Blender Git Loki
Git Commits -> Revision 0512e20
Revision 0512e20 by Joshua Leung (master) March 26, 2016, 05:02 (GMT) |
Driver Setup Workflow Improvement: Property Eyedropper This commit brings some long requested improvements to the workflow for setting up drivers, which should make it easier and faster to set up new drivers in a more interactive fashion. The new workflow is as follows: 1) Hover over the property (e.g. "Lamp Energy" or "Y Location") or properties ("Rotation") you wish to add drivers to. We'll refer to this as the "destination" 2) Ctrl-D to active the new "Add Drivers" eyedropper 3) Click on the property you want to use as the source/target. The property under the mouse will be used to drive the property you invoked Ctrl-D on. For example, to drive the X, Y, and Z location of the Cube using the Y Location of the Lamp, hover over any of the X/Y/Z location buttons, hit Ctrl-D, then click on the Y-Location button of the Lamp object. Drivers will be added to the X, Y, and Z Location properties of the Cube; each driver will have a single variable, which uses the Y-Location Transform Channel of the Lamp. Tips: - Transform properties will automatically create "Transform Channel" driver variables. Everything else will use "Single Property" ones - Due to the way that Blender's UI Context works, you'll need two Properties Panel instances open (and to have pinned one of the two to show the properties for the unselected object). It's slightly clunky, but necessary for implementing a workflow like this, as the UI cannot be manipulated while using eyedroppers to pick data. - The eyedropper operator implemented here actually has three modes of operation. 1) The "1-N" (one to many) mode is the default used for Ctrl-D, and "Add Driver to All" in the RMB Menu. This is the behaviour described above. 2) There's also a "1-1" (one to one) mode that is used for the "Add Single Driver" in the RMB Menu. 3) Finally, there's the "N-N" mode (many to many), which isn't currently exposed. The point of this is to allow mapping XYZ to XYZ elementwise (i.e. direct copying) which is useful for things like locations, rotations, scaling, and colours. Implementation Notes: - The bulk of the driver adding logic is in editors/animation/drivers.c, where most of the Driver UI operators and tools are defined - The property eyedropper code is in interface_eyedropper.c along with all the other eyedroppers (even though they don't share much actual code in common). However, this turns out to be necessary, as we can't get access to many of the low-level buttons API's otherwise. Todo: - It may be necessary to restore a way to access the old behaviour (i.e. "manual setup") in case it is not practical to immediately pick a property. - Other things to investigate here include extra hotkeys (e.g. Ctrl-Shift-D for Add Single?), and to expose the N-N mode. - Other things we could try include interactively applying scaling factors, picking multiple targets (e.g. for location difference and rotation difference drivers), and/or other ways of using these property picking methods. |
Commit Details:
Full Hash: 0512e20ae9939f4a688f4f485acdf246dc4d7682
Parent Commit: ee9898e
Lines Changed: +440, -23
6 Modified Paths:
/source/blender/editors/animation/drivers.c (+208, -19) (Diff)
/source/blender/editors/include/ED_keyframing.h (+33, -2) (Diff)
/source/blender/editors/interface/interface_eyedropper.c (+195, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+1, -2) (Diff)
/source/blender/editors/interface/interface_intern.h (+2, -0) (Diff)
/source/blender/editors/interface/interface_ops.c (+1, -0) (Diff)
/source/blender/editors/include/ED_keyframing.h (+33, -2) (Diff)
/source/blender/editors/interface/interface_eyedropper.c (+195, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+1, -2) (Diff)
/source/blender/editors/interface/interface_intern.h (+2, -0) (Diff)
/source/blender/editors/interface/interface_ops.c (+1, -0) (Diff)