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-07Cleanup: Tweak naming for recently added mesh accessorsHans Goudey
Use `verts` instead of `vertices` and `polys` instead of `polygons` in the API added in 05952aa94d33eeb50. This aligns better with existing naming where the shorter names are much more common.
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-03-28Cleanup: use "num" as a suffix in: source/blender/modifiersCampbell Barton
Also rename DNA struct members.
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-09Cleanup: make file headers more consistentCampbell Barton
Also some descriptive text into doc-strings.
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-13Refactor: Move normals out of MVert, lazy calculationHans Goudey
As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
2021-08-06Cleanup: use MEM_SAFE_FREE macroCampbell Barton
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
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-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
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-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-07-13Clang Tidy: enable readability-non-const-parameter warningJacques Lucke
Clang Tidy reported a couple of false positives. I disabled those `NOLINTNEXTLINE`. Differential Revision: https://developer.blender.org/D8199
2020-07-03Cleanup: Editors/Armature, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/armature` module. No functional changes.
2020-06-24Cleanup: unused struct membersCampbell Barton
2020-05-08Fix T76498: Refactoring - Rename BKE modifiers funtionsAntonio Vazquez
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-05-31Cleanup: style, use braces in source/ (include disabled blocks)Campbell Barton
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-22Cleanup: style, use braces for editorsCampbell Barton
2019-04-17ClangFormat: format '#if 0' code in source/Campbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-04Fix T63252: Bind in Mesh Deform Modifier failsSergey Sharybin
A regression since 64c8d72ef1ad. The solution is to force modifier evaluation for an evaluated object, and let it to copy binding data back to original when is being evaluated for binding. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4642
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-03Cleanup: trailing commasCampbell Barton
Needed for clan-format not to wrap onto one line.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-24Fix T59423: Mesh deform modifier bind bug causing spiky deformations.mano-wii
The intersection was being tested between ray and tri, the correct one is segment and tri.
2019-01-15Cleanup: comment line length (editors)Campbell Barton
Prevents clang-format wrapping text before comments.
2018-12-07Cleanup/refactor binding code for MeshDeform modifier.Bastien Montagne
We had two different ways of doing it, SurfaceDeform and LaplacianDeform would do it through a special modifier stack evaluation triggered from binding operator, while MeshDeform would do it through a regular depsgraph update/eval (also triggered from its binding op). This enforces the later to search back for orig modifier data inside modifier code (to apply binding on that one, and not on useless CoW one). Besides the question of safety about modifying orig data from threaded despgraph (that was *probably* OK, but think it's bad idea in general), it's much better to have a common way of doing that kind of things. For now it remains rather dodgy, but at least it's reasonably consistent and safe now. This commit also fixes a potential memleak from binding process of MeshDeform, and does some general cleanup a bit.
2018-06-29Cleanup: some moar DM kicking, in armature edit code.Bastien Montagne
2018-06-05Moved function declarations from BKE_mesh.h → BKE_mesh_runtime.hSybren A. Stüvel
2018-06-04Merge branch 'master' into blender2.8Campbell Barton
2018-06-04Cleanup: strip trailing space in editorsCampbell Barton
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-05-12Replace `BKE_bvhtree_from_mesh_looptri` with `BKE_bvhtree_from_mesh_get`.Germano
Must have had a conflict in commit rB82d59c6588d7 when merging branchs.
2018-05-08Cleanup: mesh_runtime namingCampbell Barton
- BKE_mesh_get_looptri_num -> BKE_mesh_runtime_looptri_len - BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc - BKE_mesh_get_looptri_array -> BKE_mesh_runtime_looptri_ensure
2018-05-08Ported Mesh Deform modifierSybren A. Stüvel
This modifier still has issues that are not related to this port: - While editing the deformation mesh, the deformed mesh doesn't update. This update only happens after exiting edit mode, making editing cumbersome. - Binding doesn't work yet. It works fine when binding in master and loading pre-bound in 2.8. This was also an issue before this port, and will be investigated separately.
2018-05-04Merge branch 'master' into blender2.8Germano
2018-05-04Mesh Lapacian: Use `isect_ray_tri_watertight_v3` instead of Epsilons to ↵Germano
prevent corners errors in raycast. Using FLT_EPSILON can fail with large coordinate values. This commit also avoids storing bvhtrees with different settings in BVHCache.
2018-04-15Merge branch 'master' into blender2.8Campbell Barton
2018-04-15Cleanup: ED_armature namingCampbell Barton
- Wasn't clear which functions handle edit-bones. - Mixed both ebone and edit_bone in names. - Didn't use ED_armature_* prefix for public API. See P655 to apply to branches.
2018-04-05Remove workspace object mode, reverts changes w/ 2.8Campbell Barton
This caused too many problems syncing object modes with multiple objects/windows/workspaces, see: D3130 for details.
2018-02-06Object Mode: use eval_ctx for keyframe & weight calculationCampbell Barton