• S sverchok
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 148
    • Задачи 148
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 21
    • Запросы на слияние 21
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • nikitronn
  • sverchok
  • Задачи
  • #145
Закр.
Открыто
Задача созд. Май 06, 2014 пользователемnikitronn@nikitronnВладелец

UI upgrade - compact nodes.

Created by: ly29

It has become more and more annoying that our nodes are large and behave in a non standard way when it comes to show socket info. Now I found a way to expose our properties like a standard blender node does without making a big class system. ui-circle What is needed for the Radius property in Circle node:

rad_ = bpy.props.FloatProperty(name = 'Radius', description='Radius', default=1.0, options={'ANIMATABLE'}, update=updateNode)

def init(self, context):
        self.inputs.new('StringsSocket', "Radius").prop_name='rad_'

This also means we don't have set anything for Radius in draw_buttons

def draw_buttons(self, context, layout):
    layout.prop(self,"mode_", text="Mode")

New code in node_s

class StringsSocket(NodeSocketStandard):
        '''String any type - one string'''
        bl_idname = "StringsSocket"
        bl_label = "Strings Socket"
        prop_name = StringProperty(default='')

        def draw(self, context, layout, node, text):
            if not self.is_output and not self.is_linked and self.prop_name:
                layout.prop(node,self.prop_name)
            elif self.is_linked:
                layout.label(text + '. ' + SvGetSocketInfo(self))
            else:
                layout.label(text)

        def draw_color(self, context, node):
            return(0.6,1.0,0.6,1.0)

Issues

  • Doesn't work with º characters for some reason.
  • If you specify ANGLE option you get value in radians, test while converting nodes.

I want to do some more testing before we commit this and start upgrading nodes.

Comments?

Ответственный
Назначить
Оценка трудозатрат