Closed Pyrolistical closed 1 year ago
bpy.types.Object.rotation_euler is a vector of 3 components, each of which should be modifiable
bpy.types.Object.rotation_euler
From Blender console:
>>> type(bpy.data.objects['some object']) <class 'bpy_types.Object'> >>> type(bpy.data.objects['some object'].rotation_euler) <class 'Euler'> >>> bpy.data.objects['some object'].rotation_euler[0] = 1.5 >>> bpy.data.objects['some object'].rotation_euler[0] 1.5
Observe some object is rotated about 90 degrees around x-axis.
some object
in fake-bpy-modules/bpy/types.py class Object defines rotation_euler as:
class Object
rotation_euler
rotation_euler: typing.Union[ bpy_prop_array[float], typing.Sequence[float], typing. Tuple[float, float, float], 'mathutils.Vector'] = None
When attempting to set it, pylance gives the following 2 errors:
"__setitem__" method not defined on type "Sequence[float]" "__setitem__" method not defined on type "Tuple[float, float, float]"
The workaround is to just add #type: ignore to the line
#type: ignore
I think this issue seems a same logic of https://github.com/nutti/fake-bpy-module/issues/119#issuecomment-1304786775
This issue is now fixed.
System Information
Expected behavior
bpy.types.Object.rotation_euler
is a vector of 3 components, each of which should be modifiableFrom Blender console:
Observe
some object
is rotated about 90 degrees around x-axis.Description about the bug
in fake-bpy-modules/bpy/types.py
class Object
definesrotation_euler
as:When attempting to set it, pylance gives the following 2 errors:
Additional comments
The workaround is to just add
#type: ignore
to the line