Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r--source/blender/editors/object/object_add.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index d030e61952e..466338a736f 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);
@@ -733,7 +733,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
rename_id(&ob->id, get_lamp_defname(type));
rename_id(&la->id, get_lamp_defname(type));
- if (scene_use_new_shading_nodes(scene)) {
+ if (BKE_scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(scene, &la->id);
la->use_nodes = 1;
}
@@ -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);
}
@@ -923,7 +923,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
for (scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) {
if (scene_iter != scene && !(scene_iter->id.lib)) {
- base_other = object_in_scene(base->object, scene_iter);
+ base_other = BKE_scene_base_find(scene_iter, base->object);
if (base_other) {
ED_base_object_free_and_unlink(bmain, scene_iter, base_other);
}
@@ -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);
@@ -1239,12 +1239,12 @@ static EnumPropertyItem convert_target_items[] = {
static void curvetomesh(Scene *scene, Object *ob)
{
if (ob->disp.first == NULL)
- makeDispListCurveTypes(scene, ob, 0); /* force creation */
+ BKE_displist_make_curveTypes(scene, ob, 0); /* force creation */
- nurbs_to_mesh(ob); /* also does users */
+ BKE_mesh_from_nurbs(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,16 +1341,16 @@ 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;
}
- mesh_to_curve(scene, newob);
+ BKE_mesh_from_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;
@@ -1405,7 +1405,7 @@ static int convert_exec(bContext *C, wmOperator *op)
cu = newob->data;
if (!newob->disp.first)
- makeDispListCurveTypes(scene, newob, 0);
+ BKE_displist_make_curveTypes(scene, newob, 0);
newob->type = OB_CURVE;
cu->type = OB_CURVE;
@@ -1446,7 +1446,7 @@ static int convert_exec(bContext *C, wmOperator *op)
curvetomesh(scene, newob);
/* meshes doesn't use displist */
- freedisplist(&newob->disp);
+ BKE_displist_free(&newob->disp);
}
}
else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
@@ -1467,7 +1467,7 @@ static int convert_exec(bContext *C, wmOperator *op)
newob = ob;
/* meshes doesn't use displist */
- freedisplist(&newob->disp);
+ BKE_displist_free(&newob->disp);
}
curvetomesh(scene, newob);
@@ -1479,7 +1479,7 @@ static int convert_exec(bContext *C, wmOperator *op)
base->flag &= ~SELECT;
ob->flag &= ~SELECT;
- baseob = BKE_metaball_basis_find(scene, ob);
+ baseob = BKE_mball_basis_find(scene, ob);
if (ob != baseob) {
/* if motherball is converting it would be marked as done later */
@@ -1487,7 +1487,7 @@ static int convert_exec(bContext *C, wmOperator *op)
}
if (!baseob->disp.first) {
- makeDispListMBall(scene, baseob);
+ BKE_displist_make_mball(scene, baseob);
}
if (!(baseob->flag & OB_DONE)) {
@@ -1499,7 +1499,7 @@ static int convert_exec(bContext *C, wmOperator *op)
mb = newob->data;
mb->id.us--;
- newob->data = add_mesh("Mesh");
+ newob->data = BKE_mesh_add("Mesh");
newob->type = OB_MESH;
me = newob->data;
@@ -1509,7 +1509,7 @@ static int convert_exec(bContext *C, wmOperator *op)
for (a = 0; a < newob->totcol; a++) id_us_plus((ID *)me->mat[a]);
}
- mball_to_mesh(&baseob->disp, newob->data);
+ BKE_mesh_from_metaball(&baseob->disp, newob->data);
if (obact->type == OB_MBALL) {
basact = basen;
@@ -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;
@@ -1736,7 +1736,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
if (dupflag & USER_DUP_MBALL) {
ID_NEW_US2(obn->data)
else {
- obn->data = BKE_metaball_copy(obn->data);
+ obn->data = BKE_mball_copy(obn->data);
didit = 1;
}
id->us--;
@@ -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,8 +1760,8 @@ 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);
- armature_rebuild_pose(obn, obn->data);
+ obn->data = BKE_armature_copy(obn->data);
+ BKE_pose_rebuild(obn, obn->data);
didit = 1;
}
id->us--;
@@ -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);
@@ -1954,7 +1954,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
/* find object, create fake base */
RNA_string_get(op->ptr, "name", name);
- ob = (Object *)find_id("OB", name);
+ ob = (Object *)BKE_libblock_find_name(ID_OB, name);
if (ob == NULL)
return OPERATOR_CANCELLED;
@@ -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;
}