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

node id. Again

Created by: ly29

For keeping of things track that can't be stored in bpy.props we use a number of schemes to be able to use as a key for python dicts.

The one we recommended in #116 (closed) was

n_id=hash(node)

Which works well until we undo. Which often will change the value of hash(node). Easiest is to test with view drawer where it leads to abandoned callbacks that aren't disabled. For a node like script node it only leads to a memory leak because it regenerates the script from a bpy.prop if it can't find the key in node_dict

To test create a string prop and test for change.

    old_nid = StringProperty(default='',options={'SKIP_SAVE'})

   def update(self):
       n_id = str(hash(self))
       if n_id != self.old_nid:
          print(self.name,"node id changed")
          self.old_nid=n_id

I think we have to accept that there isn't a stable unique value for a node. Name, label, hash can all change and that we have to keep track of the change for cached data to avoid memory leaks or abandoned callbacks.

Any suggestions for how to do this in a good way?

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