Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.

import os

import maya.cmds

import IECore
import IECoreMaya

def exportMeshes( meshes, destinationDirectory ) :

	if not os.path.exists( destinationDirectory ) :
		os.makedirs( destinationDirectory )	

	for mesh in meshes :
	
		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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.