From 35d2a2284659ca0e308d37765b803a66157de2f7 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 24 Jun 2022 16:16:43 -0500 Subject: Cleanup: Remove unused argument --- source/blender/blenkernel/intern/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index c8b87c27697..94b606d6a02 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -4318,7 +4318,7 @@ Mesh *BKE_object_get_evaluated_mesh(const Object *object) } if (object->data && GS(((const ID *)object->data)->name) == ID_ME) { - mesh = BKE_mesh_wrapper_ensure_subdivision(object, mesh); + mesh = BKE_mesh_wrapper_ensure_subdivision(mesh); } return mesh; -- cgit v1.2.3 From 7b6b740ace1e56a8217fb44ed9fd3cf0c0a324f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Jun 2022 17:29:57 +1000 Subject: Cleanup: spelling in comments --- source/blender/blenkernel/intern/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 94b606d6a02..e87b43c627c 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -2273,7 +2273,7 @@ Object *BKE_object_add(Main *bmain, ViewLayer *view_layer, int type, const char LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer); BKE_collection_viewlayer_object_add(bmain, view_layer, layer_collection->collection, ob); - /* Note: There is no way to be sure that #BKE_collection_viewlayer_object_add will actually + /* NOTE: There is no way to be sure that #BKE_collection_viewlayer_object_add will actually * manage to find a valid collection in given `view_layer` to add the new object to. */ Base *base = BKE_view_layer_base_find(view_layer, ob); if (base != nullptr) { -- cgit v1.2.3 From 34c701abbdbfa6143c11e1b6f8d7797257c70237 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Jul 2022 14:57:43 +1000 Subject: Fix T99270: bones using empties as custom shapes can't be selected Regression in [0] which didn't account for the bounds of empty objects. Add support support calculating bounds from empty draw-type to use in pose-bone culling. [0]: 3267c91b4d5caab7da8aef071a446dd2e86f86a9 --- source/blender/blenkernel/intern/object.cc | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index e87b43c627c..5ed1ac98ddf 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -3985,6 +3985,70 @@ bool BKE_object_empty_image_data_is_visible_in_view3d(const Object *ob, const Re return true; } +bool BKE_object_minmax_empty_drawtype(const struct Object *ob, float r_min[3], float r_max[3]) +{ + BLI_assert(ob->type == OB_EMPTY); + float3 min(0), max(0); + + bool ok = false; + const float radius = ob->empty_drawsize; + + switch (ob->empty_drawtype) { + case OB_ARROWS: { + max = float3(radius); + ok = true; + break; + } + case OB_PLAINAXES: + case OB_CUBE: + case OB_EMPTY_SPHERE: { + min = float3(-radius); + max = float3(radius); + ok = true; + break; + } + case OB_CIRCLE: { + max[0] = max[2] = radius; + min[0] = min[2] = -radius; + ok = true; + break; + } + case OB_SINGLE_ARROW: { + max[2] = radius; + ok = true; + break; + } + case OB_EMPTY_CONE: { + min = float3(-radius, 0.0f, -radius); + max = float3(radius, radius * 2.0f, radius); + ok = true; + break; + } + case OB_EMPTY_IMAGE: { + const float *ofs = ob->ima_ofs; + /* NOTE: this is the best approximation that can be calculated without loading the image. */ + min[0] = ofs[0] * radius; + min[1] = ofs[1] * radius; + max[0] = radius + (ofs[0] * radius); + max[1] = radius + (ofs[1] * radius); + /* Since the image aspect can shrink the bounds towards the object origin, + * adjust the min/max to account for that. */ + for (int i = 0; i < 2; i++) { + CLAMP_MAX(min[i], 0.0f); + CLAMP_MIN(max[i], 0.0f); + } + ok = true; + break; + } + } + + if (ok) { + copy_v3_v3(r_min, min); + copy_v3_v3(r_max, max); + } + return ok; +} + bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, -- cgit v1.2.3 From eb7218de8dba2a977fdcf8f2e75b16fcd8fc044a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 4 Jul 2022 13:02:24 +0200 Subject: Fix T99386: Driven modifiers are always re-evaluated during animation Even if the driver is not dependent on time the modifiers were always re-evaluated during playback. This is due to the legacy nature of the check whether modifier depends on time or not: it was simply checking for sub-string match for modifier in the F-Curve and drivers RNA paths. Nowadays such dependencies are created by the dependency graph builder, which allows to have more granular control over what depends on what. The code is now simplified to only check for "static" dependency of the modifier form time: for example, Wave modifier which always depends on time (even without explicit animation involved). This change also fixes missing relation from the animation component to the shader_fx modifiers, fixing race condition. Additional files used to verify relations: - Geometry: F13257368 - Grease Pencil: F13257369 - Shader FX: F13257370 In these files different types of modifiers have an animated property, and the purpose of the test is to verify that the modifiers do react to the animation and that there is a relation between animation and geometry components of the object. The latter one can only be checked using the dependency graph relation visualization. The drivers are not tested by these files. Those are not typically depend on time, and if there were missing relation from driver to the modifier we'd receive a bug report already. As well as if there was a bug in missing time relation to a driver we'd also receive a report. Differential Revision: https://developer.blender.org/D15358 --- source/blender/blenkernel/intern/object.cc | 120 ----------------------------- 1 file changed, 120 deletions(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 5ed1ac98ddf..f7436b6112c 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -5357,126 +5357,6 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) /** \name Object Modifier Utilities * \{ */ -bool BKE_object_modifier_use_time(Scene *scene, Object *ob, ModifierData *md) -{ - if (BKE_modifier_depends_ontime(scene, md)) { - return true; - } - - /* Check whether modifier is animated. */ - /* TODO: this should be handled as part of build_animdata() -- Aligorith */ - if (ob->adt) { - AnimData *adt = ob->adt; - FCurve *fcu; - - char md_name_esc[sizeof(md->name) * 2]; - BLI_str_escape(md_name_esc, md->name, sizeof(md_name_esc)); - - char pattern[sizeof(md_name_esc) + 16]; - BLI_snprintf(pattern, sizeof(pattern), "modifiers[\"%s\"]", md_name_esc); - - /* action - check for F-Curves with paths containing 'modifiers[' */ - if (adt->action) { - for (fcu = (FCurve *)adt->action->curves.first; fcu != nullptr; fcu = (FCurve *)fcu->next) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - } - - /* This here allows modifier properties to get driven and still update properly - * - * Workaround to get T26764 (e.g. subsurf levels not updating when animated/driven) - * working, without the updating problems (T28525 T28690 T28774 T28777) caused - * by the RNA updates cache introduced in r.38649 - */ - for (fcu = (FCurve *)adt->drivers.first; fcu != nullptr; fcu = (FCurve *)fcu->next) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - - /* XXX: also, should check NLA strips, though for now assume that nobody uses - * that and we can omit that for performance reasons... */ - } - - return false; -} - -bool BKE_object_modifier_gpencil_use_time(Object *ob, GpencilModifierData *md) -{ - if (BKE_gpencil_modifier_depends_ontime(md)) { - return true; - } - - /* Check whether modifier is animated. */ - /* TODO(Aligorith): this should be handled as part of build_animdata() */ - if (ob->adt) { - AnimData *adt = ob->adt; - - char md_name_esc[sizeof(md->name) * 2]; - BLI_str_escape(md_name_esc, md->name, sizeof(md_name_esc)); - - char pattern[sizeof(md_name_esc) + 32]; - BLI_snprintf(pattern, sizeof(pattern), "grease_pencil_modifiers[\"%s\"]", md_name_esc); - - /* action - check for F-Curves with paths containing 'grease_pencil_modifiers[' */ - if (adt->action) { - LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - } - - /* This here allows modifier properties to get driven and still update properly */ - LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - } - - return false; -} - -bool BKE_object_shaderfx_use_time(Object *ob, ShaderFxData *fx) -{ - if (BKE_shaderfx_depends_ontime(fx)) { - return true; - } - - /* Check whether effect is animated. */ - /* TODO(Aligorith): this should be handled as part of build_animdata() */ - if (ob->adt) { - AnimData *adt = ob->adt; - - char fx_name_esc[sizeof(fx->name) * 2]; - BLI_str_escape(fx_name_esc, fx->name, sizeof(fx_name_esc)); - - char pattern[sizeof(fx_name_esc) + 32]; - BLI_snprintf(pattern, sizeof(pattern), "shader_effects[\"%s\"]", fx_name_esc); - - /* action - check for F-Curves with paths containing string[' */ - if (adt->action) { - LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - } - - /* This here allows properties to get driven and still update properly */ - LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { - return true; - } - } - } - - return false; -} - /** * Set "ignore cache" flag for all caches on this object. */ -- cgit v1.2.3 From 9f153949f9ee1cbea04687c2a99d9e1e2f891962 Mon Sep 17 00:00:00 2001 From: Erik Abrahamsson Date: Tue, 12 Jul 2022 18:31:33 +0200 Subject: Enable "copy to selected" for new Curves modifiers The operator bpy.ops.object.modifier_copy_to_selected() does not work for the new Curves objects. This is because it isn't added to BKE_object_supports_modifiers. Differential Revision: https://developer.blender.org/D15439 --- source/blender/blenkernel/intern/object.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index f7436b6112c..62ebb45b0ed 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -1402,6 +1402,7 @@ bool BKE_object_supports_modifiers(const Object *ob) { return (ELEM(ob->type, OB_MESH, + OB_CURVES, OB_CURVES_LEGACY, OB_SURF, OB_FONT, -- cgit v1.2.3 From 500d815478966de6ad509c2e6a73c61fce8513a5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 25 Aug 2022 17:21:39 +0200 Subject: Fix T100255: Make RigidBodyWorld (and effector_weights) collections refcounted. 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 --- source/blender/blenkernel/intern/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 62ebb45b0ed..2a85811e2e8 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -449,7 +449,7 @@ static void object_foreach_id(ID *id, LibraryForeachIDData *data) if (object->soft->effector_weights) { BKE_LIB_FOREACHID_PROCESS_IDSUPER( - data, object->soft->effector_weights->group, IDWALK_CB_NOP); + data, object->soft->effector_weights->group, IDWALK_CB_USER); } } } -- cgit v1.2.3 From 25237d2625078c6d14d744f288776299efd3c7c8 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 30 Aug 2022 14:54:53 -0500 Subject: Attributes: Improve custom data initialization options 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 --- source/blender/blenkernel/intern/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 2a85811e2e8..c90c83074bd 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -1665,7 +1665,7 @@ static void copy_ccg_data(Mesh *mesh_destination, Mesh *mesh_source, int layer_t const int layer_index = CustomData_get_layer_index(data_destination, layer_type); CustomData_free_layer(data_destination, layer_type, num_elements, layer_index); BLI_assert(!CustomData_has_layer(data_destination, layer_type)); - CustomData_add_layer(data_destination, layer_type, CD_CALLOC, nullptr, num_elements); + CustomData_add_layer(data_destination, layer_type, CD_SET_DEFAULT, nullptr, num_elements); BLI_assert(CustomData_has_layer(data_destination, layer_type)); CustomData_copy_layer_type_data(data_source, data_destination, layer_type, 0, 0, num_elements); } -- cgit v1.2.3 From 17501c146edc4af8a5e04565dc4d0b30ed5c5323 Mon Sep 17 00:00:00 2001 From: Monique Dewanchand Date: Thu, 1 Sep 2022 10:00:53 +0200 Subject: Cleanup: Remove/replace View Layer macros. This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799 --- source/blender/blenkernel/intern/object.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index c90c83074bd..0389fa2f1c6 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -2547,7 +2547,7 @@ Object **BKE_object_pose_array_get_ex(ViewLayer *view_layer, uint *r_objects_len, bool unique) { - Object *ob_active = OBACT(view_layer); + Object *ob_active = BKE_view_layer_active_object_get(view_layer); Object *ob_pose = BKE_object_pose_armature_get(ob_active); Object **objects = nullptr; if (ob_pose == ob_active) { @@ -2583,7 +2583,7 @@ Base **BKE_object_pose_base_array_get_ex(ViewLayer *view_layer, uint *r_bases_len, bool unique) { - Base *base_active = BASACT(view_layer); + Base *base_active = view_layer->basact; Object *ob_pose = base_active ? BKE_object_pose_armature_get(base_active->object) : nullptr; Base *base_pose = nullptr; Base **bases = nullptr; -- cgit v1.2.3 From 05952aa94d33eeb504fa63618ba35c2bcc8bd19b Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 5 Sep 2022 11:56:34 -0500 Subject: Mesh: Remove redundant custom data pointers 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 --- source/blender/blenkernel/intern/object.cc | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 0389fa2f1c6..ec21d0b127b 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -145,6 +145,8 @@ #include "atomic_ops.h" using blender::float3; +using blender::MutableSpan; +using blender::Span; static CLG_LogRef LOG = {"bke.object"}; @@ -3189,6 +3191,7 @@ static void give_parvert(Object *par, int nr, float vec[3]) BKE_object_get_evaluated_mesh(par); if (me_eval) { + const MVert *verts = BKE_mesh_vertices(me_eval); int count = 0; int numVerts = me_eval->totvert; @@ -3222,14 +3225,14 @@ static void give_parvert(Object *par, int nr, float vec[3]) /* Get the average of all verts with (original index == nr). */ for (int i = 0; i < numVerts; i++) { if (index[i] == nr) { - add_v3_v3(vec, me_eval->mvert[i].co); + add_v3_v3(vec, verts[i].co); count++; } } } else { if (nr < numVerts) { - add_v3_v3(vec, me_eval->mvert[nr].co); + add_v3_v3(vec, verts[nr].co); count++; } } @@ -3243,7 +3246,7 @@ static void give_parvert(Object *par, int nr, float vec[3]) else { /* use first index if its out of range */ if (me_eval->totvert) { - copy_v3_v3(vec, me_eval->mvert[0].co); + copy_v3_v3(vec, verts[0].co); } } } @@ -4127,10 +4130,10 @@ void BKE_object_foreach_display_point(Object *ob, float3 co; if (mesh_eval != nullptr) { - const MVert *mv = mesh_eval->mvert; + const MVert *verts = BKE_mesh_vertices(mesh_eval); const int totvert = mesh_eval->totvert; - for (int i = 0; i < totvert; i++, mv++) { - mul_v3_m4v3(co, obmat, mv->co); + for (int i = 0; i < totvert; i++) { + mul_v3_m4v3(co, obmat, verts[i].co); func_cb(co, user_data); } } @@ -4754,7 +4757,8 @@ bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb) switch (ob->type) { case OB_MESH: { Mesh *mesh = (Mesh *)ob->data; - BKE_keyblock_convert_to_mesh(key->refkey, mesh->mvert, mesh->totvert); + MutableSpan verts = mesh->vertices_for_write(); + BKE_keyblock_convert_to_mesh(key->refkey, verts.data(), mesh->totvert); break; } case OB_CURVES_LEGACY: @@ -5250,32 +5254,31 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) const int *index; if (me_eval && (index = (const int *)CustomData_get_layer(&me_eval->vdata, CD_ORIGINDEX))) { - MVert *mvert = me_eval->mvert; - uint totvert = me_eval->totvert; + const Span verts = me->vertices(); /* Tree over-allocates in case where some verts have #ORIGINDEX_NONE. */ tot = 0; - tree = BLI_kdtree_3d_new(totvert); + tree = BLI_kdtree_3d_new(verts.size()); /* We don't how many verts from the DM we can use. */ - for (i = 0; i < totvert; i++) { + for (i = 0; i < verts.size(); i++) { if (index[i] != ORIGINDEX_NONE) { float co[3]; - mul_v3_m4v3(co, ob->obmat, mvert[i].co); + mul_v3_m4v3(co, ob->obmat, verts[i].co); BLI_kdtree_3d_insert(tree, index[i], co); tot++; } } } else { - MVert *mvert = me->mvert; + const Span verts = me->vertices(); - tot = me->totvert; + tot = verts.size(); tree = BLI_kdtree_3d_new(tot); for (i = 0; i < tot; i++) { float co[3]; - mul_v3_m4v3(co, ob->obmat, mvert[i].co); + mul_v3_m4v3(co, ob->obmat, verts[i].co); BLI_kdtree_3d_insert(tree, i, co); } } -- cgit v1.2.3 From da3d1e9165f4d0ffcb04645aded3eea489fd6cdd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 Sep 2022 12:52:05 +1000 Subject: Cleanup: spelling in comments, correct doxy slashes, replace '/w' --- source/blender/blenkernel/intern/object.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index ec21d0b127b..ac33b11fcd2 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -2416,7 +2416,7 @@ ParticleSystem *BKE_object_copy_particlesystem(ParticleSystem *psys, const int f } /* XXX(@campbellbarton): from reading existing code this seems correct but intended usage of - * point-cache should /w cloth should be added in 'ParticleSystem'. */ + * point-cache should with cloth should be added in 'ParticleSystem'. */ if (psysn->clmd) { psysn->clmd->point_cache = psysn->pointcache; } -- cgit v1.2.3 From be038b844cb53bc228d3e98bfe09071560930cde Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 7 Sep 2022 00:06:31 -0500 Subject: Cleanup: Tweak naming for recently added mesh accessors 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. --- source/blender/blenkernel/intern/object.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/object.cc') diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index ac33b11fcd2..4c3b32b6ae0 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -3191,7 +3191,7 @@ static void give_parvert(Object *par, int nr, float vec[3]) BKE_object_get_evaluated_mesh(par); if (me_eval) { - const MVert *verts = BKE_mesh_vertices(me_eval); + const MVert *verts = BKE_mesh_verts(me_eval); int count = 0; int numVerts = me_eval->totvert; @@ -4130,7 +4130,7 @@ void BKE_object_foreach_display_point(Object *ob, float3 co; if (mesh_eval != nullptr) { - const MVert *verts = BKE_mesh_vertices(mesh_eval); + const MVert *verts = BKE_mesh_verts(mesh_eval); const int totvert = mesh_eval->totvert; for (int i = 0; i < totvert; i++) { mul_v3_m4v3(co, obmat, verts[i].co); @@ -4757,7 +4757,7 @@ bool BKE_object_shapekey_remove(Main *bmain, Object *ob, KeyBlock *kb) switch (ob->type) { case OB_MESH: { Mesh *mesh = (Mesh *)ob->data; - MutableSpan verts = mesh->vertices_for_write(); + MutableSpan verts = mesh->verts_for_write(); BKE_keyblock_convert_to_mesh(key->refkey, verts.data(), mesh->totvert); break; } @@ -5254,7 +5254,7 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) const int *index; if (me_eval && (index = (const int *)CustomData_get_layer(&me_eval->vdata, CD_ORIGINDEX))) { - const Span verts = me->vertices(); + const Span verts = me->verts(); /* Tree over-allocates in case where some verts have #ORIGINDEX_NONE. */ tot = 0; @@ -5271,7 +5271,7 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot) } } else { - const Span verts = me->vertices(); + const Span verts = me->verts(); tot = verts.size(); tree = BLI_kdtree_3d_new(tot); -- cgit v1.2.3