How do I find a problematic Sketchup Material?

How do I find a problematic Sketchup Material?

Postby halroach » Mon Apr 06, 2009 7:34 am

Hello

I am using Maxwell Render along with Sketchup. Every now and then I get the following type of error within Maxwell Render:
Code: Select all
ERROR: - File "D:/metal/metal-alucobond-white-r.jpg" has not been found. Render cannot continue.


I am unable to continue rendering until the texture is either miraculously found, or if I delete the problematic material from Sketchup.

The sketchup material is linking to a D drive (which is a DVD drive), meaning it is not a texture that I created. It is probably a material that came with one of the hundreds of components that I imported into my model.

The Problem IS:
I cannot find which sketchup material is causing the problem! I have a model with 40-50 materials in it. I have gone over each of the 40-50 materials to see if they are linked to a material by that name "metal-alucobond-white-r.jpg" but it doesn't appear anywhere!
If I delete all the materials in the model the problem will be solved! but then I have to reassign materials... that is not a good solution!
In the passed I have a problematic texture called grass.jpg. so I deleted all the green and grass materials until the problem was solved. But I can't seem to find a straight forward way to find the material.

I tried generating a report to see if anything might be listed in there, but the model is too heavy, and the report just jams sketchup.
generating a report with a simple model doesn't seem to fill in textures in any case.

Anyone have a solution?
Maybe there is a way through a ruby script, to list all materials and linked textures within a model?

Good Day
0
User avatar
halroach 
 

Re: How do I find a problematic Sketchup Material?

Postby Ecuadorian » Mon Apr 06, 2009 8:24 am

Have you tried purging the model?

I don't use Maxwell, but perhaps this could work:

Create a metal-alucobond-white-r.jpg file with MS Paint, and burn it to a CD inside a folder called metal.
0

Ecuadorian 
 

Re: How do I find a problematic Sketchup Material?

Postby halroach » Mon Apr 06, 2009 8:52 am

Ecuadorian wrote:Have you tried purging the model?

I don't use Maxwell, but perhaps this could work:

Create a metal-alucobond-white-r.jpg file with MS Paint, and burn it to a CD inside a folder called metal.


1. I've tired purging. It doesn't help
2. That will work, but it's not worth the trouble, since errors like this happen quite often!

The best solution is to find the problematic material, but how!?
0
User avatar
halroach 
 

Re: How do I find a problematic Sketchup Material?

Postby Ecuadorian » Mon Apr 06, 2009 9:26 am

Just found this post... might give you a clue.

viewtopic.php?p=8442#p8442
0

Ecuadorian 
 

Re: How do I find a problematic Sketchup Material?

Postby thomthom » Mon Apr 06, 2009 10:00 am

Open the Ruby Console, type in
Code: Select all
Sketchup.active_model.materials.each { |m| puts m.name + ' - ' m.texture.filename }
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: How do I find a problematic Sketchup Material?

Postby halroach » Mon Apr 06, 2009 10:14 am

thomthom wrote:Open the Ruby Console, type in
Code: Select all
Sketchup.active_model.materials.each { |m| puts m.name + ' - ' m.texture.filename }


I am not very familiar with Ruby Code. If I'm supposed to add something, substitue something let me know.
Typing in the above code as is gives an error.
Code: Select all
Error: #<SyntaxError: (eval):131: compile error
(eval):131: syntax error
Sketchup.active_model.materials.each { |m| puts m.name + ' - ' m.texture.filename }


What am I supposed to see after the code is executed?
0
User avatar
halroach 
 

Re: How do I find a problematic Sketchup Material?

Postby thomthom » Mon Apr 06, 2009 10:34 am

Sorry, my bad. Didn't check the code first.
This works:
Sketchup.active_model.materials.each { |m| puts m.name + ' - ' + m.texture.filename if m.texture != nil }

It will return a list of textured materials with their name and the filepath.
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: How do I find a problematic Sketchup Material?

Postby HPW » Mon Apr 06, 2009 10:49 am

Nice code snippet!

But why are there material names in different format:
<.....>
[.....]
.....

And is this the only possibility to see filepath?
In SU material editor I only see filename.
But when I get a SKP from other users there is a embedded material where the path does not exist on my PC.
0

HPW 
 

Re: How do I find a problematic Sketchup Material?

Postby thomthom » Mon Apr 06, 2009 11:09 am

< and [ are just some naming conventions. I think some of SU's default materials uses these characters.

I don't know of any other means to find out the file path.

Some times there isn't a filepath. It's just the name.

SU always embed the texture into SU. But some times stores the location of the original texture. Not sure why though. But render engines some times uses that path to load the textures. Since SU downsamples the images the original might be a higher resolution. But, as I've noticed with V-Ray, if the file doesn't exists it'll return an error instead of falling back to extracting the embedded image.
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: How do I find a problematic Sketchup Material?

Postby halroach » Thu Apr 16, 2009 7:22 am

Thank you Thomthom!
Your script worked very well and it helped me re diagnose my problem.
Apparently Sketchup wasn't the problem maker, all textures were well defined and linked.

For those who are interested, the problem was (and still is) as follows:
I had a material in my model named '<white>' - which when exporting to Maxwell - using 'Auto MXM conversion' - was pointing to a problematic MXM - a material within my Maxwell material libraries (which is apparently called '<white>'!?!?).
I went through a lot of trouble to find which material IN SKETCHUP was causing the problem, and I am currently in correspondence with the Maxwell Support Team to figure out a way to quickly find the problematic MXM in my libraries, since I don't have any MXM called white, but rather a bunch of MXMs that include white in their name.

So, a temporary solution to get the render going is to delete the material called <white> in the sketchup model, and redefine parts of the model that were affected. How to find that <white> (or any other texture for that matter) was making the problem, we have yet to discover...
0
User avatar
halroach 
 

Re: How do I find a problematic Sketchup Material?

Postby silver_shadow » Thu Apr 16, 2009 12:13 pm

hi there...nice script...any way to make a button for this, then we dont have to copy and paste every time, thanx
0

silver_shadow 
 

Re: How do I find a problematic Sketchup Material?

Postby TIG » Thu Apr 16, 2009 12:24 pm

So, a temporary solution to get the render going is to delete the material called <white> in the sketchup model, and redefine parts of the model that were affected. How to find that <white> (or any other texture for that matter) was making the problem, we have yet to discover...

You could always go into the SUp material-browser, model-tab, pick the problem material's icon, edit and then rename <white> as <HALwhite> (or whatever) to avoid the glitch after export... That way the parts of the model aren't affected at all as their colour etc stays as it was - only that material's name has changed to protect the innocent/guilty...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: How do I find a problematic Sketchup Material?

Postby halroach » Thu Apr 16, 2009 12:45 pm

TIG wrote:You could always go into the SUp material-browser, model-tab, pick the problem material's icon, edit and then rename <white> as <HALwhite> (or whatever) to avoid the glitch after export... That way the parts of the model aren't affected at all as their colour etc stays as it was - only that material's name has changed to protect the innocent/guilty...


Yep, that works too - sometimes!
I have played around with changing the problematic material's name. Some times it works sometimes it doesn't. I tried renaming to other names which include the word white, like '<White>XXX', and it still failed intermitently. Either I did something wrong, or actually having the string 'White' in the material name calls the problematic material in Maxwell... haven't recreated the problem yet.
0
User avatar
halroach 
 

Re: How do I find a problematic Sketchup Material?

Postby silver_shadow » Thu Apr 16, 2009 1:05 pm

this happened to me too when i tried importing to maxwell part by part from sketchup, thought it was going to be easier. It was a nightmare. I couldnt bring it all at once into maxwell(preferable way to go) my model was too big. And it kept telling me this material is already there, ignore or replace it and i chose ignore it, because its alreday there.Kinda got the same error messages when i try to render and ends up rendering just checkerboards.So i dont know if your model may be the same result of importing just bits and pieces to make up a full model.
0

silver_shadow 
 

Re: How do I find a problematic Sketchup Material?

Postby thomthom » Thu Apr 16, 2009 1:09 pm

silver_shadow wrote:hi there...nice script...any way to make a button for this, then we dont have to copy and paste every time, thanx

Yea. I'll see when I can squeeze it in.
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: How do I find a problematic Sketchup Material?

Postby skateboardtshirt » Thu Aug 16, 2018 6:38 pm

I had a similar problem where I are getting this message every time I tried to save: "*** Problems were found that could not be fixed! *** The name for CMaterial (290526) is not valid". It would still let me save the file though. I was able to solve the problem by opening the materials window and hovering over each material to look at the name. I found 3 materials that somehow had blank names. After renaming those materials the problem went away.

I don't know how those blank named materials got there in the first place though, I tried to recreate the problem but SketchUp won't let you name a material with a blank name.
0

skateboardtshirt 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: alexnguyen_design and 11 guests

Visit our sponsors: