Problem with import .scene and Ogre files together

hi

this code works properly :



[java]

@Override

public void simpleInitApp() {



this.getFlyByCamera().setMoveSpeed(50);



// Spatial ninja = assetManager.loadModel(“Models/Ninja/Ninja.mesh.xml”);

// ninja.scale(0.05f, 0.05f, 0.05f);

// ninja.rotate(0.0f, -3.0f, 0.0f);

// ninja.setLocalTranslation(0.0f, -5.0f, -2.0f);

// rootNode.attachChild(ninja);



assetManager.registerLocator(“town.zip”, ZipLocator.class.getName());

Spatial gameLevel = assetManager.loadModel(“main.scene”);

gameLevel.setLocalTranslation(0, -5.2f, 0);

gameLevel.setLocalScale(2);

rootNode.attachChild(gameLevel);





DirectionalLight sun = new DirectionalLight();

sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));

rootNode.addLight(sun);

}

[/java]



and Also this one



[java]



@Override

public void simpleInitApp() {



this.getFlyByCamera().setMoveSpeed(50);



Spatial ninja = assetManager.loadModel(“Models/Ninja/Ninja.mesh.xml”);

ninja.scale(0.05f, 0.05f, 0.05f);

ninja.rotate(0.0f, -3.0f, 0.0f);

ninja.setLocalTranslation(0.0f, -5.0f, -2.0f);

rootNode.attachChild(ninja);



// assetManager.registerLocator(“town.zip”, ZipLocator.class.getName());

// Spatial gameLevel = assetManager.loadModel(“main.scene”);

// gameLevel.setLocalTranslation(0, -5.2f, 0);

// gameLevel.setLocalScale(2);

// rootNode.attachChild(gameLevel);





DirectionalLight sun = new DirectionalLight();

sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));

rootNode.addLight(sun);



}



[/java]



but when i remove all comments ( import both ogre and scene files ) this Exception occur :



[java]



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at com.jme3.animation.AnimControl.resetToBind(AnimControl.java:272)

at com.jme3.animation.AnimControl.reset(AnimControl.java:261)

at com.jme3.animation.AnimControl.(AnimControl.java:90)

at com.jme3.scene.plugins.ogre.MeshLoader.compileModel(MeshLoader.java:671)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:717)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:175)

at com.jme3.scene.plugins.ogre.SceneLoader.startElement(SceneLoader.java:214)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:293)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:175)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:297)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:307)

at helloworld.HelloAssets.simpleInitApp(HelloAssets.java:41)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:155)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)

at java.lang.Thread.run(Thread.java:619)



[/java]



what is the problem?!

I thought I fixed this issue. Are you using the latest SVN or nightly build version, or alpha2?

yes . i’m using netbenas with libraries of alpha2 from this dir “jmonkeyplatform / libs”

I have fixed this issue after the alpha2 version. You can download jME3 nightly builds here:

http://jmonkeyengine.com/nightly/

Why dont you just use jMP? It has the same code editor as NetBeans and you can update to the latest nightly automatically.

Momoko_Fan said:
I have fixed this issue after the alpha2 version. You can download jME3 nightly builds here:
http://jmonkeyengine.com/nightly/


Done and fixed , thx boss ;)

normen said:
Why dont you just use jMP? It has the same code editor as NetBeans and you can update to the latest nightly automatically.

JMP is really nice but it has some bugs for me specially in SceneViewer. for example i can't view models or sometimes when i want to see my code -after selecting java file- , sceneViewer being lock in top and block my eyesight.
but i'm using JMP too, for example for converting to j3o ;)

When you cant see models in jMP try turning on the light :slight_smile: Also, the SceneViewer should only hide floating windows. If it hides others, you might have to update your JDK.

you were right about light but about other issue , i found out that it hides my source code’s page when i pin the palette to window ( that it is unusual in my opinion ) but you were right about floating window boss.

it seems i have some user level bug no SceneViewer and i beg your pardon :stuck_out_tongue:

but i have a suggestion. i think it is better for light to be On by default.

No, the light is not better on, one should simply learn that w/o light you cannot see anything. In a normal scene you have light and when you have the camera light on by default you will not see the correctly lighted version but the version with your cam light. So “everything is dark, I turn the light on” is more obvious than “why does my scene look different when I load it?” I think.

The thing with the “floating” or “unpinned” windows being hidden is due to heavyweight (OpenGL) / lightweight (Swing) components, Java7 promises to improve this kind of integration.

Cheers,

Normen

yes , you are right again :stuck_out_tongue: Get quiet Soheil :-"