mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
bug fix remove items not working in scene inventory manager
This commit is contained in:
parent
7c9d4f7439
commit
1d72cd1023
12 changed files with 58 additions and 35 deletions
|
|
@ -242,3 +242,20 @@ def get_previous_loaded_object(container: str):
|
|||
if str(obj) in sel_list:
|
||||
node_list.append(obj)
|
||||
return node_list
|
||||
|
||||
|
||||
def remove_container_data(container: str):
|
||||
"""Function to remove container data after updating, switching or deleting it.
|
||||
|
||||
Args:
|
||||
container (str): container
|
||||
"""
|
||||
if container.modifiers[0].name == "OP Data":
|
||||
all_set_members_names = [
|
||||
member.node for member
|
||||
in container.modifiers[0].openPypeData.all_handles]
|
||||
for current_set_member in all_set_members_names:
|
||||
rt.Delete(current_set_member)
|
||||
rt.deleteModifier(container, container.modifiers[0])
|
||||
|
||||
rt.Delete(container)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
|
||||
from ayon_core.hosts.max.api import lib, maintained_selection
|
||||
from ayon_core.hosts.max.api import lib
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
unique_namespace,
|
||||
get_namespace,
|
||||
|
|
@ -9,7 +9,8 @@ from ayon_core.hosts.max.api.lib import (
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -94,6 +95,5 @@ class FbxLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ from ayon_core.hosts.max.api.lib import (
|
|||
object_transform_set
|
||||
)
|
||||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise, get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -93,6 +95,5 @@ class MaxSceneLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ import os
|
|||
from ayon_core.pipeline import load, get_representation_path
|
||||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object
|
||||
get_previous_loaded_object,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.hosts.max.api import lib
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
maintained_selection, unique_namespace
|
||||
maintained_selection,
|
||||
unique_namespace
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -99,7 +101,7 @@ class ModelAbcLoader(load.LoaderPlugin):
|
|||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
||||
@staticmethod
|
||||
def get_container_children(parent, type_name):
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import os
|
||||
from ayon_core.pipeline import load, get_representation_path
|
||||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise, get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.hosts.max.api import lib
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
|
|
@ -92,6 +94,5 @@ class FbxModelLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ from ayon_core.hosts.max.api.lib import maintained_selection
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -84,6 +85,5 @@ class ObjLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ from ayon_core.hosts.max.api.lib import maintained_selection
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -114,4 +115,4 @@ class ModelUSDLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ from ayon_core.hosts.max.api import lib, maintained_selection
|
|||
from ayon_core.hosts.max.api.lib import unique_namespace
|
||||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object
|
||||
get_previous_loaded_object,
|
||||
remove_container_data
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -105,7 +106,7 @@ class AbcLoader(load.LoaderPlugin):
|
|||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
||||
@staticmethod
|
||||
def get_container_children(parent, type_name):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ from ayon_core.pipeline.load import LoadError
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
|
|
@ -105,4 +106,4 @@ class OxAbcLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
@ -8,7 +8,8 @@ from ayon_core.hosts.max.api.lib import (
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -63,6 +64,5 @@ class PointCloudLoader(load.LoaderPlugin):
|
|||
def remove(self, container):
|
||||
"""remove the container"""
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ from ayon_core.pipeline.load import LoadError
|
|||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
update_custom_attribute_data,
|
||||
get_previous_loaded_object
|
||||
get_previous_loaded_object,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.hosts.max.api import lib
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
|
|
@ -72,6 +73,5 @@ class RedshiftProxyLoader(load.LoaderPlugin):
|
|||
|
||||
def remove(self, container):
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.getNodeByName(container["instance_node"])
|
||||
rt.delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import os
|
||||
from ayon_core.hosts.max.api import lib, maintained_selection
|
||||
from ayon_core.hosts.max.api.lib import (
|
||||
unique_namespace,
|
||||
|
||||
unique_namespace
|
||||
)
|
||||
from ayon_core.hosts.max.api.pipeline import (
|
||||
containerise,
|
||||
get_previous_loaded_object,
|
||||
update_custom_attribute_data
|
||||
update_custom_attribute_data,
|
||||
remove_container_data
|
||||
)
|
||||
from ayon_core.pipeline import get_representation_path, load
|
||||
|
||||
|
|
@ -59,6 +59,5 @@ class TyCacheLoader(load.LoaderPlugin):
|
|||
def remove(self, container):
|
||||
"""remove the container"""
|
||||
from pymxs import runtime as rt
|
||||
|
||||
node = rt.GetNodeByName(container["instance_node"])
|
||||
rt.Delete(node)
|
||||
remove_container_data(node)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue