Page MenuHome

VSE: Support copy-pasting strips with animation
ClosedPublic

Authored by Richard Antalik (ISS) on Jan 16 2022, 8:44 PM.

Details

Summary

When copying strips between 2 scenes, it wasn't possible to copy
animation curves along with strips.

In this patch curves are copied into clipboard ListBase. When pasted,
original curves are moved into temporary ListBase and curves in
clipboard are moved into scene action. This is because when strips from
clipboard have to be renamed, function SEQ_ensure_unique_name() does
fix RNA paths of curves, but this is done globally for all curves within
action. After strips are renamed, restore original curves from backup.

Fixes T77530

Diff Detail

Repository
rB Blender
Branch
copy-paste-curves (branched from master)
Build Status
Buildable 20022
Build 20022: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.Jan 16 2022, 8:44 PM
Richard Antalik (ISS) created this revision.
  • Remove function SEQ_dupe_animdata() - do curve duplication explicitly in operator code, which makes more sense to do.

Seems only fcurves from action are copied. Is this an expected limitation of the initial support? Would be nice to have clarification on the driver and NLA behavior.
Also, worth ensuring things work correct when scenes share the same Action.

Seems only fcurves from action are copied. Is this an expected limitation of the initial support? Would be nice to have clarification on the driver and NLA behavior.

Yes, intention was to copy only simple keyframe animation as I think this would cover most cases (never heared of other requests). Currently drivers are not managed at all in VSE. First I would need to implement this. For copy-pasting I think only drivers with simple expression could be copied. Not sure how relationship traversing works when copying objects though, perhaps it could be possible to support more complicated cases.

Not quite sure what you mean by NLA behavior though. It's not impossible to use NLA with VSE, but it doesn't sound very practical and from few tests I have done it may even not work at all. There are quirks like that you can push keyframes of 2 different strips into same action which is bit weird. Then situation is same as with drivers - handling is not implemented.

Also, worth ensuring things work correct when scenes share the same Action.

Eh I have never imagined this is possible... In any case copy-pasting is possible within same scene, so it should work same way as before. When action is shared, worst case you will end up with 2 curves pointing to same RNA path. This will happen in current master too. I could sanitize this, but I don't think I can tell what should happen when conflict is created.

To resolve such conflicts I think it would be best to change animation data ownership from scene to strips. it would probably simplify design in other places too.

Currently drivers are not managed at all in VSE

They are indeed not managed by VSE because they live within Scene animation block. It is possible to have drivers on strips though.
Not sure if it is something what is often used. If its clearly communicated in the implementation of animation copy-paste then it should be fine.

Not sure how relationship traversing works when copying objects though

It is fine to have driver pointing to something what is not directly linked to scene. Just similar to how you can copy-paste objects between scenes.

Not quite sure what you mean by NLA behavior though

Confession time: I'm not really sure how to use NLA. I just see tracks apprearing in there when animation is added to strips. But again, as simple as mention that only animation f-curves from actions are copied then it is fine for this implementation.

Eh I have never imagined this is possible...

It is totally possible to do for objects (Via Action editor). Not sure there is something what explicitly forbids actions to be re-used by Scene datablock.
As long as it doesn't behave more weirdly than it is now then don't think we need to go into any deeper changes.

  • Add comment clarifying that drivers and NLA strips are not copied

Currently drivers are not managed at all in VSE

They are indeed not managed by VSE because they live within Scene animation block. It is possible to have drivers on strips though.
Not sure if it is something what is often used. If its clearly communicated in the implementation of animation copy-paste then it should be fine.

Not sure how relationship traversing works when copying objects though

It is fine to have driver pointing to something what is not directly linked to scene. Just similar to how you can copy-paste objects between scenes.

Not quite sure what you mean by NLA behavior though

Confession time: I'm not really sure how to use NLA. I just see tracks apprearing in there when animation is added to strips. But again, as simple as mention that only animation f-curves from actions are copied then it is fine for this implementation.

Right I will clarify this in code then

Eh I have never imagined this is possible...

It is totally possible to do for objects (Via Action editor). Not sure there is something what explicitly forbids actions to be re-used by Scene datablock.
As long as it doesn't behave more weirdly than it is now then don't think we need to go into any deeper changes.

It seems that there is nothing that prevents sharing scene action between 2 scenes, you have to do it via outliner by remapping users. From sequencer point of view this will inevitably cause problems.

Thanks for updating comment.
This is also something to state in the commit message and the release notes,

The code itself seems fine.

This revision is now accepted and ready to land.Jan 18 2022, 11:42 AM