Skip to content

ExamplesMayaMeshExport

Ben Toogood edited this page Jun 13, 2013 · 3 revisions

Exporting meshes from maya into the custom cortex format is pretty straightforward. See how it can be used in ExamplesProceduralsAnimatedMesh.

importosimportmaya.cmdsimportIECoreimportIECoreMayadefexportMeshes( meshes, destinationDirectory ) :
ifnotos.path.exists( destinationDirectory ) :
os.makedirs( destinationDirectory ) formeshinmeshes :
converter=IECoreMaya.FromMayaShapeConverter.create( mesh )
converted=converter.convert()
writer=IECore.ObjectWriter( converted, destinationDirectory+"/"+mesh+".cob" )
writer.write()
allMeshes=maya.cmds.ls( selection=True, noIntermediate=True, dag=True, type="mesh" )
exportMeshes( allMeshes, "/tmp/myMeshes" )

Clone this wiki locally