I want to find the prim_path of a prim which contain a specific expression like “Geometry” for example.
I first used the get_parent, get_children functions and try to find the string inside each prim_path recursively and then I found the find_matching function but for now I don’t find how to get it work.
To test it I first past “/World/Geometry” and it work well because it’s the exact expression but as the api doc mention, I understand that we can put a regex expression like " .*Geometry.*" but unfortunately it won’t work well…
Maybe I’m misunderstanding something in the doc or in it’s just not the right way to use it.
Is it something possible with this function or do I have to retry the get_parent, get_child workaround ?
Can you please use as an alternative the following snippet, while we investigate more about the implementation?
import re
import omni.isaac.core.utils.stage as stage_utils
import omni.isaac.core.utils.prims as prims_utils
paths = [res.string for prim in stage_utils.traverse_stage() if (res:=re.search(".*Geometry.*", prims_utils.get_prim_path(prim)))]
print(paths)