这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@MrStevns
Copy link
Member

@MrStevns MrStevns commented Nov 3, 2024

This PR introduces callbacks to Layer and KeyFrame, in order to be able to notify when a keyframe has been created, destroyed and modified.

For Keyframe creations: One benefit here is for example to be able to setup a SoundClip and not having to worry whether the SoundPlayer gets created or not because it's handled universally in Editor. In addition it also opens up for a more general handling of adding dependencies to Layer or KeyFrame without creating tight coupling.

For keyframe modifications: All modification() calls on KeyFrame will automatically now trigger a frameModified event. In practice this means that we might see more frameModified and potentially double updates to scribblearea because this has until now been handled with manual frameModified calls. As such I've removed frameModified emits where I could see a KeyFrame::modification() call was also made.

For KeyFrame destructions: Currently unused but could be used for cleanup tasks.

It's important to note that to get callbacks working properly, I had to make some changes to when we create a keyframe on Layer and move the entire default layer setup from Object to LayerManager.

As this is now done in through Editor::onLayerEvent
For changes that affect keyframes directly, the modification will automatically trigger an update in Editor via the new Editor::onLayerEvent

Other tools such as MoveTool that do not affect keyframes immediately, still have to notify manually.
Because this is now handled by Editor::onLayerEvent
@MrStevns MrStevns closed this Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discarded

Development

Successfully merging this pull request may close these issues.

1 participant