Открыть боковую панель
nikitronn
sverchok
Коммиты
7bf707c4
Коммит
7bf707c4
создал
Фев 02, 2022
по автору
Durman
Просмотр файлов
fix reading __annotations__ attribute in python 3.10
владелец
771a4b94
Изменения
2
Скрыть пробелы
Построчно
Рядом
__init__.py
Просмотр файла @
7bf707c4
...
...
@@ -43,7 +43,7 @@
bl_info
=
{
"name"
:
"Sverchok"
,
"author"
:
"sverchok-b3d@ya.ru various authors see https://github.com/nortikin/sverchok/graphs/contributors"
,
"version"
:
(
1
,
0
,
0
),
"version"
:
(
1
,
0
,
1
),
"blender"
:
(
2
,
93
,
0
),
"location"
:
"Node Editor"
,
"category"
:
"Node"
,
...
...
data_structure.py
Просмотр файла @
7bf707c4
...
...
@@ -1192,9 +1192,11 @@ def extend_blender_class(cls):
Take into account that this decorator does not delete anything onto reload event
"""
bl_class
=
getattr
(
bpy
.
types
,
cls
.
__name__
)
for
base_cls
in
chain
([
cls
],
cls
.
__bases__
[
1
:]):
if
hasattr
(
base_cls
,
'__annotations__'
):
for
name
,
prop
in
base_cls
.
__annotations__
.
items
():
for
base_cls
in
chain
([
cls
],
cls
.
__bases__
):
# https://docs.python.org/3/howto/annotations.html#accessing-the-annotations-dict-of-an-object-in-python-3-9-and-older
# avoiding getting inherited annotations
if
'__annotations__'
in
base_cls
.
__dict__
:
for
name
,
prop
in
base_cls
.
__dict__
[
'__annotations__'
].
items
():
setattr
(
bl_class
,
name
,
prop
)
for
key
in
(
key
for
key
in
dir
(
base_cls
)
if
not
key
.
startswith
(
'_'
)):
setattr
(
bl_class
,
key
,
getattr
(
base_cls
,
key
))
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать