Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-10Cleanup: Move sculpt.c to C++Hans Goudey
2022-09-29Cleanup: run clang-format in sculpt codeJoseph Eagar
2022-09-29Sculpt: Normal-based automasking modesJoseph Eagar
Two new normal-based automasking modes. The first mode, "brush", compares vertex normals with the initial normal at the beginning of the brush stroke. The second, "view", compares vertex normals with the view normal. If "occlusion" is on then rays will be shot from each vertex to test if it is occluded by other geometry (note: this can be very slow).\ Only geometry inside the sculpt mesh is considered. Each mode has an associated angular limit and a falloff. Reviewed by: Julien Kaspar and Jeroen Bakker Differential Revision: https://developer.blender.org/D15297 Ref D15297
2022-08-16Cleanup: spelling in commentsCampbell Barton
2022-08-16Sculpt: Fix redo panel bugsJoseph Eagar
SCULPT_undo_push_begin no longer takes an explicit name. Instead it takes a wmOperator pointer and uses op->type->name for the name. This is necassary for the redo panel to work and should fix the entire class of bugs related to misspelled undo push names. Cases where the calling operator is not registered may use SCULPT_undo_push_begin_ex if desired; it takes a name string as before.
2022-06-16Cleanup: differentiate region/screen relative coordinatesCampbell Barton
- Avoid ambiguity which caused these values to be confused, use `mval` for region relative mouse coordinates, otherwise `event_xy`. - Pass region relative coordinates to sample_detail_dyntopo & sample_detail_voxel as there is no reason to use screen-space values. - Rename invalid use of mval for screen-space coordinates.
2022-04-15PBVH Pixel extractor.Jeroen Bakker
This patch contains an initial pixel extractor for PBVH and an initial paint brush implementation. PBVH is an accelleration structure blender uses internally to speed up 3d painting operations. At this moment it is extensively used by sculpt, vertex painting and weight painting. For the 3d texturing brush we will be using the PBVH for texture painting. Currently PBVH is organized to work on geometry (vertices, polygons and triangles). For texture painting this should be extended it to use pixels. {F12995467} Screen recording has been done on a Mac Mini with a 6 core 3.3 GHZ Intel processor. # Scope This patch only contains an extending uv seams to fix uv seams. This is not actually we want, but was easy to add to make the brush usable. Pixels are places in the PBVH_Leaf nodes. We want to introduce a special node for pixels, but that will be done in a separate patch to keep the code review small. This reduces the painting performance when using low and medium poly assets. In workbench textures aren't forced to be shown. For now use Material/Rendered view. # Rasterization process The rasterization process will generate the pixel information for a leaf node. In the future those leaf nodes will be split up into multiple leaf nodes to increase the performance when there isn't enough geometry. For this patch this was left out of scope. In order to do so every polygon should be uniquely assigned to a leaf node. For each leaf node for each polygon If polygon not assigned assign polygon to node. Polygons are to complicated to be used directly we have to split the polygons into triangles. For each leaf node for each polygon extract triangles from polygon. The list of triangles can be stored inside the leaf node. The list of polygons aren't needed anymore. Each triangle has: poly_index. vert_indices delta barycentric coordinate between x steps. Each triangle is rasterized in rows. Sequential pixels (in uv space) are stored in a single structure. image position barycentric coordinate of the first pixel number of pixels triangle index inside the leaf node. During the performed experiments we used a fairly simple rasterization process by finding the UV bounds of an triangle and calculate the barycentric coordinates per pixel inside the bounds. Even for complex models and huge images this process is normally finished within 0.5 second. It could be that we want to change this algorithm to reduce hickups when nodes are initialized during a stroke. Reviewed By: brecht Maniphest Tasks: T96710 Differential Revision: https://developer.blender.org/D14504
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-02-11Fix T83013: Annotation with hidden object in sculpt mode crashesCampbell Barton
This just avoids the crash, the annotation tool still doesn't work. Larger changes will be needed to resolve this, see T85532.
2020-09-03Sculpt: Face Set Extract OperatorPablo Dobarro
This implements a Face Set Extract operator, which is similar to mask extract. This operator uses a picker to select and Face Set in the mesh and extract the geometry directly to a new object. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8599
2020-08-18Fix Mask Slice deleting the Face SetsPablo Dobarro
This was a TODO in the code. Previously the Face Set datalayer was deleted and recreated with a constant ID of 0. Now the datalayer is preserved and set to the SculptSession after slicing the mask and a new ID is calculated for the new faces that the slicing operation produced, so they can be easily isolated for further tweaking. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8583
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-04-14Sculpt: Implement undo of Apply Base during sculpt sessionSergey Sharybin
The idea is to push both base mesh geometry and PBVH coordinates so it is possible to undo everything without loosing data which was not flushed from sculpt session to base mesh. It is possible do memory optimization to avoid push custom data layers which are not touched by operator, but before doing that better to ensure this is a correct and working approach. Differential Revision: https://developer.blender.org/D7381
2020-03-06Cleanup: Rename ARegion variables from ar to regionJulian Eisel
The old convention was easy to confuse with ScrArea. Part of https://developer.blender.org/T74432. This is mostly a batch rename with some manual fixing. Only single word variable names are changed, no prefixed/suffixed names. Brecht van Lommel and Campbell Barton both gave me a green light for this convention change. Also ran clan clang format on affected files.
2020-03-02Cleanup: make remaining editor include headers work in C++Jacques Lucke
2019-11-18Fix wrong name for QuadriFlow undo stepCampbell Barton
2019-09-11Sculpt: Transform toolPablo Dobarro
The sculpt mode transform tool applies the sculpt pivot transformation to all vertices, taking XYZ symmetry into account. This commit also includes an operator to set the pivot point initial position. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5717
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-08-14OpenVDB: Voxel RemesherPablo Dobarro
The voxel remesher introduces a new workflow for sculpting without any of the limitations of Dyntopo (no geometry errors or performance penalty when blocking shapes). It is also useful for simulations and 3D printing. This commit includes: - Voxel remesh operator, voxel size mesh property and general remesh flags. - Paint mask reprojection. - Geometry undo/redo for sculpt mode. This should support remesh operations as well as future tools that modify the topology of the sculpt in a single step, like trimming tools or mesh insert brushes. - UI changes in the sculpt topbar and the mesh properties pannel. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5407
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-263D View: move deselect all logic into an optionCampbell Barton
This removes `VIEW3D_OT_select_or_deselect_all`, adding a deselect_all option to the `VIEW3D_OT_select` operator. - Add utility functions to simplify de-selecting all. - Return true from selection functions when they change the selection to avoid redundant updates. - Use arrays of bases when passing objects between selection utility functions since some users require bases. - Fix logical error in box selection that updated all objects after the first hit.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-08-143D View boarder/lasso select tool optionsCampbell Barton
Add tool options to control how select operates (add/sub/set/and/xor). Note: edit mode armature select still needs to support all options, this is complicated by how it handles partial end-point selection.
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-04-01Merge branch 'master' into blender2.8Campbell Barton
- Undo that changes modes currently asserts, since undo is now screen data. Most likely we will change how object mode and workspaces work since it's not practical/maintainable at the moment. - Removed view_layer from particle settings (wasn't needed and complicated undo).
2018-03-31Undo: unified undo system w/ linear historyCampbell Barton
- Use a single undo history for all operations. - UndoType's are registered and poll the context to check if they should be used when performing an undo push. - Mode switching is used to ensure the state is correct before undo data is restored. - Some undo types accumulate changes (image & text editing) others store the state multiple times (with de-duplication). This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`. - Each undo step stores ID datablocks they use with utilities to help manage restoring correct ID's. Needed since global undo is now mixed with other modes undo. - Currently performs each undo step when going up/down history Previously this wasn't done, making history fail in some cases. This can be optimized to skip some combinations of undo steps. grease-pencil is an exception which has not been updated since it integrates undo into the draw-session. See D3113
2017-02-26OpenGL: replace gluProject and gluUnProject, and simplify surrounding code.Brecht Van Lommel
Part of T49042.
2015-03-28Cleanup: redundant struct declarationsCampbell Barton
2014-12-29Move average stroke from sculpt session to unified paint settings so itAntony Riakiotakis
can be reused by other paint systems too.
2014-12-29Cleanup: get rid of sculpt minmax and reuse last stroke function (codeAntony Riakiotakis
did that anyway, just kept the result in an intermediate variable)
2014-06-23Add ED_paint.h, split out ED_sculpt.hCampbell Barton
also rename some functions to match our convention
2014-05-29Add notifiers and reuse update calls for flood fill operatorsAntony Riakiotakis
2014-05-13Fix T39196, Dynamic Topology Undo Applied to Wrong MeshAntony Riakiotakis
Undoing nodes that do not belong to the current object will cause the saved bmesh log entry to be reverted instead. This entry can belong to another object though. This is easy to fix by enforcing name matching (this was borrowed by edit mode but can definitely be improved) between current object name and undo node name and deleting older entries. However there are complications. Deleting dyntopo entries in this way can leave a brush stroke as first dyntopo log entry. This can present issues if we attempt to delete that entry since it's deleted mesh elements may now have had their ids (which would still be valid at the time) cleaned up. This can result in crashing if we attempt to resculpt on the mesh. To fix this I have disabled releasing the deleted entries. This entanglement between bm_log and undo is quite volatile but I hope the system works better now. Also minor cleanup, fix unneeded check warning
2014-05-07Fix issue discovered while investigating T39950:Antony Riakiotakis
Sculpt mode drawing fails after deleting a subsurf modifier in sculpt mode and undoing. This was quite difficult to spot. Main cause was that mesh data was not synchronized properly between undo and sculpt code because we generated a pbvh on derivedmesh invalidation without really refreshing the rest of the data. This could result in undo and drawing operating on different data. To solve this and avoid bad level calls I had to move quite some code around. Crazyspace is now moved to blenkernel, as did some sculpt calls that make sure sculpt data are properly refreshed.
2014-04-07Code cleanup: remove unused functions and convert int -> boolCampbell Barton
2014-03-14Fix T39156 part 2: Add support for image paint operations in undoAntony Riakiotakis
history operator (Ctrl + Alt + Z). This will only show paint operations now while in an image paint mode. The caveat is that user can delete previous paint operations too (even on images not on the canvas currently) so it needs some care. This is consistent with regular undo behaviour though. Sculpting also suffers from lack of Undo history support, this will be added in a separate commit.
2014-01-20Fix T38269: scene full copy in mesh edit or sculpt mode did not copy mesh edits.Brecht Van Lommel
2013-12-19Fix T37387 VIEW3D_OT_view_selected in sculpt mode zooms far fromAntony Riakiotakis
sculpted object if last sculpt stroke ends outside the mesh. Code here used the last true location which is invalid in that case, just reuse the average stroke location instead.
2013-12-08Fix T37326 inversion of image channels did not do an undo push. Now only do ↵Antony Riakiotakis
an undo if we are in image paint mode and use the paint undo stack. Also added missing GPU update.:
2013-10-27Border select for sculpting, using B shortcut, warmup for more advancedAntony Riakiotakis
masking, like lasso selection.
2013-04-19Fix #34818: Sculpting Mode only rotates around geometry origin (bring bug back)Sergey Sharybin
Made it so average coordinate of previous stroke is used as a viewport rotation center when Rotate Around Selection is enabled in user preferences.
2012-10-01mask data is no longer automatically added when sculpting (except when there ↵Campbell Barton
is a multi-res modifier).
2012-05-13code cleanup: missed some min/max use of float[3], also found case of ↵Campbell Barton
DO_MIN/MAX re-reading same value from array 4 times when it can do once (use minf rather then MIN2, same for maxf)
2012-05-11style cleanup: mainly sculpt/whitespaceCampbell Barton