Skip to content

Commit

Permalink
Squashed commit of pyblish_shortcut_buttons:
Browse files Browse the repository at this point in the history
commit 687d4b7
Author: clement.hector <clement.hector@gmail.com>
Date:   Mon Feb 14 11:26:30 2022 +0100

    Add pyblish family whitelist for photoshop

commit a6c2802
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Fri Dec 10 11:29:46 2021 +0100

    add PYBLISH_DEFAULT_INTENT env var

commit bdcd514
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Fri Dec 10 11:29:26 2021 +0100

    Add PYBLISH_TITLE env var

commit 2027a38
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Fri Dec 10 11:11:25 2021 +0100

    Fix lines length

commit 7ada56b
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Wed Nov 17 14:59:21 2021 +0100

    Add PYBLISH_FAMILY_WHITELIST env var

commit 6f79251
Merge: ecae9f6 6468751
Author: Petr Kalis <petr.kalis@gmail.com>
Date:   Mon Feb 7 10:05:55 2022 +0100

    Merge pull request ynput#2634 from Ellipsanime/fix-photoshop-environement-workfiles-on-launch

    Fix open workfile on launch in photoshop

commit ecae9f6
Merge: 4b3834e 3160199
Author: Milan Kolar <mkolar@users.noreply.github.com>
Date:   Mon Feb 7 09:52:39 2022 +0100

    Merge pull request ynput#2556 from pypeclub/feature/OP-2429_Publisher-Preparations-before-standalone-publisher

commit 4b3834e
Merge: ccea535 604a590
Author: pypebot <82967070+pypebot@users.noreply.github.com>
Date:   Mon Feb 7 09:38:20 2022 +0100

    [Automated] Merged release main into develop

commit ccea535
Merge: f2a9543 a11700e
Author: pypebot <82967070+pypebot@users.noreply.github.com>
Date:   Sat Feb 5 04:34:51 2022 +0100

    [Automated] Merged main into develop

commit 6468751
Author: clement.hector <clement.hector@gmail.com>
Date:   Fri Feb 4 12:11:05 2022 +0100

    use env_value_to_bool instead of ast.literal_eval + os.getenv

commit fe46093
Author: clement.hector <clement.hector@gmail.com>
Date:   Wed Feb 2 19:36:49 2022 +0100

    fix test on string to boolean

commit 3160199
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 14:15:19 2022 +0100

    fix grammar

commit d739364
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 13:48:18 2022 +0100

    handle default value of 'is_label_horizontal'

commit 7ec4d50
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 13:48:03 2022 +0100

    precreate widget is separated from create dialog completely

commit f8be576
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 18:05:32 2022 +0100

    renamed method 'get_attribute_defs' to 'get_instance_attr_defs'

commit 20f5e8f
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:51:25 2022 +0100

    hound fixes

commit 95176b6
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:26:16 2022 +0100

    modified example creator

commit 23c3bc8
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:26:09 2022 +0100

    style changes of header view nad checkbox

commit 2d75212
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:25:51 2022 +0100

    ui attribute definitions are skipped for storing data

commit f0b7f72
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:25:34 2022 +0100

    creator dialog has context widget and creator's attributes

commit 9c6a57a
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:23:37 2022 +0100

    creator can define precreate attribute definitions and allowing context change

commit 3878c52
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:57 2022 +0100

    added widgett for pre create attributes

commit fffdef5
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:41 2022 +0100

    added publisher specific asset and task widgets

commit fbdd1d8
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:08 2022 +0100

    moved few widgets to tools/utils and modified asset/task widgets to easily change source model

commit 396bdfd
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:16:32 2022 +0100

    added few new attribute definitions and their widgets
  • Loading branch information
BenoitConnan committed Feb 28, 2022
1 parent 854d457 commit 08915ac
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 2 deletions.
15 changes: 15 additions & 0 deletions openpype/hosts/maya/plugins/publish/collect_instances.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from maya import cmds

import pyblish.api
Expand Down Expand Up @@ -41,6 +42,13 @@ def process(self, context):
ctx_frame_end_handle = context.data['frameEndHandle']

context.data['objectsets'] = objectset

families_whitelist = os.getenv("PYBLISH_FAMILY_WHITELIST")
if families_whitelist:
families_whitelist = families_whitelist.split(',')
self.log.info("Whitelisted families : {}".format(
families_whitelist))

for objset in objectset:

if not cmds.attributeQuery("id", node=objset, exists=True):
Expand Down Expand Up @@ -78,6 +86,12 @@ def process(self, context):
value = None
data[attr] = value

