Plumiferos request: Added button in Armature options panel to set custom
authorTon Roosendaal <ton@blender.org>
Wed, 1 Nov 2006 14:29:06 +0000 (14:29 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 1 Nov 2006 14:29:06 +0000 (14:29 +0000)
bone drawing on/off. Is default on.

source/blender/include/BIF_editarmature.h
source/blender/makesdna/DNA_armature_types.h
source/blender/src/buttons_editing.c
source/blender/src/drawarmature.c

index 7766accdab62a3f29f9095b329fae884e93d9f90..62cb7c2e7499ce490babca97d7ae8c75fb354cfb 100644 (file)
@@ -103,6 +103,7 @@ void        mouse_armature(void);
 void   remake_editArmature(void);
 void   selectconnected_armature(void);
 void   selectconnected_posearmature(void);
+void   select_bone_parent(void);
 void    unique_editbone_name (char* name);
 
 void   auto_align_armature(void);
index f2080c60cefa8a3a388f63dd92a053723d041195..0b59173afa7cbb04b8731f698a2b2a1581ffbf5b 100644 (file)
@@ -95,6 +95,8 @@ typedef struct bArmature {
 #define                ARM_DONT_USE    0x080
 #define                ARM_MIRROR_EDIT 0x100
 #define                ARM_AUTO_IK             0x200
+                       /* made option negative, for backwards compat */
+#define                ARM_NO_CUSTOM   0x400
 
 /* armature->drawtype */
 #define                ARM_OCTA                0
index ce6730454be65f91a4c80840b12d0c85e58220d1..12284ff9294c2c104b56ed9ee4a5d77b2fce2f3f 100644 (file)
@@ -3119,8 +3119,9 @@ static void editing_panel_armature_type(Object *ob, bArmature *arm)
        uiDefButI(block, ROW, REDRAWVIEW3D, "B-Bone",   155, 100,70,20, &arm->drawtype, 0, ARM_B_BONE, 0, 0, "Draw bones as boxes, showing subdivision and b-splines");
        uiDefButI(block, ROW, REDRAWVIEW3D, "Envelope", 225, 100,85,20, &arm->drawtype, 0, ARM_ENVELOPE, 0, 0, "Draw bones as extruded spheres, showing deformation influence volume");
 
-       uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 80,150,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
-       uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 160,80,150,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
+       uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 80,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes");
+       uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 110,80,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone names");
+       uiDefButBitI(block, TOGN, ARM_NO_CUSTOM, REDRAWVIEW3D, "Draw Shapes", 210,80,100,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone shapes");
        
        uiDefButS(block, NUM, REDRAWVIEW3D, "Ghost: ", 10,60,150,20, &arm->ghostep, 0.0f, 30.0f, 0, 0, "Draw Ghosts around current frame, for current Action");
        uiDefButS(block, NUM, REDRAWVIEW3D, "Step: ", 160,60,150,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances");
index 083125442afc01fdcb11bf555c1e6958d375fdc9..4f554530675ad87e3d52c2fc058ca78c641208f2 100644 (file)
@@ -1378,7 +1378,7 @@ static void draw_pose_channels(Base *base, int dt)
                                        if(bone->parent && (bone->parent->flag & BONE_HIDDEN_P))
                                                flag &= ~BONE_CONNECTED;
                                        
-                                       if(pchan->custom)
+                                       if(pchan->custom && !(arm->flag & ARM_NO_CUSTOM))
                                                draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length);
                                        else if(arm->drawtype==ARM_LINE)
                                                ;       /* nothing in solid */
@@ -1465,7 +1465,7 @@ static void draw_pose_channels(Base *base, int dt)
                                        if(pchan->flag & POSE_STRIDE)
                                                constflag |= PCHAN_HAS_STRIDE;
 
-                                       if(pchan->custom) {
+                                       if(pchan->custom && !(arm->flag & ARM_NO_CUSTOM)) {
                                                if(dt<OB_SOLID)
                                                        draw_custom_bone(pchan->custom, OB_WIRE, arm->flag, flag, index, bone->length);
                                        }