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-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
2022-05-17Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-17Fix T98052: Eevee / Workbench background render crash with GPU subdivisionBrecht Van Lommel
The problem is that depsgraph evaluation happens before the OpenGL context is initialized, and so modifier evaluation happens without GPU subdivision. Later the BKE_subsurf_modifier_can_do_gpu_subdiv test in the draw code gives a different result. This just checks if the mesh has information for GPU subdivision in the draw code, and if so uses it. This is only set if the test for supported GPU subdivision passes in the modifier evaluation. Additionally it may be good to perform OpenGL context initialization earlier so background render can take advantage of GPU subdivision, but this is more complicated. Differential Revision: https://developer.blender.org/D14969
2022-05-17Cleanup: Use `switch` and `BLI_assert_unreachable()` more.Bastien Montagne
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-17Cleanup: Deduplicate Alembic procedural bounding box mesh creationHans Goudey
This removes the manual construction of a box mesh in the mesh sequence cache modifier when the Alembic procedural is enabled. It also removes the use of `BKE_object_boundbox_get` which doesn't make sense on a non-evaluated object. Differential Revision: https://developer.blender.org/D14958
2022-05-17Cleanup: spelling in commentsCampbell Barton
2022-05-16LibOverride: Do not write Surface Deform modifier binding data.Bastien Montagne
Skip writing binding data and similar for override modifiers already present in reference linked data, as this can use a lot of space, and is fully useless data typically since we already skip writing Mesh geometry data itself. Ref. T97967.
2022-05-16LibOverride: Do not write Laplacian Deform modifier binding data.Bastien Montagne
Skip writing binding data and similar for override modifiers already present in reference linked data, as this can use a lot of space, and is fully useless data typically since we already skip writing Mesh geometry data itself. Ref. T97967.
2022-05-16LibOverride: Do not write Corrective Smooth modifier binding data.Bastien Montagne
Skip writing binding data and similar for override modifiers already present in reference linked data, as this can use a lot of space, and is fully useless data typically since we already skip writing Mesh geometry data itself. Ref. T97967.
2022-05-16LibOverride: Do not write MeshDeform modifier binding data.Bastien Montagne
Skip writing binding data and similar for override modifiers already present in reference linked data, as this can use a lot of space, and is fully useless data typically since we already skip writing Mesh geometry data itself. Ref. T97967.
2022-05-16Refactor modifiers writing code.Bastien Montagne
This changes is needed to give more control to modifiers' writing callback when defined. It will allow to implement better culling of needless data when writing e.g. modifiers from library overrides. Ref. T97967. Reviewed By: brecht, JacquesLucke Differential Revision: https://developer.blender.org/D14939
2022-05-15Cleanup: Clang tidyHans Goudey
2022-05-14Cleanup: Further use of const for retrieved custom data layersHans Goudey
Similar to cf69652618fefcd22b2cde9a2.
2022-05-13Cleanup: Use const when retrieving custom data layersHans Goudey
Knowing when layers are retrieved for write access will be essential when adding proper copy-on-write support. This commit makes that clearer by adding `const` where the retrieved data is not modified. Ref T95842
2022-05-12Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-12Cleanup: use proper naming in Warp modifier read/write code.Bastien Montagne
2022-05-12Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-12Fix (unreported) bad memory access in read/write code of MeshDeform modifier.Bastien Montagne
This abuse of one one size value to handle another allocated array of a different size is bad in itself, but at least now read/write code of this modifier should not risk invalid memory access anymore. NOTE: invalid memory access would in practice only happen in case endian switch would be performed at read time I think (those switches only check for given length being non-zero, not for a NULL data pointer...).