Skip to content

Commit

Permalink
Merge pull request #13470 from Popov72/serialize-instance-actions
Browse files Browse the repository at this point in the history
Babylon serializer: Serialize actions for instances
  • Loading branch information
carolhmj authored Jan 26, 2023
2 parents 1c0f9fa + 8143cd7 commit 19bcd88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/dev/core/src/Meshes/mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3722,6 +3722,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
serializationInstance.metadata = instance.metadata;
}

// Action Manager
if (instance.actionManager) {
serializationInstance.actions = instance.actionManager.serialize(instance.name);
}

serializationObject.instances.push(serializationInstance);

// Animations
Expand Down Expand Up @@ -4179,6 +4184,11 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
Mesh._PhysicsImpostorParser(scene, instance, parsedInstance);
}

// Actions
if (parsedInstance.actions !== undefined) {
instance._waitingData.actions = parsedInstance.actions;
}

// Animation
if (parsedInstance.animations) {
for (let animationIndex = 0; animationIndex < parsedInstance.animations.length; animationIndex++) {
Expand Down

0 comments on commit 19bcd88

Please sign in to comment.