OBJ_IO modified script

I added a select button to import file.
for the moment, the file is at this address:
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif232.py

…nice improvement! OBJ format is currently my favorite platform for mesh imports. The script works fine and is more comfortable now.

Thanks

Thorsten

Thanks for the update on your script jms.
For give me for being so thick headed but I’m having a heck of a time getting it to work.

How do you export and import multiple meshes without them being joined together?

I have followed the instructions in the script, I select my objects, apply size/rotation, and I have tried, I think, every combination of options available for importing and exporting.
No matter what I do, the meshes are allways joined together on import and the center is always at 0,0,0. The instructions say “If you are exporting a group of objects, you will automatically be placed in “object coordinate” mode”. This doesn’t appear to be happening. Also It says “If you do not enter a path, [for the exported file] the path will default to your blender directory”. This doesn’t happen either. Could this indicate what the problem is? I have Python 2.3.3 installed and the path is set in Blender.

Seemed to work.

Is it posible to run the script without opening it in the text editor and executing it from there? Any way to get it to be a little more “intergrated” into Blender?

On a side note: I created a square in Wings3D, intruded, beveled, etc. Ultimatly it was simply a square with a cirlce cut out of the middle. Then I exported to a .obj format from Wings3D and opened it in Blender and it seemed to have some un-need pollies? I’m not positive though. You can’t cut a circle out of the middle of a square without having pollies added to keep the face surrounding the hole in place can you?

Cyberace, I don’t know alot about scripting yet but I added the following code to the top of my script so it starts from the file import menu.

“”“Registration info for Blender menus:
Name: ‘OBJ…’
Blender: 232
Group: ‘Import’
Tooltip: ‘Import Wavefront File Format (*.obj)’
“””

When I go to file-Import, I select OBJ and the script runs and does the import. You then have to split the window to a 3d window to see the model but at least it seems to work.

Make sure the script is in the script directory and it should run. Let me know if this works and I will try to figure how to split the window automatically.

Mike

Better :


#!BPY
"""Registration info for Blender menus:
Name: 'OBJ...'
Blender: 232
Group: 'Import'
Tip: 'Import Wavefront File Format (*.obj)'
"""

The script needs also a correction to really work.
http://www.zoo-logique.org/3D.Blender/scripts_python/obj_io_modif232.py

I forgot - which python version do I install and how do I set my path variables for Windows XP? (You can jsut refer me to a previous post if you like) :slight_smile:

OK, OK, so its right at the top of the forum :expressionless: ! Never mind.

jms, what does the correction do?? Should I use that one instead?

The other one seems to be working OK, but I will try this one.

Mike

Copy this script in the /.blender/scripts folder and re-try using the
file/export menu .

Thanks for your work on this. I use it (probably like most people) to get my nice models from Wings into Blender. It’s the preferred method and an essential part of Blender for anyone who uses Bl + Wings.

I’ll have to try this update.

Thanks again.

jms, it doesn’t show up in the File Export. I saved the file using Python’s Idle as a py file. It does run if I open it but it doesn’t show up in the menu. The script itself has all of the import export buttons on it anyway and it is importing and exporting for me. Everything seems to be OK but export just doesn’t show up in the menu. The lines that I changed earlier seemed to get it to show up in the import. I was just testing some stuff and changed some things around.

This is probably an indirect way of doing this since I don’t really know alot about python but I made a second copy of the script with a different name and added the following:

#====Added the following to test Export====
“”“Registration info for Blender menus:
Name: ‘OBJ…’
Blender: 232
Group: ‘Export’
Tooltip: ‘Export Wavefront File Format (*.obj)’
“””
Now the script will show up in both the import and export file menus. Since most of the scripts usually only provide one function and are separate scripts, maybe it only loads the first item it sees for the file menu. Not sure about this though. Your script provides both an import and export function (which is GREAT! by the way).

This seems to be working well for me now, but let me know if there is a different way that you want me to load the scripts.

Mike

It is not “my” script, i just added one or two functions and make it compatible with the new api python.

The header you show above does not work. You forget the first line:


#!BPY

Sorry, jms. I have that header in the script that I am using I just didn’t post it above.

I am sorry for the error “your script” part. I am using the script that was written by Chris Lynch. He is the author as his name appears on the GUI.
Thanks

Mike

Ok something REALLY weird just happened to the export part of the script. I’ve been using the script for a while now. Without any problems. But just now when I tried to export(something I’ve done alot with the exact script) it messes up. But the import works flawlessly. Any ideas?

Just did a test; no problem with this script:
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif232b.py

Hmmm something is messed up. When I tried the one you just posted, it worked perfectly. But now it dosn’t work again :open_mouth: Some times it seems to depend on the model. Thou now it’s not working with one that I just exported this morning, with the exact same script. What’s weird, is that it runs fines. But as soon as I press export, it fails.

It seems that you have real problems with your file or your system.

Very interesting. I just tried the script on my freshly installed gentoo box. No go. It had never even seen blender before this.

http://www.cs.utah.edu/~gk/atwork/img/bevelbar.gif
http://jmsoler.free.fr/util/blenderfile/py/obj_io_modif240.py
http://www.cs.utah.edu/~gk/atwork/img/bevelbar.gif