Skip to content

Commit

Permalink
Squashed commits publish_from_published_workfiles:
Browse files Browse the repository at this point in the history
commit 9be0d40
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Thu Dec 23 14:49:17 2021 +0100

    Fix syntax

commit 3e23455
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Wed Dec 22 10:55:34 2021 +0100

    Move setting from Global to Maya

commit e452155
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Mon Dec 20 11:58:49 2021 +0100

    Add option to publish from published workfile

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 a0e5f7d commit d8d6cff
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pyblish.api
import openpype.api
from openpype.lib.profiles_filtering import filter_profiles


def is_subdir(path, root_dir):
Expand All @@ -25,7 +26,7 @@ def is_subdir(path, root_dir):
return True


class ValidateSceneSetWorkspace(pyblish.api.ContextPlugin):
class ValidateSceneSetWorkspace(pyblish.api.InstancePlugin):
"""Validate the scene is inside the currently set Maya workspace"""

order = openpype.api.ValidatePipelineOrder
Expand All @@ -34,8 +35,11 @@ class ValidateSceneSetWorkspace(pyblish.api.ContextPlugin):
version = (0, 1, 0)
label = 'Maya Workspace Set'

def process(self, context):
publish_from_published_workfiles = False

def process(self, instance):

context = instance.context
scene_name = cmds.file(query=True, sceneName=True)
if not scene_name:
raise RuntimeError("Scene hasn't been saved. Workspace can't be "
Expand All @@ -44,4 +48,35 @@ def process(self, context):
root_dir = cmds.workspace(query=True, rootDirectory=True)

if not is_subdir(scene_name, root_dir):
raise RuntimeError("Maya workspace is not set correctly.")

if not self.publish_from_published_workfiles:
raise RuntimeError("Maya workspace is not set correctly.")
else:
settings = context.data.get('project_settings')
template_name_profiles = settings.get('global') \
.get('publish') \
.get('IntegrateAssetNew') \
.get('template_name_profiles')
task_name = context.data["anatomyData"]["task"]["name"]
task_type = context.data["anatomyData"]["task"]["type"]
key_values = {
"families": "workfile",
"tasks": task_name,
"hosts": context.data["hostName"],
"task_types": task_type
}
profile = filter_profiles(
template_name_profiles,
key_values,
logger=self.log
)
anatomy = context.data.get('anatomy')
anatomy_filled = anatomy.format(
instance.data.get('anatomyData')
)
pub_workfile_path = anatomy_filled.get(
profile["template_name"]
).get("folder")

if not is_subdir(scene_name, pub_workfile_path):
raise RuntimeError("Maya workspace is not set correctly.")
3 changes: 3 additions & 0 deletions openpype/settings/defaults/project_settings/maya.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@
"redshift_render_attributes": [],
"renderman_render_attributes": []
},
"ValidateSceneSetWorkspace": {
"publish_from_published_workfiles": false
},
"ValidateModelName": {
"enabled": false,
"database": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,20 @@
}
]
},
{
"type": "dict",
"collapsible": true,
"key": "ValidateSceneSetWorkspace",
"label": "Validate Workspace",
"is_group": true,
"children": [
{
"type": "boolean",
"key": "publish_from_published_workfiles",
"label": "Allow publishing form published workfiles"
}
]
},
{
"type": "collapsible-wrap",
"label": "Model",
Expand Down

0 comments on commit d8d6cff

Please sign in to comment.