Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Smaller fixes and typos #2950

Merged
merged 9 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from openpype.hosts.traypublisher.api import pipeline
from openpype.lib import FileDef
from openpype.pipeline import (
Creator,
CreatedInstance,
lib
CreatedInstance
)


Expand Down Expand Up @@ -80,7 +80,7 @@ def get_default_variants(self):

def get_instance_attr_defs(self):
output = [
lib.FileDef(
FileDef(
"filepath",
folders=False,
extensions=self.extensions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class ValidateWorkfilePath(pyblish.api.InstancePlugin):
"""Validate existence of workfile instance existence."""

label = "Collect Workfile"
label = "Validate Workfile"
order = pyblish.api.ValidatorOrder - 0.49
families = ["workfile"]
hosts = ["traypublisher"]
Comment on lines 6 to 12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting this here even though it's somewhat unrelated to this PR.

This particular plug-in checks sourceFilepath in data. A quick query over the code base shows that ONLY this validator and collector use that particular instance.data. It doesn't appear to be used for any output, etc.

Could we somehow make to this more generic so that there's no need for this additional data key for this single use case but we could do e.g. a validator over all instance.data[representation] and its files? (even though most representations get added during Extractors after Validator).

Validating our input content exists seems like something we (need to do or are doing) elsewhere too so I imagine we might want to unify where possible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole logic of traypublisher will be more generic, but not in this PR.

Expand Down
15 changes: 0 additions & 15 deletions openpype/modules/ftrack/lib/avalon_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,6 @@ def from_dict_to_set(data, is_project):
return result


def get_avalon_project_template(project_name):
"""Get avalon template
Args:
project_name: (string)
Returns:
dictionary with templates
"""
templates = Anatomy(project_name).templates
return {
"workfile": templates["avalon"]["workfile"],
"work": templates["avalon"]["work"],
"publish": templates["avalon"]["publish"]
}


def get_project_apps(in_app_list):
""" Application definitions for app name.

Expand Down
6 changes: 3 additions & 3 deletions openpype/modules/log_viewer/tray/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def __init__(self, parent=None):

self.setStyleSheet(style.load_stylesheet())

self._frist_show = True
self._first_show = True

def showEvent(self, event):
super(LogsWindow, self).showEvent(event)

if self._frist_show:
self._frist_show = False
if self._first_show:
self._first_show = False
self.logs_widget.refresh()
2 changes: 1 addition & 1 deletion openpype/tools/publisher/widgets/create_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def __init__(
create_btn.setEnabled(False)

form_layout = QtWidgets.QFormLayout()
form_layout.addRow("Name:", variant_layout)
form_layout.addRow("Variant:", variant_layout)
form_layout.addRow("Subset:", subset_name_input)

mid_widget = QtWidgets.QWidget(self)
Expand Down
16 changes: 14 additions & 2 deletions openpype/tools/utils/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from openpype.style import get_objected_colors
from openpype.resources import get_image_path

log = Logger.get_logger(__name__)


def center_window(window):
"""Move window to center of it's screen."""
Expand Down Expand Up @@ -111,13 +113,23 @@ def get_qta_icon_by_name_and_color(icon_name, icon_color):
variants.append("{0}.{1}".format(key, icon_name))

icon = None
used_variant = None
for variant in variants:
try:
icon = qtawesome.icon(variant, color=icon_color)
used_variant = variant
break
except Exception:
pass

if used_variant is None:
log.info("Didn't find icon \"{}\"".format(icon_name))

elif used_variant != icon_name:
log.debug("Icon \"{}\" was not found \"{}\" is used instead".format(
icon_name, used_variant
))

SharedObjects.icons[full_icon_name] = icon
return icon

Expand All @@ -140,8 +152,8 @@ def get_asset_icon_name(asset_doc, has_children=True):
return icon_name

if has_children:
return "folder"
return "folder-o"
return "fa.folder"
return "fa.folder-o"


def get_asset_icon_color(asset_doc):
Expand Down
3 changes: 2 additions & 1 deletion openpype/widgets/attribute_defs/files_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,5 +641,6 @@ def dropEvent(self, event):
filepaths.append(filepath)
# TODO filter check
if len(filepaths) == 1:
self.set_value(filepaths[0], False)
self._filepath_input.setText(filepaths[0])

event.accept()