Hi
I want to apply a randomized texture to an object and also randomize its material properties (reflectivity, roughness, etc.) at the same time.
The python API for replicator.core.randomizer.texture only exposes randomization options for the texture images and does not provide options to randomize material properties.
The documentation however states:
Randomize texture Creates and binds an OmniPBR material to each prim in input_prims and modifies textures.
This can also be seen when looking at the created OmniGraph of the randomization:
How can the material properties, i.e. the inputs of the TextureRandomizer Node be written and randomized via the replicator Python API?
@ManicMunchkin i am just another user passing by, but for the other material properties like metallic and roughness, are you thinking of randomizing their color value or texture input? below are a few different scenarios in the past where users have asked for similar things that might be of interest:
@Simplychenable thanks for your response and the links.
I would like to randomize the amount of specularity by randomizing the roughness and metallic values of the created material. I don’t need texture maps for these parameters.
It seems like it should be possible with the Texture Randomizer node as it has the required inputs. It is unclear however how I could access these inputs using the replicator API.
I would imagine I could use something like this:
def randomize_floor_mat():
with floor:
tex = rep.randomizer.texture(
textures=[
'omniverse://localhost/NVIDIA/Materials/vMaterials_2/Ground/textures/aggregate_exposed_diff.jpg'
])
with tex:
rep.modify.attribute("inputs:metallic", rep.distribution.uniform(lower=0.3, upper=1.0))
return floor.node
This however does not work because the inner rep.distribution call is made with num_samples set to 0. I guess this has something to do with tex being a replicator item, not a prim?
Rigging it up manually seems to work. So the question is how can I implement something like the following graph using the replicator API