Refresh object parameter (more info...)

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 :)

AttachmentSize
env_light_hdr.ms10.61 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Michele71's picture

Ok, continue to update the

Ok, continue to update the discussion :) I found a way around the problem with the material editor:

for o = 1 to 24 do
(
if superclassof meditmaterials[o] == texturemap and classof Environment_Probe_Chrome_Ball__mi == texturemap do 
(
meditmaterials[o] =standardmaterial()
)
)

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:

envArr = for m in sceneMaterials where isProperty m #epcb_ca collect m

I have as a result:

#(Environment_Probe_Chrome_Ball__mi:Environment Probe/Chrome Ball (mi))

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

AttachmentSize
env_light_hdr_0.6.ms 18.64 KB
Michele71's picture

Well, I resolve the problem

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!!)

barigazy's picture

...

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...

barigazy

Michele71's picture

Thanks barygazi for reply.

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!!!

barigazy's picture

...

I you want to delete CA from any node (object, material, map etc.) try this fn

fn delCA node = if (caDefs = custAttributes.getDefs node) != null do
(
	if caDefs.count > 0 do (for i = 1 to caDefs.count do custAttributes.delete node caDefs[i])
)

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

barigazy

Michele71's picture

ok thanks again barigazy!! I

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!!!

Michele71's picture

Ok, I continued the script

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?

AttachmentSize
env_light_hdr_0.5.ms 16.68 KB
Michele71's picture

Bah... the same function for

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...

Michele71's picture

Thanks barigazy :) I 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 ;)

barigazy's picture

...

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.

AttachmentSize
env_light_hdr_new.ms 12.22 KB

barigazy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.