Evaluation / animation of f-curves does not correct for a scene's position within another scene #49658

Closed
opened 2016-10-14 16:24:12 +02:00 by Olly Funkster · 15 comments

System Information
Linux (Fedora 23 x64)

Blender Version
Broken: 2.78, latest in git as of 2016-10-14

Short description of error
If you embed a scene within another scene ("use sequence") at any position other than at the start, evaluation of f-curves is incorrect for the embedded scene - values calculated are for the frame number being rendered in the master scene, not relative to the start of the embedded scene.

Exact steps for others to reproduce the error
scene 1) add some kind of visible strip (e.g. text), add keyframe for strip opacity 0 (transparent) at 0s and 3s, 1 (opaque) at 4s from start of scene.
scene 2) insert scene 1 as sequence, at position 2s from start of scene.
result: render scene 2, text becomes opaque at 4s rather than 6s as you would expect.

Example attached - "sub" scene counts from 1 to 5 by way of animated opacities of text strips, but when embedded starting at 2s in the "master" scene it starts counting at 3 because the 2-second offset is not accounted for.
incorrect_sequence_keyframes.blend

Affects 2.78 and the latest that I have built from git today.

F-curves do not appear to have any pointer to anything that could tell them what scene they belong to, so it is impossible to work out the correct value for evaltime (animsys_evaluate_fcurves, anim_sys.c line 1691).

**System Information** Linux (Fedora 23 x64) **Blender Version** Broken: 2.78, latest in git as of 2016-10-14 **Short description of error** If you embed a scene within another scene ("use sequence") at any position other than at the start, evaluation of f-curves is incorrect for the embedded scene - values calculated are for the frame number being rendered in the master scene, not relative to the start of the embedded scene. **Exact steps for others to reproduce the error** scene 1) add some kind of visible strip (e.g. text), add keyframe for strip opacity 0 (transparent) at 0s and 3s, 1 (opaque) at 4s from start of scene. scene 2) insert scene 1 as sequence, at position 2s from start of scene. result: render scene 2, text becomes opaque at 4s rather than 6s as you would expect. Example attached - "sub" scene counts from 1 to 5 by way of animated opacities of text strips, but when embedded starting at 2s in the "master" scene it starts counting at 3 because the 2-second offset is not accounted for. [incorrect_sequence_keyframes.blend](https://archive.blender.org/developer/F378354/incorrect_sequence_keyframes.blend) Affects 2.78 and the latest that I have built from git today. F-curves do not appear to have any pointer to anything that could tell them what scene they belong to, so it is impossible to work out the correct value for evaltime (animsys_evaluate_fcurves, anim_sys.c line 1691).
Olly Funkster self-assigned this 2016-10-14 16:24:12 +02:00
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Funkster-3

Added subscriber: @Funkster-3
Author

Err... I don't know how to create a diff on here, sorry!

https://developer.blender.org/P413

This fixes it for this one specific use case, but I have tested in exactly zero other circumstances so don't even think about applying it.

Err... I don't know how to create a diff on here, sorry! https://developer.blender.org/P413 This fixes it for this one specific use case, but I have tested in exactly zero other circumstances so don't even think about applying it.

Added subscribers: @Sergey, @mont29

Added subscribers: @Sergey, @mont29

Eeeeh… @Sergey, wasn’t your recent fix (57a2015) supposed to handle those cases?

Eeeeh… @Sergey, wasn’t your recent fix (57a2015) supposed to handle those cases?
Author

That fix did sort out a lot of the odd stuff that was going on with scene strips, but F-Curves appear to be evaluated completely independently of that system.

That fix did sort out a lot of the odd stuff that was going on with scene strips, but F-Curves appear to be evaluated completely independently of that system.
Author

Okay, I'm very sorry for what I've just done to your source code. It's Friday afternoon, I'm about to go home and was hoping to have some kind of proof-of-concept, and this is what I ended up with:

https://developer.blender.org/P414

It doesn't work (the guess at working out the frame difference in anim_sys.c isn't right), I don't know how to make it save the new member of the FCurve struct to the .blend file, and I've touched waaaay too much stuff. But it does kinda show the idea, if someone could slap me onto the right track I'll work on it next week.

Okay, I'm very sorry for what I've just done to your source code. It's Friday afternoon, I'm about to go home and was hoping to have some kind of proof-of-concept, and this is what I ended up with: https://developer.blender.org/P414 It doesn't work (the guess at working out the frame difference in anim_sys.c isn't right), I don't know how to make it save the new member of the FCurve struct to the .blend file, and I've touched waaaay too much stuff. But it does kinda show the idea, if someone could slap me onto the right track I'll work on it next week.
Author

Okay, I've undone all that nonsense I pasted last week and have come up with a solution that seems sensible. However I am happy to be told that I've done everything wrong because to be fair I have no idea what I'm doing.

https://developer.blender.org/D2308

Could someone review this? It does work! Also Blender doesn't randomly crash when I do some other stuff but I've hardly tested this exhaustively.

I have attached a more challenging test case which inclues nested nested strips:
incorrect_sequence_keyframes_2.blend

Okay, I've undone all that nonsense I pasted last week and have come up with a solution that seems sensible. However I am happy to be told that I've done everything wrong because to be fair I have no idea what I'm doing. https://developer.blender.org/D2308 Could someone review this? It does work! Also Blender doesn't randomly crash when I do some other stuff but I've hardly tested this exhaustively. I have attached a more challenging test case which inclues nested nested strips: [incorrect_sequence_keyframes_2.blend](https://archive.blender.org/developer/F380652/incorrect_sequence_keyframes_2.blend)
Author

Hi all,

I've been using Blender a fair bit since making my fix in D2308 above, and I haven't found any problems so far.

Is there any chance someone could review it? I didn't want to step on anyone's toes by randomly assigning review to someone.

Many thanks!

Hi all, I've been using Blender a fair bit since making my fix in [D2308](https://archive.blender.org/developer/D2308) above, and I haven't found any problems so far. Is there any chance someone could review it? I didn't want to step on anyone's toes by randomly assigning review to someone. Many thanks!
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Author

Found a crash while looking at a slightly dodgy file, updated the diff to fix it.

Found a crash while looking at a slightly dodgy file, updated the diff to fix it.

Added subscriber: @mardy

Added subscriber: @mardy

This is essentially the same as #49261

I created a less invasive patch, which seems to work for me, here: D2558

I'm attaching a blender test file which can be used to test the fix. Open the "master scene" and scrub through the VSE: the text indicating the color should always match the background color.

test-vse-recursive.blend

This is essentially the same as #49261 I created a less invasive patch, which seems to work for me, here: [D2558](https://archive.blender.org/developer/D2558) I'm attaching a blender test file which can be used to test the fix. Open the "master scene" and scrub through the VSE: the text indicating the color should always match the background color. [test-vse-recursive.blend](https://archive.blender.org/developer/F508021/test-vse-recursive.blend)

This issue was referenced by a372e5e426

This issue was referenced by a372e5e426e46f38a5fa08affb27f7fa726775b5

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
6 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#49658
No description provided.