Announcement

Collapse
No announcement yet.

Script For "Show Shaded Material In Viewport"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script For "Show Shaded Material In Viewport"

    Is there any script to show the diffuse map (or with mix materials the first diffuse map) of all materials in the scene?
    FStorm 1.3.0d I Max 2018 I Win7 I i7 5930k I 64GB I 3 x 1080Ti

  • #2
    Done. Only one line:
    Code:
    for i in sceneMaterials do try(showTextureMap i (if(try(if i.diffuse_tex!=undefined do true)catch(false))then i.diffuse_tex else if(try(if i.diffuse_tex.texture1!=undefined do true)catch(false))then i.diffuse_tex.texture1)ON)catch()
    Replace "ON" by "OFF" to hide all diffuse maps in viewport.
    Last edited by Sylk; 11-28-2016, 02:30 PM.
    Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
    Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

    Comment


    • #3
      Originally posted by Sylk View Post
      Done. Only one line:
      Code:
      for i in sceneMaterials do(try(showTextureMap i (if(try(if i.diffuse_tex!=undefined do true)catch(false))then i.diffuse_tex else if(try(if i.diffuse_tex.texture1!=undefined do true)catch(false))then i.diffuse_tex.texture1)ON)catch())
      Replace "ON" by "OFF" to hide all diffuse maps in viewport.
      What do I have to do exactly? Just paste it into a fresh MaxScript and Evaluate?
      Not working for me...
      Last edited by RobSteady; 11-28-2016, 03:09 PM.
      FStorm 1.3.0d I Max 2018 I Win7 I i7 5930k I 64GB I 3 x 1080Ti

      Comment


      • #4
        Yes.
        Or you can paste it into the maxscript field at the bottom-left of the max window, and press enter.

        It works on 2017 and it should on 2014.
        Last edited by Sylk; 11-28-2016, 04:28 PM.
        Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
        Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

        Comment


        • #5
          Mhhh... Somehow it does not work for me. Nothing happens.
          Last edited by RobSteady; 11-28-2016, 04:50 PM.
          FStorm 1.3.0d I Max 2018 I Win7 I i7 5930k I 64GB I 3 x 1080Ti

          Comment


          • #6
            Be sure copy full code.
            Be sure you have FStorm materials in scene with diffuse map to show change.
            Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
            Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

            Comment


            • #7
              Hello !
              For starters check whether all materials are FStorm.

              for i in sceneMaterials do (
              s = ClassOf i
              print (s)
              )


              Just run this script in MS (Evalute all). And look what materials in the scene .. If there FStormPortal that these materials do not have ,aps such as Diffuse, FStormPortal to exclude. checks can be realized through (if ClassOf != 'FStormPortal')

              Comment


              • #8
                Originally posted by Refik View Post
                Hello !
                For starters check whether all materials are FStorm.
                Useless. My script affect only FStorm mat with FStormBitmap on diffuse slot, and FStorm mat with FStormMix on diffuse slot with FStormBitmap on texture1 slot.
                FStormPortal or other is not a problem.
                Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
                Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

                Comment


                • #9
                  If I insert in the diffuse map FStormColorCorrection it will not work ... Though in FStormColorCorrection inside will FStormBitmap ...
                  In any case, you need to modify these moments ... as ..
                  if (classOf i.diffuse_tex == FStormColorCorrection) do showTextureMap i i.diffuse_tex.input on

                  Comment


                  • #10
                    Yeah, i just did quick line for demand.

                    Better code to affect all is this:
                    Code:
                    for i in sceneMaterials do try(showTextureMap i(case classOf(d=i.diffuse_tex)of(FStormColorCorrection:(d.input);FStormDirt:(d.radius_texture);FStormGradient:(d.source_map);FStormMix:(d.texture1);FStormOutput:(d.input);default:d)ON)catch()
                    Last edited by Sylk; 11-28-2016, 07:52 PM.
                    Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
                    Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

                    Comment


                    • #11
                      Originally posted by Sylk View Post
                      Yeah, i just did quick line for demand.

                      Better code to affect all is this:
                      Code:
                      for i in sceneMaterials do try(showTextureMap i(case classOf(d=i.diffuse_tex)of(FStormColorCorrection:(d.input);FStormDirt:(d.radius_texture);FStormGradient:(d.source_map);FStormMix:(d.texture1);FStormOutput:(d.input);default:d)ON)catch()
                      now it seems to finish =)

                      Comment


                      • #12

                        And there is the "Show Maps in Viewport Button"
                        Last edited by RobSteady; 11-28-2016, 08:31 PM.
                        FStorm 1.3.0d I Max 2018 I Win7 I i7 5930k I 64GB I 3 x 1080Ti

                        Comment


                        • #13
                          Originally posted by Sylk View Post
                          Yeah, i just did quick line for demand.

                          Better code to affect all is this:
                          Code:
                          for i in sceneMaterials do try(showTextureMap i(case classOf(d=i.diffuse_tex)of(FStormColorCorrection:(d.input);FStormDirt:(d.radius_texture);FStormGradient:(d.source_map);FStormMix:(d.texture1);FStormOutput:(d.input);default:d)ON)catch()
                          Sorry, still not working for me
                          Could be the Multi/Sub-Object Materials?
                          Last edited by RobSteady; 11-29-2016, 09:50 AM.
                          FStorm 1.3.0d I Max 2018 I Win7 I i7 5930k I 64GB I 3 x 1080Ti

                          Comment


                          • #14
                            Here is the macro button version. Clic the button let you choose Show or Hide maps.

                            Extract zip into 3dsmax folder.
                            Find macro in category "SGX FStormTools".
                            Attached Files
                            Last edited by Sylk; 11-29-2016, 10:12 AM.
                            Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
                            Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

                            Comment


                            • #15
                              Originally posted by RobSteady View Post
                              Sorry, still not working for me
                              Could be the Multi/Sub-Object Materials?
                              No problem with multisub. (edit: problem with multisub)

                              Can you post screenshot from your slate material editor, please?
                              Try with the macro version.
                              Last edited by Sylk; 11-30-2016, 03:58 AM.
                              Software: FStormRender: 1.5.0h | Drivers NV: 456.71 | 3dsMax: 2020.3 | Windows: 10 x64
                              Hardware: Gpu: GTX1080 Phoenix GLH | Cpu: i7-2600k@4.5GHz | Ram: 16GB | SSD: Samsung 860 Pro

                              Comment

                              Working...
                              X