hi all man and thanks for and thanks for the visit :)
I have completed another script and I'm completing the final steps (debug and more options). Now it is a problem. The script provides for the creation of a obj plane "general" called mr_plane and a map environmet. With its creation of plane (and map env), I active every spinner etc .. because I want it to be created first. Now If I close the rollot and re-open it, the spinner ecc are desabled. I know many ways to refresh parameters ecc, but are now bogged down..
My question is:
How to recognize the presence of the plane (and evironment) and activate all parameters? The problem is if the plane is renamed AFTER its creation and if there exists a map environment different or equal...
Any suggestion is welcome! Thanks!!
P.S: I attach the script to be consulted :)
By
Comments (20)
Comment policy
Ok, continue to update the discussion :) I found a way around the problem with the material editor:
Now all work well and the script is almost finished, but...
When I close the rollout or reopen, the preview image appear even if I removed the CA and textureMap in the environmet. If I evalute this string:
I have as a result:
but I delete all!!
However, the strange thing is that if I wait a few minutes with the rollout closed,the described situation disappears !! All work well...
Why the textureMap remains in memory for a long time even if canceled?
Attach the script if you want to consult :D
Attachments
Well, I resolve the problem :) The variable epcb dont work during the delete of CA for the envirinment map; the material is delete but CA link to material no.. Now all work well (least I hope!!)
The problem is that scenematerials don't refresh until next save file.
I posted solution here
http://www.scriptspot.com/forums/3ds-max/general-scripting/ignore-unassi…
Thanks barygazi for reply. Yea, I suppose that have need of refresh something... Strange that cancel the CA for env map and mat in slot editor the problem disappear. However, I put the your fn in the script!!!
Thanks again for adviser!!!
I you want to delete CA from any node (object, material, map etc.) try this fn
This fn will delete all CA. But if you want to delete specific CA lets say by given name then it is a different story :). You can find by youreslf how to do that
ok thanks again barigazy!! I have used two form for delete CA ( material plane and environment map) but this fn appear to be more fast and symple!!
Thanks again!!!
Ok, I continued the script and I arrived in good punt :) Now I just can not figure out how to remove a material from Material Editor know the name or CA !! Too much information to script these days and I am exhausted :D
The problem is that the material associated to environment remain in memory, or if I copy or instance it in the material editor, the rollout update Always the info. i have create a button for clear this data, but dont even clean up the map in ME...
Any suggestions?
In practice: how I delete a material/map n Material Editor knowing only his name or state?
Attachments
Bah... the same function for material dont work... I've create (based on function for mrplane) a fn for probe ball material but without success. The same parameters put in "open do" work well.
In short, the access in texture_shader map dont work.... I to go on my study...
Thanks barigazy :) I study your solution for CA!!
I'm off to work two days but I bring the script as a book to read and study !!
Thanks again for your valuable support and help ;)
I corrected some of your code and added some comments (--***) and function for mr_plane CA. Try this:
Open your script, create plane and change some plane and material properties.
Then close and reopen script. Voila! For EnvMap you need to write code by yourself
You need to do the same thing for enironment map. Create CA and add inside functions for creation of preview map for rollout UI.
Attachments
Hi Branko :)
Bad news, the your script (thanks again :)) dont work!! The parameters dont refresh... I try the function "defPlaneCA node" on new script very simple:
The function here work well, but in your example, no.
I noticed that at the function (the first time in new script) gave me error "IsKindOf" where he found three but was looking for two!! Very strange because value is tes and class rolloutclass then right. I do not think that is the position of the function in the script is wrong... In your opinion, where is the error?
Which parameters not refresh?
I did'nt make the code where you can change material properties in material editor and refresh parameters in rollout. Same things for plane render scale in command panel not refresh same spiner value in your rollout.
For that you can use Timer control bat this is another story.
Your example works because U declared your "Cubo" as global var. Your method not work if you save scene and close/open max and load the same scene and then run script again.
I "getMRPlaneData" function variable "mrp" represents your cube object which holds CA. So u can use
One more thing. You use max2010. This version probably not supports many things which are available in max2014, related to mxs
Heheheeh the spinner, checkboxes ecc are disabled (as in the original) whe re-open the script. As you suggested, I opened the script, created the plane and changed some values in rollout. Closed and reopen the script. The rollout is "closed".
That's why I created a new script, to try to see if the fn that you wrote worked (I have not create any change in Material Editor etc.)
In my work, I have had a chance to test your test script in max2015 64bit, and does not work. Reading in the help, there are differences with the 2010 version (at least not dictated from Autodesk) about CA, but this can not be safely...
Honestly, this opportunity to refresh with CA fascinates me a lot, since it can be convenient in many cases. I discovered something new very useful.
Thanks for the suggestion referred to the "Cubo", I have not thought that if I save scene and close/open max and load the same scene its dont work.
Thanks again Branko and sorry for the trouble :(
P.S: your script for the grid, the first time I installed it worked very well!!!
Attachments
You are right. It's very wierd. Function inside CA is ok but not works. I don't know why.
Anyway...I manage this to works. I left CA only for mr_plane recognition and for label :)
Attachments
Hahahah the function does not work in CA is really strange!!!
Thanks Branko, now work well :)Parameters and rollout refresh and and I'm happy!!!
Now try with the environment map, and I try to implement your recommendations and suggestions. I learned a lot, thanks! I leave this thread open for future updates ;)
I'm sorry again for the inconvenience and thank you very much!
U can use custAttribute which contains all rollout parameters of the plane and env map. When u close rollout this CA will be added on the plane.When you load the script again in the "open" event you need to add fn that will check if plane CA exists and load all parameters back
Hi barigazy and thanks for you reply (sorry for delay). I have not thought of this way for re-check the parameters. Now I try and see if I can use CA, otherwise I must use another method :(
Thanks for reply and support :)
See how I use CA for this tool
http://www.scriptspot.com/3ds-max/scripts/gridtm-addon
U can add one parameter in ParameterBlock like stringTab or soo to store data of your rollout.
Thanks again, I check and study your tool. I hope to get on top of the problem :-D
Ok, I have understand how it works CA, but but I have a question that is not answered: I can enter a CA in a Rollout without create un modifier in the object?? Yes I can but...
If I check with
the object plane, CA "testBox" is known and no modifier is applied (because obviously not created)
es.
but I do not understand how the main "parameters" is updated, while if I create a modifier (attribute holder) con CA there are no problems... Where I am wrong?
PS: This is the first time I use a plug-in MAXScript and I have read dozens of pages helpscript tonight... every time I create a shred of script, opens a new world !! :-D