diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-28 06:49:45 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-28 06:49:45 +0300 |
commit | 54c5859578362976cc54b4e04f0a513117b4698e (patch) | |
tree | c377ed51fd218982da61a960c4e5f572c91ab2df /source/blender/editors | |
parent | c6b4c2716a5fb2784b9b2ddc5ec555ff68a2d24b (diff) |
Durian Rigging Requests: (Armature Layers + Rotation Locking Tweaks)
* Increased the number of Armature and Bone Layers from 16 to 32. Please note that older versions of Blender may not correctly resolve the layers that bones are on when loading new files.
* Newly added objects are now made by default to allow locking of 4-component rotations using 4 separate locks (i.e. one by component) instead of requiring the obscure 'W' toggle (renamed '4L' now) to be enabled first. The objects in the default scene need modifying manually though.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 26 | ||||
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 7 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 27 |
3 files changed, 27 insertions, 33 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index f415eeb421f..aeb42142abd 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1464,7 +1464,7 @@ static short pose_select_same_layer (Object *ob) bPose *pose= (ob)? ob->pose : NULL; bArmature *arm= (ob)? ob->data : NULL; bPoseChannel *pchan; - short layers= 0, changed= 0; + int layers= 0, changed= 0; if (ELEM3(NULL, ob, pose, arm)) return 0; @@ -1670,7 +1670,7 @@ static int pose_armature_layers_invoke (bContext *C, wmOperator *op, wmEvent *ev Object *ob= CTX_data_active_object(C); bArmature *arm= (ob)? ob->data : NULL; PointerRNA ptr; - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* sanity checking */ if (arm == NULL) @@ -1691,7 +1691,7 @@ static int pose_armature_layers_exec (bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); bArmature *arm= (ob)? ob->data : NULL; PointerRNA ptr; - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* get the values set in the operator properties */ RNA_boolean_get_array(op->ptr, "layers", layers); @@ -1723,7 +1723,7 @@ void POSE_OT_armature_layers (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean_layer_member(ot->srna, "layers", 16, NULL, "Layer", "Armature layers to make visible"); + RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers to make visible"); } void ARMATURE_OT_armature_layers (wmOperatorType *ot) @@ -1742,7 +1742,7 @@ void ARMATURE_OT_armature_layers (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean_layer_member(ot->srna, "layers", 16, NULL, "Layer", "Armature layers to make visible"); + RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers to make visible"); } /* ------------------- */ @@ -1750,7 +1750,7 @@ void ARMATURE_OT_armature_layers (wmOperatorType *ot) /* Present a popup to get the layers that should be used */ static int pose_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt) { - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* get layers that are active already */ memset(&layers, 0, sizeof(layers)); /* set all layers to be off by default */ @@ -1760,7 +1760,7 @@ static int pose_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt) short bit; /* loop over the bits for this pchan's layers, adding layers where they're needed */ - for (bit= 0; bit < 16; bit++) { + for (bit= 0; bit < 32; bit++) { if (pchan->bone->layer & (1<<bit)) layers[bit]= 1; } @@ -1780,7 +1780,7 @@ static int pose_bone_layers_exec (bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); bArmature *arm= (ob)? ob->data : NULL; PointerRNA ptr; - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* get the values set in the operator properties */ RNA_boolean_get_array(op->ptr, "layers", layers); @@ -1816,7 +1816,7 @@ void POSE_OT_bone_layers (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean_layer_member(ot->srna, "layers", 16, NULL, "Layer", "Armature layers that bone belongs to"); + RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers that bone belongs to"); } /* ------------------- */ @@ -1824,7 +1824,7 @@ void POSE_OT_bone_layers (wmOperatorType *ot) /* Present a popup to get the layers that should be used */ static int armature_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *evt) { - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* get layers that are active already */ memset(&layers, 0, sizeof(layers)); /* set all layers to be off by default */ @@ -1834,7 +1834,7 @@ static int armature_bone_layers_invoke (bContext *C, wmOperator *op, wmEvent *ev short bit; /* loop over the bits for this pchan's layers, adding layers where they're needed */ - for (bit= 0; bit < 16; bit++) { + for (bit= 0; bit < 32; bit++) { if (ebone->layer & (1<<bit)) layers[bit]= 1; } @@ -1854,7 +1854,7 @@ static int armature_bone_layers_exec (bContext *C, wmOperator *op) Object *ob= CTX_data_edit_object(C); bArmature *arm= (ob)? ob->data : NULL; PointerRNA ptr; - int layers[16]; /* hardcoded for now - we can only have 16 armature layers, so this should be fine... */ + int layers[32]; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ /* get the values set in the operator properties */ RNA_boolean_get_array(op->ptr, "layers", layers); @@ -1890,7 +1890,7 @@ void ARMATURE_OT_bone_layers (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean_layer_member(ot->srna, "layers", 16, NULL, "Layer", "Armature layers that bone belongs to"); + RNA_def_boolean_layer_member(ot->srna, "layers", 32, NULL, "Layer", "Armature layers that bone belongs to"); } /* ********************************************** */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index f054e229147..083884336d2 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -65,17 +65,16 @@ typedef struct EditBone their parents. Therefore any rotations specified during the animation are automatically relative to the bones' rest positions*/ int flag; - - int parNr; /* Used for retrieving values from the menu system */ + int layer; float dist, weight; float xwidth, length, zwidth; /* put them in order! transform uses this as scale */ float ease1, ease2; float rad_head, rad_tail; - short layer, segments; float oldlength; /* for envelope scaling */ - + + short segments; } EditBone; #define BONESEL_ROOT 0x10000000 diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 0eddeba6ff9..a988ceb50e7 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -521,40 +521,35 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) split = uiLayoutSplit(layout, 0.8); switch(RNA_enum_get(ptr, "rotation_mode")) { - case ROT_MODE_XYZ: - case ROT_MODE_XZY: - case ROT_MODE_YXZ: - case ROT_MODE_YZX: - case ROT_MODE_ZXY: - case ROT_MODE_ZYX: - colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, "Rotation", 0, ptr, "rotation_euler", 0); - colsub = uiLayoutColumn(split, 1); - uiItemL(colsub, "", 0); - uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); - break; - case ROT_MODE_QUAT: + case ROT_MODE_QUAT: /* quaternion */ colsub = uiLayoutColumn(split, 1); uiItemR(colsub, "Rotation", 0, ptr, "rotation_quaternion", 0); colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, "W", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE); + uiItemR(colsub, "4L", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE); if (RNA_boolean_get(ptr, "lock_rotations_4d")) uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); else uiItemL(colsub, "", 0); uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); break; - case ROT_MODE_AXISANGLE: + case ROT_MODE_AXISANGLE: /* axis angle */ colsub = uiLayoutColumn(split, 1); uiItemR(colsub, "Rotation", 0, ptr, "rotation_axis_angle", 0); colsub = uiLayoutColumn(split, 1); - uiItemR(colsub, "W", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE); + uiItemR(colsub, "4L", 0, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE); if (RNA_boolean_get(ptr, "lock_rotations_4d")) uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); else uiItemL(colsub, "", 0); uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); break; + default: /* euler rotations */ + colsub = uiLayoutColumn(split, 1); + uiItemR(colsub, "Rotation", 0, ptr, "rotation_euler", 0); + colsub = uiLayoutColumn(split, 1); + uiItemL(colsub, "", 0); + uiItemR(colsub, "", ICON_LOCKED, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY); + break; } uiItemR(layout, "", 0, ptr, "rotation_mode", 0); |