Revision: 19958
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19958
Author:   ben2610
Date:     2009-04-28 15:56:24 +0200 (Tue, 28 Apr 2009)

Log Message:
-----------
ITASC: add solver selection button (nothing behind yet).

Modified Paths:
--------------
    branches/ge_dev/source/blender/include/butspace.h
    branches/ge_dev/source/blender/makesdna/DNA_armature_types.h
    branches/ge_dev/source/blender/src/buttons_object.c

Modified: branches/ge_dev/source/blender/include/butspace.h
===================================================================
--- branches/ge_dev/source/blender/include/butspace.h   2009-04-28 13:32:02 UTC 
(rev 19957)
+++ branches/ge_dev/source/blender/include/butspace.h   2009-04-28 13:56:24 UTC 
(rev 19958)
@@ -709,6 +709,7 @@
 enum {
        B_CONSTRAINT_TEST = 3201,
        B_CONSTRAINT_CHANGETARGET,
+       B_CONSTRAINT_CHANGEIKSOLVER,
        B_CONSTRAINT_ADD_NULL,
        B_CONSTRAINT_ADD_KINEMATIC,
        B_CONSTRAINT_ADD_TRACKTO,

Modified: branches/ge_dev/source/blender/makesdna/DNA_armature_types.h
===================================================================
--- branches/ge_dev/source/blender/makesdna/DNA_armature_types.h        
2009-04-28 13:32:02 UTC (rev 19957)
+++ branches/ge_dev/source/blender/makesdna/DNA_armature_types.h        
2009-04-28 13:56:24 UTC (rev 19958)
@@ -81,6 +81,8 @@
        int                     ghostsf, ghostef;               /* start and 
end frames of ghost-drawing range */
        int             pathsf, pathef;                 /* start and end frames 
of path-calculation range for all bones */
        int                     pathbc, pathac;                 /* number of 
frames before/after current frame of path-calculation for all bones  */
+       int                     iksolver;                               /* ik 
solver to use */
+       int                     pad;
 } bArmature;
 
 /* armature->flag */
@@ -159,4 +161,9 @@
        BONE_TRANSFORM_CHILD            = (1<<20),      /* Indicates that a 
parent is also being transformed */
 } eBone_Flag;
 
+/* bArmature->iksolver */
+typedef enum {
+       IKSOLVER_LEGACY = 0,
+       IKSOLVER_ITASC,
+} eArmature_IKSolverType;
 #endif

Modified: branches/ge_dev/source/blender/src/buttons_object.c
===================================================================
--- branches/ge_dev/source/blender/src/buttons_object.c 2009-04-28 13:32:02 UTC 
(rev 19957)
+++ branches/ge_dev/source/blender/src/buttons_object.c 2009-04-28 13:56:24 UTC 
(rev 19958)
@@ -1890,7 +1890,10 @@
                /* influence; do not execute actions for 1 dag_flush */
                if (ob->pose)
                        ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
-
+               /* walkthrough */
+       case B_CONSTRAINT_CHANGEIKSOLVER:
+               allqueue(REDRAWBUTSOBJECT, 0);
+               /* walkthrough */
        case B_CONSTRAINT_CHANGETARGET:
                if (ob->pose) ob->pose->flag |= POSE_RECALC;    // checks & 
sorts pose channels
                DAG_scene_sort(G.scene);
@@ -2874,9 +2877,23 @@
        if(G.obedit==OBACT) return;     // ??
        
        conlist = get_active_constraints(OBACT);
-       
+
+       xco = 10;
+       yco = 190;
+       {
+               bArmature *arm = get_armature(ob);
+               if (arm) {
+                       uiDefBut(block, LABEL, 0, "Armature IK solver:",        
0, yco, 130, 20, NULL, 0.0, 0.0, 0, 0, "Choose the IK solver for IK 
constraints");
+                       uiDefButI(block, MENU, B_CONSTRAINT_CHANGEIKSOLVER, 
+                                 "IK Solver%t|Legacy%x0|iTaSc%x1", 
+                                 150, yco, 120, 19, &arm->iksolver, 0, 0, 0, 
0, "Choose the IK solver for IK constraints");
+                       yco -= 30;
+               }
+       }
+
        if (conlist) {
-               uiDefBlockBut(block, add_constraintmenu, NULL, "Add 
Constraint", 0, 190, 130, 20, "Add a new constraint");
+
+               uiDefBlockBut(block, add_constraintmenu, NULL, "Add 
Constraint", 0, yco, 130, 20, "Add a new constraint");
                
                /* print active object or bone */
                str[0]= 0;
@@ -2887,11 +2904,9 @@
                else {
                        sprintf(str, "To Object: %s", ob->id.name+2);
                }
-               uiDefBut(block, LABEL, 1, str,  150, 190, 150, 20, NULL, 0.0, 
0.0, 0, 0, "Displays Active Object or Bone name");
-               
+               uiDefBut(block, LABEL, 1, str,  150, yco, 150, 20, NULL, 0.0, 
0.0, 0, 0, "Displays Active Object or Bone name");
+               yco -= 30;
                /* Go through the list of constraints and draw them */
-               xco = 10;
-               yco = 160;
                
                for (curcon = conlist->first; curcon; curcon=curcon->next) {
                        /* hrms, the temporal constraint should not draw! */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to