diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-20 02:38:26 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-20 02:38:26 +0300 |
commit | a8855e2cafafe2acc14f532625cb0dff1815a0f7 (patch) | |
tree | ca9904c34c1b154e311703183d8584e8c6d4807f /source/blender/editors | |
parent | ccb6e1904abf358c0f999019ffd62d407ecc920b (diff) |
Drivers UI: Debug Info
Feature request for ZanQdo, which shows the intermediate values used in driver calculations (i.e. current value of driver, and current value of variables), allowing drivers expressions to be debugged. This is a per-driver setting...
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 30 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 1 |
2 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 7dfb11a9827..1d6fe6d0b6b 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -318,7 +318,7 @@ static void graph_panel_driverVar__singleProp(const bContext *C, uiLayout *layou /* Target ID */ row= uiLayoutRow(layout, 0); - uiTemplateAnyID(row, (bContext *)C, &dtar_ptr, "id", "id_type", "Value:"); + uiTemplateAnyID(row, (bContext *)C, &dtar_ptr, "id", "id_type", "Prop:"); /* Target Property */ // TODO: make this less technical... @@ -490,6 +490,21 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) if (driver->flag & DRIVER_FLAG_INVALID) uiItemL(col, "ERROR: invalid target channel(s)", ICON_ERROR); } + + col= uiLayoutColumn(pa->layout, 1); + /* debug setting */ + uiItemR(col, NULL, 0, &driver_ptr, "show_debug_info", 0); + + /* value of driver */ + if (driver->flag & DRIVER_FLAG_SHOWDEBUG) { + uiLayout *row= uiLayoutRow(col, 1); + char valBuf[32]; + + uiItemL(row, "Driver Value:", 0); + + sprintf(valBuf, "%.3f", driver->curval); + uiItemL(row, valBuf, 0); + } /* add driver variables */ col= uiLayoutColumn(pa->layout, 0); @@ -542,6 +557,19 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) graph_panel_driverVar__transChan(C, box, ale->id, dvar); break; } + + /* value of variable */ + if (driver->flag & DRIVER_FLAG_SHOWDEBUG) { + uiLayout *row; + char valBuf[32]; + + box= uiLayoutBox(col); + row= uiLayoutRow(box, 1); + uiItemL(row, "Value:", 0); + + sprintf(valBuf, "%.3f", dvar->curval); + uiItemL(row, valBuf, 0); + } } /* cleanup */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8033a340a43..811ebb13592 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4600,7 +4600,6 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o { ID *id= &ob->id; AnimData *adt= ob->adt; - bArmature *arm= ob->data; bAction *act= (adt) ? adt->action : NULL; bPose *pose= ob->pose; bPoseChannel *pchan; |