Skip to content

Commit

Permalink
Squashed commit of add_deadline_render_output_override:
Browse files Browse the repository at this point in the history
commit c22763f
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Mon Nov 22 11:54:40 2021 +0100

    Apply override on AOV layer path

commit cc3167b
Author: Jérôme LORRAIN <jerome.lorrain@protonmail.com>
Date:   Tue Nov 16 16:57:36 2021 +0100

    Deadline publish plugin override output option

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 a729ea5 commit 86080b2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions openpype/hosts/maya/plugins/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def process(self):
])

cmds.setAttr("{}.machineList".format(self.instance), lock=True)
cmds.setAttr("{}.overrideOutput".format(self.instance), lock=False)
self._rs = renderSetup.instance()
layers = self._rs.getRenderLayers()
if use_selection:
Expand Down Expand Up @@ -265,6 +266,7 @@ def _create_render_settings(self):
self.data["framesPerTask"] = 1
self.data["whitelist"] = False
self.data["machineList"] = ""
self.data["overrideOutput"] = ""
self.data["useMayaBatch"] = False
self.data["tileRendering"] = False
self.data["tilesX"] = 2
Expand Down
20 changes: 16 additions & 4 deletions openpype/hosts/maya/plugins/publish/collect_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def process(self, context):
return

render_globals = render_instance
# Get global overrides and translate to Deadline values
overrides = self.parse_options(str(render_globals))

collected_render_layers = render_instance.data["setMembers"]
filepath = context.data["currentFile"].replace("\\", "/")
asset = api.Session["AVALON_ASSET"]
Expand Down Expand Up @@ -235,8 +238,14 @@ def process(self, context):
for aov in exp_files:
full_paths = []
for file in aov[aov.keys()[0]]:
full_path = os.path.join(workspace, default_render_file,
file)
if 'overrideOutput' in overrides:
full_path = os.path.join(overrides['overrideOutput'],
default_render_file,
file)
else:
full_path = os.path.join(workspace,
default_render_file,
file)
full_path = full_path.replace("\\", "/")
full_paths.append(full_path)
publish_meta_path = os.path.dirname(full_path)
Expand Down Expand Up @@ -380,8 +389,6 @@ def process(self, context):
data["families"].append("assscene_render")

# Include (optional) global settings
# Get global overrides and translate to Deadline values
overrides = self.parse_options(str(render_globals))
data.update(**overrides)

# Define nice label
Expand Down Expand Up @@ -426,6 +433,11 @@ def parse_options(self, render_globals):
key = "Whitelist" if attributes["whitelist"] else "Blacklist"
options["renderGlobals"][key] = machine_list

# Override Output
override_output = attributes["overrideOutput"]
if override_output:
options["overrideOutput"] = override_output

# Suspend publish job
state = "Suspended" if attributes["suspendPublishJob"] else "Active"
options["publishJobState"] = state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _format_tiles(
return out, cfg


def get_renderer_variables(renderlayer, root):
def get_renderer_variables(renderlayer, root, override=False):
"""Retrieve the extension which has been set in the VRay settings.
Will return None if the current renderer is not VRay
Expand All @@ -179,13 +179,21 @@ def get_renderer_variables(renderlayer, root):
padding = cmds.getAttr("{}.{}".format(render_attrs["node"],
render_attrs["padding"]))

if override:
workspace = cmds.workspace(q=True, rootDirectory=True)
cmds.workspace(root, openWorkspace=True)

filename_0 = cmds.renderSettings(
fullPath=True,
gin="#" * int(padding),
lut=True,
layer=renderlayer or lib.get_current_renderlayer())[0]
filename_0 = re.sub('_<RenderPass>', '_beauty',
filename_0, flags=re.IGNORECASE)

if override:
cmds.workspace(workspace, openWorkspace=True)

prefix_attr = "defaultRenderGlobals.imageFilePrefix"
if renderer == "vray":
renderlayer = renderlayer.split("_")[-1]
Expand Down Expand Up @@ -393,6 +401,11 @@ def process(self, instance):

self.log.debug(filepath)

override_output = False
override_output_path = instance.data.get('overrideOutput')
if override_output_path:
override_output = True

# Gather needed data ------------------------------------------------
default_render_file = instance.context.data.get('project_settings')\
.get('maya')\
Expand All @@ -402,12 +415,15 @@ def process(self, instance):
filename = os.path.basename(filepath)
comment = context.data.get("comment", "")
dirname = os.path.join(workspace, default_render_file)
if override_output:
dirname = override_output_path
renderlayer = instance.data['setMembers'] # rs_beauty
deadline_user = context.data.get("user", getpass.getuser())
jobname = "%s - %s" % (filename, instance.name)

# Get the variables depending on the renderer
render_variables = get_renderer_variables(renderlayer, dirname)
render_variables = get_renderer_variables(renderlayer, dirname,
override_output)
filename_0 = render_variables["filename_0"]
if self.use_published:
new_scene = os.path.splitext(filename)[0]
Expand Down

0 comments on commit 86080b2

Please sign in to comment.