diff --git a/pype/lib/abstract_submit_deadline.py b/pype/lib/abstract_submit_deadline.py index 170e4908b7..9862f534f1 100644 --- a/pype/lib/abstract_submit_deadline.py +++ b/pype/lib/abstract_submit_deadline.py @@ -373,8 +373,12 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin): """Plugin entry point.""" self._instance = instance context = instance.context - self._deadline_url = os.environ.get( - "DEADLINE_REST_URL", "http://localhost:8082") + self._deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) assert self._deadline_url, "Requires DEADLINE_REST_URL" file_path = None diff --git a/pype/plugins/celaction/publish/submit_celaction_deadline.py b/pype/plugins/celaction/publish/submit_celaction_deadline.py index 30e7175a60..fd958d11a3 100644 --- a/pype/plugins/celaction/publish/submit_celaction_deadline.py +++ b/pype/plugins/celaction/publish/submit_celaction_deadline.py @@ -11,7 +11,7 @@ class ExtractCelactionDeadline(pyblish.api.InstancePlugin): """Submit CelAction2D scene to Deadline Renders are submitted to a Deadline Web Service as - supplied via the environment variable DEADLINE_REST_URL + supplied via settings key "DEADLINE_REST_URL". """ @@ -37,10 +37,15 @@ class ExtractCelactionDeadline(pyblish.api.InstancePlugin): instance.data["toBeRenderedOn"] = "deadline" context = instance.context - DEADLINE_REST_URL = os.environ.get("DEADLINE_REST_URL") - assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL" + deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) + assert deadline_url, "Requires DEADLINE_REST_URL" - self.deadline_url = "{}/api/jobs".format(DEADLINE_REST_URL) + self.deadline_url = "{}/api/jobs".format(deadline_url) self._comment = context.data.get("comment", "") self._deadline_user = context.data.get( "deadlineUser", getpass.getuser()) diff --git a/pype/plugins/fusion/publish/submit_deadline.py b/pype/plugins/fusion/publish/submit_deadline.py index ed3fb06586..050e558d2e 100644 --- a/pype/plugins/fusion/publish/submit_deadline.py +++ b/pype/plugins/fusion/publish/submit_deadline.py @@ -12,7 +12,7 @@ class FusionSubmitDeadline(pyblish.api.InstancePlugin): """Submit current Comp to Deadline Renders are submitted to a Deadline Web Service as - supplied via the environment variable DEADLINE_REST_URL + supplied via settings key "DEADLINE_REST_URL". """ @@ -32,9 +32,13 @@ class FusionSubmitDeadline(pyblish.api.InstancePlugin): from avalon.fusion.lib import get_frame_path - DEADLINE_REST_URL = api.Session.get("DEADLINE_REST_URL", - "http://localhost:8082") - assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL" + deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) + assert deadline_url, "Requires DEADLINE_REST_URL" # Collect all saver instances in context that are to be rendered saver_instances = [] diff --git a/pype/plugins/global/publish/collect_presets.py b/pype/plugins/global/publish/collect_presets.py deleted file mode 100644 index 95fb4dbfad..0000000000 --- a/pype/plugins/global/publish/collect_presets.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -Requires: - config_data -> colorspace.default - config_data -> dataflow.default - -Provides: - context -> presets -""" - -from pyblish import api -from pype.api import get_current_project_settings - - -class CollectPresets(api.ContextPlugin): - """Collect Presets.""" - - order = api.CollectorOrder - 0.491 - label = "Collect Presets" - - def process(self, context): - project_settings = get_current_project_settings() - context.data["presets"] = project_settings - - return diff --git a/pype/plugins/global/publish/collect_settings.py b/pype/plugins/global/publish/collect_settings.py new file mode 100644 index 0000000000..8531e530ac --- /dev/null +++ b/pype/plugins/global/publish/collect_settings.py @@ -0,0 +1,13 @@ +from pyblish import api +from pype.api import get_current_project_settings, get_system_settings + + +class CollectSettings(api.ContextPlugin): + """Collect Settings and store in the context.""" + + order = api.CollectorOrder - 0.491 + label = "Collect Settings" + + def process(self, context): + context.data["project_settings"] = get_current_project_settings() + context.data["system_settings"] = get_system_settings() diff --git a/pype/plugins/global/publish/submit_publish_job.py b/pype/plugins/global/publish/submit_publish_job.py index b8bf240c06..c90837dfed 100644 --- a/pype/plugins/global/publish/submit_publish_job.py +++ b/pype/plugins/global/publish/submit_publish_job.py @@ -305,7 +305,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): self.log.info("Submitting Deadline job ...") - url = "{}/api/jobs".format(self.DEADLINE_REST_URL) + url = "{}/api/jobs".format(self.deadline_url) response = requests.post(url, json=payload, timeout=10) if not response.ok: raise Exception(response.text) @@ -924,10 +924,13 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): } if submission_type == "deadline": - self.DEADLINE_REST_URL = os.environ.get( - "DEADLINE_REST_URL", "http://localhost:8082" + self.deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] ) - assert self.DEADLINE_REST_URL, "Requires DEADLINE_REST_URL" + assert self.deadline_url, "Requires DEADLINE_REST_URL" self._submit_deadline_post_job(instance, render_job, instances) diff --git a/pype/plugins/maya/create/create_render.py b/pype/plugins/maya/create/create_render.py index fa0e269126..a3700e2f60 100644 --- a/pype/plugins/maya/create/create_render.py +++ b/pype/plugins/maya/create/create_render.py @@ -9,6 +9,7 @@ from maya import cmds import maya.app.renderSetup.model.renderSetup as renderSetup from pype.hosts.maya import lib +from pype.api import get_system_settings import avalon.maya @@ -124,8 +125,11 @@ class CreateRender(avalon.maya.Creator): # get pools pools = [] - deadline_url = os.environ.get("DEADLINE_REST_URL", None) - muster_url = os.environ.get("MUSTER_REST_URL", None) + system_settings = get_system_settings()["modules"] + + deadline_url = system_settings["deadline"]["DEADLINE_REST_URL"] + muster_url = system_settings["muster"]["MUSTER_REST_URL"] + if deadline_url and muster_url: self.log.error( "Both Deadline and Muster are enabled. " "Cannot support both." diff --git a/pype/plugins/maya/publish/submit_maya_deadline.py b/pype/plugins/maya/publish/submit_maya_deadline.py index 0ae19cbb81..e1cfe5591c 100644 --- a/pype/plugins/maya/publish/submit_maya_deadline.py +++ b/pype/plugins/maya/publish/submit_maya_deadline.py @@ -238,11 +238,7 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): """Submit available render layers to Deadline. Renders are submitted to a Deadline Web Service as - supplied via the environment variable ``DEADLINE_REST_URL``. - - Note: - If Deadline configuration is not detected, this plugin will - be disabled. + supplied via settings key "DEADLINE_REST_URL". Attributes: use_published (bool): Use published scene to render instead of the @@ -254,11 +250,6 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): order = pyblish.api.IntegratorOrder + 0.1 hosts = ["maya"] families = ["renderlayer"] - if not os.environ.get("DEADLINE_REST_URL"): - optional = False - active = False - else: - optional = True use_published = True tile_assembler_plugin = "PypeTileAssembler" @@ -267,9 +258,16 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): def process(self, instance): """Plugin entry point.""" instance.data["toBeRenderedOn"] = "deadline" + context = instance.context + self._instance = instance - self._deadline_url = os.environ.get( - "DEADLINE_REST_URL", "http://localhost:8082") + self._deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) + assert self._deadline_url, "Requires DEADLINE_REST_URL" context = instance.context diff --git a/pype/plugins/maya/publish/validate_deadline_connection.py b/pype/plugins/maya/publish/validate_deadline_connection.py index f9c11620ba..0733c3badf 100644 --- a/pype/plugins/maya/publish/validate_deadline_connection.py +++ b/pype/plugins/maya/publish/validate_deadline_connection.py @@ -12,8 +12,6 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin): order = pyblish.api.ValidatorOrder hosts = ["maya"] families = ["renderlayer"] - if not os.environ.get("DEADLINE_REST_URL"): - active = False def process(self, context): @@ -21,14 +19,15 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin): if not contextplugin_should_run(self, context): return - try: - DEADLINE_REST_URL = os.environ["DEADLINE_REST_URL"] - except KeyError: - self.log.error("Deadline REST API url not found.") - raise ValueError("Deadline REST API url not found.") + deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) # Check response - response = self._requests_get(DEADLINE_REST_URL) + response = self._requests_get(deadline_url) assert response.ok, "Response must be ok" assert response.text.startswith("Deadline Web Service "), ( "Web service did not respond with 'Deadline Web Service'" diff --git a/pype/plugins/nuke/publish/submit_nuke_deadline.py b/pype/plugins/nuke/publish/submit_nuke_deadline.py index 2c7d468d3a..5e5efb6e62 100644 --- a/pype/plugins/nuke/publish/submit_nuke_deadline.py +++ b/pype/plugins/nuke/publish/submit_nuke_deadline.py @@ -12,7 +12,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): """Submit write to Deadline Renders are submitted to a Deadline Web Service as - supplied via the environment variable DEADLINE_REST_URL + supplied via settings key "DEADLINE_REST_URL". """ @@ -34,11 +34,15 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): node = instance[0] context = instance.context - DEADLINE_REST_URL = os.environ.get("DEADLINE_REST_URL", - "http://localhost:8082") - assert DEADLINE_REST_URL, "Requires DEADLINE_REST_URL" + deadline_url = ( + context.data["system_settings"] + ["modules"] + ["deadline"] + ["DEADLINE_REST_URL"] + ) + assert deadline_url, "Requires DEADLINE_REST_URL" - self.deadline_url = "{}/api/jobs".format(DEADLINE_REST_URL) + self.deadline_url = "{}/api/jobs".format(deadline_url) self._comment = context.data.get("comment", "") self._ver = re.search(r"\d+\.\d+", context.data.get("hostVersion")) self._deadline_user = context.data.get( diff --git a/pype/settings/defaults/project_settings/global.json b/pype/settings/defaults/project_settings/global.json index 5f76f2d0f6..6661729e3d 100644 --- a/pype/settings/defaults/project_settings/global.json +++ b/pype/settings/defaults/project_settings/global.json @@ -94,8 +94,8 @@ "deadline_department": "", "deadline_pool": "", "deadline_group": "", - "deadline_chunk_size": "", - "deadline_priority": "", + "deadline_chunk_size": 1, + "deadline_priority": 50, "aov_filter": { "maya": [ ".+(?:\\.|_)([Bb]eauty)(?:\\.|_).*" diff --git a/pype/settings/defaults/project_settings/maya.json b/pype/settings/defaults/project_settings/maya.json index 9193ea2b52..10e3db2dd7 100644 --- a/pype/settings/defaults/project_settings/maya.json +++ b/pype/settings/defaults/project_settings/maya.json @@ -109,7 +109,7 @@ }, "publish": { "CollectMayaRender": { - "sync_workfile_version": true + "sync_workfile_version": false }, "ValidateCameraAttributes": { "enabled": true, @@ -134,6 +134,9 @@ "ValidateMeshHasOverlappingUVs": { "enabled": false }, + "ValidateAttributes": { + "enabled": false + }, "ExtractCameraAlembic": { "enabled": true, "optional": true, @@ -316,4 +319,4 @@ "ValidateNoAnimation": false } } -} +} \ No newline at end of file diff --git a/pype/settings/defaults/project_settings/standalonepublisher.json b/pype/settings/defaults/project_settings/standalonepublisher.json index b8015f2832..67b4826692 100644 --- a/pype/settings/defaults/project_settings/standalonepublisher.json +++ b/pype/settings/defaults/project_settings/standalonepublisher.json @@ -123,4 +123,4 @@ "help": "Script exported from matchmoving application" } } -} +} \ No newline at end of file diff --git a/pype/settings/defaults/system_settings/modules.json b/pype/settings/defaults/system_settings/modules.json index a36a3b75cf..74268c9254 100644 --- a/pype/settings/defaults/system_settings/modules.json +++ b/pype/settings/defaults/system_settings/modules.json @@ -169,11 +169,11 @@ "enabled": false, "workspace_name": "studio name" }, - "Deadline": { + "deadline": { "enabled": true, "DEADLINE_REST_URL": "http://localhost:8082" }, - "Muster": { + "muster": { "enabled": false, "MUSTER_REST_URL": "http://127.0.0.1:9890", "templates_mapping": { diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_global_publish.json b/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_global_publish.json index 86c6f2963e..e9e3e26c60 100644 --- a/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_global_publish.json +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_global_publish.json @@ -344,12 +344,12 @@ "label": "Deadline Group" }, { - "type": "text", + "type": "number", "key": "deadline_chunk_size", "label": "Deadline Chunk Size" }, { - "type": "text", + "type": "number", "key": "deadline_priority", "label": "Deadline Priotity" }, diff --git a/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_maya_publish.json b/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_maya_publish.json index 33d0a06d2c..1cd526adb9 100644 --- a/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_maya_publish.json +++ b/pype/tools/settings/settings/gui_schemas/projects_schema/schemas/schema_maya_publish.json @@ -123,6 +123,19 @@ "label": "Enabled" }] }, + { + "type": "dict", + "collapsable": true, + "key": "ValidateAttributes", + "label": "ValidateAttributes", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }] + }, { "type": "splitter" }, diff --git a/pype/tools/settings/settings/gui_schemas/system_schema/schema_modules.json b/pype/tools/settings/settings/gui_schemas/system_schema/schema_modules.json index 31eaab2ede..62aaafc27b 100644 --- a/pype/tools/settings/settings/gui_schemas/system_schema/schema_modules.json +++ b/pype/tools/settings/settings/gui_schemas/system_schema/schema_modules.json @@ -100,7 +100,7 @@ ] }, { "type": "dict", - "key": "Deadline", + "key": "deadline", "label": "Deadline", "collapsable": true, "checkbox_key": "enabled", @@ -115,7 +115,7 @@ }] }, { "type": "dict", - "key": "Muster", + "key": "muster", "label": "Muster", "collapsable": true, "checkbox_key": "enabled", @@ -126,7 +126,7 @@ }, { "type": "text", "key": "MUSTER_REST_URL", - "label": "Muster Resl URL" + "label": "Muster Rest URL" }, { "type": "dict-modifiable", "object_type": {