Author Topic: Show shaded material in viewport always on  (Read 3931 times)

2019-05-09, 17:27:00

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG

Hello friends,.

Is there a way for all created materials to automatically appear in the viewport?
Having to click the "show shader material in the viewport" button every time I create a material is very annoying.

I'm not talking about an option like the show map button on the VP crown convert, I'm talking about an option for the material editor button to always be turned on.

2019-05-13, 10:47:08
Reply #1

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
There are various options to deal with this - depends on what you would like to have. You can have

- a button on your personal toolbar to toggle that setting for the material(s) of selected objects (that's what I use)
- as a variant, a button which switches show in viewport on for the materials of selected objects (and maybe another to switch if off)
- or a script which automatically activates show in viewport when assigning a material to an object (sometimes I use this one)
- or a script which always switches it on automatically after loading a scene
- or ... whatever :]

Your choice. I'm not aware of any built in option to achieve this.


Good Luck



Never underestimate the power of a well placed level one spell.

2019-05-15, 18:58:09
Reply #2

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG

Yes, these options I know. But what I'm looking for is a way to show difuse maps automatically in the viewport when I apply things, I just want to eliminate the need to click a button for that function.

2019-05-15, 20:32:26
Reply #3

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
when I apply things


Now, what exactly do you mean here? Connecting a bitmap to a material? Or assign a material? Or something else?


Good Luck



Never underestimate the power of a well placed level one spell.

2019-05-18, 00:15:54
Reply #4

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG
Please watch the video and you'll understand.

2019-05-20, 20:10:16
Reply #5

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
That's what I listed here:

- or a script which automatically activates show in viewport when assigning a material to an object (sometimes I use this one)

Here is my old script, I use almost solely a toggle button now because you cannot generally activate diffuse tex or material display and that's it. On many materials you would rather like to see some completely different map type in the viewport, especially while tweaking. But it should do what you have shown. Throw it in your "scripts\startup" directory or just execute it to test.


Good Luck


Never underestimate the power of a well placed level one spell.

2019-05-21, 00:57:52
Reply #6

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG
Cool, I'll try. Thanks for sharing

2019-05-21, 01:08:04
Reply #7

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG
This script worked PERFECTLY on the first few tests, but now I get this error message. I'm sorry, but I'm totally noob on schedule, I was in doubt about editing the script.
How do I create alternations in code to toggle between diffuse and reflect? gloss for example?
« Last Edit: 2019-05-21, 01:26:42 by Lucas Rodrigues »

2019-05-21, 09:36:51
Reply #8

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
The viewport display is cumbersome to handle outside (and even inside) SME and this tiny script was never meant to be something else but working in the background and activating a basic map display immediately. There is no toggle, not even a button :) Better to do everything else in SME, really. But if you want to play around, these are the texmap properties of a Corona material which you could use instead of "textmapDiffuse":

Code: [Select]
  .texmapDiffuse
  .texmapReflect
  .texmapReflectGlossiness
  .texmapRefract
  .texmapRefractGlossiness
  .texmapOpacity
  .texmapBump
  .texmapTranslucency
  .texmapReflectAnisotropy
  .texmapReflectAnisotropyRotation
  .texmapIor
  .texmapFresnelIor
  .texmapDisplace (texmapDisplacement)
  .texmapReflectBgOverride
  .texmapRefractBgOverride
  .texmapSelfIllum (texmapSelfIllumination)
  .texmapTranslucencyFraction
  .texmapAbsorption
  .texmapScatterColor
  .texmapSssAmount
  .texmapSssRadius
  .texmapSssScatterColor

Remember to evaluate scripts in the maxscript editor after changes (Ctrl+E).

BTW: Also see https://forum.corona-renderer.com/index.php?topic=19916.0

I get this error message

Which error do you get? I've been using it in Max2016+2018.


Good Luck




Never underestimate the power of a well placed level one spell.

2019-05-21, 13:39:33
Reply #9

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG
I'm sorry, I forgot to share the error print. I talk about this mistake
https://i.imgur.com/uPaxGry.jpg

2019-05-21, 13:51:47
Reply #10

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
You should never get this when using it as startup script (it has been one). Manually running: Load into maxscript editor and press Ctrl-E.


Good Luck



Never underestimate the power of a well placed level one spell.

2019-05-21, 14:09:16
Reply #11

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG
Wow, now this works great. I thank you with all my heart for all your willingness to help. Can I share this script with some friends?

2019-05-21, 14:40:23
Reply #12

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Haha sure :) No magic inside.


Good Luck



Never underestimate the power of a well placed level one spell.

2019-05-21, 14:41:05
Reply #13

Lucas Rodrigues

  • Active Users
  • **
  • Posts: 72
    • View Profile
    • Ilustra Studios CG