diff --git a/packages/editor/src/components/properties/ModelTransformProperties.tsx b/packages/editor/src/components/properties/ModelTransformProperties.tsx index b555a5a7b4..eca7062802 100644 --- a/packages/editor/src/components/properties/ModelTransformProperties.tsx +++ b/packages/editor/src/components/properties/ModelTransformProperties.tsx @@ -140,7 +140,7 @@ export default function ModelTransformProperties({ entity, onChangeModel }: { en for (const variant of variants) { if (clientside) { - await clientSideTransformModel(variant as ModelTransformParameters) + nuPath = await clientSideTransformModel(variant as ModelTransformParameters) } else { await Engine.instance.api.service(modelTransformPath).create(variant) } diff --git a/packages/engine/src/assets/compression/ModelTransformFunctions.ts b/packages/engine/src/assets/compression/ModelTransformFunctions.ts index 39f4f59f0b..c76468c7f0 100644 --- a/packages/engine/src/assets/compression/ModelTransformFunctions.ts +++ b/packages/engine/src/assets/compression/ModelTransformFunctions.ts @@ -345,7 +345,7 @@ function hashBuffer(buffer: Uint8Array): string { export async function transformModel( args: ModelTransformParameters, onMetadata: (key: string, data: any) => void = (key, data) => {} -) { +): Promise { const parms = args /** @@ -758,6 +758,7 @@ export async function transformModel( } }) )*/ + result = finalPath console.log('Handled glb file') } else if (parms.modelFormat === 'gltf') { await Promise.all( @@ -842,7 +843,7 @@ export async function transformModel( finalPath += '.gltf' } await doUpload(new Blob([JSON.stringify(json)], { type: 'application/json' }), finalPath) - + result = finalPath console.log('Handled gltf file') } @@ -856,6 +857,6 @@ export async function transformModel( } } onMetadata('vertexCount', totalVertexCount) - + result = pathJoin(LoaderUtils.extractUrlBase(args.src), result) return result } diff --git a/packages/server-core/src/assets/model-transform/model-transform.class.ts b/packages/server-core/src/assets/model-transform/model-transform.class.ts index 005e0cb5e2..081739187d 100644 --- a/packages/server-core/src/assets/model-transform/model-transform.class.ts +++ b/packages/server-core/src/assets/model-transform/model-transform.class.ts @@ -64,7 +64,8 @@ export class ModelTransformService implements ServiceInterface { const createParams: ModelTransformParameters = data console.log('config', config) if (!config.kubernetes?.enabled) { - return transformModel(createParams) + await transformModel(createParams) + return } try { const transformParms = createParams