Fix #2528. Setting x angle on slabs now only affects the X euler angle

This commit is contained in:
Dion Moult
2022-10-26 18:11:54 +11:00
parent ffbf6483b5
commit fb2989c17f
2 changed files with 7 additions and 4 deletions
@@ -176,8 +176,7 @@ class DumbSlabGenerator:
obj.matrix_world = matrix_world
bpy.context.view_layer.update()
self.collection.objects.link(obj)
rotation = mathutils.Matrix.Rotation(self.x_angle, 4, 'X')
obj.matrix_world = rotation
obj.matrix_world = Matrix.Rotation(self.x_angle, 4, 'X')
element = blenderbim.core.root.assign_class(
tool.Ifc,
@@ -294,8 +294,12 @@ class ChangeExtrusionXAngle(bpy.types.Operator, tool.Ifc.Operator):
is_global=True,
should_sync_changes_first=False,
)
rotation = mathutils.Matrix.Rotation(x_angle, 4, "X")
obj.matrix_world = rotation
euler = obj.matrix_world.to_euler()
euler.x = x_angle
new_matrix = euler.to_matrix().to_4x4()
new_matrix.col[3] = obj.matrix_world.col[3]
obj.matrix_world = new_matrix
if wall_objs:
DumbWallRecalculator().recalculate(wall_objs)
return {"FINISHED"}