mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-29 17:06:35 +02:00
[blender] preview script: more robust mesh name retrieval
This commit is contained in:
parent
d3da5998af
commit
6c5afb1109
1 changed files with 2 additions and 1 deletions
|
@ -157,7 +157,8 @@ def loadModel(filename):
|
|||
'''Load model in Alembic of OBJ format. Make sure orientation matches camera orientation.'''
|
||||
if filename.lower().endswith('.obj'):
|
||||
bpy.ops.import_scene.obj(filepath=filename, axis_forward='Y', axis_up='Z')
|
||||
return bpy.data.objects['mesh'], bpy.data.meshes['mesh']
|
||||
meshName = os.path.splitext(os.path.basename(filename))[0]
|
||||
return bpy.data.objects[meshName], bpy.data.meshes[meshName]
|
||||
elif filename.lower().endswith('.abc'):
|
||||
bpy.ops.wm.alembic_import(filepath=filename)
|
||||
root = bpy.data.objects['mvgRoot']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue