diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-05 14:59:12 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-05 14:59:12 +0300 |
commit | 6fb1d0e6a371ef66a2a3598c3a919ce63b64a22c (patch) | |
tree | e9345226f302f9d9cf38474bb9c21298514e94af /source/blender/editors/space_graph | |
parent | cce1d178b8ea9ac948ca7be4017a28b57dda6785 (diff) |
More Driver Fixes:
* Fixed Driver version-patching code to work correctly again with the new system.
* Fix for bug #20484, by adding a new driver variable type ('Transform Channel') which makes it easier to use object/bone transforms as in the past. The main differences with using this (compared with the 'Single Prop' type) are that this allows for 'final' transforms to get used instead (i.e. constraints are also taken into account), and also that this variable type can only be used for transforms (more limited scope -> less flexibility -> point-n-click goodies can follow). Mancandy now loads correctly again.
* Added toggle for local vs worldspace transforms when working with Rot/Loc Diff variable types, and also for the newly added Transform Channel
* Removed some dead code from sequencer...
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index c42dfd0015d..c7c58689a5f 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -352,7 +352,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, if (dtar->id && ob1->pose) { PointerRNA tar_ptr; - RNA_pointer_create(dtar2->id, &RNA_Pose, ob1->pose, &tar_ptr); + RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr); uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones"); } @@ -367,7 +367,7 @@ static void graph_panel_driverVar__rotDiff(const bContext *C, uiLayout *layout, } } -/* settings for 'rotation difference' driver variable type */ +/* settings for 'location difference' driver variable type */ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) { DriverTarget *dtar= &dvar->targets[0]; @@ -388,9 +388,11 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, if (dtar->id && ob1->pose) { PointerRNA tar_ptr; - RNA_pointer_create(dtar2->id, &RNA_Pose, ob1->pose, &tar_ptr); + RNA_pointer_create(dtar->id, &RNA_Pose, ob1->pose, &tar_ptr); uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones"); } + + uiItemR(col, NULL, 0, &dtar_ptr, "use_local_space_transforms", 0); col= uiLayoutColumn(layout, 1); uiTemplateAnyID(col, (bContext *)C, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:"); @@ -401,6 +403,35 @@ static void graph_panel_driverVar__locDiff(const bContext *C, uiLayout *layout, RNA_pointer_create(dtar2->id, &RNA_Pose, ob2->pose, &tar_ptr); uiItemPointerR(col, "", ICON_BONE_DATA, &dtar2_ptr, "bone_target", &tar_ptr, "bones"); } + + uiItemR(col, NULL, 0, &dtar2_ptr, "use_local_space_transforms", 0); +} + +/* settings for 'transform channel' driver variable type */ +static void graph_panel_driverVar__transChan(const bContext *C, uiLayout *layout, ID *id, DriverVar *dvar) +{ + DriverTarget *dtar= &dvar->targets[0]; + Object *ob = (Object *)dtar->id; + PointerRNA dtar_ptr; + uiLayout *col, *row; + + /* initialise RNA pointer to the target */ + RNA_pointer_create(id, &RNA_DriverTarget, dtar, &dtar_ptr); + + /* properties */ + col= uiLayoutColumn(layout, 1); + uiTemplateAnyID(col, (bContext *)C, &dtar_ptr, "id", "id_type", "Ob/Bone:"); + + if (dtar->id && ob->pose) { + PointerRNA tar_ptr; + + RNA_pointer_create(dtar->id, &RNA_Pose, ob->pose, &tar_ptr); + uiItemPointerR(col, "", ICON_BONE_DATA, &dtar_ptr, "bone_target", &tar_ptr, "bones"); + } + + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, 0, &dtar_ptr, "transform_type", 0); + uiItemR(row, NULL, 0, &dtar_ptr, "use_local_space_transforms", 0); } /* driver settings for active F-Curve (only for 'Drivers' mode) */ @@ -503,6 +534,9 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) case DVAR_TYPE_LOC_DIFF: /* location difference */ graph_panel_driverVar__locDiff(C, box, ale->id, dvar); break; + case DVAR_TYPE_TRANSFORM_CHAN: /* transform channel */ + graph_panel_driverVar__transChan(C, box, ale->id, dvar); + break; } } |