Skip to content

Commit

Permalink
Merge pull request #258 from ynput/bugfix/maya-load-use-correct-produ…
Browse files Browse the repository at this point in the history
…ct-type

Maya: Load plugins use correct source for product type
  • Loading branch information
iLLiCiTiT authored Mar 26, 2024
2 parents 942dddd + df1d0d4 commit 4848d95
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ class RedshiftProxyLoader(load.LoaderPlugin):

def load(self, context, name=None, namespace=None, options=None):
"""Plugin entry point."""
try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "redshiftproxy"
product_type = context["product"]["productType"]

folder_name = context["folder"]["name"]
namespace = namespace or unique_namespace(
Expand Down
6 changes: 1 addition & 5 deletions client/ayon_core/hosts/maya/plugins/load/load_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ class ReferenceLoader(plugin.ReferenceLoader):
def process_reference(self, context, name, namespace, options):
import maya.cmds as cmds

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "model"

product_type = context["product"]["productType"]
project_name = context["project"]["name"]
# True by default to keep legacy behaviours
attach_to_root = options.get("attach_to_root", True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ def load(self, context, name, namespace, data):
from ayon_core.hosts.maya.api.pipeline import containerise
from ayon_core.hosts.maya.api.lib import unique_namespace

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "vdbcache"
product_type = context["product"]["productType"]

# Check if the plugin for arnold is available on the pc
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def load(self, context, name=None, namespace=None, data=None):
from ayon_core.hosts.maya.api.pipeline import containerise
from ayon_core.hosts.maya.api.lib import unique_namespace

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "vdbcache"
product_type = context["product"]["productType"]

# Check if the plugin for redshift is available on the pc
try:
Expand Down
5 changes: 1 addition & 4 deletions client/ayon_core/hosts/maya/plugins/load/load_vdb_to_vray.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ def load(self, context, name, namespace, data):
"Path does not exist: %s" % path
)

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "vdbcache"
product_type = context["product"]["productType"]

# Ensure V-ray is loaded with the vrayvolumegrid
if not cmds.pluginInfo("vrayformaya", query=True, loaded=True):
Expand Down
5 changes: 1 addition & 4 deletions client/ayon_core/hosts/maya/plugins/load/load_vrayproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ def load(self, context, name=None, namespace=None, options=None):
"""

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "vrayproxy"
product_type = context["product"]["productType"]

# get all representations for this version
filename = self._get_abc(
Expand Down
5 changes: 1 addition & 4 deletions client/ayon_core/hosts/maya/plugins/load/load_vrayscene.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ class VRaySceneLoader(load.LoaderPlugin):
color = "orange"

def load(self, context, name, namespace, data):
try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "vrayscene_layer"
product_type = context["product"]["productType"]

folder_name = context["folder"]["name"]
namespace = namespace or unique_namespace(
Expand Down
5 changes: 1 addition & 4 deletions client/ayon_core/hosts/maya/plugins/load/load_yeti_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ def load(self, context, name=None, namespace=None, data=None):
"""

try:
product_type = context["representation"]["context"]["family"]
except ValueError:
product_type = "yeticache"
product_type = context["product"]["productType"]

# Build namespace
folder_name = context["folder"]["name"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def load(self, context, name, namespace, data):
root = unreal_pipeline.AYON_ASSET_DIR
folder_name = context["folder"]["name"]
folder_path = context["folder"]["path"]
product_type = context["representation"]["context"]["family"]
product_type = context["product"]["productType"]
suffix = "_CON"
if folder_name:
asset_name = "{}_{}".format(folder_name, name)
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_core/hosts/unreal/plugins/load/load_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def load(self, context, name, namespace, options):
"loader": str(self.__class__.__name__),
"representation": context["representation"]["id"],
"parent": context["representation"]["versionId"],
"family": context["representation"]["context"]["family"],
"family": context["product"]["productType"],
"loaded_assets": loaded_assets
}
imprint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def load(self, context, name, namespace, options):

folder_name = context["folder"]["name"]
folder_path = context["folder"]["path"]
product_type = context["representation"]["context"]["family"]
product_type = context["product"]["productType"]
asset_name = f"{folder_name}_{name}" if folder_name else name
container_name = f"{folder_name}_{name}_CON"

Expand Down

0 comments on commit 4848d95

Please sign in to comment.