Can the Import export script be fixed a little bit ?

Hello. I have been using the import export script overtime now. But each and everytime I do it takes a number of clicks to get things to work.

I would like to ask if somebody could improve upon it ?

When I use it the mesh is created. But I have to create a new material for it, then assign all of the mesh to that material in edit mode just for it to show up. Then to get the texture on it the procedure is go to the material button, then texture button, select a texture as image, load an image thru the long list of files( click , click, click,) then go to UV edit choose the image as it’s UV image, then go back to materials select texture Image and mapto UV…

All of that just to do a first test render. And I have to do this alot as I keep testing meshes imported.

So I ask… Is their anyway to automate the texture loading along with the mesh. The textures name is always the same as the .obj file like mat.bmp mat.jpg whatever…

Does anybody else have this trouble ?
It would help soooo much …

Links to the script
https://blenderartists.org/forum/viewtopic.php?t=14106&highlight=import+export

The script does not find the .mtl file.
You have just to leave the mtl file and the obj file in the same directory.

It’s beacause the script does not find the .mtl file.
Just put the mtl file and the obj file in the same directory[/quote]

Aw ! But it will not even work at all when the .mtl file is there , so I have to end up deleting it. Hold On I will get a console report

Here is the console when the .mtl file is there

Using a clean Global Dictionary.
Traceback (most recent call last):
File “eobj_io_modif228-1.py”, line 154, in EventGUI
File “eobj_io_modif228-1.py”, line 270, in ImportFunction
File “eobj_io_modif228-1.py”, line 448, in ObjImport
IndexError: list index out of range

And the .mtl file has this inside of it …

File created by ZBrush

ToolType: PolyMesh3D

www.pixologic.com

newmtl defaultMat
map_Kd hat.bmp

The script seems to be not compatible with the zbrush mtl file…

Test this one:
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif230.zip

mtl , image and obj file must be in the same directory.
It works only with the zbrush mtl file.

:smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

Sweet Happy !

It does the loading of the UV texture ! Now only if it would create it’s own material and select the buttons for the material to use the image as a UV texture. But I am happy enough for now ^v^ Thankyou soooooooooooooo sooooooooo sooooooo much this helps … Thankyou :smiley:

Why not?..

Why not?..[/quote]

???

The material ??? It does not create the first material for it. I do not know why. I have to do that. But it does map the UV image to it for preview but not render. It also now shows up as a mesh now with out having to do the assign part in edit mode. That is about it. It would be nice to save those various clicks … :smiley:

EDIT:

I do get this as my Console report.

5: [‘#Vertex’, ‘Count’, ‘506’]
6: [‘uv’, ‘Vertex’, ‘Count’, ‘693’]
7: [‘#Face’, ‘Count’, ‘508’]
try to import : /users/joiceannhall/desktop//monkey4.mtl
fist line : # File created by ZBrush

[‘#’, ‘File’, ‘created’, ‘by’, ‘ZBrush’]
[‘#’, ‘ToolType:’, ‘PolyMesh3D’]
[‘#’, ‘www.pixologic.com’]
[‘newmtl’, ‘defaultMat’]
[‘map_Kd’, ‘monkey4.bmp’]
1718: [‘End’, ‘Of’, ‘File’]
1719: [‘\x00’]
import into Blender …
Object has uv coordinates
Progress = 0/508

all other (general) polygons …
Total number of vertices is 506
Total number of faces is 508
Total number of sets is 1994
Finished importing monkey4.obj
===== Sun Dec 28 2003 ===== 10:08:11 America/New_York =====
5: [‘#Vertex’, ‘Count’, ‘506’]
6: [‘uv’, ‘Vertex’, ‘Count’, ‘693’]
7: [‘#Face’, ‘Count’, ‘508’]
try to import : /users/joiceannhall/desktop//monkey4.mtl
fist line : # File created by ZBrush

[‘#’, ‘File’, ‘created’, ‘by’, ‘ZBrush’]
[‘#’, ‘ToolType:’, ‘PolyMesh3D’]
[‘#’, ‘www.pixologic.com’]
[‘newmtl’, ‘defaultMat’]
[‘map_Kd’, ‘monkey4.bmp’]
1718: [‘End’, ‘Of’, ‘File’]
1719: [‘\x00’]
import into Blender …
Object has uv coordinates
Progress = 0/508

all other (general) polygons …
Total number of vertices is 506
Total number of faces is 508
Total number of sets is 1994
Finished importing monkey4.obj

So try this instead:
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif231.zip

Even better ! My mouth is in pain from all of the sweets !

but… ( alittle but ) It does write the material on perfectly with the UV ready to go. The only thing now is that when I import another item along with it, they share the same material name so that in turn means that they share the same texture image in the textue menus, ( but not the same UV image).

But this is so easy for me to fix, all I have to do is dulicate the material before I import another mesh and all is well . So I am in pain with sweets !

Thankyou, this saves me my pour little fingers a trillion clicks.

Now only if you could make normal and displacement mapping I would be solid … :wink: HA aH, I am done :wink:

thankyou
^v^

Normal, they share the same name .
Perhaps something to do …

I just did a few corrections :
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif231.zip

It creates a new ME: in the material window, so it does work but each continues to share the same root material settings like spec and shader stuff.

I have teeth fillings from all of the sweets ! :smiley:

Not really a problem if the UVs appear correctely.

Not really a problem if the UVs appear correctely.[/quote]

Very true, and for all that you have done I am super happy. :smiley:

^v^ sugar high !