Skip to content

Commit 203752a

Browse files
committed
fix: apply scale on imported GLB
1 parent f06bbf5 commit 203752a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

editor/src/editor/layout/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
10301030
}
10311031

10321032
this.setState({ informationMessage: `Importing scene "${basename(absolutePath)}"...` });
1033-
const result = await loadImportedSceneFile(this.scene, absolutePath, useCloudConverter);
1033+
const result = await loadImportedSceneFile(this.scene, absolutePath);
10341034
this.setState({ informationMessage: "" });
10351035

10361036
return result;

editor/src/editor/layout/preview/import/import.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function tryConvertSceneFile(absolutePath: string, progress?: (perc
4646
}
4747
}
4848

49-
export async function loadImportedSceneFile(scene: Scene, absolutePath: string, fromCloudConverter?: boolean): Promise<ISceneLoaderAsyncResult | null> {
49+
export async function loadImportedSceneFile(scene: Scene, absolutePath: string): Promise<ISceneLoaderAsyncResult | null> {
5050
if (!projectConfiguration.path) {
5151
return null;
5252
}
@@ -61,9 +61,10 @@ export async function loadImportedSceneFile(scene: Scene, absolutePath: string,
6161
return null;
6262
}
6363

64-
if (fromCloudConverter) {
65-
const root = result.meshes.find((m) => m.name === "__root__");
66-
root?.scaling.scaleInPlace(100);
64+
const root = result.meshes.find((m) => m.name === "__root__");
65+
if (root) {
66+
root.scaling.scaleInPlace(100);
67+
root.name = basename(absolutePath);
6768
}
6869

6970
result.meshes.forEach((mesh) => {

0 commit comments

Comments
 (0)