mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
[Automated] Merged develop into main
This commit is contained in:
commit
d1685dbf4e
19 changed files with 221 additions and 52 deletions
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -35,6 +35,10 @@ body:
|
|||
label: Version
|
||||
description: What version are you running? Look to OpenPype Tray
|
||||
options:
|
||||
- 3.15.5
|
||||
- 3.15.5-nightly.2
|
||||
- 3.15.5-nightly.1
|
||||
- 3.15.4
|
||||
- 3.15.4-nightly.3
|
||||
- 3.15.4-nightly.2
|
||||
- 3.15.4-nightly.1
|
||||
|
|
@ -131,10 +135,6 @@ body:
|
|||
- 3.13.1-nightly.2
|
||||
- 3.13.1-nightly.1
|
||||
- 3.13.0
|
||||
- 3.13.0-nightly.1
|
||||
- 3.12.3-nightly.3
|
||||
- 3.12.3-nightly.2
|
||||
- 3.12.3-nightly.1
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
|
|
@ -166,8 +166,8 @@ body:
|
|||
label: Are there any labels you wish to add?
|
||||
description: Please search labels and identify those related to your bug.
|
||||
options:
|
||||
- label: I have added the relevant labels to the bug report.
|
||||
required: true
|
||||
- label: I have added the relevant labels to the bug report.
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
|
|
|
|||
2
.github/workflows/update_bug_report.yml
vendored
2
.github/workflows/update_bug_report.yml
vendored
|
|
@ -18,6 +18,8 @@ jobs:
|
|||
uses: ynput/gha-populate-form-version@main
|
||||
with:
|
||||
github_token: ${{ secrets.YNPUT_BOT_TOKEN }}
|
||||
github_user: ${{ secrets.CI_USER }}
|
||||
github_email: ${{ secrets.CI_EMAIL }}
|
||||
registry: github
|
||||
dropdown: _version
|
||||
limit_to: 100
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import os
|
||||
|
||||
import qtawesome
|
||||
|
||||
from openpype.hosts.fusion.api import (
|
||||
get_current_comp,
|
||||
comp_lock_and_undo_chunk,
|
||||
|
|
@ -28,6 +26,7 @@ class CreateSaver(Creator):
|
|||
family = "render"
|
||||
default_variants = ["Main", "Mask"]
|
||||
description = "Fusion Saver to generate image sequence"
|
||||
icon = "fa5.eye"
|
||||
|
||||
instance_attributes = ["reviewable"]
|
||||
|
||||
|
|
@ -89,9 +88,6 @@ class CreateSaver(Creator):
|
|||
|
||||
self._add_instance_to_context(created_instance)
|
||||
|
||||
def get_icon(self):
|
||||
return qtawesome.icon("fa.eye", color="white")
|
||||
|
||||
def update_instances(self, update_list):
|
||||
for created_inst, _changes in update_list:
|
||||
new_data = created_inst.data_to_store()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import qtawesome
|
||||
|
||||
from openpype.hosts.fusion.api import (
|
||||
get_current_comp
|
||||
)
|
||||
|
|
@ -15,6 +13,7 @@ class FusionWorkfileCreator(AutoCreator):
|
|||
identifier = "workfile"
|
||||
family = "workfile"
|
||||
label = "Workfile"
|
||||
icon = "fa5.file"
|
||||
|
||||
default_variant = "Main"
|
||||
|
||||
|
|
@ -104,6 +103,3 @@ class FusionWorkfileCreator(AutoCreator):
|
|||
existing_instance["asset"] = asset_name
|
||||
existing_instance["task"] = task_name
|
||||
existing_instance["subset"] = subset_name
|
||||
|
||||
def get_icon(self):
|
||||
return qtawesome.icon("fa.file-o", color="white")
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class PublishValidationError(Exception):
|
|||
|
||||
def __init__(self, message, title=None, description=None, detail=None):
|
||||
self.message = message
|
||||
self.title = title or "< Missing title >"
|
||||
self.title = title
|
||||
self.description = description or message
|
||||
self.detail = detail
|
||||
super(PublishValidationError, self).__init__(message)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
"bg-view-selection-hover": "rgba(92, 173, 214, .8)",
|
||||
|
||||
"border": "#373D48",
|
||||
"border-hover": "rgba(168, 175, 189, .3)",
|
||||
"border-hover": "rgb(92, 99, 111)",
|
||||
"border-focus": "rgb(92, 173, 214)",
|
||||
|
||||
"restart-btn-bg": "#458056",
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@ QWidget:disabled {
|
|||
color: {color:font-disabled};
|
||||
}
|
||||
|
||||
/* Some DCCs have set borders to solid color */
|
||||
QScrollArea {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
background: transparent;
|
||||
}
|
||||
|
|
@ -42,7 +47,7 @@ QLabel {
|
|||
/* Inputs */
|
||||
QAbstractSpinBox, QLineEdit, QPlainTextEdit, QTextEdit {
|
||||
border: 1px solid {color:border};
|
||||
border-radius: 0.3em;
|
||||
border-radius: 0.2em;
|
||||
background: {color:bg-inputs};
|
||||
padding: 0.1em;
|
||||
}
|
||||
|
|
@ -226,7 +231,7 @@ QMenu::separator {
|
|||
/* Combobox */
|
||||
QComboBox {
|
||||
border: 1px solid {color:border};
|
||||
border-radius: 3px;
|
||||
border-radius: 0.2em;
|
||||
padding: 1px 3px 1px 3px;
|
||||
background: {color:bg-inputs};
|
||||
}
|
||||
|
|
@ -474,7 +479,6 @@ QAbstractItemView:disabled{
|
|||
}
|
||||
|
||||
QAbstractItemView::item:hover {
|
||||
/* color: {color:bg-view-hover}; */
|
||||
background: {color:bg-view-hover};
|
||||
}
|
||||
|
||||
|
|
@ -743,7 +747,7 @@ OverlayMessageWidget QWidget {
|
|||
|
||||
#TypeEditor, #ToolEditor, #NameEditor, #NumberEditor {
|
||||
background: transparent;
|
||||
border-radius: 0.3em;
|
||||
border-radius: 0.2em;
|
||||
}
|
||||
|
||||
#TypeEditor:focus, #ToolEditor:focus, #NameEditor:focus, #NumberEditor:focus {
|
||||
|
|
@ -860,7 +864,13 @@ OverlayMessageWidget QWidget {
|
|||
background: {color:bg-view-hover};
|
||||
}
|
||||
|
||||
/* New Create/Publish UI */
|
||||
/* Publisher UI (Create/Publish) */
|
||||
#PublishWindow QAbstractSpinBox, QLineEdit, QPlainTextEdit, QTextEdit {
|
||||
padding: 1px;
|
||||
}
|
||||
#PublishWindow QComboBox {
|
||||
padding: 1px 1px 1px 0.2em;
|
||||
}
|
||||
PublisherTabsWidget {
|
||||
background: {color:publisher:tab-bg};
|
||||
}
|
||||
|
|
@ -944,6 +954,7 @@ PixmapButton:disabled {
|
|||
border-top-left-radius: 0px;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
width: 0.5em;
|
||||
}
|
||||
#VariantInput[state="new"], #VariantInput[state="new"]:focus, #VariantInput[state="new"]:hover {
|
||||
border-color: {color:publisher:success};
|
||||
|
|
@ -1072,7 +1083,7 @@ ValidationArtistMessage QLabel {
|
|||
#AssetNameInputWidget {
|
||||
background: {color:bg-inputs};
|
||||
border: 1px solid {color:border};
|
||||
border-radius: 0.3em;
|
||||
border-radius: 0.2em;
|
||||
}
|
||||
|
||||
#AssetNameInputWidget QWidget {
|
||||
|
|
@ -1465,6 +1476,12 @@ CreateNextPageOverlay {
|
|||
}
|
||||
|
||||
/* Attribute Definition widgets */
|
||||
AttributeDefinitionsWidget QAbstractSpinBox, QLineEdit, QPlainTextEdit, QTextEdit {
|
||||
padding: 1px;
|
||||
}
|
||||
AttributeDefinitionsWidget QComboBox {
|
||||
padding: 1px 1px 1px 0.2em;
|
||||
}
|
||||
InViewButton, InViewButton:disabled {
|
||||
background: transparent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import uuid
|
||||
import copy
|
||||
|
||||
from qtpy import QtWidgets, QtCore
|
||||
|
|
@ -126,7 +125,7 @@ class AttributeDefinitionsWidget(QtWidgets.QWidget):
|
|||
|
||||
row = 0
|
||||
for attr_def in attr_defs:
|
||||
if not isinstance(attr_def, UIDef):
|
||||
if attr_def.is_value_def:
|
||||
if attr_def.key in self._current_keys:
|
||||
raise KeyError(
|
||||
"Duplicated key \"{}\"".format(attr_def.key))
|
||||
|
|
@ -144,11 +143,16 @@ class AttributeDefinitionsWidget(QtWidgets.QWidget):
|
|||
|
||||
col_num = 2 - expand_cols
|
||||
|
||||
if attr_def.label:
|
||||
if attr_def.is_value_def and attr_def.label:
|
||||
label_widget = QtWidgets.QLabel(attr_def.label, self)
|
||||
tooltip = attr_def.tooltip
|
||||
if tooltip:
|
||||
label_widget.setToolTip(tooltip)
|
||||
if attr_def.is_label_horizontal:
|
||||
label_widget.setAlignment(
|
||||
QtCore.Qt.AlignRight
|
||||
| QtCore.Qt.AlignVCenter
|
||||
)
|
||||
layout.addWidget(
|
||||
label_widget, row, 0, 1, expand_cols
|
||||
)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class BaseRepresentationModel(object):
|
|||
self.remote_provider = remote_provider
|
||||
|
||||
|
||||
class SubsetsModel(TreeModel, BaseRepresentationModel):
|
||||
class SubsetsModel(BaseRepresentationModel, TreeModel):
|
||||
doc_fetched = QtCore.Signal()
|
||||
refreshed = QtCore.Signal(bool)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from qtpy import QtCore, QtGui
|
|||
|
||||
# ID of context item in instance view
|
||||
CONTEXT_ID = "context"
|
||||
CONTEXT_LABEL = "Options"
|
||||
CONTEXT_LABEL = "Context"
|
||||
# Not showed anywhere - used as identifier
|
||||
CONTEXT_GROUP = "__ContextGroup__"
|
||||
|
||||
|
|
@ -15,6 +15,9 @@ VARIANT_TOOLTIP = (
|
|||
"\nnumerical characters (0-9) dot (\".\") or underscore (\"_\")."
|
||||
)
|
||||
|
||||
INPUTS_LAYOUT_HSPACING = 4
|
||||
INPUTS_LAYOUT_VSPACING = 2
|
||||
|
||||
# Roles for instance views
|
||||
INSTANCE_ID_ROLE = QtCore.Qt.UserRole + 1
|
||||
SORT_VALUE_ROLE = QtCore.Qt.UserRole + 2
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class AssetDocsCache:
|
|||
return copy.deepcopy(self._full_asset_docs_by_name[asset_name])
|
||||
|
||||
|
||||
class PublishReport:
|
||||
class PublishReportMaker:
|
||||
"""Report for single publishing process.
|
||||
|
||||
Report keeps current state of publishing and currently processed plugin.
|
||||
|
|
@ -784,6 +784,13 @@ class PublishValidationErrors:
|
|||
|
||||
# Make sure the cached report is cleared
|
||||
plugin_id = self._plugins_proxy.get_plugin_id(plugin)
|
||||
if not error.title:
|
||||
if hasattr(plugin, "label") and plugin.label:
|
||||
plugin_label = plugin.label
|
||||
else:
|
||||
plugin_label = plugin.__name__
|
||||
error.title = plugin_label
|
||||
|
||||
self._error_items.append(
|
||||
ValidationErrorItem.from_result(plugin_id, error, instance)
|
||||
)
|
||||
|
|
@ -1674,7 +1681,7 @@ class PublisherController(BasePublisherController):
|
|||
# pyblish.api.Context
|
||||
self._publish_context = None
|
||||
# Pyblish report
|
||||
self._publish_report = PublishReport(self)
|
||||
self._publish_report = PublishReportMaker(self)
|
||||
# Store exceptions of validation error
|
||||
self._publish_validation_errors = PublishValidationErrors()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Only one item can be selected at a time.
|
|||
```
|
||||
<i> : Icon. Can have Warning icon when context is not right
|
||||
┌──────────────────────┐
|
||||
│ Options │
|
||||
│ Context │
|
||||
│ <Group 1> ────────── │
|
||||
│ <i> <Instance 1> [x]│
|
||||
│ <i> <Instance 2> [x]│
|
||||
|
|
@ -202,7 +202,7 @@ class ConvertorItemsGroupWidget(BaseGroupWidget):
|
|||
class InstanceGroupWidget(BaseGroupWidget):
|
||||
"""Widget wrapping instances under group."""
|
||||
|
||||
active_changed = QtCore.Signal()
|
||||
active_changed = QtCore.Signal(str, str, bool)
|
||||
|
||||
def __init__(self, group_icons, *args, **kwargs):
|
||||
super(InstanceGroupWidget, self).__init__(*args, **kwargs)
|
||||
|
|
@ -253,13 +253,16 @@ class InstanceGroupWidget(BaseGroupWidget):
|
|||
instance, group_icon, self
|
||||
)
|
||||
widget.selected.connect(self._on_widget_selection)
|
||||
widget.active_changed.connect(self.active_changed)
|
||||
widget.active_changed.connect(self._on_active_changed)
|
||||
self._widgets_by_id[instance.id] = widget
|
||||
self._content_layout.insertWidget(widget_idx, widget)
|
||||
widget_idx += 1
|
||||
|
||||
self._update_ordered_item_ids()
|
||||
|
||||
def _on_active_changed(self, instance_id, value):
|
||||
self.active_changed.emit(self.group_name, instance_id, value)
|
||||
|
||||
|
||||
class CardWidget(BaseClickableFrame):
|
||||
"""Clickable card used as bigger button."""
|
||||
|
|
@ -332,7 +335,7 @@ class ContextCardWidget(CardWidget):
|
|||
icon_layout.addWidget(icon_widget)
|
||||
|
||||
layout = QtWidgets.QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 5, 10, 5)
|
||||
layout.setContentsMargins(0, 2, 10, 2)
|
||||
layout.addLayout(icon_layout, 0)
|
||||
layout.addWidget(label_widget, 1)
|
||||
|
||||
|
|
@ -363,7 +366,7 @@ class ConvertorItemCardWidget(CardWidget):
|
|||
icon_layout.addWidget(icon_widget)
|
||||
|
||||
layout = QtWidgets.QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 5, 10, 5)
|
||||
layout.setContentsMargins(0, 2, 10, 2)
|
||||
layout.addLayout(icon_layout, 0)
|
||||
layout.addWidget(label_widget, 1)
|
||||
|
||||
|
|
@ -377,7 +380,7 @@ class ConvertorItemCardWidget(CardWidget):
|
|||
class InstanceCardWidget(CardWidget):
|
||||
"""Card widget representing instance."""
|
||||
|
||||
active_changed = QtCore.Signal()
|
||||
active_changed = QtCore.Signal(str, bool)
|
||||
|
||||
def __init__(self, instance, group_icon, parent):
|
||||
super(InstanceCardWidget, self).__init__(parent)
|
||||
|
|
@ -424,7 +427,7 @@ class InstanceCardWidget(CardWidget):
|
|||
top_layout.addWidget(expand_btn, 0)
|
||||
|
||||
layout = QtWidgets.QHBoxLayout(self)
|
||||
layout.setContentsMargins(0, 5, 10, 5)
|
||||
layout.setContentsMargins(0, 2, 10, 2)
|
||||
layout.addLayout(top_layout)
|
||||
layout.addWidget(detail_widget)
|
||||
|
||||
|
|
@ -445,6 +448,10 @@ class InstanceCardWidget(CardWidget):
|
|||
def set_active_toggle_enabled(self, enabled):
|
||||
self._active_checkbox.setEnabled(enabled)
|
||||
|
||||
@property
|
||||
def is_active(self):
|
||||
return self._active_checkbox.isChecked()
|
||||
|
||||
def set_active(self, new_value):
|
||||
"""Set instance as active."""
|
||||
checkbox_value = self._active_checkbox.isChecked()
|
||||
|
|
@ -515,7 +522,7 @@ class InstanceCardWidget(CardWidget):
|
|||
return
|
||||
|
||||
self.instance["active"] = new_value
|
||||
self.active_changed.emit()
|
||||
self.active_changed.emit(self._id, new_value)
|
||||
|
||||
def _on_expend_clicked(self):
|
||||
self._set_expanded()
|
||||
|
|
@ -584,6 +591,45 @@ class InstanceCardView(AbstractInstanceView):
|
|||
result.setWidth(width)
|
||||
return result
|
||||
|
||||
def _toggle_instances(self, value):
|
||||
if not self._active_toggle_enabled:
|
||||
return
|
||||
|
||||
widgets = self._get_selected_widgets()
|
||||
changed = False
|
||||
for widget in widgets:
|
||||
if not isinstance(widget, InstanceCardWidget):
|
||||
continue
|
||||
|
||||
is_active = widget.is_active
|
||||
if value == -1:
|
||||
widget.set_active(not is_active)
|
||||
changed = True
|
||||
continue
|
||||
|
||||
_value = bool(value)
|
||||
if is_active is not _value:
|
||||
widget.set_active(_value)
|
||||
changed = True
|
||||
|
||||
if changed:
|
||||
self.active_changed.emit()
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if event.key() == QtCore.Qt.Key_Space:
|
||||
self._toggle_instances(-1)
|
||||
return True
|
||||
|
||||
elif event.key() == QtCore.Qt.Key_Backspace:
|
||||
self._toggle_instances(0)
|
||||
return True
|
||||
|
||||
elif event.key() == QtCore.Qt.Key_Return:
|
||||
self._toggle_instances(1)
|
||||
return True
|
||||
|
||||
return super(InstanceCardView, self).keyPressEvent(event)
|
||||
|
||||
def _get_selected_widgets(self):
|
||||
output = []
|
||||
if (
|
||||
|
|
@ -742,7 +788,15 @@ class InstanceCardView(AbstractInstanceView):
|
|||
for widget in self._widgets_by_group.values():
|
||||
widget.update_instance_values()
|
||||
|
||||
def _on_active_changed(self):
|
||||
def _on_active_changed(self, group_name, instance_id, value):
|
||||
group_widget = self._widgets_by_group[group_name]
|
||||
instance_widget = group_widget.get_widget_by_item_id(instance_id)
|
||||
if instance_widget.is_selected:
|
||||
for widget in self._get_selected_widgets():
|
||||
if isinstance(widget, InstanceCardWidget):
|
||||
widget.set_active(value)
|
||||
else:
|
||||
self._select_item_clear(instance_id, group_name, instance_widget)
|
||||
self.active_changed.emit()
|
||||
|
||||
def _on_widget_selection(self, instance_id, group_name, selection_type):
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ from ..constants import (
|
|||
CREATOR_IDENTIFIER_ROLE,
|
||||
CREATOR_THUMBNAIL_ENABLED_ROLE,
|
||||
CREATOR_SORT_ROLE,
|
||||
INPUTS_LAYOUT_HSPACING,
|
||||
INPUTS_LAYOUT_VSPACING,
|
||||
)
|
||||
|
||||
SEPARATORS = ("---separator---", "---")
|
||||
|
|
@ -198,6 +200,8 @@ class CreateWidget(QtWidgets.QWidget):
|
|||
|
||||
variant_subset_layout = QtWidgets.QFormLayout(variant_subset_widget)
|
||||
variant_subset_layout.setContentsMargins(0, 0, 0, 0)
|
||||
variant_subset_layout.setHorizontalSpacing(INPUTS_LAYOUT_HSPACING)
|
||||
variant_subset_layout.setVerticalSpacing(INPUTS_LAYOUT_VSPACING)
|
||||
variant_subset_layout.addRow("Variant", variant_widget)
|
||||
variant_subset_layout.addRow("Subset", subset_name_input)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ selection can be enabled disabled using checkbox or keyboard key presses:
|
|||
- Backspace - disable selection
|
||||
|
||||
```
|
||||
|- Options
|
||||
|- Context
|
||||
|- <Group 1> [x]
|
||||
| |- <Instance 1> [x]
|
||||
| |- <Instance 2> [x]
|
||||
|
|
@ -486,6 +486,9 @@ class InstanceListView(AbstractInstanceView):
|
|||
group_widget.set_expanded(expanded)
|
||||
|
||||
def _on_toggle_request(self, toggle):
|
||||
if not self._active_toggle_enabled:
|
||||
return
|
||||
|
||||
selected_instance_ids = self._instance_view.get_selected_instance_ids()
|
||||
if toggle == -1:
|
||||
active = None
|
||||
|
|
@ -1039,7 +1042,8 @@ class InstanceListView(AbstractInstanceView):
|
|||
proxy_index = proxy_model.mapFromSource(select_indexes[0])
|
||||
selection_model.setCurrentIndex(
|
||||
proxy_index,
|
||||
selection_model.ClearAndSelect | selection_model.Rows
|
||||
QtCore.QItemSelectionModel.ClearAndSelect
|
||||
| QtCore.QItemSelectionModel.Rows
|
||||
)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ from qtpy import QtWidgets, QtCore
|
|||
|
||||
from openpype.tools.attribute_defs import create_widget_for_attr_def
|
||||
|
||||
from ..constants import INPUTS_LAYOUT_HSPACING, INPUTS_LAYOUT_VSPACING
|
||||
|
||||
|
||||
class PreCreateWidget(QtWidgets.QWidget):
|
||||
def __init__(self, parent):
|
||||
|
|
@ -81,6 +83,8 @@ class AttributesWidget(QtWidgets.QWidget):
|
|||
|
||||
layout = QtWidgets.QGridLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setHorizontalSpacing(INPUTS_LAYOUT_HSPACING)
|
||||
layout.setVerticalSpacing(INPUTS_LAYOUT_VSPACING)
|
||||
|
||||
self._layout = layout
|
||||
|
||||
|
|
@ -117,8 +121,16 @@ class AttributesWidget(QtWidgets.QWidget):
|
|||
|
||||
col_num = 2 - expand_cols
|
||||
|
||||
if attr_def.label:
|
||||
if attr_def.is_value_def and attr_def.label:
|
||||
label_widget = QtWidgets.QLabel(attr_def.label, self)
|
||||
tooltip = attr_def.tooltip
|
||||
if tooltip:
|
||||
label_widget.setToolTip(tooltip)
|
||||
if attr_def.is_label_horizontal:
|
||||
label_widget.setAlignment(
|
||||
QtCore.Qt.AlignRight
|
||||
| QtCore.Qt.AlignVCenter
|
||||
)
|
||||
self._layout.addWidget(
|
||||
label_widget, row, 0, 1, expand_cols
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import collections
|
|||
from qtpy import QtWidgets, QtCore, QtGui
|
||||
import qtawesome
|
||||
|
||||
from openpype.lib.attribute_definitions import UnknownDef, UIDef
|
||||
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
|
||||
|
|
@ -36,6 +36,8 @@ from .icons import (
|
|||
from ..constants import (
|
||||
VARIANT_TOOLTIP,
|
||||
ResetKeySequence,
|
||||
INPUTS_LAYOUT_HSPACING,
|
||||
INPUTS_LAYOUT_VSPACING,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1098,6 +1100,8 @@ class GlobalAttrsWidget(QtWidgets.QWidget):
|
|||
btns_layout.addWidget(cancel_btn)
|
||||
|
||||
main_layout = QtWidgets.QFormLayout(self)
|
||||
main_layout.setHorizontalSpacing(INPUTS_LAYOUT_HSPACING)
|
||||
main_layout.setVerticalSpacing(INPUTS_LAYOUT_VSPACING)
|
||||
main_layout.addRow("Variant", variant_input)
|
||||
main_layout.addRow("Asset", asset_value_widget)
|
||||
main_layout.addRow("Task", task_value_widget)
|
||||
|
|
@ -1346,6 +1350,8 @@ class CreatorAttrsWidget(QtWidgets.QWidget):
|
|||
content_layout.setColumnStretch(0, 0)
|
||||
content_layout.setColumnStretch(1, 1)
|
||||
content_layout.setAlignment(QtCore.Qt.AlignTop)
|
||||
content_layout.setHorizontalSpacing(INPUTS_LAYOUT_HSPACING)
|
||||
content_layout.setVerticalSpacing(INPUTS_LAYOUT_VSPACING)
|
||||
|
||||
row = 0
|
||||
for attr_def, attr_instances, values in result:
|
||||
|
|
@ -1371,9 +1377,19 @@ class CreatorAttrsWidget(QtWidgets.QWidget):
|
|||
|
||||
col_num = 2 - expand_cols
|
||||
|
||||
label = attr_def.label or attr_def.key
|
||||
label = None
|
||||
if attr_def.is_value_def:
|
||||
label = attr_def.label or attr_def.key
|
||||
if label:
|
||||
label_widget = QtWidgets.QLabel(label, self)
|
||||
tooltip = attr_def.tooltip
|
||||
if tooltip:
|
||||
label_widget.setToolTip(tooltip)
|
||||
if attr_def.is_label_horizontal:
|
||||
label_widget.setAlignment(
|
||||
QtCore.Qt.AlignRight
|
||||
| QtCore.Qt.AlignVCenter
|
||||
)
|
||||
content_layout.addWidget(
|
||||
label_widget, row, 0, 1, expand_cols
|
||||
)
|
||||
|
|
@ -1474,6 +1490,8 @@ class PublishPluginAttrsWidget(QtWidgets.QWidget):
|
|||
attr_def_layout = QtWidgets.QGridLayout(attr_def_widget)
|
||||
attr_def_layout.setColumnStretch(0, 0)
|
||||
attr_def_layout.setColumnStretch(1, 1)
|
||||
attr_def_layout.setHorizontalSpacing(INPUTS_LAYOUT_HSPACING)
|
||||
attr_def_layout.setVerticalSpacing(INPUTS_LAYOUT_VSPACING)
|
||||
|
||||
content_layout = QtWidgets.QVBoxLayout(content_widget)
|
||||
content_layout.addWidget(attr_def_widget, 0)
|
||||
|
|
@ -1501,12 +1519,19 @@ class PublishPluginAttrsWidget(QtWidgets.QWidget):
|
|||
expand_cols = 1
|
||||
|
||||
col_num = 2 - expand_cols
|
||||
label = attr_def.label or attr_def.key
|
||||
label = None
|
||||
if attr_def.is_value_def:
|
||||
label = attr_def.label or attr_def.key
|
||||
if label:
|
||||
label_widget = QtWidgets.QLabel(label, content_widget)
|
||||
tooltip = attr_def.tooltip
|
||||
if tooltip:
|
||||
label_widget.setToolTip(tooltip)
|
||||
if attr_def.is_label_horizontal:
|
||||
label_widget.setAlignment(
|
||||
QtCore.Qt.AlignRight
|
||||
| QtCore.Qt.AlignVCenter
|
||||
)
|
||||
attr_def_layout.addWidget(
|
||||
label_widget, row, 0, 1, expand_cols
|
||||
)
|
||||
|
|
@ -1517,7 +1542,7 @@ class PublishPluginAttrsWidget(QtWidgets.QWidget):
|
|||
)
|
||||
row += 1
|
||||
|
||||
if isinstance(attr_def, UIDef):
|
||||
if not attr_def.is_value_def:
|
||||
continue
|
||||
|
||||
widget.value_changed.connect(self._input_value_changed)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
def __init__(self, parent=None, controller=None, reset_on_show=None):
|
||||
super(PublisherWindow, self).__init__(parent)
|
||||
|
||||
self.setObjectName("PublishWindow")
|
||||
|
||||
self.setWindowTitle("OpenPype publisher")
|
||||
|
||||
icon = QtGui.QIcon(resources.get_openpype_icon_filepath())
|
||||
|
|
@ -440,15 +442,24 @@ class PublisherWindow(QtWidgets.QDialog):
|
|||
event.accept()
|
||||
return
|
||||
|
||||
if event.matches(QtGui.QKeySequence.Save):
|
||||
save_match = event.matches(QtGui.QKeySequence.Save)
|
||||
if save_match == QtGui.QKeySequence.ExactMatch:
|
||||
if not self._controller.publish_has_started:
|
||||
self._save_changes(True)
|
||||
event.accept()
|
||||
return
|
||||
|
||||
if ResetKeySequence.matches(
|
||||
QtGui.QKeySequence(event.key() | event.modifiers())
|
||||
):
|
||||
# PySide6 Support
|
||||
if hasattr(event, "keyCombination"):
|
||||
reset_match_result = ResetKeySequence.matches(
|
||||
QtGui.QKeySequence(event.keyCombination())
|
||||
)
|
||||
else:
|
||||
reset_match_result = ResetKeySequence.matches(
|
||||
QtGui.QKeySequence(event.modifiers() | event.key())
|
||||
)
|
||||
|
||||
if reset_match_result == QtGui.QKeySequence.ExactMatch:
|
||||
if not self.controller.publish_is_running:
|
||||
self.reset()
|
||||
event.accept()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from .widgets import (
|
||||
FocusSpinBox,
|
||||
FocusDoubleSpinBox,
|
||||
ComboBox,
|
||||
CustomTextComboBox,
|
||||
PlaceholderLineEdit,
|
||||
BaseClickableFrame,
|
||||
|
|
@ -38,6 +39,7 @@ from .overlay_messages import (
|
|||
__all__ = (
|
||||
"FocusSpinBox",
|
||||
"FocusDoubleSpinBox",
|
||||
"ComboBox",
|
||||
"CustomTextComboBox",
|
||||
"PlaceholderLineEdit",
|
||||
"BaseClickableFrame",
|
||||
|
|
|
|||
|
|
@ -41,7 +41,28 @@ class FocusDoubleSpinBox(QtWidgets.QDoubleSpinBox):
|
|||
super(FocusDoubleSpinBox, self).wheelEvent(event)
|
||||
|
||||
|
||||
class CustomTextComboBox(QtWidgets.QComboBox):
|
||||
class ComboBox(QtWidgets.QComboBox):
|
||||
"""Base of combobox with pre-implement changes used in tools.
|
||||
|
||||
Combobox is using styled delegate by default so stylesheets are propagated.
|
||||
|
||||
Items are not changed on scroll until the combobox is in focus.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ComboBox, self).__init__(*args, **kwargs)
|
||||
delegate = QtWidgets.QStyledItemDelegate()
|
||||
self.setItemDelegate(delegate)
|
||||
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
|
||||
self._delegate = delegate
|
||||
|
||||
def wheelEvent(self, event):
|
||||
if self.hasFocus():
|
||||
return super(ComboBox, self).wheelEvent(event)
|
||||
|
||||
|
||||
class CustomTextComboBox(ComboBox):
|
||||
"""Combobox which can have different text showed."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
@ -253,6 +274,9 @@ class PixmapLabel(QtWidgets.QLabel):
|
|||
self._empty_pixmap = QtGui.QPixmap(0, 0)
|
||||
self._source_pixmap = pixmap
|
||||
|
||||
self._last_width = 0
|
||||
self._last_height = 0
|
||||
|
||||
def set_source_pixmap(self, pixmap):
|
||||
"""Change source image."""
|
||||
self._source_pixmap = pixmap
|
||||
|
|
@ -263,6 +287,12 @@ class PixmapLabel(QtWidgets.QLabel):
|
|||
size += size % 2
|
||||
return size, size
|
||||
|
||||
def minimumSizeHint(self):
|
||||
width, height = self._get_pix_size()
|
||||
if width != self._last_width or height != self._last_height:
|
||||
self._set_resized_pix()
|
||||
return QtCore.QSize(width, height)
|
||||
|
||||
def _set_resized_pix(self):
|
||||
if self._source_pixmap is None:
|
||||
self.setPixmap(self._empty_pixmap)
|
||||
|
|
@ -276,6 +306,8 @@ class PixmapLabel(QtWidgets.QLabel):
|
|||
QtCore.Qt.SmoothTransformation
|
||||
)
|
||||
)
|
||||
self._last_width = width
|
||||
self._last_height = height
|
||||
|
||||
def resizeEvent(self, event):
|
||||
self._set_resized_pix()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue