I've got this code:
object.location.x += self.parameters.pos_x
object.location.y += self.parameters.pos_y
object.location.z += self.parameters.pos_z
object.rotation_euler = (self.parameters.rot_x, self.parameters.rot_y, self.parameters.rot_z)
object.select_set(True)
# Optimization opportunity here
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
object.select_set(False)
I would like to replace the call to:
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
I figured I would have to use the bmesh module in some way, but I cannot figure out how to do this. I want to apply rotation to all objects in a list.
In the end I rewrote my code to avoid using rotation_euler. Instead I used bmesh and rotation matrices to perform my rotation directly upon the mesh.
I think the question was closed prematurely though.
– DrewTNBD Jun 30 '21 at 11:07