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
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-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-05-19Fix T76865: Vertex paint draws hidden but cannot be painted ontoCampbell Barton
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-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-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
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-08-30Sculpt: New brush cursor, active vertex and normal radiusPablo Dobarro
This commit includes the new brush cursor, active vertex updates and the normal radius brush property for all sculpt brushes. -The new brush cursor previews the real stroke radius over the mesh and the sampled sculpt normal. -The active vertex is used in sculpt tools and brushes as a starting point for an operation, similar to a preselection. It is also mirrored following the enabled symmetry options to preview the stroke symmetry. -The normal radius brush property limits the radius that is going to be used to sample the sculpt normal and area center. It controls how closely the cursor follows the surface and it improves the behavior of most brushes, making them suitable for hard surface sculpting. Reviewed By: campbellbarton, brecht Differential Revision: https://developer.blender.org/D3594
2019-08-04Sculpting: Remove Show Diffuse Color OptionYour Name
This should have been removed in 2.80 as the functionality was removed. This feature now does not do anything and can be removed. Differential Revision: https://developer.blender.org/D5411
2019-06-17Fix T65620: Sculpting brush size jumping.mano-wii
The PBVHs raycast function calls `isect_ray_tri_epsilon_v3` with epsilon `0.1` which is inaccurate and may result in the problem presented in T65620. The solution is to use `isect_ray_tri_watertight_v3` instead `isect_ray_tri_epsilon_v3`. This can positively affect other areas as well. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5083
2019-04-23Workbench: Support Active Vertex ColorJeroen Bakker
Currently it is not possible to view the vertex colors of an object. To optimize the workflow, workbench will need to support Vertex Colors. The Vertex Colors is a new option in `shading->color_type`. When objects do not have vertex color, the objects will be rendered with the `V3D_SHADING_OBJECT_COLOR`. In order to support vertex colors in workbench the current texture/solid shading structure is migrated to a primary shaders and fallback shaders. Fix: T57000 Reviewers: brecht, fclem Differential Revision: https://developer.blender.org/D4694
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-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-15Cleanup: commas at the end of enumsCampbell Barton
Without this clang-format may wrap them onto a single line.
2018-09-11Followup for previous PBVH commitSergey Sharybin
Didn't realize the index buffer is stored once in a BVH and same pointer is reused. Surprisingly, simple files were fixed with the previous fix. Now disabled the optimization all together, and it was simpler to just completely remove all residue of the code. It is likely to be a different implementation anyway, so no need to try to keep code in a semi-broken state.
2018-08-31Remove CCGDM from PBVHSergey Sharybin
The statement that PBVH needs to keep track of CCGDM is wrong, PBVH itself does not care about CCGDM at all, and it's weird for it to carry on this beast so others can access. Even more, nobody will actually caring about CCGDM itself, all the usages were checking whether there is CCGDM or not. This is as good as simply checking PBVH type. Tested with an original report T53551 and everything is still stable.
2018-01-15Sculpting: Sdd an option to hide mask in viewportSergey Sharybin
Brushes themselves are still affected by the mask, but the viewport is not showing the mask. This way it's easier to see details while sculpting. Studio request by Julien Kaspar
2017-10-05Vertex Paint: apply when cursor isn't over facesCampbell Barton
This behavior makes more sense for sculpt, less so for painting. Restores non PBVH behavior, adding `BKE_pbvh_find_nearest_to_ray` - similar to ray-cast except it finds the closest point on the surface.
2017-10-05Cleanup: rename dist -> depthCampbell Barton
Prepare to add code that stores distance to the ray, avoid confusion.
2017-09-27Vertex/Weight Paint: Use PBVH for paintingCampbell Barton
2016 GSOC project by @nathanvollmer, see D2150 - Mirrored painting and radial symmetry, like in sculpt mode. - Volume based splash prevention, which avoids painting vertices far away from the 3D brush location. - Normal based splash prevention, which avoids painting vertices with normals opposite the normal at the 3D brush location. - Blur mode now uses a nearest neighbor average. - Average mode, which averages the color/weight of the vertices within the brush - Smudge mode, which pulls the colors/weights along the direction of the brush - RGB^2 color blending, which gives a more accurate blend between two colors - multithreading support. (PBVH leaves are painted in parallel.) - Foreground/background color picker in vertex paint
2016-07-06Cleanup: redundant 4th index in sculpt PBVHCampbell Barton
Since moving to MLoopTri this is no longer needed.
2016-06-02Fix T47637: Multiple multires objects in Sculpt mode make blender crash.Bastien Montagne
That was a nice and funny hunt, albeit rather time consumming! To summarize, so far code was using a static global gpu_buffer for pbvh vbo drawing of 'grid' types (multires mostly?). There were two issues here: 1) Global gpu buffer was assigned to GPU_PBVH_Buffers->index_buf, but then nearly no check was done when freeing that buffer, to ensure we were not freeing the global one (not totally sure this one was actually causing any issue, but was bad and unsafe anyway). Was solved by adding a flag to GPU_PBVH_Buffers to indicate when we are using some 'common' buffer here, which freeing is handled separately. 2) Main issue: if several multires objects in sculpt mode with different grid size were present simultaneously, the global gpu buffer had to be resized for each object draw (i.e., freed and re-allocated), but then the pbvh nodes from other objects storing freed reference to that global buffer had no way to know that it had been freed, which was causing the segfault & crash. Was solved by getting rid of that global buffer, and instead allocating one 'grid_commmon_gpu_buffer' per pbvh. Told ya baby, globals are *PURE EVIL*!
2015-07-16Split ray_face_intersection into quad/tri versionsCampbell Barton
Since many callers only need a single triangle
2015-07-16Add tessellation data to DerivedMesh (LoopTri)Campbell Barton
This stores loop indices into the loop array giving easier acess to data such as vertex-colors and UV's, removing the need to store an MFace duplicate of custom-data. This doesn't yet move all internal code from MFace to LoopTri just yet. Only applies to: - opengl drawing - sculpting (pbvh) - vertex/weight paint Thanks to @psy-fi for review, fixes and improvements to drawing!
2015-07-11Use const for sculpt varsCampbell Barton
resolves building with gcc4.9
2015-07-10Cleanup: use const for mesh functionsCampbell Barton
2015-05-27Fix T44745 non manifold edges of mesh do not work when smoothing inAntony Riakiotakis
multires. Code had special guards for such edges to stop this from happening. I don't see why this is needed though since code above assigns smoothed positions for all vertices in the grid. After removing the guards I saw that this in fact was the only place where grd adjacency was used, so I completely removed it.
2015-04-25Cleanup: use 8 space indent for multi-line argsCampbell Barton
2014-04-17Refactor to Dyntopo node customdata commit.Antony Riakiotakis
Don't use a dedicated node layer but use temporary int layer instead. Works like a charm as long as we are careful resetting the layer when needed (after pbvh clearing and always after bmesh has been filled in undo) Tip by Campbell, thanks!
2014-04-16Dyntopo:Antony Riakiotakis
Store PBVH node ID in CustomData. This avoids a number of hash deletions and checks/insertions on big hashes.
2014-04-11Code cleanup: use boolCampbell Barton
2014-04-08Dyntopo: replace GHash with GSet, saves some memoryCampbell Barton
2014-03-24Code cleanup: styleCampbell Barton
2014-03-23Detail sampling operatorAntony Riakiotakis
Located on topology panel. To use just click on button and click on mesh. Operator will just use the dimensions of the triangles below to set the constant detail setting. Also changed pair of scale/detail size with nice separate float percentage value.
2014-02-03Code cleanup: use bools where possibleCampbell Barton
2014-01-03Code clean-up change naming of gpu buffers used by pbvh to betterAntony Riakiotakis
reflect that. Previous name GPU_Buffers was very similar to GPU_Buffer, renamed to GPU_PBVH_Buffers
2013-09-18style cleanupCampbell Barton
2013-09-12code cleanup: headers - doxy comments.Campbell Barton
2013-08-26replace hashes with sets where possible.Campbell Barton
2013-07-23remove the pointer from BLI_bitmap's typedef, Campbell Barton
hides that an arg passed is really an array which may be modified by other functions.
2012-12-31add ".hh" as an extension for source scripts.Campbell Barton
2012-12-30Add dynamic topology support to the PBVHNicholas Bishop
* Add BLI_pbvh_build_bmesh(), similar to the other PBVH builders but specialized for BMesh. Whereas the PBVH leaf nodes for mesh and grids only store a start-index and count into the primitive indices array, the BMesh version uses GHashes to store the full set of faces and vertices in leaf nodes * Update PBVH iterator to handle BMesh * Make some of the pbvh.c functions non-static so they can be used by the new pbvh_bmesh code * The BLI_pbvh_bmesh_update_topology() function is the main reason for adding BMesh support to the PBVH. This function is used during a sculpt stroke to dynamically collapse edges that are particular short and subdivide edges that are particularly long.
2012-12-30Move layer displacements from SculptUndoNode to PBVHNodeNicholas Bishop
* This doesn't make much difference for regular mesh/multires sculpting, but for dynamic topology sculpting the undo stack isn't split up by PBVH nodes, so it's more convenient to store the layer data in PBVH nodes. * Note that the life cycle of the layer displacement data is unchanged -- it's only valid during a stroke with the layer brush, gets free'd when the undo step ends.
2012-12-30Code cleanup: move PBVH/PBVHNode structs into new header fileNicholas Bishop