Sunday, March 27, 2016

Driver Workflow Improvements - "Property Eyedropper" for Quicker Setup, and Other Features

It's taken a few days of intense hacking and investigation, but late this afternoon I finally succeeded in implementing a new way workflow for setting up drivers that should help streamline the process. Many have been requesting a faster way of doing this for years and it's been on my todo list for a while now until I finally got around to it this Easter.

Here's a little demo of how this now works:





In Short:
* Use Ctrl-D to add drivers instead of DKEY.  This has been changed to avoid conflicts/problems when Grease Pencil is used

* You can now use an "eyedropper" to select which property you want to use as the source/driving value. This saves you effort, by removing the need to manually specify the driver variables in the Graph Editor, one by one. It's all done for you with a single click.

(PS: Try to not record a video the night after pulling a long coding session to hack crazy stuff together... It makes it even more horrible listening to the sound of your own voice! Aaarrrrgh!! Haha)


For More Details:
See the commit log


Next Steps:
1) I'm going to put back an option to have the old behaviour (in case you can't easily get another view open for the source properties). The big question is how to provide access to it...

2) I'm currently pondering whether to first put up a menu of different options for setting up and picking the new driver(s). In particular, there's a "many to many" option that could be useful for quickly driving a colour by another colour (or maybe a location), without having to do a lot of manual work, but which isn't currently exposed as there's no way to expose it.

3) Use some similar techniques for setting up Location Difference and Rotation Difference drivers. These may be better suited to picking objects from the 3D view however.   (In the process, I may as well add the missing eyedropper icons/tools for the Bone fields)

4) Some other workflow tweaks for making it easier to edit drivers. Ideas I've been considering include:
   A.  Adding a popup panel to quickly change settings about the driver, and to see its variables
   B.  Adding a "Show in Graph Editor" option to jump to a Graph Editor to edit the relevant driver
   C.  Implementing more eyedroppers to make it easy to change driver targets and/or set up other new driver variable targets at a later date
   D.  Providing a dropdown of commonly used driver expressions (e.g. "half, double, triple, sin, etc." that people can just pick to quickly set things up even faster).  Exactly what we include, and whether we do it in the expression vs for the FCurve shape are yet to be decided


Other Stuff:
* I've also been working on making it easier to create corrective drivers. Specifically, you can now press IKEY over a driven property, and a keyframe will now be created such that the x-coordinate of is the driver (expression)'s current result, and the y-coordinate being the value of the driven property. 

(There's a slight snag in that you can only do this when the Driver FCurve is muted, since the RNA_update() performed just after editing but before autokeying the button makes it impossible to do such keying otherwise. Hopefully I'll figure out some way to get this fully working - maybe by finishing off the "overrides" system I first sketched out and have had hanging around unfinished in the animsystem since the earliest days that I was writing the code for that back in January 2009)


* I've also set up some tools to help "validate" the names of driver variables. It will now tell you why a driver expression was bad if you click on the indicator beside the offending variable names:



1 comment:

  1. Hi. While this is a really nice addition it would be cool also to have the ability to pick values from the viewport. Let me explain further.

    The idea is to add a driver and while setting the driver you may click on some object on the viewport. Then a dropdown menu allows you to navigate trought the properties of such objects. Location, rotations. Once you click on that option the driver is set.

    That´s more or less how the After Effects pickwhip works, but due to that AE is based on layers the most reasonable approach I find it´s this. Maybe this is more related to the widget project. I find a little bit annoying to have two properties panel opened.

    However I will like to thank your work on drivers. They are one of the most powerfull and underrated features on Blender. With some little more enhancements specially on the UI and the sintaxis for creating expressions (ie: adding things like sframe for start frame or x.location for referencing the location of the current object, and even a more easy way to reference properties from other objects as ob("Cube1").location.x), the driver system could become as powerfull as some top notch applications as Houdini.

    ReplyDelete