I'm trying to make a driver that gets the restrict viewport (hide property) and restrict rendering (hide_render property) properties from another object, as explained here.
1. No live updates ?
The above picture only shows a driver on the hide_render property, even if I did try with the hide property too.
- hide_render : seems to work (objets are hidden when rendered);
- hide : the outliner icons are not updated nor the objects are hidden in the viewport. Probably related to this bug ?
This is a known limitation of the current dependency graph (depsgraph).
Currently, the depsgraph can only represent and schedule up relationships on datablock level. Drivers are actually evaluated on the object level, and all in one go before any other data on the object gets evaluated. As a result, for drivers which operate on bones within the same armature that they read values from, the drivers are only able to see the result of the previous time that the pose was evaluated. In other words, you'll find a bit of lag in the updates.
2. Script to fetch a parent ?
While I have coding skills, I don't know anything about Python, and it's the first time I'm thinking about using a script in Blender.
Rather than setting manually an object for the "prop" value of the driver, is it possible to add a script that would fetch the object's parent ?
That script should get the closest parent having keyframes for the desired property.
I would be glad to have your thoughts about all of this !