mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
don't add hidden widgets to publisher widgets
This commit is contained in:
parent
068ec3f898
commit
a606de5b76
1 changed files with 19 additions and 7 deletions
|
|
@ -9,6 +9,7 @@ import collections
|
|||
from Qt import QtWidgets, QtCore, QtGui
|
||||
import qtawesome
|
||||
|
||||
from openpype.lib.attribute_definitions import UnknownDef
|
||||
from openpype.tools.attribute_defs import create_widget_for_attr_def
|
||||
from openpype.tools import resources
|
||||
from openpype.tools.flickcharm import FlickCharm
|
||||
|
|
@ -1303,6 +1304,13 @@ class CreatorAttrsWidget(QtWidgets.QWidget):
|
|||
else:
|
||||
widget.set_value(values, True)
|
||||
|
||||
widget.value_changed.connect(self._input_value_changed)
|
||||
self._attr_def_id_to_instances[attr_def.id] = attr_instances
|
||||
self._attr_def_id_to_attr_def[attr_def.id] = attr_def
|
||||
|
||||
if attr_def.hidden:
|
||||
continue
|
||||
|
||||
expand_cols = 2
|
||||
if attr_def.is_value_def and attr_def.is_label_horizontal:
|
||||
expand_cols = 1
|
||||
|
|
@ -1321,13 +1329,8 @@ class CreatorAttrsWidget(QtWidgets.QWidget):
|
|||
content_layout.addWidget(
|
||||
widget, row, col_num, 1, expand_cols
|
||||
)
|
||||
|
||||
row += 1
|
||||
|
||||
widget.value_changed.connect(self._input_value_changed)
|
||||
self._attr_def_id_to_instances[attr_def.id] = attr_instances
|
||||
self._attr_def_id_to_attr_def[attr_def.id] = attr_def
|
||||
|
||||
self._scroll_area.setWidget(content_widget)
|
||||
self._content_widget = content_widget
|
||||
|
||||
|
|
@ -1421,8 +1424,17 @@ class PublishPluginAttrsWidget(QtWidgets.QWidget):
|
|||
widget = create_widget_for_attr_def(
|
||||
attr_def, content_widget
|
||||
)
|
||||
label = attr_def.label or attr_def.key
|
||||
content_layout.addRow(label, widget)
|
||||
hidden_widget = attr_def.hidden
|
||||
# Hide unknown values of publish plugins
|
||||
# - The keys in most of cases does not represent what would
|
||||
# label represent
|
||||
if isinstance(attr_def, UnknownDef):
|
||||
widget.setVisible(False)
|
||||
hidden_widget = True
|
||||
|
||||
if not hidden_widget:
|
||||
label = attr_def.label or attr_def.key
|
||||
content_layout.addRow(label, widget)
|
||||
|
||||
widget.value_changed.connect(self._input_value_changed)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue