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

Closed
opened 6 years ago by Funkster-3 · 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).
Funkster-3 self-assigned this 6 years ago
Poster

Changed status to: 'Open'

Changed status to: 'Open'
Poster

Added subscriber: @Funkster-3

Added subscriber: @Funkster-3
Poster

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.
mont29 commented 6 years ago
Owner

Added subscribers: @Sergey, @mont29

Added subscribers: @Sergey, @mont29
mont29 commented 6 years ago
Owner

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?
Poster

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.
Poster

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.
Poster

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)
Poster

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!
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Poster

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.
mardy commented 6 years ago

Added subscriber: @mardy

Added subscriber: @mardy
mardy commented 6 years ago

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)
Collaborator

This issue was referenced by a372e5e426

This issue was referenced by a372e5e426e46f38a5fa08affb27f7fa726775b5
iss commented 4 years ago
Collaborator

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
iss closed this issue 4 years ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Sculpt, Paint & Texture
legacy module/User Interface
legacy module/VFX & Video
legacy project/BF Blender: 2.8
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/OpenGL Error
legacy project/Retrospective
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49658
Loading…
There is no content yet.