Argument of type "Euler | None" cannot be assigned to parameter "rotation" of type "Sequence[float] | Quaternion | Euler" in function "LocRotScale"
Type "Euler | None" cannot be assigned to type "Sequence[float] | Quaternion | Euler"
Type "None" cannot be assigned to type "Sequence[float] | Quaternion | Euler"
Type "None" cannot be assigned to type "Sequence[float]"
Type "None" cannot be assigned to type "Quaternion"
Type "None" cannot be assigned to type "Euler"
LocRotScale(None, None, None) shouldn't raise any type errors—it returns a 4x4 identity matrix:
Object.location, .rotation_euler, .rotation_quaternion and .scale are Unions of Lists and Tuples of floats in addition to their Mathutils types, which means that passing them to LocRotScale raises yet further type errors—is this by design, or a separate issue that I should create an issue for? These are certainly not the only places these Union types are used for Mathutils types.
System Information
fake-bpy-module-3.4
from pypiExpected Behavior
The typing for
mathutils.Matrix.LocRotScale
matches the documention, with arotation
argument typedMatrix | Quaternion | Euler | None
.Actual Behaviour
LocRotScale(None, None, None)
shouldn't raise any type errors—it returns a 4x4 identity matrix:Additional comments
Object.location
,.rotation_euler
,.rotation_quaternion
and.scale
are Unions ofList
s andTuple
s offloat
s in addition to their Mathutils types, which means that passing them toLocRotScale
raises yet further type errors—is this by design, or a separate issue that I should create an issue for? These are certainly not the only places these Union types are used for Mathutils types.