I can`t find problem in LoadTexture to imported model

I make Mesh by Blender 2.6 and i export it as Ogre.xml.

and i convert ogre.xml → .j3o in JME SDK.

i should use ‘scaleTextureCoordinates’ for WrapMode.Repeat.

To get mesh from Imported Model, So, i type the code like this. → ((Geometry)(world).getChild(0)).getMesh().scaleTextureCoordinates(new Vector2f(40,40));



Here is my sourcecode.

[java]

Node world = (Node)assetManager.loadModel(“world/Stone.j3o”);

world.setLocalScale(4.0f);

world.setLocalTranslation(4f, -1f, -4f);

Material matStone = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);

((Geometry)(world).getChild(0)).getMesh().scaleTextureCoordinates(new Vector2f(40,40));

// This code occur runtime Error!

Texture txtStone = assetManager.loadTexture(new TextureKey(“Models/Stone/Rock.PNG”,false));

txtStone.setWrap(Texture.WrapMode.Repeat);

matStone.setTexture(“ColorMap”, txtStone);

world.setMaterial(matStone);

rootNode.attachChild(world);

[/java]

Are you sure your world.getChild(0) is a geometry?

you’d better use world.getChild(“nameOfTheGeometry”), this way you are sure to grab the good object.

@nehon said:
Are you sure your world.getChild(0) is a geometry?
you'd better use world.getChild("nameOfTheGeometry"), this way you are sure to grab the good object.

Thank you ^^ I`ll test this!!