Objects load with different scale after rep.randomizer.instantiate

I am trying to load and scatter2d a set of random boxes. However some load with a scale of 0.01 and some 0.0001. The code below doesnt seem to set the scale correctly. Any ideas ?

def env_props(plane, size=config[‘num_items’]):

instances = rep.randomizer.instantiate(cardboard_usd_files, size=size, mode="scene_instance")
with instances:    
    rep.modify.attribute("xformOp:scale", 0.01) 
    rep.modify.semantics([('class', 'CardBox')])
    rep.randomizer.rotation(min_angle=(0.0,0.0,0.0), max_angle=(0.001, 0.001, 180.0))
    rep.modify.pose(scale=(1.0, 1.0 ,1.0))
    rep.randomizer.scatter_2d(surface_prims=plane, check_for_collisions=True, offset=0.01)
return instances.node

A few suggestions and a request:

  1. If you’re using a public asset (such as one in the examples that we can also try) can you mention which ones they are? Solving this may need to be able to look at the specific assets you’re referring to.
  2. It looks like you’re setting scale twice in rep.modify.attribute("xformOp:scale", 0.01) and rep.modify.pose(scale=(1.0, 1.0 ,1.0)). Try removing the last one, (or one of them).
  3. Instantiate will only work on the parent xform, while the mesh inside may have a different scale. Check whether the mesh has a different scale, and whats happening to the parent xform thats supposed to be getting scaled.