Import model saved with blenderjmeXMLExport


hi there,
i'm trying to import into jme a model i saved in blender using jmeXMLExport.
i had a look at TestXMLExporter.java
and i saw this test first create barebone from within jme itself and then save them using ByteArrayOutputStream bos.


ByteArrayOutputStream bos = new ByteArrayOutputStream();
XMLExporter.getInstance().save(t, bos);



later it's then read using:


ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
t = (Node) XMLImporter.getInstance().load(bis);



i just want to import a model created in blender using xml format,
but i see there's no converter for xml, so i cannot use:


FormatConverter converter=new ObjToJme();
converter.convert(model.openStream(), BO);
 map=(Spatial) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));



.. i need to feed the ByteArrayOutputStream BO with something to be able to read from it with ByteArrayInputStream.

how can i import somthing i haven't created with barebone jme like in the TestXMLExporter.java ?
i just want to import it..
( and not create something from jme, export it and then import it like TestXMLExporter.java does if i'm not mistaken)
i think i need something like  TestXMLImporter.java ?


tnx

@all

i’ve slept a bit on it all… i feel a bit cooler now… sorry it seems i overreacted a tad :wink:

even if somethings i’ve said are true, there maybe better way to put it up.

i apologies



but still, it don’t work… :wink:



@nymon

i have made quite a few now, which one do you want? i have xml, obj, 3ds…

i could make an archive of it all ?

want me to paste  them (xml/obj/mtl), or link to them ?



*update:

anyway here the whole “data/” dir, contains it all with file creation date you could see what was made last.

data.tar.gz

if you need me to paste the code of the last file i was working on (obj/mtl) or something else please tell me.


OK I have good news keisangi! You had it right about 12:15 yesterday when you made mad.obj and mad.mtl. You successfully uv mapped your cube from blender, but the problem was in loading your tga texture.



What I did was opened up the obj and mtl files in a text editor and changed all references of uvface_Cube.tga to weasel.png and then loaded it into jME and it showed up with the texture. I don't think the uv coords are exactly what you were looking for, but none the less you had it right.



As an excercise, open Blender, and with the new cube change to the UV map view and select all of the cube. You will notice that the UV map is all blue. Don't unwrap the UV, just leave it as is and export the obj. Now you should get the whole texture on each face of the cube. When you unwrap it, its like stretching the texture over the whole cube, instead of on each face. Also, try this with png or jpg textures. Not too sure about tga support in jME.



Way late for me, sleep time… Hope this helps

@nymon

damn… i was that close… :slight_smile:



after all i tryed i could  have finally got it right once … :wink:

anyway thanks for the help…



btw, if i get it right this time, would it be possible that i update  the doc?

the page is outdated… i don't know who should i ask to access and edit it.

i could update more docs  as i progress if needed?

Hello,



I'm a recruitment consultant in the UK and am currently looking for a number of Java developers with jME experience for a client in the Hampshire area of the UK on a contract basis. My client is looking for people with a background in either the Gaming or GIS / GeoSpatial Industries to work on this state of the art project. If you are looking for your next opportunity in this area, are available now and have the relevant expertise then please email me at stuart@ashtongeo.co.uk or call me on 0117 302 7500. These contracts are for an initial 6 months with good day rates.



Thanks for reading this, I look forward to hearing from you.



Regards



Stuart

AshtonGeo

0117 302 7500

keisangi, you must understand that this engine and all libraries for it were created by people on their free time, without any payment or compensation what so ever. If you want all your requirements satisfied go buy Torque and pay 150,000$ per license; everything will work perfectly and you can even hire a little gnome assistant to tell you exactly what to do.  :wink:





On the Blender issue, if you used the ultimate, most powerful exporter, and the ultimate, most powerful engine, your cube still won't load.

Why? Because you need to know how to model, what UV coordinates mean, how to unwrap, how to apply materials, and how to use export scripts. Why is it that I can export my model from Blender3D and use it just fine?

It's not a flaw in Blender, it's a flaw in you. Lightwave works because it's not Blender3D, and it does things differently.


first we are speaking about basic features and jme claims to be able to do.
2nd, i'm not requesting new features, i just want what is reported as "working" to be working.
if it needs workarounds, they should be put together and maintained up to date. 
jme maintainer should put up a wiki or something if they want user to work uptodate docs for themselves.
and last, please note i offered my my help to maintain and put things to order.

what's wrong in saying things need an update?

no need to get out the old song "buy a xxxxx for 1000xxx$$ and everything will work fine and blahblah.
if you are satisfied by the present state of things in jme,  fine for you, i guess some other aren't.
then since you brought this up, lemme say if i ever need a little gnome, i'll ask you ;)

finally, if blender needs workaround to work with jme don't say "it work differently" when obviously the exporter seems flawed. not exporting texture coordinates unless you use uv and set them up manuallly is not working differently.
it's a bug, or missing features. it doesn't work differently: "it does not work well" / "it requiere workarounds" .. it's not the same thing.
and should be reported as such.

keisangi, would you mind posting your exported model file?

@all

i got it working now…

tnx to everypne for the help and the patience.

sorry for the bitching … (not sure about this word, english isn't my 1st language)



if docs were up to date all these could have been avoided.

true i grumble too much,but think about it, other might experience the same frustration.

so what do we do for the docs?



someone have to make a nice tutorial it's very easy once you get it, but when you don't at first it's really annoying and frustrating, one get the impression nothing work and etc…

i can help making a nice tutorial… just lemme know.

i'm on #jme all the time, same nick. let's organize something about it.




Just use a FileInputStream instead of the ByteArrayInputStream.

i'll try tnx :slight_smile:

ok, i did this:



        try {
            FileInputStream fis = new FileInputStream("data/grmbl.blend.xml");
            map = (Spatial) XMLImporter.getInstance().load(fis);       
            map.setLocalScale(.1f);
            rootNode.attachChild(map);
            rootNode.updateGeometricState(0, true);
            rootNode.updateRenderState();
        } catch (Exception e) {
            System.out.println("Damn exceptions! O_o n" + e);
            e.printStackTrace();
            System.exit(0);
        }


i can't see nothing.
the model can be seen here
here's what blender rendered: here
did i forget something ? maybe i need to add a light ?
the class in which i tryed this is:
public class MenuState extends CameraGameState { }
i want to create a 3d model for the game title to appear in the menu

and even though it display nothing, i saw in the output it couldn't find the texture specified in the xml.
what cant i use instead of this:


URL folder= IngameState.class.getClassLoader().getResource("data/");
        converter.setProperty("mtllib", folder);
        converter.setProperty("texdir", folder);



since i don't use converter but FileInputStream instead how do i tell it where to find resources ?

ok, i did this…

now the  object is displayed and there’s no more complain about "missing texture.

but then, i get this output:

instead of this:


    public MenuState(String name) {
        super(name);

        display = DisplaySystem.getDisplaySystem();
        initInput();
        initText();

        try {
            URL folder= IngameState.class.getClassLoader().getResource("data/");
            ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(folder));           
            FileInputStream fis = new FileInputStream("data/grmbl2.xml");
            map = (Spatial) XMLImporter.getInstance().load(fis);       
            //map.setLocalScale(.4f);
            map.setLocalTranslation(0, 0, 5);
            map.getLocalRotation().set(new Quaternion()
            .fromAngleAxis( - FastMath.PI/2, new Vector3f(8,5,1)) );
            rootNode.attachChild(map);
            rootNode.updateGeometricState(0, true);
            rootNode.updateRenderState();
        } catch (Exception e) {
            System.out.println("Damn exceptions! O_o n" + e);
            e.printStackTrace();
            System.exit(0);
        }
       
        PointLight light = new PointLight();
        light.setEnabled(true);
        lightstate = display.getRenderer().createLightState();
        lightstate.setEnabled(true);
        lightstate.attach(light);
        rootNode.setRenderState(lightstate);

    }


is it a problem realted to blender ?

Looks like your texture gets loaded wrong somehow.

I can see in the model file that you are using a png image for the texture.

Try another format. Some png images seem to have subtle quirks in their encoding (esp. when using indexed color tables) which can make them difficult to read for some importers.

tnx for the advice, i've tryed with a jpg but

sadly i get the same output in jme.



i could provide blender project …maybe i clicked something i shouldn't have somewhere in blender?

but basicaly, i've just launched blender, and assigned a texture on the default cube, default material.

test on blender 2.46 and 2.48. i use ubuntu 8.10. gfx card is nvidia 9600gt (nvidia driver)



the full source for this class is here:


import java.io.FileInputStream;
import java.net.URL;

import com.jme.input.InputHandler;
import com.jme.input.KeyBindingManager;
import com.jme.input.KeyInput;
import com.jme.input.Mouse;
import com.jme.light.PointLight;
import com.jme.math.FastMath;
import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Spatial;
import com.jme.scene.Text;
import com.jme.scene.state.LightState;
import com.jme.scene.state.MaterialState;
import com.jme.scene.state.MaterialState.ColorMaterial;
import com.jme.system.DisplaySystem;
import com.jme.util.export.xml.XMLImporter;
import com.jme.util.resource.ResourceLocatorTool;
import com.jme.util.resource.SimpleResourceLocator;
import com.jmex.game.state.CameraGameState;
import com.jmex.game.state.GameState;
import com.jmex.game.state.GameStateManager;

public class MenuState extends CameraGameState {
   
    private DisplaySystem display;
    private Text start,control,load,save,exit;
    private InputHandler input;
    private Mouse mouse;
    private Spatial map;
    private LightState lightstate;
    private GameState myState;
   
    public MenuState(String name) {
        super(name);

        initInput();
        initText();

        try {
            URL folder= IngameState.class.getClassLoader().getResource("data/");
            ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(folder));           
            FileInputStream fis = new FileInputStream("data/blob.xml");
            map = (Spatial) XMLImporter.getInstance().load(fis);       
            //map.setLocalScale(.4f);
            map.setLocalTranslation(0, 0, 5);
            map.getLocalRotation().set(new Quaternion()
            .fromAngleAxis( - FastMath.PI/2, new Vector3f(8,5,1)) );
            rootNode.attachChild(map);
            rootNode.updateGeometricState(0, true);
            rootNode.updateRenderState();
        } catch (Exception e) {
            System.out.println("Damn exceptions! O_o n" + e);
            e.printStackTrace();
            System.exit(0);
        }
       
        PointLight light = new PointLight();
        light.setEnabled(true);
        lightstate = display.getRenderer().createLightState();
        lightstate.setEnabled(true);
        lightstate.attach(light);
        rootNode.setRenderState(lightstate);
    }

    public void onActivate() {
        display.setTitle("Dungeon 3D - Title screen");       
        super.onActivate();
    }

    protected void initInput() {
        display = DisplaySystem.getDisplaySystem();       
        KeyBindingManager.getKeyBindingManager().set("up", KeyInput.KEY_UP);
        KeyBindingManager.getKeyBindingManager().set("down", KeyInput.KEY_DOWN);
    }
   
    private void initText() {       
        start = Text.createDefaultTextLabel( "info" );
        start.setTextColor(ColorRGBA.green);
        start.print( "Start game" );
        start.getLocalTranslation().set(
                display.getWidth()/2-100,
                display.getHeight()-200, 0 );         
        control = Text.createDefaultTextLabel( "info" );
        control.print( "Controls" );
        control.getLocalTranslation().set(
                display.getWidth()/2-100,
                display.getHeight()-220, 0 );
       
        load = Text.createDefaultTextLabel( "info" );
        load.print( "Load" );
        load.getLocalTranslation().set(
                display.getWidth()/2-100,
                display.getHeight()-240, 0 );         
        save = Text.createDefaultTextLabel( "info" );
        save.print( "Save" );
        save.getLocalTranslation().set(
                display.getWidth()/2-100,
                display.getHeight()-260, 0 );         
        exit = Text.createDefaultTextLabel( "info" );
        exit.print( "Exit" );
        exit.getLocalTranslation().set(
                display.getWidth()/2-100,
                display.getHeight()-280, 0 );         
        rootNode.attachChild( start );
        rootNode.attachChild( control );
        rootNode.attachChild( load );
        rootNode.attachChild( save );
        rootNode.attachChild( exit );
        MaterialState ms = display.getRenderer().createMaterialState();
        ms.setColorMaterial(ColorMaterial.Emissive);
        rootNode.setRenderState(ms);
    }   

    protected void stateUpdate(float tpf) {
        //input.update(tpf);
        if (KeyBindingManager.getKeyBindingManager().isValidCommand("up", false)) {
            GameState ingame = new IngameState("ingame");
            ingame.setActive(true);
            GameStateManager.getInstance().attachChild(ingame);
            this.setActive(false);
        }
        if (KeyBindingManager.getKeyBindingManager().isValidCommand("down", false)) {
            TestGameStateSystem.exit();
        }
        rootNode.updateRenderState();//updateGeometricState(tpf, true);
    }   
}



