Skip to content

Commit

Permalink
Merge pull request #1070 from BigRoy/enhancement/add_borisfx_silhouet…
Browse files Browse the repository at this point in the history
…te_support

Add BorisFX Silhouette support
  • Loading branch information
BigRoy authored Jan 23, 2025
2 parents 0cb1c26 + 68ea504 commit cd3543f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 49 deletions.
3 changes: 2 additions & 1 deletion client/ayon_core/hooks/pre_add_last_workfile_arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook):
"aftereffects",
"wrap",
"openrv",
"cinema4d"
"cinema4d",
"silhouette",
}
launch_types = {LaunchTypes.local}

Expand Down
3 changes: 2 additions & 1 deletion client/ayon_core/hooks/pre_ocio_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class OCIOEnvHook(PreLaunchHook):
"hiero",
"resolve",
"openrv",
"cinema4d"
"cinema4d",
"silhouette",
}
launch_types = set()

Expand Down
2 changes: 1 addition & 1 deletion client/ayon_core/plugins/publish/validate_file_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ValidateCurrentSaveFile(pyblish.api.ContextPlugin):
label = "Validate File Saved"
order = pyblish.api.ValidatorOrder - 0.1
hosts = ["fusion", "houdini", "max", "maya", "nuke", "substancepainter",
"cinema4d"]
"cinema4d", "silhouette"]
actions = [SaveByVersionUpAction, ShowWorkfilesAction]

def process(self, context):
Expand Down
45 changes: 1 addition & 44 deletions client/ayon_core/tools/utils/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ayon_core.resources import get_image_path
from ayon_core.tools.flickcharm import FlickCharm

from qtpy import QtWidgets, QtCore, QtGui, QtSvg
from qtpy import QtWidgets, QtCore, QtGui


class DeselectableTreeView(QtWidgets.QTreeView):
Expand All @@ -19,48 +18,6 @@ def mousePressEvent(self, event):
QtWidgets.QTreeView.mousePressEvent(self, event)


class TreeViewSpinner(QtWidgets.QTreeView):
size = 160

def __init__(self, parent=None):
super(TreeViewSpinner, self).__init__(parent=parent)

loading_image_path = get_image_path("spinner-200.svg")

self.spinner = QtSvg.QSvgRenderer(loading_image_path)

self.is_loading = False
self.is_empty = True

def paint_loading(self, event):
rect = event.rect()
rect = QtCore.QRectF(rect.topLeft(), rect.bottomRight())
rect.moveTo(
rect.x() + rect.width() / 2 - self.size / 2,
rect.y() + rect.height() / 2 - self.size / 2
)
rect.setSize(QtCore.QSizeF(self.size, self.size))
painter = QtGui.QPainter(self.viewport())
self.spinner.render(painter, rect)

def paint_empty(self, event):
painter = QtGui.QPainter(self.viewport())
rect = event.rect()
rect = QtCore.QRectF(rect.topLeft(), rect.bottomRight())
qtext_opt = QtGui.QTextOption(
QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter
)
painter.drawText(rect, "No Data", qtext_opt)

def paintEvent(self, event):
if self.is_loading:
self.paint_loading(event)
elif self.is_empty:
self.paint_empty(event)
else:
super(TreeViewSpinner, self).paintEvent(event)


class TreeView(QtWidgets.QTreeView):
"""Ultimate TreeView with flick charm and double click signals.
Expand Down
5 changes: 3 additions & 2 deletions client/ayon_core/tools/workfiles/models/workfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ def get_file_items(self, folder_id, task_id, task_name):
return items

for filename in os.listdir(workdir):
# We want to support both files and folders. e.g. Silhoutte uses
# folders as its project files. So we do not check whether it is
# a file or not.
filepath = os.path.join(workdir, filename)
if not os.path.isfile(filepath):
continue

ext = os.path.splitext(filename)[1].lower()
if ext not in self._extensions:
Expand Down

0 comments on commit cd3543f

Please sign in to comment.