Announcement

Collapse
No announcement yet.

Maxscript: Condense materials with same name

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

  • #16
    Originally posted by kosso_olli View Post
    Oh Lele, thank you so much! I had to spend days in the past for this!
    Imagine the cost: personal (your most precious time!), and of energy (the PC staying on for you to just click stuff, essentially.).
    This stuff makes me super, super, super happy of doing the job i do.

    The record, however, is currently, and to my knowledge, belonging to someone else:

    Click image for larger version

Name:	image003.png
Views:	329
Size:	3.4 KB
ID:	1057361

    I can't begin to fathom the scene's complexity...
    Lele
    Trouble Stirrer in RnD @ Chaos
    ----------------------
    emanuele.lecchi@chaos.com

    Disclaimer:
    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

    Comment


    • #17
      Oh, wow! Okay, that's something different...
      https://www.behance.net/Oliver_Kossatz

      Comment


      • #18
        Originally posted by kosso_olli View Post
        Oh, wow! Okay, that's something different...
        My thoughts to the dot when i saw it, ahah.
        Lele
        Trouble Stirrer in RnD @ Chaos
        ----------------------
        emanuele.lecchi@chaos.com

        Disclaimer:
        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

        Comment


        • #19
          One thing I just noticed: The whole process takes significantly longer if the Material/Map Browser is open. I have to remember myself to close it before starting.
          https://www.behance.net/Oliver_Kossatz

          Comment


          • #20
            Umh, i had a v003 which i apparently never shared.
            Would you be so kind as to be my guinea pig, Olli?
            It should just work fine, and take care of putting max in its most performant state.
            It's also turned into a macroscript, so when run it will go into the "VRay" category, as "Duplicate Material Condenser", and can then be assigned to shortcuts, menus, and so on.

            Attached (but TEST it first!)

            Attached Files
            Lele
            Trouble Stirrer in RnD @ Chaos
            ----------------------
            emanuele.lecchi@chaos.com

            Disclaimer:
            The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

            Comment


            • #21
              It does work for the macroscript part etc, but it still is much slower when the material/map browser is opened. Which is no problem, as long as you think to close it before running the script. Anyway, this saved tons of my time already. Dreary stuff, these duplicate materials...

              Browser open

              Click image for larger version

Name:	slow.PNG
Views:	448
Size:	6.2 KB
ID:	1057658

              Browser closed

              Click image for larger version

Name:	fast.PNG
Views:	451
Size:	6.5 KB
ID:	1057657
              Last edited by kosso_olli; 08-01-2020, 09:38 AM.
              https://www.behance.net/Oliver_Kossatz

              Comment


              • #22
                Oh, you use slate?
                Material Explorer?
                Standard material browser?
                The material editor (i.e. the old max one) and any child windows should get closed by the script (i couldn't imagine why it would not.).
                I could, with some difficulty, also manage slate.
                I can't touch those other two windows from maxscript (i know of no obvious way to do so, yet.).

                Alas, yes, it'd be wise to not have max refresh the material list each time a material is condensed (which happens MANY times.), so close any browser window with the material list in view.
                Last edited by ^Lele^; 08-01-2020, 12:33 PM.
                Lele
                Trouble Stirrer in RnD @ Chaos
                ----------------------
                emanuele.lecchi@chaos.com

                Disclaimer:
                The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                Comment


                • #23
                  First thing I do on a fresh install: Switch to old material editor and old style material browser. The new one is even slower.
                  https://www.behance.net/Oliver_Kossatz

                  Comment


                  • #24
                    I found working with slate *very* frustrating, both as max user, and as scripter.
                    The new "asset browser" windows and such seem cool, but i fear their handling may be quite problematic (i.e.: so far they seem to lack the maxscript functions to open, close, and so on.).
                    I'm also quite ignorant of those two (the separate material browser, and the material explorer, i think new in 2020), so i'll have to dig into them and see what's what.
                    Thanks for providing me with the doubt!
                    Lele
                    Trouble Stirrer in RnD @ Chaos
                    ----------------------
                    emanuele.lecchi@chaos.com

                    Disclaimer:
                    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                    Comment


                    • #25
                      I have to admit I am still on Max 2017, because every release after that had the annoying double-click bug in the render settings window.
                      https://www.behance.net/Oliver_Kossatz

                      Comment


                      • #26
                        Alright, there is a new bugger in a scene of data given to me.
                        The materials are the same, but they are NUMBERED for every single part. So, in the scene you have as many unique materials as there are objects. They are not really unique, though because it's all the same material, only numbered. I hope the attached screenshots makes it clearer. How would I go about that?

                        Click image for larger version

Name:	mat_mess.JPG
Views:	596
Size:	183.3 KB
ID:	1067558
                        https://www.behance.net/Oliver_Kossatz

                        Comment


                        • #27
                          I assume it would have to be done through hashing, again, minus the name check.
                          I added a second button to the new script version to do that.
                          Note that the script does not pick one specific material name to condense the rest to.
                          The first collected and with a matching hash will replace the rest.

                          Consider the new script mode very much beta, as i have no real scene, i can't quite test it properly, and synthetic testing only goes so far.
                          You've been warned.
                          Last edited by ^Lele^; 23-04-2020, 01:03 AM. Reason: removed the broken script.
                          Lele
                          Trouble Stirrer in RnD @ Chaos
                          ----------------------
                          emanuele.lecchi@chaos.com

                          Disclaimer:
                          The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                          Comment


                          • #28
                            I just tried out the version, and I see the new button etc. But pressing it gives me statistics that it did nothing. Can I send over a test scene for ya?
                            https://www.behance.net/Oliver_Kossatz

                            Comment


                            • #29
                              please !
                              Lele
                              Trouble Stirrer in RnD @ Chaos
                              ----------------------
                              emanuele.lecchi@chaos.com

                              Disclaimer:
                              The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                              Comment


                              • #30
                                Originally posted by kosso_olli View Post
                                I have to admit I am still on Max 2017, because every release after that had the annoying double-click bug in the render settings window.
                                That's fixed recently.
                                Old max version will get fixied when vray is ported over to Qt.

                                Comment

                                Working...
                                X