Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: Refactor to new publisher #4388

Merged
merged 203 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 157 commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
5c9e88b
Show new publisher from menu
BigRoy Jan 26, 2023
d05f904
Implement draft for new publisher in Maya
BigRoy Jan 26, 2023
82631a1
Maya: Refactor Create Pointcache to new publish
BigRoy Jan 26, 2023
81ffcc8
Add tooltip
BigRoy Jan 26, 2023
b448c46
Maya: Refactor Create Model to new publish
BigRoy Jan 26, 2023
5be796c
Maya: Refactor Create Maya Scene to new publish
BigRoy Jan 26, 2023
ef4b5d1
Rename file to match plugin name
BigRoy Jan 26, 2023
783bd86
Maya: Refactor Create Look to new publisher
BigRoy Jan 26, 2023
b67018a
Default use selection to True
BigRoy Jan 26, 2023
8179ad4
Maya: Refactor Create Layout to new publisher
BigRoy Jan 26, 2023
c231907
Maya: Refactor Create Camera + Camera Rig to new publisher
BigRoy Jan 26, 2023
3f87417
Maya: Refactor Create Assembly to new publisher
BigRoy Jan 26, 2023
9b180bc
Remove name attribute
BigRoy Jan 26, 2023
e57b7aa
Maya: Refactor Create Animation to new publisher
BigRoy Jan 26, 2023
fadf3a1
Maya: Refactor Create Rig to new publisher
BigRoy Jan 26, 2023
ccb4e95
Maya: Refactor Create Setdress to new publisher
BigRoy Jan 26, 2023
406884d
Maya: Refactor Create Xgen to new publisher
BigRoy Jan 26, 2023
c9aa319
Maya: Refactor Create Yeti Rig + Yeti Cache to new publisher
BigRoy Jan 27, 2023
ae2a1b2
Fix creator identifier
BigRoy Jan 27, 2023
fa6f813
Fix accidental comment
BigRoy Jan 27, 2023
4ed04c5
Remove unused imports
BigRoy Jan 27, 2023
448d520
Ignore new style instances
BigRoy Jan 27, 2023
b114b06
Collect relevant data for the new style instances
BigRoy Jan 27, 2023
e9d7f66
Generate frameStartHandle and frameEndHandle accordingly
BigRoy Jan 27, 2023
b664fc3
Merge branch 'maya_fix_validate_plugin_path_attributes' into maya_new…
BigRoy Jan 27, 2023
082b673
Remove unused import
BigRoy Jan 27, 2023
2d57499
Fix indentation
BigRoy Jan 27, 2023
011c1f7
Maya: Refactor Create Ass to new publisher
BigRoy Jan 27, 2023
5225578
Maya: Refactor Create Render Setup to new publisher
BigRoy Jan 27, 2023
946ad15
Maya: Refactor Create Redshift Proxy to new publisher
BigRoy Jan 27, 2023
aa22a7c
Maya: Refactor Create Review to new publisher
BigRoy Jan 27, 2023
23f0cb2
Make Validate Frame Range optional in new publisher
BigRoy Jan 27, 2023
69bc82e
Refactor many maya publish plug-ins to be optional in new publisher
BigRoy Jan 27, 2023
fc03beb
Maya: Refactor Create Proxy Alembic to new publisher
BigRoy Jan 27, 2023
cb23a1d
Validate Model Content - Raise PublishValidationError
BigRoy Jan 27, 2023
e546a4e
Make it so that you can select instance with select action if its empty
BigRoy Jan 27, 2023
a54c8b2
Validate Instance Has Members - Raise PublishValidationError
BigRoy Jan 27, 2023
46f3f7a
Raise PublishValidationError for better report
BigRoy Jan 27, 2023
2990745
Improve validation title
BigRoy Jan 27, 2023
2446082
Raise PublishValidationError for better report
BigRoy Jan 27, 2023
e1970ee
Maya: Refactor Create Multiverse Look to new publisher
BigRoy Jan 27, 2023
d4a9e1c
Maya: Refactor Create VRay Proxy to new publisher
BigRoy Jan 27, 2023
aae89c4
Add nice new report
BigRoy Jan 27, 2023
f423bc6
Maya: Refactor Create Unreal Static Mesh to new publisher
BigRoy Jan 27, 2023
f0ac3b4
Maya: Refactor Create Unreal Skeletal Mesh to new publisher
BigRoy Jan 27, 2023
6133730
Maya: Refactor Create Multiverse USD to new publisher
BigRoy Jan 27, 2023
62e4120
Maya: Refactor Create Multiverse USD Composition to new publisher
BigRoy Jan 27, 2023
3e7fb48
Maya: Refactor Create Multiverse USD Override to new publisher
BigRoy Jan 27, 2023
99a7b64
Fix typo
BigRoy Jan 27, 2023
1513109
Remove `name` attribute
BigRoy Jan 27, 2023
8fd44f6
Allow to customize deadline pool in new publisher
BigRoy Jan 29, 2023
3db4c91
Move `publishJobState` setting to Submit Publish Job
BigRoy Jan 29, 2023
e5f3911
Fix docstring typos
BigRoy Jan 29, 2023
3b92cb6
Add priority, framesPerTask, machineList attribute defs via AbstractS…
BigRoy Jan 29, 2023
c2f6439
Maya Deadline submit use project settings + allow tile priority to be…
BigRoy Jan 29, 2023
8f8136f
Use attribute def values for pools
BigRoy Jan 29, 2023
b134b7f
Better variable name
BigRoy Jan 29, 2023
a89beb8
Use attribute value
BigRoy Jan 29, 2023
f3033fe
Resolve todo
BigRoy Jan 29, 2023
99b9f77
Refactor maya submit remote publish to abstract submit deadline class
BigRoy Jan 29, 2023
5ed2751
Cosmetics
BigRoy Jan 29, 2023
a6ca5cb
Cosmetics
BigRoy Jan 29, 2023
1598ad8
Fix get_attribute_defs
BigRoy Jan 29, 2023
7e41b44
EARLY WIP - Refactor Create Render to new style publisher
BigRoy Jan 29, 2023
e0aaf4d
Fix cosmetics
BigRoy Jan 29, 2023
fded63f
Correct docstring
BigRoy Jan 29, 2023
82b6f88
Add icon
BigRoy Jan 29, 2023
b7e9240
Simplify Create Render logic
BigRoy Jan 29, 2023
a37bb77
Support RenderLayer removals
BigRoy Jan 30, 2023
2ac4965
Auto create main layer, directly refresh renderlayers on CreateRender
BigRoy Jan 30, 2023
627e71d
Be more explicit about what settings we're using in the Creator
BigRoy Jan 30, 2023
c895b09
Implement data persistence for renderlayers
BigRoy Jan 30, 2023
70c4535
Delete the renderlayer instance node on remove
BigRoy Jan 30, 2023
b8e5fc2
Fix hound
BigRoy Jan 30, 2023
5b85892
Do collect data for empty sets
BigRoy Jan 30, 2023
ad5cb6b
Do not prefix renderLayer with _
BigRoy Jan 30, 2023
63456c5
Store lowercase `renderlayer`
BigRoy Jan 30, 2023
16987ea
Refactor how layer/renderlayer is retrieved from instance
BigRoy Jan 30, 2023
fa9361f
Move Muster plug-in to muster module
BigRoy Jan 30, 2023
2bd2fda
Do not explicitly try to set `deadlineUrl` from a render instance in …
BigRoy Jan 30, 2023
9345123
Fix default
BigRoy Jan 30, 2023
b9e4360
Fix imprint for Create Render
BigRoy Jan 30, 2023
ccb03dd
Code cosmetics/clarity
BigRoy Jan 30, 2023
5162ddf
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Jan 30, 2023
e0067d9
Don't use separate Creator for CreateRenderlayer logic
BigRoy Jan 30, 2023
5aa05e0
Implement dedicated function to get the singleton render instance node
BigRoy Jan 30, 2023
b998ac0
Refactor Validate Maya Units to show report in new publisher
BigRoy Jan 31, 2023
7985720
Get and update context data for maya using `maya.cmds.fileInfo`
BigRoy Jan 31, 2023
1f1ef6b
Create workfile using auto creator
BigRoy Jan 31, 2023
2b1eeea
Allow to convert legacy instances in Maya
BigRoy Feb 1, 2023
c9d3549
Allow workfile + renderlayer to be empty
BigRoy Feb 1, 2023
b931183
Make `getattr` call safer
BigRoy Feb 1, 2023
4f633aa
Ignore `cbId` attribute on read
BigRoy Feb 1, 2023
feacb8f
Just pass flat list as items for the EnumDef if key == label
BigRoy Feb 1, 2023
b86287c
Fix apply settings
BigRoy Mar 3, 2023
32faafe
Merge remote-tracking branch 'origin/maya_new_publisher' into maya_ne…
BigRoy Mar 3, 2023
bd48267
Cosmetics
BigRoy Mar 3, 2023
9de0a81
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Mar 18, 2023
ccbd0c0
Shush hound
BigRoy Mar 18, 2023
ac4bf97
Add back separate 'Create...' menu entry
BigRoy Mar 18, 2023
5a8e87b
Fix getting file info data for context
BigRoy Mar 18, 2023
80a8706
Add strict error checking instance attribute definition
BigRoy Mar 18, 2023
479e0bd
Fix if statement
BigRoy Mar 18, 2023
14969a8
Remove file that was removed in `develop` but remained in merge conflict
BigRoy Mar 18, 2023
9976d7b
Fix loading rigs with creation of animation instance
BigRoy Mar 18, 2023
2f8b45a
Replace legacy instance collector
BigRoy Mar 18, 2023
27f590a
Refactor to at least get to a working deadline submission.
BigRoy Mar 18, 2023
6633594
Shush hound for the hacky workaround
BigRoy Mar 18, 2023
73c4df8
Fix missed removal of code
BigRoy Mar 18, 2023
cfdc1d3
Cleanup
BigRoy Mar 18, 2023
822e2f6
Move attribute definitions to SubmitMayaDeadline explicitly to (for n…
BigRoy Mar 19, 2023
c5bf02c
Hound fixes
BigRoy Mar 19, 2023
791c7de
Update openpype/hosts/maya/api/plugin.py
BigRoy Mar 21, 2023
49b2b65
Cleanup code from review suggestions
BigRoy Mar 21, 2023
faeb533
More suggestions from code review
BigRoy Mar 21, 2023
9c5ce5e
Cleanup code based on code review from @fabiaserra
BigRoy Mar 21, 2023
d87c88b
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Mar 22, 2023
962b5c1
Set up validation messages for new publisher
BigRoy Mar 23, 2023
fd62853
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Apr 4, 2023
14d767a
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Apr 4, 2023
5d84be5
Merge branch 'develop' into maya_new_publisher
BigRoy Apr 4, 2023
a6b28e4
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Apr 5, 2023
dc05906
Merge branch 'maya_new_publisher' of https://github.com/BigRoy/OpenPy…
BigRoy Apr 5, 2023
3858530
Draft refactor CreateVRayScene
BigRoy Apr 5, 2023
ae9b595
Cleanup + add todo
BigRoy Apr 5, 2023
59410c7
Fix typo
BigRoy Apr 5, 2023
08f6e96
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Apr 5, 2023
09ecd3b
Refactor `LegacyConverted` -> `MayaLegacyConvertor`
BigRoy Apr 5, 2023
28c207a
Remove mention of mayaScene export only since it also applies to the …
BigRoy Apr 5, 2023
a6799fa
Update openpype/hosts/maya/plugins/create/create_render.py
BigRoy Apr 5, 2023
f62384b
Preserve original comment as tooltip
BigRoy Apr 5, 2023
096f913
Merge branch 'maya_new_publisher' of https://github.com/BigRoy/OpenPy…
BigRoy Apr 5, 2023
7dc6158
Change assertions to KnownPublishError
BigRoy Apr 5, 2023
436da74
Remove redundant type logging since it's converted to `int` above
BigRoy Apr 5, 2023
2cbe58f
Cleanup
BigRoy Apr 5, 2023
2a48d82
Allow optional validate mesh arnold attributes
BigRoy Apr 5, 2023
149dd25
Revert default optional state
BigRoy Apr 5, 2023
3b2dce7
Use base class for Renderlayer linked creators
BigRoy Apr 6, 2023
26f5ee3
Improve error message for unsupported renderer
BigRoy Apr 6, 2023
558126a
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy Apr 6, 2023
3cb3641
Be more explicit about the flattened creator attributes data structure
BigRoy Apr 6, 2023
de5895c
Raise as PublishValidationErrors
BigRoy Apr 6, 2023
bbfbc94
Raise as PublishValidationErrors
BigRoy Apr 6, 2023
35b4981
Match labeling from Arnold's ASS Export labels in Maya export UI
BigRoy Apr 7, 2023
7bc2dc1
Match order of settings with Export UI of Arnold ASS in maya
BigRoy Apr 7, 2023
49bdb7f
Raise PublishValidationError
BigRoy Apr 7, 2023
7a2ff83
Raise PublishValidationError
BigRoy Apr 7, 2023
76d7763
Remove temporary hack to force enable the plug-in
BigRoy Apr 7, 2023
1c59234
Raise PublishValidationError
BigRoy Apr 7, 2023
aeb1ae0
Cleanup
BigRoy Apr 7, 2023
2dd39ad
Raise PublishValidationError
BigRoy Apr 7, 2023
434ed6c
Raise PublishValidationError
BigRoy Apr 7, 2023
47ef404
Raise PublishValidationError
BigRoy Apr 7, 2023
1398133
Remove old `collect_animation_data` which is not relevant with new cr…
BigRoy Apr 7, 2023
a851b18
Cosmetics
BigRoy Apr 7, 2023
a908d30
Avoid legacy_io usage
BigRoy Apr 7, 2023
3785baa
Move variable closer to where it's used
BigRoy Apr 7, 2023
5954a2a
Right split since are only using the furthest right value
BigRoy Apr 7, 2023
1b85eeb
Remove instance logging
BigRoy Apr 7, 2023
f923c9a
Merge branch 'develop' into maya_new_publisher
BigRoy Apr 11, 2023
e2d0ebf
Merge branch 'maya_new_publisher' of https://github.com/BigRoy/OpenPy…
BigRoy Apr 11, 2023
544c043
Merge branch 'develop' into maya_new_publisher
tokejepsen May 16, 2023
790196c
Update openpype/hosts/maya/plugins/create/create_review.py
BigRoy May 16, 2023
685f2a9
Update openpype/hosts/maya/plugins/create/create_review.py
BigRoy May 16, 2023
9593c3b
Update openpype/hosts/maya/plugins/create/create_review.py
BigRoy May 16, 2023
1d5afbb
Use handle calculations.
tokejepsen May 16, 2023
61af8ae
Get settings and apply to attribute defs.
tokejepsen May 16, 2023
75ba69a
Merge pull request #13 from tokejepsen/maya_new_publisher
BigRoy May 25, 2023
5d45763
Merge remote-tracking branch 'origin/maya_new_publisher' into maya_ne…
BigRoy May 25, 2023
d1d4e77
Use correct new style Creator
BigRoy May 25, 2023
9e9a9bd
Merge branch 'develop' into maya_new_publisher
iLLiCiTiT May 26, 2023
92b3adb
Merge pull request #14 from ynput/enhancement/maya_new_publisher_update
BigRoy May 26, 2023
c7883f4
Tweak logging
BigRoy May 26, 2023
5851088
Fix workfile icon
BigRoy May 26, 2023
eec2a88
Remove logging since we don't need to log that a plug-in is running
BigRoy May 26, 2023
d6eb231
Cleanup logs + cosmetics
BigRoy May 26, 2023
37a9846
Optimize logic + improve logging
BigRoy May 26, 2023
739c6a1
Merge remote-tracking branch 'upstream/develop' into maya_new_publisher
BigRoy May 30, 2023
2045344
Tweak error type
BigRoy May 30, 2023
dfaad2d
Allow conversion from legacy renderlayer singleton instances
BigRoy May 30, 2023
c3cfe1f
Merge branch 'develop' into maya_new_publisher
mkolar Jun 2, 2023
140b9d0
update validators to use PublishValidationError
mkolar Jun 2, 2023
1e70314
update further validator with validation error
mkolar Jun 2, 2023
3a49955
:rotating_light: calming :dog:
antirotor Jun 9, 2023
ae9ca67
:rotating_light: calm :dog: round 2
antirotor Jun 9, 2023
8c848f6
Merge remote-tracking branch 'origin/develop' into maya_new_publisher
antirotor Jun 16, 2023
10251ee
:bug: fix review
antirotor Jun 19, 2023
83e2397
Update openpype/hosts/maya/plugins/publish/collect_review.py
antirotor Jun 19, 2023
d3b2102
Merge branch 'develop' into maya_new_publisher
antirotor Jun 23, 2023
1279acc
:bug: fix ASS creator and validator
antirotor Jun 23, 2023
97834e3
:recycle: make the validation logic more clear
antirotor Jun 23, 2023
0de1b2f
:recycle: convert asserts
antirotor Jun 23, 2023
8d4d04e
Merge branch 'develop' into maya_new_publisher
antirotor Jun 23, 2023
cd10572
:bug: use fps from context
antirotor Jun 30, 2023
41196cf
:bug: fix default value
antirotor Jun 30, 2023
4b12f49
:twisted_rightwards_arrows: Merge remote-tracking branch 'origin/deve…
antirotor Jun 30, 2023
6a311e9
:bug: remove empty instance warning on workfile instance
antirotor Jun 30, 2023
2e1b0fa
:bug: fix light enum values
antirotor Jun 30, 2023
1387192
:bug: fix another fps issue
antirotor Jun 30, 2023
90f5fa8
:twisted_rightwards_arrows: Merge remote-tracking branch 'origin/deve…
antirotor Jun 30, 2023
197067d
Update openpype/hosts/maya/plugins/publish/collect_review.py
antirotor Jul 11, 2023
92d18eb
:twisted_rightwards_arrows: Merge remote-tracking branch 'origin/deve…
antirotor Jul 11, 2023
a172977
Merge branch 'develop' into maya_new_publisher
antirotor Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 40 additions & 14 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
load_container,
registered_host,
)
from openpype.lib import NumberDef
from openpype.pipeline.context_tools import get_current_project_asset


Expand Down Expand Up @@ -283,8 +284,8 @@ def pairwise(iterable):
return zip(a, a)


def collect_animation_data(fps=False):
"""Get the basic animation data
def collect_animation_defs(fps=False):
"""Get the basic animation attribute defintions for the publisher.

Returns:
OrderedDict
Expand All @@ -296,17 +297,42 @@ def collect_animation_data(fps=False):
end = cmds.playbackOptions(query=True, animationEndTime=True)

# build attributes
data = OrderedDict()
data["frameStart"] = start
data["frameEnd"] = end
data["handleStart"] = 0
data["handleEnd"] = 0
data["step"] = 1.0
defs = [
NumberDef("frameStart",
label="Frame Start",
default=start,
decimals=0),
NumberDef("frameEnd",
label="Frame End",
default=end,
decimals=0),
NumberDef("handleStart",
label="Handle Start",
default=0,
decimals=0),
NumberDef("handleEnd",
label="Handle End",
default=0,
decimals=0),
NumberDef("step",
label="Step size",
tooltip="A smaller step size means more samples and larger "
"output files.\n"
"A 1.0 step size is a single sample every frame.\n"
"A 0.5 step size is two samples per frame.\n"
"A 0.2 step size is five samples per frame.",
default=1.0,
decimals=3),
]

if fps:
data["fps"] = mel.eval('currentTimeUnitToFPS()')
current_fps = mel.eval('currentTimeUnitToFPS()')
fps_def = NumberDef(
"fps", label="FPS", default=current_fps, decimals=5
)
defs.append(fps_def)

return data
return defs


def imprint(node, data):
Expand Down Expand Up @@ -392,10 +418,10 @@ def lsattrs(attrs):
attrs (dict): Name and value pairs of expected matches

Example:
>> # Return nodes with an `age` of five.
>> lsattr({"age": "five"})
>> # Return nodes with both `age` and `color` of five and blue.
>> lsattr({"age": "five", "color": "blue"})
>>> # Return nodes with an `age` of five.
>>> lsattrs({"age": "five"})
>>> # Return nodes with both `age` and `color` of five and blue.
>>> lsattrs({"age": "five", "color": "blue"})

Return:
list: matching nodes.
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/api/lib_renderproducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Instance(object):
}.get(renderer_name.lower(), None)
if renderer is None:
raise UnsupportedRendererException(
"unsupported {}".format(renderer_name)
"Unsupported renderer: {}".format(renderer_name)
)

return renderer(layer, render_instance)
Expand Down
11 changes: 7 additions & 4 deletions openpype/hosts/maya/api/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ def deferred():

