Converting EMDL files

Recently a few customers have asked Autodesk support about converting their Softimage EMDL files, and whether they could somehow get Softimage licenses to do it. (One Autodesk person even asked me whether I know anyone who could answer Softimage questions! 😉

You actually don’t need a license, because you can do it with xsibatch. Just add the -processing flag to do it without using a license.

xsibatch.exe -processing -script "S:\solidangle\softimage\convert_emdl.pys" -main "main"

Here’s an example script that loads a model and exports it to Alembic:

def main():
Application.ImportModel("S:\Program Files\Autodesk\Softimage 2015 SP2\Data\XSI_SAMPLES\Models\Jaiqua.emdl", "", "", "", "", "", "")

path = "S:\Projects\softimage\support\Models\{0}.abc".format( Application.Selection(0).Name )

model = "B:{0}".format( Application.Selection(0).Name )

Application.AbcExport( path, 1,2, model, False, "Ogawa", "Color, Scale, Size, PointVelocity, Orientation, AngularVelocity, Shape, StrandPosition, StrandVelocity, StrandDeform, StrandOrientation, StrandUpVector, StrandColor, StrandSize, ColorAlongStrands", "Materials, MaterialID, PointUserMotions", "")

PS Here’s the Softimage SDK help

Finding materials used by a model

Here’s one way to get the materials used by model. Note that this will also get any materials applied to clusters.


def get_mdl_materials( m ):
	from win32com.client import constants as c
	return m.FindObjects( c.siMaterialID )

Application.GetPresetModel("Man_Character", "Man_Character", "", "Character.Character_Designer")
for m in get_mdl_materials( si.Dictionary.GetObject( 'Man_Character' ) ):
	print m

And here’s an old-school way that uses a couple of string expressions:

mdl = si.Dictionary.GetObject( 'Man_Character' )

import win32com.client
mats = win32com.client.Dispatch( "XSI.Collection" )
mats.Items = '{0}.{1},{0}.{2}'.format(mdl.Name, "*.cls.*.material", "*.material")

for m in mats:
	print (m)

Working with large scenes and models

Softimage 2014 now supports scene (.scn) and model (.emdl) files of size up to 4 GB. That’s on Windows. On Linux, the limit is [still?] 2 GB.

Note that this applies only to scenes and models saved from Softimage 2014. You can’t save a huge 3GB scene out of Softimage 2013 and load it into Softimage 2014. Large files saved by 2013 and older are not saved properly, and won’t load into 2014.

On Linux, Softimage 2014 will warn you if you save a file that exceeds 2GB. Presumably that will give you a chance to reduce the file size, or save out models, so you can re-load the assets later.