Motionblur in cycles calculates drivers' scripted expressions' multiple times per frame #37734

Closed
opened 2013-12-08 14:24:42 +01:00 by levon hudson · 9 comments

when using scripted expression drivers, and rendering in cycles with motion blur, the actual expression is evaluated 4 times per frame.

in the attached blend file:

  1. run the script, im using the default driver_function template 'slow_value', except ive modified the script the print out the value to the console each time it is run.

  2. render an animation with motion blur on. in the console it prints out 4 values for each frame.

  3. turn motionblur off and render animation. only 1 value per frame is printed to the console.

when using scripted expression drivers, and rendering in cycles with motion blur, the actual expression is evaluated 4 times per frame. in the attached blend file: 1) run the script, im using the default driver_function template 'slow_value', except ive modified the script the print out the value to the console each time it is run. 2) render an animation with motion blur on. in the console it prints out 4 values for each frame. 3) turn motionblur off and render animation. only 1 value per frame is printed to the console.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @LevonHudson

Added subscriber: @LevonHudson

Added subscriber: @brecht

Added subscriber: @brecht
[mblur_drivers.blend](https://archive.blender.org/developer/F37438/mblur_drivers.blend)

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2013-12-08 14:48:03 +01:00

This is pretty much working as intended I think, for each frame it will evaluate the animation at the current frame, then two other frames to find the motion, and then restore the current frame again.

In principle this could be optimized to reduce computation time, but I'm not sure why it would be a bug? How many times are you expecting it to be evaluated? Going from 4 to 3 is possible in some cases but it's quite complex due to motion blur settings themselves possibly being animated, and going to 1 for animation renders would give extra memory usage, which I don't think is a good trade-off.

This is pretty much working as intended I think, for each frame it will evaluate the animation at the current frame, then two other frames to find the motion, and then restore the current frame again. In principle this could be optimized to reduce computation time, but I'm not sure why it would be a bug? How many times are you expecting it to be evaluated? Going from 4 to 3 is possible in some cases but it's quite complex due to motion blur settings themselves possibly being animated, and going to 1 for animation renders would give extra memory usage, which I don't think is a good trade-off.
Author

ill try and get a better example. in some code im working on at the moment, it renders fine with out motion blur... but with motion blur on, and being evaluated 4 times per frame, it totally screws up the animation.

Im kinda doing frame sensitive calculations in my code, so each frame skips 4.

While im not actually looking at using motion blur at the moment, i just noticed that motion blur was causing my script to act differently.

this would obviously be avoided if i could bake the drivers to animation, but i dont think that is possible at the moment.

ill try and get a better example. in some code im working on at the moment, it renders fine with out motion blur... but with motion blur on, and being evaluated 4 times per frame, it totally screws up the animation. Im kinda doing frame sensitive calculations in my code, so each frame skips 4. While im not actually looking at using motion blur at the moment, i just noticed that motion blur was causing my script to act differently. this would obviously be avoided if i could bake the drivers to animation, but i dont think that is possible at the moment.

Ok, with motion blur it's basically expected to jump around time to sample motion (and it will do subframe calculations as well soon), that's standard for renderers and motion blur I think. It can be tricky if you do physics or other things that only like to move forward in time, but there's no practical way to do that I think.

Ok, with motion blur it's basically expected to jump around time to sample motion (and it will do subframe calculations as well soon), that's standard for renderers and motion blur I think. It can be tricky if you do physics or other things that only like to move forward in time, but there's no practical way to do that I think.
Author

yep, fair enough. i think a driver baking tool would be a much better option anyway.

yep, fair enough. i think a driver baking tool would be a much better option anyway.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#37734
No description provided.