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
2021-03-13Cleanup: add BKE_pbvh_vertex_iter_begin to clang-formatPablo Dobarro
Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10707
2021-01-05Fix T79146: Sculpt Mode lags until the entire mesh is visiblePablo Dobarro
This was caused when the BKE_pbvh_draw_cb function was used with update_only_visible set to false. In that case, all nodes with the flag were updating, but the update flag was only cleared for visible nodes. This was causing constant updates per redraw in no visible nodes until they enter the view frustum and their flag was cleared. In order to fix this and prevent it from happening again: - Updating the buffers, flushing the updates and clearing the flags are now part of the same function. It does not make sense to do these in separate places. - The BKE_pbvh_draw_cb function was refactored so the pbvh_update_draw_buffers is only called once. It should now be easier to understand what the function does when it is used to update only visible nodes or all nodes. Reviewed By: mont29 Maniphest Tasks: T79146 Differential Revision: https://developer.blender.org/D9935
2020-12-01UI: Add Sculpt Session info to statsPablo Dobarro
This adds the vertex and face count info to the scene stats in sculpt mode. These stats count the active vertices and faces in the sculptsession for the active object. This has the following advantages: - It is possible to know how many vertices the sculptsession has active comparted to the vertex count of the entire scene from sculpt mode - When sculpting with constructive modifiers, these stats will report the number of vertices that you can actually sculpt with, instead of the vertex count of the modified mesh and the entire scene. Reviewed By: sergey, dbystedt Differential Revision: https://developer.blender.org/D9623
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-07Cleanup: Blenkernel, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes.
2020-08-05Sculpt: Use vertices instead of faces to limit the grids in each PBVH nodePablo Dobarro
This uses the vertices per grid instead of quads to set the limit of grids per PBVH Node. This should create more leaf nodes in lower subdivisions levels where the duplicates count is high, producing more uniform performance across different levels. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8454
2020-07-13Clang Tidy: enable readability-non-const-parameter warningJacques Lucke
Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199
2020-07-09Sculpt: Skip fully hidden nodes in sculpt toolsPablo Dobarro
As tools iterators skip not visible vertices, fully hidden nodes can also be skipped and considered as masked. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8244
2020-07-09Fix wrong upate flag when updating the PBVH visibilityPablo Dobarro
This function was using the wrong flag to update the visibility state of the nodes, so I assume that most of the partially visible optimizations were not working. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8243
2020-06-23Sculpt Vertex Colors: Initial implementationPablo Dobarro
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time. This commit includes: - SCULPT_UNDO_COLOR for undo support in sculpt mode - SCULPT_UPDATE_COLOR and PBVH flags and rendering - Sculpt Color API functions - Sculpt capability for sculpt tools (only enabled in the Paint Brush for now) - Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint) - Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint) - Remesher reprojection in the Voxel Remehser - Paint Brush and Smear Brush with color smoothing in alt-smooth mode - Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors - Color Filter - Color picker (uses S shortcut, replaces smooth) - Color selector in the top bar Reviewed By: brecht Maniphest Tasks: T72866 Differential Revision: https://developer.blender.org/D5975
2020-06-02Fix T76776: Implement vertex_visibility_get for PBVH_GRIDSPablo Dobarro
This was missing from when Face Sets were enabled in Multires, so it was always considering that all vertices in the grids are visible. This should also fix other unreported bugs. Reviewed By: sergey Maniphest Tasks: T76776 Differential Revision: https://developer.blender.org/D7809
2020-06-02Cleanup: Always use pbvh in PBVH BKE filesPablo Dobarro
Reviewed By: sergey Differential Revision: https://developer.blender.org/D7889
2020-05-19Merge branch 'blender-v2.83-release'Philipp Oeser
2020-05-19Fix T76865: Vertex paint draws hidden but cannot be painted ontoCampbell Barton
2020-05-14Merge branch 'blender-v2.83-release'Pablo Dobarro
2020-05-14Sculpt: Render Face Sets always as flat shadingPablo Dobarro
This removes the smooth shading rendering from the face set overlay when smooth shading is enabled. Reviewed By: jbakker Maniphest Tasks: T74906, T74622, T75331, T76530 Differential Revision: https://developer.blender.org/D7105
2020-05-14Merge branch 'blender-v2.83-release'Jeroen Bakker
2020-05-14Fix T75908: Sculpt GPU Batches + Render ArtifactsJeroen Bakker
When sculpting the GPU batches are constructed with only the required data for a single viewport. When that viewport changes shading or coloring mode (object to vertex) batches might not hold all the needed information. There is also a case when you have two 3d viewport one in object color mode and the other in vertex color mode that the GPU batches were updated without any vertex colors. In order to fix these category of issues this patch would always construct the full GPU batches for sculpting. Reviewed By: Clément Foucault, Pablo Dobarro Maniphest Tasks: T75908 Differential Revision: https://developer.blender.org/D7701
2020-05-13Merge branch 'blender-v2.83-release'Pablo Dobarro
2020-05-13Fix T75968: PBVH raycast returns wrong active vertexPablo Dobarro
nearest_vertex_co was not reset when a new triangle was intersected by the ray, so it was always returning the closest vertex to the real cursor position in any triangle, which was not always the triangle under the cursor. Reviewed By: sergey Maniphest Tasks: T75968 Differential Revision: https://developer.blender.org/D7485
2020-05-09Cleanup: double-spaces in commentsCampbell Barton
2020-04-30Task: Use TBB as Task SchedulerBrecht Van Lommel
This patch enables TBB as the default task scheduler. TBB stands for Threading Building Blocks and is developed by Intel. The library contains several threading patters. This patch maps blenders BLI_task_* function to their counterpart. After this patch we can add more patterns. A promising one is TBB:graph that can be used for depsgraph, draw manager and compositor. Performance changes depends on the actual hardware. It was tested on different hardwares from laptops to workstations and we didn't detected any downgrade of the performance. * Linux Xeon E5-2699 v4 got FPS boost from 12 to 17 using Spring's 04_010_A.anim.blend. * AMD Ryzen Threadripper 2990WX 32-Core Animation playback goes from 9.5-10.5 FPS to 13.0-14.0 FPS on Agent 327 , 10_03_B.anim.blend. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D7475
2020-04-22Cleanup: Spelling in function nameSergey Sharybin
Should be no functional changes.
2020-04-20Fix T75329: Missing show_face_sets checks for MultiresPablo Dobarro
These values were hardcoded before Face Sets were enabled for Multires, so enable the show_face_sets checks now. Reviewed By: jbakker Maniphest Tasks: T75329 Differential Revision: https://developer.blender.org/D7444
2020-04-14Sculpt: New Layer BrushPablo Dobarro
The Layer brush was in Blender before 2.81, when the sculpt API was introduced. It had a huge amount of bugs and glitches which made it almost unusable for anything but the most trivial cases. Also, it needed some hacks in the code just to support the persistent base. The brush was completely rewritten using the Sculpt API. It fulfills the same use case as the old one, but it has: - All previous artifacts fixed - Simpler code - Persistent base now works with multires thanks to the sculpt API - Small cursor widget to preview the layer height - More controllable and smoother strength and deformation - More correct masking support - More predictable invert support. When using persistent base, the brush invert mode resets to layer height 0, instead of jumping from +1 to -1. The brush can still be inverted in the brush direction property. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7147
2020-04-02Sculpt: Delay Viewport UpdatesPablo Dobarro
In Blender 2.81 we update and draw all nodes inside the view planes. When navigating with a pen tablet after an operation that tags the whole mesh to update (like undo or inverting the mask), this introduces some lag as nodes are updating when they enter the view. The viewport is not fully responsive again until all nodes have entered the view after the operation. This commit delays nodes updates until the view navigation stops, so the viewport navigation is always fully responsive. This introduces some artifacts while navigating, so it can be disabled if you don't want to see them. I'm storing the update planes in the PBVH. This way I can add support for some tools to update in real-time only the nodes inside this plane while running the operator, like the mesh filter. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6269
2020-04-02Fix Face Sets painting and selection precisionPablo Dobarro
This fixes the following issues: - Previously, the face set from the active vertex was used directly. Vertices always return the most recently created face set, so in some cases there may be some face sets that were not possible to select as active. Now the active face set is set in the ray intersection, so it always matches the face under the cursor. - When drawing face sets they were set per vertex, so it was not possible to paint one face at a time. Now face sets are painted per poly when using the brush on meshes, testing the distance to the center of each poly. - The code for the active vertex on PBVH_GRIDS was not correct, so I also fixed that to test if everything was working correctly. {F8441699} Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7303
2020-04-01Multires: Initial Face Sets supportPablo Dobarro
This implements the Sculpt Mode API functions needed for Face Sets and visibility management for PBVH_GRIDS. No major changes were needed in the operators and the sculpt mode code. This implementation stores the face sets in the base mesh, so faces created in higher subdivision levels can't be modified individually. Also, we are not checking for multiple face sets per vertex (that can be added in the future), so relax tools don't work yet. The rest of the features (paint, undo, visibility operators..) work as expected. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7168
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-09Face Sets: Use white color for a default Face Set to enable the overlayPablo Dobarro
This introduces a variable to store a face set ID which is going to be rendered white. When initializing a mesh or randomizing the colors, this variable gets updated to always render a white face set. This way the face set overlay can be enabled without adding colors to the mesh if face sets are not in use. After creating the first face set, new colors are generated randomly like usual. The face set stored as default does not have any special meaning for tools or brushes, it just affects the rendering color. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7035
2020-03-05Sculpt Face SetsPablo Dobarro
Face Sets are the new system to control the visibility state of the mesh in sculpt and paint modes. They are designed to work in modes where brushes are the primary way of interaction and they provide much more control when working with meshes with complex shapes and overlapping surfaces. This initial commit includes: - Sculpt Face Sets data structures and PBVH rendering. - Face Set overlay and opacity controls. - Sculpt Undo support. - Remesher reprojection support. The visibility state of the mesh is also preserved when remeshing. - Automasking and Mesh filter support. - Mask expand operator mode to expand Face Sets (Shift + W) and flood fill areas by connectivity (press Ctrl while expanding). - Sculpt Mode Face Sets and Visibility API. - Sculpt Face Sets creation and visibility management operators. - Operator to randomize the Face Sets colors. - Draw Face Sets brush tool to create and edit the Face Sets. Drawing on the mesh creates a new Face Set. Pressing Ctrl before drawing modifies the Face Set under the brush at the beginning of the stroke. - Updated keymap and menu to work with Face Sets from Sculpt Mode (H to toggle visibility, Alt + H to show all, Shit + H to hide). - Pie menu on the W key with Face common Sets operations. Know limitations: - Multires support. The Face Sets and Visibility API needs to be implemented for Multires. Reviewed By: jbakker, #user_interface, Severin Differential Revision: https://developer.blender.org/D6070
2020-02-28Fix wrong coordinates being read when using the sculpt APIPablo Dobarro
The coordinates should be read from the PBVH when using deform modifiers. This is needed for the cloth brush to work with subdivisions, as it reads the vertex coordinates using this function when building and updating the constraints. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6967
2020-02-26Cleanup: format, unused varCampbell Barton
2020-02-25Fix T72721: Add visibility flags updates to the PBVHPablo Dobarro
Currently, there its a function that sets manually the fully_hidden flag of the nodes from the visibility operators in paint_hide.c. The undo code was not updating the flag, so the visibility state of the nodes was incorrect after preforming undo operations. This sometimes was drawing fully hidden nodes with empty buffers, causing artifacts in the geometry. I added a function to mark nodes which visibility state changed (similar as we are updating the mask flags and the nodes bounding boxes). This way, the tools, operators and undo code don't have to update the visibility flags, making everything much simpler to understand and maintain. I did not remove the flag update code from the current visibility operators in this patch, but after reimplementing them (and all the new ones) in the new visibility system, all visibility updates should be done using this method and the BKE_pbvh_node_fully_hidden_set function should be removed. Reviewed By: jbakker Maniphest Tasks: T72721 Differential Revision: https://developer.blender.org/D6767
2020-02-07Cleanup: use of 'unsigned'Campbell Barton
- Replace 'unsigned' used on it's own with 'uint'. - Replace 'unsigned const char' with 'const uchar'.
2020-01-14Fix T73094: Check all vertices when recalculating the mask flagsPablo Dobarro
When a node was partially/fully hidden, this was causing the mask flags to update incorrectly because it was not checking all vertices, so they were assigned the fully_masked state and not updating in the transform tool and mesh filter. Reviewed By: jbakker Maniphest Tasks: T73094 Differential Revision: https://developer.blender.org/D6573
2019-10-10Sculpt: use TBB instead of BLI_task for multithreadingBrecht Van Lommel
This solves performance issues on some computers where there is significant threading overhead. Rather than doing the complicated work of optimizing our own task scheduler, use TBB which appears to work well. The downside is that we have another thread pool, but it is already there when using OpenVDB voxel remesh. For future releases we can switch to using TBB to replace our task scheduler implementation entirely, and use the same thread pool for BLI_task, Cycles, Mantaflow, etc. Differential Revision: https://developer.blender.org/D6030
2019-10-09Sculpt: Fix wireframe drawingPablo Dobarro
With this commit sculpt mode draws the real mesh wireframe instead of the triangulated version by ignoring non real edges when building the PBVH GPU buffers Reviewed By: brecht Differential Revision: https://developer.blender.org/D6032
2019-10-08Fix multires sculpt not setting the active vertex correctlyBrecht Van Lommel
Also cleanup code to remove duplicated min_depth tracking, ray intersection already does it.
2019-10-01Cleanup: internal sculpt refactoring related to multires, no user visible ↵Brecht Van Lommel
changes
2019-10-01Cleanup: slightly more efficient access to PBVH multires grid keyBrecht Van Lommel
2019-09-30PBVH: PBVH_FullyMasked and PBVH_FullyUnmasked flagsPablo Dobarro
This commit introduces flags to tag the PBVH nodes as fully masked or unmasked. This is used in do_brush_actions to filter fully masked nodes during a stroke. Other tools can also be updated to use this flags. Sculpt updates now require a flag to update the mask or the vertex coordinates. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5935
2019-09-29Fix small memory leaks in some sculpt toolsBrecht Van Lommel
Also use MEM_SAFE_FREE to simplify code.
2019-09-29Sculpt: minor optimizations for GPU draw buffer fillingBrecht Van Lommel
Ref T70295
2019-09-29Sculpt: only update draw buffers for visible nodes during paint strokeBrecht Van Lommel
Also applies to some other sculpt tools like filter and mask expand. The full update happens after the paint stroke is finished, so it does not happen on view navigation, which would cause a delay. Ref T70295 Differential Revision: https://developer.blender.org/D5922
2019-09-29Sculpt: multithread GPU draw buffer filling for workbenchBrecht Van Lommel
This improves performance of some sculpt tools, particularly those that modify many vertices like filter and mask tools, or use brushes with large radius. For mask expand it can make updates up to 2x faster on heavy meshes, but for most tools it's more on the order of 1-1.1x. There are bigger bottlenecks to solve, like normal updates. Ref T70295 Differential Revision: https://developer.blender.org/D5926
2019-09-29Sculpt: use dynamic scheduling and chunk size 1 for multithreadingBrecht Van Lommel
This is under the assumptions that each node has enough work to avoid the threading overhead, while also having a possible variable amount of work. For example most of the vertices being masked or outside of the brush radius. Improves performance by about 10% for tools like mesh filter on an entire 3 million poly mesh, tested on a quad core. Ref T68873
2019-09-29Cleanup: move sculpt parallel range threading test into functionBrecht Van Lommel
Easier to experiment with different settings this way.