mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
family widget now use get presets from config
This commit is contained in:
parent
1570800b7b
commit
3e6f02795c
1 changed files with 5 additions and 15 deletions
|
|
@ -4,13 +4,11 @@ import inspect
|
|||
import json
|
||||
from collections import namedtuple
|
||||
|
||||
from . import QtWidgets, QtCore, QtGui
|
||||
from . import QtWidgets, QtCore
|
||||
from . import HelpRole, FamilyRole, ExistsRole, PluginRole
|
||||
from . import FamilyDescriptionWidget
|
||||
from pype.vendor import six
|
||||
|
||||
from avalon import api, io, style
|
||||
from pype import lib as pypelib
|
||||
from pypeapp import config
|
||||
|
||||
|
||||
class FamilyWidget(QtWidgets.QWidget):
|
||||
|
|
@ -249,14 +247,9 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
|
||||
def refresh(self):
|
||||
has_families = False
|
||||
|
||||
path_items = [
|
||||
pypelib.get_presets_path(), 'tools', 'standalone_publish.json'
|
||||
]
|
||||
filepath = os.path.sep.join(path_items)
|
||||
presets = dict()
|
||||
with open(filepath) as data_file:
|
||||
presets = json.load(data_file)
|
||||
presets = config.get_presets().get('tools', {}).get(
|
||||
'standalone_publish', {}
|
||||
)
|
||||
|
||||
for creator in presets.get('families', {}).values():
|
||||
creator = namedtuple("Creator", creator.keys())(*creator.values())
|
||||
|
|
@ -277,9 +270,6 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
item.setData(QtCore.Qt.ItemIsEnabled, False)
|
||||
self.list_families.addItem(item)
|
||||
|
||||
presets_path = pypelib.get_presets_path()
|
||||
config_file = os.path.sep.join([presets_path, 'tools', 'creator.json'])
|
||||
|
||||
self.list_families.setCurrentItem(self.list_families.item(0))
|
||||
|
||||
def echo(self, message):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue