Notifications
Clear all

[Closed] newMap = oldMap but better

This is a followup to this old thread.
The problem was with a free plugin, multiSub_Map by Dieter Morgenroth, which we have used from time to time and which is scattered throughout our assets and scene files. Dieter is a busy dude and on to bigger and better things. Instead of pestering him to recompile his plugin for every new version of Max, we are moving on to an alternative, MultiIDMap by Grant Adam. We have several licenses of RPManager and have enjoyed his amazing support over the years.

Anyway, both maps are available for 2009 but MultiIDMap is not available for 2010/11. So, with the help of ZeBoxx, I’ve written this little function to make the transition. ZeBoxx’s solutionwas also cool because it worked across version changes where only one map was available in each version. It is worth a look.

I hope it is useful for someone! Cheers.

(
fn fixMultiSubMap = (
		multiSubMaps = #()
		MultiIDMap2_propNames = for p in (getPropNames MultiIDMap2) collect ( p )
		for msm in (getclassinstances multiSub_map) do append multiSubMaps msm
	 
		MultiSubMaps_SubMaps = for m in MultiSubMaps collect (
				for sm in m.mapList collect ( sm )
			)
		for i = 1 to multiSubMaps.count do
		(
			oldMap = multiSubMaps[i]
			
			oldMapList = oldmap.maplist
			oldMap_SubMaps = MultiSubMaps_SubMaps[i]
			newMap = MultiIDMap2 name:oldMap.name
			
			for i = 1 to (amin oldMap_SubMaps.count 15) do (
			setProperty newMap MultiIDMap2_propNames[i] oldMap_SubMaps[i]
			)
			replaceInstances oldMap newMap
		)
		
	)
	
fixMultiSubMap()
	
)