if families_whitelist:
if data['family'] not in families_whitelist:
self.log.info("Skipped instance with not whitelisted "
"family: {}".format(data['family']))
continue

# temporarily translation of `active` to `publish` till issue has
# been resolved, https://github.com/pyblish/pyblish-base/issues/307
if "active" in data:
Expand Down Expand Up @@ -152,6 +166,7 @@ def process(self, context):

instance.data["label"] = label


instance.data.update(data)

# Produce diagnostic message for any graphical
Expand Down
9 changes: 9 additions & 0 deletions openpype/hosts/maya/plugins/publish/collect_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ def process(self, context):

data = {}

families_whitelist = os.getenv("PYBLISH_FAMILY_WHITELIST")
if families_whitelist:
families_whitelist = families_whitelist.split(',')
if families_whitelist:
if 'workfile' not in families_whitelist:
self.log.info("Skipped instance with not whitelisted "
"family: {}".format('workfile'))
return

# create instance
instance = context.create_instance(name=filename)
subset = 'workfile' + task.capitalize()
Expand Down
13 changes: 13 additions & 0 deletions openpype/hosts/photoshop/plugins/publish/collect_instances.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pyblish.api

from openpype.hosts.photoshop import api as photoshop
Expand Down Expand Up @@ -25,6 +27,11 @@ def process(self, context):
layers = stub.get_layers()
layers_meta = stub.get_layers_metadata()
instance_names = []

families_whitelist = os.getenv("PYBLISH_FAMILY_WHITELIST")
if families_whitelist:
families_whitelist = families_whitelist.split(',')

for layer in layers:
layer_data = stub.read(layer, layers_meta)

Expand All @@ -39,6 +46,12 @@ def process(self, context):
if "placeholder" in layer_data["id"]:
continue

if families_whitelist:
if layer_data["family"] not in families_whitelist:
self.log.info("Skipped instance with not whitelisted "
"family: {}".format(layer_data["family"]))
continue

# child_layers = [*layer.Layers]
# self.log.debug("child_layers {}".format(child_layers))
# if not child_layers:
Expand Down
10 changes: 10 additions & 0 deletions openpype/hosts/photoshop/plugins/publish/collect_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ class CollectReview(pyblish.api.ContextPlugin):

def process(self, context):
family = "review"

families_whitelist = os.getenv("PYBLISH_FAMILY_WHITELIST")
if families_whitelist:
families_whitelist = families_whitelist.split(',')
if families_whitelist:
if family not in families_whitelist:
self.log.info("Skipped instance with not whitelisted "
"family: {}".format(family))
return

task = os.getenv("AVALON_TASK", None)
subset = family + task.capitalize()

Expand Down
9 changes: 9 additions & 0 deletions openpype/hosts/photoshop/plugins/publish/collect_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ def process(self, context):
staging_dir = os.path.dirname(file_path)
base_name = os.path.basename(file_path)

families_whitelist = os.getenv("PYBLISH_FAMILY_WHITELIST")
if families_whitelist:
families_whitelist = families_whitelist.split(',')
if families_whitelist:
if 'workfile' not in families_whitelist:
self.log.info("Skipped instance with not whitelisted "
"family: {}".format('workfile'))
return

# Create instance
instance = context.create_instance(subset)
instance.data.update({
Expand Down
6 changes: 5 additions & 1 deletion openpype/tools/pyblish_pype/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ def show(parent=None):

self._window.show()
self._window.activateWindow()
self._window.setWindowTitle(settings.WindowTitle)
env_title = os.getenv("PYBLISH_TITLE")
if env_title:
self._window.setWindowTitle(env_title)
else:
self._window.setWindowTitle(settings.WindowTitle)

font = QtGui.QFont("Open Sans", 8, QtGui.QFont.Normal)
self._window.setFont(font)
Expand Down
9 changes: 8 additions & 1 deletion openpype/tools/pyblish_pype/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"""
from __future__ import unicode_literals

import os

import pyblish

from . import settings, util
Expand Down Expand Up @@ -110,11 +112,16 @@ def reset(self):
.get("intent", {})
)

default = intents_preset.get("default")
items = intents_preset.get("items", {})
if not items:
return

env_default_intent = os.getenv("PYBLISH_DEFAULT_INTENT")
if env_default_intent and env_default_intent in items.keys():
default = env_default_intent
else:
default = intents_preset.get("default")

for idx, item_value in enumerate(items.keys()):
if item_value == default:
self.default_index = idx
Expand Down

0 comments on commit 08915ac

Please sign in to comment.