Open GCChen97 opened 1 week ago
Rotations are generally controlled by the piece of code which invokes the asset, not the asset itself.
If you want to apply a rotation inside an asset implementation, you may need to "apply" the rotation so that it is baked into the mesh and isnt overwritten when later parts of the code assign the rotation. You can do this by calling butil.apply_transform(obj, rot=True)
on the obj & placeholder before returning them.
But this is just my best guess for what could be going on, for more specific advice id need to know what object this is and what command you are running (indoors or nature ?)
@araistrick Hi, Alex. Thanks for the reply. The reason I want to add rotation is to make the scene more casual and more diverse rather than everything being regularly placed and axis-aligned.
I implemented a few simple primitive factories including cube, sphere and cylinder for indoor scenes, and managed to add materials of canfactory for them. I did this for exploring the way infinigen works and will add more complex objects when I know how it works. Is butil.apply_transform a better choice for adding rotation?
Assuming this is for indoor scenes, the easier way to achieve this would be to edit here and add some translation / rotation.
IE right before this line you could do something like:
placeholder.rotation_euler.z += np.rad2deg(np.random.uniform(-10, 10))
Thanks! I'll try both the methods.
Describe the bug
I tried to add some rotation to objects in
create_assets
andcreate_pholder
before returning the objects but it makes the objects floating above the floor.Steps to Reproduce
I added some rotation, but it seems not to work and makes the objects float above the floor instead. Here is the code clip:
What version of the code were you using?
commit 88fb49cde0bbca401601d05d672b31d28e9b45cb