Modify.pose : Empty typeName for ... xformOpOrder

I got the following error message when trying the use randonmizer

Empty typeName for </World/RubixCube/Cubies_11/RedStickers_Mat.xformOpOrder>

The script is as follow

import omni.replicator.core as rep

with rep.new_layer():

    def randomPose(prim:str, positionFrom: tuple, positionTo: tuple, rotationFrom: tuple, rotationTo: tuple, scaleFrom: float, scaleTo: float):
        can = rep.get.prims(path_pattern=prim)
        with can:
                position=rep.distribution.uniform(positionFrom, positionTo),
                rotation=rep.distribution.uniform(rotationFrom, rotationTo),
                scale=rep.distribution.uniform(scaleFrom, scaleTo),
        return can.node


    with rep.trigger.on_frame(num_frames=3):
        rep.randomizer.randomPose('/World/AlarmClock_Retro', (-80, -40, 40), (70, 25, 40), (-90, 0, -180), (-90, 0, 180), 0.8, 1.2)

error message

/Replicator/SDGPipeline/OgnWritePrimAttribute_15: OmniGraph Error: WritePrimAttribute Error: 
Error in 'pxrInternal_v0_20__pxrReserved__::UsdStage::_SetValueImpl' at line 6028 in file /buildAgent/work/ca6c508eae419cf8/USD/pxr/usd/usd/stage.cpp : 'Empty typeName for </World/RubixCube/Cubies_11/RedStickers_Mat.xformOpOrder>'


I believe this is happening because you are trying to modify the pose (i.e. xformOpOrder) on a material (/World/RubixCube/Cubies_11/RedStickers_Mat), which can’t have an xformOpOrder attribute. It is probably a result of using “rep.get.prims” which returns all the prims that match the path pattern, including children, since a ‘prim’ is the base of all objects.

I would try using “rep.get.mesh” instead to filter out any materials that have part of the object path in the material path string.

I tried to reproduce the error with your script and it does not produce this error if ‘/World/AlarmClock_Retro’ is a mesh (I replaced it with a Cube on my end), and the error seems to be related to the ‘/World/RubixCube’ object.