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-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-25Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-25Fix T100255: Make RigidBodyWorld (and effector_weights) collections refcounted.Bastien Montagne
Those collections were so far mainly just tagged as fake user (even though a few places in code already incremented usercount on them). Since we now clear the fakeuser flag when linking/appending data, ensure that these collections are preserved by making these usages regular ID refcounting ones. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15783
2022-08-23Merge branch 'blender-v3.3-release'Philipp Oeser
2022-08-23Fix T100578: Surface Deform modifier displays wrong in editmodePhilipp Oeser
This was the case when the "Show in Editmode" option was used and a vertexgroup affected the areas. Probably an oversight in {rBdeaff945d0b9}?, seems like deforming modifiers always need to call `BKE_mesh_wrapper_ensure_mdata` in `deformVertsEM` when a vertex group is used. Maniphest Tasks: T100578 Differential Revision: https://developer.blender.org/D15756
2022-08-23Cleanup: match names between functions & declarationsCampbell Barton
2022-08-16Cleanup: some refactoring in mapped mesh extractionBrecht Van Lommel
* Flip the logic to first detect if we are dealing with an unmodified mesh in editmode. And then if not, detect if we need a mapping or not. * runtime.is_original is only valid for the bmesh wrapper. Rename it to clarify that and only check it when the mesh is a bmesh wrapper. * Remove MR_EXTRACT_MAPPED and instead check only for the existence of the origindex arrays. Previously it would sometimes access those arrays without MR_EXTRACT_MAPPED set, which according to a comment means they are invalid. Differential Revision: https://developer.blender.org/D15676
2022-08-12Cleanup: remove use_normals arugment to MOD_deform_mesh_eval_getCampbell Barton
Accessing the normals creates them on demand so there was no need to pass an argument requesting them.
2022-08-12Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-12Fix T100191: Crash with the wave modifier using normals in edit-modeCampbell Barton
2022-08-12Cleanup: screw modifier comments & namingCampbell Barton
Rename dist to dist_sq as it's the squared distance, also prefer __func__ in temporary allocated arrays.
2022-08-11Mesh: Move hide flags to generic attributesHans Goudey
This commit moves the hide status of mesh vertices, edges, and faces from the `ME_FLAG` to optional generic boolean attributes. Storing this data as generic attributes can significantly simplify and improve code, as described in T95965. The attributes are called `.hide_vert`, `.hide_edge`, and `.hide_poly`, using the attribute name semantics discussed in T97452. The `.` prefix means they are "UI attributes", so they still contain original data edited by users, but they aren't meant to be accessed procedurally by the user in arbitrary situations. They are also be hidden in the spreadsheet and the attribute list by default, Until 4.0, the attributes are still written to and read from the mesh in the old way, so neither forward nor backward compatibility are affected. This means memory requirements will be increased by one byte per element when the hide status is used. When the flags are removed completely, requirements will decrease when hiding is unused. Further notes: * Some code can be further simplified to skip some processing when the hide attributes don't exist. * The data is still stored in flags for `BMesh`, necessitating some complexity in the conversion to and from `Mesh`. * Access to the "hide" property of mesh elements in RNA is slower. The separate boolean arrays should be used where possible. Ref T95965 Differential Revision: https://developer.blender.org/D14685
2022-08-11Cleanup: remove redundant MEM_SAFE_FREECampbell Barton
MEM_SAFE_FREE isn't necessary when the memory is known to be allocated and clearing the value afterwards isn't necessary.
2022-08-09I18n: make more parts of the UI translatableDamien Picard
- "Name collisions" label in mesh properties - "Threshold" labels in Vertex Weight Edit modifier - "Particle System" label in Particle Instance modifier - Slot number in the Shader Editor - Status bar keymap items during modal operations: add TIP_() macro to status bar interface template - On dumping messages, sort preset files so their messages are stable between runs Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15607
2022-08-09I18n: make more parts of the UI translatableDamien Picard
- "Name collisions" label in mesh properties - "Threshold" labels in Vertex Weight Edit modifier - "Particle System" label in Particle Instance modifier - Slot number in the Shader Editor - Status bar keymap items during modal operations: add TIP_() macro to status bar interface template - On dumping messages, sort preset files so their messages are stable between runs Ref. T43295 Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15607
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-08-04Depsgraph: More clear function name for transform dependnecySergey Sharybin
The name was confusing to a level that it sounded like the relation goes the opposite direction than it is intended.
2022-07-31Cleanup: Remove mesh edge "tmp tag"Hans Goudey
Ref T95966. Also fixes modification of input mesh, which should be considered constant.
2022-07-28Cleanup: Use new IDProperty creation API for geometry ndoes modifierHans Goudey
Use the API from 36068487d076bfd8 instead of the uglier `IDPropertyTemplate` API.
2022-07-28Geometry Nodes: add assert to check if node supports lazynessIliay Katueshenock
Only nodes supporting lazyness can mark inputs as unused. For other nodes, this is done automatically of all outputs are unused. Differential Revision: https://developer.blender.org/D15409
2022-07-22Cleanup: Use r_ prefix for boolean return parametersHans Goudey
Also rearrange some lines to simplify logic.
2022-07-20Cleanup: remove unused get_cage_mesh parameterJacques Lucke
All callers passed `false` for this parameter, making it more confusing than useful. If this functionality is needed again in the future, a separate function should be added. Differential Revision: https://developer.blender.org/D15401
2022-07-20Add a 'Apply and Delete All' operation to shapekeys.Bastien Montagne
Adds a new option to the 'Delete ShpaKeys' operator, which first applies the current mix to the object data, before removing all shapekeys. Request from @JulienKaspar from Blender studio. Reviewed By: JulienKaspar Differential Revision: https://developer.blender.org/D15443
2022-07-19Cleanup: Remove compile option for curves objectHans Goudey
After becb1530b1c81a408e20 the new curves object type isn't hidden behind an experimental flag anymore, and other areas depend on this, so disabling curves at compile time doesn't make sense anymore.
2022-07-15Fix overly noisy surface deform warning messageSergey Sharybin
An increased number of vertices is not a stopper for the surface deform modifier anymore. It might still be useful to expose the message in the UI, but printing error message to the console on every modifier evaluation makes real errors to become almost invisible. Differential Revision: https://developer.blender.org/D15468
2022-07-15UI: make many modifier strings translatableDamien Picard
This includes: - new modifier names It mostly uses `N_` because the strings are actually translated elsewhere. The goal is simply to export them to .po files. Most of the new translations were reported in T43295#1105335. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15418
2022-07-14Modifiers: fix mesh to volume modifier on non-volume objectsJacques Lucke
2022-07-08Geometry Nodes: new geometry attribute APIJacques Lucke
Currently, there are two attribute API. The first, defined in `BKE_attribute.h` is accessible from RNA and C code. The second is implemented with `GeometryComponent` and is only accessible in C++ code. The second is widely used, but only being accessible through the `GeometrySet` API makes it awkward to use, and even impossible for types that don't correspond directly to a geometry component like `CurvesGeometry`. This patch adds a new attribute API, designed to replace the `GeometryComponent` attribute API now, and to eventually replace or be the basis of the other one. The basic idea is that there is an `AttributeAccessor` class that allows code to interact with a set of attributes owned by some geometry. The accessor itself has no ownership. `AttributeAccessor` is a simple type that can be passed around by value. That makes it easy to return it from functions and to store it in containers. For const-correctness, there is also a `MutableAttributeAccessor` that allows changing individual and can add or remove attributes. Currently, `AttributeAccessor` is composed of two pointers. The first is a pointer to the owner of the attribute data. The second is a pointer to a struct with function pointers, that is similar to a virtual function table. The functions know how to access attributes on the owner. The actual attribute access for geometries is still implemented with the `AttributeProvider` pattern, which makes it easy to support different sources of attributes on a geometry and simplifies dealing with built-in attributes. There are different ways to get an attribute accessor for a geometry: * `GeometryComponent.attributes()` * `CurvesGeometry.attributes()` * `bke::mesh_attributes(const Mesh &)` * `bke::pointcloud_attributes(const PointCloud &)` All of these also have a `_for_write` variant that returns a `MutabelAttributeAccessor`. Differential Revision: https://developer.blender.org/D15280
2022-07-08Fix T99191: Boolean modifier creates invalid material indicesHans Goudey
Similar to 1a6d0ec71cf3b0c2c which changed the mesh boolean node (and also caused this bug), this commit changes the material mapping for the exact mode of the boolean modifier. Now the result should contain any material on the faces of the input objects (including materials linked to objects and meshes). The improvement is possible because materials can be changed during evaluation (as of 1a81d268a19f2f1402). Differential Revision: https://developer.blender.org/D15365
2022-07-08Curves: support deforming curves on surfaceJacques Lucke
Curves that are attached to a surface can now follow the surface when it is modified using shape keys or modifiers (but not when the original surface is deformed in edit or sculpt mode). The surface is allowed to be changed in any way that keeps uv maps intact. So deformation is allowed, but also some topology changes like subdivision. The following features are added: * A new `Deform Curves on Surface` node, which deforms curves with attachment information based on the surface object and uv map set in the properties panel. * A new `Add Rest Position` checkbox in the shape keys panel. When checked, a new `rest_position` vector attribute is added to the mesh before shape keys and modifiers are applied. This is necessary to support proper deformation of the curves, but can also be used for other purposes. * The `Add > Curve > Empty Hair` operator now sets up a simple geometry nodes setup that deforms the hair. It also makes sure that the rest position attribute is added to the surface. * A new `Object (Attach Curves to Surface)` operator in the `Set Parent To` (ctrl+P) menu, which attaches existing curves to the surface and sets the surface object as parent. Limitations: * Sculpting the procedurally deformed curves will be implemented separately. * The `Deform Curves on Surface` node is not generic and can only be used for one specific purpose currently. We plan to generalize this more in the future by adding support by exposing more inputs and/or by turning it into a node group. Differential Revision: https://developer.blender.org/D14864
2022-07-08Cleanup: Move mesh legacy conversion to a separate fileHans Goudey
It's helpful to make the separation of legacy data formats explicit, because it declutters actively changed code and makes it clear which areas do not follow Blender's current design. In this case I separated the `MFace`/"tessface" conversion code into a separate blenkernel .cc file and header. This also makes refactoring to remove these functions simpler because they're easier to find. In the future, conversions to the `MLoopUV` type and `MVert` can be implemented here for the same reasons (see T95965). Differential Revision: https://developer.blender.org/D15396
2022-06-29Geometry Nodes: Only calculate mesh to volume bounds when necessaryHans Goudey
In "size" voxel resolution mode, calculating the bounds of the mesh to volume node's input mesh isn't necessary. For high poly this can take a few milliseconds, so this commit skips the calculation unless we need it for the "Amount" mode. Differential Revision: https://developer.blender.org/D15324
2022-06-29Geometry Nodes: Add Mesh To Volume NodeErik Abrahamsson
This adds a Mesh To Volume Node T86838 based on the existing modifier. The mesh to volume conversion is implemented in the geometry module, and shared between the node and the modifier. Currently the node outputs a grid with the name "density". This may change in the future depending on the decisions made in T91668. The original patch was by Kris (@Metricity), further implementation by Geramy Loveless (@GeramyLoveless), then finished by Erik Abrahamsson (@erik85). Differential Revision: https://developer.blender.org/D10895
2022-06-23Mesh: Add an explicit "positions changed" functionHans Goudey
We store various lazily calculated caches on meshes, some of which depend on the vertex positions staying the same. The current API to invalidate these caches is a bit confusing. With an explicit set of functions modeled after the functions in `BKE_node_tree_update.h`, it becomes clear which function to call. This may become more important if more lazy caches are added in the future. Differential Revision: https://developer.blender.org/D14760
2022-06-21Cleanup: removed unused Blender Internal bump/normal mapping texture codeBrecht Van Lommel
The TexResult.nor output does not appear to be used anywhere.
2022-06-16Geometry Nodes: add 'Intersecting Edges' output for boolean nodePhilipp Oeser
This patch adds a 'Intersecting Edges' output with a boolean selection that only gives you the new edges on intersections. Will work on a couple of examples next, this should make some interesting effects possible (including getting us closer to the "bevel- after-boolean-usecase") To achieve this, a Vector is passed to `direct_mesh_boolean` when the iMesh is still available (and intersecting edges appended), then from those edge indices a selection will be stored as attribute. Differential Revision: https://developer.blender.org/D15151
2022-06-14Fix T98813: crash with GPU subdiv in edit mode and instanced geometryBrecht Van Lommel
Instancing with geometry nodes uses just the evaluated Mesh, and ignores the Object that it came from. That meant that it would try to look up the subsurf modifier on the instancer object which does not have the subsurf modifier. Instead of storing a session UUID and looking up the modifier data, store a point to the subsurf modifier runtime data. Unlike the modifier data, this runtime data is preserved across depsgraph CoW. It must be for the subdiv descriptor contained in it to stay valid along with the draw cache. As a bonus, this moves various Mesh_Runtime variables into the subsurf runtime data, reducing memory usage for meshes not using subdivision surfaces. Also fixes T98693, issues with subdivision level >= 8 due to integer overflow. Differential Revision: https://developer.blender.org/D15184
2022-06-07Fix T98626: Mesh Deform modifier stops working on a linked collection upon undo.Bastien Montagne
Regression from rBb66368f3fd9c, we still need to store all data on undo writes, since overrides are not re-applied after undo/redo.
2022-06-07Cleanup: spelling in comments, additional white spaceCampbell Barton
2022-06-03Fix (unreported) important memory leak in Boolean modifier using a ↵Bastien Montagne
Collection operand and Fast mode. Code handling repetitive boolean operations when using several objects from a Collection would not handle result mesh properly, re-creating for each object without properly freeing it. Further more, existing code was effectively converting the BMesh to mesh twice, including a modification of the initial (input) mesh, which modifiers should never do! Removed the extra useless conversion, which also gives a small improvement in performances: With as simple of a scene as four objects (three operands in a collection, and the modified one) totalling 20k vertices/faces, this commit: * Avoids 2MB memory leak per evaluation (!). * Speeds up boolean evaluation by 5-10%. Found while investigating some production files of the Project Heist here at the Blender Studio.
2022-06-03Fix (unreported) invalid debug timing code in Boolean modifier code.Bastien Montagne
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-06-01Cleanup: '*' prefix C-comment blocksCampbell Barton
2022-06-01Cleanup: spelling in comments, use doxy sectionsCampbell Barton
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-05-31Geometry Nodes: Don't allow UI attributes as modifier field inputsJacques Lucke
This is an extension of 4669178fc3786e1, applying the same changes to attributes chosen in the field inputs of the geometry nodes modifier. If a UI/internal attribute is used, the attribute name button will have a red alert. Adding a disabled hint is currently a bit more complex. Also hide UI attributes in attribute search for the named attribute node. Part of D14934
2022-05-30Cleanup: Clang tidyHans Goudey
Mostly duplicate includes, also use nullptr, and using default member initializers.
2022-05-30Nodes: add separately allocated run-time data for bNodeTreeJacques Lucke
`bNodeTree` has a lot of run-time embedded in it currently. Having a separately allocated run-time struct has some benefits: * Run-time data is not stored in files. * Makes it easy to use c++ types as run-time data. * More clear distinction between what data only exists at run-time and which doesn't. This commit doesn't move all run-time data to the new struct yet, only the data where I know for sure how it is used. The remaining data can be moved separately. Differential Revision: https://developer.blender.org/D15033
2022-05-19Cleanup: format, reduce line length & strip trailing spaceCampbell Barton
2022-05-18Cleanup: remove unused variables, redundant assignmentsCampbell Barton