def create(cls, name): logger = plogging.getLogger(name) logger = plogging.getLogger(name) logger.setLevel(logger.INFO) return cls(logger, name)
""" Provides a common interface between PyQt4 and PySide. By Rob Galanakis: Practical Maya Programming with Python """ from . import Qt from Qt import QtCore, QtGui, QtWidgets try: import pymel.internal.plogging as logging except ImportError: import logging log = logging.getLogger(__name__) if Qt.__binding__ in ("PySide", "PySide2"): try: import shiboken except: from Shiboken import shiboken log.debug("Imported PySide and shiboken") def _getcls(name): result = getattr(QtWidgets, name, None) if result is None: result = getattr(QtCore, name, None) return result def wrapinstance(ptr):
''' global _allMPx if _allMPx is None: _allMPx = [] for _, cls in inspect.getmembers( mpx, lambda x: inspect.isclass(x) and issubclass(x, mpx.MPxNode)): _allMPx.append(cls) return _allMPx # We want to make sure we know if maya adds a new MPx class! _new = [_mpx.__name__ for _mpx in allMPx() if _mpx not in mpxClassesToMpxEnums] if _new: import pymel.internal.plogging as plog _logger = plog.getLogger('pymel') _logger.raiseLog( _logger.WARNING, 'found new MPx classes: %s. Run pymel.api.plugins._suggestNewMPxValues()' % ', '.join(_new)) #=============================================================================== # Plugin Registration / loading #=============================================================================== registered = set() pyNodeMethods = {} def _pluginModule():
def allMPx(): ''' Returns a list of all MPx classes ''' global _allMPx if _allMPx is None: _allMPx = [] for _, cls in inspect.getmembers(mpx, lambda x: inspect.isclass(x) and issubclass(x, mpx.MPxNode)): _allMPx.append(cls) return _allMPx # We want to make sure we know if maya adds a new MPx class! _new = [_mpx.__name__ for _mpx in allMPx() if _mpx not in mpxClassesToMpxEnums] if _new: import pymel.internal.plogging as plog _logger = plog.getLogger('pymel') _logger.raiseLog(_logger.WARNING, 'found new MPx classes: %s' % ', '.join(_new)) #=============================================================================== # Plugin Registration / loading #=============================================================================== registered = set() pyNodeMethods = {} def _pluginModule(): return inspect.getmodule( lambda: None ) def _pluginName():
Returns a list of all MPx classes """ global _allMPx if _allMPx is None: _allMPx = [] for _, cls in inspect.getmembers(mpx, lambda x: inspect.isclass(x) and issubclass(x, mpx.MPxNode)): _allMPx.append(cls) return _allMPx # We want to make sure we know if maya adds a new MPx class! _new = [_mpx.__name__ for _mpx in allMPx() if _mpx not in mpxClassesToMpxEnums] if _new: import pymel.internal.plogging as plog _logger = plog.getLogger("pymel") _logger.raiseLog(_logger.WARNING, "found new MPx classes: %s" % ", ".join(_new)) # =============================================================================== # Plugin Registration / loading # =============================================================================== registered = set() pyNodeMethods = {} def _pluginModule(): return inspect.getmodule(lambda: None)
def getLogger(name): if 'guppy_animation_tools' in name: name = name.replace('guppy_animation_tools', 'gat', 1) return plogging.getLogger(name)
(c) Jeffrey "italic" Hoover italic DOT rendezvous AT gmail DOT com Licensed under the Apache 2.0 license. This script can be used for non-commercial and commercial projects free of charge. For more information, visit: https://www.apache.org/licenses/LICENSE-2.0 """ import pymel.core as pmc import pymel.internal.plogging as logging logging.basicConfig(level=logging.WARN) log = logging.getLogger(__name__) log.setLevel(logging.WARN) def get_curves(direction=None): curves = pmc.animCurveEditor("graphEditor1GraphEd", q=True, curvesShown=True) log.debug(curves) if not curves: return [] displayed_curves = [ ("_".join(x.split("_")[:-1]), x.split("_")[-1]) for x in curves ] log.debug(displayed_curves) keys = list(set(pmc.findKeyframe(x[0], attribute=x[1], which=direction) for x in displayed_curves)) keys.sort()