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-18Sculpt: Enable Cloth Simulation Target for Pose and BoundaryPablo Dobarro
This adds a new brush property called "Deformation Target" which controls how the brush deformations is going to affect the mesh data. By default is set to Geometry, which makes the brushes displace the vertices. When set to Cloth Simulation, the deformation of the brush is applied to the cloth solver constraints, so the simulation is responsible to apply the final deformation. This allows to add cloth simulation effects to other sculpt tools with minor modifications to their code. This patch enables Cloth Simulation deformation target for Pose and Boundary brushes, which are tools that are already designed to work in low poly counts and produce large deformations. This allows creating the most common cloth effects, like bending and compressing folds, without relying on collisions. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8578
2020-08-18Sculpt: Erase Displacement Mesh FilterPablo Dobarro
Same concept as the Multires Displacement Eraser Brush but implemented as a mesh Filter. This allows to delete the displacement of an entire area uniformly. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8608
2020-08-18Sculpt: Enhance Details Mesh FilterPablo Dobarro
Exact same operation as D8509, implemented as a Mesh Filter. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8510
2020-08-18Sculpt: Invert Smooth to Enhance DetailsPablo Dobarro
This enables the invert mode in the smooth brush as Enhance Details. The operation is similar to the Sharpen Filter intensify details parameter, which consist in applying the laplacian smooth displacement in the opposite direction calculated using the original coordinates. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8509
2020-08-18Sculpt: Sculpt Filter Orientation OptionsPablo Dobarro
Previously, the XYZ deform axis of the Mesh Filter were limited to object space (which is the default for sculpt mode). Now it is possible to limit the XYZ displacement in Local, Global or View space. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8582
2020-08-18Sculpt: Option to limit the forces axis in the Cloth FilterPablo Dobarro
This uses the same concept of the Mesh Filter but for applying the cloth filter forces, so now it can be limited to a specific axis. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8567
2020-08-18Cleanup: rename bdata to boundaryPablo Dobarro
Reviewed By: sergey Differential Revision: https://developer.blender.org/D8556
2020-08-18Sculpt: Expose the functions to create and init a SculptClothSimulationPablo Dobarro
This will be used for new features like supporting cloth deformation in other brushes and tools outside of the cloth brush code. No functional changes. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8602
2020-08-17Cleanup: spellingCampbell Barton
2020-08-13Sculpt: Boundary Brush Falloff Types and OffsetPablo Dobarro
This adds the boundary_falloff_type and boundary_offset to control how the falloff of the Boundary Brush is applied. Boundary Origin Offset is the same concept as the Pose Origin offset in the Pose Brush. It is a multiplier that adds extra length to the brush radius to locate the deformation pivot further from the boundary without affecting the falloff. The Falloff type includes Constant (previous default), brush radius, loop and loop and invert. Loop and Loop and Invert can be used to create deformation patterns in a mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8526
2020-08-12Sculpt: Multires Displacement Eraser BrushPablo Dobarro
This brush deletes displacement information of the Multires Modifier, resetting the mesh to the subdivision limit surface. This can be use to easily delete parts of the sculpt or to fix reprojection artifacts after applying a shrinkwrap. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8543
2020-08-12Clenaup: Rename random_access_init to random_access_ensurePablo Dobarro
Reviewed By: sergey Differential Revision: https://developer.blender.org/D8529
2020-08-10Sculpt: Boundary BrushPablo Dobarro
This brush includes a set of deformation modes designed to deform and control the shape of the mesh boundaries, which are really hard to do with regular sculpt brushes (and even in edit mode). This is useful for creating cloth assets and hard surface base meshes. The brush detects the mesh boundary closest to the active vertex and propagates the deformation using the brush falloff into the mesh. It includes bend, expand, inflate, grab and twist deform modes. The main use cases of this brush are the Bend and Expand deformation modes, which depend on a grid topology to create the best results. In order to do further adjustments and tweaks to the result of these deformation modes, the brush also includes the Inflate, Grab and Twist deformation modes, which do not depend that much on the topology. Grab and Inflate are the same operation that is implemented in the Grab and Inflate tools, they are also available in the boundary brush as producing deformations with regular brushes in these areas is very hard to control. Even if this brush can produce deformations in triangle meshes and meshes with a non-regular quad grid, the more regular and clean the topology is, the better. Most of the assets this brush is intended to deform are always created from a cylindrical or plane quad grid, so it should be fine. Also, its algorithms can be improved in future versions to handle more corner cases and topology patterns. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8356
2020-08-07Merge branch 'blender-v2.90-release' into masterJacques Lucke
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-08-06Cleanup: Paint Cursor RefactorPablo Dobarro
The paint_draw_cursor function was handling the cursor drawing for 2D and 3D views of all paint modes, calculating the brush radius, updating the SculptSession data and updating and drawing all sculpt cursor overlays for different tools. It was almost impossible to understand when and what was being drawn and in which state the GPU matrix was. Now everyting is organized into different functions, with clear separation between modes, sculpt tool overlays and different drawing setups. Update and drawing functions are also separated (this allows to skip one PBVH query on each cursor drawing). Reviewed By: sergey Differential Revision: https://developer.blender.org/D8206
2020-08-06Sculpt: Sharpen Mesh Filter curvature smoothing and intensify detailsPablo Dobarro
This adds a curvature smoothing and intensify details properties to control the result of the Sharpen Mesh Filter. Curvature smoothing removes high frequency details from the precalculated sharpen data, so the filter result has much smoother surfaces and cleaner sharpen lines; Intensify details displaces the vertices of creases and valleys in the direction opposite to its neighbors average, so it intensifies high frequency details in those areas, producing more noisy and sharp shapes: Both this properties can be used in combination to achieve a good balance of high and low frequency details depending on the shape and the desired result. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8447
2020-07-30Sculpt: Enable persistent base for the cloth brushPablo Dobarro
The cloth brush builds the constraints when the stroke starts usign the current state of the mesh. This means that deformations profuced by the simulattion will accumulate after multiple strokes as it will always start from the previous deformed state. While this is useful in many cases, for other uses it is convenient to always simulate the same initial shape, but applying different forces to it. The persistent base options work like the persistent base in the layer brush and allows the cloth brush to not accumulate deformation after each stroke. When enabled, constraints are created for the shape stored in the persistent base instead of from the current state of the mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8428
2020-07-21Sculpt: Support pen pressure modulation in Paint Brush propertiesPablo Dobarro
This allows to use pen pressure modulation in hardness, wet mix, wet persistence, flow and density, as well as inverting the modulation (more pressure, less density...). With this, it is possible to create brushes that mix paint or apply a new color based on the pressure. Reviewed By: sergey, campbellbarton Differential Revision: https://developer.blender.org/D8267
2020-07-15Fix T78747: Fix mesh boundary detection and automaskingPablo Dobarro
This issue was produced by a hack in the sculpt mode code from 2.80 when the sculpt API for connectivity info was not available. The smooth brush was the only brush that needed connectivity info, so there were 3 different smooth functions with the connectivity queries implemented for dyntopo, meshes and grids. The mesh version of smoothing was checking the number of connected faces to a vertex to mask the mesh boundaries, which was not covering all cases and was hardcoded in the smooth function itself. This patch removes all those legacy functions and unifies all smooth functions into a single one using the new API and the automasking system. In order to achieve this, there were needed some extra changes: - The smooth brush now does not automasks the boundaries by default, so its default preset needs to be updated to enable automasking - The mesh boundary info is extracted once and cached in a bitmap, similar to the disconnected elements IDs. This makes boundary detection work as expected in all cases, solving a lot of known issues with the smooth brush. In multires, this info is extracted and cached only at the base mesh level, so it is much more memory efficient than the previous automasking system. - In order to keep the brushes responsive as they were before, the automasking system can now skip creating the cache when it is not needed for the requested options. This means that for high poly meshes and simple automasking options the brushes won't lag on start. Reviewed By: sergey Maniphest Tasks: T78747 Differential Revision: https://developer.blender.org/D8260
2020-07-09Sculpt: Make Sculpt Vertex Colors features experimentalPablo Dobarro
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8239
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-02Sculpt: Mask By ColorPablo Dobarro
This tool generates masks based on the sculpt vertex colors by clicking on the model, similar to automatic selection tools in image editing software. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8157
2020-07-01Cleanup: Add functions to check the first brush step and symmetry passesPablo Dobarro
This adds three functions to check the state of the stroke in the StrokeCache, removing the references to first_time and mirror_symmetry_pass from the code. This makes easier to understand what each code path is doing inside of each tool. Some tools were using mirror_symmetry_pass incorrectly, so this should also fix unreported bugs with radial and tiling symmetry related to that. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8164
2020-06-30Sculpt: Color filter fill modePablo Dobarro
This implements a fill mode in the Color Filter tool, which fills the entire mesh with a specific color. As this functionality is part of the color filter, this allows to control the blending of the fill color with the filter strength. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8158
2020-06-30Sculpt: Pose Brush option to affect loose partsPablo Dobarro
This option allows posing meshes with different disconnected elements using the Pose Brush. This is achieved by doing the following: - Creating an ID per vertex that stores the connected component of that vertex. - By using those IDs, one fake topology connection is created per vertex to the nearest vertex in a different ID. The maximum distance to create that connection is determined by the "Max Element Distance" property. These fake connectivity neighbors are used in the Sculpt API functions iterators, so all the algorithms of the Pose Brush can run without modifications as if everything was part of the same mesh. In order to make this work, the "Connected only" property of the Pose Brush needs to be disabled. This will add an extra performance cost to the Pose Brush and its preview. To achieve optimal results, max element distance should be as low as possible. Reviewed By: sergey, campbellbarton Differential Revision: https://developer.blender.org/D7282
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-09Sculpt: Face Set Edit OperatorPablo Dobarro
This operator performs an edit operation in the active face set defined by the cursor position and updates the visibility. For now, it has a Grow and Shrink operations, similar to Select More/Less in edit mode or to the mask filter Grow/Shrink modes. More operations can be added in the future. In multires, this updates the visibility of an entire face from the base mesh at once, which makes it very convenient to edit the visible area without manipulating the face set directly. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7367
2020-06-04Fix Sharpen mesh filter in MultiresPablo Dobarro
Instead of accumulating displacement for each vertex into the neighbors, accumulate the opposite displacement from each neighbor into the vertex. I think this is the same and it does not produce artifacts in Multires. Reviewed By: sergey, brecht Differential Revision: https://developer.blender.org/D7508
2020-06-01Sculpt: Cloth FilterPablo Dobarro
This tool is similar to the cloth brush, but it applies the cloth simulation deformation to the whole mesh in an uniform way. The simulation can be controlled using the mask to pin vertices and the face sets to define force action areas. It uses the same solver as the cloth brush which now no longer depends on StrokeCache. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7857
2020-05-27Cleanup: Use bitmaps insteand of bool and char arraysPablo Dobarro
This was propsed in D7059, so I applied it to the rest of the code Reviewed By: campbellbarton, sergey Differential Revision: https://developer.blender.org/D7480
2020-05-26Merge branch 'blender-v2.83-release'Pablo Dobarro
2020-05-26Fix Cloth Brush grab deformation modePablo Dobarro
The grab mode was not correctly implemented, so the way it was working was confusing for users. - Grab delta was calculated in increments from the last stroke position, so it did not match the behavior of a grab brush. I refactored the grab delta calculation to make this change more explicit. - Grab displacement was not calculated from the original coordinates - Grab was using an incorrect strength Grab is now setting the position of the affected vertices directly and the constraints solve the rest of the cloth. I also tried to implement an alternative version based on applying forces to move the vertices to the grab position, but I think this is more controllable and the grab falloff can be adjusted by tweaking the simulation falloff. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7756
2020-05-26Fix naming in the PBVH neighbor iterator macroPablo Dobarro
The only possible name for the iterator was ni, this should fix that. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7774
2020-05-09Cleanup: double-spaces in commentsCampbell Barton
2020-05-06Cleanup: warningsCampbell Barton
2020-05-05Fix T75743: Implement restore for brushes that modify their own dataPablo Dobarro
This implements the restore function for Draw Face Sets and Layer, which don't affect coordinates or masks directly. This is needed for the anchored and dot brush strokes. Layer frees the current displacement and a new one is created on each stroke sample. Draw Face Sets copies the data back from the first undo node to the mesh datalayer. Also fixes T75727 Reviewed By: jbakker Maniphest Tasks: T75727 Differential Revision: https://developer.blender.org/D7442
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-14Sculpt: Sharpen Mesh FilterPablo Dobarro
This mesh filter sharpens and smooths the mesh based on its curvature, resulting in pinching hard edges and polishing flat surfaces. It fixes most of the artifacts of the voxel remesher and those produced when sculpting hard surfaces and stylized models with creasing and flattening brushes. It needs and accumulate_displacement step before each filter iteration which can't be multithreaded in an easy way (it would need something to sync the threads when modifying the data of neighbors in a different node), but this does not affect performance in a significant way. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7335
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-04-04Cleanup: Move Detail Operators and Dyntopo to their own filesPablo Dobarro
2020-04-03Cleanup: Move Mask Filter and Mask Expand to their own filesPablo Dobarro
2020-04-03Cleanup: Move Mesh Filter, Smooth and Automasking to their own filesPablo Dobarro
2020-04-03Cleanup: Move all sculpt transform functionality to its own filePablo Dobarro
2020-04-03Cleanup: Missing clang format in previous commitPablo Dobarro
2020-04-03Cleanup: Move all Face Set functionality to its own filePablo Dobarro
2020-04-03Fix T74205: crash cancelling transfrom operation in sculpt modeAsad-ullah Khan
Differential Revision: https://developer.blender.org/D7018
2020-04-03Cleanup: spellingCampbell Barton
2020-04-01Sculpt Undo: Refactor Geometry undo nodesSergey Sharybin
Made it so there is a single UNDO node in the list which has both original and modified mesh state. Makes it easier to achieve "interleaved" undo nodes stored in the undo step (as opposite of either storing geometry or other data). Should be no functional changes, just preparing for an upcoming work to support undo of operation like Apply Base. Differential Revision: https://developer.blender.org/D7290
2020-03-27Sculpt: Pose Brush Face Sets origin modePablo Dobarro
This commit introduces a new mode for calculating the positions and weights of the IK segments in the Pose Brush based on the Face Sets. The first segment of the chain will always include all face sets inside the brush radius and it will propagate until the boundary of the last face sets added in the flood fill. Then consecutive connected face sets are added to the chain until the chain length limit is reached or all face sets of the mesh are already part of the chain. This feature enables complete control over the pose brush origins in case that is needed. Also, with this mode, the user can have a library of base meshes with face sets already configured to get to the initial pose as fast as possible. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7235