Dynamically applying scripts to new selections of obj/clus?
Posted: 06 Jan 2016, 00:44
I have recently started to script in SI with Jscript (it's what I know more or less) - to automate some manual work.
It has saved me a lot of time thus far.
Now.. I'd like to save it even more, and learn how to apply a string of commands to dynamic selections.
Say, I have a number of objects with said names on clusters, and I want to apply unique corresponding shaders.
I import a new object with a similar set of cluster naming conventions, but with a different cluster set, and then apply said unique corresponding shaders.
I would want to run the script to be able to recursively apply the materials to different clusters.
Here is what I have used, where the "M05_sideback-C4" would be the "tag" in the cluster selections, and then said tag would assign the corresponding material "tag".
How would I programm this to search for the tags in a new selection/object/set of clusters and apply each material according to their "tag"?
Or can this be done in ICE? I am still new to programming, and have no idea how arrays might work - some pointers would be very much appreciated. ;;)
It has saved me a lot of time thus far.
Now.. I'd like to save it even more, and learn how to apply a string of commands to dynamic selections.
Say, I have a number of objects with said names on clusters, and I want to apply unique corresponding shaders.
I import a new object with a similar set of cluster naming conventions, but with a different cluster set, and then apply said unique corresponding shaders.
I would want to run the script to be able to recursively apply the materials to different clusters.
Here is what I have used, where the "M05_sideback-C4" would be the "tag" in the cluster selections, and then said tag would assign the corresponding material "tag".
Code: Select all
SelectObj("CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_001_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_002_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_003_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_004_M05_sideback-C4_0000_M05_sideback-C4_0000", null, null);
AssignMaterial("Sources.Materials.DefaultLib.M05_sideback-C4_0000_png,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_001_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_002_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_003_M05_sideback-C4_0000_M05_sideback-C4_0000,CROWD_platform_01.polymsh.cls.M05_sideback-C4_0000_004_M05_sideback-C4_0000_M05_sideback-C4_0000", siLetLocalMaterialsOverlap);
Or can this be done in ICE? I am still new to programming, and have no idea how arrays might work - some pointers would be very much appreciated. ;;)