Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 3.43 KB

GeneratingIndividualAssets.md

File metadata and controls

60 lines (40 loc) · 3.43 KB

Generating Individual Assets

This tutorial will help you generate images, .blend files, or baked OBJ/USD/etc files for any asset of your choosing.

Example Commands

Shown are three examples of using our generate_individual_assets.py script to create images and .blend files. If you want to create asset files in another format (e.g. OBJ, FBX, USD) you should first generate blend files then use our docs to bake them to the format of your choosing.

mkdir outputs
python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f CoralFactory -n 8 --save_blend
python -m infinigen_examples.generate_individual_assets --output_folder outputs/seashells -f seashells -n 1 --save_blend
python -m infinigen_examples.generate_individual_assets --output_folder outputs/chunkyrock -f chunkyrock -n 1 --save_blend

Running the above commands will save images and .blend files into your outputs folder. You can customize what object is generated by changing the -f argument to the name of a different AssetFactory defined in the codebase (see the file tests/test_meshes_basic.txt for a partial list).

Please run python -m infinigen_examples.generate_individual_assets --help for a full list of commandline arguments.

Generate many different assets in one command

⚠️ There are a small number of assets which are used in the main system but are not included in the tests/assets/*.txt lists for various reasons. You can read the commented lines in tests/assets/list_nature_meshes.txt for a partial list. There are also other types of procedural generators (lighting, colors, scatters, volumetrics, animations, etc) besides meshes/materials, which add diversity to the main rendering system but are not included in the commands below.

Generate one of each mesh in the unit tests list:

python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f tests/assets/list_nature_meshes.txt -n 1 --save_blend
python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f tests/assets/list_indoor_meshes.txt -n 1 --save_blend

Generate one of each material in the unit tests list:

python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f tests/assets/list_nature_materials.txt -n 1 --save_blend
python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f tests/assets/list_indoor_materials.txt -n 1 --save_blend

Creating OBJ, USD, FBX and other file formats

You can use the --export flag to export each generated asset to a format of your choosing. Please see ExportingToExternalFileFormats for details and limitations regarding exporting.

Examples:

# Save a coral as an OBJ with texture maps
python -m infinigen_examples.generate_individual_assets --output_folder outputs/corals -f CoralFactory -n 1 --render none --export obj

# Save a bush as OpenUSD 
python -m infinigen_examples.generate_individual_assets --output_folder outputs/bush -f BushFactory -n 1 --render none --export usdc

# See the full list of supported formats
python -m infinigen_examples.generate_individual_assets --help