I would like to use Replicator to modify the color of the OmniSurface material. Specifically, each mesh in my scene has hundreds of different colors, and I need to use Replicator to continuously switch the material colors and render an image for each color.
However, I’ve encountered a problem: I’m using the OmniSurface material because it has the transmission property I need, and the entire simulation is built upon it, so I can’t switch to OmniPBR. When checking the Replicator API, I only found functions that support OmniPBR.
I’m wondering if these APIs can also be applied to OmniSurface, or if there’s another way to modify the color of OmniSurface materials?
I’ve discovered that modifying the omnisurface material can be achieved using the following code, provided you first create a list of all materials with different colors.
However, there’s currently an issue: modify.material cannot render and output according to the material list’s sequence via distribution.sequence. Is there a way to resolve this?
1. rep.get.material did not retrieve the omnisurface material.
2. randomizer.color is not applicable; it defaults to assigning a PBR material.
3. rep.create.from_usd is not applicable; my scene file is very large.
I’ve resolved it—rep.modify.material(rep.distribution.sequence(material_paths)) accepts material paths, which I hadn’t noticed before. The code is as follows.