File formats conversion - What is the best way to get...

What is the best way to get blender models ie: meshs, surfeces, splines, etc. to the Nebula device game engine?
I and some other people was trying to learn make games in Nebula device (I´m working with the arts only), and We need to convert my future blender models to direct3D files… Blender only exports to .dxf or .wrl… DXF get some strange results like ex: rotated meshs. wrl 1.0 does not export textures and some other objects (someone said that wrl doesn´t do it…) I´m right now trying to export to POV-RAY and use xcourses (I´m not in front of my computer and I think this name ca be wrong) to convert it to direct3D. The format POVANIM script exports to pov-ray is the v3.5 file. xcourses can´t read this file version.

How and with what program can I get Nebula compatible archives from blender files? I need a solution with as less data loss as possible!

Thanks.

Maybe the DirectX export script can help you: https://blenderartists.org/forum/viewtopic.php?t=9163

Ok, I will try it now!
I can’t find it before…
Tanks! :smiley:

Ok, I was bit confused until now!
We don’t need directx files, but .n3d files… Directx files was a way to export to .n3d files (some program or script) that my friends find on internet some time ago. But converting to name.x and after it, convert to name.n3d get a two times conversion, and I find two blender to nebula direct converter scripts in Phython… Unfortunately they don’t work at now… :frowning:
The first needs a path directory modification to work on my computer, but whem I adjusted it, the script can’t export anything in my scene and generated a empty file… The second script import a blender phython library that isn’t present in Blender 2.27 (import Blender210 as Blender)…
Thinking that it can be a version issue, I try to chenge this script line to (import Blender) to see if the library name was changed, but not their content. Unfortunately the objects and theyr parameters seens to be all modified. Where can I find actualized versions of these scripts, or where can I find usefull documentation of the blender phyton library to try get compatibility?

If you want, I can write a script to translate povanim export to n3d…

jms,

I’m a newbye in blender community and I really don’t understand anything about nebula. I have the following problem at now: I and other two friends (They know how to code in c++, develop programs, etc) are trying to make or to learn to make games. it"s a early stage project (planning at now) and I’m trying to learn blender, or some other type of 3D modelling aplication. Nebula was a choice of some time ago, but my friends can try other 3D engines in the future… We can change our entirely focus if they want to…
As a beginner in 3D world, I don’t know if exists any other direct translation utilities from blender to nebula format… It’s great who you have interest in my problem, and if You can make a new script and if this work is easy (ie: not charge you so much) I will be pleased, but think that I may never get a game after all that work, and that your new script may probalby only be usefull to some other people in the future, not to me…
I’m at now only work with possibilities, and trying to learn a way to follow in future.

Please, see that I’m Brazilian and my English Language isn’t so very good.

Thanks for your support!
Thanks for your interest in to make the script!
If you like, you can do it, and I will be thankfull!
I think that your script can be usefull to some other people…
:stuck_out_tongue:

Don’t worry, mine is not better : I’m french :slight_smile:

It’s fine!

I will not understand you and you not understand me…
He He He!
It will be a very interesting chat!
:wink:

Anyway i did a script to translate povanim exported files to
n3d. The file gives good results for the vertices, normal vertices and faces
but there is no color and textures are << face based >> not
vertex based so there are 4 textures for one vertex.


####################################################
# Script de traduction d'export povanim vers ".n3d"
# 
# (c) jm soler, Mai 2003
#
# Ce script est proposé dans l'état. L'auteur
# ne sera pas tenu pour responsable de l'usage qu'on
# en fera, ni des dommages causé par son utilisation
# quelles que soient les conditions d'utilisation.
#
# NE FONCTIONNE QUE SUR LES FICHIERS STATIQUES
#
#####################################################

####################################################
# Pour fonctionner correctement le script doit être
# chargé dans le fichier blender que l'on vient d'exporter
#####################################################

####################################################
# Veuillez donner le nom du fichier blender :
#####################################################
file='tux2e'
####################################################
# Le resultat se trouve dans 'mesh'+file+'.comp'
#####################################################
     
filtre={
"vertex_vectors" : ['v', 'verts.inc'],
"normal_vectors" : ['vn', 'norm.inc'],
"face_indices"   : ['f', 'faces.inc'],
"normal_indices" : ['', 'nindice.inc'],
"uv_vectors"     : ['vt', 'uvco.inc'],
"texture_list"   : ['', 'text_list.inc'],
"uv_indices"     : ['', 'uvind.inc']
}


#----------------------------------------
# export type : pov, n3d
#----------------------------------------     
type='n3d'

#----------------------------------------
# developpement hors blender
#----------------------------------------     
devel=0

#----------------------------------------
# gestion des repertoires supplémentaires
#----------------------------------------     
import os

#----------------------------------------
# recuperation de l'adresse absolue des
# fichiers
#----------------------------------------     
if devel==0:                          
   import sys
   import Blender
     
   L=sys.path
   ls=Blender.Get('filename')
   ls=Blender.sys.dirname(ls)
   if ls not in sys.path:
      sys.path.append(ls)
else:
   #----------------------------------------
   # developpement hors blender :blenderfile/py
   #----------------------------------------     
   ls='..'
   
#----------------------------------------
# exportation groupée : 1 = oui, 0 = non
#----------------------------------------     
bloc=0
if bloc==0:
   #----------------------------------------
   # exportation groupée : 1 = oui, 0 = non
   #----------------------------------------     
   # Tout est rangé dans le répertoire objet
   # il faut vérifier qui'l existe 
   #----------------------------------------
   try:
     os.stat(ls+os.sep+'povanim'+os.sep+'objects')
   except:
     os.mkdir(ls+os.sep+'povanim'+os.sep+'objects')
     
try:
#if 1==1:   
    #----------------------------------------
    # ouverture et lecture du fichier cible
    # qui contient toutes les informations
    # la localisation des données. 
    #----------------------------------------
    f=open(ls+os.sep+'povanim'+os.sep+'mesh'+file+'.inc','r')
    contenu=f.readlines()
    f.close()
     
     
    f=None
    f_o=None
    
    #-----------------------------------------
    # Quel que soit le type de regroupement
    # que l'on choisisse, on garde une trace des
    # fichiers que l'on doit importés dans un
    # fichier *.comp
    #------------------------------------------ 
    if type=='pov':
       f=open(ls+os.sep+'povanim'+os.sep+'mesh'+file+'.comp','w')
     
    l=0
    nom=''
    nom_objet=''
     
    #-----------------------------------------
    #  Boucle principale :
    #------------------------------------------
    while l &lt;=len(contenu)-1:
        if contenu[l].find('#declare')!=-1 and\
           contenu[l].find('mesh2')!=-1 :
            #------------------------------------------
            # s'il s'agit d'un fichier unique
            # if we want a lone file, only for pov-type tranformation
            #------------------------------------------
            if (contenu[l].find('#declare')==-1 and\
                contenu[l].find('mesh2')==-1) and type=='pov':
                f.write(contenu[l]+'
')
            #-------------------------------------------
            # si on veut l'export d'objets séparés
            # if we want exportation of separate object
            #-------------------------------------------
            if bloc==0:
               n0=contenu[l].find('#declare')+len('#declare ')
               n1=contenu[l].find(' =')
               nom_objet=contenu[l][n0:n1]
               #---------------------------
               # controle des objets traites
               # control the current objects the script is worcking upon
               #---------------------------
               print nom_objet
               #---------------------------
               # ouverture des fichiers objets
               #---------------------------
               if type=='pov':
                  f_o=open(ls+os.sep+'povanim'+os.sep+'objects'+\
                           os.sep+nom_objet+'.inc','w')
                  f_o.write(contenu[l])
                  
               elif type=='n3d':
                  f_o=open(ls+os.sep+'povanim'+os.sep+'objects'+\
                           os.sep+nom_objet+'.n3d','w')
                  f_o.write('#translation of povanim exported files to .n3d')
                  print  '#translation of povanim files to .n3d'
               #---------------------------
               # prise en compte des donnes
               # dans le fichier mesh "global"
               #---------------------------
               if type=='pov':
                  f.write('#include "'+ls+os.sep+'povanim'+\
                          os.sep+'objects'+os.sep+nom_objet+'.inc"
')
                  
            while contenu[l].find('}')!=0:
                l+=1
                if contenu[l].find('}')!=0 and contenu[l].find('uv_mapping')==-1:
                    d=contenu[l].find('{ #include "')
                    tag=contenu[l][22:d]
                    d1=d+len('{ #include "')
                    #print tag 
                    d2=contenu[l].find(filtre[tag][1])
                    nom=contenu[l][d1:d2]
                    d3=filtre[tag][0]
                     
                    #------------------------------------------
                    # récupérations des données 
                    #------------------------------------------
                    f2=open(ls+os.sep+'povanim'+os.sep+'mesh'+\
                            os.sep+nom+filtre[tag][1],'r')
                    fichier_inc=f2.readlines()
                    f2.close()
                     
                    #------------------------------------------
                    # si il s'agit d'un fichier unique 
                    #------------------------------------------
                    if bloc==1 and type=='pov':
                       f.write(tag+'{
')
                       f.writelines(fichier_inc)
                       f.write('}
 // '+tag+'
')
                    #-------------------------------------------
                    # si on veut l'export d'objets séparés
                    #-------------------------------------------
                    elif bloc==0 and type=='pov': 
                       f_o.write(tag+'{
')
                       f_o.writelines(fichier_inc)
                       f_o.write('}
 // '+tag+'
')
                    #-------------------------------------------
                    # si on veut l'export d'objets séparés
                    #-------------------------------------------
                    elif type=='n3d':
                       if d3!='':
                          if d3=='v':
                             f_o.writelines('
# vertex number '+\
                                            fichier_inc[0])
                             v=1
                             while v &lt; len(fichier_inc):
                                Vl=fichier_inc[v].replace(',','')
                                Vl=Vl.replace('&lt;','')
                                Vl=Vl.replace('&gt;','')
                                f_o.writelines('v'+Vl)   
                                v+=1
                                
                          if d3=='vn':
                             f_o.writelines('# normal vector  '+fichier_inc[0])
                             v=1
                             while v &lt; len(fichier_inc):
                                Vl=fichier_inc[v].replace(',','')
                                Vl=Vl.replace('&lt;','')
                                Vl=Vl.replace('&gt;','')
                                f_o.writelines('vn'+Vl)   
                                v+=1
                          """
                          #can't be used because data are face based
                          if d3=='vt':
                             f_o.writelines('# texture vector  '+fichier_inc[0])
                             v=1
                             while v &lt; len(fichier_inc):
                                Vl=fichier_inc[v].replace(',',' ')
                                Vl=Vl.replace('&lt;','')
                                Vl=Vl.replace('&gt;','')
                                f_o.writelines('vt '+Vl)   
                                v+=1
                          """
                          
                          if d3=='f':
                             f_o.writelines('# faces number '+fichier_inc[0])
                             ft=1
                             while ft &lt; len(fichier_inc):
                                fd=fichier_inc[ft].find('&lt;')+1
                                ff=fichier_inc[ft].find('&gt;')
                                Fl=fichier_inc[ft][fd:ff].replace(',',' ')
                                f_o.writelines('f '+Fl+'
')
                                #print Fl
                                ft+=1
                       pass
                     
                    if l&gt; len(contenu):
                        print "arret"
                        break
                else:
                    if bloc==1 and type=='pov': 
                       if f!=None and contenu[l].find('}')==-1 :
                          f.write(contenu[l])
                    elif bloc==0 and type=='pov':       
                       if f_o!=None and contenu[l].find('}')==-1 :
                          f_o.write(contenu[l])
                    elif type=='n3d':
                        pass
            #------------------------------------------
            # si il s'agit d'un fichier unique 
            #------------------------------------------
            if bloc==1 and type=='pov':        
                f.write('}// fin de '+nom+'
')
            elif bloc==0 and type=='pov':
                #-------------------------------------------
                # si on veut l'export d'objets séparés
                #-------------------------------------------
                f_o.write('} // fin de '+nom+'
')
            elif type=='n3d':
                #-------------------------------------------
                # si on veut l'export d'objets séparés
                #-------------------------------------------
                f_o.write('# end of '+nom+'
')
                
        elif type=='pov':
            #------------------------------------------
            # si il s'agit d'un fichier unique 
            #------------------------------------------
            if (contenu[l].find('#declare')==-1 and\
               contenu[l].find('mesh2')==-1) and\
               bloc==0 and\
               contenu[l].find('
')!=0:
               f.write(contenu[l])
               
            elif contenu[l].find('mesh2')==-1 and\
                 contenu[l].find('
')!=0:
               f.write(contenu[l])
               
            if bloc==0:
                #-------------------------------------------
                # si on veut l'export d'objets séparés
                #-------------------------------------------
                if f_o!=None:
                   f_o.close()
        l+=1
    if f!=None: 
        f.close()

except:
    l=""" vous êtes en train d'essayer d'exporter un fichier d'animation ou un ficher contenant une macro"""
    print l

example of translated file :

#translation of povanim exported files to .n3d
# vertex number 8,
v 4.21265 4.21265 -4.21265
v 4.21265 -4.21265 -4.21265
v -4.21265 -4.21265 -4.21265
v -4.21265 4.21265 -4.21265
v 4.21265 4.21265 4.21265
v 4.21264 -4.21265 4.21265
v -4.21265 -4.21265 4.21265
v -4.21265 4.21265 4.21265
# normal vector  8, 
vn 0.57735 0.57735 -0.57735
vn 0.57735 -0.57735 -0.57735
vn -0.57735 -0.57735 -0.57735
vn -0.57735 0.57735 -0.57735
vn 0.57735 0.57735 0.57735
vn 0.57735 -0.57735 0.57735
vn -0.57735 -0.57735 0.57735
vn -0.57735 0.57735 0.57735
# faces number 12, 
f 0 2 3
f 0 1 2
f 4 6 5
f 4 7 6
f 0 5 1
f 0 4 5
f 1 6 2
f 1 5 6
f 2 7 3
f 2 6 7
f 4 3 7
f 4 0 3
# end of tux2eCube2

Thanks, jms!
I will try your script now!

Hey, great work with Povanim!

Later I will give you feedback…
I need to contact my friends before can say anything, but I will paly with this toy a lot!

Thanks and bye.

you can try this script too:
http://jmsoler.free.fr/util/blenderfile/py/povanim_trans.py

Ok, I will see it too…

I´m having some problem to run scripts on my computer now (Povanim stops to work…?) I need to see what is going on… I´m not confidently with blender and very confuse with phyton!
I get the error: can´t find the file - povanim226-14, but povanim226-14.pyo is still in my blender directory, with the povanim launcher. I may just do something wrong… I will see what investigate it next week. At now my priority is to find what is wrong with my modem that disconect of internet constantly (my brother computer, using the same internet acess provider at the same phone line still works fine… I think it´s my modem is missing functionality)
After solving these problems, and after contacting my friends who are travelling I can say anything about the scripts…
However I take a look in your script code to translate povanim to n3d… If I understand correctly, it works with a translated blender to Pov file that I need to specify in the line: file=“put the file name here” in your code… I need to set anything more in the code to it works correctly? I´m trying to translate some of your documentation to understand better your code (I´m very bad in French Language, but don´t worry, I can do it!)

After finished the code translation (to English and Portuguese languages) can I publish it in a new reply to this forum context?

Thanks!

jms,
I get some results at now…
I just exported a non textured bridge to pov-ray with your povanim script and translated it to n3d. The file get 76 vertices and normals, and 148 faces. In Pov-Ray 3.5 it looks fine, but whem I get it to .n3d I have some problems…
Well, I don’t know at now how it looks in Nebula Device (My friend will try it today at morning and will show me the results) since I don’t have Nebula Device in my computer. For testing purposes, I renamed the m3d file to a obj file and open it in MilkShape. Since the two formats are nearly identical, I think it will works fine this way, but the model shows some miss placed faces.
I actually don’t know if it was a MilkShape problem, or if it is some type of geometry problem with my original model. Since in Pov-Ray it looks fine and the tree formats are very close (.n3d, .obj, .inc) I think it can’t be your scripts fault, but probably MilkShape fault or my model’s fault…
Well, Whem my friend get their results with Nebula, I will may say something more…
Thanks by your support! :slight_smile:

Like I said before, I tried to translate the French documentation of your script to Portuguese and English languages… I realy don’t understand French Language very well, but except by some errors, I think this translation can help some newbie people to understand the script.

####################################################

Script de traduction d’export povanim vers “.n3d”

© jm soler, Mai 2003

Ce script est proposé dans l’état. L’auteur

ne sera pas tenu pour responsable de l’usage qu’on

en fera, ni des dommages causé par son utilisation

quelles que soient les conditions d’utilisation.

NE FONCTIONNE QUE SUR LES FICHIERS STATIQUES

Somente funciona com arquivos estaticos

Only works without animation

#####################################################

####################################################

Pour fonctionner correctement le script doit être

chargé dans le fichier blender que l’on vient d’exporter

English

To correctly get the script working, you need to specify

the blender file name that you want to export without .blend extension

#portuguese

Para o script funcionar corretamente você deverá fornecer o nome

#do arquivo blender que você deseja exportar mas sem a extensão .blend
#####################################################

####################################################

Veuillez donner le nom du fichier blender :

Englis

Give the blender file name…

Portuguese

Forneça o nome do arquivo

#####################################################
file=‘new_name’
####################################################

Le resultat se trouve dans ‘mesh’+file+’.comp’

English

The resulting file will be as follow: ‘mesh’+file+’.comp’

Protuguese

O resultado será encontrado em ‘mesh’+nome do arquivo dado em file+’.comp’

I’m not certain that it’s a correct translation because the file name was

mesh_type+.n3d in povanim\objects folder…

Eu nao estou certo de que esta traducao esteja correta pois o nome do arquivo

foi tipo_de_mesh_.n3d no diretorio povanim\objects

#####################################################

filtre={
“vertex_vectors” : [‘v’, ‘verts.inc’],
“normal_vectors” : [‘vn’, ‘norm.inc’],
“face_indices” : [‘f’, ‘faces.inc’],
“normal_indices” : [’’, ‘nindice.inc’],
“uv_vectors” : [‘vt’, ‘uvco.inc’],
“texture_list” : [’’, ‘text_list.inc’],
“uv_indices” : [’’, ‘uvind.inc’]
}

#----------------------------------------

export type : pov, n3d

english

export to a pov or n3d file

portuguese

tipo de arquivo a exportar : POV, n3d (deve ser deixado em n3d para gerar n3d)

may it was miss translated at now…

devo ter traduzido isto errado…

#----------------------------------------
type=‘n3d’

#----------------------------------------

developpement hors blender

English

Development outside blender (some type of debug feature?)

Portuguese

desenvolvimento fora do blender

#----------------------------------------
devel=0

#----------------------------------------

gestion des repertoires supplémentaires

English

Auxiliar libraries call

Portuguese

Gestão das bibliotecas auxiliares

#----------------------------------------
import os

#----------------------------------------

recuperation de l’adresse absolue des

fichiers

English

getting the absolute adresses of the files

Portuguese

Obtendo os endereços absolutos dos arquivos

#----------------------------------------
if devel==0:
import sys
import Blender

L=sys.path

maybe I need to specify the system path variable in winxp like

was said in a phython tutorial site…

ls=Blender.Get(‘filename’)

I need to give the filename or it’s a know parameter at this time?

ls=Blender.sys.dirname(ls)
if ls not in sys.path:
sys.path.append(ls)
else:
#----------------------------------------

developpement hors blender :blenderfile/py

#----------------------------------------
ls=’…’

#----------------------------------------

exportation groupée : 1 = oui, 0 = non

English

Administrating the exportation : 1 = yes, 0 = no

Portuguese

Administrando a exportação : 1 = sim, 0 = não

#----------------------------------------
bloc=0
if bloc==0:
#----------------------------------------

exportation groupée : 1 = oui, 0 = non

#----------------------------------------

Tout est rangé dans le répertoire objet

il faut vérifier qui’l existe

English

I can’t understand what this phrase means…

but I see that if the directory doen’t exists

the script try to make dir… os.mkdir(variable++povanim++objects

in wich will place the results…

Portuguese

#----------------------------------------
try:
os.stat(ls+os.sep+‘povanim’+os.sep+‘objects’)
except:
os.mkdir(ls+os.sep+‘povanim’+os.sep+‘objects’)

try:
#if 1==1:
#----------------------------------------
# ouverture et lecture du fichier cible
# qui contient toutes les informations
# la localisation des données.
# English
# Informational and data locational target file opening and reading
# Portuguese
# Abertura e leitura do arquivo alvo que contém
# todas as informações sobre a localização dos dados
#----------------------------------------
f=open(ls+os.sep+‘povanim’+os.sep+‘mesh’+file+’.inc’,‘r’)
contenu=f.readlines()
f.close()

f=None 
f_o=None 

#----------------------------------------- 
# Quel que soit le type de regroupement 
# que l'on choisisse, on garde une trace des 
# fichiers que l'on doit importés dans un 
# fichier *.comp
# English
# I can't understand the above phrase...
# Portuguese
# ...
#------------------------------------------ 
if type=='pov': 
   f=open(ls+os.sep+'povanim'+os.sep+'mesh'+file+'.comp','w') 
  
l=0 
nom='' 
nom_objet='' 
  
#----------------------------------------- 
#  Boucle principale :
# Main loop
# Anel principal
#------------------------------------------ 
while l &lt;=len(contenu)-1: 
    if contenu[l].find('#declare')!=-1 and\
       contenu[l].find('mesh2')!=-1 : 
        #------------------------------------------ 
        # s'il s'agit d'un fichier unique 
        # if we want a lone file, only for pov-type tranformation 
        #------------------------------------------ 
        if (contenu[l].find('#declare')==-1 and\
            contenu[l].find('mesh2')==-1) and type=='pov': 
            f.write(contenu[l]+'

‘)
#-------------------------------------------
# si on veut l’export d’objets séparés
# if we want exportation of separate object
#-------------------------------------------
if bloc==0:
n0=contenu[l].find(’#declare’)+len(’#declare ‘)
n1=contenu[l].find(’ =’)
nom_objet=contenu[l][n0:n1]
#---------------------------
# controle des objets traites
# control the current objects the script is working upon
#---------------------------
print nom_objet
#---------------------------
# ouverture des fichiers objets
# English
# Opening the objects file
#---------------------------
if type==‘pov’:
f_o=open(ls+os.sep+‘povanim’+os.sep+‘objects’+
os.sep+nom_objet+’.inc’,‘w’)
f_o.write(contenu[l])

           elif type=='n3d': 
              f_o=open(ls+os.sep+'povanim'+os.sep+'objects'+\
                       os.sep+nom_objet+'.n3d','w') 
              f_o.write('#translation of povanim exported files to .n3d') 
              print  '#translation of povanim files to .n3d' 
           #--------------------------- 
           # prise en compte des donnes 
           # dans le fichier mesh "global"
           # English
           # Take in account the mesh file "global"'s data
           # Portuguese
           # Leve em conta os dados do arquivo de meshes "global"
           #--------------------------- 
           if type=='pov': 
              f.write('#include "'+ls+os.sep+'povanim'+\
                      os.sep+'objects'+os.sep+nom_objet+'.inc"

')

        while contenu[l].find('}')!=0: 
            l+=1 
            if contenu[l].find('}')!=0 and contenu[l].find('uv_mapping')==-1:
                d=contenu[l].find('{ #include "') 
                tag=contenu[l][22:d] 
                d1=d+len('{ #include "') 
                #print tag 
                d2=contenu[l].find(filtre[tag][1]) 
                nom=contenu[l][d1:d2] 
                d3=filtre[tag][0] 
                  
                #------------------------------------------ 
                # récupérations des données
                # English
                # getting the data
                # Portuguese
                # obtendo os dados
                #------------------------------------------ 
                f2=open(ls+os.sep+'povanim'+os.sep+'mesh'+\
                        os.sep+nom+filtre[tag][1],'r') 
                fichier_inc=f2.readlines() 
                f2.close() 
                  
                #------------------------------------------ 
                # si il s'agit d'un fichier unique
                # English
                # for a single file
                #------------------------------------------ 
                if bloc==1 and type=='pov': 
                   f.write(tag+'{

‘)
f.writelines(fichier_inc)
f.write(’}
// ‘+tag+’
‘)
#-------------------------------------------
# si on veut l’export d’objets séparés
# English
# For several object files
#-------------------------------------------
elif bloc==0 and type==‘pov’:
f_o.write(tag+’{
‘)
f_o.writelines(fichier_inc)
f_o.write(’}
// ‘+tag+’
‘)
#-------------------------------------------
# si on veut l’export d’objets séparés
#-------------------------------------------
elif type==‘n3d’:
if d3!=’’:
if d3==‘v’:
f_o.writelines(’

vertex number '+\

                                        fichier_inc[0]) 
                         v=1 
                         while v &lt; len(fichier_inc): 
                            Vl=fichier_inc[v].replace(',','') 
                            Vl=Vl.replace('&lt;','') 
                            Vl=Vl.replace('&gt;','') 
                            f_o.writelines('v'+Vl)    
                            v+=1 
                            
                      if d3=='vn': 
                         f_o.writelines('# normal vector  '+fichier_inc[0]) 
                         v=1 
                         while v &lt; len(fichier_inc): 
                            Vl=fichier_inc[v].replace(',','') 
                            Vl=Vl.replace('&lt;','') 
                            Vl=Vl.replace('&gt;','') 
                            f_o.writelines('vn'+Vl)    
                            v+=1 
                      """ 
                      #can't be used because data are face based 
                      if d3=='vt': 
                         f_o.writelines('# texture vector  '+fichier_inc[0]) 
                         v=1 
                         while v &lt; len(fichier_inc): 
                            Vl=fichier_inc[v].replace(',',' ') 
                            Vl=Vl.replace('&lt;','') 
                            Vl=Vl.replace('&gt;','') 
                            f_o.writelines('vt '+Vl)    
                            v+=1 
                      """ 
                      
                      if d3=='f': 
                         f_o.writelines('# faces number '+fichier_inc[0]) 
                         ft=1 
                         while ft &lt; len(fichier_inc): 
                            fd=fichier_inc[ft].find('&lt;')+1 
                            ff=fichier_inc[ft].find('&gt;') 
                            Fl=fichier_inc[ft][fd:ff].replace(',',' ') 
                            f_o.writelines('f '+Fl+'

')
#print Fl
ft+=1
pass

                if l&gt; len(contenu): 
                    print "arret" 
                    break 
            else: 
                if bloc==1 and type=='pov': 
                   if f!=None and contenu[l].find('}')==-1 : 
                      f.write(contenu[l]) 
                elif bloc==0 and type=='pov':        
                   if f_o!=None and contenu[l].find('}')==-1 : 
                      f_o.write(contenu[l]) 
                elif type=='n3d': 
                    pass 
        #------------------------------------------ 
        # si il s'agit d'un fichier unique 
        #------------------------------------------ 
        if bloc==1 and type=='pov':        
            f.write('}// fin de '+nom+'

‘)
elif bloc==0 and type==‘pov’:
#-------------------------------------------
# si on veut l’export d’objets séparés
#-------------------------------------------
f_o.write(’} // fin de ‘+nom+’
‘)
elif type==‘n3d’:
#-------------------------------------------
# si on veut l’export d’objets séparés
#-------------------------------------------
f_o.write(’# end of ‘+nom+’
')

    elif type=='pov': 
        #------------------------------------------ 
        # si il s'agit d'un fichier unique 
        #------------------------------------------ 
        if (contenu[l].find('#declare')==-1 and\
            contenu[l].find('mesh2')==-1) and\
            bloc==0 and\
            contenu[l].find('

')!=0:
f.write(contenu[l])

        elif contenu[l].find('mesh2')==-1 and\
             contenu[l].find('

')!=0:
f.write(contenu[l])

        if bloc==0: 
            #------------------------------------------- 
            # si on veut l'export d'objets séparés 
            #------------------------------------------- 
            if f_o!=None: 
               f_o.close() 
    l+=1 
if f!=None: 
    f.close() 

except:
l=""" vous êtes en train d’essayer d’exporter un fichier d’animation ou un ficher contenant une macro"""
print l

Good idea.
Thanks you.
You can use [ code ] [ / code ]tag to preserve indentation of the script like that:


if devel==0:                          
   import sys 
   import Blender 
      
   L=sys.path
   # maybe I need to specify the system path variable in winxp like
   # was said in a phython tutorial site...
   ls=Blender.Get('filename')
   # I need to give the filename or it's a know parameter at this time?
   ls=Blender.sys.dirname(ls) 
   if ls not in sys.path: 
      sys.path.append(ls) 
else: