OpenFlight exporting with Textures

Hello all,

I am current having issues when I try to export my model to OpenFlight format. I imported my model in VRML 2.0 format and after I have imported the file, the model has textures and looks great. When I export to OpenFlight I have all the options selected such as write attribute files, copy textures, etc… However, when I go to import that OpenFlight model, it is all one color (a shade of gray.) Not sure where I am going wrong, I need to OpenFlight model for another program and I need it to have the right color/textures.

Thanks in advance!

Chris

Chris,

I am the maintainer and developer of the FLT tools and scripts included with Blender. There are several things that you need to know in order to use them succesfully. Please reference this page on the wiki:

http://wiki.blender.org/index.php/Sc…openflight_flt

I suspect that possibly your uv-layers from the VRML file are the culprit. Blender can have any number of UV layers, and they have no explicit order. However OpenFlight can have only 8. Because of this the exporter expects that your layers are named ‘Layer0, Layer1, Layer2…’ and so on.

As for the color information, I need to ask if you are using RGB or indexed colors for your target application. Currently the FLT tools only support writing databases that have indexed colorsets, but this can be changed in the future. There is a tool for converting your VRML colors to FLT palette colors that will show fine on export though.

Additionally I would be more than happy to look at any example file you (or anyone else) might provide. This way I could tell you exactly what needed to be done to ensure a smooth export process. For what its worth, I use these scripts in production every day on very large databases and once you know how to use them, its pretty smooth sailing!

Additional documentation for the importer, palette manager and toolbar:
http://wiki.blender.org/index.php/Sc…openflight_flt
http://wiki.blender.org/index.php/Sc…Manual/FLTools

Cheers,
Briggs

Hi, I also use the openflight exporter at work. Thanks for writing it, its very good. However, sometimes i get error messages on the console saying something about overflow masking being deprecated. They are often accompanied by gibberish (random characters + symbols). Should I be worried about this?

Also, is there a way to make the script name the exported file something other than "scene.flt:? I often exported batches of models and its a little inconvenient to rename each one.

Thanks again,
Daniel

Daniel,

Glad you like the scripts. I didnt write them from scratch but did quite a bit of work to get them up to point where they could be used in production where I work. I’m happy to see that these efforts have been useful for others as well.

As for the error messages, I still have to look into those. They are not actually a problem other than being ugly so they get a very low priority on my list of things to fix. I will get to them eventually though.

Regarding file names: The way the exporter/importer pair works currently is that each scene in your file is understood to be a seperate openflight file. Because of this you can build a whole database, complete with external references within Blender from scratch (See the FLT toolbar for functions relating to creating and editing external references). Simply changing the name of the current scene will cause it to export with a different label.

Regardless, right now there are a LOT of little things/features that are not fully documented, so if you have any questions just ask. Also any ideas for improvments as well would be appreciated.

Cheers,
Briggs

Cool! I didn’t know about the multiple scenes/ naming. That will make things easier at work. Thanks for your help on this.

A few feature requests (they may already be there, I might just not know how to use them):
The FLT Palette manager makes the system beep when you pick colors; it’s kind of annoying. Any way to make it be quiet?

Also, is there a way to delete the data that the FLT Palette manager creates so that the colors won’t export?

Thanks,
-Daniel

Daniel,

Sorry for late reply, been rather busy lately.

The FLT palette manager beep is rather annoying I know, and something I plan to address as soon as I get time to work on the scripts again. Unfortunately the best solution I have at the moment is to just turn off the PC’s built in speaker.

As for getting rid of FLT colors, I wrote a small script to accomplish this for you:


import Blender

def removeColors():
    editmode = Blender.Window.EditMode()
    if editmode:
        Blender.Window.EditMode(0)
        
    scene = Blender.Scene.GetCurrent()
    actob = scene.objects.active
    if actob and actob.type != 'Mesh':
        return
    mesh = actob.getData(mesh=True)
    if "FLT_Fcol" in mesh.getColorLayerNames():
        mesh.removeColorLayer("FLT_Fcol")
        mesh.faces.removePropertyLayer("FLT_COL")
        
    mesh.update()
    if editmode:
        Blender.Window.EditMode(1)
        
        
        
removeColors()


To use the script, simply load it in blenders text editor, select a mesh you want to delete colors from and press ‘alt-p’ in the text editor. Let me know how this works for you!

Cheers,
Briggs

Works great! Thanks for the script.
I’m not much good at python, but I’ve added the lines to make it appear in blender’s script menu’s, so that others can easily save and use it.

#!BPY
“”"
Name: ‘FLT Colors Remover’
Blender: 246
Group: ‘Misc’
Tip: ‘Removes FLT colors from active object.’
“”"

import Blender

def removeColors():
editmode = Blender.Window.EditMode()
if editmode:
[INDENT] Blender.Window.EditMode(0)

scene = Blender.Scene.GetCurrent()
actob = scene.objects.active
if actob and actob.type != 'Mesh':
     return
 mesh = actob.getData(mesh=True)
if "FLT_Fcol" in mesh.getColorLayerNames():
     mesh.removeColorLayer("FLT_Fcol")
    mesh.faces.removePropertyLayer("FLT_COL")
mesh.update()
if editmode:
     Blender.Window.EditMode(1)

[/INDENT]

removeColors()

I am interesting in learning more about the UV Layer issue. I am using the Ogre Mesh XML importer. Within Blender I can see the textures are there. However when I export to FLT the textures are not loaded. Is there a way to clean up the layers prior to exporting. E.g. can I manually rename the UV Layer(s)? I am brand new to Blender. Thanks for any insight.