Page MenuHome

Imports/Exports a scene from an Object File Format (OFF)
Closed, ArchivedPublicPATCH

Description

Project: Blender Extensions
Tracker: Py Scripts Upload
Blender: 2.51
Category: Import Export
Python: 3.1
Script name: export_off.py, import_scene_off.py
Wiki page: -
Dependencies: open, str
Author(s): Leif Andersen
Status: Closed

Features:
Imports all of the vertexes and faces from an OFF file into a new mesh and object. Note that it adds it as a series of triangular faces.

Setup:
Every external module used should be included within standard python 3.1, these include: open, str. The script is designed to be placed in the scripts/io/ folder in the blender directory. Alternatively, it will work if the user just runes the script. Note that running the script does not begin the export, it will add an option in the export menu to export to OFF. If the script is already in scripts/io, it should be there on startup.

Manuel:
Once a scene with meshes has be created, and the script has been loaded (see setup), all the user needs to do is go into File->Import->Object File Format (OFF), once there, he will be offered a file browser, where he will choose the name and directory of the file. Then, blender will create a mesh, and object, and add all of the vertexes and faces to it.

Known Bugs:
1. Always adds triangular faces. To be deprecated when blender adds support for n-gons.
2. While it adds the mesh and object to the list of meshes and objects, it doesn't actually update the 3d view to reflect the changes.

Event Timeline

Added a few OFF files for testing (generated by blender 2.4x, certainly does not cover the entire span of the off spec).

Which "thread" do you want to use? the older or the newer? no sense in having two as it just confuses people.

I'm sorry, I thought that the importer and exporter would merit separate items, (obviously I'm a bit new here still). Anyway, as you can see, I have concatenated most of the two threads as I could see (I don't see a way to edit the detailed description).

Thank you.

It's allright I'm kinda new to, but it's easier if everythings in the same place.

Fixed one of the two bugs from the OFF importer, it now links the object to the scene. However, it still adds everything as a series of triangle meshes, leaving a large mess of an imported mesh. (Also, if anyone reads this, is there anyway to update files, rather than removing the old one, and adding the old version?)

both import & export return errors.
Import is buggy with not all faces created & object has no data.
Export does not work due to errors.

Please have these scripts working soon or the tracker will close.

The export off one broke due to API changes. I updated it to work with the latest API calls.

I do admit the importer is a bit broken...I'll look into this momentarily.

Thank you for bringing this to my attention. Other than going through all of the SVN commit logs, is there any way I can keep track of these API changes, so this doesn't happen again? (Perhaps there is something in the documentation...). Again, thank you.

closing after discussion with Leif,
.off is quite an obscure format

Brendon Murphy (meta-androcto) changed the task status from Unknown Status to Unknown Status.Apr 20 2011, 10:32 AM