Author Topic: "Show map in viewport" script?  (Read 4237 times)

2014-02-06, 18:36:20

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
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 =)

2014-02-06, 21:26:59
Reply #1

arqrenderz

  • Active Users
  • **
  • Posts: 996
  • https://www.behance.net/Arqrenderz1
    • View Profile
    • arqrenderz
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.

2014-02-06, 22:02:37
Reply #2

racoonart

  • Active Users
  • **
  • Posts: 1446
    • View Profile
    • racoon-artworks
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()
Any sufficiently advanced bug is indistinguishable from a feature.

2014-02-07, 12:07:20
Reply #3

johan belmans

  • Primary Certified Instructor
  • Active Users
  • ***
  • Posts: 761
    • View Profile
    • belly.be
Thanks DeadClown

Keep up the good work

regards

Johan

2014-02-07, 14:37:57
Reply #4

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
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.