Editor.AnimationLayerBlendMode
EnumEnum defining how animation layers blend with the base animation.
Index
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project?.scene;
if (!scene) {
console.log('No scene loaded.');
return;
}
// Walk scene objects and switch Additive clips to Default blending
let switched = 0;
function walk(obj: Editor.Model.SceneObject): void {
const players = obj.getComponents('AnimationPlayer');
for (const player of players) {
for (const clip of player.animationClips) {
if (clip.blendMode === Editor.AnimationLayerBlendMode.Additive) {
clip.blendMode = Editor.AnimationLayerBlendMode.Default;
switched++;
}
}
}
for (const child of obj.children) walk(child);
}
for (const root of scene.rootSceneObjects) walk(root);
console.log(`Switched ${switched} Additive clip(s) to Default`);
Enumeration Members
Additive
Additive:
number
Additive blending mode that adds the animation on top of existing animations.
Default
Default:
number
Base blending mode that replaces the animation.