Hi interwebs,
I’m writing my first Omni Code extension and am struggling with the function arguments. I have an extension working with a button that spawns a cube prim. I’d like to modify it to spawn a cube that doesn’t have a scale: [1, 1, 1]. This is what I’m currently using.
def generate_random_algorithm_cube():
omni.kit.commands.execute('CreateMeshPrimWithDefaultXform',
prim_type='Cube')
omni.kit.commands.execute('TransformMultiPrimsSRTCpp',
count=1,
paths=['/World/Cube'],
new_translations=[0.0, 0.0, 0.0],
new_rotation_eulers=[0.0, 0.0, 0.0],
new_rotation_orders=[0, 1, 2],
new_scales=[(random.uniform(0.05, 3)), (random.uniform(0.05, 3)), (random.uniform(0.05, 3))],
old_translations=[0.0, 0.0, 0.0],
old_rotation_eulers=[0.0, 0.0, 0.0],
old_rotation_orders=[0, 1, 2],
old_scales=[1.0, 1.0, 1.0],
usd_context_name='',
time_code=0.0)