Purge material or find material
-
I have a model that I purged all the materials. In the model it looks like all material have been purge. However when you look at the material drop down lists there are many materials still in the file.
Just wondering, don't want anyone to work on this, is there a plugin that will find a material if I select the material on the material in model list.
Yes, I have looked at the components, they seem to be free of materials.
Ken
-
Hi Ken,
In some models, I have materials applied to edges (not only faces). So even with all faces deleted or with material removed, still material in the model. Maybe its your case.Yours
Pascal -
Another way to reproduce :
Start SU
Create a rectangle
apply texture
delete the face (not the edges)
purge the modelyou will see the material is still in the model even if no entity has it applied...
With some more tests :
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
}
endstill material in model. No reason as no entity has it applied...
-
In one of your models in the past you had things on a hidden layer that were adding to the material list.
-
But with my sample it seems to be a SU bug. You can reproduce very easily.
-
Anyone have a sample model to share?
-
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.
-
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
-
@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.
-
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.
-
@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
-
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. -
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
-
@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. -
@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?
Advertisement