diff options
author | Jiri Hnidek <jiri.hnidek@tul.cz> | 2009-07-29 18:07:51 +0400 |
---|---|---|
committer | Jiri Hnidek <jiri.hnidek@tul.cz> | 2009-07-29 18:07:51 +0400 |
commit | 9547fc48ac653c039dc857d08ece8b1072d717c4 (patch) | |
tree | e55a87d2dca338b99044e50f7fce198ce65979fc | |
parent | 2ee51efd6b5c3c0f90c6b0b07f7b4fc168cd9860 (diff) |
- Fix some things I missed in my last commit
- Change name of OBJECT_OT_object_add operator
- Use new OBJECT_OT_object_add operator in space_info.py
-rw-r--r-- | release/ui/space_info.py | 2 | ||||
-rw-r--r-- | source/blender/editors/metaball/editmball.c | 11 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_meta.c | 1 |
4 files changed, 12 insertions, 4 deletions
diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 3cc01a35c1f..855ce0b4f8f 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -113,7 +113,7 @@ class INFO_MT_add(bpy.types.Menu): layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon="ICON_OUTLINER_OB_MESH") layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon="ICON_OUTLINER_OB_CURVE") layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon="ICON_OUTLINER_OB_SURFACE") - layout.item_enumO("OBJECT_OT_object_add", "type", "META", icon="ICON_OUTLINER_OB_META") + layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", "META", icon="ICON_OUTLINER_OB_META") layout.itemO("OBJECT_OT_text_add", text="Text", icon="ICON_OUTLINER_OB_FONT") layout.itemS() diff --git a/source/blender/editors/metaball/editmball.c b/source/blender/editors/metaball/editmball.c index 7b9175f8ae0..b9bb219783f 100644 --- a/source/blender/editors/metaball/editmball.c +++ b/source/blender/editors/metaball/editmball.c @@ -45,6 +45,7 @@ #include "DNA_scene_types.h" #include "DNA_view3d_types.h" #include "DNA_windowmanager_types.h" +#include "DNA_userdef_types.h" #include "RNA_define.h" #include "RNA_access.h" @@ -106,6 +107,8 @@ MetaElem *add_metaball_primitive(bContext *C, int type, int newname) MetaElem *ml; float *curs, mat[3][3], cent[3], imat[3][3], cmat[3][3]; + if(!obedit) return NULL; + /* Deselect all existing metaelems */ ml= mball->editelems->first; while(ml) { @@ -114,7 +117,6 @@ MetaElem *add_metaball_primitive(bContext *C, int type, int newname) } Mat3CpyMat4(mat, obedit->obmat); - if(v3d) { curs= give_cursor(scene, v3d); VECCOPY(cent, curs); @@ -127,12 +129,17 @@ MetaElem *add_metaball_primitive(bContext *C, int type, int newname) cent[2]-= obedit->obmat[3][2]; if (rv3d) { - Mat3CpyMat4(imat, rv3d->viewmat); + if (!(newname) || U.flag & USER_ADD_VIEWALIGNED || !rv3d) + Mat3CpyMat4(imat, rv3d->viewmat); + else + Mat3One(imat); Mat3MulVecfl(imat, cent); Mat3MulMat3(cmat, imat, mat); Mat3Inv(imat,cmat); Mat3MulVecfl(imat, cent); } + else + Mat3One(imat); ml= MEM_callocN(sizeof(MetaElem), "metaelem"); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f699ae93a08..f34dc2e7c23 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -597,7 +597,7 @@ static int object_metaball_add_invoke(bContext *C, wmOperator *op, wmEvent *even void OBJECT_OT_metaball_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Metaball"; + ot->name= "Metaball"; ot->description= "Add an metaball object to the scene."; ot->idname= "OBJECT_OT_metaball_add"; diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index beb5bbaf51b..d57c102a35f 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -40,6 +40,7 @@ #include "BKE_depsgraph.h" #include "WM_types.h" +#include "WM_api.h" static int rna_Meta_texspace_editable(PointerRNA *ptr) { |