In continuation on my voyage to automate my tree and plant season setup, I have met a problem. Don’t know if it specifically is a Corona problem, - maybe you can tell me.
I have now made a setup where all trees are made of a Multisub material with a CoronaSelectMtl in the leaves material slot. The selector consist of 5 leaf materials, - WinterSnow (naked branches - see below), Winter (naked branches), Spring (light green leaves, with a random number of invisible leaves), Summer (Full blown green, no hidden leaves) , Autumn, golden brown leaves, with a possibility to hide random leaves).
Each tree has also a linked CoronaSelectMtl that handles the visibility of the snow on the branches, - only visible in the WinterSnow selection, - the rest of the time its attached an Invisible material (opacity = black).
Right now I handle the change of season by a Float Limit controler, that link the Selected properpty on each CoronaSelectMtl that handles all the Season on each tree / Plant. So when the work is done all you have to do is to find ONE of the CoronaSelectMtl’s and change the season - and all will be changed. Works great!
See the setup in the attached screendump.
Now the cumbersome part is to link all those damn Select materals, - and sometimes you delete some plants and sometimes you add some plants - so it is hard to manage in the long run.
I had figured a way to come around that by making a max script with a user interface with a list of the seasons , that would look up all CoronaSelectMtl’s in the scene having the prefix “Season” in its name, and change the select number to a number associated with the selected season in the list.
Here is an example of a name on such a CoronaSelectMtl “Season - Leaves - AM_Birch_01-04”
However, it appears to me, when I select a season in the material editor, that the CoronaSelectMtl can’t be reached per say????
Here is an example ….
sceneMaterials["msEvermotion_Forrest_Beech_Undergrowth"].materialList[2].selected = 3
So the line above refers to a multisub material, named "msEvermotion_Forrest_Beech_Undergrowth", which has a CoronaSelectMtl in the 2nd slot which now has changed the value to 3!!??
Are there no way I can let a script collect all the CoronaSelectMtl’s in the scene - check if it has “Season” in the first part of the name and then change the selected value to them all?
Help!!?