Archive for July, 2012

Localise matLib in Softimage

Quick script for nAngus – this will import the material library from a referenced model and change the object assignments from the referenced to the local. Saves importing the refModel completely.

'''
localiseMatLib

Usage: select a referenced matLib. A (local) duplicate will be created and 
objects assigned to these new materials

'''

app = Application

print '##########################'
shaderColl = {}
sel = app.Selection
for x in sel:
	if x.Type == 'library_source':
		# is locked by refmodel?
		if x.lockType == 3:
			matLibName = x.FullName
			print 'Matlib:', matLibName
			for mem in x.items:
				print mem.name
				usedBy = mem.UsedBy
				
				itemList = []
				for obj in usedBy:
					itemList.append(obj.fullName)

				shaderColl[str(mem.name)] = itemList
			print 'shaderColl', shaderColl
			
			# copy the material library
			newMatLib = app.Duplicate(x)
			print newMatLib
			
			# assign objects to the new matlib
			for mem in x.items:
				objectList = shaderColl[str(mem.name)]
				newMatName = mem.FullName.replace(matLibName, str(newMatLib))
				print 'newMatName', newMatName
				for obj in objectList:
					print newMatName, obj
					Application.SIAssignMaterial( obj, newMatName)
		else:
			print 'Pick a matlib that is referenced'

ICE instances into Maya

There was a follow up to an old discussion on the Softimage mailing list concerning transferring particle instance orders from Soft into Maya. I thought I’d document what I said earlier.
Read more

Duplicating Shave setups

Shave and a Haircut… interesting bit of kit.

I’ve been needing to duplicate hair setups onto meshes that aren’t world aligned (they have different animation caches on them, otherwise the same mesh), which means that Shave’s built in duplicating tools won’t necessarily work. For some reason, trying to script the duplication and plugging in a new mesh wasn’t working, until i decided to call a scene refresh. That fixed it! The old refresh trick…

Read more

Return top