@@ -567,7 +567,6 @@ export class Skeleton implements IAnimatable {
var bone = new Bone(source.name, result, parentBone, source.getBaseMatrix().clone(), source.getRestPose().clone());
bone._index = source._index;
-
if (source._linkedTransformNode) {
bone.linkTransformNode(source._linkedTransformNode);
}
@@ -430,7 +430,7 @@ export class TransformNode extends Node {
public instantiateHierarchy(newParent: Nullable<TransformNode> = null, options?: { doNotInstantiate: boolean}, onNewNodeCreated?: (source: TransformNode, clone: TransformNode) => void): Nullable<TransformNode> {
let clone = this.clone("Clone of " + (this.name || this.id), newParent || this.parent, true);
- if (clone) {
+ if (clone) {
if (onNewNodeCreated) {
onNewNodeCreated(this, clone);
@@ -90,12 +90,12 @@ export class MorphTarget implements IAnimatable {
public name: string, influence = 0, scene: Nullable<Scene> = null) {
this._scene = scene || EngineStore.LastCreatedScene;
this.influence = influence;
+
if (this._scene) {
this._uniqueId = this._scene.getUniqueId();
/**
* Gets the unique ID of this manager
*/
@@ -167,7 +167,7 @@ export class MorphTargetManager {
public clone(): MorphTargetManager {
let copy = new MorphTargetManager(this._scene);
for (var target of this._targets) {
copy.addTarget(target.clone());
@@ -57,6 +57,7 @@ export class AssetContainer extends AbstractScene {
* Instantiate or clone all meshes and add the new ones to the scene.
* Skeletons and animation groups will all be cloned
+ * @returns the list of instantiated entries
public instantiateModelsToScene(): InstantiatedEntries {
let convertionMap: {[key: number]: number} = {};