In this code I try to use scatter2d to âavoidâ placing prims that would intersect the desk prim which is imported from nvidia assets. Unfortunately, when using âStartâ or âPreviewâ option from replicator, I get an error message indicating that:
â[Error] [omni.graph.core.plugin] /Replicator/SDGPipeline/OgnScatter2D: OmniGraph Error: Scatter2D Error: Expected prim at /Replicator/Ref_Xform/Ref to be of type UsdGeom.Mesh or UsdGeom.GeomSubset but got type Xformâ
I think that the problem is just that usd assets apart from cubes, spheres, etc. are not supported with non_coll_prims parameter, which is quite strange. Is there any kind of workaround to make this script work?
What is happening is get.prims is returning Xforms as well as meshes, and scatter expects a Mesh. By narrowing the scope of get.prims we can exclude the Xform prims from the get.
Thank you for your reply. How does the path_match parameter work? Replicator Python API says, that it does âPython string matchingâ. But from what I saw, only âDeskâ works. I tried to paste the whole path or only some parts of path to the usd file instead of âDeskâ to see how it works, but the prims did intersect the desk. So if I want to use this function with my usd asset, what should I write in path_match parameter? I also want to add that the first line of code, doesnât work (I donât get an error, but the prims still may intersect the desk).
I also get this warning when I try to execute script with this line:
[Warning] [omni.replicator.core.ogn.python._impl.nodes.OgnGetPrims] No prims found with given inputs:
Apologies, it errors on my side too, I didnât notice the error the first time.
Explanation:
When you add semantics=[(...)] when creating an object, the semantic label is added to the parent Xform and not the child mesh prims. So doing rep.get.prims(semantics=[('class', 'desk')], prim_types=['Mesh']) returns nothing, since there are no mesh prims with the semantic label.
Weâre going to add some logic to scatter functionality such that it will look for child meshes when given an Xform
But for now, desks = rep.get.prims(path_match='Desk', prim_types=['Mesh']) should work since "Desk" is in the prim path of the meshes