Hi, experts.
When executing the following code, the asset does not get colored and turns white instead. The same issue occurs when using other USD paths.
One possible explanation could be that the rendering is not keeping up with the processing in the writer.
Do you have any advice or suggestions?
import omni.replicator.core as rep
with rep.new_layer():
# Add Default Light
distance_light = rep.create.light(rotation=(315,0,0), intensity=3000, light_type="distant")
camera = rep.create.camera(position=(1000,1000, 1000),rotation=(-35,45,0))
render_product = rep.create.render_product(camera, (1024, 1024))
PROPS = 'omniverse://localhost/NVIDIA/Assets/Vegetation/Plant_Tropical/'
# PROPS = "omniverse://localhost/NVIDIA/Assets/ArchVis/Commercial/Seating/"
# PROPS = "omniverse://localhost/NVIDIA/Assets/ArchVis/Commercial/Seating/Caprice/"
# PROPS = "omniverse://localhost/NVIDIA/Assets/ArchVis/Residential/Food/Fruit/"
plane = rep.create.plane(scale=10, visible=True)
def get_props(size):
instances = rep.randomizer.instantiate(rep.utils.get_usd_files(PROPS, recursive=True), size=size, mode='point_instance')
with instances:
rep.modify.pose(
position=rep.distribution.uniform((-500, 0, -500), (500, 0, 500)),
rotation=rep.distribution.uniform((-90, -180, 0), (-90, 180, 0)),
)
return instances.node
rep.randomizer.register(get_props)
# Setup randomization
with rep.trigger.on_frame(num_frames=30):
rep.randomizer.get_props(3)
# Initialize and attach writer
writer = rep.WriterRegistry.get("BasicWriter")
writer.initialize( output_dir="random_assets", rgb=True)
writer.attach([render_product])
rep.orchestrator.preview()