1
$\begingroup$

I tried to access the FPS setting of the render settings in a shader node through a driver expression. The attempt was successful, but I got a warning and a tip saying:

WARNING: Driver expression may not work correctly

TIP: bpy.context is not safe for renderfarm usage

Driver Settings screenshot from Blender Drivers Editor

According to this thread the proper way to set the active scene is through bpy.context. Therefor, I assumed, that the proper way to get the active scene would be through bpy.context as well. This warning however makes me feel like there is a more proper way to access scene data (like render settings) through drivers so they would also work in renderfarms.

So my question is: How do I properly access this kind of data in a driver expression?

$\endgroup$
3
  • 1
    $\begingroup$ You'll have to modify the drivers namespace because the expression field can't directly acces the context See How can a blender driver python script access scene properties like FPS? $\endgroup$
    – Gorgious
    Feb 15, 2021 at 22:07
  • 1
    $\begingroup$ @Gorgious thanks, that helps a lot! Seems like I was using too abstract search terms. Probably would have found that if I literally looked for my specific problem. $\endgroup$
    – narranoid
    Feb 16, 2021 at 13:41
  • 1
    $\begingroup$ You can simply enter the word frame into expression, and it will refer to the current frame. To slow down, you can do, frame * 0.01 $\endgroup$
    – Noob Cat
    Feb 21, 2021 at 12:59

0

Browse other questions tagged .