sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Purge material or find material

    Scheduled Pinned Locked Moved Plugins
    15 Posts 6 Posters 708 Views 6 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.
    • ppoublanP Offline
      ppoublan
      last edited by

      Another way to reproduce :
      Start SU
      Create a rectangle
      apply texture
      delete the face (not the edges)
      purge the model

      you will see the material is still in the model even if no entity has it applied...

      With some more tests :

      materials.jpg

      plugins_menu = UI.menu("Plugins")
      item = plugins_menu.add_item("Test") { test }

      def test
      Sketchup.active_model.entities.each { |ent|
      puts ent.entityID
      if ent.material
      puts ent.name
      end
      }
      end

      still material in model. No reason as no entity has it applied...

      1 Reply Last reply Reply Quote 0
      • BoxB Offline
        Box
        last edited by

        In one of your models in the past you had things on a hidden layer that were adding to the material list.

        1 Reply Last reply Reply Quote 0
        • ppoublanP Offline
          ppoublan
          last edited by

          But with my sample it seems to be a SU bug. You can reproduce very easily.

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            Anyone have a sample model to share?

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

              A Material will only Purge if it is unused [and of course it is not the active-material].

              A Material is 'used' if it has been applied to a face, or an edge, or a group, or a component-instance - even though you may not see it on-screen.

              Also if such an entity has been assigned an OFF Layer or is set 'Hidden' [or is a Softened edge], again you won't see it, but the Material is 'used'.

              A Material is also 'used' if it is applied to any of the above entity types within a Component definition - even if that definition itself is unused.
              Purge the Components to remove unused definitions, then Purge the Materials to resolve that.

              You can also Delete a Material from the Browser's pop-out context-menu - even if that Material is in use - it then reverts any entity which had used the deleted-material to be assigned the default-material.

              TIG

              1 Reply Last reply Reply Quote 0
              • kenK Offline
                ken
                last edited by

                Thanks everyone for your reply.

                I had a model that I wanted to export to CAD. I wanted to make the file smaller, so I purge all unused components, then purge unused materials. However, in the material browser I found about 30 materials that did not purge. Now, since I purged all unused components, I would have thought that selecting the whole model, I would have purge all materials. Didn't happen.

                So I used TomTom Material Tools. This plugin purged all materials expect one yellow. That I just deleted.

                So I was wondering if there was a plugin that would find the component that was using a selected material. Just wanted to see where the material was hiding.

                I would have search the Ruby Library Depot, however the server seems to be down.

                My real problem is in SU 2014 I can't seem to export to CAD without hidden lines being shown. I can do this in SU 2013 but not in SU 2014. Yes the settings seem to be the same. And yes I have requested help from Thrimble's SU 2014 team.

                So thanks for your replies.

                Ken

                Fight like your the third monkey on Noah's Ark gangway.

                1 Reply Last reply Reply Quote 0
                • ppoublanP Offline
                  ppoublan
                  last edited by

                  @tt_su said:

                  Anyone have a sample model to share?

                  Attached.
                  This model contains only 4 edges. No component.
                  None have material applied.
                  Material is still not purged.


                  material_not_used_not_purged.skp

                  1 Reply Last reply Reply Quote 0
                  • tt_suT Offline
                    tt_su
                    last edited by

                    That's because it's also the currently selected material. The currently selected material won't be purge because SketchUp assume you're about to use it. Select the default material instead and then purge and you should be all set.

                    1 Reply Last reply Reply Quote 0
                    • kenK Offline
                      ken
                      last edited by

                      @tt_su said:

                      That's because it's also the currently selected material. The currently selected material won't be purge because SketchUp assume you're about to use it. Select the default material instead and then purge and you should be all set.

                      Thanks TT for your input, that make sense.

                      Saw you at BaseCamp, however you were busy. Had a green bowler, but was not brave enough to wear it at basecamp.

                      Now got any reason why I can't export to a CAD from SU 2014 and not have the hidden lines showing, like it does in SU 2013?

                      Now aren't you sorry you responded.

                      Ken

                      Fight like your the third monkey on Noah's Ark gangway.

                      1 Reply Last reply Reply Quote 0
                      • ppoublanP Offline
                        ppoublan
                        last edited by

                        Ok
                        I better understand now.
                        But sometimes difficult to understand the logic of developers : "Used" is not "Selected". As in the other way when a material is selected on Mac and not applied, Materials.current returns nil on Mac, and the material on PC.
                        Someone of SU should clearly define for developers what is "used" material and what is a "selected" material.

                        1 Reply Last reply Reply Quote 0
                        • sdmitchS Offline
                          sdmitch
                          last edited by

                          If all you want to do is get rid of all materials in the model, this one-line will do it.

                          m=Sketchup.active_model.materials;l=m.length-1;l.step(0,-1) do |i| m.remove(m[i].name) end
                          

                          Nothing is worthless, it can always be used as a bad example.

                          http://sdmitch.blogspot.com/

                          1 Reply Last reply Reply Quote 0
                          • tt_suT Offline
                            tt_su
                            last edited by

                            @ppoublan said:

                            Ok
                            But sometimes difficult to understand the logic of developers : "Used" is not "Selected".

                            Yea, I know what you mean. What I describe is only what I assume was the original "logic" behind it. I didn't confirm it.
                            I have been caught by that myself. In CleanUp I made it deselect the current material before it purges the model in order to prevent exactly this issue.

                            1 Reply Last reply Reply Quote 0
                            • tt_suT Offline
                              tt_su
                              last edited by

                              @unknownuser said:

                              Saw you at BaseCamp, however you were busy. Had a green bowler, but was not brave enough to wear it at basecamp.

                              Ah, yea, there was so many people I wanted to catch up with - but man that last BaseCamp was busy! Next time you just grab me and we'll chat. πŸ˜„

                              @unknownuser said:

                              Now got any reason why I can't export to a CAD from SU 2014 and not have the hidden lines showing, like it does in SU 2013?

                              I'm not sure what we're talking about here... examples?

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

                              Advertisement