diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-17 11:00:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-17 11:00:54 +0300 |
commit | 319b9d6501f2170dcf06b10de0add340d0be83a3 (patch) | |
tree | d43beea169beef1fae3c2f253e4aab7fc116bad8 /source/blender/blenkernel | |
parent | 19a703b0db1687aac2e887f32b225e897a3fac88 (diff) |
DNA: rename dup_* struct members to instance_*
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 34 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 30 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 2 |
9 files changed, 52 insertions, 52 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 2cbce902b94..41393d99db4 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -401,8 +401,8 @@ Collection *BKE_collection_master(const Scene *scene) static bool collection_object_cyclic_check_internal(Object *object, Collection *collection) { - if (object->dup_group) { - Collection *dup_collection = object->dup_group; + if (object->instance_collection) { + Collection *dup_collection = object->instance_collection; if ((dup_collection->id.tag & LIB_TAG_DOIT) == 0) { /* Cycle already exists in collections, let's prevent further crappyness */ return true; @@ -483,9 +483,9 @@ bool BKE_collection_is_empty(Collection *collection) static bool collection_object_add(Main *bmain, Collection *collection, Object *ob, int flag, const bool add_us) { - if (ob->dup_group) { + if (ob->instance_collection) { /* Cyclic dependency check. */ - if (collection_find_child_recursive(ob->dup_group, collection)) { + if (collection_find_child_recursive(ob->instance_collection, collection)) { return false; } } diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 8fd8285c433..f914441aa59 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -921,8 +921,8 @@ static void add_collision_object(ListBase *relations, Object *ob, int level, uns /* objects in dupli groups, one level only for now */ /* TODO: this doesn't really work, we are not taking into account the * dupli transforms and can get objects in the list multiple times. */ - if (ob->dup_group && level == 0) { - Collection *collection= ob->dup_group; + if (ob->instance_collection && level == 0) { + Collection *collection= ob->instance_collection; /* add objects */ FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(collection, object) diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 29e0ee0715d..92633803895 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -560,7 +560,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call data.cb_flag = data_cb_flag; CALLBACK_INVOKE(object->gpd, IDWALK_CB_USER); - CALLBACK_INVOKE(object->dup_group, IDWALK_CB_USER); + CALLBACK_INVOKE(object->instance_collection, IDWALK_CB_USER); if (object->pd) { CALLBACK_INVOKE(object->pd->tex, IDWALK_CB_USER); @@ -812,8 +812,8 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call case ID_PA: { ParticleSettings *psett = (ParticleSettings *) id; - CALLBACK_INVOKE(psett->dup_group, IDWALK_CB_USER); - CALLBACK_INVOKE(psett->dup_ob, IDWALK_CB_NOP); + CALLBACK_INVOKE(psett->instance_collection, IDWALK_CB_USER); + CALLBACK_INVOKE(psett->instance_object, IDWALK_CB_NOP); CALLBACK_INVOKE(psett->bb_ob, IDWALK_CB_NOP); CALLBACK_INVOKE(psett->collision_group, IDWALK_CB_NOP); @@ -854,7 +854,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call } } - for (ParticleDupliWeight *dw = psett->dupliweights.first; dw; dw = dw->next) { + for (ParticleDupliWeight *dw = psett->instance_weights.first; dw; dw = dw->next) { CALLBACK_INVOKE(dw->ob, IDWALK_CB_NOP); } break; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index a2bf36bc660..5f4a64e502e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -852,7 +852,7 @@ void BKE_object_init(Object *ob) ob->upflag = OB_POSZ; } - ob->dupfacesca = 1.0; + ob->instance_faces_scale = 1.0; ob->col_group = 0x01; ob->col_mask = 0xffff; @@ -1576,9 +1576,9 @@ void BKE_object_make_proxy(Main *bmain, Object *ob, Object *target, Object *cob) if (cob) { ob->rotmode = target->rotmode; mul_m4_m4m4(ob->obmat, cob->obmat, target->obmat); - if (cob->dup_group) { /* should always be true */ + if (cob->instance_collection) { /* should always be true */ float tvec[3]; - mul_v3_mat3_m4v3(tvec, ob->obmat, cob->dup_group->dupli_ofs); + mul_v3_mat3_m4v3(tvec, ob->obmat, cob->instance_collection->dupli_ofs); sub_v3_v3(ob->obmat[3], tvec); } BKE_object_apply_mat4(ob, ob->obmat, false, true); diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index db6855ccaf3..8a70faf69ec 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -119,7 +119,7 @@ static void copy_dupli_context(DupliContext *r_ctx, const DupliContext *ctx, Obj /* XXX annoying, previously was done by passing an ID* argument, this at least is more explicit */ if (ctx->gen->type == OB_DUPLICOLLECTION) - r_ctx->collection = ctx->object->dup_group; + r_ctx->collection = ctx->object->instance_collection; r_ctx->object = ob; if (mat) @@ -270,8 +270,8 @@ static void make_duplis_collection(const DupliContext *ctx) Collection *collection; float collection_mat[4][4]; - if (ob->dup_group == NULL) return; - collection = ob->dup_group; + if (ob->instance_collection == NULL) return; + collection = ob->instance_collection; /* combine collection offset and obmat */ unit_m4(collection_mat); @@ -614,7 +614,7 @@ static void make_child_duplis_faces(const DupliContext *ctx, void *userdata, Obj continue; /* obmat is transform to face */ - get_dupliface_transform(mp, loopstart, mvert, fdd->use_scale, ctx->object->dupfacesca, obmat); + get_dupliface_transform(mp, loopstart, mvert, fdd->use_scale, ctx->object->instance_faces_scale, obmat); /* make offset relative to inst_ob using relative child transform */ mul_mat3_m4_v3(child_imat, obmat[3]); @@ -767,14 +767,14 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem /* first check for loops (particle system object used as dupli object) */ if (part->ren_as == PART_DRAW_OB) { - if (ELEM(part->dup_ob, NULL, par)) + if (ELEM(part->instance_object, NULL, par)) return; } else { /*PART_DRAW_GR */ - if (part->dup_group == NULL) + if (part->instance_collection == NULL) return; - const ListBase dup_collection_objects = BKE_collection_object_cache_get(part->dup_group); + const ListBase dup_collection_objects = BKE_collection_object_cache_get(part->instance_collection); if (BLI_listbase_is_empty(&dup_collection_objects)) return; @@ -806,8 +806,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem if (part->draw & PART_DRAW_COUNT_GR) { psys_find_group_weights(part); - for (dw = part->dupliweights.first; dw; dw = dw->next) { - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->dup_group, object, mode) + for (dw = part->instance_weights.first; dw; dw = dw->next) { + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object, mode) { if (dw->ob == object) { totcollection += dw->count; @@ -818,7 +818,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } } else { - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->dup_group, object, mode) + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object, mode) { (void) object; totcollection++; @@ -830,8 +830,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem if (part->draw & PART_DRAW_COUNT_GR) { a = 0; - for (dw = part->dupliweights.first; dw; dw = dw->next) { - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->dup_group, object, mode) + for (dw = part->instance_weights.first; dw; dw = dw->next) { + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object, mode) { if (dw->ob == object) { for (b = 0; b < dw->count; b++, a++) { @@ -845,7 +845,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } else { a = 0; - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->dup_group, object, mode) + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object, mode) { oblist[a] = object; a++; @@ -854,7 +854,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } } else { - ob = part->dup_ob; + ob = part->instance_object; } if (totchild == 0 || part->draw & PART_DRAW_PARENT) @@ -933,7 +933,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem if (part->ren_as == PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) { b = 0; - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->dup_group, object, mode) + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object, mode) { copy_m4_m4(tmat, oblist[b]->obmat); @@ -942,8 +942,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem mul_v3_fl(tmat[3], size * scale); /* collection dupli offset, should apply after everything else */ - if (!is_zero_v3(part->dup_group->dupli_ofs)) { - sub_v3_v3(tmat[3], part->dup_group->dupli_ofs); + if (!is_zero_v3(part->instance_collection->dupli_ofs)) { + sub_v3_v3(tmat[3], part->instance_collection->dupli_ofs); } /* individual particle transform */ diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index f41789f6a1d..c6b66f2456f 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -226,8 +226,8 @@ void BKE_object_handle_data_update( if (psys_check_enabled(ob, psys, use_render_params)) { /* check use of dupli objects here */ if (psys->part && (psys->part->draw_as == PART_DRAW_REND || use_render_params) && - ((psys->part->ren_as == PART_DRAW_OB && psys->part->dup_ob) || - (psys->part->ren_as == PART_DRAW_GR && psys->part->dup_group))) + ((psys->part->ren_as == PART_DRAW_OB && psys->part->instance_object) || + (psys->part->ren_as == PART_DRAW_GR && psys->part->instance_collection))) { ob->transflag |= OB_DUPLIPARTS; } @@ -306,8 +306,8 @@ bool BKE_object_eval_proxy_copy(Depsgraph *depsgraph, invert_m4_m4(imat, obg->obmat); mul_m4_m4m4(object->obmat, imat, object->proxy_from->obmat); /* Should always be true. */ - if (obg->dup_group) { - add_v3_v3(object->obmat[3], obg->dup_group->dupli_ofs); + if (obg->instance_collection) { + add_v3_v3(object->obmat[3], obg->instance_collection->dupli_ofs); } } else { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index abf463c8b30..9705fc88ef8 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -343,11 +343,11 @@ void psys_find_group_weights(ParticleSettings *part) /* Find object pointers based on index. If the collection is linked from * another library linking may not have the object pointers available on * file load, so we have to retrieve them later. See T49273. */ - const ListBase dup_group_objects = BKE_collection_object_cache_get(part->dup_group); + const ListBase instance_collection_objects = BKE_collection_object_cache_get(part->instance_collection); - for (ParticleDupliWeight *dw = part->dupliweights.first; dw; dw = dw->next) { + for (ParticleDupliWeight *dw = part->instance_weights.first; dw; dw = dw->next) { if (dw->ob == NULL) { - Base *base = BLI_findlink(&dup_group_objects, dw->index); + Base *base = BLI_findlink(&instance_collection_objects, dw->index); if (base != NULL) { dw->ob = base->object; } @@ -359,8 +359,8 @@ void psys_check_group_weights(ParticleSettings *part) { ParticleDupliWeight *dw, *tdw; - if (part->ren_as != PART_DRAW_GR || !part->dup_group) { - BLI_freelistN(&part->dupliweights); + if (part->ren_as != PART_DRAW_GR || !part->instance_collection) { + BLI_freelistN(&part->instance_weights); return; } @@ -368,11 +368,11 @@ void psys_check_group_weights(ParticleSettings *part) psys_find_group_weights(part); /* Remove NULL objects, that were removed from the collection. */ - dw = part->dupliweights.first; + dw = part->instance_weights.first; while (dw) { - if (dw->ob == NULL || !BKE_collection_has_object_recursive(part->dup_group, dw->ob)) { + if (dw->ob == NULL || !BKE_collection_has_object_recursive(part->instance_collection, dw->ob)) { tdw = dw->next; - BLI_freelinkN(&part->dupliweights, dw); + BLI_freelinkN(&part->instance_weights, dw); dw = tdw; } else { @@ -382,9 +382,9 @@ void psys_check_group_weights(ParticleSettings *part) /* Add new objects in the collection. */ int index = 0; - FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(part->dup_group, object) + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object) { - dw = part->dupliweights.first; + dw = part->instance_weights.first; while (dw && dw->ob != object) { dw = dw->next; } @@ -393,7 +393,7 @@ void psys_check_group_weights(ParticleSettings *part) dw = MEM_callocN(sizeof(ParticleDupliWeight), "ParticleDupliWeight"); dw->ob = object; dw->count = 1; - BLI_addtail(&part->dupliweights, dw); + BLI_addtail(&part->instance_weights, dw); } dw->index = index++; @@ -402,7 +402,7 @@ void psys_check_group_weights(ParticleSettings *part) /* Ensure there is an element marked as current. */ int current = 0; - for (dw = part->dupliweights.first; dw; dw = dw->next) { + for (dw = part->instance_weights.first; dw; dw = dw->next) { if (dw->flag & PART_DUPLIW_CURRENT) { current = 1; break; @@ -410,7 +410,7 @@ void psys_check_group_weights(ParticleSettings *part) } if (!current) { - dw = part->dupliweights.first; + dw = part->instance_weights.first; if (dw) dw->flag |= PART_DUPLIW_CURRENT; } @@ -452,7 +452,7 @@ void BKE_particlesettings_free(ParticleSettings *part) MEM_SAFE_FREE(part->effector_weights); - BLI_freelistN(&part->dupliweights); + BLI_freelistN(&part->instance_weights); boid_free_settings(part->boids); fluid_free_settings(part->fluid); @@ -3319,7 +3319,7 @@ void BKE_particlesettings_copy_data( } } - BLI_duplicatelist(&part_dst->dupliweights, &part_src->dupliweights); + BLI_duplicatelist(&part_dst->instance_weights, &part_src->instance_weights); } ParticleSettings *BKE_particlesettings_copy(Main *bmain, const ParticleSettings *part) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index ada254ba77e..21e7d1face8 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1786,8 +1786,8 @@ static bool foreach_object_ptcache(Scene *scene, /* Consider all object in dupli groups to be part of the same object, * for baking with linking dupligroups. Once we have better overrides * this can be revisited so users select the local objects directly. */ - if (scene != NULL && (duplis-- > 0) && (object->dup_group != NULL)) { - FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(object->dup_group, + if (scene != NULL && (duplis-- > 0) && (object->instance_collection != NULL)) { + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(object->instance_collection, current_object) { if (current_object == object) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7c978458ef1..432538f96ff 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1099,7 +1099,7 @@ int BKE_scene_base_iter_next(Depsgraph *depsgraph, SceneBaseIter *iter, /* collections cannot be duplicated for mballs yet, * this enters eternal loop because of * makeDispListMBall getting called inside of collection_duplilist */ - if ((*base)->object->dup_group == NULL) { + if ((*base)->object->instance_collection == NULL) { iter->duplilist = object_duplilist(depsgraph, (*scene), (*base)->object); iter->dupob = iter->duplilist->first; |