Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: cecofuli on 2014-02-06, 18:36:20

Title: "Show map in viewport" script?
Post by: cecofuli on 2014-02-06, 18:36:20
Hello guys,
as we now, with CoronaMtl we aren't able to use the "Show map in viewport" tool. 

MATERIAL EDITOR -> Material -> Show material in Viewport as ->

But we have to turn on manually the "show material in viewport" button for every bitmap.
Usually, our work-flow, is to add a "Color Correction" in the DIFFUSE channel. Then, a bitmap map.
So, I would like to know if someone can write a small script to "turn on" automatically, in every Color correction map in the diffuse channel, the "Show material in viewport".

Thanks =)
Title: Re: "Show map in viewport" script?
Post by: arqrenderz on 2014-02-06, 21:26:59
That would be really helpfull! another thing is that everytime i enter a material the basic option tab and material is open, no matter if it was closed a second ago.
Title: Re: "Show map in viewport" script?
Post by: racoonart on 2014-02-06, 22:02:37
I implemented such a thing in the next version of the materials converter (was a requested feature ;) ).
It simply tries to turn on show map for whatever is set in the Diffuse map slots of all the coronaMtls. Works with pretty many maps (like composite etc) but not everything (like CoronaAO or something like that). It's simple and could be made a lot more sophisticated (like only showing maps of selected objects) but it works.
Attention: If you run this line of code it may take a while until max responds again since every map that will be shown in viewport has to be loaded into ram, so no worries, max didn't crash it's just loading.

Code: [Select]
for o in (getclassinstances CoronaMtl) do try(showTextureMap o o.texmapDiffuse true)catch()
Title: Re: "Show map in viewport" script?
Post by: johan belmans on 2014-02-07, 12:07:20
Thanks DeadClown

Keep up the good work

regards

Johan
Title: Re: "Show map in viewport" script?
Post by: cecofuli on 2014-02-07, 14:37:57
Thanks! DeadClown. I didn't see this option in your v0.15 new script.
A suggestion: option to disable it! Useful for fast viewport.
 I know, if I change "true" to "false" in the script I have what I want, but it would be nice to have this option inside your script.
Suggestion: add a macro to your script (maybe an icon? ;-) So, we can use a shortcut.