import omni.replicator.core as rep import omni.kit.commands # 頭と手を黄色に with rep.get.prim_at_path(['/World/figure/Group/Captain','/World/figure/Group/Arm007','/World/figure/Group/Arm009']): rep.modify.material( rep.create.material_omnipbr(diffuse=(1, 0.58, 0)) ) # 腕を青に with rep.get.prim_at_path(['/World/figure/Group/Arm006','/World/figure/Group/Arm008']): rep.modify.material( rep.create.material_omnipbr(diffuse=(0, 0, 1)) ) # 帽子を赤に with rep.get.prim_at_path(['/World/figure/Group/Sphere001']): rep.modify.material( rep.create.material_omnipbr(diffuse=(1, 0, 0)) ) # 下半身をオレンジに with rep.get.prim_at_path(['/World/figure/Group/Right_leg003', '/World/figure/Group/Right_leg002', '/World/figure/Group/middle001']): rep.modify.material( rep.create.material_omnipbr(diffuse=(0.6, 0.2, 0)) ) # 腰周りのテクスチャを貼る with rep.get.prim_at_path(['/World/figure/Group/Torso001']): rep.modify.material( rep.create.material_omnipbr(diffuse_texture="sp face.jpg") ) # 胴体に作業服のテクスチャを貼る with rep.get.prim_at_path(['/World/figure/Group/Body001']): rep.modify.material( rep.create.material_omnipbr(diffuse_texture="dc-universe-super-heroes-lego-dc-universe-super-heroes-batman-minifigure-clock-5002423-1.jpg") ) # 上記で作成したマテリアルプリム(Looks)をworldに移動 omni.kit.commands.execute( 'MovePrims', paths_to_move={'/Replicator/Looks': '/World/Looks'}, keep_world_transform=False, destructive=False )