the xml file:


<?xml version="1.0" encoding="UTF-8" ?>
<com.jme.scene.Node name="Blender Exported Scene">
<children size="1">
        <com.jme.scene.Node  reference_ID="ID_1" name="Cube" >
            <children size="1">
            <com.jme.scene.TriMesh name="Cube.nocull" reference_ID="ID_0">
                    <vertBuf data="1.0000000 0.9999999 -1.0000000  1.0000000 -1.0000000 -1.0000000  -1.0000001 -0.9999998 -1.0000000  -0.9999996 1.0000004 -1.0000000  1.0000005 0.9999995 1.0000000  -0.9999999 1.0000000 1.0000000  -1.0000004 -0.9999996 1.0000000  0.9999993 -1.0000006 1.0000000" size="24"/>
                    <normBuf data="0.5773492 0.5773492 -0.5773492  0.5773492 -0.5773492 -0.5773492  -0.5773492 -0.5773492 -0.5773492  -0.5773492 0.5773492 -0.5773492  0.5773492 0.5773492 0.5773492  -0.5773492 0.5773492 0.5773492  -0.5773492 -0.5773492 0.5773492  0.5773492 -0.5773492 0.5773492" size="24"/>
                    <indexBuffer  data="0 1 2 2 3 0 4 5 6 6 7 4 0 4 7 7 1 0 1 7 6 6 2 1 2 6 5 5 3 2 4 0 3 3 5 4" size="36"/>
                <renderStateList>
                    <com.jme.scene.state.MaterialState class="com.jme.scene.state.lwjgl.LWJGLMaterialState" shininess="12.5244618395">
                        <diffuse  r="0.8000000" g="0.8000000" b="0.8000000" a="1.0000000"/>
                        <ambient  r="0.0000000" g="0.0000000" b="0.0000000" a="1.0000000"/>
                        <emissive  r="0.0000000" g="0.0000000" b="0.0000000" a="1.0000000"/>
                        <specular  r="0.2500000" g="0.2500000" b="0.2500000" a="1.0000000"/>
                    </com.jme.scene.state.MaterialState>
                    <com.jme.scene.state.TextureState class="com.jme.scene.state.lwjgl.LWJGLTextureState">
                        <texture size="1">
                            <com.jme.image.Texture2D>
                                <textureKey  class="com.jme.util.TextureKey" protocol="file" file="catwarrior.jpg"/>
                            </com.jme.image.Texture2D>
                        </texture>
                    </com.jme.scene.state.TextureState>
                </renderStateList>
            </com.jme.scene.TriMesh>
            </children>
            <localTranslation  x="0.0000000" y="0.0000000" z="0.0000000"/>
            <localRotation  x="0.0000000" y="0.0000000" z="0.0000000" w="1.0000000"/>
            <localScale  x="1.0000000" y="1.0000000" z="1.0000000"/>
        </com.jme.scene.Node>
