I am importing a model that consists of multiple individual meshes. Right after import (where everything is selected), I want to rotate the imported selected objects based on a [X, Y, Z] angle parameter. Also I want to run the script as a blender "--background" shell process.
I tried doing something like this but it doesn't seem to work.
bpy.ops.transform.rotate(value=math.radians(param.x), orient_axis='X');
bpy.ops.transform.rotate(value=math.radians(param.y), orient_axis='Y');
bpy.ops.transform.rotate(value=math.radians(param.z), orient_axis='Z');
I get this error:
RuntimeError: Operator bpy.ops.transform.rotate.poll() failed, context is incorrect
I tried searching the internet for solutions but I couldn't understand exactly what is going wrong. Also I think this error doesn't appear because I am running with "--background", but because I am running it as a terminal command.
Thanks in advance! I am using Blender 2.9.