mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
hotfix/zero out pivot on loaded models
This commit is contained in:
parent
f5f7c13f38
commit
9554b76ed4
3 changed files with 16 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ class AbcLoader(pype.maya.plugin.ReferenceLoader):
|
||||||
|
|
||||||
import maya.cmds as cmds
|
import maya.cmds as cmds
|
||||||
|
|
||||||
|
groupName = "{}:{}".format(namespace, name)
|
||||||
cmds.loadPlugin("AbcImport.mll", quiet=True)
|
cmds.loadPlugin("AbcImport.mll", quiet=True)
|
||||||
nodes = cmds.file(self.fname,
|
nodes = cmds.file(self.fname,
|
||||||
namespace=namespace,
|
namespace=namespace,
|
||||||
|
|
@ -25,6 +26,8 @@ class AbcLoader(pype.maya.plugin.ReferenceLoader):
|
||||||
reference=True,
|
reference=True,
|
||||||
returnNewNodes=True)
|
returnNewNodes=True)
|
||||||
|
|
||||||
|
cmds.makeIdentity(groupName, apply=False, rotate=True, translate=True, scale=True)
|
||||||
|
|
||||||
self[:] = nodes
|
self[:] = nodes
|
||||||
|
|
||||||
return nodes
|
return nodes
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,16 @@ class ModelLoader(pype.maya.plugin.ReferenceLoader):
|
||||||
from avalon import maya
|
from avalon import maya
|
||||||
|
|
||||||
with maya.maintained_selection():
|
with maya.maintained_selection():
|
||||||
|
|
||||||
|
groupName = "{}:{}".format(namespace, name)
|
||||||
nodes = cmds.file(self.fname,
|
nodes = cmds.file(self.fname,
|
||||||
namespace=namespace,
|
namespace=namespace,
|
||||||
reference=True,
|
reference=True,
|
||||||
returnNewNodes=True,
|
returnNewNodes=True,
|
||||||
groupReference=True,
|
groupReference=True,
|
||||||
groupName="{}:{}".format(namespace, name))
|
groupName=groupName)
|
||||||
|
|
||||||
|
cmds.makeIdentity(groupName, apply=False, rotate=True, translate=True, scale=True)
|
||||||
|
|
||||||
self[:] = nodes
|
self[:] = nodes
|
||||||
|
|
||||||
|
|
@ -141,15 +145,18 @@ class AbcModelLoader(pype.maya.plugin.ReferenceLoader):
|
||||||
|
|
||||||
import maya.cmds as cmds
|
import maya.cmds as cmds
|
||||||
|
|
||||||
|
groupName = "{}:{}".format(namespace, name)
|
||||||
cmds.loadPlugin("AbcImport.mll", quiet=True)
|
cmds.loadPlugin("AbcImport.mll", quiet=True)
|
||||||
nodes = cmds.file(self.fname,
|
nodes = cmds.file(self.fname,
|
||||||
namespace=namespace,
|
namespace=namespace,
|
||||||
sharedReferenceFile=False,
|
sharedReferenceFile=False,
|
||||||
groupReference=True,
|
groupReference=True,
|
||||||
groupName="{}:{}".format(namespace, name),
|
groupName=groupName,
|
||||||
reference=True,
|
reference=True,
|
||||||
returnNewNodes=True)
|
returnNewNodes=True)
|
||||||
|
|
||||||
|
cmds.makeIdentity(groupName, apply=False, rotate=True, translate=True, scale=True)
|
||||||
|
|
||||||
self[:] = nodes
|
self[:] = nodes
|
||||||
|
|
||||||
return nodes
|
return nodes
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,15 @@ class RigLoader(pype.maya.plugin.ReferenceLoader):
|
||||||
|
|
||||||
def process_reference(self, context, name, namespace, data):
|
def process_reference(self, context, name, namespace, data):
|
||||||
|
|
||||||
|
groupName = "{}:{}".format(namespace, name)
|
||||||
nodes = cmds.file(self.fname,
|
nodes = cmds.file(self.fname,
|
||||||
namespace=namespace,
|
namespace=namespace,
|
||||||
reference=True,
|
reference=True,
|
||||||
returnNewNodes=True,
|
returnNewNodes=True,
|
||||||
groupReference=True,
|
groupReference=True,
|
||||||
groupName="{}:{}".format(namespace, name))
|
groupName=groupName)
|
||||||
|
|
||||||
|
cmds.makeIdentity(groupName, apply=False, rotate=True, translate=True, scale=True)
|
||||||
|
|
||||||
# Store for post-process
|
# Store for post-process
|
||||||
self[:] = nodes
|
self[:] = nodes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue