Given a USD file, take a picture and assign it as it's thumbnail.
Single File Generation: python generate_thumbnail.py --usd-file <usd_file>
Generation for Entire Directory: python generate_thumbnail.py --directory <directory>
Generation for Entire Directory and Recursive Child Folders: python generate_thumbnail.py --directory <directory> --recursive
optional arguments:
-h
, --help
: Show help--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
--create-usdz-result
: Returns the resulting files as a new USDZ file called <subject_usd_file>_Thumbnail.usdz
--output-extension
: The file extension of the output image you want (exr, png..). If using exr, make sure your USD install includes OpenEXR (exr is natively included in USD as of version 23.11)--verbose
: Prints out the steps as they happen--dome-light
: The path to the dome light HDR image to use, --width
: The width of the image in pixels to generate. Default is 2048.--height
: The height of the image in pixels to generate. Default is 2048. If height is not specified, the image is square.--apply-thumbnail
: Saves the image as the thumbnail for the given USD file.--render-purposes
: A comma separated list of render purposes to include in the thumbnail. Valid values are: default, render, proxy, guide.--directory
: A directory to generate thumbnails for all .usd, .usda, .usdc, and .usdz files. When a directory is supplied, usd-file is ignored.--recursive
: Will recursively search all directories underneath a given directory, requires a directory to be set.--camera
: The path to the camera prim to use for the thumbnail image
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
usdrecord
to take a snapshot and store it in /thumbnails/<input>.png
usdrecord --camera ZCamera --imageWidth 2048 --renderer Metal camera.usda <input>.png
usdrecord --camera ZCamera --imageWidth 2048 --renderer GL camera.usda <input>.png
shell=True
for the subprocess callusdrecord --camera ZCamera --imageWidth 2048 --renderer Metal camera.usda <input>.png
<subject_usd_file>_Thumbnail.usda
, assign the image as the thumbnail, and sublayer <subject_usd_file>.usdz
--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 USDZThumbnails are being used in these apps: