Author Topic: Cash prize for Collada - POF support!  (Read 123023 times)

0 Members and 2 Guests are viewing this topic.

Offline Galemp

  • Actual father of Samus
  • Moderator
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Cash prize for Collada - POF support!
I'd also like to request that the converter works both ways. Ideally I ought to be able to convert a POF (or PMF) into a DAE, then feed it right back into the converter and come out with the same model without any data loss.

The main problem with that is having to rename all the objects during DAE export to maintain the convention required for POF export. It could cause minor problems in the ships.tbl subsystems entry.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
I'd also like to request that the converter works both ways. Ideally I ought to be able to convert a POF (or PMF) into a DAE, then feed it right back into the converter and come out with the same model without any data loss.

Umm...

Feel free to try exporting with the latest version now.

It managed to convert the 6000 poly new Aten to DAE, and then reimported it first time.

Or are you being more specific when you say 'work'?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline DaBrain

  • Screensniper
  • Moderator
  • 212
    • Shadows of Lylat board
Re: Cash prize for Collada - POF support!
"Helpers with numbers in the form XX-YY typically refer to the YYth item in the XXth grouping. E.g. engine01-02 would be the second glow of the first thruster."


That doesn't really make much sense to me.
Actually it would be a lot easier to just have the (in this example) thrusters being children of the parent engine object.


At least glowpoints should work like this(!)
Because that was the one big advantage of the MAX exporter. I simply set up a helper as glowpoint group (with the texture defined) and all helpers linked to hit (child of) work as glowpoint, regardless of their names, while their radius was used for the size of each glowpoint.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 
Re: Cash prize for Collada - POF support!
I'm curious how involved it is to build an import/export plug-in.
I use Rhino and the file formats it currently supports:

Quote
Index of Import/Export File Types

.3ds (3dstudio max)

.ai (Adobe Illustrator)

.asc (points)

.csv (points)

.csv (properties)

.dgn (MicroStation)

.dwg (AutoCAD)

.dxf (AutoCAD)

.fbx (Autodesk)

.gdf (WAMIT)

.gf (GHS - General Hydrostatics Geometry)

.gft (GHS - General Hydrostatics Geometry)

GHS (General Hydrostatics Geometry)

.gts (GNU Triangulated Surface)

.kml (Google Earth)

.lwo (LightWave 3D)

.obj (Wavefront)

.off (Geomview)

.pdf (Portable Document File)

.pm (GHS - General Hydrostatics Geometry)

.pov (Persistence of Vision Raytracer)

.ps (PostScript)

.raw (Raw Triangle)

.rib (RenderMan)

.sat (ACIS)

.skp (SketchUp)

.slc (Slice)

.step (Standard for the Exchange of Product Model Data)

.stl (Stereolithography)

.txt (points)

.udo (Moray)

.vda (Verband der Automobileindustrie)

.vrml (Virtual Reality Model Language)

.x (DirectX)

.x_t (Parasolid)

.xgl (Solaris)

.txt (points)

I can get the SDK for Rhino without any trouble.
My overall C++ skills are enough to make small apps, but I've never tried writing a file conversion.
Is this more or less a find and replace tag interpreter?
The concept fascinates me a bit.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
It's quite a bit more complicated than that.  Every model format stores its chunks differently, some are binary files, some are text, etc.  Each has it's own quirks, some implement features completely differently from others.  For every converter you probably end up coding in quite a few kludges to make different features convert properly, so each one is going to be unique.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Cash prize for Collada - POF support!
Essentially it would be a conversion from OpenNURBS with Rhino.
I just downloaded the SDK's for .NET & C++.
I appreciate the patience with me.
I am not concerned with investing the time to learn about it.
If I learn it once it may prove more invaluable to me any way to have a better ubderstanding of it.
Whether going to COB/POF/Collada etc... is the best approach...
There are tons of compatibility issues involved with any cross platform applications.
I just want to find a better format than 3ds to export into PCS2 or 3D Explorer.
So far OBJ has not been very stable. 3DS loses geometry with any size to it.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
I understand, I was just trying to explain that it's more work than a find and replace interpreter.  It's not like converting BBCode to HTML.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Galemp

  • Actual father of Samus
  • Moderator
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Re: Cash prize for Collada - POF support!
Umm...

I'm actually more concerned about converting POF->DAE->POF than I am DAE->POF->DAE. The real test would be if Volition's BSPgen models convert, since they're pretty unique in that the names don't correspond to the hierarchy.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
"Helpers with numbers in the form XX-YY typically refer to the YYth item in the XXth grouping. E.g. engine01-02 would be the second glow of the first thruster."


That doesn't really make much sense to me.
Actually it would be a lot easier to just have the (in this example) thrusters being children of the parent engine object.


At least glowpoints should work like this(!)
Because that was the one big advantage of the MAX exporter. I simply set up a helper as glowpoint group (with the texture defined) and all helpers linked to hit (child of) work as glowpoint, regardless of their names, while their radius was used for the size of each glowpoint.
You'd prefer that for engines? It could probably be managed.
Fine, I'll look at glowpoints :p

I'm actually more concerned about converting POF->DAE->POF than I am DAE->POF->DAE. The real test would be if Volition's BSPgen models convert, since they're pretty unique in that the names don't correspond to the hierarchy.
That's where I'm working from. The current limitation is that no properties fields are saved, at all. Turrets should be find (other than the properties fields) as long as the barrels are subobjects of the base, which seems to be the case with :v: models. Paths have issues if path numbers are missing and they all lose their parents. Subobjects suffer from the properties issue and lose rotations too. Subsystems shouldn't be a problem. Engines lose their linked subsystems. Dockpoints lose their paths.

For the most part this is due to no decisions being made on where to store all this stuff.

Anyway, try it and tell me what you don't like about it.

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Cash prize for Collada - POF support!
Did you try importing into another program?
At that point no - didn't have the time. Now that I have, unfortunately it doesn't work.
Here's a pack contining the POF, the DAE produced from it, the error log that blender produces when importing it, and the blender DAE import/export scripts for reference. Hopefully something in that will help?

http://game-warden.com/starfox/Non_SF_related_stuff/MVP3610BETA/ColladaStuff.zip

I've had an idea about the turret helpers, given that turrets tend to be named all sorts of things. Instead of doing turretXX-YY, it would do <subobject name>-YY. That way it's clearer which subobjects are meant to be turrets and it's less restrictive on turret names. It's pretty much how the saver works currently. It doesn't create an entirely foolproof way to detect multipart turrets though.
Yeah that sounds fine for the firepoints of turrets. :)
For multiparts, hmm....
Maybe look for an object with "<subobject name>-arm" to recognise them?

Actually it would be a lot easier to just have the (in this example) thrusters being children of the parent engine object.

At least glowpoints should work like this(!)
Because that was the one big advantage of the MAX exporter. I simply set up a helper as glowpoint group (with the texture defined) and all helpers linked to hit (child of) work as glowpoint, regardless of their names, while their radius was used for the size of each glowpoint.
That doesn't sound half bad. :)
It would be much more organised and hence easier to modify.

One thing about thruster glowpoints is that they can be the children of either an Engine subsystem or an engine subobject model. When the parent subsystem/subobject is destroyed, the children glowpoints dissappear. To accommodate for that, I recommend the points be set up as follows:

In the top half of the pic the parent is a subobject, while in the bottom it's an engine subsystem. In both cases I have all the actual thruster glowpoint helpers set up as children of a generic "Glowpoints#" parent helper (the number is nessecary to avoid having two objects with the same name in the scene). I thought doing it this way would be best because it would allow you to have other helpers as children of the subobject to define other things such as properties.

In fact, maybe something similar could be done with the subobject properties field:

This way you would be able to 'write' multiple lines of subobject properties through the names of the children helpers (Again the ## on the end of "Properties" would just be a discarded unique identifier). The "Vectors" helper would be the one that defined both the u and f vecs with its orientation.

The full list of properties that it would need to recognise according to PCS2 is:
$special=subsystem
$name=x
$fov=180
$rotate=x
$detail_sphere:1,x
$detail_box:1
$box_min: x,x,x
$box_max: x,x,x
$triggered:
$stepped
$steps=4
$t_paused=2
$t_transit=6
$look_at:0
$uvec:0,1,0
$fvec:0,0,1
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline DaBrain

  • Screensniper
  • Moderator
  • 212
    • Shadows of Lylat board
Re: Cash prize for Collada - POF support!
You'd prefer that for engines? It could probably be managed.
Fine, I'll look at glowpoints :p

Great! :)


Quote
The full list of properties that it would need to recognise according to PCS2 is:
$special=subsystem
$name=x
$fov=180
$rotate=x
$detail_sphere:1,x
$detail_box:1
$box_min: x,x,x
$box_max: x,x,x
$triggered:
$stepped
$steps=4
$t_paused=2
$t_transit=6
$look_at:0
$uvec:0,1,0
$fvec:0,0,1

I think PCS2 doesn't have anything to do with this. It simply has to put it into the custom properties of a subobject.
The FSO exe has to "understand" it.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Cash prize for Collada - POF support!
Oh I know - but PCS2's list of what the engine will recognise covers everything nicely. ;)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Cash prize for Collada - POF support!
I have nothing at all productive to contribute, but I just wanted to say that, after reading the thread, I'm really impressed by the rapid, efficient progress being made here. It's not often we non-coders get a chance to see even a glimpse of what goes on behind the scenes.

Considerable admiration!

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
At that point no - didn't have the time. Now that I have, unfortunately it doesn't work.
Here's a pack contining the POF, the DAE produced from it, the error log that blender produces when importing it, and the blender DAE import/export scripts for reference. Hopefully something in that will help?

http://game-warden.com/starfox/Non_SF_related_stuff/MVP3610BETA/ColladaStuff.zip
Interesting; it died because of a timezone thingo which I copied directly from the Collada DOM wiki...
If you look at any exported dae files, you'll notice that the time and date are always the same.
Try a new build. It should omit the timezone.

Quote
Maybe look for an object with "<subobject name>-arm" to recognise them?
I've got it assuming any subobject of a turret is probably serving as turret arms. This could do weird stuff if anyone has subobjects of turret bases. Is anyone likely to do that?

On engine glows and glowpoints, that's pretty much what I wanted to do with turret firepoints. Would there be a problem with grouping all the helpers for a subobject under one single node?
Something like
name
-subobject
-geometry
-helper
--firepoints
---firepoint
---...
--thrusters
---thruster
---...
--glowpoints
---...
--properties
---...

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Cash prize for Collada - POF support!
Nope - that sounds great, and I'll try and test the new build later tonight. :)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Cash prize for Collada - POF support!
Ok, I've tried opening the pof in the latest build, and it does now work, but with the following problems:
1) Due to the FS co-ordinate system being a bit weird, the model is rotated 90°, pointing straight up. (In FS +X is port, +Y is upwards and +Z is forwards. In most other apps, +X is starboard, +Y is forwards and +Z is upwards.)

2) All the turrets, turret arms and other subobjects of anything are in very wrong places. The guns on top are moved below the ship and way forwards, the arms shift a little bit etc. It looks to me like it's just that some of the position axes are switched around or back to front. If you can't identify which is what yourself I'll see if I can make a simple test model.

3) No materials/textures are found on the model, though to be honest I'm not sure if that's an import script shortcoming or an exporter fault. :\
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
Thruster glows and turret firepoints have been switched over. Properties, glowpoints and paths might tomorrow.

Your glowpoint picture doesn't actually specify all the glowpoint properties.

No materials at all?

Hmm, I'm going to blame the axes thing on things not working like they seem they should. Everything is probably still mirrored on the X axis though. Try it now.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
Paths and properties should be working now. One slight issue with properties is that it's splitting properties on spaces as well as new lines.

I've changed the textures to expect .tgas for now on export and things show up with ColladaLoader now. Try it.

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Cash prize for Collada - POF support!
Nice, yeah all the geometries are now appearing in their correct locations, it's seeing materials and the properties are converting. :D

There are a couple of other problems though:
1) The model appears to be mirrored along the X axis (left-right) during the POF->DAE conversion.

2) There are now way too many materials: ;)

Not sure if there's a way around this though. It could well be the import script interpreting the same material as lots of different ones, as the numbers resemble the way blender adds default numeration to duplicate objects.

3) Engine glows still don't appear in their correct locations - they appear way further back in the modeller, but oddly get put back in their right places during the DAE->POF conversion. In Blender when I resize the engine subsystem they're attached to down to 1x1x1 dimensions they're put back in their correct places.

4) I think the $special=subsystem property is being added by default during DAE->POF from before the new changes, because subsystems are now getting "$special=subsystem$special=subsystem" as their properties. Also as you said, the properties are getting split by spaces as well, which is resulting in:
Code: [Select]
$name=main
dock

5) For the thrusters properties, they seem to have acquired an extra $, resulting in: "$engine_subsystem=$$engine"

Oh - and would it be possible to have a question box pop up during DAE export asking if you want to export paths or not? Or maybe just one asking if you want all or no helpers converted with the model? I ask because there are times you only need/want the geometry and materials. :)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
Heh, thruster glow positions are getting scaled. I'll take care of that a bit later.
1, 2 and 5 should be fixed though. However, Collada doesn't seem to like spaces in names...

Export without helpers should be possible.