About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
Glad to be of assistance :)
Glad to be of assistance :)
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
This is some really horrible
This is some really horrible code but it might work:
No idea why refs.dependsOn doesn't work in some cases, in the end I had to switch to the previous implementation you've posted before.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
we need to integrate somehow this function
Find all submaterials in one mat, but unfortunately it is also limited, not going deep enough!!! And after finding the last submaterial, it is possible to use your code that works for any materials without submaterials
This is shorter and does the
This is shorter and does the same:
Anyway, I don't think it's a good idea to work from top to bottom and then back again... Have a look at my previous reply, it's certainly not universal and handles Blend material and Multisub material separately (obviously you'd have to add any other material type that can contain other materials - but there are not really that many cases).
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
Thanks
I've wrote the code to find submaterials inside composite material
hmm...
Who wrote this function?
And how you using it?
I see that it's a recursive function but... it store the result in
All_SubMaterials
(that s'd be array), but this variable is not a part of this function (not defined inside, nor yet passed as argument). So that mean, that this function will work properly only if you define array variable with exact the same name before calling the function. In other words:my recent MAXScripts RSS (archive here)
I found it in materialselector_2
sorry for this if smth !!!!
Thanks, Swordslayer, YOU ARE A GREAT MAN!!!!
You answer is very GOOD and your code works perfectly! I could not even imagine how to do this! And thank you that you found time to think about this problem.
The only thing is that it does not work now for multisubobject materials, or composite, or blend material(those materials which contain submaterials) - I tried your first code for detecting MAP TREE in ActiveSlot in MTLEDITOR:
and it's working well! I have in my slot Multisubobject Material with 3 sub vraymtl's. I get this answer in listener:
When I get inside 1st VrayMTL, I get this answer:
And this is typically what I need + submaterials tree + submaps tree:
Your second code is very POWERFUL. It's working great for Materials which does not contain submaterials. For a material with no submaterials I get very fine result:
or
but for other materials I get no answer :(
We need to combine them somehow!
Is this the way you intend to
Is this the way you intend to use it? If that is so, it could have saved a lot of hassle had you said this in the original post... Getting the material tree going from the lowest level up is way harder than going the other way round:
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
THANKS Swordslayer! You're really perfect scripter
This Script is much better!
But how to make it work for all materials, for example, if we have inside multimaterial blend mtl - then it skips it at all!
or if we have composite material, it does not work! This should be Universal! Where we have
it should recall somehow
if isKindOf mat Blend
and all other mtl types
We need smth recursive - material in material in material...
while
( material contains submaterial) do
And it's very interesting that if I have a vrayLightmtl inside multimaterial then it's showing all it's textures, but if we have blend or composite, override etc it doesn't! I'm really stupid at this! I need to test 3 months to make it work by myself!