Graph Editor tweaks:
authorJoshua Leung <aligorith@gmail.com>
Tue, 7 Sep 2010 12:03:09 +0000 (12:03 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 7 Sep 2010 12:03:09 +0000 (12:03 +0000)
Buttons for editing RNA paths/array index for F-Curves that aren't working are now actually functional. This means that when invalid paths are present, they can be manually fixed up.

source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/makesrna/intern/rna_fcurve.c

index b71e9ac35071c40bc229c2672948aa8fd01a806e..4bc2654e581b4421403ab51eef70a4af2eb54c9d 100644 (file)
@@ -157,6 +157,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                        /* icon for this should be the icon for the base ID */
                        // TODO: or should we just use the error icon?
                        icon= RNA_struct_ui_icon(id_ptr.type);
+                       
+                       /* tag F-Curve as disabled - as not usable path */
+                       fcu->flag |= FCURVE_DISABLED;
                }
        }
        
index 14f684dd9e3618816dc3eb18e1810be9744cc170..f4567255b9106f2e3187353468a59259960b4b4c 100644 (file)
@@ -184,7 +184,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
                
        /* RNA-Path Editing - only really should be enabled when things aren't working */
        col= uiLayoutColumn(layout, 1);
-               uiLayoutSetEnabled(col, (fcu->flag & FCURVE_DISABLED)); 
+               uiLayoutSetEnabled(col, (fcu->flag & FCURVE_DISABLED)!=0); 
                uiItemR(col, &fcu_ptr, "data_path", 0, "", ICON_RNA);
                uiItemR(col, &fcu_ptr, "array_index", 0, NULL, 0);
                
index a55c3f1009534c917ea8ceb63343a4ee31757514..63405e08f69171cb2a48c0104d5c0a1bebe70de2 100644 (file)
@@ -324,8 +324,10 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
        if (fcu->rna_path)
                MEM_freeN(fcu->rna_path);
        
-       if (strlen(value))
+       if (strlen(value)) {
                fcu->rna_path= BLI_strdup(value);
+               fcu->flag &= ~FCURVE_DISABLED;
+       }
        else 
                fcu->rna_path= NULL;
 }