diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 23:20:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 23:20:05 +0400 |
commit | 6b21085ed5d8bcd827859345105d7b37e1049d4b (patch) | |
tree | 46d673a44b1723e7d307755ab27269f837aa39d5 /source/blender/editors/mesh/editmesh_add.c | |
parent | 1028284301d7a5d45bf968e12bc094e3393e56f9 (diff) |
enable adding objects in background mode by not using the context to get the object added.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 857423f8ab3..f0e6f40af30 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1269,6 +1269,7 @@ static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmod Object *obedit= CTX_data_edit_object(C); int newob = 0; float mat[4][4]; + int scale; if(obedit==NULL || obedit->type!=OB_MESH) { obedit= ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer); @@ -1279,8 +1280,10 @@ static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmod } else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); - dia *= ED_object_new_primitive_matrix(C, loc, rot, mat); - depth *= ED_object_new_primitive_matrix(C, loc, rot, mat); + scale= ED_object_new_primitive_matrix(C, obedit, loc, rot, mat); + + dia *= scale; + depth *= scale; make_prim(obedit, type, mat, tot, seg, subdiv, dia, depth, ext, fill); |