Evgeniy Zaitsev Technical Artist


Generate random uv’s Maya Python API

Quick example working with OpenMaya.MFnMesh setUV and assignUV.
Limitation : works only on objects with no construction history.
Download : apiGenerateUV.zip


Houdini course at CG Spectrum

My student work during the course:

Filed under: Houdini Comments Off

Arnold for Maya – Custom velocity Motion Blur

Quick tutorial, easy way how you can transfer velocity vector from Houdini using Alembic.
Download : customVelocity.zip


Convert Vertex Normals to Soft/Hard Edges using Maya Python API

Download : vtxNormalsToSoftHardEdges.zip

import vtxNormalsToSoftHardEdges; vtxNormalsToSoftHardEdges.convertNormals();


Houdini: roundcorners python node

This python node allows user to get equivalent of mia_roundcorners in Houdini.
Download : roundcorners_example
Download : roundcorners_digitalAsset

Filed under: Houdini Continue reading

Houdini: Toggle Views

My first Houdini Python Script. This script toggles Camera from PERSP view to SIDE view and back ( depends of camera vector ). You just need to make a Python shelf. Create new Python Tool and link my script.
Something like:

import view3d_toggle_views

Download : Toggle Views

Filed under: Houdini Comments Off

get MDagPath() from MObject()

Quick example

import maya.OpenMaya as OpenMaya

m_obj       = OpenMaya.MObject() # should get from any code above
m_dagPath   = OpenMaya.MDagPath()
if m_obj.hasFn( OpenMaya.MFn.kDagNode ):
    OpenMaya.MDagPath.getAPathTo( m_obj, m_dagPath )
    print( m_dagPath.fullPathName() )

Traversing whole scene file Maya Python API

Quick example

import maya.OpenMaya as OpenMaya

m_iterator = OpenMaya.MItDag( OpenMaya.MItDag.kDepthFirst )
while not m_iterator.isDone():
	m_obj   = m_iterator.currentItem()
	m_objFn = OpenMaya.MFnDagNode( m_obj )
	#if ( OpenMaya.MFn.kMesh == m_obj.apiType() ):
	print( m_objFn.fullPathName() )


Get all extra attributes Maya Python API

Select the node and run:

m_list = getAllExtraAttributes()
print( m_list )


Get all attributes from the kFileTexture node Maya Python API

import maya.OpenMaya as OpenMaya

m_iterator = OpenMaya.MItDependencyNodes( OpenMaya.MFn.kFileTexture )
m_nodeFn   = OpenMaya.MFnDependencyNode()

while not m_iterator.isDone():
    m_object = m_iterator.thisNode()
    m_nodeFn.setObject( m_object )
    print( "  --- {0} --- ".format( m_nodeFn.name()) )
    for i in range( m_nodeFn.attributeCount() ):
        m_atrr   = m_nodeFn.attribute(i)
        m_fnAttr = OpenMaya.MFnAttribute( m_atrr )
        print( m_fnAttr.name() )