mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
family widget also stores and collect key of family in presets so can be trackable on pyblish
This commit is contained in:
parent
79104b278c
commit
b7c827f35d
2 changed files with 6 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ HelpRole = QtCore.Qt.UserRole + 2
|
|||
FamilyRole = QtCore.Qt.UserRole + 3
|
||||
ExistsRole = QtCore.Qt.UserRole + 4
|
||||
PluginRole = QtCore.Qt.UserRole + 5
|
||||
PluginKeyRole = QtCore.Qt.UserRole + 6
|
||||
|
||||
from ..resources import get_resource
|
||||
from .button_from_svgs import SvgResizable, SvgButton
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import json
|
|||
from collections import namedtuple
|
||||
|
||||
from . import QtWidgets, QtCore
|
||||
from . import HelpRole, FamilyRole, ExistsRole, PluginRole
|
||||
from . import HelpRole, FamilyRole, ExistsRole, PluginRole, PluginKeyRole
|
||||
from . import FamilyDescriptionWidget
|
||||
|
||||
from pypeapp import config
|
||||
|
|
@ -116,8 +116,10 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
|
||||
def collect_data(self):
|
||||
plugin = self.list_families.currentItem().data(PluginRole)
|
||||
key = self.list_families.currentItem().data(PluginKeyRole)
|
||||
family = plugin.family.rsplit(".", 1)[-1]
|
||||
data = {
|
||||
'family_preset_key': key,
|
||||
'family': family,
|
||||
'subset': self.input_result.text(),
|
||||
'version': self.version_spinbox.value()
|
||||
|
|
@ -318,7 +320,7 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
has_families = False
|
||||
presets = config.get_presets().get('standalone_publish', {})
|
||||
|
||||
for creator in presets.get('families', {}).values():
|
||||
for key, creator in presets.get('families', {}).items():
|
||||
creator = namedtuple("Creator", creator.keys())(*creator.values())
|
||||
|
||||
label = creator.label or creator.family
|
||||
|
|
@ -327,6 +329,7 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
item.setData(HelpRole, creator.help or "")
|
||||
item.setData(FamilyRole, creator.family)
|
||||
item.setData(PluginRole, creator)
|
||||
item.setData(PluginKeyRole, key)
|
||||
item.setData(ExistsRole, False)
|
||||
self.list_families.addItem(item)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue