Ever wanted to edit just a small imperfection in an s3o model? Tired of screwed up normals and per piece importing into upspring? Dislike making text files for assimp? Here is the ultimate solution!
Complete S3O to OBJ and OBJ to S3O converter. Needs python 2.x to run. Billion thanks to Muon for his wonderfule S3O library!
Converts OBJ files to S3O files, while retaining pieces and piece hierarchies. Instructions and notes:
Launch by double clicking obj2s3o.py!
1. Converting S3O to OBJ: Open an s3o file, and the obj file will be saved with the same name and an .obj extension. The name of each object in the .obj file will reflect the naming and pieces of the s3o file. All s3o data is retained, and is listed as a series of parameters in the object's name. Example: base,ox=-0.00,oy=0.00,oz=0.00,p=,mx=-0.00,my=4.00,mz=0.00,r=17.50,h=21.00,t1=tex1.png,t2=tex2.png ALL s3o info is retained, including piece hierarchy, piece origins, smoothing groups, vertex normals, and even degenerate pieces with no geometry used as emit points and vectors. These emit pieces will be shown as triangles with their correct vertex ordering. 2. Converting OBJ to S3O: The opened .obj file will be converted into s3o. If the piece names contain the information as specified in the above example, the entire model hierarchy will be correctly converted. If it doesnt, then the program will convert each object as a child piece of an empty base object
Why is this all good for you? It creates closed surfaces editable in wings3d. It retains piece heirarchy and piece origins both ways. It optimizes s3o vertex counts and performs vertex cache optimization. Allows normals-correct importing and exporting Allows graphical editing of directed emit points For an empty emit piece, make a triangle, its first vertex will be the emit pos with a direction of (0,0,1), and name the piece like this: 'flare,e=0'. For an emit piece with a position and a custom direction, make a triangle object; its first vertex will be the emit position, and the vector pointing from first vertex to second vertex will be the emit direction. name the piece like this: 'wake,e=1' Calculates proper smoothing groups for .obj files. And as a bonus, you can linear transform the UV space of any .obj file upon importing! (yes this includes flipping the UVs, in which case you want to specify (1,0,-1,1)
Yes. But I also realised (I didn't at the time ) that the smoothing changes might have happened when the model went from obj to Wing3D. So it might be a false alarm.
Thats the whole point of it. That if an obj has multiple pieces, they will be individually added to an empty root object. If it has multiple pieces, and they are correctly named (with the parameters in the post, or by exporting from s3o to obj by this tool) they will retain their parent-child relationships, textures, offests, origins, etc.
Joined: 11 Jun 2010, 06:32 Location: Adelaide, Australia
I have a problem with objects exported from blender. basically it appears to mess with something cause the commander gets all messed up and the objects position somehow is dependent.
converting from existing s3o and back works fine.. only from blender to obj to s30 is broken.. attached is the zip with the original export from blender, and the s3o
The cube.obj converts perfectly to s3o for me. Please post your commander, and screenshot the nature of your issue. If the script throws an error in console, paste that.
EDIT: The object hierarchies made in blender _WILL NOT_ be retained. Neither will the object offsets. The object hierarchies made in upspring are retained.
Joined: 11 Jun 2010, 06:32 Location: Adelaide, Australia
Beherith wrote:
The cube.obj converts perfectly to s3o for me. Please post your commander, and screenshot the nature of your issue. If the script throws an error in console, paste that.
EDIT: The object hierarchies made in blender _WILL NOT_ be retained. Neither will the object offsets. The object hierarchies made in upspring are retained.
currently uploading a youtube vid to illustrate, also appears to be linux only.
I have to go out now, so will post a link to the vid later.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum