- 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
This commit is contained in:
2009-07-29 14:07:51 +00:00
parent 2ee51efd6b
commit 9547fc48ac
4 changed files with 12 additions and 4 deletions

View File

@@ -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()

View File

@@ -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");

View File

@@ -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";

View File

@@ -40,6 +40,7 @@
#include "BKE_depsgraph.h"
#include "WM_types.h"
#include "WM_api.h"
static int rna_Meta_texspace_editable(PointerRNA *ptr)
{