from setuptools import setup, Extensionfrom Cython.Build import cythonizeimport os
def _script_path(module_name): return os.path.join(os.path.dirname(__file__), "src", module_name).replace("//", "/")
setup( name="vzUtils", ext_modules=cythonize( Extension("vzUtils", language="c++", sources=[_script_path("vzUtils.pyx")], include_dirs=[ "C:/Program Files/Autodesk/Maya2019/Python/Lib/site-packages", "C:/Program Files/Autodesk/Maya2019/include", os.path.join(os.path.dirname(__file__), "src").replace("//", "/") ], libraries=[ "Foundation", "OpenMaya", "OpenMayaUI", "OpenMayaAnim", "OpenMayaFX", "OpenMayaRender", "Image" ], library_dirs=[ "C:/Program Files/Autodesk/Maya2019/lib", "C:/Program Files/Autodesk/Maya2019/Python/DLLs" ]) ))
# distiutils: Language=c++
from maya import OpenMaya
cpdef list_nodes_connections(node, list node_list): if node.isNull(): return
node_plugs = OpenMaya.MPlugArray() fn = OpenMaya.MFnDependencyNode(node)
if fn.typeName() in ["mesh", "polyCurve"]: return
fn.getConnections(node_plugs) cdef int i = 0 cdef int k = 0 for i in range(node_plugs.length()): plugs_connected = OpenMaya.MPlugArray() node_plugs[i].connectedTo(plugs_connected, True, False) for k in range(plugs_connected.length()): list_nodes_connections(plugs_connected[k].node(), node_list)
if fn.name() not in node_list: node_list.append(fn.name())
cpdef list_nodes_connections(MObject nodes, list node_list):
--Regards,Gabriel Valderramos
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/dc8e094c-b78a-4077-b7e1-1d9af18f5ae7%40googlegroups.com.