cmds.menuItem(divider=True)

# Create default items
cmds.menuItem(
"Create...",
command=lambda *args: host_tools.show_creator(parent=parent_widget)
command=lambda *args: host_tools.show_publisher(
parent=parent_widget,
tab="create"
)
)

cmds.menuItem(
Expand All @@ -82,8 +84,9 @@ def deferred():

cmds.menuItem(
"Publish...",
command=lambda *args: host_tools.show_publish(
parent=parent_widget
command=lambda *args: host_tools.show_publisher(
parent=parent_widget,
tab="publish"
),
image=pyblish_icon
)
Expand Down
19 changes: 18 additions & 1 deletion openpype/hosts/maya/api/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json
import base64
import os
import errno
import logging
Expand All @@ -13,6 +15,7 @@
HostBase,
IWorkfileHost,
ILoadHost,
IPublishHost,
HostDirmap,
)
from openpype.tools.utils import host_tools
Expand Down Expand Up @@ -63,7 +66,7 @@
AVALON_CONTAINERS = ":AVALON_CONTAINERS"


class MayaHost(HostBase, IWorkfileHost, ILoadHost):
class MayaHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
name = "maya"

def __init__(self):
Expand Down Expand Up @@ -146,6 +149,20 @@ def maintained_selection(self):
with lib.maintained_selection():
yield

def get_context_data(self):
data = cmds.fileInfo("OpenPypeContext", query=True)
if not data:
return {}

data = data[0] # Maya seems to return a list
decoded = base64.b64decode(data).decode("utf-8")
return json.loads(decoded)

def update_context_data(self, data, changes):
json_str = json.dumps(data)
encoded = base64.b64encode(json_str.encode("utf-8"))
return cmds.fileInfo("OpenPypeContext", encoded)

def _register_callbacks(self):
for handler, event in self._op_events.copy().items():
if event is None:
Expand Down
Loading