[Plugin] Material Tools

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby thomthom » Tue Jun 28, 2011 12:59 pm

As a DIY quick-fix - change
if ents.respond_to?( :back_material )
to
if e.respond_to?( :back_material )
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby Rich O Brien » Tue Jun 28, 2011 1:33 pm

Sorted :thumb:

Now I'll break something else
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby thomthom » Tue Jun 28, 2011 1:49 pm

Go'n run with scissors or something...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby Pherim » Mon Sep 12, 2011 9:06 pm

I like find this plugin very useful, especially the possibility to transfer the instance material to the faces inside the group or component, but that results in the backfaces also being painted. But sometimes I just want all the instance material gone as I sometimes accidentally assign a material to a group or component and later I can't find it any more. This is especially annoying if the material is not used any more in the rest of the model but remains in the material browser and doesn't get purged. I tried removing all backface materials after transferring the instance material but that resulted in also losing all backface materials I assigned intentionally. Is there a way to simply remove all instance materials?
0

Pherim 
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby jorge2011 » Sun Oct 02, 2011 4:01 pm

Hello sr thomthom.
I think I'm doing something wrong or is there a bug in the plugin.
1 - Remove From Selection.
Error: # undefined local variable or <NameError: `ents' method for TT::Plugins::MaterialTools:Module>
C: / Program Files / Google / Google SketchUp 8/Plugins/tt_material_tools.rb: 270: in `remove_all_from_selection '
C: / Program Files / Google / Google SketchUp 8/Plugins/tt_material_tools.rb: 256: in `each '
C: / Program Files / Google / Google SketchUp 8/Plugins/tt_material_tools.rb: 256: in `remove_all_from_selection '
C: / Program Files / Google / Google SketchUp 8/Plugins/tt_material_tools.rb: 62
add
Groups only erases materials or components. If you edit a component or group and select faces and edges were deleted material.
If I select faces or edges that are not in a group or component, the materials are not deleted.
If I select a group / component, which contains within groups / components nested, the materials are not deleted.
if I apply a material to a group / component and other material to the face that contains this group, only delete the material applied inside to the faces in the group / component

2 - Remove Specific Material
only works with colors. Textured materials does not work.
In addition, when shown the list of materials to remove, it only shows the name of the texture of the material, rather than the name of the material


is possible to solve this problem.
Thank you very much for your time
0

jorge2011 
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby TIG » Sun Oct 02, 2011 4:43 pm

Is this the latest version 2.2.0?

if so it looks to me like you have some code 'missing' in the script - you haven't opened the .rb script with a wordprocessor and then saved or edited it with say Notepad.exe ??
Line #270 is actually about if e.respond_to?( :back_material ) while the offending error for 'ents' should occur earlier in line #260 where it first appears as parent.entities.each { |ents| or the next three lines #262/263/264 - so there's obviously something wrong here...
Try reinstalling the tool and come back...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby jorge2011 » Sun Oct 02, 2011 5:32 pm

tig thanks for your reply.
But reinstalling the plugin and the library. The plugin still generates the same error.
I use sketchup in Spanish, has something to do this?

Error: #<NameError: undefined local variable or method `ents' for TT::Plugins::MaterialTools:Module>
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:270:in `remove_all_from_selection'
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:256:in `each'
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:256:in `remove_all_from_selection'
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:62
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:270:in `call'
C:/Archivos de programa/Google/Google SketchUp 8/Plugins/tt_material_tools.rb:270
0

jorge2011 
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby TIG » Sun Oct 02, 2011 6:12 pm

I think we must wait for thomthom himself to reply.
As far as I can see you can't get that error with a correctly installed script :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby thomthom » Sun Oct 02, 2011 9:16 pm

I have an update for this in an unreleased version. I'll get it online soon.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.2.0) — 21 October2010

Postby jorge2011 » Sun Oct 02, 2011 9:53 pm

many, thank you very much. is a very useful tool
0

jorge2011 
 

Re: [Plugin] Material Tools (2.5.1) — 03 October 2011

Postby thomthom » Mon Oct 03, 2011 8:33 am

Version 2.5.1
Code: Select all
# 2.5.1 - 29.06.2011
#    * Fixed typo bug in Remove From Selection.
#
# 2.5.0 - 15.12.2010
#    * Paint roof.
#
# 2.4.0 - 15.12.2010
#    * Ensure Unique Filenames.
#
# 2.3.0 - 31.10.2010
#    * Remove All Textures.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.1) — 03 October 2011

Postby jorge2011 » Mon Oct 03, 2011 11:03 am

thom excellent update.
still not cleared yet assigned to groups of materials / components.
You can correct this?
0

jorge2011 
 

Re: [Plugin] Material Tools (2.5.1) — 03 October 2011

Postby thomthom » Mon Oct 03, 2011 11:53 am

jorge2011 wrote:thom excellent update.
still not cleared yet assigned to groups of materials / components.
You can correct this?

? You're still getting errors?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.1) — 03 October 2011

Postby jorge2011 » Mon Oct 03, 2011 2:08 pm

no, no errors.
but does not remove the materials assigned to a group.
if you remove the materials assigned to faces and edges contained within the group.
see the file

and
Remove Specific Material
only works with colors. Textured materials does not work.
In addition, when shown the list of materials to remove, it only shows the name of the texture of the material, rather than the name of the material


is possible to solve this problem.
Thank you very much for your time
0

jorge2011 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby thomthom » Tue Oct 04, 2011 8:24 am

Version 2.5.2
Fixed bug in Remove From Selection
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby jorge2011 » Wed Oct 05, 2011 12:09 am

Thank you very much. :)
0

jorge2011 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby irwanwr » Tue Nov 29, 2011 5:38 pm

thank you very much for this plugins. :thumb:
it's very useful for me to keep the file size as small as it could.
0
User avatar
irwanwr 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby halroach » Sun Mar 18, 2012 9:21 am

1. Does the 'remove specific material work on textures?
2. I've got a problem when trying to remove a specific material. Have many many materials in my model and the list of materials in the plugin is not long enough for me to see all of them. Any solution?

3. The reason I am trying to use this plugin is for removing a material that has a TGA in it (which causes annoying errors when I first open the model). I am not able to find the TGA in the model, but am able to find the material it is in. When I try to right click on the material in the regular materials window, sketchup freezes for 10 seconds or so, and then I see the context menu for only a fraction of a second, and I am not able to actually delete the material. This happens a lot when I have a lot of materials in a model.

This is a sketchup bug that's been around for quite a long time! Any suggestions?

4. 'List textures in console' doesn't seem to do anything other than opening the console box, but nothing happens.

(I'm using latest sketchup pro 8 with windows 7 64bit)
0
User avatar
halroach 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby thomthom » Mon Mar 19, 2012 9:57 am

Halroach wrote:1. Does the 'remove specific material work on textures?

You mean removing texture from material?
The plugin would remove the material - entirely. Making no distinction if it is textured or not.

Halroach wrote:2. I've got a problem when trying to remove a specific material. Have many many materials in my model and the list of materials in the plugin is not long enough for me to see all of them. Any solution?

That's a bug in SketchUp. Only way around it is to create a WebDialog instead - which I don't have the time for right now.

Halroach wrote:3. The reason I am trying to use this plugin is for removing a material that has a TGA in it (which causes annoying errors when I first open the model). I am not able to find the TGA in the model, but am able to find the material it is in. When I try to right click on the material in the regular materials window, sketchup freezes for 10 seconds or so, and then I see the context menu for only a fraction of a second, and I am not able to actually delete the material. This happens a lot when I have a lot of materials in a model.

Have you tried assigning a different texture to that material - if the purpose is to avoid the errors when you open the model? (What does the error say btw?)

Halroach wrote:4. 'List textures in console' doesn't seem to do anything other than opening the console box, but nothing happens.
Huh! I see that as well. Sure is a bug.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby halroach » Mon Mar 19, 2012 10:38 am

1. cool

2. I imagine the sketchup team is aware of the bug... I really wish I could just mark a bunch of selected materials in one go, and delete them...

3. That's a good idea! I just unchecked the texture in the material, purged, saved, and the error doesn't appear anymore.
The error I get looked like this:
TGA error.JPG


4. happy I could be of assistance

---

thomthom wrote:
Halroach wrote:1. Does the 'remove specific material work on textures?

You mean removing texture from material?
The plugin would remove the material - entirely. Making no distinction if it is textured or not.

Halroach wrote:2. I've got a problem when trying to remove a specific material. Have many many materials in my model and the list of materials in the plugin is not long enough for me to see all of them. Any solution?

That's a bug in SketchUp. Only way around it is to create a WebDialog instead - which I don't have the time for right now.

Halroach wrote:3. The reason I am trying to use this plugin is for removing a material that has a TGA in it (which causes annoying errors when I first open the model). I am not able to find the TGA in the model, but am able to find the material it is in. When I try to right click on the material in the regular materials window, sketchup freezes for 10 seconds or so, and then I see the context menu for only a fraction of a second, and I am not able to actually delete the material. This happens a lot when I have a lot of materials in a model.

Have you tried assigning a different texture to that material - if the purpose is to avoid the errors when you open the model? (What does the error say btw?)

Halroach wrote:4. 'List textures in console' doesn't seem to do anything other than opening the console box, but nothing happens.
Huh! I see that as well. Sure is a bug.
0
User avatar
halroach 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby TIG » Mon Mar 19, 2012 11:41 am

If you have a long list in a UI dialog you can click in the list pane and then use the up/down arrow keys to scroll to the item you want.
If you want to jump a long way up/down a list [i.e. to somethings that's off screen!] let's say you are on 'Aardvark' but you want to jump to 'White' then press the W key and it'll jump to the first W - perhaps 'Wheat' [assuming alphanumeric sorting], then you can press the down-arrow until 'White' is the select item...
It's not perfect... BUT it does allow you to access any item in an overly long list in a standard UI dialog... :geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby halroach » Mon Mar 19, 2012 2:18 pm

TIG wrote:If you have a long list in a UI dialog you can click in the list pane and then use the up/down arrow keys to scroll to the item you want.
If you want to jump a long way up/down a list [i.e. to somethings that's off screen!] let's say you are on 'Aardvark' but you want to jump to 'White' then press the W key and it'll jump to the first W - perhaps 'Wheat' [assuming alphanumeric sorting], then you can press the down-arrow until 'White' is the select item...
It's not perfect... BUT it does allow you to access any item in an overly long list in a standard UI dialog... :geek:


For some reason my list is not sorted alphanumerically... but your tip is good to know!
0
User avatar
halroach 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby TIG » Mon Mar 19, 2012 2:57 pm

If you have an array of strings then array.sort! will sort it...
I'm unfamiliar with the code producing this list - but it should be easy enough to have an ordered list ??
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby thomthom » Mon Mar 19, 2012 3:08 pm

TIG wrote:If you have an array of strings then array.sort! will sort it...

Since the list of SketchUp material names which is UTF-8 - meaning there can be multi-byte characters. And Ruby's #sort will mangle these characters because it treat each byte as individual characters.

This is another reason why a WebDialog is better - since one can make a dropdown box with scrollbar and utilize the fact the JS is Unicode compatible. (In addition I have a natural sort algorithm that would ensure that you get numbers in correct order ( 1,2,3,10...etc instead of 1,10,2,3... )
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby EarthMover » Sat Aug 11, 2012 1:27 pm

Thom, possible to add removing materials from all groups and components? Not the materials on the inside surfaces, just anything applied to a group or component itself and replacing it with default?
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby TIG » Sat Aug 11, 2012 1:43 pm

Something like
Code: Select all
Sketchup.active_model.definitions.each{|d|next if d.image?;d.instances.each{|i|i.material=nil}}
for every group/instance in the model, ignoring whether visible/locked etc...
OR
Code: Select all
Sketchup.active_model.selection.each{|e|e.material=nil if(e.is_a?(Sketchup::Group)||e.is_a?(Sketchup::ComponentInstance))&& !e.locked?)}}
to process all groups/instances in a selection, ignoring locked ones...
Copy/paste one-liners into the Ruby Console...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby rv1974 » Wed Jan 16, 2013 8:27 am

Fantastic tools! :thumb: Thank you.
What I really miss :roll: is additional script to assign the front faces material to backfaces (at least
on geometry with transparent mats).
0

rv1974 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby massimo » Wed Jan 16, 2013 8:44 am

rv1974 wrote:Fantastic tools! :thumb: Thank you.
What I really miss :roll: is additional script to assign the front faces material to backfaces (at least
on geometry with transparent mats).

viewtopic.php?p=155759#p155759
0
User avatar
massimo 
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby thomthom » Wed Jan 16, 2013 9:47 am

Transparent.png


:?: :?:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Material Tools (2.5.2) — 04 October 2011

Postby rv1974 » Wed Jan 16, 2013 11:09 am

thomthom wrote:
Transparent.png


:?: :?:

What exactly do you ask?
If it's already there (the last line) I for some mystic reason don't have it (the version is updated)
If it's a printscreen of the latest future update- it looks awesome (exactly what I mean (if it processes entire model)).
P.S. How do you make the printscreen of the dropped down list???
0
Last edited by rv1974 on Wed Jan 16, 2013 11:30 am, edited 1 time in total.

rv1974 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: Bing [Bot], owl99 and 22 guests

Visit our sponsors: