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-11-06Refactor: move Paint lib linking to blenkernelJacques Lucke
Ref T76372.
2020-11-06Refactor: move Paint .blend I/O to blenkernelJacques Lucke
Ref T76372.
2020-10-30Sculpt: Dyntopo detail size edit operatorPablo Dobarro
This introduces a new operator to edit the detail size of constant detail mode in dyntopo. The way this operator works and the functionality it provides is similar to the "Voxel size edit" operator for the voxel remesher. It also includes a sample mode. When pressing Ctrl, the detail size will be sampled from the surface under the cursor, updating the preview in real time. This allows quick resolution changes without using the operator multiple times. The operator is set to Shift + D, replacing the old way to change the constant detail size of dyntopo. Shift + R will remain available to be enabled when the voxel remesher works with dyntopo. Deciding if both detail sizes can be unified needs a separate discussion as the new dyntopo can work with detail sizes in parts of the mesh that can easily crash the remesher. The structure of these operators is similar, but the data they control, ranges, drawing and setup functions are completely different, making it hard to merge them into one. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9355
2020-10-30Sculpt: Add normal orientation to lasso trim toolPablo Dobarro
This adds an option to orientate the trimming shape using the surface normal instead of the view when lasso trim is used. Reviewed By: dbystedt, sergey Differential Revision: https://developer.blender.org/D9231
2020-10-15Sculpt: Use mpoly flags to sync Face Sets visibilityPablo Dobarro
Previously, all Face Set visibility logic was using mvert flags directly to store the visibility state on the vertices while sculpting. As Face Sets are a poly attribute, it is much simpler to use mpoly flags and let BKE_mesh_flush_hidden_from_polys handle the vertex visibility, even for Multires. Now all operators that update the Face Set visibility state will always copy the visibility to the mesh (using poly flags) and the grids, all using the same code. This should fix a lot of visibility glitches and bugs like the following: - Sculpt visibility reset when changing multires levels. - Multires visibility not updating in edit mode. - Single face visibible when surrounded by visibile face set, even when the face set was hidden. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9175
2020-10-15Sculpt: Use cursor depth in trimming gesturesPablo Dobarro
This adds an operator property to use the paint cursor radius and position for the depth of the trimming shape created by the trimming tools. When enabled, the shape is located in the surface point when the gesture started and it will have the depth of the cursor radius. When the cursor is not over the mesh, the shape will be positioned at the center of the depth of the whole object from the viewport camera. Reviewed By: dbystedt, sergey Differential Revision: https://developer.blender.org/D9129
2020-10-14Cleanup: spellingCampbell Barton
2020-10-13Sculpt: Use plasticity for softbody influencePablo Dobarro
Previously the softbody strength property was controlling the strength of the constraints that pin all vertices to the original location. This was causing problems when the forces were trying to deform the vertices too much, like when using gravity or grab brushes. Now softbody is implemented with plasticity, which creates constraints to a separate coordinates array. These coordinates are deformed with the simulation, and the plasticity parameter controls how much the simulation moves the coordinates (plasticity 0), or the coordinates move the simulation back to its previous position (plasticity 1). This creates much better and predictable results and adding softbody plasticity to the brushes can increase its control and the stability of the simulation. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D9187
2020-10-07Refactor: remove `BKE_<id_type>_copy` functions.Bastien Montagne
Those were only shallow wrappers around `BKE_id_copy`, barely used (even fully unused in some cases), and we want to get rid of those ID-specific helpers for the common ID management tasks. Also prevents weird custom behaviors (like `BKE_object_copy`, who was the only basic ID copy function to reset user count of the new copy to zero). Part of 71219.
2020-10-01Sculpt: Cloth Simulation Dynamic area modePablo Dobarro
This simulation area mode moves the active area with the brush. When enabled, the cloth brush has no restrictions on stroke length, area or mesh vertex count. In order to work, this enables PBVH nodes dynamically for simulation as the stroke location moves and builds the constraints for new nodes during the stroke. When a node is not inside the simulated area, all the constraints that were created for it and vertex collisions are not computed. The simulation limits falloff areas and constraints tweaking control how the simulated and no simulated nodes blend. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D8726
2020-09-30Cleanup: spellingCampbell Barton
2020-09-30Cleanup: sort struct declarationsCampbell Barton
2020-09-29Sculpt: Preserve Mesh visibility from edit mode using the Face SetsPablo Dobarro
Before this change, when users switch from edit mode to sculpt mode, the entire mesh would be visible. Even if in the edit mesh mode part of it was set to invisible. With this change the visibility is preserved, by creating a separate face set for the visible and invisible parts of the mesh and setting their initial visibility. Implementation details: This adds a function to initialize a new Face Set datalayer taking the current mesh visibility into account which is stored in the ME_HIDE flag of the vertices. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8901
2020-09-21Cleanup: move some paint helpers to ED_ 'namespace'.Bastien Montagne
Those two functions had `BKE_` prefix, were defined in BKE headers, but implemented in ED code, yuck. Moved everything to ED area for now, since those do not look fondamental enough to belong to BKE, and none of their usages requires it currently.
2020-09-18Sculpt: Render Mask and Face Sets with modifiers activePablo Dobarro
This removes the limitation of the sculpt overlays not being visible with modifiers active. Reviewed By: fclem Maniphest Tasks: T68900 Differential Revision: https://developer.blender.org/D8673
2020-08-25Sculpt: Cloth Snake Hook BrushPablo Dobarro
This implements Snake Hook as a deform type for the cloth brush. This brush changes the strength of the deformation constraints per brush step to avoid affecting the results of the simulation as much as possible. It allows to grab the cloth without producing any artifacts in the surface and create more natural looking folds than any of the other deformation modes. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8621
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-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-06Sculpt: Cloth Brush/Filter CollisionsPablo Dobarro
This implements collisions in the solver of the cloth brush/filter. It uses the scene colliders as a regular physics simulation. There are still some parameters (friction, distance to the surface...) that can be exposed as properties in later patches. Thanks to Sebastian Parborg for helping me with the implementation. Reviewed By: sergey, zeddb Differential Revision: https://developer.blender.org/D8019
2020-08-05Merge branch 'blender-v2.90-release'Pablo Dobarro
2020-08-05Fix T78665: Face Set visibility reverted when chaning Multires LevelsPablo Dobarro
Face Sets where only set and updated on the PBVH after starting a sculpt tool. In order to preserve the visibility they store when changing levels, they need to be updated and sync also on PBVH creation Reviewed By: sergey Maniphest Tasks: T78665 Differential Revision: https://developer.blender.org/D8225
2020-07-30Sculpt: Use constraints in cloth deform brushesPablo Dobarro
Previously, deform brushes were modifying the final positions in the simulation directly, which was causing all sorts of artifacts in the deformed area and problems with other features of the solver. Now these brushes deform a separate array of positions and the solver adds constraints to them, so the real vertices are moved when solving the constraints. This prevents those artifacts and gives the brush a much better behavior. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8424
2020-07-30Cleanup: spellingCampbell Barton
2020-07-29Sculpt: Cloth Brush Soft Body Influence propertyPablo Dobarro
This property adds constraints to the simulation using the initial location of the vertices, making it behave like a soft body. The strength of these constraints can be modified with the brush parameter. This makes some deformation modes more subtle and predictable, making it possible to use the cloth brush to add surface detail in a more controllable way without loosing completely the original shape of the mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7845
2020-07-27Fix T78242: Crash when using a Sculpt color tools that needs connectivity ↵Pablo Dobarro
for the first time When there is no color layer available, BKE_sculpt_update_object_for_edit creates a new one and tags the mesh with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the tool starts. This also deletes the PBVH and when it is created again in BKE_sculpt_update_object_after_eval, the pmap is not initialized, making the tool crash. This moves the color layer creation to a separate function outside BKE_sculpt_update_object_for_edit, which now runs after the color layer is available, so it won't need to update again and the pmap will still be available when the tool is used. Reviewed By: sergey Maniphest Tasks: T78242 Differential Revision: https://developer.blender.org/D8135
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-02Cleanup: Remove useless duplicated linesValentin
I spotted a duplicate struct declaration, so I had to check for other duplicated as well There might be some other but i am not confident enough for deleting them this regex search for duplicate ^(.*;)$\n(\1)$ Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D8146
2020-07-01Cleanup: spellingCampbell Barton
2020-06-30Sculpt: Refactor persistent base to make it usable from other toolsPablo Dobarro
This renames the layer persistent base and adds new API functions to get the mesh state from the base, so it can be used from other tools and replaced in the future with a better system. Reviewed By: sergey Maniphest Tasks: T77738 Differential Revision: https://developer.blender.org/D8003
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-29Fix T78323: Enable Unified and Secondary colors for Scultp Vertex ColorsPablo Dobarro
The report does not include any file, but probably that file is using the settings for unified colors, which are currently not available in the UI, so it always paints black. This enables unified colors and secondary colors for sculpt vertex colors, so it should solve that issue. Unified color does not make much sense now as the Paint tool is the only one that has paint capabilities, but it will do in the future when sculpt and paint at the same time is enabled and the paint capability is added to more tools. Reviewed By: sergey Maniphest Tasks: T78323 Differential Revision: https://developer.blender.org/D8136
2020-06-24Cleanup: Replace GSet with Edgeset in Cloth BrushPablo Dobarro
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-14Cleanup: remove unnecessary headerCampbell Barton
Introduced in D8007
2020-06-13Sculpt: Fix creation of repeated constraints in the Cloth BrushPablo Dobarro
Previously, constraints were added multiple times from different vertices. This adds a GSet to check that the same constraint is not being added twice when iterating over the neighbors of two different vertices. Reviewed By: zeddb Differential Revision: https://developer.blender.org/D8007
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-09Sculpt: Pose Squash and Stretch deform modePablo Dobarro
This implements squash and stretch as a deform mode for the Pose Brush. It is similar to scale, but it applies different scale values in different axis. To achieve this, the pivot local space of the transform needs to be aligned to the segment when using this deform mode to apply the scale in the correct direction. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7934
2020-06-02Sculpt: Improve twist axis in Pose FK modePablo Dobarro
Previously, the twist rotation was aligned using the stroke location. This was causing unexpected results when rotating some Face Sets rigs. Now the intersection with the first Face Set in the flood fill is used, which produces much better results. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7900
2020-05-25Sculpt: Pose Brush Scale/Transform deform modePablo Dobarro
This is an alternative deformation brush for the Pose Brush intended quickly change the proportions of the mesh. The regular mode scales using the segment's origin as a pivot. The inverted mode drags the entire segment using the grab delta. The only difference with the regular pose brush is that it is not compatible with IK, so the option is disabled and set to 1 segment. The rest of the options should work as expected. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7374
2020-05-12Merge branch 'blender-v2.83-release'Antonio Vazquez
Conflicts: release/scripts/startup/bl_ui/properties_render.py source/blender/blenkernel/BKE_blender_version.h
2020-05-12Fix T74694: Sculpt Mask Influences Weight/Vertex Paint DrawingJeroen Bakker
Sculpt overlay assumed that the sculpt session was always in sculpt mode. But the sculpt session was also used for Vertex/Weight painting. This resulted that when a mask was defined in the sculpt mode this resulted into render artifacts. This patch adds a check to see if the object has a sculpt session for OB_MODE_SCULPT. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D7704
2020-05-09Cleanup: double-spaces in commentsCampbell Barton
2020-05-08Cleanup: take includes out of 'extern "C"' blocksJacques Lucke
Surrounding includes with an 'extern "C"' block is not necessary anymore. Also that made it harder to add any C++ code to some headers, or include headers that have "optional" C++ code like `MEM_guardedalloc.h`. I tested compilation on linux and windows (and got help from @LazyDodo). If this still breaks compilation due to some linker error, the header containing the symbol in question is probably missing an 'extern "C"' block. Differential Revision: https://developer.blender.org/D7653
2020-04-20Fix crash on Multires Face Set visibility syncPablo Dobarro
Multires uses the data of the Face Sets stored in the base mesh to manage the grid's visibility, so these pointers can no longer be set to NULL when editing Multires objects as they are requried for some operations. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7431
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: Store explicit value for multires sculpt levelSergey Sharybin
Allows to know what level sculpting has been done after the value has been changed in the MultiresModifierData. No functional changes, just preparing code to have everything needed for propagation undo. Differential Revision: https://developer.blender.org/D7307
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