Revision: 14182
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14182
Author:   aligorith
Date:     2008-03-20 12:31:52 +0100 (Thu, 20 Mar 2008)

Log Message:
-----------
Bugfix #8599b: 
Insert-Key in Action Editor didn't work correctly for Constraint Channels yet. 
This was because a pointer to constraint data was not being obtained (it's now 
hacked to assume that 'Influence' is being keyed all the time).

Modified Paths:
--------------
    trunk/blender/source/blender/src/editaction.c
    trunk/blender/source/blender/src/editipo.c

Modified: trunk/blender/source/blender/src/editaction.c
===================================================================
--- trunk/blender/source/blender/src/editaction.c       2008-03-20 10:50:46 UTC 
(rev 14181)
+++ trunk/blender/source/blender/src/editaction.c       2008-03-20 11:31:52 UTC 
(rev 14182)
@@ -1432,6 +1432,7 @@
        allqueue(REDRAWACTION, 0);
        allqueue(REDRAWIPO, 0);
        allqueue(REDRAWNLA, 0);
+       allqueue(REDRAWBUTSOBJ, 0);
 }
 
 /* delete selected keyframes */

Modified: trunk/blender/source/blender/src/editipo.c
===================================================================
--- trunk/blender/source/blender/src/editipo.c  2008-03-20 10:50:46 UTC (rev 
14181)
+++ trunk/blender/source/blender/src/editipo.c  2008-03-20 11:31:52 UTC (rev 
14182)
@@ -2268,14 +2268,14 @@
        BIF_undo_push("Add Ipo vertex");
 }
 
-static void *get_context_ipo_poin(ID *id, int blocktype, char *actname, 
IpoCurve *icu, int *vartype)
+static void *get_context_ipo_poin(ID *id, int blocktype, char *actname, char 
*constname, IpoCurve *icu, int *vartype)
 {
-       if(blocktype==ID_PO) {
-               if(GS(id->name)==ID_OB) {
+       if (blocktype==ID_PO) {
+               if (GS(id->name)==ID_OB) {
                        Object *ob= (Object *)id;
                        bPoseChannel *pchan= get_pose_channel(ob->pose, 
actname);
                        
-                       if(pchan) {
+                       if (pchan) {
                                *vartype= IPO_FLOAT;
                                return get_pchan_ipo_poin(pchan, icu->adrcode);
                        }
@@ -2284,6 +2284,35 @@
                }
                return NULL;
        }
+       else if (blocktype==ID_CO) {
+               if ((GS(id->name)==ID_OB) && (constname && constname[0])) {
+                       Object *ob= (Object *)id;
+                       bConstraint *con;
+                       
+                       /* assume that we only want the influence (as only used 
for Constraint Channels) */
+                       if ((ob->ipoflag & OB_ACTION_OB) && !strcmp(actname, 
"Object")) {
+                               for (con= ob->constraints.first; con; con= 
con->next) {
+                                       if (strcmp(constname, con->name)==0) {
+                                               *vartype= IPO_FLOAT;
+                                               return &con->enforce;
+                                       }
+                               }
+                       }
+                       else if (ob->pose) {
+                               bPoseChannel *pchan= get_pose_channel(ob->pose, 
actname);
+                               
+                               if (pchan) {
+                                       for (con= pchan->constraints.first; 
con; con= con->next) {
+                                               if (strcmp(constname, 
con->name)==0) {
+                                                       *vartype= IPO_FLOAT;
+                                                       return &con->enforce;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return NULL;
+       }
        else
                return get_ipo_poin(id, icu, vartype);
 
@@ -2420,7 +2449,7 @@
                
                if(icu) {
                        
-                       poin= get_context_ipo_poin(id, blocktype, actname, icu, 
&vartype);
+                       poin= get_context_ipo_poin(id, blocktype, actname, 
constname, icu, &vartype);
                        
                        if(poin) {
                                curval= read_ipo_poin(poin, vartype);
@@ -2641,7 +2670,7 @@
                
                if(icu) {
                        
-                       poin= get_context_ipo_poin(id, blocktype, actname, icu, 
&vartype);
+                       poin= get_context_ipo_poin(id, blocktype, actname, 
constname, icu, &vartype);
                        
                        if(poin) {
                                curval= read_ipo_poin(poin, vartype);
@@ -2683,7 +2712,7 @@
        
        if(icu) {
                
-               poin= get_context_ipo_poin(id, blocktype, actname, icu, 
&vartype);
+               poin= get_context_ipo_poin(id, blocktype, actname, constname, 
icu, &vartype);
                
                if(poin) {
                        curval= read_ipo_poin(poin, vartype);
@@ -2735,7 +2764,7 @@
        
        if(icu) {
                
-               poin= get_context_ipo_poin(id, blocktype, actname, icu, 
&vartype);
+               poin= get_context_ipo_poin(id, blocktype, actname, constname, 
icu, &vartype);
                
                if(poin) {
                        


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

Reply via email to