mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
also resolves OP-6526_3dsMax-loading-an-asset-multiple-times
This commit is contained in:
parent
0825afa73a
commit
86f86db4f8
5 changed files with 12 additions and 13 deletions
|
|
@ -51,7 +51,11 @@ class MaxSceneLoader(load.LoaderPlugin):
|
|||
rt.MergeMaxFile(path, rt.Name("deleteOldDups"))
|
||||
new_container = rt.Container(name=inst_name)
|
||||
max_objects = rt.getLastMergedNodes()
|
||||
|
||||
current_max_objects = rt.getLastMergedNodes()
|
||||
for current_object in current_max_objects:
|
||||
prev_max_objects = prev_max_objects.remove(current_object)
|
||||
for prev_object in prev_max_objects:
|
||||
rt.Delete(prev_object)
|
||||
max_objects_list = []
|
||||
max_objects_list.append(new_container)
|
||||
max_objects_list.extend(max_objects)
|
||||
|
|
|
|||
|
|
@ -26,11 +26,7 @@ class FbxModelLoader(load.LoaderPlugin):
|
|||
rt.FBXImporterSetParam("Preserveinstances", True)
|
||||
rt.importFile(filepath, rt.name("noPrompt"), using=rt.FBXIMP)
|
||||
|
||||
container = rt.GetNodeByName(name)
|
||||
if not container:
|
||||
container = rt.Container()
|
||||
container.name = name
|
||||
|
||||
container = rt.Container(name=name)
|
||||
selections = rt.GetCurrentSelection()
|
||||
import_custom_attribute_data(container, selections)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,18 +27,16 @@ class ObjLoader(load.LoaderPlugin):
|
|||
|
||||
rt.Execute(f'importFile @"{filepath}" #noPrompt using:ObjImp')
|
||||
# create "missing" container for obj import
|
||||
container = rt.Container()
|
||||
container.name = name
|
||||
container = rt.Container(name=name)
|
||||
selections = rt.GetCurrentSelection()
|
||||
import_custom_attribute_data(container, selections)
|
||||
# get current selection
|
||||
for selection in selections:
|
||||
selection.Parent = container
|
||||
|
||||
asset = rt.GetNodeByName(name)
|
||||
self.log.debug(f"{container.ClassID}")
|
||||
|
||||
return containerise(
|
||||
name, [asset], context, loader=self.__class__.__name__)
|
||||
name, [container], context, loader=self.__class__.__name__)
|
||||
|
||||
def update(self, container, representation):
|
||||
from pymxs import runtime as rt
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class ModelUSDLoader(load.LoaderPlugin):
|
|||
rt.USDImporter.importFile(filepath,
|
||||
importOptions=import_options)
|
||||
asset = rt.GetNodeByName(name)
|
||||
|
||||
import_custom_attribute_data(asset, asset.Children)
|
||||
|
||||
return containerise(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue