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-31Curves: Avoid unnecessarily initializing new positions layerHans Goudey
When creating a curves data-block, one is expected to set the new position values. We can slightly improve performance by avoiding doing that redundantly. Similar to cccc6d6905be7ac32cb.
2022-08-31Attributes: Avoid unnecessarily initializing new attributesHans Goudey
The "write_only" (i.e. no reading) API function expects the caller to set values for all new attribute elements, so using calloc or setting the default value first is redundant. In theory this can improve performance by avoiding an extra pass over the array. I observed a 6% improvement in a basic test with the mesh to points node: from 47.9ms to 45ms on average. See 25237d2625078c6d for more info. Similar to cccc6d6905be7ac.
2022-08-31Mesh: Avoid redundant custom data layer initializationHans Goudey
In all these cases, it was clear that the layer values were set right after the layer was created anyway. So there's no point in using calloc or setting the values to zero first. See 25237d2625078c6d for more info.
2022-08-30Merge branch 'blender-v3.3-release'Hans Goudey
2022-08-30Fix: Potential name clash when adding rest position attributeHans Goudey
If a "rest_position" attribute already existed, potentiall with another type, the next name "rest_position.001" would be used, which might even conflict with a name on another domain. Use the C++ attribute API instead, which has more standard/predictable behavior.
2022-08-30Attributes: Improve custom data initialization optionsHans Goudey
When allocating new `CustomData` layers, often we do redundant initialization of arrays. For example, it's common that values are allocated, set to their default value, and then set to some other value. This is wasteful, and it negates the benefits of optimizations to the allocator like D15082. There are two reasons for this. The first is array-of-structs storage that makes it annoying to initialize values manually, and the second is confusing options in the Custom Data API. This patch addresses the latter. The `CustomData` "alloc type" options are rearranged. Now, besides the options that use existing layers, there are two remaining: * `CD_SET_DEFAULT` sets the default value. * Usually zeroes, but for colors this is white (how it was before). * Should be used when you add the layer but don't set all values. * `CD_CONSTRUCT` refers to the "default construct" C++ term. * Only necessary or defined for non-trivial types like vertex groups. * Doesn't do anything for trivial types like `int` or `float3`. * Should be used every other time, when all values will be set. The attribute API's `AttributeInit` types are updated as well. To update code, replace `CD_CALLOC` with `CD_SET_DEFAULT` and `CD_DEFAULT` with `CD_CONSTRUCT`. This doesn't cause any functional changes yet. Follow-up commits will change to avoid initializing new layers where the correctness is clear. Differential Revision: https://developer.blender.org/D15617
2022-08-30Geometry Nodes: Use separate field context for each geometry typeHans Goudey
Using the same `GeometryComponentFieldContext` for all situations, even when only one geometry type is supported is misleading, and mixes too many different abstraction levels into code that could be simpler. With the attribute API moved out of geometry components recently, the "component" system is just getting in the way here. This commit adds specific field contexts for geometry types: meshes, curves, point clouds, and instances. There are also separate field input helper classes, to help reduce boilerplate for fields that only support specific geometry types. Another benefit of this change is that it separates geometry components from fields, which makes it easier to see the purpose of the two concepts, and how they relate. Because we want to be able to evaluate a field on just `CurvesGeometry` rather than the full `Curves` data-block, the generic "geometry context" had to be changed to avoid using `GeometryComponent`, since there is no corresponding geometry component type. The resulting void pointer is ugly, but only turns up in three places in practice. When Apple clang supports `std::variant`, that could be used instead. Differential Revision: https://developer.blender.org/D15519
2022-08-30Merge branch 'blender-v3.3-release'Hans Goudey
2022-08-30Fix T99253: Missing face center dots with deform modifier cage optionHans Goudey
Before 8c25889bb67db4c, subsurf face center tags were stored in each vertex, so they were always copied to duplicate meshes. Now they are stored in runtime data though, so they need to be copied explicitly. The function name "reset_on_copy" is a bit awkward here, so the tags are copied by the caller.
2022-08-30GPencil: Improve Thickness handling for Outline operatorAntonio Vazquez
Actually, when you increase the thickness of the stroke in the outline conversion, the shape of the stroke changes and becomes thicker. This commit includes a new algorithm to correct this problem. A new `Keep Shape` parameter allows you to disable it because, for artist reasons, it may be good to keep the old algorithm and change the shape.
2022-08-30Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-30LibOverride: Minor resync optimization by removing unuecessary processing.Bastien Montagne
Not much to gain here, but can make resync faster by a few percents when dealing with linked overrides and such.
2022-08-30Cleanup: Remove one level of indentation by early continue in a loop.Bastien Montagne
2022-08-30Fix T100586: libOverride resync could remove too many data-blocks.Bastien Montagne
Do not delete 'orphaned' overrides when their reference is missing because the library file itself is missing.
2022-08-30Cleanup: formatCampbell Barton
2022-08-30Cleanup: Use const for custom data layersHans Goudey
2022-08-30Sculpt: Avoid creating mask and face set when remeshingHans Goudey
If these layers didn't exist on the original mesh, they would be created from scratch and transferred anyway. That is inefficient because all the work is pointless, and because creating these layers could slow down subsequent sculpt operations.
2022-08-29Merge branch 'blender-v3.3-release'Hans Goudey
2022-08-29Fix: Broken build with OpenVDB turned offHans Goudey
Problem with e3a6a2f41284f90b010.
2022-08-29Fix T99576: Guard against empty names when removing attributesTom Edwards
It's possible for misbehaving scripts written before 3.3 to reach this state and crash Blender. With this change, the error is reduced to a Python exception. Differential Revision: https://developer.blender.org/D15724
2022-08-29Fix: Broken build with OpenVDB turned offHans Goudey
Problem with e3a6a2f41284f90b010.
2022-08-29Merge branch 'blender-v3.3-release'Jacques Lucke
2022-08-29Fix T99004: scaling volume down results in crashJacques Lucke
OpenVDB crashes when the determinant of the grid transformation is too small. The solution is too detect when the determinant is too small and to replace the grid with an empty one. If possible the translation and rotation of the grid remains unchanged. Differential Revision: https://developer.blender.org/D15806
2022-08-29I18n: translate newly created node group socketsDamien Picard
Translate: - new group socket names - default names Input and Output - on connecting a link from another node - new geometry nodes input and output socket names Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15763
2022-08-29Weight Paint: use coordinates from normal evaluated mesh if same topology.Alexander Gavrilov
Weight and Vertex paint don't change coordinates and thus don't need crazyspace data, which allows using coordinates from normal evaluated meshes. Since painting uses original topology, the deform only mesh is used, but if the fully evaluated mesh has the same topology, it is preferred. This is useful because not only Geometry Nodes, but even simple weight computation modifiers are excluded from the deform only mesh evaluation. Differential Revision: https://developer.blender.org/D15501
2022-08-29GPencil: New conversion to outline in draw modeAntonio Vazquez
This new option converts the stroke to outline perimeter as soon as is drawn. If no alternative material is set, the actual material is used. The algorithm is similar to the new operator in D15664 Reviewed By: pepeland Differential Revision: https://developer.blender.org/D15738
2022-08-28Curves: Avoid creating types array when unnecessaryHans Goudey
When the curve type attribute doesn't exist, there is no reason to create an array for it only to fill the default value, which will add overhead to subsequent "add" operations. I added a "get_if_single" method to virtual array to simplify this check. Also use the existing functions for filling curve types. Differential Revision: https://developer.blender.org/D15560
2022-08-28Cleanup: replace NULL with nullptr for C++ filesCampbell Barton
2022-08-27Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-27Cleanup: Remove two files committed by mistake.Bastien Montagne
Committed in rB3c7a6718ddc.
2022-08-27Cleanup: rename filename to filepath when used for full pathsCampbell Barton
2022-08-26CustomData: Add function to get name of default layerHans Goudey
Used by D14365
2022-08-26Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-26Fix assert in id remapper tests.Bastien Montagne
Was using uninitialized ID name, leading to unknown ID type. Thanks at Ray molenkamp (@LazyDodo) for noting the issue.
2022-08-26Cleanup: Fix const correctness in CustomData set name functionHans Goudey
The function does modify the object since it changes the name of a layer it owns. Ideally this wouldn't be possible, but raw pointers don't have ownership semantics so this is a common problem with CustomData.
2022-08-26Cleanup: use booleansCampbell Barton
2022-08-26Cleanup: quiet GCC array bounds warningCampbell Barton
2022-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-26Cleanup: spelling in comments, formatCampbell 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-25Revert "LibOverride: Preserve viewlayers when creating overrides of ↵Bastien Montagne
collecitons." Commit is not working as expected in some cases, as revealed by liboverride testcase entering infinite loop. Code needs some more thinking. This reverts commit ee7bd79b54a32d64fe0337695d438ad34990d121.
2022-08-25LibOverride: Preserve viewlayers when creating overrides of collecitons.Bastien Montagne
Usually, when overriding collections, the linked reference ones are removed from the ViewLayer, and the overrides replace them. This change to `layer_collection_sync` code makes it so that in case there is a free viewlayer hierarchy matching the linked collection, it gets re-used for the override one, instead of re-creating everything from scratch. To achieve this, resync process is split into two steps, first regular collections are processed, then the override ones. This should ensure an override does not steal the layers of its reference if the later is still instantiated in the view layer.
2022-08-25Cleanup: rename mat3_to_quat_is_ok to mat3_to_quat_legacyCampbell Barton
Update comment, noting why this is kept.
2022-08-25Cleanup: Add asserts to curves data-block creationMattias Fredriksson
Ref D14481
2022-08-24Cleanup: Fix typo in commentHans Goudey
Added by mistake in 6718afdc8a32.
2022-08-23Fix: Write hide status attributes for undo stepsHans Goudey
We don't convert to the old mesh format when writing undo steps to avoid overhead. So we can't skip writing the hide attributes then.
2022-08-23Fix T100482: Face Set visibility reset after savingHans Goudey
The face hide attribute wasn't created in order to store the visiblity from the face sets, it was only updated if it already existed.
2022-08-23Cleanup: Move paint.c to C++Hans Goudey
2022-08-23Cleanup: Use utility to write palette color listHans Goudey