sketchucation logo sketchucation
    • Login
    βŒ› Sale Ending | 30% Off Profile Builder 4 ends 30th September

    [Plugin] Remove group materials, leave geometry material

    Scheduled Pinned Locked Moved Plugins
    88 Posts 27 Posters 60.6k Views 27 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EarthMoverE Offline
      EarthMover
      last edited by

      I want to extend my thanks as well. This will be an invaluable ruby to help speed up processing/parsing times for Vray!

      3D Artist at Clearstory 3D Imaging
      Guide Tool at Winning With Sketchup
      Content Creator at Skapeup

      1 Reply Last reply Reply Quote 0
      • plot-parisP Offline
        plot-paris
        last edited by

        Jacksons suggestion for the script to apply the material of the group to all geometry with default colour within the group before removing the group-colour is a fantastic idea.

        Imagine you have a rather complex group, several faces are painted with different materials, the rest is not coloured yet. all you have to do now is apply the colour for the rest of the faces to the group and rund Matthieu's script. that is much faster, than selecting all the untextured faces manually...

        of course it could be quite tricky if you have nested groups within the painted group. then the script had to go down all the hierarchy into the lowest groups to paint the faces. of course it had to work from the 'inside' to the 'outside', so that the colour on the outermost group has lowest priority...

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          My earlier 'GlobalMaterialChange' script works on a selection: so by using Didier's filter tools you could just have what you want selected [e.g. Groups] and 'change all' materials in that to <default>. It can 'mine' into a group or component to change things within it too...
          http://www.sketchucation.com/forums/scf/viewtopic.php?p=96863#p96863
          Or am I missing something ?

          TIG

          1 Reply Last reply Reply Quote 0
          • free agentF Offline
            free agent
            last edited by

            while on the subject of helping out vray, vray SR1 creates vray materials of all materials in the scene even the materials on lines (multi-coloured from CAD imports) could there also be a script to remove all materials from lines? that way vray wouldnt create any unnecessary materials

            http:i167.photobucket.comalbumsu143FreeAgent84bug.gif

            1 Reply Last reply Reply Quote 0
            • M Offline
              Matt666
              last edited by

              Hi all!
              Sorry for the delay, I was in London last week...

              So:

              @unknownuser said:

              it would actually apply the group material to the default geometry itself
              Yes, it's possible. I will add a message box to the script.

              @unknownuser said:

              p.s. I have one suggestion for your script above, maybe it would be better if it was named "Remove_CG_Mat" as ""Delete_CG_Mat" sounds like it would delete/purge those materials from the actual skp file, which might make people a little reluctant to use it.
              Ok!

              @unknownuser said:

              while on the subject of helping out vray, vray SR1 creates vray materials of all materials in the scene even the materials on lines (multi-coloured from CAD imports) could there also be a script to remove all materials from lines? that way vray wouldnt create any unnecessary materials
              Yes, it's possible. Vray uses attributes to record all object material. You just want to remove it.

              I just need for time to do that πŸ˜„

              Frenglish at its best !
              My scripts

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jackson
                last edited by

                Matthieu,

                You are the man! If you can produce a ruby script which removes group materials and applies them to the default geometry you will save me about 3 day's work on this model alone! I'm trying to update my portfolio so this would be of enormous benefit to me as I've got lots to do and very little time to do it.

                http://i449.photobucket.com/albums/qq215/JacksonPhotobucket/Malm1.jpg

                Jackson

                1 Reply Last reply Reply Quote 0
                • M Offline
                  Matt666
                  last edited by

                  To Free Agent, can you share an example with Vray line material, please ?
                  Thank you !

                  Frenglish at its best !
                  My scripts

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jackson
                    last edited by

                    Matthieu,

                    Free Agent means SUs own materials on lines, there's no separate VRay materials- it just creates/links it's own materials from those of SU. A standard skp model will contain the line materials Free Agent is describing.

                    Free Agent,

                    When SU imports dwgs and adds materials to lines (i.e. layer materials from Autocad) just delete those materials either by right-clicking on them in SU's material editor or (if there's lots of them) by opening the imported dwg group, switch to wireframe view, select all, paint with the default SU material and then purge the file. This will also delete all unnecessary VfSU materials.

                    Jackson

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      Matt666
                      last edited by

                      Ok, but I will wait for Free agent answer to do smt πŸ˜„ !
                      I've updated post of the script with demanded improvments... I did'nt really test it... πŸŽ‰

                      Frenglish at its best !
                      My scripts

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jackson
                        last edited by

                        Matthieu,

                        I just ran it on this fairly simple model, but unfortunately it has applied the wrong materials to the groups, see before and after image below. I thought it might be applying materials from higher up the group heirarchy, but that doesn't seem to be the case. Any idea what's going wrong? I can send you the skp file if you like.

                        http://i449.photobucket.com/albums/qq215/JacksonPhotobucket/HouseRemoveCGMaterialsTest.jpg

                        Jackson

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          Matt666
                          last edited by

                          Can you send me the skp, please?
                          Thank you !
                          Sorry, I don't have a lot of time to test... 😞

                          Frenglish at its best !
                          My scripts

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jackson
                            last edited by

                            Here's the Rapidshare link:

                            404 Not Found

                            favicon

                            (rapidshare.com)

                            LOL, definitely no need to apologise!

                            Jackson

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              Matt666
                              last edited by

                              Hi Jackson !
                              I don't forget your demand !!
                              I have no time to do smt now, and I have a problem of "Hierarchy" in your drawing example... So it's quite difficult !
                              But I think I will show smt in a few days..

                              See you soon !

                              Frenglish at its best !
                              My scripts

                              1 Reply Last reply Reply Quote 0
                              • J Offline
                                Jackson
                                last edited by

                                Matthieu,

                                No worries, your original "Remove CG Materials" script has already saved me about 20 hour's work so I'm pretty happy already!

                                Best regards,
                                Jackson

                                Jackson

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  Matt666
                                  last edited by

                                  We loosed some posts here 😞

                                  So, script's post has been updated... Not tested enough, but I'm a few confident ! πŸ˜„
                                  Now all Comp/Groups materials are transfered to geometry if you want.
                                  😎

                                  Frenglish at its best !
                                  My scripts

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    Jackson
                                    last edited by

                                    Seems to work perfectly Matthieu! I just ran it with the test file I sent you and it reassigned all the materials in just a few seconds. This is such a valuable little tool for "VRay for SU" users, I will spread the good word (and your name) over at the ASGvis forums.

                                    Many many thanks for creating this little gem, MERCI BEAUCOUP!
                                    Jackson

                                    Jackson

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      Matt666
                                      last edited by

                                      πŸ˜„
                                      You're welcome, Jackson ! Glad to help you !

                                      Frenglish at its best !
                                      My scripts

                                      1 Reply Last reply Reply Quote 0
                                      • plot-parisP Offline
                                        plot-paris
                                        last edited by

                                        thanks so much, Matthieu! 😍

                                        only one minor thing still: while all the materials are applied to faces and the material of the outer group is changed to default, nested groups still keep their assigned material. that is not very important, because the face's textures are the dominant ones. but to be perfectly accurate, it would be great if the plugin could assign the default material to nested groups too.

                                        one positive side effect I experienced is, that your plugin coloures front and back faces. that is really good!

                                        1 Reply Last reply Reply Quote 0
                                        • M Offline
                                          Matt666
                                          last edited by

                                          Hi plot-paris !
                                          ok, that's been updated !
                                          Thank you for testing !

                                          Frenglish at its best !
                                          My scripts

                                          1 Reply Last reply Reply Quote 0
                                          • plot-parisP Offline
                                            plot-paris
                                            last edited by

                                            damn, you are fast! now the plugin is flawless. fantastic! thank you so much!!!

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 1 / 5
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement