Hello,
We are trying the randomize the properties of components of a material Graph as part of the Synthetic data generation process. The Material Graph is created in a way to have additive effect of multiple file_texures. We want to randomize a texture of particular file_texture.
Current Implementation which is not working
def get_blade_material():
shape = rep.get.prims(path_pattern='/World/Looks/MachineBlade_Material/base_texture/file_texture')
with shape:
rep.modify.attribute('inputs:texture', rep.distribution.choice([
'omniverse://localhost/NVIDIA/Materials/vMaterials_2/Ground/textures/aggregate_exposed_diff.jpg',
'omniverse://localhost/NVIDIA/Materials/vMaterials_2/Ground/textures/gravel_track_ballast_diff.jpg',
'omniverse://localhost/NVIDIA/Materials/vMaterials_2/Ground/textures/gravel_track_ballast_multi_R_rough_G_ao.jpg',
'omniverse://localhost/NVIDIA/Materials/vMaterials_2/Ground/textures/rough_gravel_rough.jpg'
]))
rep.randomizer.register(get_blade_material)
However in the extension we are able to access the component (Material Graph node) of same material graph in the extension we developed and manipulate it’s property using the code below
prims_1 = self.stage.GetPrimAtPath("/World/MachineBlade/MachineBlade_Material/base_texture/file_texture")
prims_1.GetAttribute("inputs:brightness").Set(0)
Requesting help on understanding of configuring Material graph in Replicator
Attaching the USD and the Python script
SDG_Replicator.py (2.5 KB)
Blade_SDG_Scene.zip (12.6 MB)