Hi @Moult,
I have tried a test on object rotation and its working perfectly. below is my code and the screenshot from BB.
I was wondering if this is the correct way of doing the rotation. I have made a 3x3 matrix and then converted into a 4x4 by adding additional col and row and I dont think this is the right approach :(. Is this 4x4 matrix a quaternion?
Also, I observed that I was loosing the existing translation or rotation and that I have to mention all the existing translations and rotations again. How do I only apply the new rotation to the object with existing rotation/translation?
beam_plc = placement.get_local_placement(beam.ObjectPlacement)
beam_matrix = mathutils.Matrix(beam_plc)
phi, psi = -np.pi/2, np.pi/2
rotX = mathutils.Matrix([[1,0,0],
[0, np.cos(phi), -np.sin(phi)],
[0, np.sin(phi), np.cos(phi)]])
rotZ = mathutils.Matrix([[np.cos(psi), -np.sin(psi), 0],
[np.sin(psi), np.cos(psi), 0],
[0,0,1]])
rotation = rotX@rotZ
translation = np.array([0, -0.08, 2.04])
last_row = np.array([0.,0.,0.,1.])
rotation_mat = np.vstack((np.hstack((np.matrix(rotation), translation.reshape(-1,1))), last_row))
new_matrix = mathutils.Matrix(rotation_mat.tolist())
run('geometry.edit_object_placement', f, product=beam, matrix = new_matrix)

