Debug value in degrees (under parenthesis) for rotation driver variables
authorDalai Felinto <dfelinto@gmail.com>
Tue, 20 Nov 2012 23:35:03 +0000 (23:35 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Tue, 20 Nov 2012 23:35:03 +0000 (23:35 +0000)
Specifically the Rotational Difference and XYZ Rotation Transform Channel

Feature requested during BlenderPRO 2012 (Brazilian Blender Conference)
and coded during my flight back :)

Reviewed by Joshua Leung(Aligorith)

source/blender/editors/space_graph/graph_buttons.c

index 8bb57a32090558d4cab9bacfbfbef80d8225517f..67b427daa9cc1e4a896c5c9d064046e40d33d155 100644 (file)
@@ -714,7 +714,14 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
                        row = uiLayoutRow(box, TRUE);
                        uiItemL(row, IFACE_("Value:"), ICON_NONE);
                        
-                       BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval);
+                       if ((dvar->type == DVAR_TYPE_ROT_DIFF) ||
+                               (dvar->type == DVAR_TYPE_TRANSFORM_CHAN &&
+                                dvar->targets[0].transChan >= DTAR_TRANSCHAN_ROTX &&
+                                dvar->targets[0].transChan < DTAR_TRANSCHAN_SCALEX))
+                               BLI_snprintf(valBuf, sizeof(valBuf), "%.3f (%4.1f°)", dvar->curval, RAD2DEGF(dvar->curval));
+                       else
+                               BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval);
+
                        uiItemL(row, valBuf, ICON_NONE);
                }
        }