renaudll / omtk Goto Github PK
View Code? Open in Web Editor NEWLightweight open-source production tools for Maya
License: MIT License
Lightweight open-source production tools for Maya
License: MIT License
Implement at least the following operators: (>, >=, <, <=, ==, !=)
Using rigRibbon
Current (pymel) implementation is really slow when doing connection traversal.
I've done some quick benchmarks and OpenMaya2 seem the faster for this.
# Benchmark cmds vs OpenMaya vs OpenMaya2
# For each attr of each nodes, get the name of each connected attrs
import time
import pymel.core as pymel
from maya import OpenMaya
from maya.api import OpenMaya as om2
all_ = []
objs = pymel.ls()
print("Scanning {0} nodes".format(len(objs)))
st = time.time()
for obj in objs:
for attr in obj.listAttr():
all_.append(attr.name())
et = time.time()
print("Pymel took: {0}".format(et-st))
###
# Benchmark cmds vs OpenMaya vs OpenMaya2
# For each attr of each nodes, get the name of each connected attrs
import time
all_ = []
mfns = [obj.__apimfn__() for obj in pymel.ls()]
print("Scanning {0} nodes".format(len(mfns)))
st = time.time()
for mfn in mfns:
for i in xrange(mfn.attributeCount()):
a = mfn.attribute(i)
amfn = OpenMaya.MFnAttribute(a)
all_.append(amfn.name())
et = time.time()
print("OpenMaya took: {0}".format(et-st))
###
pymel.select(pymel.ls())
sel = om2.MGlobal.getActiveSelectionList()
all_ = []
print("Scanning {0} nodes".format(sel.length()))
st = time.time()
for i in xrange(sel.length()):
mfn = om2.MFnDependencyNode(sel.getDependNode(i))
for j in xrange(mfn.attributeCount()):
a = mfn.attribute(j)
amfn = om2.MFnAttribute(a)
all_.append(amfn.name)
et = time.time()
print("OpenMaya2 took: {0}".format(et-st))
Result in:
Scanning 286 nodes
Pymel took: 6.77531504631
Scanning 286 nodes
OpenMaya took: 0.150294065475
Scanning 280 nodes
OpenMaya2 took: 0.108594894409
The following class won't work with libSerialization.
from omtk.vendor import libSerialization
class Test(object):
def __init__(self, arg):
self.arg = arg
t = Test()
net = libSerialization.export_network(t)
libSerialization.import_network(net) # fail
This will produce this error:
# Error: TypeError: file <maya console> line 7: __init__() takes exactly 2 arguments (1 given) #
The following modules can be replaced by sane compounds.
But first we need to define the standard public interface for each of thems.
We have bootstrap.sh for UNIX users that don't have rez installed.
However we need a bootstrap.bat for Windows users.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.