</children>
</com.jme.scene.Node>



the image used:


result in jme:



for the sake of testing i removed all the gamestate class, and went with barebone simpleGame.
here's the code:


import java.io.FileInputStream;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.jme.app.SimpleGame;
import com.jme.light.PointLight;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.Spatial;
import com.jme.scene.state.LightState;
import com.jme.util.export.xml.XMLImporter;
import com.jme.util.resource.ResourceLocatorTool;
import com.jme.util.resource.SimpleResourceLocator;

public class TestGameStateSystem extends SimpleGame {

    private LightState lightState;
    private Spatial map;
  
    public static void main(String[] args) {
        TestGameStateSystem app = new TestGameStateSystem();
        app.setConfigShowMode(ConfigShowMode.AlwaysShow);
        Logger.getLogger("").setLevel(Level.SEVERE);
        app.start();
    }
  
    protected void simpleInitGame() { 
        display.setTitle("test dungeon");
        try {
            URL folder= IngameState.class.getClassLoader().getResource("data/");
            ResourceLocatorTool.addResourceLocator(ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(folder));          
            FileInputStream fis = new FileInputStream("data/lol.xml");
            map = (Spatial) XMLImporter.getInstance().load(fis);
            map.setLocalTranslation(0, 0, 0);
            rootNode.attachChild(map);
            rootNode.updateGeometricState(0, true);
            rootNode.updateRenderState();
        } catch (Exception e) {
            System.out.println("Damn exceptions! O_o n" + e);
            e.printStackTrace();
            System.exit(0);
        }
       
        PointLight light = new PointLight();
        light.setDiffuse( new ColorRGBA( 255f, 255f, 255f, 255f ) );
        light.setAmbient( new ColorRGBA( 0.5f, 0.5f, 0.5f, 1.0f ) );
        light.setLocation( new Vector3f( 200, 200, 200 ) );
        light.setEnabled( true );
        lightState = display.getRenderer().createLightState();
        lightState.setEnabled( true );
        lightState.attach( light );
        rootNode.setRenderState( lightState );      
     }

