diff options
author | Ton Roosendaal <ton@blender.org> | 2005-10-03 00:51:35 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-10-03 00:51:35 +0400 |
commit | 015fe7ea817680e785e4dd2b4118bbfdabeba766 (patch) | |
tree | e20c853d86690bb30f45843314b76a90d51138a7 /source/blender/src/header_ipo.c | |
parent | 42fe4c568d2c393dcb016882a08a710ac3b11173 (diff) |
Version 1.0 of IpoDrivers.
First note that this is new functionality, unfinished, and only for
testing and feedback purposes. I'll list below what works, and what will
need work still.
This text is also in cms: http://www.blender.org/cms/Ipo_Drivers.680.0.html
An IpoDriver is like an IpoCurve, but instead of a Bezier curve, it allows
to connect a property of other Objects as input for the "channel". For
example, IpoDrivers can be used to have a Shape Key being "driven" by
the rotation of a Bone. Or the RGB colors of a Material get driven by the
XYZ location of an Object.
Editing of Drivers happens in the IpoWindow. Here you can notice that the
channels (right hand window) now have an "active" channel indicator.
To add a Driver, you have to use the "Transform Properties" Panel (Nkey).
Here you can add or remove a Driver to the active channel, and use the
buttons to fill in what kind of relationship you want to establish.
Driver Objects
Note that any Ipo Channel can become driven now, but that only Object
transformation or Pose Bone transformation can be used to become a
Driver now.
At this moment, only the local transformation is taken into account.
For Objects that means the location/rotation/scale value without Parent
transform (as shown in "Transform Properties" Panel for Objects).
For Pose Bones it means that only the Pose transform (changes of rest
position) is Driver information (also as shown in Transform Property
Panel in Pose Mode).
Mapping of Drivers
When an Ipo Channel is "driven", the mapping is by default one-to-one.
It is only restricted by already built-in limits for Channels, like
for Material the "R" value can only range from 0.0 to 1.0.
Also note that when mapping rotations, the actual rotation values
in Ipos are scaled down with a factor 10.0. (180 degrees actually has
in the Ipo system a value of 18.0). This is an ancient year zero
convention in Blender... it is a bit hidden, because the ruler
(vertical as well as horizontal) displays the virtual values correctly.
Only the Properties panel shows the actual value.
When you draw an IpoCurve in a Driven channel, this curve will define
the mapping between the Driver output (horizontal) and Driven input
(vertical, as usual).
A nice new option to use is "Insert one-to-one curve" (press I-key,
or in pulldown menu). This will also zoom the display in exactly to
fill the window, allowing easy edit. If you use this option with
degrees, it will map 180 degree rotation to a range of 1.0 unit.
Live updates
Since the Drivers are integrated in the Ipo system, they will always
be updated whenever an Ipo is evaluated. This happens at least on
frame changes.
For interactive feedback, updates while transforming objects were
added in these cases:
- Driven Object Ipos, by other Objects or Pose Bones
- Driven Shape Key Ipos, by other Objects or Pose Bones
You can also insert Drivers on Action Ipos, but these are only evaluated
on frame change now.
Todo
- Drivers can also get a text button, allowing a 1 line Python script
to be executed.
- Make UI for it a bit less hidden... maybe with visualization in 3D?
- Allowing global transform coordinates as Driver too.
Issues
- renaming Bones won't rename drivers
- (file) appending the Ipo won't append the linked driver Objects
Diffstat (limited to 'source/blender/src/header_ipo.c')
-rw-r--r-- | source/blender/src/header_ipo.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index fce45d7ab39..06e7e418224 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -411,10 +411,13 @@ static uiBlock *ipo_editmenu(void *arg_unused) else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Edit Selected|TAB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - ei = G.sipo->editipo; + ei = get_active_editipo(); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + if(ei->icu && ei->icu->driver) + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert 1:1 Curve...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + else + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -473,11 +476,14 @@ static void do_ipo_viewmenu(void *arg, int event) mainqenter(PADMINUS,1); break; case 6: /* Play Back Animation */ - play_anim(0); - break; + play_anim(0); + break; case 7: /* Play Back Animation in All */ - play_anim(1); - break; + play_anim(1); + break; + case 8: + add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW); + break; } } @@ -492,6 +498,8 @@ static uiBlock *ipo_viewmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "ipo_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_ipo_viewmenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Channel Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); if (G.sipo->showkey) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); else @@ -692,6 +700,8 @@ void do_ipo_buttons(short event) v2d->cur.ymax= v2d->tot.ymax+ dy; test_view2d(G.v2d, curarea->winx, curarea->winy); + if(G.sipo->ipo) G.sipo->ipo->cur = G.v2d->cur; + scrarea_queue_winredraw(curarea); break; case B_IPOBORDER: |