mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Fixes for 🎫 OP-2825
This commit is contained in:
parent
7481eb82a2
commit
6706e90d18
3 changed files with 10 additions and 19 deletions
|
|
@ -178,7 +178,7 @@ class ReferenceLoader(Loader):
|
|||
loader=self.__class__.__name__
|
||||
)
|
||||
loaded_containers.append(container)
|
||||
self._organize_containers([ref_node], container)
|
||||
self._organize_containers(nodes, container)
|
||||
c += 1
|
||||
namespace = None
|
||||
|
||||
|
|
@ -318,6 +318,7 @@ class ReferenceLoader(Loader):
|
|||
@staticmethod
|
||||
def _organize_containers(nodes, container):
|
||||
# type: (list, str) -> None
|
||||
"""Put containers in loaded data to correct hierarchy."""
|
||||
for node in nodes:
|
||||
id_attr = "{}.id".format(node)
|
||||
if not cmds.attributeQuery("id", node=node, exists=True):
|
||||
|
|
|
|||
|
|
@ -121,18 +121,12 @@ class ReferenceLoader(openpype.hosts.maya.api.plugin.ReferenceLoader):
|
|||
if family == "rig":
|
||||
self._post_process_rig(name, namespace, context, options)
|
||||
else:
|
||||
|
||||
if "translate" in options:
|
||||
cmds.setAttr(group_name + ".t", *options["translate"])
|
||||
|
||||
print(new_nodes)
|
||||
return new_nodes
|
||||
|
||||
def load(self, context, name=None, namespace=None, options=None):
|
||||
container = super(ReferenceLoader, self).load(
|
||||
context, name, namespace, options)
|
||||
# clean containers if present to AVALON_CONTAINERS
|
||||
self._organize_containers(self[:], container[0])
|
||||
|
||||
def switch(self, container, representation):
|
||||
self.update(container, representation)
|
||||
|
||||
|
|
|
|||
|
|
@ -58,16 +58,12 @@ class ExtractMayaSceneRaw(openpype.api.Extractor):
|
|||
else:
|
||||
members = instance[:]
|
||||
|
||||
loaded_containers = None
|
||||
if set(self.add_for_families).intersection(
|
||||
set(instance.data.get("families")),
|
||||
set(instance.data.get("family").lower())):
|
||||
loaded_containers = self._add_loaded_containers(members)
|
||||
|
||||
selection = members
|
||||
if loaded_containers:
|
||||
self.log.info(loaded_containers)
|
||||
selection += loaded_containers
|
||||
if set(self.add_for_families).intersection(
|
||||
set(instance.data.get("families"))) or \
|
||||
instance.data.get("family") in self.add_for_families:
|
||||
selection += self._add_loaded_containers(members)
|
||||
self.log.info(selection)
|
||||
|
||||
# Perform extraction
|
||||
self.log.info("Performing extraction ...")
|
||||
|
|
@ -105,7 +101,7 @@ class ExtractMayaSceneRaw(openpype.api.Extractor):
|
|||
if cmds.referenceQuery(ref, isNodeReferenced=True)
|
||||
]
|
||||
|
||||
refs_to_include = set(refs_to_include)
|
||||
members_with_refs = set(refs_to_include).union(members)
|
||||
|
||||
obj_sets = cmds.ls("*.id", long=True, type="objectSet", recursive=True,
|
||||
objectsOnly=True)
|
||||
|
|
@ -121,7 +117,7 @@ class ExtractMayaSceneRaw(openpype.api.Extractor):
|
|||
continue
|
||||
|
||||
set_content = set(cmds.sets(obj_set, query=True))
|
||||
if set_content.intersection(refs_to_include):
|
||||
if set_content.intersection(members_with_refs):
|
||||
loaded_containers.append(obj_set)
|
||||
|
||||
return loaded_containers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue