SketchUcation Plugin Store

 

 

[Plugin] Material Replacer (1.1.0) — 12 January 2010

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby Bob James » Thu Jul 15, 2010 1:49 am

I have a real need for something very similar to bagatelo's request.

I have a need that doesn't seem to fit "Select by Material" or "Material Replacer" or "Repaint" or "GlobalMaterialChange".

In the development of my major models I was not very consistent with color application. As I've learned more and have gotten much more involved with rendering (TwiLight originally and now Thea) the actual colors are very important.

What I would like to be able to do is select a material/color that is in the model from the materials dialog (or something like bagatelo's idea) and then be able to select all objects that have that color/material. Then I need to be able to isolate them so I can see what's been selected, and, finally, with all of these selected, I can change their color. But I need to know which objects, groups, components are that color so I don't accidentally change one that I don't want changed.

Does anyone have an idea of how to do this or even if it could be done?
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 609
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Thu Jul 15, 2010 9:12 am

One can select all entities that has material with the same colour.
However, this isolation - not quite sure what you mean there. You mean hide all other faces/edges?
Can't think of nay other way to isolate. You do have the Hide Rest of Model feature in SU, but then everything would need to be inside a group/component - and the API doesn't let us upen up groups etc...
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby Bob James » Thu Jul 15, 2010 4:59 pm

thomthom wrote:One can select all entities that has material with the same colour.


That's what I don't know how to do: If I could select all the entities with the same color and then isolate only those entities I could see which ones had the "wrong" color so I could change it.

Very belated update:


Karen Walkerman has done just what I requested above.
http://forums.sketchucation.com/viewtopic.php?t=31378
Thanks again Karen :thumb:
Last edited by Bob James on Sat Oct 30, 2010 10:01 pm, edited 2 times in total.
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 609
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby Dragoonprogramming » Fri Aug 20, 2010 6:55 pm

someone buy thomthom a cookie at base camp and take a picture of it :D
"...And if he says that one more time i'll punch him right in the throat" - Armstrong and Getty
My website http://dragoonprogramming.weebly.com/
Dragoonprogramming
 
Posts: 108
Joined: Wed Jul 21, 2010 6:11 pm
Location: California
Name: Taylor

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Tue Aug 24, 2010 12:23 am

I'm not going to Basecamp... :(
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby Bob James » Fri Aug 27, 2010 10:53 pm

thomthom wrote:I'm not going to Basecamp... :(

Bummer :cry:
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 609
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dedmin » Tue Nov 30, 2010 9:45 pm

Is it possible to change just the material of the picked face?
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby TIG » Tue Nov 30, 2010 9:50 pm

dedmin wrote:Is it possible to change just the material of the picked face?

Can't you just paint it ??
TIG
User avatar
TIG
Global Moderator
 
Posts: 14008
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dedmin » Tue Nov 30, 2010 10:04 pm

The beauty of this tool - You don't have to open a component to change the material of the faces.
But it changes all the material in the whole model - not just the face You click on.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby TIG » Wed Dec 01, 2010 10:35 am

dedmin wrote:The beauty of this tool - You don't have to open a component to change the material of the faces.
But it changes all the material in the whole model - not just the face You click on.

BUT your question was to change the material of the picked face !
You mean to change the material of the picked face INSIDE THE GROUP/INSTANCE !
It could be done... but I must leave it to others......
TIG
User avatar
TIG
Global Moderator
 
Posts: 14008
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dedmin » Wed Dec 01, 2010 11:56 am

Yes, inside the group or component. And only of that picked fase.
dedmin
 
Posts: 823
Joined: Thu Oct 02, 2008 10:40 pm

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby lcbrewer » Thu Dec 02, 2010 7:14 am

How do you install this plugin
lcbrewer
 
Posts: 1
Joined: Thu Dec 02, 2010 7:02 am
Name: lewis

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Thu Dec 02, 2010 7:56 am

Open the zip file and drop the .rb file and the folder with it into the Plugins folder where SketchUp is installed.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby bagatelo » Tue Jan 25, 2011 10:13 pm

It would be possible to create a function swap some materials? Something like this:
Imagine a blue box and a red ball. We play the plugin, we click on the box and after the ball, and the colors are reversed. It would be interesting too, if it were possible to exchange materials not in the whole scene, but only on selected objects. Thanks for this fantastic tool.
User avatar
bagatelo
 
Posts: 243
Joined: Wed Apr 16, 2008 4:55 pm
Location: São José, Santa Catarina, Brasil
Name: Alex Henrique
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Intermediate

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby cobb89 » Sat Mar 12, 2011 3:00 am

Is there any way we can use this plugin to replace a specific material [.skm]..that has been used in the model with vray materials [i.e. .vismats]...??
cobb89
Banned
 
Posts: 39
Joined: Sun Feb 13, 2011 6:35 am

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Mon Mar 14, 2011 10:46 am

cobb89 wrote:Is there any way we can use this plugin to replace a specific material [.skm]..that has been used in the model with vray materials [i.e. .vismats]...??

Use V-Ray's material editor. Right click a material and Import
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby jarynzlesa » Thu Mar 24, 2011 2:59 pm

thank you for this plugin, i found this very useful. :thumb:
User avatar
jarynzlesa
 
Posts: 275
Joined: Wed Jan 27, 2010 10:23 pm
Location: Czech Republic
Name: Jaryn Zlesa
Operating system: Windows
SketchUp version: 7
License type: Free/Make
SketchUp use: woodworking
Level of SketchUp: Beginner

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby Bob James » Sun May 01, 2011 9:49 pm

This sort of ties in with the current thread:
http://forums.sketchucation.com/viewtopic.php?f=79&t=36987
"If you don't plan ahead you'll be at the mercy of those that do" - Ashleigh Brilliant

"Bad is not good until worse happens" - Bob James
User avatar
Bob James
Premium Member
Premium Member
 
Posts: 609
Joined: Fri Jan 18, 2008 9:29 pm
Location: Lompoc, CA, USA
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dereeei » Fri Jun 24, 2011 7:42 am

As I can see, this plugin replaces a material globally in entire model. It would be awesome to have option to replace material on a specific object only. :thumb:
Will you take into consideration my suggestion?
Thank you.
dereeei
 
Posts: 565
Joined: Tue Nov 16, 2010 1:48 pm
Name: derei

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby TIG » Fri Jun 24, 2011 8:44 am

dereeei wrote:As I can see, this plugin replaces a material globally in entire model. It would be awesome to have option to replace material on a specific object only. :thumb:
Will you take into consideration my suggestion?
Thank you.

You probably need viewtopic.php?p=63629#p63629 [my olde Global_Material_Replacer.rb tool] - it is dialog driven to choose the material to go and material to use - including 'All' and 'Default-front/back'. It swaps materials in the entire model's active_entities collection, OR IF there's a selection on selected objects... It works inside 'containers'...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14008
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dereeei » Sun Jun 26, 2011 11:27 am

TIG wrote:You probably need viewtopic.php?p=63629#p63629 [my olde Global_Material_Replacer.rb tool] - it is dialog driven to choose the material to go and material to use - including 'All' and 'Default-front/back'. It swaps materials in the entire model's active_entities collection, OR IF there's a selection on selected objects... It works inside 'containers'...

As I could see, thomthom's plugin keeps UV mapping, when replacing materials, which is cool :D. Does yours keeps UV ?
When I use paint bucket tool :paint: to change the material on some object, the UV is reset.
dereeei
 
Posts: 565
Joined: Tue Nov 16, 2010 1:48 pm
Name: derei

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Sun Jun 26, 2011 11:45 am

dereeei wrote:When I use paint bucket tool :paint: to change the material on some object, the UV is reset.

Use the Entity Info to replace materials - then the UV is preserved.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dereeei » Sun Jun 26, 2011 8:58 pm

thomthom wrote:Use the Entity Info to replace materials - then the UV is preserved.

Thanks! I never used it.
dereeei
 
Posts: 565
Joined: Tue Nov 16, 2010 1:48 pm
Name: derei

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby TIG » Sun Jun 26, 2011 10:18 pm

dereeei wrote:[TIG] Does yours keeps UV ?
When I use paint bucket tool :paint: to change the material on some object, the UV is reset.
Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14008
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby dereeei » Mon Jun 27, 2011 8:43 am

TIG wrote:Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...

Will this affect Twilight metadata? If I change a "wood" material with a "metal" material, both with textures... will it render as "metal", or just the image is changed and uses metadata from initially "wood" ?
dereeei
 
Posts: 565
Joined: Tue Nov 16, 2010 1:48 pm
Name: derei

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby TIG » Mon Jun 27, 2011 9:51 am

dereeei wrote:
TIG wrote:Like with Entity Info... my tool swaps the material but keeps the UV-mapping - so any rotated or scales/skewed textures stay unchanged, but the material uses a different image-file...

Will this affect Twilight metadata? If I change a "wood" material with a "metal" material, both with textures... will it render as "metal", or just the image is changed and uses metadata from initially "wood" ?
You could always try it yourself... :roll:
A Twilight material is associated with a SKP material.
If you have a gray RGB material in your SKP you can tell Twilight to substitute it with a silver metal - shiny/textured/etc.
If you have a buff RGB material in your SKP you can tell Twilight to substitute it with a golden metal - shiny/textured/etc.
If you swap around materials in your SKP it'll be reflected in corresponding changes in the next Twilight render.
How would changing a face's material in the SKP NOT affect the Twilight render? AND how might it affect the Twilight material - which is associated on a one-to-one relationship - gray=silver, buff=golden etc?? It only swaps around SKP materials by name it doesn't redefine them or rename them. I'm not sure what happens if you swap the names of materials over in your SKP - presumably if you said in the SKP material Browser gray=>gray1 and buff=>gray and gray1=>buff, then if Twilight uses a material-name look up table for how to render each of its materials based the SKP's current material-names then it would indeed swap what was silver with golden and vice versa... Perhaps useful on occasion, but not the point of this current discussion or thread.

So to recap, swapping a face's SKP material gives the face that other SKP material, the face's material's UV-mapping comes from the face itself; whatever 'correspondence' Twilight a material has with the SKP material is kept intact and it renders accordingly...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14008
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby samyell77 » Wed Sep 07, 2011 4:24 pm

Hi thomthom,
Love this plugin by the way. Is it possible to have the material name display whenever using the eyedropper tool and not just when running your ruby script. Having the name of the material display is SOOOO handy and I'd love it if the eyedropper always displayed the material name. Is this possible? I work on mac so currently trying to work out what material is what is pretty tricky due to the absence of a list view in the material browser. Also would it be possible to move the 'material replacer' to a context menu so you could access if using a right click rather than going to the drop down menus?
Fantastic tool tho - thanks!
Sam
1. PC Windows Ultimate
Intel Xeon Quad 2.26
6gb RAM
2. Mac OSX 10.7.2
2x2.8 Quad - 4gb RAM
samyell77
 
Posts: 126
Joined: Fri Feb 04, 2011 11:39 am
Name: samyell77
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby thomthom » Wed Sep 07, 2011 4:52 pm

I can't modify the native SketchUp tools I'm afraid.

As for context menu, I could, but then someone would ask me to reverse it. But I'll see if I can send you a modified version.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17687
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby samyell77 » Wed Sep 07, 2011 5:02 pm

Would really appreciate that - thanks! :D
1. PC Windows Ultimate
Intel Xeon Quad 2.26
6gb RAM
2. Mac OSX 10.7.2
2x2.8 Quad - 4gb RAM
samyell77
 
Posts: 126
Joined: Fri Feb 04, 2011 11:39 am
Name: samyell77
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Advanced

Re: [Plugin] Material Replacer (1.1.0) — 12 January 2010

Postby samyell77 » Thu Sep 08, 2011 8:39 am

Hey Thomthom - don't worry about sending the revised ruby. I hadn't realised that I can invoke plugins using key commands so have set up a keyboard short cut to your material replacer now. Thanks
1. PC Windows Ultimate
Intel Xeon Quad 2.26
6gb RAM
2. Mac OSX 10.7.2
2x2.8 Quad - 4gb RAM
samyell77
 
Posts: 126
Joined: Fri Feb 04, 2011 11:39 am
Name: samyell77
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: interior design
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012

Next

Return to Plugins

Who is online

Users browsing this forum: aninu, bd187, Bing [Bot], davidcoke, Google Feedfetcher, prairiemain and 12 guests