moved standalone publish from tools into pype
|
|
@ -1,3 +1,4 @@
|
|||
from .asapublish_module import ASAPublishModule
|
||||
from .app import (
|
||||
show,
|
||||
cli
|
||||
|
|
@ -10,6 +10,8 @@ from .widgets import *
|
|||
# Move this to pype lib?
|
||||
from avalon.tools.libraryloader.io_nonsingleton import DbConnector
|
||||
|
||||
module = sys.modules[__name__]
|
||||
module.window = None
|
||||
|
||||
class Window(QtWidgets.QDialog):
|
||||
_db = DbConnector()
|
||||
|
|
@ -22,7 +24,7 @@ class Window(QtWidgets.QDialog):
|
|||
NOT_SELECTED = '< Nothing is selected >'
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(Window, self).__init__(parent)
|
||||
super(Window, self).__init__()
|
||||
self._db.install()
|
||||
|
||||
self.setWindowTitle("Standalone Publish")
|
||||
|
|
@ -172,18 +174,10 @@ class Window(QtWidgets.QDialog):
|
|||
data.update(self.widget_assets.collect_data())
|
||||
data.update(self.widget_family.collect_data())
|
||||
data.update(self.widget_components.collect_data())
|
||||
|
||||
|
||||
return data
|
||||
|
||||
def show(parent=None, debug=False, context=None):
|
||||
"""Display Loader GUI
|
||||
|
||||
Arguments:
|
||||
debug (bool, optional): Run loader in debug-mode,
|
||||
defaults to False
|
||||
|
||||
"""
|
||||
|
||||
def show(parent=None, debug=False):
|
||||
try:
|
||||
module.window.close()
|
||||
del module.window
|
||||
|
|
@ -191,7 +185,7 @@ def show(parent=None, debug=False, context=None):
|
|||
pass
|
||||
|
||||
with parentlib.application():
|
||||
window = Window(parent, context)
|
||||
window = Window(parent)
|
||||
window.show()
|
||||
|
||||
module.window = window
|
||||
|
|
@ -23,7 +23,9 @@ pyblish.api.register_plugin_path(PUBLISH_PATH)
|
|||
|
||||
def set_context(project, asset, app):
|
||||
os.environ["AVALON_PROJECT"] = project
|
||||
io.Session["AVALON_PROJECT"] = project
|
||||
os.environ["AVALON_ASSET"] = asset
|
||||
io.Session["AVALON_ASSET"] = asset
|
||||
|
||||
io.install()
|
||||
|
||||
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 730 B |
|
Before Width: | Height: | Size: 803 B After Width: | Height: | Size: 803 B |
|
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 484 B |
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 823 B |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
|
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 663 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
|
|
@ -11,7 +11,7 @@ class DropDataFrame(QtWidgets.QFrame):
|
|||
super().__init__()
|
||||
self.parent_widget = parent
|
||||
self.items = []
|
||||
self.presets = config.get_presets()['tools']['standalone_publish']
|
||||
self.presets = config.get_presets()['standalone_publish']
|
||||
|
||||
self.setAcceptDrops(True)
|
||||
layout = QtWidgets.QVBoxLayout(self)
|
||||
|
|
@ -267,7 +267,7 @@ class DropDataFrame(QtWidgets.QFrame):
|
|||
icon += 's'
|
||||
data['icon'] = icon
|
||||
data['thumb'] = (
|
||||
ext in self.presets['thumbnailable'] and
|
||||
ext in self.presets['extensions']['thumbnailable'] and
|
||||
data['is_sequence'] is False
|
||||
)
|
||||
data['prev'] = ext in self.presets['extensions']['video_file']
|
||||
|
|
@ -247,9 +247,7 @@ class FamilyWidget(QtWidgets.QWidget):
|
|||
|
||||
def refresh(self):
|
||||
has_families = False
|
||||
presets = config.get_presets().get('tools', {}).get(
|
||||
'standalone_publish', {}
|
||||
)
|
||||
presets = config.get_presets().get('standalone_publish', {})
|
||||
|
||||
for creator in presets.get('families', {}).values():
|
||||
creator = namedtuple("Creator", creator.keys())(*creator.values())
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
from . import cli
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
sys.exit(cli(sys.argv[1:]))
|
||||