diff options
author | William Reynish <william@reynish.com> | 2009-10-20 14:41:44 +0400 |
---|---|---|
committer | William Reynish <william@reynish.com> | 2009-10-20 14:41:44 +0400 |
commit | c01c716346bba69bb1a2fe072b5e3d5c27b8cbeb (patch) | |
tree | 97e7492fd0cd746b891cde7c418808d7affbab4d /source | |
parent | 9f841f5b35e8f4f0f7f4866ba65d0d3d5d14b7e3 (diff) |
*Made the Add Constraint menu similar to modifiers, with categories in columns. Makes them consistent, and also ensures the menu fits even on smaller displays.
*Put the Modifiers tab *before* the ObData (mesh, curve etc) tab, because modifiers actually apply to Object , not the ObData, even though the opposite would appear to make more sense.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/UI_icons.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_header.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 56 |
3 files changed, 29 insertions, 33 deletions
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index e8c99a51bf8..f071111660b 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -523,7 +523,7 @@ DEF_ICON(ICON_MOD_UVPROJECT) DEF_ICON(ICON_MOD_DISPLACE) DEF_ICON(ICON_MOD_CURVE) DEF_ICON(ICON_MOD_LATTICE) -DEF_ICON(ICON_BLANK143) +DEF_ICON(ICON_CONSTRAINT_DATA) DEF_ICON(ICON_MOD_ARMATURE) DEF_ICON(ICON_MOD_SHRINKWRAP) DEF_ICON(ICON_MOD_CAST) diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 1bf2a058b5a..37a08bcf2ed 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -117,10 +117,10 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT_DATA, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_OBJECT, 0, 0, "Object"); if(sbuts->pathflag & (1<<BCONTEXT_CONSTRAINT)) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_CONSTRAINT, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, "Object Constraints"); - if(sbuts->pathflag & (1<<BCONTEXT_DATA)) - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, sbuts->dataicon, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, "Object Data"); if(sbuts->pathflag & (1<<BCONTEXT_MODIFIER)) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_MODIFIER, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_MODIFIER, 0, 0, "Modifiers"); + if(sbuts->pathflag & (1<<BCONTEXT_DATA)) + uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, sbuts->dataicon, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, "Object Data"); if(sbuts->pathflag & (1<<BCONTEXT_BONE)) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_BONE_DATA, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_BONE, 0, 0, "Bone"); if(sbuts->pathflag & (1<<BCONTEXT_BONE_CONSTRAINT)) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a820073d385..6a7885c3a16 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -27,6 +27,8 @@ #include "RNA_define.h" #include "RNA_types.h" +#include "rna_internal.h" + #include "DNA_action_types.h" #include "DNA_constraint_types.h" #include "DNA_modifier_types.h" @@ -37,36 +39,30 @@ #include "WM_types.h" EnumPropertyItem constraint_type_items[] ={ - {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", 0, "Child Of", ""}, - {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", 0, "Transformation", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", 0, "Copy Location", ""}, - {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", 0, "Copy Rotation", ""}, - {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", 0, "Copy Scale", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", 0, "Limit Location", ""}, - {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", 0, "Limit Rotation", ""}, - {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", 0, "Limit Scale", ""}, - {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", 0, "Limit Distance", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", 0, "Track To", ""}, - {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", 0, "Locked Track", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_MINMAX, "FLOOR", 0, "Floor", ""}, - {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", 0, "Shrinkwrap", ""}, - {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", 0, "Follow Path", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", 0, "Clamp To", ""}, - {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", 0, "Stretch To", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_KINEMATIC, "IK", 0, "IK", ""}, - {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", 0, "Rigid Body Joint", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_ACTION, "ACTION", 0, "Action", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_PYTHON, "SCRIPT", 0, "Script", ""}, - {0, "", 0, NULL, NULL}, - {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""}, + {0, "", 0, "Transform", ""}, + {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation", ""}, + {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", ""}, + {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", ""}, + {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT_DATA, "Copy Scale", ""}, + {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location", ""}, + {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation", ""}, + {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT_DATA, "Limit Scale", ""}, + {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT_DATA, "Limit Distance", ""}, + {0, "", 0, "Tracking", ""}, + {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To", ""}, + {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track", ""}, + {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To", ""}, + {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO",ICON_CONSTRAINT_DATA, "Stretch To", ""}, + {CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT_DATA, "Inverse Kinematics", ""}, + {0, "", 0, "Relationship", ""}, + {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", ""}, + {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", ""}, + {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""}, + {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", ""}, + {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""}, + {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", ""}, + {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem space_pchan_items[] = { |