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:
authorMichael Fox <mfoxdogg@gmail.com>2009-01-27 02:58:56 +0300
committerMichael Fox <mfoxdogg@gmail.com>2009-01-27 02:58:56 +0300
commitd17b0d738b389ae9602d3ae48b3206fb0542b610 (patch)
tree6788faa7502984832555e277806c1fae83d16c87 /source/blender/editors/object
parent5917d0892c8d73b38c2988c911341ef325a4656d (diff)
2.5
****** small commit just porting the makeparent menu to use the new menu contsruction system
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_edit.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 9b421cd7b8e..f53fbc3f835 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -2417,7 +2417,7 @@ static int make_parent_exec(bContext *C, wmOperator *op)
DAG_scene_sort(CTX_data_scene(C));
ED_anim_dag_flush_update(C);
- BIF_undo_push("make Parent");
+ ED_undo_push(C,"make Parent");
return OPERATOR_FINISHED;
}
@@ -2425,31 +2425,26 @@ static int make_parent_exec(bContext *C, wmOperator *op)
static int make_parent_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *ob= CTX_data_active_object(C);
- char *str, string[256];
- char formatstr[] = "|%s %%x%d";
+ uiMenuItem *head= uiMenuBegin("Make Parent To");
- str= string + sprintf(string, "Make Parent To %%t");
+ uiMenuContext(head, WM_OP_EXEC_DEFAULT);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_OBJECT);
/* ob becomes parent, make the associated menus */
if(ob->type==OB_ARMATURE) {
- str += sprintf(str, formatstr, "Object", PAR_OBJECT);
- str += sprintf(str, formatstr, "Armature Deform", PAR_ARMATURE);
- str += sprintf(str, formatstr, "Bone", PAR_BONE);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_ARMATURE);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_BONE);
}
else if(ob->type==OB_CURVE) {
- str += sprintf(str, formatstr, "Object", PAR_OBJECT);
- str += sprintf(str, formatstr, "Curve Deform", PAR_CURVE);
- str += sprintf(str, formatstr, "Follow Path", PAR_FOLLOW);
- str += sprintf(str, formatstr, "Path Constraint", PAR_PATH_CONST);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_CURVE);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_FOLLOW);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_PATH_CONST);
}
else if(ob->type == OB_LATTICE) {
- str += sprintf(str, formatstr, "Object", PAR_OBJECT);
- str += sprintf(str, formatstr, "Lattice Deform", PAR_LATTICE);
+ uiMenuItemEnumO(head, "OBJECT_OT_make_parent", "type", PAR_LATTICE);
}
- else
- str += sprintf(str, formatstr, "Object", PAR_OBJECT);
- uiPupmenuOperator(C, 0, op, "type", string);
+ uiMenuEnd(C, head);
return OPERATOR_RUNNING_MODAL;
}