Hello all,
I created 4 adjacent cubes using blender. Then, I exported it to jMonkeyEngine as adjCube.blender. In jMonkeyEngine I converted it to a j3o binary, and it did it successfully, but when I try to see the image I am not able to see anything just black screen with the blue, green, and red vector.
What can I do in order to see the image?
Thanks!
turn on the light?
I just tried to import a .blend file of 4 stacked cubes as well but I end up with an error of:
A java.lang.NullPointerException exception has occurred.
However, the system should continue working without further problems.
Click Show Details for the stack trace.
Show Details:
java.lang.NullPointerException
at com.jme3.scene.plugins.blender.textures.TextureHelper.getTextureFromImage(TextureHelper.java:476)
at com.jme3.scene.plugins.blender.meshes.MeshHelper.toMesh(MeshHelper.java:189)
at com.jme3.scene.plugins.blender.objects.ObjectHelper.toObject(ObjectHelper.java:158)
at com.jme3.scene.plugins.blender.AbstractBlenderLoader.toObject(AbstractBlenderLoader.java:132)
at com.jme3.scene.plugins.blender.BlenderLoader.toObject(BlenderLoader.java:70)
at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:63)
at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:49)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:282)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)
[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:53)
at com.jme3.gde.core.assets.AssetData.loadAsset(AssetData.java:84)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel3.loadModel(ModelImporterVisualPanel3.java:90)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel3.loadSettings(ModelImporterVisualPanel3.java:59)
at com.jme3.gde.modelimporter.ModelImporterWizardPanel3.readSettings(ModelImporterWizardPanel3.java:81)
at org.openide.WizardDescriptor.updateStateOpen(WizardDescriptor.java:910)
at org.openide.WizardDescriptor.updateState(WizardDescriptor.java:861)
at org.openide.WizardDescriptor.goToNextStep(WizardDescriptor.java:1072)
at org.openide.WizardDescriptor.access$1200(WizardDescriptor.java:137)
at org.openide.WizardDescriptor$Listener$1.run(WizardDescriptor.java:2052)
at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1480)
at org.openide.WizardDescriptor.access$1300(WizardDescriptor.java:137)
at org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:2071)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
at $Proxy37.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)
at java.awt.EventQueue.access$000(EventQueue.java:102)
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:676)
at java.awt.EventQueue$4.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:155)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:1038)
at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:1072)
at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:1060)
at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:126)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
at org.openide.util.Mutex.readAccess(Mutex.java:271)
at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:1045)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at com.jme3.gde.modelimporter.ImportModel.actionPerformed(ImportModel.java:52)
at org.openide.awt.InjectorExactlyOne.actionPerformed(InjectorExactlyOne.java:78)
at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)
at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:250)
at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.awt.GeneralAction$DelegateAction.actionPerformed(GeneralAction.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703)
at java.awt.EventQueue.access$000(EventQueue.java:102)
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:676)
at java.awt.EventQueue$4.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
I then took the standard monkey and then put it into the models dir, and then converted to .j3o when I go to scenecomposer the .j3o of the .blend file will open but even with clicking the light the model does not appear and a message of:
com.jme3.asset.AssetNotFoundException: Models/monkey.blend
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:277)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)
[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)
at com.jme3.gde.core.assets.actions.ConvertModel$1.run(ConvertModel.java:63)
at java.lang.Thread.run(Thread.java:722)
and:
A com.jme3.asset.AssetNotFoundException exception has occurred.
However, the system should continue working without further problems.
Click Show Details for the stack trace.
Edit:
{
I see that it says it is because it can not find Models/monkey.blend
After moving the files, which was named monkey.blend to the models directory. In the Jme asset manager I had right clicked it and choose to rename the item. I show the model has been renamed to monkey025.blend in the model directory as well.
}
Edit # 2:
{
I opened the original model in blender and then saved a new copy with the filename I wanted into the model dir. Now I am able to convert to .j3o and open in scenecomposer. Yet, when I push the light button the model does not appear, but there is no message in bottom right corner.
}
appears. I hope this helps. I have the .blend plugin for jme installed along with the nightly build option selected but I do not see any new updates listed.
It is happening the same thing to me. It doesn’t matter if I turn on the light, I am still not able to see the object in scene composer.
You cannot have the file opened in blender and jme at the same time (on windows).
@danvath what blender version do you use ??
Because if it is Blender 2.63+ the mesh is stored in NGons which is not yet supported.
I created a simple cube with a texture and I didn’t see it on my scene because the actual mesh was empty.
The models made of triangles and quads should be loaded properly though.
I plan to add NGon support but I have to deal with current issues first.
And I am only bothered with the exception you got:
java.lang.NullPointerException
at com.jme3.scene.plugins.blender.textures.TextureHelper.getTextureFromImage(TextureHelper.java:476)
at com.jme3.scene.plugins.blender.meshes.MeshHelper.toMesh(MeshHelper.java:189)
at com.jme3.scene.plugins.blender.objects.ObjectHelper.toObject(ObjectHelper.java:158)
…
Beacuse around line 476 there is a pointer taken to the field ‘packedfile’ in the blender’s image structure. If you get NPE there it seems like the structure had been changed and simple java null was returned instead of Pointer class instance.
If you could provide me with the blend file I could check this out because I didn’t get NPE there.
After trying a few times with the other files I tried to dl one online from blender repository which is the one that gave me the nullpointerexception. The link to the file is:
http://www.blender-models.com/model-downloads/characters/id/fighter-updated/
I was thinking that it may have been a corrupted dl of blender on my part.
I am using 2.63, I was told to give 2.62 a try but I still have same thing when using models from that as well. Do you know what verison of blender does not use the NGons by chance?
Blender 2.62 does not have NGons yet. I managed to save my NGon cube there and it appeared as it should have after loading it by jme.
As for the fighter model the file is definitely corrupted. I got NPE while reading material arrays because in my result array I didn’t get the ‘Material’ structure but something else. Even blender said that several material blocks are invalid.
And I belive that your first error was also due to the file corruption because it didn’t find field of a structure which should be there.
@Kaelthas, @Danvath, @zero007
Found a work around → see http://hub.jmonkeyengine.org/groups/import-assets/forum/topic/yet-another-import-problem/