Bug with rep.get.prims

Hello, this is a follow up post about the bug descussed here: How to use scatter2d no_coll_prims parameter with prim created from rep.create.from_usd - #2 by dennis.lynch

I believe I am now experiencing this issue as well.


import omni.replicator.core as rep


HOSE_ON_GROUND_ASSETS_DIR = "C:/Users/dsiss/Desktop/synthia-LFS/Omniverse/randomization_assets/water_hose/rolled_on_ground"
plane_path = "/World/scatter_plane"

def randomize():
	hose_prims = rep.get.prims(semantics = [("class", "hose")])
	traversable_plane = rep.get.prim_at_path(plane_path)
	
	with rep.utils.sequential():
		with hose_prims:
			rep.randomizer.scatter_2d(traversable_plane, check_for_collisions=True)

with rep.new_layer():
	rep.create.from_dir(HOSE_ON_GROUND_ASSETS_DIR, recursive = True, semantics = [("class", "hose")])
	rep.randomizer.register(randomize)
	with rep.trigger.on_time(interval = 0.5):
		randomize()

I get the errors:

Thank you

The error message is from scatter_2d

“There are multiple child meshes (or perhaps other non-mesh types) for the parent xform, scatter requires a single child at this level of hierarchy.

This is either an issue with the way your prims are structured in Usd, or your get.prims is “too broad” and is getting prims that are not compatible with scatter_2d.

Try to print which prims are being returned by your get.prims and also take a look at the documentation for get.

There are specific methods such as get.xform or get.mesh, or use the prim_types argument with get.prims to restrict the results to prims that can be scattered with scatter_2d

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.