Pārlūkot izejas kodu

Fix issue with gltf cloning

David Catuhe 5 gadi atpakaļ
vecāks
revīzija
28a38e984e

+ 2 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx

@@ -396,7 +396,7 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
                         {
                             morphTargets.map((mt, i) => {
                                 return (
-                                    <SliderLineComponent label={mt.name} target={mt} propertyName="influence" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                                    <SliderLineComponent key={i} label={mt.name} target={mt} propertyName="influence" minimum={0} maximum={1} step={0.01} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                                 );
                             })
                         }
@@ -410,6 +410,7 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
                         <CheckBoxLineComponent label="Compute bones using shaders" target={mesh} propertyName="computeBonesUsingShaders" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                     }
                     <CheckBoxLineComponent label="Collisions" target={mesh} propertyName="checkCollisions" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    <TextLineComponent label="Geometry ID" value={mesh.geometry?.uniqueId.toString()} />
                     <TextLineComponent label="Has normals" value={mesh.isVerticesDataPresent(VertexBuffer.NormalKind) ? "Yes" : "No"} />
                     <TextLineComponent label="Has vertex colors" value={mesh.isVerticesDataPresent(VertexBuffer.ColorKind) ? "Yes" : "No"} />
                     <TextLineComponent label="Has UV set 0" value={mesh.isVerticesDataPresent(VertexBuffer.UVKind) ? "Yes" : "No"} />

+ 1 - 1
src/Animations/animationGroup.ts

@@ -205,7 +205,7 @@ export class AnimationGroup implements IDisposable {
         this._scene = scene || EngineStore.LastCreatedScene!;
         this.uniqueId = this._scene.getUniqueId();
 
-        this._scene.animationGroups.push(this);
+        this._scene.addAnimationGroup(this);
     }
 
     /**

+ 1 - 1
src/Meshes/mesh.ts

@@ -2825,7 +2825,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
      * @returns the current mesh
      */
     public synchronizeInstances(): Mesh {
-        if (this._geometry && this._geometry.meshes.length !== 1) {
+        if (this._geometry && this._geometry.meshes.length !== 1 && this.instances.length) {
             this.makeGeometryUnique();
         }