-
Notifications
You must be signed in to change notification settings - Fork 7
Description
I am using usd2gltf to convert a USDZ file to GLTF. The tool works well when I run it in a console, successfully converting the USDZ file with embedded textures. However, when running the same conversion in a FastAPI script, I encounter the following issue where textures are skipped during the conversion:
Skipping texture processing as converter.dirname is empty or invalid.
Logs from FastAPI Execution:
Length of USDZ file content: 9261065 bytes
USDZ file written to temporary path: /tmp/temp_usdz.usdz
Temporary USDZ file size: 9261065 bytes
Running command: /home/ec2-user/venv/bin/usd2gltf -d -i /tmp/temp_usdz.usdz -o ./PS5.glb -f
Standard Output:
Converting: /tmp/temp_usdz.usdz
To: ./PS5.glb
Skipping texture processing as converter.dirname is empty or invalid.
Skipping texture processing as converter.dirname is empty or invalid.
Skipping texture processing as converter.dirname is empty or invalid.
Converted!
GLB file size 2.3 MB without textures
Console Output (Working Scenario):
When running usd2gltf in the console, the conversion works as expected and the textures are embedded:
usd2gltf -d -i "PS5.usdz" -o "PS5.glb"
Console log includes texture embedding:
DEBUG:usd2gltf.converter:Embeded res: FileResource("baked_mesh_93702174_tex0.png")
DEBUG:usd2gltf.converter:Embeded res: FileResource("baked_mesh_93702174_ao0.png")
Converted!
GLB file size 11.3 MB with textures
Environment Details:
• usd2gltf Version: 0.3.5
• Python Version: 3.9
• Operating System: Amazon lightsail running Amazon Linux
• Execution Environment:
• Working in console (inside a virtual environment)
• Issue occurs when running in FastAPI (inside the same virtual environment)