I am currently creating an upload and translation job from the model derivative API, and I want to to get the properties of the uploaded model immediately after the the translation finishes. However, I tried using model derivative’s getAllProperties
function after the translation finishes, but I get nothing. What can I do here?
const obj = await uploadObject(file.name, file.path, req.fields.bucketKey);
const modelZipEntrypoint = req.fields['model-zip-entrypoint'] as unknown;
const job = await translateObject(urnify(obj.objectId), modelZipEntrypoint as string);
await modelDerivativeClient.getAllProperties(access_token, urn, modelGuid); // HERE
export const uploadObject = async (objectName: string, filePath: string, bucket) => {
await doesBucketExists(bucket);
const { access_token } = await getInternalToken();
const obj = await ossClient.upload(bucket, objectName, filePath, access_token);
return obj;
}
export const translateObject = async (urn: string, rootFileName: string) => {
const { access_token } = await getInternalToken();
const job = await modelDerivativeClient.startJob(access_token, {
input: {
urn,
compressedUrn: !!rootFileName,
rootFileName
},
output: {
formats: [{
views: [View._2d, View._3d],
type: Type.Svf
}],
}
});
return job;
}
Expecting: the data.collections
is not empty.