Given a USD file, take a picture and assign it as it's thumbnail.
python generate_thumbnail.py <usd_file>
positional arguments:
usd_file
: The USD file you want to add a thumbnail to. If USDZ is input, a new USD file will be created to wrap the existing one called<subject_usd_file>_Thumbnail.usd
optional arguments:
-h
,--help
: Show help--create-usdz-result
: Returns the resulting files as a new USDZ file called<subject_usd_file>_Thumbnail.usdz
--verbose
: Prints out the steps as they happen
Note: You must have usd installed and available in your path. Install Steps Here
Given a USD file to use as the subject of the thumbnail do the following
- Generate a camera such that the subject is in view
- Sublayer the subject in the camera
- Run
usdrecord
to take a snapshot and store it in/renders/<input>.0.png
- macOS
usdrecord --frames 0:0 --camera ZCamera --imageWidth 2048 --renderer Metal camera.usda <input>.#.png
- windows
usdrecord --frames 0:0 --camera ZCamera --imageWidth 2048 --renderer GL camera.usda <input>.#.png
- note: this will run with
shell=True
for the subprocess call
- linux
usdrecord --frames 0:0 --camera ZCamera --imageWidth 2048 --renderer Metal camera.usda <input>.#.png
- ZCamera & camera.usda are generated in step 2
- macOS
- If the file is not a USDZ file, assign that image as the usd's thumbnail image
- If the file is a USDZ file, create a new
<subject_usd_file>_Thumbnail.usda
, assign the image as the thumbnail, and sublayer<subject_usd_file>.usdz
- If
--create-usdz-result
is passed in, combine all of the files into a USDZ, in the case of a USD file it would be the input file and the image. In the case of a USDZ file it would be the new USDA, the image, and the input USDZ