Timeline Integration
Adding timeline support to a 3rd party addon, be it a plugin, behavior or effect is quite easy. A little bit of extra work is needed though, here is how to do it.
Plugins
-
Set the interpolatable plugin property option to true in all the plugin properties which should be supported by timelines.
-
Implement the GetPropertyValueByIndex(index) method in the plugin instance class.
- index argument
- Refers to the index of each property in the plugin as they are given to the constructor of the plugin instance class.
- return value
- The current value associated with the passed in index. Depending on the current implementation this could be as easy as returning an existing variable.
-
Implement the SetPropertyValueByIndex(index, value) method in the plugin instance class.
- index argument
- Refers to the index of each property in the plugin as they are given to the constructor of the plugin instance class.
- value argument
- The new value that needs to be applied to the specified property. The passed in value is absolute so it should be applied directly with the = operator.
- return value
- No return value is required.
Plugin that need layout view preview updates
Some plugins might need to update the layout view to give a preview of the changes they are making. In this case a few more methods needs to be implemented so the plugin can update it's internal state when a timeline starts preview and when it stops preview.
-
Implement the OnTimelinePropertyChanged (id, value, detail) method in the plugin instance class.
- id argument
- The id of the property that is changing.
- value argument
- The value that is being applied by the timeline.
- detail argument
- An object with details about the value. It has a "resultMode" property with a value of either "absolute" or "relative".
-
implement OnExitTimelineEditMode (). This method is called when timeline edit mode is turned off. In this method the plugin's internal state should be updated again so any timeline changes from the preview are reset. Using GetPropertyValue(id) to get values without timeline changes, applying those to the relevant internal variables of the plugin and refreshing the layout view should be enough.
Behaviors
See plugin integration above, all steps apply.
Effects
Edit the effect's .json file and add the interpolatable property with a value of true to each paramenter definition which should be supported by timelines. No additional modifications needed.
Addon SDK Manual
Construct.net
2020-06-16
2023-11-27
You are here:
Search this manual:
This manual entry was last updated on 27 Nov, 2023 at 11:40