3dsMax is using representation entity

This commit is contained in:
Jakub Trllo 2024-03-08 12:39:54 +01:00
parent 756ab2dda0
commit ef38f9d765
12 changed files with 34 additions and 34 deletions

View file

@ -169,7 +169,7 @@ def containerise(name: str, nodes: list, context,
"name": name,
"namespace": namespace or "",
"loader": loader,
"representation": context["representation"]["_id"],
"representation": context["representation"]["id"],
}
container_name = f"{namespace}:{name}{suffix}"
container = rt.container(name=container_name)

View file

@ -54,8 +54,8 @@ class FbxLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
node = rt.getNodeByName(node_name)
namespace, _ = get_namespace(node_name)
@ -88,7 +88,7 @@ class FbxLoader(load.LoaderPlugin):
update_custom_attribute_data(node, fbx_objects)
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -51,8 +51,8 @@ class MaxSceneLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
node = rt.getNodeByName(node_name)
namespace, _ = get_namespace(node_name)
@ -87,7 +87,7 @@ class MaxSceneLoader(load.LoaderPlugin):
update_custom_attribute_data(node, max_objects)
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -73,8 +73,8 @@ class ModelAbcLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node = rt.GetNodeByName(container["instance_node"])
node_list = [n for n in get_previous_loaded_object(node)
if rt.ClassOf(n) == rt.AlembicContainer]
@ -91,7 +91,7 @@ class ModelAbcLoader(load.LoaderPlugin):
abc_obj.source = path
lib.imprint(
container["instance_node"],
{"representation": str(repre_doc["_id"])},
{"representation": repre_entity["id"]},
)
def switch(self, container, context):

View file

@ -50,8 +50,8 @@ class FbxModelLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
node = rt.getNodeByName(node_name)
if not node:
@ -86,7 +86,7 @@ class FbxModelLoader(load.LoaderPlugin):
rt.Select(node)
update_custom_attribute_data(node, fbx_objects)
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -50,8 +50,8 @@ class ObjLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
node = rt.getNodeByName(node_name)
namespace, _ = get_namespace(node_name)
@ -78,7 +78,7 @@ class ObjLoader(load.LoaderPlugin):
rt.Select(node)
lib.imprint(node_name, {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -66,8 +66,8 @@ class ModelUSDLoader(load.LoaderPlugin):
namespace, loader=self.__class__.__name__)
def update(self, container, context):
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
node = rt.GetNodeByName(node_name)
namespace, name = get_namespace(node_name)
@ -108,7 +108,7 @@ class ModelUSDLoader(load.LoaderPlugin):
rt.Select(node)
lib.imprint(node_name, {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -79,8 +79,8 @@ class AbcLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node = rt.GetNodeByName(container["instance_node"])
abc_container = [n for n in get_previous_loaded_object(node)
if rt.ClassOf(n) == rt.AlembicContainer]
@ -97,7 +97,7 @@ class AbcLoader(load.LoaderPlugin):
abc_obj.source = path
lib.imprint(
container["instance_node"],
{"representation": str(repre_doc["_id"])},
{"representation": repre_entity["id"]},
)
def switch(self, container, context):

View file

@ -63,8 +63,8 @@ class OxAbcLoader(load.LoaderPlugin):
)
def update(self, container, context):
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node_name = container["instance_node"]
namespace, name = get_namespace(node_name)
node = rt.getNodeByName(node_name)
@ -99,7 +99,7 @@ class OxAbcLoader(load.LoaderPlugin):
update_custom_attribute_data(node, ox_abc_objects)
lib.imprint(
container["instance_node"],
{"representation": str(repre_doc["_id"])},
{"representation": repre_entity["id"]},
)
def switch(self, container, context):

View file

@ -45,8 +45,8 @@ class PointCloudLoader(load.LoaderPlugin):
"""update the container"""
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node = rt.GetNodeByName(container["instance_node"])
node_list = get_previous_loaded_object(node)
update_custom_attribute_data(
@ -56,7 +56,7 @@ class PointCloudLoader(load.LoaderPlugin):
for prt in rt.Selection:
prt.filename = path
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -55,8 +55,8 @@ class RedshiftProxyLoader(load.LoaderPlugin):
def update(self, container, context):
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node = rt.getNodeByName(container["instance_node"])
node_list = get_previous_loaded_object(node)
rt.Select(node_list)
@ -66,7 +66,7 @@ class RedshiftProxyLoader(load.LoaderPlugin):
proxy.file = path
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):

View file

@ -43,8 +43,8 @@ class TyCacheLoader(load.LoaderPlugin):
"""update the container"""
from pymxs import runtime as rt
repre_doc = context["representation"]
path = get_representation_path(repre_doc)
repre_entity = context["representation"]
path = get_representation_path(repre_entity)
node = rt.GetNodeByName(container["instance_node"])
node_list = get_previous_loaded_object(node)
update_custom_attribute_data(node, node_list)
@ -52,7 +52,7 @@ class TyCacheLoader(load.LoaderPlugin):
for tyc in node_list:
tyc.filename = path
lib.imprint(container["instance_node"], {
"representation": str(repre_doc["_id"])
"representation": repre_entity["id"]
})
def switch(self, container, context):