[Plugin] Material Replacer

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
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 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:
0
User avatar
jarynzlesa 
 

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
0
i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60
User avatar
Bob James 
Premium Member
Premium Member
 

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

Postby derei » 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.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
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'...
0
TIG
User avatar
TIG 
Global Moderator
 

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

Postby derei » 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.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
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.
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 Replacer (1.1.0) — 12 January 2010

Postby derei » 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.
0
DESIGNER AND ARTIST DEREI.UK
User avatar
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...
0
TIG
User avatar
TIG 
Global Moderator
 

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

Postby derei » 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" ?
0
DESIGNER AND ARTIST DEREI.UK
User avatar
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...
0
TIG
User avatar
TIG 
Global Moderator
 

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
0
SU Pro 2016
Dell Precision M4800
PC Windows 10
Intel Core i7-4900MQ @ 2.80ghz
Nvidia Quadro K2100M
16gb RAM

samyell77 
 

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.
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 Replacer (1.1.0) — 12 January 2010

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

Would really appreciate that - thanks! :D
0
SU Pro 2016
Dell Precision M4800
PC Windows 10
Intel Core i7-4900MQ @ 2.80ghz
Nvidia Quadro K2100M
16gb RAM

samyell77 
 

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
0
SU Pro 2016
Dell Precision M4800
PC Windows 10
Intel Core i7-4900MQ @ 2.80ghz
Nvidia Quadro K2100M
16gb RAM

samyell77 
 

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

Postby rachitect » Thu Sep 22, 2011 5:25 pm

Does this work with SketchUp 8 Pro? I copied the unzipped files into the SketchUp Ruby folder but it is not showing up in the Plugins menu in Sketchup... :?
0

rachitect 
 

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

Postby TIG » Fri Sep 23, 2011 8:46 am

You don't see it there because it's not in the 'Plugins' menu!
It's in the 'Tools' menu - as 'Material Replacer'...
:roll:
0
TIG
User avatar
TIG 
Global Moderator
 

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

Postby MartinK » Tue Nov 15, 2011 3:04 am

Thanks for a great time saver. :thumb:
0

MartinK 
 

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

Postby caronte01 » Tue Dec 20, 2011 6:01 pm

thanks Thomas, I use this plugin a lot!
galletas.jpg
0

caronte01 
 

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

Postby McGyver » Sat Feb 02, 2013 4:46 pm

Thank you very much for this extremely useful tool! I Just tried it out and it works smoothly and without any trouble! Thank you!
0
User avatar
McGyver 
 

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

Postby fullyfledgeded » Thu Mar 21, 2013 2:34 pm

Hi, great simple little tool works perfectly, except the material being replaced, did not inherit the same scale of the texture. Any ideas?
thanks
0

fullyfledgeded 
 

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

Postby LesZautres » Thu May 09, 2013 5:27 pm

This plug-in does exactly what I expected through a really nicely made UI!
Many thanks!
0

LesZautres 
 

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

Postby Nithin » Thu Dec 05, 2013 12:01 pm

I think this plugin can be updated to make this function possible.
More details:
window frames with different sizes say 4'x3', 2'x3, 5'x2' are present which has same wooden texture(teak). Using this plugin if 4'x3' selected as source material then all other group/model with same dimension(ultimately volume) can be replaced with other material(oak) and other frames should remains unchanged.
0
User avatar
Nithin 
 

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

Postby Nithin » Thu Dec 05, 2013 10:32 pm

Hi Thom,

with a little guide from TIG here, I manage to update this plugin.

I have no knowledge about ruby , not even a basic grammer :( , but as I am familiar with other languages like php and C++ , I just gone through the some ruby resources and made this modification.
Some minor changes is required as when trying to replace the default material , it is replacing whole model.

I am attaching both modified code and skp test file, hope you rectify this minor bug :thumb: .
0
User avatar
Nithin 
 

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

Postby tt_su » Fri Dec 06, 2013 12:25 pm

Thanks. I've added an issue in the BitBucket repo to remind me to merge this: https://bitbucket.org/thomthom/material ... e-user-fix
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Material Replacer error when using Thea for Sketchup

Postby MrMitchell » Fri Aug 01, 2014 6:05 pm

I have been exploring the Thea for Sketchup latest build on my Mac at work using SketchupPro2014 and was just playing around with the Thea Materials and Material Replacer this morning and think I have run into a serious problem.

I had just added some of the default materials from the Thea library to the sketchup material library and had applied them to some of the components I had been working with earlier.

I had applied the materials to the whole components instead of the faces of the components on some, while going inside of the components and adding the materials directly to the faces of the objects on others.

I then drew a rectangular plane next to the models to pull the default material color from.

Next I successfully used the material replacer to replace the materials applied to the components as a whole from their Thea Material (which was one of the default wood materials) back to the default white/blue sketchup material from the rectangular plane I was pulling from.

However when I attempted to replace the materials inside of the components where the faces had been directly painted (using the example 01.mat.thea inside the displacement folder in the Thea Material Library) sketchup hung up.

I force quit the program expecting to simply reopen the file, or at least even an earlier version of the file, but to no avail. All I get now when trying to open the file is this error message


I even used Time Machine, which pulled versions of the files created earlier... same problem... Could you please shed some light as to how this problem could have occurred, or how I might be able to recover my files?

-Thanks
0
User avatar
MrMitchell 
 

Re: [Plugin] Material Replacer

Postby tt_su » Mon Aug 04, 2014 10:49 am

Can you upload or PM the file in question?
Does the backup file work? (the one with the tilde)
0
User avatar
tt_su 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Material Replacer

Postby MrMitchell » Mon Aug 04, 2014 4:46 pm

Here are the corrupted files. Thankfully I had exported the file as an .obj to render and was able to convert the .obj to a .dae and recomponantize the model back in sketchup... but still... pretty scary.
0
User avatar
MrMitchell 
 

Re: [Plugin] Material Replacer

Postby MrMitchell » Mon Aug 04, 2014 4:54 pm

None of the files work. Even when I attempted to recover the files using Time Machine, the restored files still were treated like the corrupted files currently in the folder. Here are the recovered files, from the previous evening in case you want to try and poke at them...
0
User avatar
MrMitchell 
 

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

Postby rombout » Wed Apr 01, 2015 3:43 am

thomthom wrote:
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.

Ive used UV textures to uvmap a mesh, is it still possible to replace the material. It keeps messing up the uv cause the base textures have different scale settings. I have the same material 3times, but they all have different settings though
0
User avatar
rombout 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: JOTTADLP and 16 guests

Visit our sponsors: