[Plugin] Import OBJ with Materials v2.1 20131118
-
Hi,
Thanks for your job, really apreciate.
there is something i missunderstood.
1/ I open a .vray.mat in 3DS
2/ I export in obj format, wih mat as you can see on the picture.3/ i put in the export folder, the map furnished with the .vray.max.
4/ i import in SU using your plugin, i choose cm
The problem is i don't have any mat with the model.
Could you help me?
-
When you make a .OBJ file it should also make a similarly named .MTL file which defines the materials.
These materials are referenced in the header of the OBJ and can be plain colors with optional transparency or with mapped textures.
The textures are defined with a reference to an imgae file.
Most OBJ exporters put these in a folder - named something like Textures or OBJName_Textures...The normal rule is that the OBJ and MTL files go in a common folder - the OBJ's code typically looks for the MTL file 'by name only' [with no 'path'] and therefore expects it to be in the same folder as the OBJ... The 'Texture' folder goes in the same folder as the OBJ and MTL because the MTL's code looks for "Textures/ImageName.png" etc.
If the OBJ can find the MTL then no materials are made/used.
If the MTL can't find an image file then the a plain-color is used instead.You can read an OBj or MTL file with a plain-text-editor...
So see what the OBJ and MTL files are expecting and ensure that you keep all of the exported parts together: that is - the matching OBJ + MTL + ImageFilesInsideTextureFolder
-
For some reason the file will not show the textures. I checked the .mtl and everything seems fine, and the textures are where they need to be. But when I import the file, all the textures are replaced with a matte grey. Is there anyway I can get this to show the textures? It's working fine in blender but not SketchUp.
-
Without seeing the files who can say ?
Are the faces made 'inside out' ?
So you are seeing their backsides ?
Are you importing 'with textures' - there are different options...Can you ZIP and attach or PM+attach the files
-
Some textures are not loading, the model had 26,000 lines though. Is that usual?
-
Who knows?
What's the object?
What are the Textures?
Are ALL Texture files listed in the MTL sub-file also in the Textures sub-folder ?
If it's a manageable size when made into a ZIP can you attach it to a post or PM it ?...It might be an issue with the files themselves rather than the plugin ???
-
Hi,
I am using Sketchup 2013 and installed obj_importer_v2.2.rbz. I am trying to import a .obj file in to Sketchup.
I installed by going to Window > Preferences and then clicking Extensions. The Extensions panel is displayed and then I clicked the Install Extension button.
Then I restarted sketchup.
Then I select import and the file format for obj still doesn't appear.
I was hoping you might now what I am doing wrong. Should I be importing a different way?
Thanks in advance.
-
This tool is NOT an importer that is listed under the File menu...
That would need a special kind of coding...This tool makes its entries in the Plugins menu...
-
-
@komeyl said:
@chris fullmer said:
And thanks!
how to import materials obj?
Help us to help you... You question is useless
Let's assume you have the plugin's RB file correctly installed in the Plugins folder and you have restarted SketchUp...
And also that you have an OBJ file, and it related MTL file defining materials - this must be kept with the OBJ file.
If there are textures specified they come as image-files inside a subfolder that is kept with the MTL file [its exact name varies - open the MTL in notepad to see the expected folder-name/relative-path...]Run the Import OBJ tool from its Plugins menu item [I assume you'll want 'with Textures'].
Answer the dialog prompts [if you don't know the original units accept the default 'inches'], then wait as it is processed.Answer the prompt at the end - you will probably want to flip the imported geometry upright.
You should now have the imported object using the specified materials and textures.To see progress watch the status bar.
If you have the Ruby Console open rare error-message might appear...If the geometry is exceptionally tiny and arrives with 'holes', then try reimporting it as 'meters' [scaling down to the real size later] - that way you'll avoid the known tolerance issues, where very tiny edges are not created by SketchUp when it considers their ends 'coincident' [~/1000"], then the related face is lost because it has a gap in its edge-loop - tiny geometry can 'exist' [say after scaling down] but it can't be 'created'.
Should you need further help, please come back and ask concisely and clearly, ...
-
The inverse option, for export obj files from SU is possible?
Thanks anyway.... -
Hi,
Let me start by saying thanks for this plugin, it's great.
I've started using it to import models from Structure Sensor.
I decided to do a little hacking to make my life easier; basically setting the units to default to metres and taking a look at how to bulk import mesh models (todo). I also discovered that when the models were loading in the background/covered by another window, they loaded much faster (I'm on OSX/'14 Make).
The reason for this is because the UI is getting hammered with several tens/hundreds of thousands of repaints (1 per obj file line) to updated the status bar from this:
Sketchup.set_status_text("Processing line #{line_cnt} of #{lines.length}")
I took a crack at fixing this by making the status line update on a change in percentage. I obviously screwed it up not being a ruby coder, but in the process discovered my 40K+ line (991kb) models loaded in about 2 seconds.
It still slows down when you get really big models; I have a 13.2MB file that starts to grind after about 90%, but I suspect this is a memory/swap bottleneck.
Anyway, I fixed my update code and it looks like this:
Initialize the percentage variables before the looping starts
old_percentage=-1 new_percentage=0 ### trap in case of a missing 'g' lines=["g OBJ\n"]+lines
Update the status and force sketchup to repaint once per percentage point.
# Sketchup.set_status_text("Processing line #{line_cnt} of #{lines.length}") new_percentage = ((line_cnt * 100.0)/lines.length).round; if old_percentage != new_percentage Sketchup.set_status_text("Importing Model - #{new_percentage}% (#{line_cnt} of #{lines.length})") end#if old_percentage = new_percentage
Probably something that would help others enjoy this plugin a little more.
-G
-
I've just installed Import OBJ with Materials 2.1 and am running into the same problem, with materials being replaced with white/grey. I'm exporting from Poser, and the .obj and .mtl files are in a folder, with a Textures subfolder containing the generated PNG files. I've also tried it with the PNG materials in the same folder at the .obj and .mtl files. Neither works. I'm running Sketchup2015 64 in Yosemite on a 5K Retina iMac if that helps. Any suggestions?
-
@enuminous said:
I've just installed Import OBJ with Materials 2.1 and am running into the same problem, with materials being replaced with white/grey. I'm exporting from Poser, and the .obj and .mtl files are in a folder, with a Textures subfolder containing the generated PNG files. I've also tried it with the PNG materials in the same folder at the .obj and .mtl files. Neither works. I'm running Sketchup2015 64 in Yosemite on a 5K Retina iMac if that helps. Any suggestions?
Same for me here, on SketchUp 2014 on Windows, OBJ + MTL textures. All textures are gray. Any solution to make it working welcome
-
Please make a ZIP of the OBJ, MTL and textures-subfolder [including its image-files].
Then either attach it to a post here, or onto a Private Message sent to me.Any messages in the Ruby Console ?
If the OBJ refers to the MTL, and that MTL refers to the texture image files then it should work... -
Will this plugin work with SU2015? I have a large .obj with 219 different UV textures, and so far this hasn't worked (fails to import). Or do I need to be using 2013 in order for the importing and mapping to work appropriately? I get this file to import correctly using SimLab's plugin, but the materials are all wonky because the mapping is incorrect. Any help would be appreciated.
-
It works in all currently available SketchUp versions.
Without the OBJ/MTL/Textures it's difficult to say what your issue is.
Sometimes OBJ files do not follow the prescribed format and are awkward to parse [e.g. -ve vertex referencing] - although those main variants are catered for already in its code...
If it ZIPs to <= ~4Mb you can attach it to a Post or a Private-Message...
Or use a Dropdown etc and PM me a link...BUT alternatively you could think about getting Blender [free], importing the OBJ into that, exporting from that as a DAE and finally importing that into your SKP using the native Collada Importer ??
See if that helps.
But if that OBJ/MTL/Tetxures is inherently flaky - as your SimLab experience suggests - then perhaps it's inevitable ? -
We just released FluidImporter 3.1.0. You can get it here.
Here's what's new:
- Faster import
- FluidImporter is now a full .rbz extension, with a single file for Windows/OSX
- You can access FluidImporter funtionality through the menu Extensions -> FluidImporter
- Added edge smooth option
- Options are now saved so you don't lose your settings when closing SkechUp
-
I have tried with obj files this week, the import with materials fails to bring all the geometry across and import as geometry loses faces but at least keeps the lines for the geometry. Is there something I can do to get all the geometry?
Link to models. http://www.colacola.se
Link to topic http://sketchucation.com/forums/viewtopic.php?f=81%26amp;t=62675 -
I've only looked at one downloadable model.
The most recently added OBJ [bazze...] is poorly set up.
There is no units 'clue' in its header.
There is no call to an MTL file inside the OBJ.
There is no MTL file - which would be used to define Materials.
The two images are not referenced, as there is no MTL file to call them - also they typically go inside a subfolder with the OBJ and MTL files...So using that you will never get materials included.
If you guess the units to be 'meters' then all of the geometry might get made...
With smaller units, any tiny edges will not get created, and any reliant faces will also no make it through...
Advertisement