Sequencer strips ignore drivers on rendering (works in playback) #26560

Closed
opened 2011-03-21 06:29:32 +01:00 by Daniel Salazar · 11 comments
Member

Duplicates: #27788

%%%play animation on provided file. see how the color is driven by the cube's zloc
now render an animation. see how animation is stuck in one color

cheers%%%

**Duplicates**: #27788 %%%play animation on provided file. see how the color is driven by the cube's zloc now render an animation. see how animation is stuck in one color cheers%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%Clarification of the problem:
When the file is loaded, scrubbing the timeline shows the color strip's color being affected by the driver (the strip in the sequncer, the property, and the sequencer preview all show the color changing).

Once the scene is rendered (animation render), the strip adopts a color (it looks like the one that was active when the rendering started) and won't change again until the file is reloaded. By "won't change again", I mean that although the strip display in the sequencer and the property still change, the sequencer preview (and the rendered clip) both show only a single color (vs color changing in response to the driver).


Attempted fixes I've tried:

  1. I firstly checked whether it was just a case of something that relied on a RNA update call, which could be hacked around by inlining the update code in the setter for the color. This caused crashes if loading the file at startup (i.e. loading the file with blender from the filesystem directly)
  2. Enabling all instances of places where animation updates for stuff affecting the sequencer, forcing driver updates too (i.e setting those to ADT_RECALC_ALL)

Since it seems that the animation system side is functioning fine (properties update ok), I suspect it might have something to do with some imbuf locking tricks that sequencer uses when it thinks something won't change. Leaving for a sequencer guru to hack...%%%

%%%Clarification of the problem: When the file is loaded, scrubbing the timeline shows the color strip's color being affected by the driver (the strip in the sequncer, the property, and the sequencer preview all show the color changing). Once the scene is rendered (animation render), the strip adopts a color (it looks like the one that was active when the rendering started) and won't change again until the file is reloaded. By "won't change again", I mean that although the strip display in the sequencer and the property still change, the sequencer preview (and the rendered clip) both show only a single color (vs color changing in response to the driver). --- Attempted fixes I've tried: 1) I firstly checked whether it was just a case of something that relied on a RNA update call, which could be hacked around by inlining the update code in the setter for the color. This caused crashes if loading the file at startup (i.e. loading the file with blender from the filesystem directly) 2) Enabling all instances of places where animation updates for stuff affecting the sequencer, forcing driver updates too (i.e setting those to ADT_RECALC_ALL) Since it seems that the animation system side is functioning fine (properties update ok), I suspect it might have something to do with some imbuf locking tricks that sequencer uses when it thinks something won't change. Leaving for a sequencer guru to hack...%%%
Author
Member

%%%when you clear cache after rendering the preview starts working again%%%

%%%when you clear cache after rendering the preview starts working again%%%
Author
Member

%%%by clearing the cache I mean hit the Refresh Sequencer button%%%

%%%by clearing the cache I mean hit the Refresh Sequencer button%%%
Member

%%%Maybe Peter can help!%%%

%%%Maybe Peter can help!%%%
Author
Member

%%%Ive attached SequencerDriversRand.blend. In it Ive modified the driver to print a random value every time it runs, and guess what, it never stops printing right after opening the blend file!%%%

%%%Ive attached SequencerDriversRand.blend. In it Ive modified the driver to print a random value every time it runs, and guess what, it never stops printing right after opening the blend file!%%%
Member

%%%After a quick debugging session we came to the conclusion that the sequencer does not do scene updates before rendering, probably because it was assumed that scene properties have no influence on the sequencer outcome, but not taking drivers into account. I found this little piece of code excluded in sequencer.c: seq_render_strip_stack, which was apparently meant to do just that, but disabled:

if 0 /* commentind since this breaks keyframing, since it resets the value on draw */

if(scene->r.cfra != cfra) {
	// XXX for prefetch and overlay offset!..., very bad!!!
	AnimData *adt= BKE_animdata_from_id(&scene->id);
	BKE_animsys_evaluate_animdata(&scene->id, adt, cfra, ADT_RECALC_ANIM);
}

endif

Looking at how regular rendering handles scene updates, i tried to make a quick patch using the scene_update_for_newframe function (attached), but since i'm not familiar with rendering or sequencer code, i have no idea if this is a proper fix.

The constant driver updates in the most basic system call are creepy, is this really intended? Potentially dangerous too i guess ...%%%

%%%After a quick debugging session we came to the conclusion that the sequencer does not do scene updates before rendering, probably because it was assumed that scene properties have no influence on the sequencer outcome, but not taking drivers into account. I found this little piece of code excluded in sequencer.c: seq_render_strip_stack, which was apparently meant to do just that, but disabled: # if 0 /* commentind since this breaks keyframing, since it resets the value on draw */ if(scene->r.cfra != cfra) { // XXX for prefetch and overlay offset!..., very bad!!! AnimData *adt= BKE_animdata_from_id(&scene->id); BKE_animsys_evaluate_animdata(&scene->id, adt, cfra, ADT_RECALC_ANIM); } # endif Looking at how regular rendering handles scene updates, i tried to make a quick patch using the scene_update_for_newframe function (attached), but since i'm not familiar with rendering or sequencer code, i have no idea if this is a proper fix. The constant driver updates in the most basic system call are creepy, is this really intended? Potentially dangerous too i guess ...%%%
Member

%%%The main problem is the sequencer preview renderer and the fact that the sequencer can contain it's owner scene as a strip.

The piece of code Lukas found is problematic (and #iffed out) because if the animation system is evaluated when the preview render runs it becomes impossible to keyframe pretty much anything as an update call (and thus a redraw of sequencer preview) is issued immediately when a value is changed. This update then resets any user changed value.

There could of course be exceptions to make preview and actual rendering do different things, but I'd much rather see the whole preview rendering implemented properly with the job system (this is already on the todo list). However not to make things too simple using the job system for preview rendering will currently face the same kinds of problems as normal rendering with sharing the scene data between rendering and ui threads (with the added complication that users will change values that effect the preview rendering pretty much constantly while the sequencer is rendering the preview).

The nice random value example Daniel found is most probably due to the preview rendering being called from the ui drawing update call.. basically anything that sends a redraw call will also start a sequencer preview rendering. After the first render this will be very quick as the images are just read from the sequencer cache, but it's still a full preview rendering each time none the less.

So basically this is a todo item (with a solution that relates quite a bit to how normal preview rendering will be brought back), but I'd love to hear Peter's opinion on all this too before closing the report.%%%

%%%The main problem is the sequencer preview renderer and the fact that the sequencer can contain it's owner scene as a strip. The piece of code Lukas found is problematic (and #iffed out) because if the animation system is evaluated when the preview render runs it becomes impossible to keyframe pretty much anything as an update call (and thus a redraw of sequencer preview) is issued immediately when a value is changed. This update then resets any user changed value. There could of course be exceptions to make preview and actual rendering do different things, but I'd much rather see the whole preview rendering implemented properly with the job system (this is already on the todo list). However not to make things too simple using the job system for preview rendering will currently face the same kinds of problems as normal rendering with sharing the scene data between rendering and ui threads (with the added complication that users will change values that effect the preview rendering pretty much constantly while the sequencer is rendering the preview). The nice random value example Daniel found is most probably due to the preview rendering being called from the ui drawing update call.. basically anything that sends a redraw call will also start a sequencer preview rendering. After the first render this will be very quick as the images are just read from the sequencer cache, but it's still a full preview rendering each time none the less. So basically this is a todo item (with a solution that relates quite a bit to how normal preview rendering will be brought back), but I'd love to hear Peter's opinion on all this too before closing the report.%%%

%%%There're already several bugs related on how preview system works in tracker. It's indeed need to be re-thinked. There was already a note in our todo list which referenced to 4 different bugs. Added another one link there http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Sequence_Editor
So wouldn't consider this is really a bug, just thing which needs major improvements. Thanks for the report, but will close it now.%%%

%%%There're already several bugs related on how preview system works in tracker. It's indeed need to be re-thinked. There was already a note in our todo list which referenced to 4 different bugs. Added another one link there http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Sequence_Editor So wouldn't consider this is really a bug, just thing which needs major improvements. Thanks for the report, but will close it now.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

%%%I just hit this issue in 2.67a - I tried to use drivers in the sequencer and they behave lazy. They update rarely, and randomly. The values don't change while I play the sequence back in Blender almost at all.%%%

%%%I just hit this issue in 2.67a - I tried to use drivers in the sequencer and they behave lazy. They update rarely, and randomly. The values don't change while I play the sequence back in Blender almost at all.%%%
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
7 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#26560
No description provided.