    protected void simpleUpdate() {  }
}



and here's what i got:


the texture seems to never get applied.
my texture, objects and xml files are all in
Workspace/druaga3/data/
the source is in Workspace/druaga3/src
and i did added "data" directory as a source dir in eclipse menu>project>properties>javabuildpath

the complete output is:


Nov 24, 2008 4:16:40 PM com.jme.app.BaseGame start
INFO: Application started.
Nov 24, 2008 4:16:40 PM com.jme.system.PropertiesGameSettings <init>
INFO: PropertiesGameSettings created
Nov 24, 2008 4:16:40 PM com.jme.system.PropertiesGameSettings load
INFO: Read properties

(<unknown>:23924): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:23924): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:23924): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:23924): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:23924): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:23924): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
Nov 24, 2008 4:16:42 PM com.jme.system.PropertiesGameSettings save
INFO: Saved properties
Nov 24, 2008 4:16:42 PM com.jme.app.BaseSimpleGame initSystem
INFO: jME version 2.0 dev build 2
Nov 24, 2008 4:16:42 PM com.jme.input.joystick.DummyJoystickInput <init>
INFO: Joystick support is disabled
Nov 24, 2008 4:16:42 PM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLRenderer <init>
INFO: LWJGLRenderer created. W:  640H: 480
Nov 24, 2008 4:16:42 PM com.jme.app.BaseSimpleGame initSystem
INFO: Running on: null
Driver version: null
NVIDIA Corporation - GeForce 9600 GT/PCI/SSE2 - 2.1.2 NVIDIA 177.80
Nov 24, 2008 4:16:42 PM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Nov 24, 2008 4:16:42 PM com.jme.util.lwjgl.LWJGLTimer <init>
INFO: Timer resolution: 1000 ticks per second
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node attachChild
INFO: Child (Graph node) attached to this node (Stats node)
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
INFO: FBO support detected.
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer initCamera
INFO: Init RTT camera
Nov 24, 2008 4:16:42 PM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Line <init>
INFO: Line created.
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer setupTexture
INFO: setup fbo tex with id 2: 640,360
Nov 24, 2008 4:16:42 PM com.jme.scene.Node attachChild
INFO: Child (lineGraph) attached to this node (Graph node)
Nov 24, 2008 4:16:42 PM com.jme.scene.Node attachChild
INFO: Child (f4) attached to this node (Graph node)
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer <init>
INFO: FBO support detected.
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer initCamera
INFO: Init RTT camera
Nov 24, 2008 4:16:42 PM com.jme.renderer.AbstractCamera <init>
INFO: Camera created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.renderer.lwjgl.LWJGLTextureRenderer setupTexture
INFO: setup fbo tex with id 3: 640,120
Nov 24, 2008 4:16:42 PM com.jme.scene.Node attachChild
INFO: Child (labelGraph) attached to this node (Graph node)
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node <init>
INFO: Node created.
Nov 24, 2008 4:16:42 PM com.jme.scene.Node attachChild
INFO: Child (Blender Exported Scene) attached to this node (rootNode)
Nov 24, 2008 4:16:45 PM com.jme.app.BaseSimpleGame cleanup
INFO: Cleaning up resources.
Nov 24, 2008 4:16:45 PM com.jme.app.BaseGame start
INFO: Application ending.

