From b22f7536caa25754d0f82aeb080287ff8f9d5bfa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 5 Nov 2019 18:27:09 +0100 Subject: [PATCH] moved pymel.core imports to process parts of actions to not slow down discover --- pype/plugins/maya/load/load_ass.py | 2 +- pype/plugins/maya/load/load_gpucache.py | 1 - pype/plugins/maya/load/load_image_plane.py | 4 ++-- pype/plugins/maya/load/load_reference.py | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pype/plugins/maya/load/load_ass.py b/pype/plugins/maya/load/load_ass.py index 979d4b5767..2960e4403e 100644 --- a/pype/plugins/maya/load/load_ass.py +++ b/pype/plugins/maya/load/load_ass.py @@ -1,7 +1,6 @@ from avalon import api import pype.maya.plugin import os -import pymel.core as pm from pypeapp import config @@ -70,6 +69,7 @@ class AssProxyLoader(pype.maya.plugin.ReferenceLoader): import os from maya import cmds + import pymel.core as pm node = container["objectName"] diff --git a/pype/plugins/maya/load/load_gpucache.py b/pype/plugins/maya/load/load_gpucache.py index b98ca8b7f4..9e7938777e 100644 --- a/pype/plugins/maya/load/load_gpucache.py +++ b/pype/plugins/maya/load/load_gpucache.py @@ -2,7 +2,6 @@ from avalon import api import pype.maya.plugin import os from pypeapp import config -import pymel.core as pm reload(config) diff --git a/pype/plugins/maya/load/load_image_plane.py b/pype/plugins/maya/load/load_image_plane.py index e2d94ac82e..e95ea6cd8f 100644 --- a/pype/plugins/maya/load/load_image_plane.py +++ b/pype/plugins/maya/load/load_image_plane.py @@ -1,5 +1,3 @@ -import pymel.core as pc - from avalon import api from Qt import QtWidgets @@ -14,6 +12,8 @@ class ImagePlaneLoader(api.Loader): color = "orange" def load(self, context, name, namespace, data): + import pymel.core as pc + new_nodes = [] image_plane_depth = 1000 diff --git a/pype/plugins/maya/load/load_reference.py b/pype/plugins/maya/load/load_reference.py index a754c3be98..55db019cf4 100644 --- a/pype/plugins/maya/load/load_reference.py +++ b/pype/plugins/maya/load/load_reference.py @@ -1,8 +1,6 @@ - import pype.maya.plugin import os from pypeapp import config -import pymel.core as pm reload(config) import pype.maya.plugin reload(pype.maya.plugin) @@ -20,9 +18,10 @@ class ReferenceLoader(pype.maya.plugin.ReferenceLoader): color = "orange" def process_reference(self, context, name, namespace, data): - import maya.cmds as cmds from avalon import maya + import pymel.core as pm + try: family = context["representation"]["context"]["family"]