feat: pass blend shapes to avatar viewer

This commit is contained in:
Edwin Wong
2023-09-15 20:01:09 +08:00
parent 0f1cbe4675
commit 8a48ec4574
2 changed files with 7 additions and 5 deletions
+6 -3
View File
@@ -21,6 +21,10 @@ class ExportGLTF():
}),
"model_type": (["GLB", "GLTF_EMBEDDED"],),
"write_mode": (["Overwrite", "Increment"],),
"blendshapes": ("STRING", {
"multiline": False,
"default": "{node: ''}"
}),
},
"hidden": {"endpoint": "ENDPOINT", "token": "TOKEN", "baseModelId": "BASE_MODEL_ID"},
}
@@ -32,7 +36,7 @@ class ExportGLTF():
CATEGORY = "mesh"
def process(self, bpy_objects, filename, model_type, write_mode, endpoint=None, token=None, baseModelId=None):
def process(self, bpy_objects, filename, model_type, write_mode, blendshapes, endpoint=None, token=None, baseModelId=None):
import global_bpy
bpy = global_bpy.get_bpy()
# print(bpy, bpy_objects)
@@ -83,8 +87,7 @@ class ExportGLTF():
return { "ui" : { "status_code": { response.status_code } } }
model_id = response.json()["model_id"]
return { "ui" : { "model_id": { model_id }, "status_code": { response.status_code } } }
return { "ui" : { "gltfFilename": { filepath.replace(f"{self.output_dir}/", "") } } }
return { "ui" : { "gltfFilename": { filepath.replace(f"{self.output_dir}/", "") }, "blendshapes": { blendshapes } } }
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
+1 -2
View File
File diff suppressed because one or more lines are too long