diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 18:03:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 18:03:12 +0400 |
commit | a731e130432a98ab8228112027cd3eaa8ed700b1 (patch) | |
tree | e71dad8f907ccd4a73b7bbc1ad166eda2dfba9cf /source/blender/editors/object | |
parent | a30dec8e5968ae6568184cfdc2e1a69bad0e39d6 (diff) |
code cleanup: function naming, use BKE_*type* prefix.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 56 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 24 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/object/object_hook.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 48 | ||||
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 30 |
8 files changed, 90 insertions, 90 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index d030e61952e..d58b71f54e5 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -147,7 +147,7 @@ void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *r if (rot) copy_v3_v3(ob->rot, rot); - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); } /* uses context to figure out transform for primitive */ @@ -325,7 +325,7 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, ED_object_exit_editmode(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); /* freedata, and undo */ /* deselects all, sets scene->basact */ - ob = add_object(scene, type); + ob = BKE_object_add(scene, type); BASACT->lay = ob->lay = layer; /* editor level activate, notifiers */ ED_base_object_activate(C, BASACT); @@ -891,7 +891,7 @@ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base) { DAG_id_type_tag(bmain, ID_OB); BLI_remlink(&scene->base, base); - free_libblock_us(&bmain->object, base->object); + BKE_libblock_free_us(&bmain->object, base->object); if (scene->basact == base) scene->basact = NULL; MEM_freeN(base); } @@ -975,7 +975,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag) /* XXX check object pointers */ CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { - object_relink(ob); + BKE_object_relink(ob); } CTX_DATA_END; @@ -993,7 +993,7 @@ static void copy_object_set_idnew(bContext *C, int dupflag) id = (ID *)ma->mtex[a]->tex; if (id) { ID_NEW_US(ma->mtex[a]->tex) - else ma->mtex[a]->tex = copy_texture(ma->mtex[a]->tex); + else ma->mtex[a]->tex = BKE_texture_copy(ma->mtex[a]->tex); id->us--; } } @@ -1073,7 +1073,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, for (dob = lb->first; dob; dob = dob->next) { Base *basen; - Object *ob = copy_object(dob->ob); + Object *ob = BKE_object_copy(dob->ob); /* font duplis can have a totcol without material, we get them from parent * should be implemented better... */ @@ -1097,7 +1097,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, ob->lay = base->lay; copy_m4_m4(ob->obmat, dob->mat); - object_apply_mat4(ob, ob->obmat, FALSE, FALSE); + BKE_object_apply_mat4(ob, ob->obmat, FALSE, FALSE); if (dupli_gh) BLI_ghash_insert(dupli_gh, dob, ob); @@ -1143,7 +1143,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, /* note, this may be the parent of other objects, but it should * still work out ok */ - object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); + BKE_object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); /* to set ob_dst->orig and in case theres any other discrepicies */ DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); @@ -1162,7 +1162,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, /* similer to the code above, see comments */ invert_m4_m4(ob_dst->parentinv, dob->mat); - object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); + BKE_object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE); DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB); @@ -1244,7 +1244,7 @@ static void curvetomesh(Scene *scene, Object *ob) nurbs_to_mesh(ob); /* also does users */ if (ob->type == OB_MESH) - object_free_modifiers(ob); + BKE_object_free_modifiers(ob); } static int convert_poll(bContext *C) @@ -1265,7 +1265,7 @@ static Base *duplibase_for_convert(Scene *scene, Base *base, Object *ob) ob = base->object; } - obn = copy_object(ob); + obn = BKE_object_copy(ob); obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; basen = MEM_mallocN(sizeof(Base), "duplibase"); @@ -1325,7 +1325,7 @@ static int convert_exec(bContext *C, wmOperator *op) /* When 2 objects with linked data are selected, converting both * would keep modifiers on all but the converted object [#26003] */ if (ob->type == OB_MESH) { - object_free_modifiers(ob); /* after derivedmesh calls! */ + BKE_object_free_modifiers(ob); /* after derivedmesh calls! */ } } } @@ -1341,7 +1341,7 @@ static int convert_exec(bContext *C, wmOperator *op) me->id.us--; /* make a new copy of the mesh */ - newob->data = copy_mesh(me); + newob->data = BKE_mesh_copy(me); } else { newob = ob; @@ -1350,7 +1350,7 @@ static int convert_exec(bContext *C, wmOperator *op) mesh_to_curve(scene, newob); if (newob->type == OB_CURVE) - object_free_modifiers(newob); /* after derivedmesh calls! */ + BKE_object_free_modifiers(newob); /* after derivedmesh calls! */ } else if (ob->type == OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */ ob->flag |= OB_DONE; @@ -1364,7 +1364,7 @@ static int convert_exec(bContext *C, wmOperator *op) me->id.us--; /* make a new copy of the mesh */ - newob->data = copy_mesh(me); + newob->data = BKE_mesh_copy(me); } else { newob = ob; @@ -1383,7 +1383,7 @@ static int convert_exec(bContext *C, wmOperator *op) /* re-tessellation is called by DM_to_mesh */ dm->release(dm); - object_free_modifiers(newob); /* after derivedmesh calls! */ + BKE_object_free_modifiers(newob); /* after derivedmesh calls! */ } else if (ob->type == OB_FONT) { ob->flag |= OB_DONE; @@ -1631,7 +1631,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base ; /* nothing? */ } else { - obn = copy_object(ob); + obn = BKE_object_copy(ob); obn->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; basen = MEM_mallocN(sizeof(Base), "duplibase"); @@ -1657,7 +1657,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base id = (ID *)obn->mat[a]; if (id) { ID_NEW_US(obn->mat[a]) - else obn->mat[a] = copy_material(obn->mat[a]); + else obn->mat[a] = BKE_material_copy(obn->mat[a]); id->us--; if (dupflag & USER_DUP_ACT) { @@ -1672,7 +1672,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base id = (ID *) psys->part; if (id) { ID_NEW_US(psys->part) - else psys->part = psys_copy_settings(psys->part); + else psys->part = BKE_particlesettings_copy(psys->part); if (dupflag & USER_DUP_ACT) { BKE_copy_animdata_id_action(&psys->part->id); @@ -1691,7 +1691,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base if (dupflag & USER_DUP_MESH) { ID_NEW_US2(obn->data) else { - obn->data = copy_mesh(obn->data); + obn->data = BKE_mesh_copy(obn->data); if (obn->fluidsimSettings) { obn->fluidsimSettings->orgMesh = (Mesh *)obn->data; @@ -1746,7 +1746,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base if (dupflag & USER_DUP_LAMP) { ID_NEW_US2(obn->data) else { - obn->data = copy_lamp(obn->data); + obn->data = BKE_lamp_copy(obn->data); didit = 1; } id->us--; @@ -1760,7 +1760,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base if (dupflag & USER_DUP_ARM) { ID_NEW_US2(obn->data) else { - obn->data = copy_armature(obn->data); + obn->data = BKE_armature_copy(obn->data); armature_rebuild_pose(obn, obn->data); didit = 1; } @@ -1773,7 +1773,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base if (dupflag != 0) { ID_NEW_US2(obn->data) else { - obn->data = copy_lattice(obn->data); + obn->data = BKE_lattice_copy(obn->data); didit = 1; } id->us--; @@ -1793,7 +1793,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base if (dupflag != 0) { ID_NEW_US2(obn->data) else { - obn->data = copy_speaker(obn->data); + obn->data = BKE_speaker_copy(obn->data); didit = 1; } id->us--; @@ -1832,7 +1832,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base id = (ID *)(*matarar)[a]; if (id) { ID_NEW_US((*matarar)[a]) - else (*matarar)[a] = copy_material((*matarar)[a]); + else (*matarar)[a] = BKE_material_copy((*matarar)[a]); id->us--; } @@ -1863,7 +1863,7 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag ob = basen->object; /* link own references to the newly duplicated data [#26816] */ - object_relink(ob); + BKE_object_relink(ob); set_sca_new_poins_ob(ob); DAG_scene_sort(bmain, scene); @@ -2033,7 +2033,7 @@ static int join_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); return OPERATOR_CANCELLED; } - else if (object_data_is_libdata(ob)) { + else if (BKE_object_obdata_is_libdata(ob)) { BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); return OPERATOR_CANCELLED; } @@ -2086,7 +2086,7 @@ static int join_shapes_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); return OPERATOR_CANCELLED; } - else if (object_data_is_libdata(ob)) { + else if (BKE_object_obdata_is_libdata(ob)) { BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index e63e0e34934..60ca674bb8a 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -309,7 +309,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) * the constraint is deemed invalid */ /* default IK check ... */ - if (exist_object(data->tar) == 0) { + if (BKE_object_exists_check(data->tar) == 0) { data->tar = NULL; curcon->flag |= CONSTRAINT_DISABLE; } @@ -320,7 +320,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) } if (data->poletar) { - if (exist_object(data->poletar) == 0) { + if (BKE_object_exists_check(data->poletar) == 0) { data->poletar = NULL; curcon->flag |= CONSTRAINT_DISABLE; } @@ -339,7 +339,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) bPivotConstraint *data = curcon->data; /* target doesn't have to exist, but if it is non-null, it must exist! */ - if (data->tar && exist_object(data->tar) == 0) { + if (data->tar && BKE_object_exists_check(data->tar) == 0) { data->tar = NULL; curcon->flag |= CONSTRAINT_DISABLE; } @@ -446,7 +446,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan) /* disable and clear constraints targets that are incorrect */ for (ct = targets.first; ct; ct = ct->next) { /* general validity checks (for those constraints that need this) */ - if (exist_object(ct->tar) == 0) { + if (BKE_object_exists_check(ct->tar) == 0) { /* object doesn't exist, but constraint requires target */ ct->tar = NULL; curcon->flag |= CONSTRAINT_DISABLE; @@ -774,8 +774,8 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con, else if (ob) { Object workob; - /* use what_does_parent to find inverse - just like for normal parenting */ - what_does_parent(scene, ob, &workob); + /* use BKE_object_workob_calc_parent to find inverse - just like for normal parenting */ + BKE_object_workob_calc_parent(scene, ob, &workob); invert_m4_m4(invmat, workob.obmat); } } @@ -1147,7 +1147,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); - Object *ob = object_pose_armature_get(CTX_data_active_object(C)); + Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); /* free constraints for all selected bones */ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) @@ -1413,7 +1413,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o Object *obt; /* add new target object */ - obt = add_object(scene, OB_EMPTY); + obt = BKE_object_add(scene, OB_EMPTY); /* set layers OK */ newbase = BASACT; @@ -1434,7 +1434,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o copy_v3_v3(obt->loc, obact->obmat[3]); } - /* restore, add_object sets active */ + /* restore, BKE_object_add sets active */ BASACT = base; base->flag |= SELECT; @@ -1586,7 +1586,7 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op) /* dummy operator callback */ static int pose_constraint_add_exec(bContext *C, wmOperator *op) { - Object *ob = object_pose_armature_get(ED_object_active_context(C)); + Object *ob = BKE_object_pose_armature_get(ED_object_active_context(C)); int type = RNA_enum_get(op->ptr, "type"); short with_targets = 0; @@ -1689,7 +1689,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) /* present menu with options + validation for targets to use */ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) { - Object *ob = object_pose_armature_get(CTX_data_active_object(C)); + Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bPoseChannel *pchan = get_active_posechannel(ob); bConstraint *con = NULL; @@ -1773,7 +1773,7 @@ void POSE_OT_ik_add(wmOperatorType *ot) /* remove IK constraints from selected bones */ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *ob = object_pose_armature_get(CTX_data_active_object(C)); + Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); /* only remove IK Constraints */ CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c669bbfe3b2..a683b1cc0ae 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -427,7 +427,7 @@ void ED_object_enter_editmode(bContext *C, int flag) ob = base->object; - if (object_data_is_libdata(ob)) { + if (BKE_object_obdata_is_libdata(ob)) { error_libdata(); return; } @@ -465,11 +465,11 @@ void ED_object_enter_editmode(bContext *C, int flag) bArmature *arm = base->object->data; if (!arm) return; /* - * The function object_data_is_libdata make a problem here, the + * The function BKE_object_obdata_is_libdata make a problem here, the * check for ob->proxy return 0 and let blender enter to edit mode * this causes a crash when you try leave the edit mode. * The problem is that i can't remove the ob->proxy check from - * object_data_is_libdata that prevent the bugfix #6614, so + * BKE_object_obdata_is_libdata that prevent the bugfix #6614, so * i add this little hack here. */ if (arm->id.lib) { @@ -783,7 +783,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) return; } else if (event == 24) { - /* moved to object_link_modifiers */ + /* moved to BKE_object_link_modifiers */ /* copymenu_modifiers(bmain, scene, v3d, ob); */ return; } diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 2cfefa61a18..6a41cb93e19 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -417,13 +417,13 @@ static Object *add_hook_object_new(Scene *scene, Object *obedit) Base *base, *basedit; Object *ob; - ob = add_object(scene, OB_EMPTY); + ob = BKE_object_add(scene, OB_EMPTY); basedit = object_in_scene(obedit, scene); base = object_in_scene(ob, scene); base->lay = ob->lay = obedit->lay; - /* icky, add_object sets new base as active. + /* icky, BKE_object_add sets new base as active. * so set it back to the original edit object */ scene->basact = basedit; @@ -469,7 +469,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o /* matrix calculus */ /* vert x (obmat x hook->imat) x hook->obmat x ob->imat */ /* (parentinv ) */ - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); invert_m4_m4(ob->imat, ob->obmat); /* apparently this call goes from right to left... */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 281ca7e59b6..b4207efc21f 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -368,7 +368,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene * if (totvert == 0) return 0; /* add new mesh */ - obn = add_object(scene, OB_MESH); + obn = BKE_object_add(scene, OB_MESH); me = obn->data; me->totvert = totvert; @@ -661,7 +661,7 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr) if (mti->flags & eModifierTypeFlag_NoUserAdd) continue; - if (!object_support_modifier_type(ob, md_item->value)) + if (!BKE_object_support_modifier_type_check(ob, md_item->value)) continue; } else { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 4678416e1c9..95c9773eabd 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -235,7 +235,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) ob->par3 = v3 - 1; /* inverse parent matrix */ - what_does_parent(scene, ob, &workob); + BKE_object_workob_calc_parent(scene, ob, &workob); invert_m4_m4(ob->parentinv, workob.obmat); } else { @@ -243,7 +243,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op) ob->par1 = v1 - 1; /* inverse parent matrix */ - what_does_parent(scene, ob, &workob); + BKE_object_workob_calc_parent(scene, ob, &workob); invert_m4_m4(ob->parentinv, workob.obmat); } } @@ -335,24 +335,24 @@ static int make_proxy_exec(bContext *C, wmOperator *op) char name[MAX_ID_NAME + 4]; /* Add new object for the proxy */ - newob = add_object(scene, OB_EMPTY); + newob = BKE_object_add(scene, OB_EMPTY); BLI_snprintf(name, sizeof(name), "%s_proxy", ((ID *)(gob ? gob : ob))->name + 2); rename_id(&newob->id, name); /* set layers OK */ - newbase = BASACT; /* add_object sets active... */ + newbase = BASACT; /* BKE_object_add sets active... */ newbase->lay = oldbase->lay; newob->lay = newbase->lay; - /* remove base, leave user count of object, it gets linked in object_make_proxy */ + /* remove base, leave user count of object, it gets linked in BKE_object_make_proxy */ if (gob == NULL) { BLI_remlink(&scene->base, oldbase); MEM_freeN(oldbase); } - object_make_proxy(newob, ob, gob); + BKE_object_make_proxy(newob, ob, gob); /* depsgraph flushes are needed for the new data */ DAG_scene_sort(bmain, scene); @@ -439,7 +439,7 @@ void ED_object_parent_clear(bContext *C, int type) } else if (type == 1) { ob->parent = NULL; - object_apply_mat4(ob, ob->obmat, TRUE, FALSE); + BKE_object_apply_mat4(ob, ob->obmat, TRUE, FALSE); } else if (type == 2) unit_m4(ob->parentinv); @@ -571,7 +571,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object Object workob; /* apply transformation of previous parenting */ - /* object_apply_mat4(ob, ob->obmat); */ /* removed because of bug [#23577] */ + /* BKE_object_apply_mat4(ob, ob->obmat); */ /* removed because of bug [#23577] */ /* set the parent (except for follow-path constraint option) */ if (partype != PAR_PATH_CONST) { @@ -650,13 +650,13 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object } /* get corrected inverse */ ob->partype = PAROBJECT; - what_does_parent(scene, ob, &workob); + BKE_object_workob_calc_parent(scene, ob, &workob); invert_m4_m4(ob->parentinv, workob.obmat); } else { /* calculate inverse parent matrix */ - what_does_parent(scene, ob, &workob); + BKE_object_workob_calc_parent(scene, ob, &workob); invert_m4_m4(ob->parentinv, workob.obmat); } @@ -814,7 +814,7 @@ static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) if (ob->parent) { if (ob->partype & PARSLOW) { ob->partype -= PARSLOW; - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); ob->partype |= PARSLOW; ob->recalc |= OB_RECALC_OB; } @@ -920,7 +920,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) } if (type == 1) - object_apply_mat4(ob, ob->obmat, TRUE, TRUE); + BKE_object_apply_mat4(ob, ob->obmat, TRUE, TRUE); } CTX_DATA_END; @@ -1313,7 +1313,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) } break; case MAKE_LINKS_MODIFIERS: - object_link_modifiers(obt, ob); + BKE_object_link_modifiers(obt, ob); obt->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME; break; } @@ -1401,7 +1401,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag) if ( (base->flag & flag) == flag) { if (ob->id.lib == NULL && ob->id.us > 1) { /* base gets copy of object */ - obn = copy_object(ob); + obn = BKE_object_copy(ob); base->object = obn; ob->id.us--; } @@ -1413,7 +1413,7 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag) /* object pointers */ for (base = FIRSTBASE; base; base = base->next) { - object_relink(base->object); + BKE_object_relink(base->object); } set_sca_new_poins(); @@ -1447,7 +1447,7 @@ static void new_id_matar(Material **matar, int totcol) id->us--; } else if (id->us > 1) { - matar[a] = copy_material(matar[a]); + matar[a] = BKE_material_copy(matar[a]); id->us--; id->newid = (ID *)matar[a]; } @@ -1478,7 +1478,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag) switch (ob->type) { case OB_LAMP: - ob->data = la = copy_lamp(ob->data); + ob->data = la = BKE_lamp_copy(ob->data); for (a = 0; a < MAX_MTEX; a++) { if (la->mtex[a]) { ID_NEW(la->mtex[a]->object); @@ -1489,7 +1489,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag) ob->data = BKE_camera_copy(ob->data); break; case OB_MESH: - ob->data = copy_mesh(ob->data); + ob->data = BKE_mesh_copy(ob->data); //me= ob->data; //if (me && me->key) // ipo_idnew(me->key->ipo); /* drivers */ @@ -1505,15 +1505,15 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag) ID_NEW(cu->taperobj); break; case OB_LATTICE: - ob->data = copy_lattice(ob->data); + ob->data = BKE_lattice_copy(ob->data); break; case OB_ARMATURE: ob->recalc |= OB_RECALC_DATA; - ob->data = copy_armature(ob->data); + ob->data = BKE_armature_copy(ob->data); armature_rebuild_pose(ob, ob->data); break; case OB_SPEAKER: - ob->data = copy_speaker(ob->data); + ob->data = BKE_speaker_copy(ob->data); break; default: if (G.debug & G_DEBUG) @@ -1568,7 +1568,7 @@ static void single_mat_users(Scene *scene, int flag, int do_textures) /* do not test for LIB_NEW: this functions guaranteed delivers single_users! */ if (ma->id.us > 1) { - man = copy_material(ma); + man = BKE_material_copy(ma); BKE_copy_animdata_id_action(&man->id); man->id.us = 0; @@ -1579,7 +1579,7 @@ static void single_mat_users(Scene *scene, int flag, int do_textures) if (ma->mtex[b] && (tex = ma->mtex[b]->tex)) { if (tex->id.us > 1) { tex->id.us--; - tex = copy_texture(tex); + tex = BKE_texture_copy(tex); BKE_copy_animdata_id_action(&tex->id); man->mtex[b]->tex = tex; } @@ -1606,7 +1606,7 @@ static void do_single_tex_user(Tex **from) tex->id.us--; } else if (tex->id.us > 1) { - texn = copy_texture(tex); + texn = BKE_texture_copy(tex); BKE_copy_animdata_id_action(&texn->id); tex->id.newid = (ID *)texn; tex->id.us--; diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 5d31bfff99a..df73e435737 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -77,7 +77,7 @@ static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix) { KeyBlock *kb; - if ((kb = object_insert_shape_key(scene, ob, NULL, from_mix))) { + if ((kb = BKE_object_insert_shape_key(scene, ob, NULL, from_mix))) { Key *key = ob_get_key(ob); /* for absolute shape keys, new keys may not be added last */ ob->shapenr = BLI_findindex(&key->block, kb) + 1; @@ -141,7 +141,7 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) else if (GS(key->from->name) == ID_CU) ((Curve *)key->from)->key = NULL; else if (GS(key->from->name) == ID_LT) ((Lattice *)key->from)->key = NULL; - free_libblock_us(&(bmain->key), key); + BKE_libblock_free_us(&(bmain->key), key); } DAG_id_tag_update(&ob->id, OB_RECALC_DATA); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index b8a7ce999f1..92dc9b9bd4a 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -370,8 +370,8 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob) /* a change was made, adjust the children to compensate */ for (ob_child = bmain->object.first; ob_child; ob_child = ob_child->id.next) { if (ob_child->parent == ob) { - object_apply_mat4(ob_child, ob_child->obmat, TRUE, FALSE); - what_does_parent(scene, ob_child, &workob); + BKE_object_apply_mat4(ob_child, ob_child->obmat, TRUE, FALSE); + BKE_object_workob_calc_parent(scene, ob_child, &workob); invert_m4_m4(ob_child->parentinv, workob.obmat); } } @@ -434,17 +434,17 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo /* calculate rotation/scale matrix */ if (apply_scale && apply_rot) - object_to_mat3(ob, rsmat); + BKE_object_to_mat3(ob, rsmat); else if (apply_scale) - object_scale_to_mat3(ob, rsmat); + BKE_object_scale_to_mat3(ob, rsmat); else if (apply_rot) { float tmat[3][3], timat[3][3]; /* simple rotation matrix */ - object_rot_to_mat3(ob, rsmat); + BKE_object_rot_to_mat3(ob, rsmat); /* correct for scale, note mul_m3_m3m3 has swapped args! */ - object_scale_to_mat3(ob, tmat); + BKE_object_scale_to_mat3(ob, tmat); invert_m3_m3(timat, tmat); mul_m3_m3m3(rsmat, timat, rsmat); mul_m3_m3m3(rsmat, rsmat, tmat); @@ -460,7 +460,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo if (!(apply_scale && apply_rot)) { /* correct for scale and rotation that is still applied */ - object_to_mat3(ob, obmat); + BKE_object_to_mat3(ob, obmat); invert_m3_m3(iobmat, obmat); mul_m3_m3m3(tmat, rsmat, iobmat); mul_m3_v3(tmat, mat[3]); @@ -546,7 +546,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo unit_axis_angle(ob->rotAxis, &ob->rotAngle); } - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); if (ob->type == OB_ARMATURE) { where_is_pose(scene, ob); /* needed for bone parents */ } @@ -573,9 +573,9 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { - where_is_object(scene, ob); - object_apply_mat4(ob, ob->obmat, TRUE, TRUE); - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); + BKE_object_apply_mat4(ob, ob->obmat, TRUE, TRUE); + BKE_object_where_is_calc(scene, ob); /* update for any children that may get moved */ DAG_id_tag_update(&ob->id, OB_RECALC_OB); @@ -750,7 +750,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) else { /* only bounds support */ INIT_MINMAX(min, max); - minmax_object_duplis(scene, ob, min, max); + BKE_object_minmax_dupli(scene, ob, min, max); mid_v3_v3v3(cent, min, max); invert_m4_m4(ob->imat, ob->obmat); mul_m4_v3(ob->imat, cent); @@ -854,7 +854,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) arm->id.flag |= LIB_DOIT; /* do_inverse_offset= TRUE; */ /* docenter_armature() handles this */ - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); where_is_pose(scene, ob); /* needed for bone parents */ ignore_parent_tx(bmain, scene, ob); @@ -893,7 +893,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) mul_mat3_m4_v3(ob->obmat, centn); /* ommit translation part */ add_v3_v3(ob->loc, centn); - where_is_object(scene, ob); + BKE_object_where_is_calc(scene, ob); if (ob->type == OB_ARMATURE) { where_is_pose(scene, ob); /* needed for bone parents */ } @@ -915,7 +915,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) mul_mat3_m4_v3(ob_other->obmat, centn); /* ommit translation part */ add_v3_v3(ob_other->loc, centn); - where_is_object(scene, ob_other); + BKE_object_where_is_calc(scene, ob_other); if (ob_other->type == OB_ARMATURE) { where_is_pose(scene, ob_other); /* needed for bone parents */ } |