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.

si=Application

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:

si=Application
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.