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-09-14Cleanup: Remove unused argument from modifier data mask callbackHans Goudey
This isn't likely to be helpful in the future with the move to generic attributes
2022-09-05Mesh: Remove redundant custom data pointersHans Goudey
For copy-on-write, we want to share attribute arrays between meshes where possible. Mutable pointers like `Mesh.mvert` make that difficult by making ownership vague. They also make code more complex by adding redundancy. The simplest solution is just removing them and retrieving layers from `CustomData` as needed. Similar changes have already been applied to curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of the pointers generally makes code more obvious and more reusable. Mesh data is now accessed with a C++ API (`Mesh::edges()` or `Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`). The CoW changes this commit makes possible are described in T95845 and T95842, and started in D14139 and D14140. The change also simplifies the ongoing mesh struct-of-array refactors from T95965. **RNA/Python Access Performance** Theoretically, accessing mesh elements with the RNA API may become slower, since the layer needs to be found on every random access. However, overhead is already high enough that this doesn't make a noticible differenc, and performance is actually improved in some cases. Random access can be up to 10% faster, but other situations might be a bit slower. Generally using `foreach_get/set` are the best way to improve performance. See the differential revision for more discussion about Python performance. Cycles has been updated to use raw pointers and the internal Blender mesh types, mostly because there is no sense in having this overhead when it's already compiled with Blender. In my tests this roughly halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million face grid). Differential Revision: https://developer.blender.org/D15488
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-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-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-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-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-05-17Cleanup: spelling in commentsCampbell Barton
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-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...).
2022-03-28Cleanup: use "num" as a suffix in: source/blender/modifiersCampbell Barton
Also rename DNA struct members.
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-03Merge branch 'blender-v3.1-release'Sergey Sharybin
2022-02-03Fix assert in original modifiers pointer update functionSergey Sharybin
The issue was happening with a specific file where the ID management code was not fully copying all modifiers because of the extra check in the `BKE_object_support_modifier_type_check()`. While it is arguable that copy-on-write should be a 1:1 copy there is no real need to maintain the per-modifier pointer to its original. Use its SessionUUID to perform lookup in the original datablock. Downside of this approach is that it is a linear lookup instead of direct pointer access, but the upside is that there is less pointers to manage and that the file with unsupported modifiers does behave correct without any asserts. Differential Revision: https://developer.blender.org/D13993
2022-01-30Cleanup: Remove modifier type hair callbackHans Goudey
This is similar to e032ca2e25bf2e305b66 which removed the callback for volumes. Now that we have geometry sets, there is no need to define a callback for every data type, and this wasn't used. Procedural curves/hair editing will use nodes rather than new modifier types anyway.
2021-11-13Cleanup: spelling in comments, comment block formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-04-26Cleanup: Replace modifyVolume with modifyGeometrySetHans Goudey
This allows us to remove a callback from the modifier type info struct. In the future the these modifiers might just be replaced by nodes internally anyway, but in the meantime it's nice to unify the handling of evaluated geometry a bit. Differential Revision: https://developer.blender.org/D11080
2021-02-17BLI: add BLI_simd.h header to wrap SSE includesBrecht Van Lommel
In preparation of adding Neon support. Ref D8237, T78710
2020-12-10Geometry Nodes: rename modifyPointCloud to modifyGeometrySetJacques Lucke
Since the initial merge of the geometry nodes project, the modifyPointCloud function already was already modifying a geometry set. The function wasn't renamed back then, because then the merge would have touched many more files. Ref T83357.
2020-10-26Modifiers: include the object & modifier when logging errorsCampbell Barton
Without this, there was no way of finding out which object, modifier combination caused the error, making the logs not very useful for debugging.
2020-10-01remove foreachObjectLink callbackJacques Lucke
This removes `foreachObjectLink` from `ModifierTypeInfo`, `GpencilModifierTypeInfo` and `ShaderFxTypeInfo`. There is no need to have both, `foreachObjectLink` and `foreachIDLink`. There is not code that actually depends on `foreachObjectLink`. Reviewers: brecht Differential Revision: https://developer.blender.org/D9078
2020-10-01Use DNA defaults system for modifiersHans Goudey
As noted in T80164, there are quite a few area of Blender where the "Reset to Default Value" operator in button context menus doesn't work. Modifiers are one of them, because the DNA defaults system was never set up for them. Additionally, this should make modifier versioning easier. Whenever a new field is added it should be automatically initialized to the default value. I had to make some ordering changes in the following modifiers to work around an error with `-Wsign-conversion` in the macros: - Solidify Modifier - Corrective Smooth Modifier - Screw Modifier Some modifiers are special cases and are skipped in this commit: - Data Transfer Modifier - Cloth Modifier - Fluid Modifier - Softbody Modifier Differential Revision: https://developer.blender.org/D8747
2020-09-25Modifiers: add StructRNA pointer field to ModifierTypeInfoJacques Lucke
This reduces the number of places that have to be modified when a new modifier is added. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D9000
2020-09-25Modifiers: add icon field to ModifierTypeInfoJacques Lucke
With this change `outliner_draw.c` does not have to be edited anymore when a new modifier is added. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D8998
2020-09-02UI: Use instanced panel custom data instead of list indexHans Goudey
For modifier shortcuts we added a "custom_data" field to panels. This commit uses the same system for accessing the list data that corresponds to each panel. This way the context is only used once and the modifier for each panel can be accessed more easily later. This ends up being mostly a cleanup commit with a few small changes in interface_panel.c. The large changes in the UI functions are due to the fact that the panel custom data is now passed around as a single pointer instead of being created again for every panel. The list_index variable in Panel.runtime is removed as it's now unnecessary. Differential Revision: https://developer.blender.org/D8559
2020-08-26Merge branch 'blender-v2.90-release' into masterCampbell Barton
2020-08-26Fix T80098: Mesh deform doesn't update in edit modeCampbell Barton
Use BKE_mesh_wrapper API access to access mesh coordinates for modifier evaluation. Call BKE_mesh_wrapper_ensure_mdata when binding since it's a one off operation. Regression from deaff945d0b96. Reviewed by: @brecht Ref D8709
2020-08-26Cleanup: remove G.debug_value check for old mesh-deform behaviorCampbell Barton
Added in 2007, it doesn't seem useful to support alternate behavior.
2020-07-22UI: use term 'Vertex' instead of 'Vert'Yevgeny Makarov
2020-06-16Refactor: move .blend read/write of mesh deform modifier to MOD_meshdeform.cJacques Lucke
2020-06-15Modifiers: New callbacks for reading and writing .blend filesJacques Lucke
This is part of a greater blenloader decentralization effort (T76372). For modifiers the goal is that fewer files have to be modified when a new modifier is added. This patch just adds the `blendWrite` and `blendRead` callbacks to `ModifierTypeInfo` but does not change any other code yet. In the next steps, modifier specific code will be moved from `writefile.c` and `readfile.c` into their corresponding `MOD_*` files.
2020-06-10Cleanup: move BKE_mesh_wrapper functions into own headerCampbell Barton
2020-06-05UI: Drag and Drop Modifiers, Layout UpdatesHans Goudey
This patch implements the list panel system D7490 for modifiers. It also moves modifier drawing to a callback in ModifierTypeInfo in line with the extensible architecture refactoring goal T75724. This adds a PanelRegister callback and utilities for registering panels and subpanels. It also adds the callbacks for expansion saving and drag and drop reordering described in D7490. These utilities, callbacks, and other common UI elements shared between modifiers live in MOD_ui_common.c. Because modifier buttons are now in panels, we can make use of subpanels for organization. The UI layouts also use the single column layout style consistently used elsewhere in Blender. Additionally, the mode-setting buttons are aligned and ordered consistently with the outliner. However, the large number of UI changes in this patch may mean that additional polishing is required in master. Thanks to William Reynish (@billreynish) who did a fair amount of the layout work and to Julian Eisel (@Severin) for consistent help. Differential Revision: https://developer.blender.org/D7498
2020-05-25Mesh: skip conversion from edit-mesh to mesh in edit-modeCampbell Barton
This resolves a performance regression in 2.8x where every edit-mode update performed an edit-mesh to mesh conversion. Now the conversion will be lazily initialized if/when it's required. New BKE_mesh_wrapper_* functions abstract over mesh data access. Currently only edit-mesh and regular meshes are supported. In the future sub-surface meshes may be supported too.
2020-05-09Cleanup: double-spaces in commentsCampbell Barton
2020-05-08Fix T76498: Refactoring - Rename BKE modifiers funtionsAntonio Vazquez
2020-04-22Objects: add infrastructure for hair, pointcloud, volume modifiersBrecht Van Lommel
There is no user visible difference in standard builds, as there are no volume modifiers yet. When using WITH_NEW_OBJECT_TYPES some deform only modifiers are now available for hair and pointcloud objects. Differential Revision: https://developer.blender.org/D7141
2020-04-20Fix T75885: Mesh deform modifier not updating on own transformsPhilipp Oeser
Added the missing relation. Maniphest Tasks: T75885 Differential Revision: https://developer.blender.org/D7473
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-06Cleanup: use 'BKE_' prefix for BKE_deform API callsCampbell Barton
- Use 'BKE_object_defgroup' prefix for object functions. - Rename 'defvert_verify_index' to 'defvert_ensure_index' since this adds the group if it isn't found.
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2019-11-21Fix T71412: Add transform component to deforming modifierPhilipp Oeser
Dynamically bound mesh deform modifiers failed to update the viewport on object transformation of deformer. The TODO by Sergey, which suggested adding the transform component to the depsgraph, was already there, and worked to fix T71412.
2019-08-30Cleanup: spellingCampbell Barton
2019-08-23Fix potential issues when loading files with missing librariesSebastian Parborg
This is a continuation of rB39f005eae8eed8b939579aff8c9a05a4f50e5e38 Now all the fields where we check for object type in RNA (like rna_Curve_object_poll) will have a safe guard for when this isn't the case. For example when loading files that has missing object libraries and all missing objects are replaced with empties (placeholders). Reviewed By: Brecht Differential Revision: http://developer.blender.org/D5425
2019-08-21Cleanup: vertex coordinate access, naming & minor changesCampbell Barton
This also splits vertex access and allocation so it's possible to copy coordinates into an existing array without allocating it.
2019-07-30BLI_task: Cleanup: rename some structs to make them more generic.Bastien Montagne
TLS and Settings can be used by other types of parallel 'for loops', so removing 'Range' from their names. No functional changes expected here.