that really upset me … this is stupid.

blender  seems full of thing like that :frowning:

well done for spotting the problem… this was like needle in haystack



anyway, "T" didn't worked. i still get no texture.

otoh, i tryed with lightwave, and it worked perfectly fine.



any idea how could i get texture coordinates?

this seems to be a problem on blender side then ? maybe i could ask on blender forums or in #blender channel?

how should i formulate this?

" default cube doesn't have texture coordinates when i export it i get no texture on my object ? "



would that made sense to them ?

in the mean while i'll try create a shape on my own instead of using default cube and see if that help…





*update: i tryed create a 3d text, and a cube of my own (not using default one)

i still get no texture no mater what.

maybe i'm doing thing wrong… i do that:

create object, use default material (if there's none add new)

then add new texture, type image. load image, confirm it renders ok and then export it as obj.

something else needed?


keisangi said:

the texture seems to never get applied.

Yes it does - but without texture coordinates, resulting in the cube having the color of the texture's upper left pixel.
The blender default cube doesn't seem to have texture coordinates set up, so none are exported.
Try creating UV coordinates in blender (press "T" with the cube selected I think) and export again.

You have to know how to UVmap your models, this is basic stuff in modeling, and is required for all 3D applications that need texturing.

Also I can't really support either OBJ (which had texture exporting issues in blender) or JME XML (of which the exporter was made really long ago), two formats that I would consider best are MESH.XML through OgreLoader and MD5 through MD5Importer (had a performance improvement in last version!).

tnx for the info,

i'll try the md5 then

is this the last version? http://www.katsbits.com/files/md5/blender2md5_v0.94_02sept06.zip



september 2006? looks a bit old ?

Momoko_Fan said:

Also I can't really support [...] JME XML (of which the exporter was made really long ago),

@Momoko_Fan: JME XML has only recently become part of jme 2 core, and the exporter has been appropriately updated, so I don't see any problems there.
Using a different file format will change nothing in regard to keisangi's problem, and I don't really see the point of this post.
Unless you just wanted to advertise, which is fine but should not come veiled as an answer to a problem clearly unrelated to file formats. Or maybe you wanted to warn keisangi not to use JME XML because you know of bugs or incompatibilites in the xml exporter I haven't heard of yet, in which case I'd appreciate a note.

@keisangi: All you really need to do is get an overview of the very basics of uv mapping in blender. Which file format you'll be using is up to you of course.
I guess the two formats Momoko_Fan named do get more attention and support now than JME XML, so you might actually want to do the switch. Just keep in mind that you'll still have to create UV coordinates for your model in blender.
Hint: google "blender uv mapping tutorial".