OBJ to S3O and S3O to OBJ converter (get it here :D)
Moderators: MR.D, Moderators
OBJ to S3O and S3O to OBJ converter (get it here :D)
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
Download here: https://github.com/beyond-all-reason/OBJ2S3O
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)
Edit: edited for completeness
Edit2: New download link, windows EXE
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
Download here: https://github.com/beyond-all-reason/OBJ2S3O
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)
Edit: edited for completeness
Edit2: New download link, windows EXE
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
I am so horny for you right now.
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
OBJ? Have fun for a click festival...
Oh yeah keyboard bashing
Oh yeah keyboard bashing
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
WTF?Karl wrote:OBJ? Have fun for a click festival...
Oh yeah keyboard bashing
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Fixed a bug that caused wierd smoothing groups.
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
cool... would've been handy when I was still making stuff and fighting with upspring most of that time
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Used the s3o to obj and it worked perfectly. (apart from a few Hardness lines here and there I think, nothing bothersome.)
Awesome tool .
Awesome tool .
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Could you post the s3o on which the smoothing failed?
- FireStorm_
- Posts: 666
- Joined: 19 Aug 2009, 16:09
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
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.
- Attachments
-
- mr_bob_corak.zip
- (158.23 KiB) Downloaded 50 times
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Ah, that AK was imported into upspring from 3ds, which is why it fails. Mine works perfect :D
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Another major bugfix: vanilla obj->s3o conversion used to fail because of piece reordering.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
I assume this works with objs who have multiple pieces?
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
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.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Version 5:
Fixed a bug in the UV linear transformation
Fixed a bug in the UV linear transformation
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
This is me. (50 points if you get what I'm trying to say)
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
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
any help appreciated.
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
any help appreciated.
- Attachments
-
- cube.zip
- (703 Bytes) Downloaded 53 times
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
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.
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.
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
currently uploading a youtube vid to illustrate, also appears to be linux only.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.
I have to go out now, so will post a link to the vid later.
Re: OBJ to S3O and S3O to OBJ converter (get it here :D)
Why would you even bother with that last step?enetheru wrote:only from blender to obj to s30 is broken
http://springrts.com/phpbb/viewtopic.php?f=9&t=22635