Author Topic: Using Blender 3D to create Glest model  (Read 27374 times)

VIN100

  • Guest
Using Blender 3D to create Glest model
« on: 13 February 2006, 00:56:30 »
I see an increasing number of people who are interested at Blender, so here is a topic for them.  Here I will try to summarize all what is needed to use Blender to create 3D model for Glest.

Of course, I will need your help :)
If you think about anything to be added (or any correction) to this summary, or if you have any question about using Blender to create Glest models, you are welcome to reply to this topic!

This topic is also (at this time) the "official" topic of the "Blender XML-G3D exporter".

--------------------------------------------------------------------------------------
First :  Blender

Blender is a free (as in speech and as in beer) 3D modeller and renderer.  It works on about all operating system (Windows, Linux, BSD, MacOS...)  It is a little bit hard to start with, because it have a weird interface and use many keyboad shortcut.  You'll probably need to follow some tutorials to learn how to use it.

The console (or terminal) opened with Blender is the python console, which will display messages when you will use a script.
On Linux (and probably BSD), start blender from a X terminal with the "blender -w" command, to have it on a window.

Blender : http://www.blender3d.org
A nice tutorial : http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro
Official documentation : http://download.blender.org/documentation/htmlI/

------------------------------------------------------------------------------------------

Second : Tools

At this time, there are 3 tools to use with Blender and Glest.  They can be found at
Code: [Select]
[url=http://www.glest.org/files/contrib/tools/]http://www.glest.org/files/contrib/tools/[/url]
G3D Import / Export :
Useful to import v3 and v4 G3D models.  Export is not working at this time.
It's a Blender python script which lets you import G3D models into blender.
If you want to see the mapped texture, you'll have to add the image to a new texture (F6), added to the material of the mesh.  After, select UV in the Map Input section of the material.

------------------------------------------------------------------------------------------
Glexemel :
Let to import and export v4 G3D model to and from a XML file.  Useful for the next tool (G3D XML exporter for Blender).
I think there is a bug in the current version of the program, :
Code: [Select]
You'll have to add the lines (if they aren't there) :
    #pragma pack(push, 1)
near of the beginning of the file "g3dv4.h" of glexemel and
    #pragma pack(pop)
before the #endif

Note : I didn't have tested it under Windows.
ToDo : 
- A ported and corrected version.
- A Windows executable.

------------------------------------------------------------------------------------------

Next replies :
G3D-XML Exporter for Blender :
Code: [Select]
[url=http://www.glest.org/board/viewtopic.php?p=6182#6184]http://www.glest.org/board/viewtopic.php?p=6182#6184[/url]Some tools to draw textures :
Code: [Select]
[url=http://www.glest.org/board/viewtopic.php?p=6182#61845]http://www.glest.org/board/viewtopic.php?p=6182#61845[/url]
« Last Edit: 11 April 2016, 15:34:28 by filux »

VIN100

  • Guest
G3D XML Exporter for Blender
« Reply #1 on: 13 February 2006, 01:01:35 »
G3D XML Exporter for Blender :

At this time, the main tool to export your model from Blender to the G3D format.  It export your model in the "xml-g3d" format (used by Glexemel), thus you'll have to convert it with Glexemel to have a G3D file to use with the game.

Here is the last version of the script.  Copy it to a file named g3d_xml_exporter.py, which you will place in your .blender/scripts directory.

The beginning of the script is the documentation about how to use the script and how to create/put texture/animate your model.  Please read it.

Current version : 0.1.2
At this time, not updated on the server (
Code: [Select]
[url=http://www.glest.org/files/contrib/tools/]http://www.glest.org/files/contrib/tools/[/url] has and old version)

Modification since last version :
- Better support of animations with the new frameCount object property
- Only taking the triangle faces
- Displaying a summary of the task in the python console
- Better documentation

Code: [Select]
#!BPY
"""
Name: 'G3D XML Exporter (.xml -> .g3d)'
Blender: 237
Group: 'Export'
Tooltip: 'Exports to an XML representing the Glest fileformat V4. Use xml2g to convert to .g3d'
"""
###########################################################################
# Glest Model / Texture / Animation Exporter
# for the game Glest that you can find at http://www.glest.org
# copyright 2005-2006 By Vincent Gadoury
# Started Date: December 18 2005  Put Public Decembre 20 2005
# Ver: 0.1.2        (February 12 2006)
# Distributed under the GNU PUBLIC LICENSE
# Based on g3d_support.py by Andreas Becker
#     and on glexemel by Jonathan Merritt
###########################################################################
#       (I'm sorry for the poor quality of this text,
#                   I'm not a native English speaker)
#
#INSTALLATION :
#       Copy this Script into your .blender\scripts directory
#       In Blender, open a Script Window and in the menu choose "Update Menus"
#       Export with File->Export->G3D XML Exporter
#
#PREPARE THE MODEL :
#       Each of your meshes' faces must be a triangle (3 vertex)
#       In Edit mode, you can press Space, edit>faces>Convert to Triangles
#       Create and place all your meshes before texturing or animating.
#       The X axe is the floor and the Y axe is the elevation.  The center
#       of the Blender's 3D space will be the center of you object, at the
#       ground level.  Before exporting your model, apply the transformations
#       to each of your mesh (In the 3D space window's menu :
#                           Object->Clear/Apply->Apply ... )
#       This will place the center of your mesh (the yellow or pink dot)
#       at the center of the Blender 3D space.
#       
#       Before doing any texturing or animation, try to export your model and
#       check your python console (the terminal which opens Blender) to see
#       if there is a warning about the number of used faces in the summary.
#       If there is, try to delete "false" faces (which use only 2 vertices)
#       and transform all your faces in triangle.
#       
#EXPORTING :
#       You MUST select the meshes you want to export.
#       Only meshes are exported among the selected objects.
#
#       The diffuse color of the mesh will be it's (first) material's color.
#       The opacity of the mesh will be it's material's alpha.
#       Double sided property of the mesh is exported (see F9).
#       If you want to use custom color in the texture, your mesh must be
#       double sided. If you don't want custom color to be activated for the
#       mesh, add a new boolean property to it (F4) named customColor and with
#       the false value.  Custom Color set if the alpha of the texture is
#       replaced for the color of the player.
#       
#TEXTURING :
#       To use a texture for the mesh, you must add a texture at the FIRST
#       position to the mesh's material. The texture type must be 'image'
#       and you should insert the real image.  In fact, only the filename
#       of the image is used.  After having mapped the image on the
#       mesh with UV Face selection, you don't need anymore to "stick"
#       the coordinates to the vertices.
#       Your texture's format must be TGA, without compression and with the origin
#       at the bottom left position.  The side of the image must be a multiple
#       of 2.  In practice, you must use only one image for all your meshes.
#
#ANIMATING :
#       It was only tested with the 'absolute vertex key' method, but it should
#       work with all the Blender's animation methods.
#       I recommend 'relative vertex key' if you want to modify you mesh later.
#       Don't forget to APPLY TRANSFORMATIONS before adding vertex keys.
#       You must add a "frameCount" property to the objects that are animated.
#       It's and Integer property (F4) name frameCount which contains the
#       desired number of frames of the object, starting at frame 1.
#       If and object don't have the "frameCount" property, only the first frame
#       will be exported.
#
#       LINKS :
#       Absolute vertex key animation method :
#               http://download.blender.org/documentation/htmlI/ch15.html
#       Map an image on your mesh with UV Face selection :
#               http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics
#               http://download.blender.org/documentation/htmlI/ch11s05.html
#
#CONVERT TO .G3D
#       Use the xml2g program of the glexemel tool at
#       http://www.glest.org/files/contrib/tools/
#       Syntax : ./xml2g ExportedFile.xml DesiredFile.g3d
#       
#       WARNING : The current version of this program don't seems to work...
#                 You'll have to add the lines (if they aren't there) :
#                       #pragma pack(push, 1)
#                   near of the beginning of the file "g3dv4.h" of glexemel and
#                       #pragma pack(pop)
#                   before the #endif
#
#
#ChangeLog :
#
#       0.1.2 :
#           Correcting an execution bug
#           Adding the "frameCount" property for each object
#           Using only the triangle faces for the index count
#               (problems of linking between index and vertex may occur)
#           Adding the summary display in the python console
#           Adding a better documentation
#       0.1.1b :
#           Adding a vertex duplication method to correct the vertex UV problem.
#           Correcting NMVert.uvco misuse
#
#ToDo:
#       More tests...
#       More validations...
#       Warn the user if there is something wrong, e.g. :
#                   - no mesh among the selected objects;
#                   - texture without uvco;
#                   - no material on a mesh.
#       Test and correct the theoric linking problem if faces are ignored...
#
#Contributions :
#       Â« pseudonym404 » : NMVert.uvco issue and solutions
#
###############################################################################

import Blender
from Blender import NMesh
from Blender import sys as bsys

seenindex=set()
uvlist=[]

# This list will contain the associative "real" vertex of each duplicated vertex
# in ascendant order.
# The fisrt "vertex" of the list (newvertices[0]) has the index len(mesh.verts)
newvertices=[]
currentnewvertex=0

#This list will contain all the "new" faces' indices
newindices=[]

def icmp(x,y):
    return cmp(x,y)

def notseenindex(index):
    seen = index in seenindex
    if not seen: seenindex.add(index)
    return not seen

def write_obj(filepath):
    out = file(filepath, 'w')
   
    print("-----------------------------------------------")
   
    #Header
    out.write( '<?xml version="1.0" encoding="ASCII" ?>\n' )
    out.write( '<!DOCTYPE G3D SYSTEM "g3d.dtd">\n' )
    out.write( '<!-- \n' )
    out.write( '    This file is an XML encoding of a G3D binary\n' )
    out.write( '    file.  The XML format is by Jonathan Merritt\n' )
    out.write( '    (not yet accepted as part of Glest!).\n' )
    out.write( '    The file was exported from Blender with the\n' )
    out.write( '    G3D-XML Exporter script by Vincent Gadoury.\n' )
    out.write( '-->\n' )
    out.write( '<G3D version="4">\n' )
   
    objects = Blender.Object.GetSelected()
   
    print("Exporting %i selected objects to XML-G3D format..." %(len(objects)))

    #FOR EACH MESH
    lobjects = range( 0 , len(objects) )
    for iobj in lobjects:
        object = objects[iobj]
       
        mesh = object.getData()
        # Skip the object if it's not a mesh
        if type(mesh) != Blender.Types.NMeshType :
            continue
       
        #Clear the lists
        seenindex.clear()
        uvlist[:]=[]
        newvertices[:]=[]
        newindices[:]=[]
           
        currentnewvertex=(len(mesh.verts))
       
        #Find some properties of the mesh
       
        image = None
        textureName = ''
        diffuseTexture = 'false'
        opacity = 1
        diffuseColor = [ 1.0, 1.0, 1.0 ]
       
        #Find if the mesh has a material and a texture
        #   (opacity, diffuseColor, diffuseTexture, textureName)
        if len(mesh.materials) > 0:
            material = mesh.materials[0]
           
            opacity = material.alpha
            diffuseColor[0] = material.rgbCol[0]
            diffuseColor[1] = material.rgbCol[1]
            diffuseColor[2] = material.rgbCol[2]
           
            if material.getTextures()[0]:
                image = material.getTextures()[0].tex.getImage()
            if image:
                textureName = image.getFilename()
                textureName = textureName.split('/')[-1]  #get only the filename
                diffuseTexture = 'true'
        #End material and texture
       
        #TwoSided
        if mesh.mode & NMesh.Modes['TWOSIDED']:
            twoSided='true'
        else:
            twoSided='false'
       
        #CustomColor
        customColor = 1
        try:
            customColor = object.getProperty('customColor').data
        except AttributeError:
            customColor = customColor
        if customColor:
            customColor = 'true'
        else:
            customColor = 'false'
       
        #Real face count (only use triangle)
        realFaceCount = 0
        for face in mesh.faces:
            if (len(face.v) == 3):
                realFaceCount += 1
       
        #Frames number
        frameCount = 1
        try:
            frameCount = object.getProperty('frameCount').data
        except AttributeError:
            frameCount = 1
       
       
        # TRANSFERING FACE TEXTURE COORD. TO VERTEX TEXTURE COORD.
        #  and duplicating vertex associated to different uvco
       
        if textureName == '':    #THERE IS NO TEXTURE
            #create the index list, don't care of newvertices
            for face in mesh.faces:
                faceindices = []
                if (len(face.v) == 3):
                    for vert in face.v:
                        faceindices.append(vert.index)
                    newindices.append(faceindices[0:3])
           
        else:               # THERE IS A TEXTURE
           
            uvlist[:] = [[0]*3 for i in range( len(mesh.verts) )]
           
            for face in mesh.faces:
                faceindices = []
                if (len(face.v) == 3):
                    for i in range(len(face.uv)):
                        vindex = face.v[i].index
                       
                        if notseenindex(vindex):
                            uvlist[vindex] = [vindex, face.uv[i][0], face.uv[i][1]]
                           
                        elif uvlist[vindex][1] != face.uv[i][0] or \
                          uvlist[vindex][2] != face.uv[i][1]:
                            #debug: print("dif: [%f,%f] et [%f,%f]" %( uvlist[vindex][1], face.uv[i][0], uvlist[vindex][2], face.uv[i][1] ))
                            #Create a new "entry" for an existing vertex
                            newvertices.append(vindex)
                            uvlist.append([currentnewvertex, face.uv[i][0], face.uv[i][1]])
                            vindex = currentnewvertex
                            currentnewvertex += 1
                           
                        faceindices.append(vindex)
                    newindices.append(faceindices[0:3])
           
        #End texture and vertex copy
       
       
        # ---- BEGINNING OF THE WRITING OF THE FILE ----
       
        #MESH HEADER
        out.write( '\n<Mesh \n' )
        out.write( '        name="%s" \n' % (mesh.name) )
        out.write( '        frameCount="%i" \n' % ( frameCount ) )
        out.write( '        vertexCount="%i" \n' % (len(mesh.verts) + len(newvertices)) )
        out.write( '        indexCount="%i" \n' % ( realFaceCount * 3 ) )
        out.write( '        specularPower="0" \n' )
        out.write( '        opacity="%f" \n' % (opacity) )
        out.write( '        twoSided="%s" \n' % ( twoSided ) )
        out.write( '        customColor="%s" \n' % ( customColor ) )
        out.write( '        diffuseTexture="%s" > \n' % ( diffuseTexture ) )
       
        #DIFFUSE
        out.write( '    <Diffuse>\n        <Color r="%f" g="%f" b="%f" />\n     </Diffuse>\n' % ( diffuseColor[0], diffuseColor[1], diffuseColor[2] ) )
       
        #SPECULAR
        out.write( '    <!-- UNUSED -->\n    <Specular><Color r="0" g="0" b="0" /></Specular>\n' )
       
        #TEXTURE
        if textureName == '':
            out.write( '    <!-- NO TEXTURE -->\n' )
        else:
            out.write( '    <Texture name="%s" />\n' % (textureName) )
       
        #For each FRAME
       
        #VERTICES
        l = range( 1 , frameCount+1 )
        for frame in l:
            Blender.Set('curframe', frame)
            fmesh = Blender.Object.GetSelected()[iobj].getData()
            out.write( '    <Vertices frame="%i">\n' % ( frame ) )
            # "real" vertex
            for vert in fmesh.verts:
                out.write( '        <Vertex x="%f" y="%f" z="%f" />\n' % (vert.co.x, vert.co.y, vert.co.z) )
            # "linked" new vertex
            for ind in newvertices:
                out.write( '        <Vertex x="%f" y="%f" z="%f" />\n' % \
                    (fmesh.verts[ind].co.x, fmesh.verts[ind].co.y, fmesh.verts[ind].co.z) )
            out.write( '    </Vertices>\n' )
       
        #NORMALS
        l = range( 1 , frameCount+1 )
        for frame in l:
            Blender.Set('curframe', frame)
            fmesh = Blender.Object.GetSelected()[iobj].getData()
            out.write( '    <Normals frame="%i">\n' % ( frame ) )
            # "real" vertex
            for vert in fmesh.verts:
                out.write( '        <Normal x="%f" y="%f" z="%f" />\n' % (vert.no.x, vert.no.y, vert.no.z) )
            # "linked" new vertex
            for ind in newvertices:
                out.write( '        <Normal x="%f" y="%f" z="%f" />\n' % \
                    (fmesh.verts[ind].no.x, fmesh.verts[ind].no.y, fmesh.verts[ind].no.z) )
            out.write( '    </Normals>\n' )
       
        #End FRAMES
       
        #TEXTURES COORDS
        if textureName == '':
            out.write( '    <!-- NO TEXTURE COORDS -->\n' )
        else:
            out.write( '    <TexCoords>\n' )
            #write list
            for uv in uvlist:
                out.write( '        <ST s="%f" t="%f" />\n' % (uv[1], uv[2]) )
            out.write( '    </TexCoords>\n' )
       
        #INDICES
        out.write( '    <Indices>\n' )
        for face in newindices:
            for vert in face:
                out.write( '        <Ix i="%i" />\n' % (vert) )
            out.write('\n')
        out.write( '    </Indices>\n' )
       
        #END MESH
        out.write( '</Mesh>\n' )
       
        #Printing a summary of the mesh to the output
        print("\nObject : %s" %(object.getName() ) )
        print("Mesh : %s" %(mesh.name) )
        print("%i frames" % ( frameCount ) )
        print("%i vertices" % (len(mesh.verts) + len(newvertices)) )
        print("%i exported faces (%i real faces)" % (realFaceCount, len(mesh.faces) ) )
        if realFaceCount != len(mesh.faces) :
            print("WARNING : some faces have been ignored (not triangle)\n" +
            "       Errors may occur with faces and indices linking..." )
        print("%i indices" % (realFaceCount * 3) )
        print("opacity : %f" % (opacity) )
        print("two sided : %s" % (twoSided) )
        print("custom color : %s" % (customColor) )
        print("Use a diffuse texture : %s" % (diffuseTexture) )
        if textureName != '':
            print( "    texture name : %s" % (textureName) )
        print("diffuse color : %f,%f,%f" % ( diffuseColor[0], diffuseColor[1], diffuseColor[2] )  )
        print("Number of new vertices to fit uv mapping : %i\n" % ( len(newvertices) ) )

    #FOOTER
    out.write( '</G3D>\n' )
   
    out.close()
#END write_obj

# file selector based on ac3d_export.py by Willian P. Germano
# File Selector callback:
def fs_callback(filename):
    if not filename.endswith('.xml'): filename = '%s.xml' % filename
    if bsys.exists(filename):
        if Blender.Draw.PupMenu('OVERWRITE?%t|File exists') != 1:
            return
    write_obj(filename)

OBJS = Blender.Object.GetSelected()
if not OBJS:
    Blender.Draw.PupMenu('ERROR: no objects selected')
else:
    fname = bsys.makename(ext=".xml")
    Blender.Window.FileSelector(fs_callback, "Export XML-G3D", fname)
#Blender.Window.FileSelector(write_obj, "Export")

If you find any bug or problem with this script, or if you think about an improvement, please reply to this topic.
« Last Edit: 11 April 2016, 15:35:00 by filux »

VIN100

  • Guest
[More information] Tools to draw textures...
« Reply #2 on: 13 February 2006, 01:02:50 »
Tools to draw textures :

Blender :  In the UV Mapping window, you are able to directly draw to the texture.  This is a simple tool, but it can be useful.

GIMP : A free and powerful tool to draw images.  Ported to many OS.
http://www.gimp.org

...
« Last Edit: 1 January 1970, 00:00:00 by VIN100 »

VIN100

  • Guest
Update of the file from the contrib tools...
« Reply #3 on: 10 June 2006, 21:59:27 »
If someone (Martinho, Tucho?) can update the file of
Code: [Select]
[url=http://www.glest.org/files/contrib/tools/]http://www.glest.org/files/contrib/tools/[/url] to this one, which is the "last" version :
Code: [Select]
[url=http://www.savefile.com/files.php?fid=9824010]http://www.savefile.com/files.php?fid=9824010[/url]
Thanks
« Last Edit: 11 April 2016, 15:35:50 by filux »

Enigma

  • Guest
(No subject)
« Reply #4 on: 11 June 2006, 09:33:32 »
*nods* i got the older plugin and it's not working
« Last Edit: 1 January 1970, 00:00:00 by Enigma »

Speedator

  • Guest
-
« Reply #5 on: 11 June 2006, 20:00:43 »
We host it now on the fanpage Glest: Evolution -
Code: [Select]
[url=http://glest.eurion.net/files]http://glest.eurion.net/files[/url]
« Last Edit: 11 April 2016, 15:35:24 by filux »

VIN100

  • Guest
(No subject)
« Reply #6 on: 11 June 2006, 21:11:59 »
Enigma : Hum?  Is it working now with the "new" plugin (0.1.2)??
« Last Edit: 1 January 1970, 00:00:00 by VIN100 »

metroid

  • Guest
(No subject)
« Reply #7 on: 11 July 2006, 21:25:58 »
I STILL don't get how this thing works: what do I click where and when to convert .blend files to .g3d files? I'd be able to do a lot of mods if I understood how to do this and everything...

meh.
« Last Edit: 1 January 1970, 00:00:00 by metroid »

VIN100

  • Guest
(No subject)
« Reply #8 on: 11 July 2006, 22:29:07 »
Hello Metroid!

At this time, the conversion of a .blend to a .g3d must pass by a .xml file.  You can export your model from Blender with the "G3D XML Exporter for Blender". Follow the instructions at the beggining of the .py file. It explain how your blender model must be done, and how to install and use the XML exporter.  Once you've got a (big) .xml file, you need to convert it to .g3d with the Glexemel tool.

You're probably on windows?  If it's the case, I don't know if someone have ported the glexemel tool to Windows.  If you know a little bit of programming and if you have compiling tools installed on your computer, you can probably do it quite easily. Maybe you can ask to someone on this forum to create a windows executable. (I can't, I don't have windows)  Once you got the executable, you'll have to use a shell (msdos window) to run the tool with the file to convert in parameter.
I know it may seems complexe, I'm sorry.  If you have more questions, just ask :)
« Last Edit: 1 January 1970, 00:00:00 by VIN100 »

metroid

  • Guest
(No subject)
« Reply #9 on: 12 July 2006, 14:01:12 »
Thanks.
Yeah, I figured out how to get it into an .xml file, but what kind of files are .tar and how do I open them? I can't seem to open the Glexemel thingy.


Okay, I unzipped the Glexemel thing, now how do I use it? It just says [Content] and doesn't seem to have a filename. It just says file. >:(
« Last Edit: 1 January 1970, 00:00:00 by metroid »

VIN100

  • Guest
(No subject)
« Reply #10 on: 12 July 2006, 22:04:09 »
If you are on Windows, I can't help you right now... I'll be glad to make a Windows version when I will have Windows and a compiler installed on my computer, but this will be in maybe one month . :confused:

There is probably someone on the forum who got it to work on Windows or someone who can help you more thant me.

Have someone got it works on Windows?
Or can someone take a few minutes to make an executable of Glexemel for Windows?


(It will need to link to the free xml library used by Glexemel)
« Last Edit: 1 January 1970, 00:00:00 by VIN100 »

metroid

  • Guest
(No subject)
« Reply #11 on: 13 July 2006, 14:17:02 »
Yeah, I do have a Windows.

Anyone who can help, I would greatly appreciate such a Windows version! I'll be able to make my bird faction mod then!
« Last Edit: 1 January 1970, 00:00:00 by metroid »

Herr_Alien

  • Guest
-
« Reply #12 on: 6 August 2006, 16:53:00 »
I have just finished compiling glexemel for windows. I have also performed
a successful test (building a cone in Blender, exporting it in xml and then
transforming it from xml to g3d).

The link to the binaries for windows of glexemel can be found at:
Code: [Select]
[url=http://h1.ripway.com/herralien2/arch/glexemel_win32_0.1.zip]http://h1.ripway.com/herralien2/arch/glexemel_win32_0.1.zip[/url]
Please give some feedback, have I forgotten some dll's to include in the package?

Thank you in advance.
« Last Edit: 11 April 2016, 15:36:14 by filux »

RV-007

  • Guest
Using Blender 3D to create Glest model
« Reply #13 on: 8 August 2006, 23:58:00 »
I was using the Blender and the tutorial, but I cannot find the 'file' tab, so there is no use to save the project.

Does anyone know where is the

[list=]file

edit

view

and so on
[/list]

toolbar in the "Blender"?  ?
« Last Edit: 1 January 1970, 00:00:00 by RV-007 »

Herr_Alien

  • Guest
Re: Using Blender 3D to create Glest model
« Reply #14 on: 10 August 2006, 14:28:42 »
Quote from: RV-007
I was using the Blender and the tutorial, but I cannot find the 'file' tab, so there is no use to save the project.

Does anyone know where is the

[list type=]file

edit

view

and so on
[/list]

toolbar in the "Blender"? 

First, make sure you have selected the right role in the left corner:

Code: [Select]
[img]http://h1.ripway.com/herralien/img/blender_menu.gif[/img]
« Last Edit: 11 April 2016, 15:30:56 by filux »

RV-007

  • Guest
Re: Using Blender 3D to create Glest model
« Reply #15 on: 10 August 2006, 19:29:26 »
ok I got it.

Thanks  Herr_Alien :D
« Last Edit: 1 January 1970, 00:00:00 by RV-007 »

ilivetomod

  • Guest
(No subject)
« Reply #16 on: 9 November 2006, 16:51:29 »
whenever i try to use the g3d xml exporter, blender says "script error, check console" (im on the newest v2.42a) when i look at the console, it says there's a problem with the faceindices:
UnboundLocalError: local variable 'faceindices' referenced before assignment

i think this is probably a coding problem

also, that link to the glexemel windows is broken

 :confused:

Please help!
« Last Edit: 1 January 1970, 00:00:00 by ilivetomod »

Herr_Alien

  • Guest
-
« Reply #17 on: 10 November 2006, 06:55:59 »
Hello,

I apologise for the broken link, I have fixed it now:

Code: [Select]
[url=http://h1.ripway.com/herralien2/arch/glexemel_win32_0.1.zip]http://h1.ripway.com/herralien2/arch/gl ... 32_0.1.zip[/url]
Regarding the plugin, I hope the author will fix it.
« Last Edit: 11 April 2016, 15:31:58 by filux »

ilivetomod

  • Guest
(No subject)
« Reply #18 on: 10 November 2006, 14:00:46 »
Thanks a bunch. I spent all last night trying to recode it myself, but failed miserably.

Thanks again
 :D  :D  :D
« Last Edit: 1 January 1970, 00:00:00 by ilivetomod »

ilivetomod

  • Guest
(No subject)
« Reply #19 on: 10 November 2006, 18:55:09 »
ah...herr_alien...I don't spose you have any instructions for glexemel...corry to bother you again :-[
« Last Edit: 1 January 1970, 00:00:00 by ilivetomod »

ilivetomod

  • Guest
(No subject)
« Reply #20 on: 18 November 2006, 16:02:43 »
Quote from: "ilivetomod"
ah...herr_alien...I don't spose you have any instructions for glexemel...corry to bother you again :-[


Its okay now. You don't need to bother replying. I've worked it out
« Last Edit: 1 January 1970, 00:00:00 by ilivetomod »

HomerJ

  • Guest
(No subject)
« Reply #21 on: 4 January 2007, 23:26:00 »
Just wanted to throw that link in here...

http://www.dedalo-3d.com/index.php

Maybe its helpful for someone?

This whole modelling thing looks to be too complex for me to learn at my age  :D


Greetz
HomerJ
« Last Edit: 1 January 1970, 00:00:00 by HomerJ »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
blender export doesn't contain any textures
« Reply #22 on: 27 January 2007, 21:30:29 »
what's wrong?

I load a model from the original glest into blender ( using this blender-importscript for glest ).
Now I can see there everything the model the textures ...

without making any changes I want to export this model again
 but in the xml-result the tag for textures is empty .
....
    <Specular><Color r="0" g="0" b="0" /></Specular>
    <!-- NO TEXTURE -->
    <Vertices frame="1">
.....

After converting to .g3d I can start the game without problems but
the new model is unvisible ( it was cow_standing.g3d ).
when the cow starts moving it is visible again due to another model
(cow_walking.g3d ).

I think the problem is, that the texture mapping was not saved, but why?
What do I have to do ?

Looking at the console while exporting
there were 3 warnings, ( somthing with not applied... )
So I applied the deformations( I didn't made any!)  and the warnings disappeared.
But this has no effect on the other problems.
What do I have to do to export the texture-references?

Pleeeeease help.... my kids want more glest fun from me  ;)

I have Blender 2.4.1 (Linux)
« Last Edit: 1 January 1970, 00:00:00 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
found something but....
« Reply #23 on: 28 January 2007, 21:47:33 »
ok, I found something,

the textures were not assigned to the material and the meshes were not assigned to a material. that's fixed now, but..:

The export contains information about the textures now, and I can build a g3d-file with texture information. But when I start glest with this "new" model
it crashes with:
...
 Error loading units: techs/magitech/factions/tech
Error loading UnitType: techs/magitech/factions/tech/units/cow/cow.xml
Exception caught loading 3d file: techs/magitech/factions/tech/units/cow/models/cow_standing.g3d
St9bad_alloc
Fatal signal: Segmentation Fault (SDL Parachute Deployed)
...

So, what's wrong this time ??  ?
Please help me, I really don't know what's wrong this time.


to compare my exported xml-file with coorect one I tried to convert  the cow_standing.g3d to xml, but g2xml said it's g3d version3 not version4.

Is there any model with g3d version4 in this game?
« Last Edit: 31 January 2007, 14:39:17 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
-
« Reply #24 on: 30 January 2007, 12:22:53 »
I'm no expert at this but I will try to explain what I think is the cause.

From Wikipedia:
"A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system)."

Browse this file in CVS
The message can be found in source/shared_lib/include/graphics/model.cpp
in the method void Model::loadG3d(const string &path)
Code: [Select]
catch(exception &e){
  throw runtime_error("Exception caught loading 3d file: " + path +"\n"+ e.what());
}
Eljay Love-Jensen wrote:
"When new fails to allocate the memory for an object, or new[] fails to allocate the memory for an object array, a std::bad_alloc object is thrown. In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."

In the method new[] occurs like this (three dots have been put in for left out source):
Code: [Select]
...
...
ModelHeader modelHeader;
fread(&modelHeader, sizeof(ModelHeader), 1, f);
meshCount= modelHeader.meshCount;
...
meshes= new Mesh[meshCount];
for(uint32 i=0; i<meshCount; ++i){
  meshes[i].load(dir, f, textureManager);
  meshes[i].buildInterpolationData();
}
...
...

In model_header.h meshCount is defined in the ModelHeader struct as being uint16 which has a range from 0 to positive 65,535. So the problem might be something to do with the size of the ModelHeader.

meshes.buildInterpolationData(); also has new in it.
Code: [Select]
void Mesh::buildInterpolationData(){
    interpolationData= new InterpolationData(this);
 }

I'm not really sure how to fix this problem or why it is occuring but I'd say this is getting close to where the problem is. I hope this helps.

Looking at the source it seems that there is a version 4.
« Last Edit: 11 April 2016, 15:32:38 by filux »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/