mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
creators have new attribute identifier replacing family as identifier which affected almost everything in current code
This commit is contained in:
parent
9eda0ff797
commit
8864e047ac
8 changed files with 223 additions and 203 deletions
|
|
@ -9,7 +9,7 @@
|
|||
"task": "Compositing",
|
||||
"variant": "myVariant",
|
||||
"uuid": "a485f148-9121-46a5-8157-aa64df0fb449",
|
||||
"family_attributes": {
|
||||
"creator_attributes": {
|
||||
"number_key": 10,
|
||||
"ha": 10
|
||||
},
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
"task": "Compositing",
|
||||
"variant": "myVariant2",
|
||||
"uuid": "a485f148-9121-46a5-8157-aa64df0fb444",
|
||||
"family_attributes": {},
|
||||
"creator_attributes": {},
|
||||
"publish_attributes": {
|
||||
"CollectFtrackApi": {
|
||||
"add_ftrack_family": true
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
"task": "Compositing",
|
||||
"variant": "Main",
|
||||
"uuid": "3607bc95-75f6-4648-a58d-e699f413d09f",
|
||||
"family_attributes": {},
|
||||
"creator_attributes": {},
|
||||
"publish_attributes": {
|
||||
"CollectFtrackApi": {
|
||||
"add_ftrack_family": true
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
"task": "Compositing",
|
||||
"variant": "Main2",
|
||||
"uuid": "4ccf56f6-9982-4837-967c-a49695dbe8eb",
|
||||
"family_attributes": {},
|
||||
"creator_attributes": {},
|
||||
"publish_attributes": {
|
||||
"CollectFtrackApi": {
|
||||
"add_ftrack_family": true
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
"task": "Compositing",
|
||||
"variant": "Main2",
|
||||
"uuid": "4ccf56f6-9982-4837-967c-a49695dbe8ec",
|
||||
"family_attributes": {},
|
||||
"creator_attributes": {},
|
||||
"publish_attributes": {
|
||||
"CollectFtrackApi": {
|
||||
"add_ftrack_family": true
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
"task": "modeling",
|
||||
"variant": "Main",
|
||||
"uuid": "7c9ddfc7-9f9c-4c1c-b233-38c966735fb6",
|
||||
"family_attributes": {},
|
||||
"creator_attributes": {},
|
||||
"publish_attributes": {}
|
||||
}
|
||||
]
|
||||
|
|
@ -168,15 +168,15 @@ class AttributeValues:
|
|||
return self.calculate_changes(self._data, self._origin_data)
|
||||
|
||||
|
||||
class FamilyAttributeValues(AttributeValues):
|
||||
"""Family specific attribute values of an instance.
|
||||
class CreatorAttributeValues(AttributeValues):
|
||||
"""Creator specific attribute values of an instance.
|
||||
|
||||
Args:
|
||||
instance (CreatedInstance): Instance for which are values hold.
|
||||
"""
|
||||
def __init__(self, instance, *args, **kwargs):
|
||||
self.instance = instance
|
||||
super(FamilyAttributeValues, self).__init__(*args, **kwargs)
|
||||
super(CreatorAttributeValues, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class PublishAttributeValues(AttributeValues):
|
||||
|
|
@ -350,13 +350,13 @@ class CreatedInstance:
|
|||
# Store original value of passed data
|
||||
self._orig_data = copy.deepcopy(data)
|
||||
|
||||
# Pop family and subset to preved unexpected changes
|
||||
# Pop family and subset to prevent unexpected changes
|
||||
data.pop("family", None)
|
||||
data.pop("subset", None)
|
||||
|
||||
# Pop dictionary values that will be converted to objects to be able
|
||||
# catch changes
|
||||
orig_family_attributes = data.pop("family_attributes", None) or {}
|
||||
orig_creator_attributes = data.pop("creator_attributes", None) or {}
|
||||
orig_publish_attributes = data.pop("publish_attributes", None) or {}
|
||||
|
||||
# QUESTION Does it make sense to have data stored as ordered dict?
|
||||
|
|
@ -373,18 +373,13 @@ class CreatedInstance:
|
|||
else:
|
||||
self._data["version"] = data.get("version")
|
||||
|
||||
# Stored family specific attribute values
|
||||
# Stored creator specific attribute values
|
||||
# {key: value}
|
||||
new_family_values = copy.deepcopy(orig_family_attributes)
|
||||
family_attr_defs = []
|
||||
if creator is not None:
|
||||
new_family_values = creator.convert_family_attribute_values(
|
||||
new_family_values
|
||||
)
|
||||
family_attr_defs = creator.get_attribute_defs()
|
||||
creator_values = copy.deepcopy(orig_creator_attributes)
|
||||
creator_attr_defs = creator.get_attribute_defs()
|
||||
|
||||
self._data["family_attributes"] = FamilyAttributeValues(
|
||||
self, family_attr_defs, new_family_values, orig_family_attributes
|
||||
self._data["creator_attributes"] = CreatorAttributeValues(
|
||||
self, creator_attr_defs, creator_values, orig_creator_attributes
|
||||
)
|
||||
|
||||
# Stored publish specific attribute values
|
||||
|
|
@ -471,17 +466,17 @@ class CreatedInstance:
|
|||
new_keys = set()
|
||||
for key, new_value in self._data.items():
|
||||
new_keys.add(key)
|
||||
if key in ("family_attributes", "publish_attributes"):
|
||||
if key in ("creator_attributes", "publish_attributes"):
|
||||
continue
|
||||
|
||||
old_value = self._orig_data.get(key)
|
||||
if old_value != new_value:
|
||||
changes[key] = (old_value, new_value)
|
||||
|
||||
family_attributes = self.data["family_attributes"]
|
||||
family_attr_changes = family_attributes.changes()
|
||||
if family_attr_changes:
|
||||
changes["family_attributes"] = family_attr_changes
|
||||
creator_attributes = self.data["creator_attributes"]
|
||||
creator_attr_changes = creator_attributes.changes()
|
||||
if creator_attr_changes:
|
||||
changes["creator_attributes"] = creator_attr_changes
|
||||
|
||||
publish_attr_changes = self.publish_attributes.changes()
|
||||
if publish_attr_changes:
|
||||
|
|
@ -493,8 +488,8 @@ class CreatedInstance:
|
|||
return changes
|
||||
|
||||
@property
|
||||
def family_attribute_defs(self):
|
||||
return self._data["family_attributes"].attr_defs
|
||||
def creator_attribute_defs(self):
|
||||
return self._data["creator_attributes"].attr_defs
|
||||
|
||||
@property
|
||||
def publish_attributes(self):
|
||||
|
|
@ -503,12 +498,12 @@ class CreatedInstance:
|
|||
def data_to_store(self):
|
||||
output = collections.OrderedDict()
|
||||
for key, value in self._data.items():
|
||||
if key in ("family_attributes", "publish_attributes"):
|
||||
if key in ("creator_attributes", "publish_attributes"):
|
||||
continue
|
||||
output[key] = value
|
||||
|
||||
family_attributes = self._data["family_attributes"]
|
||||
output["family_attributes"] = family_attributes.data_to_store()
|
||||
creator_attributes = self._data["creator_attributes"]
|
||||
output["creator_attributes"] = creator_attributes.data_to_store()
|
||||
|
||||
publish_attributes = self._data["publish_attributes"]
|
||||
output["publish_attributes"] = publish_attributes.data_to_store()
|
||||
|
|
@ -523,6 +518,8 @@ class CreatedInstance:
|
|||
instance_data = copy.deepcopy(instance_data)
|
||||
|
||||
family = instance_data.get("family", None)
|
||||
if family is None:
|
||||
family = creator.family
|
||||
subset_name = instance_data.get("subset", None)
|
||||
|
||||
return cls(
|
||||
|
|
@ -752,9 +749,8 @@ class CreateContext:
|
|||
|
||||
# Collect instances
|
||||
for creator in self.creators.values():
|
||||
family = creator.family
|
||||
attr_plugins = self._get_publish_plugins_with_attr_for_family(
|
||||
family
|
||||
creator.family
|
||||
)
|
||||
creator.collect_instances(attr_plugins)
|
||||
|
||||
|
|
@ -763,15 +759,15 @@ class CreateContext:
|
|||
|
||||
Reset instances if any autocreator executed properly.
|
||||
"""
|
||||
for family, creator in self.autocreators.items():
|
||||
for identifier, creator in self.autocreators.items():
|
||||
try:
|
||||
creator.create()
|
||||
|
||||
except Exception:
|
||||
# TODO raise report exception if any crashed
|
||||
msg = (
|
||||
"Failed to run AutoCreator with family \"{}\" ({})."
|
||||
).format(family, inspect.getfile(creator.__class__))
|
||||
"Failed to run AutoCreator with identifier \"{}\" ({})."
|
||||
).format(identifier, inspect.getfile(creator.__class__))
|
||||
self.log.warning(msg, exc_info=True)
|
||||
|
||||
def validate_instances_context(self, instances=None):
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ VARIANT_TOOLTIP = (
|
|||
INSTANCE_ID_ROLE = QtCore.Qt.UserRole + 1
|
||||
SORT_VALUE_ROLE = QtCore.Qt.UserRole + 2
|
||||
IS_GROUP_ROLE = QtCore.Qt.UserRole + 3
|
||||
CREATOR_IDENTIFIER_ROLE = QtCore.Qt.UserRole + 4
|
||||
FAMILY_ROLE = QtCore.Qt.UserRole + 5
|
||||
|
||||
|
||||
__all__ = (
|
||||
|
|
@ -26,5 +28,7 @@ __all__ = (
|
|||
|
||||
"INSTANCE_ID_ROLE",
|
||||
"SORT_VALUE_ROLE",
|
||||
"IS_GROUP_ROLE"
|
||||
"IS_GROUP_ROLE",
|
||||
"CREATOR_IDENTIFIER_ROLE",
|
||||
"FAMILY_ROLE"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -545,18 +545,18 @@ class PublisherController:
|
|||
|
||||
self._trigger_callbacks(self._instances_refresh_callback_refs)
|
||||
|
||||
def get_family_attribute_definitions(self, instances):
|
||||
def get_creator_attribute_definitions(self, instances):
|
||||
output = []
|
||||
_attr_defs = {}
|
||||
for instance in instances:
|
||||
for attr_def in instance.family_attribute_defs:
|
||||
for attr_def in instance.creator_attribute_defs:
|
||||
found_idx = None
|
||||
for idx, _attr_def in _attr_defs.items():
|
||||
if attr_def == _attr_def:
|
||||
found_idx = idx
|
||||
break
|
||||
|
||||
value = instance.data["family_attributes"][attr_def.key]
|
||||
value = instance.data["creator_attributes"][attr_def.key]
|
||||
if found_idx is None:
|
||||
idx = len(output)
|
||||
output.append((attr_def, [instance], [value]))
|
||||
|
|
@ -617,13 +617,10 @@ class PublisherController:
|
|||
return creator.get_icon()
|
||||
return None
|
||||
|
||||
def create(self, family, subset_name, instance_data, options):
|
||||
# QUESTION Force to return instances or call `list_instances` on each
|
||||
# creation? (`list_instances` may slow down...)
|
||||
# - also save may not be required in that case
|
||||
self.save_changes()
|
||||
|
||||
creator = self.creators[family]
|
||||
def create(
|
||||
self, creator_identifier, subset_name, instance_data, options
|
||||
):
|
||||
creator = self.creators[creator_identifier]
|
||||
creator.create(subset_name, instance_data, options)
|
||||
|
||||
self._trigger_callbacks(self._instances_refresh_callback_refs)
|
||||
|
|
|
|||
|
|
@ -18,15 +18,15 @@ from ..constants import (
|
|||
)
|
||||
|
||||
|
||||
class FamilyWidget(QtWidgets.QWidget):
|
||||
class GroupWidget(QtWidgets.QWidget):
|
||||
selected = QtCore.Signal(str, str)
|
||||
active_changed = QtCore.Signal()
|
||||
removed_selected = QtCore.Signal()
|
||||
|
||||
def __init__(self, family, family_icon, parent):
|
||||
super(FamilyWidget, self).__init__(parent)
|
||||
def __init__(self, group_name, group_icon, parent):
|
||||
super(GroupWidget, self).__init__(parent)
|
||||
|
||||
label_widget = QtWidgets.QLabel(family, self)
|
||||
label_widget = QtWidgets.QLabel(group_name, self)
|
||||
|
||||
line_widget = QtWidgets.QWidget(self)
|
||||
line_widget.setObjectName("Separator")
|
||||
|
|
@ -44,8 +44,8 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.addLayout(label_layout, 0)
|
||||
|
||||
self._family = family
|
||||
self._family_icon = family_icon
|
||||
self._group = group_name
|
||||
self._group_icon = group_icon
|
||||
|
||||
self._widgets_by_id = {}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
widget.update_instance(instance)
|
||||
else:
|
||||
widget = InstanceCardWidget(
|
||||
instance, self._family_icon, self
|
||||
instance, self._group_icon, self
|
||||
)
|
||||
widget.selected.connect(self.selected)
|
||||
widget.active_changed.connect(self.active_changed)
|
||||
|
|
@ -105,6 +105,8 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
|
||||
class CardWidget(ClickableFrame):
|
||||
selected = QtCore.Signal(str, str)
|
||||
# This must be set
|
||||
_group_identifier = None
|
||||
|
||||
def __init__(self, parent):
|
||||
super(CardWidget, self).__init__(parent)
|
||||
|
|
@ -126,7 +128,7 @@ class CardWidget(ClickableFrame):
|
|||
self.style().polish(self)
|
||||
|
||||
def _mouse_release_callback(self):
|
||||
self.selected.emit(self._id, self._family)
|
||||
self.selected.emit(self._id, self._group_identifier)
|
||||
|
||||
|
||||
class ContextCardWidget(CardWidget):
|
||||
|
|
@ -134,7 +136,7 @@ class ContextCardWidget(CardWidget):
|
|||
super(ContextCardWidget, self).__init__(parent)
|
||||
|
||||
self._id = CONTEXT_ID
|
||||
self._family = ""
|
||||
self._group_identifier = ""
|
||||
|
||||
icon_widget = TransparentPixmapLabel(self)
|
||||
icon_widget.setObjectName("FamilyIconLabel")
|
||||
|
|
@ -157,16 +159,16 @@ class ContextCardWidget(CardWidget):
|
|||
class InstanceCardWidget(CardWidget):
|
||||
active_changed = QtCore.Signal()
|
||||
|
||||
def __init__(self, instance, family_icon, parent):
|
||||
def __init__(self, instance, group_icon, parent):
|
||||
super(InstanceCardWidget, self).__init__(parent)
|
||||
|
||||
self._id = instance.id
|
||||
self._family = instance.data["family"]
|
||||
self._family_icon = family_icon
|
||||
self._group_identifier = instance.creator_identifier
|
||||
self._group_icon = group_icon
|
||||
|
||||
self.instance = instance
|
||||
|
||||
icon_widget = IconValuePixmapLabel(family_icon, self)
|
||||
icon_widget = IconValuePixmapLabel(group_icon, self)
|
||||
icon_widget.setObjectName("FamilyIconLabel")
|
||||
context_warning = ContextWarningLabel(self)
|
||||
|
||||
|
|
@ -303,10 +305,10 @@ class InstanceCardView(AbstractInstanceView):
|
|||
self._content_layout = content_layout
|
||||
self._content_widget = content_widget
|
||||
|
||||
self._widgets_by_family = {}
|
||||
self._widgets_by_group = {}
|
||||
self._context_widget = None
|
||||
|
||||
self._selected_instance_family = None
|
||||
self._selected_group = None
|
||||
self._selected_instance_id = None
|
||||
|
||||
self.setSizePolicy(
|
||||
|
|
@ -330,11 +332,11 @@ class InstanceCardView(AbstractInstanceView):
|
|||
if self._selected_instance_id == CONTEXT_ID:
|
||||
return self._context_widget
|
||||
|
||||
family_widget = self._widgets_by_family.get(
|
||||
self._selected_instance_family
|
||||
group_widget = self._widgets_by_group.get(
|
||||
self._selected_group
|
||||
)
|
||||
if family_widget is not None:
|
||||
widget = family_widget.get_widget_by_instance_id(
|
||||
if group_widget is not None:
|
||||
widget = group_widget.get_widget_by_instance_id(
|
||||
self._selected_instance_id
|
||||
)
|
||||
if widget is not None:
|
||||
|
|
@ -354,58 +356,63 @@ class InstanceCardView(AbstractInstanceView):
|
|||
|
||||
self.select_item(CONTEXT_ID, None)
|
||||
|
||||
instances_by_family = collections.defaultdict(list)
|
||||
instances_by_creator = collections.defaultdict(list)
|
||||
for instance in self.controller.instances:
|
||||
family = instance.data["family"]
|
||||
instances_by_family[family].append(instance)
|
||||
identifier = instance.creator_identifier
|
||||
instances_by_creator[identifier].append(instance)
|
||||
|
||||
for family in tuple(self._widgets_by_family.keys()):
|
||||
if family in instances_by_family:
|
||||
for identifier in tuple(self._widgets_by_group.keys()):
|
||||
if identifier in instances_by_creator:
|
||||
continue
|
||||
|
||||
if family == self._selected_instance_family:
|
||||
if identifier == self._selected_group:
|
||||
self._on_remove_selected()
|
||||
widget = self._widgets_by_family.pop(family)
|
||||
widget = self._widgets_by_group.pop(identifier)
|
||||
widget.setVisible(False)
|
||||
self._content_layout.removeWidget(widget)
|
||||
widget.deleteLater()
|
||||
|
||||
sorted_families = list(sorted(instances_by_family.keys()))
|
||||
sorted_identifiers = list(sorted(instances_by_creator.keys()))
|
||||
widget_idx = 1
|
||||
for family in sorted_families:
|
||||
if family not in self._widgets_by_family:
|
||||
family_icon = self.controller.get_icon_for_family(family)
|
||||
family_widget = FamilyWidget(
|
||||
family, family_icon, self._content_widget
|
||||
for creator_identifier in sorted_identifiers:
|
||||
if creator_identifier in self._widgets_by_group:
|
||||
group_widget = self._widgets_by_group[creator_identifier]
|
||||
else:
|
||||
group_icon = self.controller.get_icon_for_family(
|
||||
creator_identifier
|
||||
)
|
||||
family_widget.active_changed.connect(self._on_active_changed)
|
||||
family_widget.selected.connect(self._on_widget_selection)
|
||||
family_widget.removed_selected.connect(
|
||||
group_widget = GroupWidget(
|
||||
creator_identifier, group_icon, self._content_widget
|
||||
)
|
||||
group_widget.active_changed.connect(self._on_active_changed)
|
||||
group_widget.selected.connect(self._on_widget_selection)
|
||||
group_widget.removed_selected.connect(
|
||||
self._on_remove_selected
|
||||
)
|
||||
self._content_layout.insertWidget(widget_idx, family_widget)
|
||||
self._widgets_by_family[family] = family_widget
|
||||
else:
|
||||
family_widget = self._widgets_by_family[family]
|
||||
self._content_layout.insertWidget(widget_idx, group_widget)
|
||||
self._widgets_by_group[creator_identifier] = group_widget
|
||||
|
||||
widget_idx += 1
|
||||
family_widget.update_instances(instances_by_family[family])
|
||||
group_widget.update_instances(
|
||||
instances_by_creator[creator_identifier]
|
||||
)
|
||||
|
||||
def refresh_instance_states(self):
|
||||
for widget in self._widgets_by_family.values():
|
||||
for widget in self._widgets_by_group.values():
|
||||
widget.update_instance_values()
|
||||
|
||||
def _on_active_changed(self):
|
||||
self.active_changed.emit()
|
||||
|
||||
def _on_widget_selection(self, instance_id, family):
|
||||
self.select_item(instance_id, family)
|
||||
def _on_widget_selection(self, instance_id, group_name):
|
||||
self.select_item(instance_id, group_name)
|
||||
|
||||
def select_item(self, instance_id, family):
|
||||
def select_item(self, instance_id, group_name):
|
||||
if instance_id == CONTEXT_ID:
|
||||
new_widget = self._context_widget
|
||||
else:
|
||||
family_widget = self._widgets_by_family[family]
|
||||
new_widget = family_widget.get_widget_by_instance_id(instance_id)
|
||||
group_widget = self._widgets_by_group[group_name]
|
||||
new_widget = group_widget.get_widget_by_instance_id(instance_id)
|
||||
|
||||
selected_widget = self._get_selected_widget()
|
||||
if new_widget is selected_widget:
|
||||
|
|
@ -415,7 +422,7 @@ class InstanceCardView(AbstractInstanceView):
|
|||
selected_widget.set_selected(False)
|
||||
|
||||
self._selected_instance_id = instance_id
|
||||
self._selected_instance_family = family
|
||||
self._selected_group = group_name
|
||||
if new_widget is not None:
|
||||
new_widget.set_selected(True)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ from openpype.pipeline.create import CreatorError
|
|||
from .widgets import IconValuePixmapLabel
|
||||
from ..constants import (
|
||||
SUBSET_NAME_ALLOWED_SYMBOLS,
|
||||
VARIANT_TOOLTIP
|
||||
VARIANT_TOOLTIP,
|
||||
CREATOR_IDENTIFIER_ROLE,
|
||||
FAMILY_ROLE
|
||||
)
|
||||
|
||||
SEPARATORS = ("---separator---", "---")
|
||||
|
|
@ -23,7 +25,7 @@ SEPARATORS = ("---separator---", "---")
|
|||
class CreateErrorMessageBox(QtWidgets.QDialog):
|
||||
def __init__(
|
||||
self,
|
||||
family,
|
||||
creator_label,
|
||||
subset_name,
|
||||
asset_name,
|
||||
exc_msg,
|
||||
|
|
@ -47,7 +49,7 @@ class CreateErrorMessageBox(QtWidgets.QDialog):
|
|||
body_layout.addWidget(main_label_widget)
|
||||
|
||||
item_name_template = (
|
||||
"<span style='font-weight:bold;'>Family:</span> {}<br>"
|
||||
"<span style='font-weight:bold;'>Creator:</span> {}<br>"
|
||||
"<span style='font-weight:bold;'>Subset:</span> {}<br>"
|
||||
"<span style='font-weight:bold;'>Asset:</span> {}<br>"
|
||||
)
|
||||
|
|
@ -56,7 +58,9 @@ class CreateErrorMessageBox(QtWidgets.QDialog):
|
|||
line = self._create_line()
|
||||
body_layout.addWidget(line)
|
||||
|
||||
item_name = item_name_template.format(family, subset_name, asset_name)
|
||||
item_name = item_name_template.format(
|
||||
creator_label, subset_name, asset_name
|
||||
)
|
||||
item_name_widget = QtWidgets.QLabel(
|
||||
item_name.replace("\n", "<br>"), self
|
||||
)
|
||||
|
|
@ -96,9 +100,10 @@ class CreateErrorMessageBox(QtWidgets.QDialog):
|
|||
return line
|
||||
|
||||
|
||||
class FamilyDescriptionWidget(QtWidgets.QWidget):
|
||||
# TODO add creator identifier/label to details
|
||||
class CreatorDescriptionWidget(QtWidgets.QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super(FamilyDescriptionWidget, self).__init__(parent=parent)
|
||||
super(CreatorDescriptionWidget, self).__init__(parent=parent)
|
||||
|
||||
icon_widget = IconValuePixmapLabel(None, self)
|
||||
icon_widget.setObjectName("FamilyIconLabel")
|
||||
|
|
@ -195,11 +200,11 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
self._name_pattern = name_pattern
|
||||
self._compiled_name_pattern = re.compile(name_pattern)
|
||||
|
||||
creator_description_widget = FamilyDescriptionWidget(self)
|
||||
creator_description_widget = CreatorDescriptionWidget(self)
|
||||
|
||||
family_view = QtWidgets.QListView(self)
|
||||
family_model = QtGui.QStandardItemModel()
|
||||
family_view.setModel(family_model)
|
||||
creators_view = QtWidgets.QListView(self)
|
||||
creators_model = QtGui.QStandardItemModel()
|
||||
creators_view.setModel(creators_model)
|
||||
|
||||
variant_input = QtWidgets.QLineEdit(self)
|
||||
variant_input.setObjectName("VariantInput")
|
||||
|
|
@ -230,7 +235,7 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
|
||||
left_layout = QtWidgets.QVBoxLayout()
|
||||
left_layout.addWidget(QtWidgets.QLabel("Choose family:", self))
|
||||
left_layout.addWidget(family_view, 1)
|
||||
left_layout.addWidget(creators_view, 1)
|
||||
left_layout.addLayout(form_layout, 0)
|
||||
left_layout.addWidget(create_btn, 0)
|
||||
|
||||
|
|
@ -242,8 +247,8 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
create_btn.clicked.connect(self._on_create)
|
||||
variant_input.returnPressed.connect(self._on_create)
|
||||
variant_input.textChanged.connect(self._on_variant_change)
|
||||
family_view.selectionModel().currentChanged.connect(
|
||||
self._on_family_change
|
||||
creators_view.selectionModel().currentChanged.connect(
|
||||
self._on_item_change
|
||||
)
|
||||
variant_hints_menu.triggered.connect(self._on_variant_action)
|
||||
|
||||
|
|
@ -258,8 +263,8 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
self.variant_hints_menu = variant_hints_menu
|
||||
self.variant_hints_group = variant_hints_group
|
||||
|
||||
self.family_model = family_model
|
||||
self.family_view = family_view
|
||||
self.creators_model = creators_model
|
||||
self.creators_view = creators_view
|
||||
self.create_btn = create_btn
|
||||
|
||||
@property
|
||||
|
|
@ -280,11 +285,11 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
self.subset_name_input.setText("< Asset is not set >")
|
||||
self._prereq_available = False
|
||||
|
||||
if self.family_model.rowCount() < 1:
|
||||
if self.creators_model.rowCount() < 1:
|
||||
self._prereq_available = False
|
||||
|
||||
self.create_btn.setEnabled(self._prereq_available)
|
||||
self.family_view.setEnabled(self._prereq_available)
|
||||
self.creators_view.setEnabled(self._prereq_available)
|
||||
self.variant_input.setEnabled(self._prereq_available)
|
||||
self.variant_hints_btn.setEnabled(self._prereq_available)
|
||||
|
||||
|
|
@ -320,50 +325,57 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
def _refresh_creators(self):
|
||||
# Refresh creators and add their families to list
|
||||
existing_items = {}
|
||||
old_families = set()
|
||||
for row in range(self.family_model.rowCount()):
|
||||
item = self.family_model.item(row, 0)
|
||||
family = item.data(QtCore.Qt.DisplayRole)
|
||||
existing_items[family] = item
|
||||
old_families.add(family)
|
||||
old_creators = set()
|
||||
for row in range(self.creators_model.rowCount()):
|
||||
item = self.creators_model.item(row, 0)
|
||||
identifier = item.data(CREATOR_IDENTIFIER_ROLE)
|
||||
existing_items[identifier] = item
|
||||
old_creators.add(identifier)
|
||||
|
||||
# Add new families
|
||||
new_families = set()
|
||||
for family in self.controller.ui_creators.keys():
|
||||
new_creators = set()
|
||||
for identifier, creator in self.controller.ui_creators.items():
|
||||
# TODO add details about creator
|
||||
new_families.add(family)
|
||||
if family not in existing_items:
|
||||
item = QtGui.QStandardItem(family)
|
||||
new_creators.add(identifier)
|
||||
if identifier in existing_items:
|
||||
item = existing_items[identifier]
|
||||
else:
|
||||
item = QtGui.QStandardItem()
|
||||
item.setFlags(
|
||||
QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable
|
||||
)
|
||||
self.family_model.appendRow(item)
|
||||
self.creators_model.appendRow(item)
|
||||
|
||||
label = creator.label or identifier
|
||||
item.setData(label, QtCore.Qt.DisplayRole)
|
||||
item.setData(identifier, CREATOR_IDENTIFIER_ROLE)
|
||||
item.setData(creator.family, FAMILY_ROLE)
|
||||
|
||||
# Remove families that are no more available
|
||||
for family in (old_families - new_families):
|
||||
item = existing_items[family]
|
||||
self.family_model.takeRow(item.row())
|
||||
for identifier in (old_creators - new_creators):
|
||||
item = existing_items[identifier]
|
||||
self.creators_model.takeRow(item.row())
|
||||
|
||||
if self.family_model.rowCount() < 1:
|
||||
if self.creators_model.rowCount() < 1:
|
||||
return
|
||||
|
||||
# Make sure there is a selection
|
||||
indexes = self.family_view.selectedIndexes()
|
||||
indexes = self.creators_view.selectedIndexes()
|
||||
if not indexes:
|
||||
index = self.family_model.index(0, 0)
|
||||
self.family_view.setCurrentIndex(index)
|
||||
index = self.creators_model.index(0, 0)
|
||||
self.creators_view.setCurrentIndex(index)
|
||||
|
||||
def _on_plugins_refresh(self):
|
||||
# Trigger refresh only if is visible
|
||||
if self.isVisible():
|
||||
self.refresh()
|
||||
|
||||
def _on_family_change(self, new_index, _old_index):
|
||||
family = None
|
||||
def _on_item_change(self, new_index, _old_index):
|
||||
identifier = None
|
||||
if new_index.isValid():
|
||||
family = new_index.data(QtCore.Qt.DisplayRole)
|
||||
identifier = new_index.data(CREATOR_IDENTIFIER_ROLE)
|
||||
|
||||
creator = self.controller.ui_creators.get(family)
|
||||
creator = self.controller.ui_creators.get(identifier)
|
||||
|
||||
self.creator_description_widget.set_plugin(creator)
|
||||
|
||||
|
|
@ -495,7 +507,7 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
self.refresh()
|
||||
|
||||
def _on_create(self):
|
||||
indexes = self.family_view.selectedIndexes()
|
||||
indexes = self.creators_view.selectedIndexes()
|
||||
if not indexes or len(indexes) > 1:
|
||||
return
|
||||
|
||||
|
|
@ -503,7 +515,9 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
return
|
||||
|
||||
index = indexes[0]
|
||||
family = index.data(QtCore.Qt.DisplayRole)
|
||||
creator_label = index.data(QtCore.Qt.DisplayRole)
|
||||
creator_identifier = index.data(CREATOR_IDENTIFIER_ROLE)
|
||||
family = index.data(FAMILY_ROLE)
|
||||
subset_name = self.subset_name_input.text()
|
||||
variant = self.variant_input.text()
|
||||
asset_name = self._asset_name
|
||||
|
|
@ -520,7 +534,9 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
|
||||
error_info = None
|
||||
try:
|
||||
self.controller.create(family, subset_name, instance_data, options)
|
||||
self.controller.create(
|
||||
creator_identifier, subset_name, instance_data, options
|
||||
)
|
||||
|
||||
except CreatorError as exc:
|
||||
error_info = (str(exc), None)
|
||||
|
|
@ -534,7 +550,7 @@ class CreateDialog(QtWidgets.QDialog):
|
|||
|
||||
if error_info:
|
||||
box = CreateErrorMessageBox(
|
||||
family, subset_name, asset_name, *error_info
|
||||
creator_label, subset_name, asset_name, *error_info
|
||||
)
|
||||
box.show()
|
||||
# Store dialog so is not garbage collected before is shown
|
||||
|
|
|
|||
|
|
@ -169,11 +169,11 @@ class InstanceListGroupWidget(QtWidgets.QFrame):
|
|||
expand_changed = QtCore.Signal(str, bool)
|
||||
toggle_requested = QtCore.Signal(str, int)
|
||||
|
||||
def __init__(self, family, parent):
|
||||
def __init__(self, group_name, parent):
|
||||
super(InstanceListGroupWidget, self).__init__(parent)
|
||||
self.setObjectName("InstanceListGroupWidget")
|
||||
|
||||
self.family = family
|
||||
self.group_name = group_name
|
||||
self._expanded = False
|
||||
|
||||
expand_btn = QtWidgets.QToolButton(self)
|
||||
|
|
@ -181,7 +181,7 @@ class InstanceListGroupWidget(QtWidgets.QFrame):
|
|||
expand_btn.setArrowType(QtCore.Qt.RightArrow)
|
||||
expand_btn.setMaximumWidth(14)
|
||||
|
||||
subset_name_label = QtWidgets.QLabel(family, self)
|
||||
name_label = QtWidgets.QLabel(group_name, self)
|
||||
|
||||
toggle_checkbox = NiceCheckbox(parent=self)
|
||||
|
||||
|
|
@ -189,12 +189,12 @@ class InstanceListGroupWidget(QtWidgets.QFrame):
|
|||
layout.setContentsMargins(5, 0, 2, 0)
|
||||
layout.addWidget(expand_btn)
|
||||
layout.addWidget(
|
||||
subset_name_label, 1, QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter
|
||||
name_label, 1, QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter
|
||||
)
|
||||
layout.addWidget(toggle_checkbox, 0)
|
||||
|
||||
# self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||
subset_name_label.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||
name_label.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||
expand_btn.setAttribute(QtCore.Qt.WA_TranslucentBackground)
|
||||
|
||||
expand_btn.clicked.connect(self._on_expand_clicked)
|
||||
|
|
@ -204,7 +204,7 @@ class InstanceListGroupWidget(QtWidgets.QFrame):
|
|||
|
||||
self._expected_checkstate = None
|
||||
|
||||
self.subset_name_label = subset_name_label
|
||||
self.name_label = name_label
|
||||
self.expand_btn = expand_btn
|
||||
self.toggle_checkbox = toggle_checkbox
|
||||
|
||||
|
|
@ -220,10 +220,10 @@ class InstanceListGroupWidget(QtWidgets.QFrame):
|
|||
|
||||
def _on_checkbox_change(self, state):
|
||||
if not self._ignore_state_change:
|
||||
self.toggle_requested.emit(self.family, state)
|
||||
self.toggle_requested.emit(self.group_name, state)
|
||||
|
||||
def _on_expand_clicked(self):
|
||||
self.expand_changed.emit(self.family, not self._expanded)
|
||||
self.expand_changed.emit(self.group_name, not self._expanded)
|
||||
|
||||
def set_expanded(self, expanded):
|
||||
if self._expanded == expanded:
|
||||
|
|
@ -366,7 +366,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
self._group_items = {}
|
||||
self._group_widgets = {}
|
||||
self._widgets_by_id = {}
|
||||
self._family_by_instance_id = {}
|
||||
self._group_by_instance_id = {}
|
||||
self._context_item = None
|
||||
self._context_widget = None
|
||||
|
||||
|
|
@ -376,14 +376,14 @@ class InstanceListView(AbstractInstanceView):
|
|||
self.proxy_model = proxy_model
|
||||
|
||||
def _on_expand(self, index):
|
||||
family = index.data(SORT_VALUE_ROLE)
|
||||
group_widget = self._group_widgets.get(family)
|
||||
group_name = index.data(SORT_VALUE_ROLE)
|
||||
group_widget = self._group_widgets.get(group_name)
|
||||
if group_widget:
|
||||
group_widget.set_expanded(True)
|
||||
|
||||
def _on_collapse(self, index):
|
||||
family = index.data(SORT_VALUE_ROLE)
|
||||
group_widget = self._group_widgets.get(family)
|
||||
group_name = index.data(SORT_VALUE_ROLE)
|
||||
group_widget = self._group_widgets.get(group_name)
|
||||
if group_widget:
|
||||
group_widget.set_expanded(False)
|
||||
|
||||
|
|
@ -401,14 +401,14 @@ class InstanceListView(AbstractInstanceView):
|
|||
if widget is not None:
|
||||
widget.set_active(active)
|
||||
|
||||
def _update_family_checkstate(self, family):
|
||||
widget = self._group_widgets.get(family)
|
||||
def _update_group_checkstate(self, group_name):
|
||||
widget = self._group_widgets.get(group_name)
|
||||
if widget is None:
|
||||
return
|
||||
|
||||
activity = None
|
||||
for instance_id, _family in self._family_by_instance_id.items():
|
||||
if _family != family:
|
||||
for instance_id, _group_name in self._group_by_instance_id.items():
|
||||
if _group_name != group_name:
|
||||
continue
|
||||
|
||||
instance_widget = self._widgets_by_id.get(instance_id)
|
||||
|
|
@ -433,12 +433,12 @@ class InstanceListView(AbstractInstanceView):
|
|||
widget.set_checkstate(state)
|
||||
|
||||
def refresh(self):
|
||||
instances_by_family = collections.defaultdict(list)
|
||||
families = set()
|
||||
instances_by_group_name = collections.defaultdict(list)
|
||||
group_names = set()
|
||||
for instance in self.controller.instances:
|
||||
family = instance.data["family"]
|
||||
families.add(family)
|
||||
instances_by_family[family].append(instance)
|
||||
identifier = instance.creator_identifier
|
||||
group_names.add(identifier)
|
||||
instances_by_group_name[identifier].append(instance)
|
||||
|
||||
sort_at_the_end = False
|
||||
root_item = self.instance_model.invisibleRootItem()
|
||||
|
|
@ -463,15 +463,15 @@ class InstanceListView(AbstractInstanceView):
|
|||
self._context_item = context_item
|
||||
|
||||
new_group_items = []
|
||||
for family in families:
|
||||
if family in self._group_items:
|
||||
for group_name in group_names:
|
||||
if group_name in self._group_items:
|
||||
continue
|
||||
|
||||
group_item = QtGui.QStandardItem()
|
||||
group_item.setData(family, SORT_VALUE_ROLE)
|
||||
group_item.setData(group_name, SORT_VALUE_ROLE)
|
||||
group_item.setData(True, IS_GROUP_ROLE)
|
||||
group_item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
self._group_items[family] = group_item
|
||||
self._group_items[group_name] = group_item
|
||||
new_group_items.append(group_item)
|
||||
|
||||
if new_group_items:
|
||||
|
|
@ -483,24 +483,24 @@ class InstanceListView(AbstractInstanceView):
|
|||
group_item.row(), group_item.column()
|
||||
)
|
||||
proxy_index = self.proxy_model.mapFromSource(index)
|
||||
family = group_item.data(SORT_VALUE_ROLE)
|
||||
widget = InstanceListGroupWidget(family, self.instance_view)
|
||||
group_name = group_item.data(SORT_VALUE_ROLE)
|
||||
widget = InstanceListGroupWidget(group_name, self.instance_view)
|
||||
widget.expand_changed.connect(self._on_group_expand_request)
|
||||
widget.toggle_requested.connect(self._on_group_toggle_request)
|
||||
self._group_widgets[family] = widget
|
||||
self._group_widgets[group_name] = widget
|
||||
self.instance_view.setIndexWidget(proxy_index, widget)
|
||||
|
||||
for family in tuple(self._group_items.keys()):
|
||||
if family in families:
|
||||
for group_name in tuple(self._group_items.keys()):
|
||||
if group_name in group_names:
|
||||
continue
|
||||
|
||||
group_item = self._group_items.pop(family)
|
||||
group_item = self._group_items.pop(group_name)
|
||||
root_item.removeRow(group_item.row())
|
||||
widget = self._group_widgets.pop(family)
|
||||
widget = self._group_widgets.pop(group_name)
|
||||
widget.deleteLater()
|
||||
|
||||
expand_families = set()
|
||||
for family, group_item in self._group_items.items():
|
||||
expand_groups = set()
|
||||
for group_name, group_item in self._group_items.items():
|
||||
to_remove = set()
|
||||
existing_mapping = {}
|
||||
|
||||
|
|
@ -517,7 +517,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
new_items = []
|
||||
new_items_with_instance = []
|
||||
activity = None
|
||||
for instance in instances_by_family[family]:
|
||||
for instance in instances_by_group_name[group_name]:
|
||||
instance_id = instance.data["uuid"]
|
||||
if activity is None:
|
||||
activity = int(instance.data["active"])
|
||||
|
|
@ -526,7 +526,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
elif activity != instance.data["active"]:
|
||||
activity = -1
|
||||
|
||||
self._family_by_instance_id[instance_id] = family
|
||||
self._group_by_instance_id[instance_id] = group_name
|
||||
if instance_id in to_remove:
|
||||
to_remove.remove(instance_id)
|
||||
widget = self._widgets_by_id[instance_id]
|
||||
|
|
@ -545,7 +545,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
elif activity == 1:
|
||||
state = QtCore.Qt.Checked
|
||||
|
||||
widget = self._group_widgets[family]
|
||||
widget = self._group_widgets[group_name]
|
||||
widget.set_checkstate(state)
|
||||
|
||||
idx_to_remove = []
|
||||
|
|
@ -556,7 +556,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
group_item.removeRows(idx, 1)
|
||||
|
||||
for instance_id in to_remove:
|
||||
self._family_by_instance_id.pop(instance_id)
|
||||
self._group_by_instance_id.pop(instance_id)
|
||||
widget = self._widgets_by_id.pop(instance_id)
|
||||
widget.deleteLater()
|
||||
|
||||
|
|
@ -567,7 +567,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
|
||||
for item, instance in new_items_with_instance:
|
||||
if not instance.has_valid_context:
|
||||
expand_families.add(family)
|
||||
expand_groups.add(group_name)
|
||||
item_index = self.instance_model.index(
|
||||
item.row(),
|
||||
item.column(),
|
||||
|
|
@ -585,9 +585,9 @@ class InstanceListView(AbstractInstanceView):
|
|||
if sort_at_the_end:
|
||||
self.proxy_model.sort(0)
|
||||
|
||||
for family in expand_families:
|
||||
family_item = self._group_items[family]
|
||||
proxy_index = self.proxy_model.mapFromSource(family_item.index())
|
||||
for group_name in expand_groups:
|
||||
group_item = self._group_items[group_name]
|
||||
proxy_index = self.proxy_model.mapFromSource(group_item.index())
|
||||
|
||||
self.instance_view.expand(proxy_index)
|
||||
|
||||
|
|
@ -610,14 +610,14 @@ class InstanceListView(AbstractInstanceView):
|
|||
selected_ids.add(changed_instance_id)
|
||||
|
||||
self._change_active_instances(selected_ids, new_value)
|
||||
families = set()
|
||||
group_names = set()
|
||||
for instance_id in selected_ids:
|
||||
family = self._family_by_instance_id.get(instance_id)
|
||||
if family is not None:
|
||||
families.add(family)
|
||||
group_name = self._group_by_instance_id.get(instance_id)
|
||||
if group_name is not None:
|
||||
group_names.add(group_name)
|
||||
|
||||
for family in families:
|
||||
self._update_family_checkstate(family)
|
||||
for group_name in group_names:
|
||||
self._update_group_checkstate(group_name)
|
||||
|
||||
def _change_active_instances(self, instance_ids, new_value):
|
||||
if not instance_ids:
|
||||
|
|
@ -656,8 +656,8 @@ class InstanceListView(AbstractInstanceView):
|
|||
def _on_selection_change(self, *_args):
|
||||
self.selection_changed.emit()
|
||||
|
||||
def _on_group_expand_request(self, family, expanded):
|
||||
group_item = self._group_items.get(family)
|
||||
def _on_group_expand_request(self, group_name, expanded):
|
||||
group_item = self._group_items.get(group_name)
|
||||
if not group_item:
|
||||
return
|
||||
|
||||
|
|
@ -667,7 +667,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
proxy_index = self.proxy_model.mapFromSource(group_index)
|
||||
self.instance_view.setExpanded(proxy_index, expanded)
|
||||
|
||||
def _on_group_toggle_request(self, family, state):
|
||||
def _on_group_toggle_request(self, group_name, state):
|
||||
if state == QtCore.Qt.PartiallyChecked:
|
||||
return
|
||||
|
||||
|
|
@ -676,7 +676,7 @@ class InstanceListView(AbstractInstanceView):
|
|||
else:
|
||||
active = False
|
||||
|
||||
group_item = self._group_items.get(family)
|
||||
group_item = self._group_items.get(group_name)
|
||||
if not group_item:
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -1096,9 +1096,9 @@ class GlobalAttrsWidget(QtWidgets.QWidget):
|
|||
self.task_value_widget.setEnabled(editable)
|
||||
|
||||
|
||||
class FamilyAttrsWidget(QtWidgets.QWidget):
|
||||
class CreatorAttrsWidget(QtWidgets.QWidget):
|
||||
def __init__(self, controller, parent):
|
||||
super(FamilyAttrsWidget, self).__init__(parent)
|
||||
super(CreatorAttrsWidget, self).__init__(parent)
|
||||
|
||||
scroll_area = QtWidgets.QScrollArea(self)
|
||||
scroll_area.setWidgetResizable(True)
|
||||
|
|
@ -1137,7 +1137,7 @@ class FamilyAttrsWidget(QtWidgets.QWidget):
|
|||
self._attr_def_id_to_instances = {}
|
||||
self._attr_def_id_to_attr_def = {}
|
||||
|
||||
result = self.controller.get_family_attribute_definitions(
|
||||
result = self.controller.get_creator_attribute_definitions(
|
||||
instances
|
||||
)
|
||||
|
||||
|
|
@ -1169,9 +1169,9 @@ class FamilyAttrsWidget(QtWidgets.QWidget):
|
|||
return
|
||||
|
||||
for instance in instances:
|
||||
family_attributes = instance.data["family_attributes"]
|
||||
if attr_def.key in family_attributes:
|
||||
family_attributes[attr_def.key] = value
|
||||
creator_attributes = instance.data["creator_attributes"]
|
||||
if attr_def.key in creator_attributes:
|
||||
creator_attributes[attr_def.key] = value
|
||||
|
||||
|
||||
class PublishPluginAttrsWidget(QtWidgets.QWidget):
|
||||
|
|
@ -1301,7 +1301,7 @@ class SubsetAttributesWidget(QtWidgets.QWidget):
|
|||
|
||||
# BOTTOM PART
|
||||
bottom_widget = QtWidgets.QWidget(self)
|
||||
family_attrs_widget = FamilyAttrsWidget(
|
||||
creator_attrs_widget = CreatorAttrsWidget(
|
||||
controller, bottom_widget
|
||||
)
|
||||
publish_attrs_widget = PublishPluginAttrsWidget(
|
||||
|
|
@ -1314,7 +1314,7 @@ class SubsetAttributesWidget(QtWidgets.QWidget):
|
|||
|
||||
bottom_layout = QtWidgets.QHBoxLayout(bottom_widget)
|
||||
bottom_layout.setContentsMargins(0, 0, 0, 0)
|
||||
bottom_layout.addWidget(family_attrs_widget, 1)
|
||||
bottom_layout.addWidget(creator_attrs_widget, 1)
|
||||
bottom_layout.addWidget(bottom_separator, 0)
|
||||
bottom_layout.addWidget(publish_attrs_widget, 1)
|
||||
|
||||
|
|
@ -1339,7 +1339,7 @@ class SubsetAttributesWidget(QtWidgets.QWidget):
|
|||
|
||||
self.global_attrs_widget = global_attrs_widget
|
||||
|
||||
self.family_attrs_widget = family_attrs_widget
|
||||
self.creator_attrs_widget = creator_attrs_widget
|
||||
self.publish_attrs_widget = publish_attrs_widget
|
||||
self.thumbnail_widget = thumbnail_widget
|
||||
|
||||
|
|
@ -1354,7 +1354,7 @@ class SubsetAttributesWidget(QtWidgets.QWidget):
|
|||
break
|
||||
|
||||
self._all_instances_valid = all_valid
|
||||
self.family_attrs_widget.set_instances_valid(all_valid)
|
||||
self.creator_attrs_widget.set_instances_valid(all_valid)
|
||||
self.publish_attrs_widget.set_instances_valid(all_valid)
|
||||
|
||||
self.instance_context_changed.emit()
|
||||
|
|
@ -1371,11 +1371,11 @@ class SubsetAttributesWidget(QtWidgets.QWidget):
|
|||
self._all_instances_valid = all_valid
|
||||
|
||||
self.global_attrs_widget.set_current_instances(instances)
|
||||
self.family_attrs_widget.set_current_instances(instances)
|
||||
self.creator_attrs_widget.set_current_instances(instances)
|
||||
self.publish_attrs_widget.set_current_instances(
|
||||
instances, context_selected
|
||||
)
|
||||
self.family_attrs_widget.set_instances_valid(all_valid)
|
||||
self.creator_attrs_widget.set_instances_valid(all_valid)
|
||||
self.publish_attrs_widget.set_instances_valid(all_valid)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue