import os import sys import unittest import maya.standalone import revl from maya import OpenMaya _HERE = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.abspath(os.path.join(_HERE, *((os.pardir, ) * 2)))) import bana import benchmarks._preset bana.initialize() maya.standalone.initialize() class MGlobalBench(unittest.TestCase): @classmethod def setUpClass(cls): OpenMaya.MFileIO.newFile(True) revl.run(benchmarks._preset.DEEP, 10000, seed=1.23) def setUp(self): self.names = [] iterator = OpenMaya.MItDependencyNodes() while not iterator.isDone(): obj = iterator.thisNode() self.names.append(OpenMaya.MFnDependencyNode(obj).name())
import os import sys import unittest import maya.standalone from maya import OpenMaya, cmds _HERE = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.abspath(os.path.join(_HERE, *((os.pardir,) * 2)))) import bana import tests._util bana.initialize() maya.standalone.initialize() def _nodeCount(): count = 0 iterator = OpenMaya.MItDependencyNodes() while not iterator.isDone(): count += 1 iterator.next() return count class MFnDependencyNodeTest(unittest.TestCase):