diff options
Diffstat (limited to 'source/blender/blenkernel')
21 files changed, 183 insertions, 145 deletions
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index a64662f29a0..40b2d62baac 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -210,7 +210,7 @@ set(SRC intern/pbvh.c intern/pbvh_bmesh.c intern/pointcache.c - intern/pointcloud.c + intern/pointcloud.cc intern/report.c intern/rigidbody.c intern/scene.c diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 71c859e1514..f4f25c3a153 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -58,7 +58,7 @@ #include "DEG_depsgraph.h" #include "RE_pipeline.h" -#include "RE_render_ext.h" +#include "RE_texture.h" #include "SEQ_sequencer.h" diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 806b9ca1416..1b77989c2b8 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -50,7 +50,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" -#include "RE_render_ext.h" /* RE_texture_evaluate */ +#include "RE_texture.h" /* RE_texture_evaluate */ #include "BLO_read_write.h" diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 95408c7d01f..b56a15b3d45 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -76,9 +76,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" -/* to read material/texture color */ -#include "RE_render_ext.h" -#include "RE_shader_ext.h" +#include "RE_texture.h" #include "atomic_ops.h" diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f9d3fff1cec..13e9bb1bf24 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -68,8 +68,7 @@ #include "DEG_depsgraph_physics.h" #include "DEG_depsgraph_query.h" -#include "RE_render_ext.h" -#include "RE_shader_ext.h" +#include "RE_texture.h" EffectorWeights *BKE_effector_add_weights(Collection *collection) { diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 47d4b70fef5..e6d3696b198 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -841,11 +841,23 @@ bool BKE_fcurve_calc_range( */ void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt) { + if (active_bezt == NULL) { + fcu->active_keyframe_index = FCURVE_ACTIVE_KEYFRAME_NONE; + return; + } + + /* Gracefully handle out-of-bounds pointers. Ideally this would do a BLI_assert() as well, but + * then the unit tests would break in debug mode. */ + ptrdiff_t offset = active_bezt - fcu->bezt; + if (offset < 0 || offset >= fcu->totvert) { + fcu->active_keyframe_index = FCURVE_ACTIVE_KEYFRAME_NONE; + return; + } + /* The active keyframe should always be selected. */ - BLI_assert((active_bezt == NULL) || - ((active_bezt->f1 | active_bezt->f2 | active_bezt->f3) & SELECT)); - fcu->active_keyframe_index = (active_bezt == NULL) ? FCURVE_ACTIVE_KEYFRAME_NONE : - active_bezt - fcu->bezt; + BLI_assert(BEZT_ISSEL_ANY(active_bezt) || !"active keyframe must be selected"); + + fcu->active_keyframe_index = (int)offset; } /** diff --git a/source/blender/blenkernel/intern/fcurve_test.cc b/source/blender/blenkernel/intern/fcurve_test.cc index 97dd541e2b9..fb6ce02d146 100644 --- a/source/blender/blenkernel/intern/fcurve_test.cc +++ b/source/blender/blenkernel/intern/fcurve_test.cc @@ -22,6 +22,7 @@ #include "BKE_fcurve.h" #include "ED_keyframing.h" +#include "ED_types.h" /* For SELECT. */ #include "DNA_anim_types.h" @@ -295,17 +296,38 @@ TEST(fcurve_active_keyframe, ActiveKeyframe) EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE); /* Check a "normal" action. */ + fcu->bezt[2].f2 |= SELECT; BKE_fcurve_active_keyframe_set(fcu, &fcu->bezt[2]); EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), 2); - /* Check out of bounds. */ + /* Check setting an unselected keyframe as active. */ + fcu->bezt[2].f1 = fcu->bezt[2].f2 = fcu->bezt[2].f3 = 0; + EXPECT_BLI_ASSERT(BKE_fcurve_active_keyframe_set(fcu, &fcu->bezt[2]), + "active keyframe must be selected"); + EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE); + + /* Check out of bounds (lower). */ BKE_fcurve_active_keyframe_set(fcu, fcu->bezt - 20); + EXPECT_EQ(fcu->active_keyframe_index, FCURVE_ACTIVE_KEYFRAME_NONE) + << "Setting out-of-bounds value via the API should result in valid active_keyframe_index"; EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE); - /* Check out of bounds again. */ + fcu->active_keyframe_index = -20; + EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE) + << "Even with active_keyframe_index out of bounds, getting it via the API should produce a " + "valid value"; + + /* Check out of bounds (higher). */ BKE_fcurve_active_keyframe_set(fcu, fcu->bezt + 4); + EXPECT_EQ(fcu->active_keyframe_index, FCURVE_ACTIVE_KEYFRAME_NONE) + << "Setting out-of-bounds value via the API should result in valid active_keyframe_index"; EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE); + fcu->active_keyframe_index = fcu->totvert; + EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE) + << "Even with active_keyframe_index out of bounds, getting it via the API should produce a " + "valid value"; + BKE_fcurve_free(fcu); } diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 00a81e6ea2d..eb1d77eb0f4 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -80,7 +80,7 @@ # include "DEG_depsgraph.h" # include "DEG_depsgraph_query.h" -# include "RE_shader_ext.h" +# include "RE_texture.h" # include "CLG_log.h" @@ -3207,9 +3207,12 @@ static void update_effectors_task_cb(void *__restrict userdata, data->force_y[index] = retvel[1]; data->force_z[index] = retvel[2]; -# if DEBUG_PRINT +# ifdef DEBUG_PRINT /* Debugging: Print forces. */ - printf("setting force: [%f, %f, %f]\n", data->force_x[index], data->force_y[index], data->force_z[index]); + printf("setting force: [%f, %f, %f]\n", + data->force_x[index], + data->force_y[index], + data->force_z[index]); # endif } } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f87b1b5ff45..9010c846954 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2953,13 +2953,11 @@ void BKE_imbuf_write_prepare(ImBuf *ibuf, const ImageFormatData *imf) int BKE_imbuf_write(ImBuf *ibuf, const char *name, const ImageFormatData *imf) { - int ok; - BKE_imbuf_write_prepare(ibuf, imf); BLI_make_existing_file(name); - ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat); + const bool ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat); if (ok == 0) { perror(name); } diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 784cd5b2edf..0757cf791b7 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -367,7 +367,13 @@ static void view_layer_bases_hash_create(ViewLayer *view_layer) LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { if (base->object) { - BLI_ghash_insert(hash, base->object, base); + /* Some processes, like ID remapping, may lead to having several bases with the same + * object. So just take the first one here, and ignore all others + * (#BKE_layer_collection_sync will clean this up anyway). */ + void **val_pp; + if (!BLI_ghash_ensure_p(hash, base->object, &val_pp)) { + *val_pp = base; + } } } diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index aa5e28b35bf..15736011f6f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -129,8 +129,8 @@ void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, const bool do_f BKE_lib_override_library_init(dst_id, NULL); } - /* Source is already overriding data, we copy it but reuse its reference for dest ID. - * otherwise, source is only an override template, it then becomes reference of dest ID. */ + /* If source is already overriding data, we copy it but reuse its reference for dest ID. + * Otherwise, source is only an override template, it then becomes reference of dest ID. */ dst_id->override_library->reference = src_id->override_library->reference ? src_id->override_library->reference : (ID *)src_id; @@ -232,7 +232,7 @@ ID *BKE_lib_override_library_create_from_id(Main *bmain, FOREACH_MAIN_ID_BEGIN (bmain, other_id) { if ((other_id->tag & LIB_TAG_DOIT) != 0 && other_id->lib == NULL) { /* Note that using ID_REMAP_SKIP_INDIRECT_USAGE below is superfluous, as we only remap - * local IDs usages anyway... */ + * local IDs usages anyway. */ BKE_libblock_relink_ex(bmain, other_id, reference_id, @@ -256,7 +256,7 @@ ID *BKE_lib_override_library_create_from_id(Main *bmain, /** * Create overridden local copies of all tagged data-blocks in given Main. * - * \note Set id->newid of overridden libs with newly created overrides, + * \note Set `id->newid` of overridden libs with newly created overrides, * caller is responsible to clean those pointers before/after usage as needed. * * \note By default, it will only remap newly created local overriding data-blocks between @@ -289,13 +289,14 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain) for (todo_id_iter = todo_ids.first; todo_id_iter != NULL; todo_id_iter = todo_id_iter->next) { reference_id = todo_id_iter->data; if (reference_id->newid == NULL) { - /* If newid is already set, assume it has been handled by calling code. + /* If `newid` is already set, assume it has been handled by calling code. * Only current use case: re-using proxy ID when converting to liboverride. */ if ((reference_id->newid = lib_override_library_create_from(bmain, reference_id)) == NULL) { success = false; break; } - } /* We also tag the new IDs so that in next step we can remap their pointers too. */ + } + /* We also tag the new IDs so that in next step we can remap their pointers too. */ reference_id->newid->tag |= LIB_TAG_DOIT; Key *reference_key; @@ -333,7 +334,7 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain) FOREACH_MAIN_ID_BEGIN (bmain, other_id) { if ((other_id->tag & LIB_TAG_DOIT) != 0 && other_id->lib == NULL) { /* Note that using ID_REMAP_SKIP_INDIRECT_USAGE below is superfluous, as we only remap - * local IDs usages anyway... */ + * local IDs usages anyway. */ BKE_libblock_relink_ex(bmain, other_id, reference_id, @@ -381,7 +382,7 @@ static bool lib_override_hierarchy_recursive_tag(Main *bmain, id->tag |= tag; } - /* This way we won't process again that ID should we encounter it again through another + /* This way we won't process again that ID, should we encounter it again through another * relationship hierarchy. * Note that this does not free any memory from relations, so we can still use the entries. */ @@ -436,7 +437,7 @@ void BKE_lib_override_library_dependencies_tag(Main *bmain, /** * Tag all IDs in given \a bmain that are part of the same \a id_root liboverride ID group. - * That is, all other liboverrides IDs (in)directly used by \a is_root one, sharing the same + * That is, all other liboverride IDs (in)directly used by \a is_root one, and sharing the same * library for their reference IDs. * * \param id_root: The root of the hierarchy of liboverride dependencies to be tagged. @@ -481,8 +482,7 @@ static int lib_override_library_make_tag_ids_cb(LibraryIDLinkCallbackData *cb_da BLI_assert(id_owner->lib == library_root); if (id->tag & LIB_TAG_DOIT) { - /* Already processed, but maybe not with the same chain of dependency, so we need to check that - * one nonetheless. */ + /* Already processed and tagged, nothing else to do here. */ return IDWALK_RET_STOP_RECURSION; } @@ -492,7 +492,7 @@ static int lib_override_library_make_tag_ids_cb(LibraryIDLinkCallbackData *cb_da } /* We tag all collections and objects for override. And we also tag all other data-blocks which - * would user one of those. */ + * would use one of those. */ if (ELEM(GS(id->name), ID_OB, ID_GR)) { id->tag |= LIB_TAG_DOIT; } @@ -502,12 +502,12 @@ static int lib_override_library_make_tag_ids_cb(LibraryIDLinkCallbackData *cb_da static bool lib_override_library_create_do(Main *bmain, ID *id_root) { - /* Tag all collections and objects, as well as other IDs using them. */ id_root->tag |= LIB_TAG_DOIT; BKE_main_relations_create(bmain, 0); if (ELEM(GS(id_root->name), ID_OB, ID_GR)) { + /* Tag all collections and objects. */ BKE_library_foreach_ID_link(bmain, id_root, lib_override_library_make_tag_ids_cb, @@ -515,7 +515,7 @@ static bool lib_override_library_create_do(Main *bmain, ID *id_root) IDWALK_READONLY | IDWALK_RECURSE); /* Then, we remove (untag) bone shape objects, you shall never want to override those - * (hopefully)... */ + * (hopefully). */ LISTBASE_FOREACH (Object *, ob, &bmain->objects) { if (ob->type == OB_ARMATURE && ob->pose != NULL && (ob->id.tag & LIB_TAG_DOIT)) { for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan != NULL; pchan = pchan->next) { @@ -527,6 +527,10 @@ static bool lib_override_library_create_do(Main *bmain, ID *id_root) } } + /* Now tag all non-object/collection IDs 'in-between' two tagged ones, as those are part of an + * override chain and therefore alos need to be overridden. + * One very common cases are e.g. drivers on geometry or materials of an overridden object, that + * are using another overridden object as parameter. */ /* Note that this call will also free the main relations data we created above. */ BKE_lib_override_library_dependencies_tag(bmain, id_root, LIB_TAG_DOIT, false); @@ -636,16 +640,13 @@ static void lib_override_library_create_post_process( * \note Currently it only does special things if given \a id_root is an object of collection, more * specific behaviors may be added in the future for other ID types. * - * \note It will overrides all IDs tagged with \a LIB_TAG_DOIT, and it does not clear that tag at + * \note It will override all IDs tagged with \a LIB_TAG_DOIT, and it does not clear that tag at * its beginning, so caller code can add extra data-blocks to be overridden as well. * - * \note In the future that same function may be extended to support 'refresh' of overrides - * (rebuilding overrides from linked data, trying to preserve local overrides already defined). - * * \param id_root: The root ID to create an override from. * \param id_reference: Some reference ID used to do some post-processing after overrides have been - * created, may be NULL. Typically, the Empty object instantiating the linked - * collection we override, currently. + * created, may be NULL. Typically, the Empty object instantiating the linked collection we + * override, currently. * \return true if override was successfully created. */ bool BKE_lib_override_library_create( @@ -667,10 +668,10 @@ bool BKE_lib_override_library_create( } /** - * Converts a given proxy object into a library override. + * Convert a given proxy object into a library override. * - * \note This is actually a thin wrapper around \a BKE_lib_override_library_create, only extra work - * is to actually convert the proxy itself into an override first. + * \note This is a thin wrapper around \a BKE_lib_override_library_create, only extra work is to + * actually convert the proxy itself into an override first. * * \return true if override was successfully created. */ @@ -679,7 +680,7 @@ bool BKE_lib_override_library_proxy_convert(Main *bmain, ViewLayer *view_layer, Object *ob_proxy) { - /* proxy_group, if defined, is the empty instantiating the collection from which the proxy is + /* `proxy_group`, if defined, is the empty instantiating the collection from which the proxy is * coming. */ Object *ob_proxy_group = ob_proxy->proxy_group; const bool is_override_instancing_object = ob_proxy_group != NULL; @@ -688,7 +689,8 @@ bool BKE_lib_override_library_proxy_convert(Main *bmain, ID *id_reference = is_override_instancing_object ? &ob_proxy_group->id : &ob_proxy->id; /* We manually convert the proxy object into a library override, further override handling will - * then be handled by BKE_lib_override_library_create() just as for a regular override creation. + * then be handled by `BKE_lib_override_library_create()` just as for a regular override + * creation. */ ob_proxy->proxy->id.tag |= LIB_TAG_DOIT; ob_proxy->proxy->id.newid = &ob_proxy->id; @@ -728,7 +730,7 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ if (id->tag & LIB_TAG_DOIT && ID_IS_OVERRIDE_LIBRARY_REAL(id)) { /* While this should not happen in typical cases (and won't be properly supported here), user * is free to do all kind of very bad things, including having different local overrides of a - * same linked ID in a same hierarchy... */ + * same linked ID in a same hierarchy. */ if (!BLI_ghash_haskey(linkedref_to_old_override, id->override_library->reference)) { BLI_ghash_insert(linkedref_to_old_override, id->override_library->reference, id); id->override_library->reference->tag |= LIB_TAG_DOIT; @@ -738,7 +740,7 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ FOREACH_MAIN_ID_END; /* Make new override from linked data. */ - /* Note that this call also remap all pointers of tagged IDs from old override IDs to new + /* Note that this call also remaps all pointers of tagged IDs from old override IDs to new * override IDs (including within the old overrides themselves, since those are tagged too * above). */ const bool success = lib_override_library_create_do(bmain, id_root_reference); @@ -755,12 +757,12 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ ID *id_override_old = BLI_ghash_lookup(linkedref_to_old_override, id); if (id_override_old != NULL) { - /* Swap the names between old override ID and new one. */ + /* Swap the names between old override ID and new one. */ char id_name_buf[MAX_ID_NAME]; memcpy(id_name_buf, id_override_old->name, sizeof(id_name_buf)); memcpy(id_override_old->name, id_override_new->name, sizeof(id_override_old->name)); memcpy(id_override_new->name, id_name_buf, sizeof(id_override_new->name)); - /* Note that this is very efficient way to keep BMain IDs ordered as expected after + /* Note that this is a very efficient way to keep BMain IDs ordered as expected after * swapping their names. * However, one has to be very careful with this when iterating over the listbase at the * same time. Here it works because we only execute this code when we are in the linked @@ -816,7 +818,7 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ * This improves performances anyway, so everything is fine. */ FOREACH_MAIN_ID_BEGIN (bmain, id) { if (id->tag & LIB_TAG_DOIT) { - /* Note that this work because linked IDs are always after local ones (including overrides), + /* Note that this works because linked IDs are always after local ones (including overrides), * so we will only ever tag an old override ID after we have already checked it in this loop, * hence we cannot untag it later. */ if (id->newid != NULL && ID_IS_LINKED(id)) { @@ -833,7 +835,8 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ FOREACH_MAIN_ID_END; BKE_id_multi_tagged_delete(bmain); - /* At this point, id_root has very likely been deleted, we need to update it to its new version. + /* At this point, `id_root` has very likely been deleted, we need to update it to its new + * version. */ id_root = id_root_reference->newid; @@ -855,7 +858,7 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ * * \note All IDs tagged with `LIB_TAG_DOIT` will be deleted. * - * \param id_root: The root liboverride ID to resync from. + * \param id_root: The root liboverride ID to delete. */ void BKE_lib_override_library_delete(Main *bmain, ID *id_root) { @@ -864,8 +867,7 @@ void BKE_lib_override_library_delete(Main *bmain, ID *id_root) /* Tag all collections and objects, as well as other IDs using them. */ id_root->tag |= LIB_TAG_DOIT; - /* Make a mapping 'linked reference IDs' -> 'Local override IDs' of existing overrides, and tag - * linked reference ones to be overridden again. */ + /* Tag all library overrides in the chains of dependencies from the given root one. */ BKE_lib_override_library_override_group_tag(bmain, id_root, LIB_TAG_DOIT, true); ID *id; @@ -882,14 +884,9 @@ void BKE_lib_override_library_delete(Main *bmain, ID *id_root) FOREACH_MAIN_ID_END; /* Delete the override IDs. */ - FOREACH_MAIN_ID_BEGIN (bmain, id) { - if (id->tag & LIB_TAG_DOIT) { - BKE_id_delete(bmain, id); - } - } - FOREACH_MAIN_ID_END; + BKE_id_multi_tagged_delete(bmain); - /* Should not actually be needed here... */ + /* Should not actually be needed here. */ BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); } @@ -1069,7 +1066,7 @@ IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_ return ELEM(subitem_locindex, -1, opop->subitem_local_index) ? opop : NULL; } - /* index == -1 means all indices, that is valid fallback in case we requested specific index. + /* `index == -1` means all indices, that is a valid fallback in case we requested specific index. */ if (!strict && (subitem_locindex != subitem_defindex) && (opop = BLI_listbase_bytes_find( @@ -1230,7 +1227,7 @@ bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local) BLI_assert(GS(local->name) == GS(reference->name)); if (GS(local->name) == ID_OB) { - /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph evaluation would + /* Our beloved pose's bone cross-data pointers. Usually, depsgraph evaluation would * ensure this is valid, but in some situations (like hidden collections etc.) this won't * be the case, so we need to take care of this ourselves. */ Object *ob_local = (Object *)local; @@ -1290,16 +1287,16 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local) if (reference->override_library && (reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) { if (!BKE_lib_override_library_status_check_reference(bmain, reference)) { - /* If reference is also override of another data-block, and its status is not OK, + /* If reference is also an override of another data-block, and its status is not OK, * then this override is not OK either. - * Note that this should only happen when reloading libraries... */ + * Note that this should only happen when reloading libraries. */ local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK; return false; } } if (GS(local->name) == ID_OB) { - /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph evaluation would + /* Our beloved pose's bone cross-data pointers. Usually, depsgraph evaluation would * ensure this is valid, but in some situations (like hidden collections etc.) this won't * be the case, so we need to take care of this ourselves. */ Object *ob_local = (Object *)local; @@ -1332,7 +1329,7 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local) } /** - * Compares local and reference data-blocks and create new override operations as needed, + * Compare local and reference data-blocks and create new override operations as needed, * or reset to reference values if overriding is not allowed. * * \note Defining override operations is only mandatory before saving a `.blend` file on disk @@ -1341,9 +1338,9 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local) * * \note This is by far the biggest operation (the more time-consuming) of the three so far, * since it has to go over all properties in depth (all overridable ones at least). - * Generating diff values and applying overrides are much cheaper. + * Generating differential values and applying overrides are much cheaper. * - * \return true if new overriding op was created, or some local data was reset. */ + * \return true if a new overriding op was created, or some local data was reset. */ bool BKE_lib_override_library_operations_create(Main *bmain, ID *local) { BLI_assert(local->override_library != NULL); @@ -1352,7 +1349,7 @@ bool BKE_lib_override_library_operations_create(Main *bmain, ID *local) if (!is_template) { /* Do not attempt to generate overriding rules from an empty place-holder generated by link - * code when it cannot find to actual library/ID. Much better to keep the local data-block as + * code when it cannot find the actual library/ID. Much better to keep the local data-block as * is in the file in that case, until broken lib is fixed. */ if (ID_MISSING(local->override_library->reference)) { return ret; @@ -1566,7 +1563,7 @@ static void lib_override_library_id_hierarchy_recursive_reset(Main *bmain, ID *i lib_override_library_id_reset_do(bmain, id_root); - /* This way we won't process again that ID should we encounter it again through another + /* This way we won't process again that ID, should we encounter it again through another * relationship hierarchy. * Note that this does not free any memory from relations, so we can still use the entries. */ @@ -1609,7 +1606,7 @@ void BKE_lib_override_library_id_hierarchy_reset(Main *bmain, ID *id_root) FOREACH_MAIN_ID_END; } -/** Set or clear given tag in all operations as unused in that override property data. */ +/** Set or clear given tag in all operations in that override property data. */ void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty *override_property, const short tag, const bool do_set) @@ -1699,13 +1696,13 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) } /* Do not attempt to apply overriding rules over an empty place-holder generated by link code - * when it cannot find to actual library/ID. Much better to keep the local data-block as loaded + * when it cannot find the actual library/ID. Much better to keep the local data-block as loaded * from the file in that case, until broken lib is fixed. */ if (ID_MISSING(local->override_library->reference)) { return; } - /* Recursively do 'ancestors' overrides first, if any. */ + /* Recursively do 'ancestor' overrides first, if any. */ if (local->override_library->reference->override_library && (local->override_library->reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) { BKE_lib_override_library_update(bmain, local->override_library->reference); @@ -1717,7 +1714,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) /* XXX We need a way to get off-Main copies of IDs (similar to localized mats/texts/ etc.)! * However, this is whole bunch of code work in itself, so for now plain stupid ID copy - * will do, as inn-efficient as it is. :/ + * will do, as innefficient as it is. :/ * Actually, maybe not! Since we are swapping with original ID's local content, we want to * keep user-count in correct state when freeing tmp_id * (and that user-counts of IDs used by 'new' local data also remain correct). */ @@ -1738,7 +1735,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) * manual handling here. */ BLI_strncpy(tmp_id->name, local->name, sizeof(tmp_id->name)); - /* Those ugly loop-back pointers again... Luckily we only need to deal with the shape keys here, + /* Those ugly loop-back pointers again. Luckily we only need to deal with the shape keys here, * collections' parents are fully runtime and reconstructed later. */ Key *local_key = BKE_key_from_id(local); Key *tmp_key = BKE_key_from_id(tmp_id); @@ -1762,7 +1759,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) BKE_lib_id_swap(bmain, local, tmp_id); if (local_key != NULL && tmp_key != NULL) { - /* This is some kind of hard-coded 'always enforced override'... */ + /* This is some kind of hard-coded 'always enforced override'. */ BKE_lib_id_swap(bmain, &local_key->id, &tmp_key->id); tmp_key->id.flag |= (local_key->id.flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE); /* The swap of local and tmp_id inverted those pointers, we need to redefine proper @@ -1773,9 +1770,8 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) tmp_key->from = tmp_id; } - /* Again, horribly inn-efficient in our case, we need something off-Main - * (aka more generic nolib copy/free stuff)! */ - /* XXX And crashing in complex cases (e.g. because depsgraph uses same data...). */ + /* Again, horribly innefficient in our case, we need something off-Main (aka more generic nolib + * copy/free stuff)! */ BKE_id_free_ex(bmain, tmp_id, LIB_ID_FREE_NO_UI_USER, true); if (GS(local->name) == ID_AR) { @@ -1803,7 +1799,7 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) local->tag |= LIB_TAG_OVERRIDE_LIBRARY_REFOK; /* Full rebuild of Depsgraph! */ - /* Note: this is really brute force, in theory updates from RNA should have handle this already, + /* Note: this is really brute force, in theory updates from RNA should have handled this already, * but for now let's play it safe. */ DEG_id_tag_update_ex(bmain, local, ID_RECALC_ALL); DEG_relations_tag_update(bmain); @@ -1834,12 +1830,11 @@ void BKE_lib_override_library_main_update(Main *bmain) * Storage (how to store overriding data into `.blend` files). * * Basically: - * 1) Only 'differential' storage needs special handling here. All others (replacing values or + * 1) Only 'differential' overrides needs special handling here. All others (replacing values or * inserting/removing items from a collection) can be handled with simply storing current * content of local data-block. - * 2) We store the differential value into a second 'ghost' data-block, - * which is an empty ID of same type as local one, - * where we only define values that need differential data. + * 2) We store the differential value into a second 'ghost' data-block, which is an empty ID of + * same type as the local one, where we only define values that need differential data. * * This avoids us having to modify 'real' data-block at write time (and restoring it afterwards), * which is inefficient, and potentially dangerous (in case of concurrent access...), while not @@ -1881,15 +1876,15 @@ ID *BKE_lib_override_library_operations_store_start(Main *bmain, /* This is fully disabled for now, as it generated very hard to solve issues with Collections and * how they reference each-other in their parents/children relations. - * Core of the issue is creating and storing those copies in a separate BMain, while collection - * copy code re-assign blindly parents/children, even if they do not belong to the same BMain. + * Core of the issue is creating and storing those copies in a separate Main, while collection + * copy code re-assign blindly parents/children, even if they do not belong to the same Main. * One solution could be to implement special flag as discussed below, and prevent any * other-ID-reference creation/update in that case (since no differential operation is expected * to involve those anyway). */ #if 0 /* XXX TODO We may also want a specialized handling of things here too, to avoid copying heavy * never-overridable data (like Mesh geometry etc.)? And also maybe avoid lib - * reference-counting completely (shallow copy...). */ + * reference-counting completely (shallow copy). */ /* This would imply change in handling of user-count all over RNA * (and possibly all over Blender code). * Not impossible to do, but would rather see first is extra useless usual user handling is @@ -1928,7 +1923,7 @@ void BKE_lib_override_library_operations_store_end( BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(local)); /* Nothing else to do here really, we need to keep all temp override storage data-blocks in - * memory until whole file is written anyway (otherwise we'd get mem pointers overlap...). */ + * memory until whole file is written anyway (otherwise we'd get mem pointers overlap). */ local->override_library->storage = NULL; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index f9aa6dcca6a..5b0b1f333f4 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -4868,8 +4868,10 @@ void BKE_object_runtime_reset_on_copy(Object *object, const int UNUSED(flag)) { Object_Runtime *runtime = &object->runtime; runtime->data_eval = NULL; + runtime->gpd_eval = NULL; runtime->mesh_deform_eval = NULL; runtime->curve_cache = NULL; + runtime->object_as_temp_mesh = NULL; } /** diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 6c770e53000..1d62a1cce2a 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -47,7 +47,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" -#include "RE_render_ext.h" +#include "RE_texture.h" #include "BLI_hash.h" diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 222325727c1..0b331fb88d2 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -83,7 +83,7 @@ #include "DEG_depsgraph_build.h" #include "DEG_depsgraph_query.h" -#include "RE_render_ext.h" +#include "RE_texture.h" #include "BLO_read_write.h" diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 91bdfaeae95..4117dfc0b23 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -83,7 +83,7 @@ #include "PIL_time.h" -#include "RE_shader_ext.h" +#include "RE_texture.h" /* FLUID sim particle import */ #ifdef WITH_FLUID diff --git a/source/blender/blenkernel/intern/pointcloud.c b/source/blender/blenkernel/intern/pointcloud.cc index 62c4c4441ba..cbfb1086e8d 100644 --- a/source/blender/blenkernel/intern/pointcloud.c +++ b/source/blender/blenkernel/intern/pointcloud.cc @@ -67,7 +67,7 @@ static void pointcloud_init_data(ID *id) CustomData_add_layer_named(&pointcloud->pdata, CD_PROP_FLOAT3, CD_CALLOC, - NULL, + nullptr, pointcloud->totpoint, POINTCLOUD_ATTR_POSITION); BKE_pointcloud_update_customdata_pointers(pointcloud); @@ -77,7 +77,7 @@ static void pointcloud_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_s { PointCloud *pointcloud_dst = (PointCloud *)id_dst; const PointCloud *pointcloud_src = (const PointCloud *)id_src; - pointcloud_dst->mat = MEM_dupallocN(pointcloud_dst->mat); + pointcloud_dst->mat = static_cast<Material **>(MEM_dupallocN(pointcloud_dst->mat)); const eCDAllocType alloc_type = (flag & LIB_ID_COPY_CD_REFERENCE) ? CD_REFERENCE : CD_DUPLICATE; CustomData_copy(&pointcloud_src->pdata, @@ -109,7 +109,7 @@ static void pointcloud_blend_write(BlendWriter *writer, ID *id, const void *id_a { PointCloud *pointcloud = (PointCloud *)id; if (pointcloud->id.us > 0 || BLO_write_is_undo(writer)) { - CustomDataLayer *players = NULL, players_buff[CD_TEMP_CHUNK_SIZE]; + CustomDataLayer *players = nullptr, players_buff[CD_TEMP_CHUNK_SIZE]; CustomData_blend_write_prepare( &pointcloud->pdata, &players, players_buff, ARRAY_SIZE(players_buff)); @@ -164,28 +164,28 @@ static void pointcloud_blend_read_expand(BlendExpander *expander, ID *id) } IDTypeInfo IDType_ID_PT = { - .id_code = ID_PT, - .id_filter = FILTER_ID_PT, - .main_listbase_index = INDEX_ID_PT, - .struct_size = sizeof(PointCloud), - .name = "PointCloud", - .name_plural = "pointclouds", - .translation_context = BLT_I18NCONTEXT_ID_POINTCLOUD, - .flags = 0, - - .init_data = pointcloud_init_data, - .copy_data = pointcloud_copy_data, - .free_data = pointcloud_free_data, - .make_local = NULL, - .foreach_id = pointcloud_foreach_id, - .foreach_cache = NULL, - - .blend_write = pointcloud_blend_write, - .blend_read_data = pointcloud_blend_read_data, - .blend_read_lib = pointcloud_blend_read_lib, - .blend_read_expand = pointcloud_blend_read_expand, - - .blend_read_undo_preserve = NULL, + /* id_code */ ID_PT, + /* id_filter */ FILTER_ID_PT, + /* main_listbase_index */ INDEX_ID_PT, + /* struct_size */ sizeof(PointCloud), + /* name */ "PointCloud", + /* name_plural */ "pointclouds", + /* translation_context */ BLT_I18NCONTEXT_ID_POINTCLOUD, + /* flags */ 0, + + /* init_data */ pointcloud_init_data, + /* copy_data */ pointcloud_copy_data, + /* free_data */ pointcloud_free_data, + /* make_local */ nullptr, + /* foreach_id */ pointcloud_foreach_id, + /* foreach_cache */ nullptr, + + /* blend_write */ pointcloud_blend_write, + /* blend_read_data */ pointcloud_blend_read_data, + /* blend_read_lib */ pointcloud_blend_read_lib, + /* blend_read_expand */ pointcloud_blend_read_expand, + + /* blend_read_undo_preserve */ nullptr, }; static void pointcloud_random(PointCloud *pointcloud) @@ -208,21 +208,21 @@ static void pointcloud_random(PointCloud *pointcloud) void *BKE_pointcloud_add(Main *bmain, const char *name) { - PointCloud *pointcloud = BKE_id_new(bmain, ID_PT, name); + PointCloud *pointcloud = static_cast<PointCloud *>(BKE_id_new(bmain, ID_PT, name)); return pointcloud; } void *BKE_pointcloud_add_default(Main *bmain, const char *name) { - PointCloud *pointcloud = BKE_libblock_alloc(bmain, ID_PT, name, 0); + PointCloud *pointcloud = static_cast<PointCloud *>(BKE_libblock_alloc(bmain, ID_PT, name, 0)); pointcloud_init_data(&pointcloud->id); CustomData_add_layer_named(&pointcloud->pdata, CD_PROP_FLOAT, CD_CALLOC, - NULL, + nullptr, pointcloud->totpoint, POINTCLOUD_ATTR_RADIUS); pointcloud_random(pointcloud); @@ -233,14 +233,14 @@ void *BKE_pointcloud_add_default(Main *bmain, const char *name) BoundBox *BKE_pointcloud_boundbox_get(Object *ob) { BLI_assert(ob->type == OB_POINTCLOUD); - PointCloud *pointcloud = ob->data; + PointCloud *pointcloud = static_cast<PointCloud *>(ob->data); - if (ob->runtime.bb != NULL && (ob->runtime.bb->flag & BOUNDBOX_DIRTY) == 0) { + if (ob->runtime.bb != nullptr && (ob->runtime.bb->flag & BOUNDBOX_DIRTY) == 0) { return ob->runtime.bb; } - if (ob->runtime.bb == NULL) { - ob->runtime.bb = MEM_callocN(sizeof(BoundBox), "pointcloud boundbox"); + if (ob->runtime.bb == nullptr) { + ob->runtime.bb = static_cast<BoundBox *>(MEM_callocN(sizeof(BoundBox), "pointcloud boundbox")); float min[3], max[3]; INIT_MINMAX(min, max); @@ -264,10 +264,10 @@ BoundBox *BKE_pointcloud_boundbox_get(Object *ob) void BKE_pointcloud_update_customdata_pointers(PointCloud *pointcloud) { - pointcloud->co = CustomData_get_layer_named( - &pointcloud->pdata, CD_PROP_FLOAT3, POINTCLOUD_ATTR_POSITION); - pointcloud->radius = CustomData_get_layer_named( - &pointcloud->pdata, CD_PROP_FLOAT, POINTCLOUD_ATTR_RADIUS); + pointcloud->co = static_cast<float(*)[3]>( + CustomData_get_layer_named(&pointcloud->pdata, CD_PROP_FLOAT3, POINTCLOUD_ATTR_POSITION)); + pointcloud->radius = static_cast<float *>( + CustomData_get_layer_named(&pointcloud->pdata, CD_PROP_FLOAT, POINTCLOUD_ATTR_RADIUS)); } bool BKE_pointcloud_customdata_required(PointCloud *UNUSED(pointcloud), CustomDataLayer *layer) @@ -279,11 +279,11 @@ bool BKE_pointcloud_customdata_required(PointCloud *UNUSED(pointcloud), CustomDa PointCloud *BKE_pointcloud_new_for_eval(const PointCloud *pointcloud_src, int totpoint) { - PointCloud *pointcloud_dst = BKE_id_new_nomain(ID_PT, NULL); + PointCloud *pointcloud_dst = static_cast<PointCloud *>(BKE_id_new_nomain(ID_PT, nullptr)); CustomData_free(&pointcloud_dst->pdata, pointcloud_dst->totpoint); STRNCPY(pointcloud_dst->id.name, pointcloud_src->id.name); - pointcloud_dst->mat = MEM_dupallocN(pointcloud_src->mat); + pointcloud_dst->mat = static_cast<Material **>(MEM_dupallocN(pointcloud_src->mat)); pointcloud_dst->totcol = pointcloud_src->totcol; pointcloud_dst->totpoint = totpoint; @@ -302,7 +302,7 @@ PointCloud *BKE_pointcloud_copy_for_eval(struct PointCloud *pointcloud_src, bool flags |= LIB_ID_COPY_CD_REFERENCE; } - PointCloud *result = (PointCloud *)BKE_id_copy_ex(NULL, &pointcloud_src->id, NULL, flags); + PointCloud *result = (PointCloud *)BKE_id_copy_ex(nullptr, &pointcloud_src->id, nullptr, flags); return result; } @@ -326,7 +326,7 @@ static PointCloud *pointcloud_evaluate_modifiers(struct Depsgraph *depsgraph, /* Evaluate modifiers. */ for (; md; md = md->next) { - const ModifierTypeInfo *mti = BKE_modifier_get_info(md->type); + const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); if (!BKE_modifier_is_enabled(scene, md, required_mode)) { continue; @@ -345,7 +345,7 @@ static PointCloud *pointcloud_evaluate_modifiers(struct Depsgraph *depsgraph, BKE_pointcloud_update_customdata_pointers(pointcloud); /* Created deformed coordinates array on demand. */ - mti->deformVerts(md, &mectx, NULL, pointcloud->co, pointcloud->totpoint); + mti->deformVerts(md, &mectx, nullptr, pointcloud->co, pointcloud->totpoint); } else if (mti->modifyPointCloud) { /* Ensure we are not modifying the input. */ @@ -358,7 +358,7 @@ static PointCloud *pointcloud_evaluate_modifiers(struct Depsgraph *depsgraph, if (pointcloud_next && pointcloud_next != pointcloud) { /* If the modifier returned a new pointcloud, release the old one. */ if (pointcloud != pointcloud_input) { - BKE_id_free(NULL, pointcloud); + BKE_id_free(nullptr, pointcloud); } pointcloud = pointcloud_next; } @@ -374,7 +374,7 @@ void BKE_pointcloud_data_update(struct Depsgraph *depsgraph, struct Scene *scene BKE_object_free_derived_caches(object); /* Evaluate modifiers. */ - PointCloud *pointcloud = object->data; + PointCloud *pointcloud = static_cast<PointCloud *>(object->data); PointCloud *pointcloud_eval = pointcloud_evaluate_modifiers( depsgraph, scene, object, pointcloud); @@ -384,8 +384,8 @@ void BKE_pointcloud_data_update(struct Depsgraph *depsgraph, struct Scene *scene } /* Draw Cache */ -void (*BKE_pointcloud_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode) = NULL; -void (*BKE_pointcloud_batch_cache_free_cb)(PointCloud *pointcloud) = NULL; +void (*BKE_pointcloud_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode) = nullptr; +void (*BKE_pointcloud_batch_cache_free_cb)(PointCloud *pointcloud) = nullptr; void BKE_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 07532d525bd..8b66b1fc628 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -1323,7 +1323,10 @@ int BKE_sound_scene_playing(Scene *UNUSED(scene)) { return -1; } -void BKE_sound_read_waveform(Main *bmain, bSound *sound, short *stop) +void BKE_sound_read_waveform(Main *bmain, + bSound *sound, + /* NOLINTNEXTLINE: readability-non-const-parameter. */ + short *stop) { UNUSED_VARS(sound, stop, bmain); } diff --git a/source/blender/blenkernel/intern/subdiv_displacement_multires.c b/source/blender/blenkernel/intern/subdiv_displacement_multires.c index 69cac840276..0fb08880dd5 100644 --- a/source/blender/blenkernel/intern/subdiv_displacement_multires.c +++ b/source/blender/blenkernel/intern/subdiv_displacement_multires.c @@ -442,7 +442,7 @@ void BKE_subdiv_displacement_attach_from_multires(Subdiv *subdiv, { /* Make sure we don't have previously assigned displacement. */ BKE_subdiv_displacement_detach(subdiv); - /* It is possible to have mesh without MDISPS layer. Happens when using + /* It is possible to have mesh without CD_MDISPS layer. Happens when using * dynamic topology. */ if (!CustomData_has_layer(&mesh->ldata, CD_MDISPS)) { return; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index a77e0ed2b7d..4c2e4a82acb 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -67,7 +67,7 @@ #include "BKE_scene.h" #include "BKE_texture.h" -#include "RE_shader_ext.h" +#include "RE_texture.h" #include "BLO_read_write.h" diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index bcd71e39b21..11aa9597740 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -1142,7 +1142,7 @@ VolumeGrid *BKE_volume_grid_get(const Volume *volume, int grid_index) return nullptr; #else UNUSED_VARS(volume, grid_index); - return NULL; + return nullptr; #endif } @@ -1409,7 +1409,7 @@ VolumeGrid *BKE_volume_grid_add(Volume *volume, const char *name, VolumeGridType return &grids.back(); #else UNUSED_VARS(volume, name, type); - return NULL; + return nullptr; #endif } diff --git a/source/blender/blenkernel/intern/volume_render.cc b/source/blender/blenkernel/intern/volume_render.cc index 55e04911d42..5c71f1d7eca 100644 --- a/source/blender/blenkernel/intern/volume_render.cc +++ b/source/blender/blenkernel/intern/volume_render.cc @@ -386,7 +386,7 @@ void BKE_volume_grid_wireframe(const Volume *volume, #else UNUSED_VARS(volume, volume_grid); - cb(cb_userdata, NULL, NULL, 0, 0); + cb(cb_userdata, nullptr, nullptr, 0, 0); #endif } @@ -432,7 +432,7 @@ void BKE_volume_grid_selection_surface(const Volume *volume, cb(cb_userdata, (float(*)[3])verts.data(), (int(*)[3])tris.data(), verts.size(), tris.size()); #else UNUSED_VARS(volume, volume_grid); - cb(cb_userdata, NULL, NULL, 0, 0); + cb(cb_userdata, nullptr, nullptr, 0, 0); #endif } |