mifth said:
sorry, what is "cast"? o you mean to use DesktopAssetManager?
[java]
DesktopAssetManager dam = (DesktopAssetManager)assetManager;
dam.clearCache();
[/java]
:roll:?
Edit: http://www.tutorialspoint.com/java/java_polymorphism.htm
mifth said:
sorry, what is "cast"? o you mean to use DesktopAssetManager?
WOW! thanks!!! It seems it works.
Just want to say THANKS again for the blender loader and add my scene loader to this topic. You can load any models with unique names.
[java]
package basic_examples;
/*You can get transforms from *.blend files and use your models for it.
Here is a screenshot for the blender scene composer.
http://imageshack.us/photo/my-images/585/ee1r.jpg/
Uploaded with ImageShack.us
Really nice :D. Just a tip, avoid using ā_ā for attributes and class names, Itās not a good practiseā¦
For example :
Instead : āblender_scene_composerā
Use: āBlenderSceneComposerāā¦
hm, Iām still not able to load animations properly (using the latest svn-checkout).
If I use the BlenderLoader, the resultSet doesnāt contain any animation. With the BlenderModelLoader Iām getting a null-pointer-exception because of a bone with a null-name (the strange thing is, that this bone doesnāt exist in my scene. The Loader always loads one bone more than I have created). Also I wasnāt able to load the animation with the ManualBlenderTester-class from the test-package.
Iām using blender 2.58. The animation is made of an armature which bones are asigned to a vertGroup.
Is there a testcase for explicit animation loading?
The animations may not work 100% properly yet.
Sorry about that.
Iām currently finishin my work with textures which is most urgent at the moment.
But after Iām done with that Iāll switch to animations.
Probably some things changed in jme in animations and were not updated in blender loader.
But textures goes first at the moment
Hello, thanks very much for this help! Iām still having trouble understanding how this all works, so small question; in the first line:
assetManager.registerLocator(āblender/file/pathā, ChosenLocatorClass.class);
I take it āblender/file/pathā is the location where all your model files are saved? Secondly, what is the ChosenLocatorClass supposed to be?
For the nightly version of jme3 the blender loader is already registered, you can simply load models like
[java]Spatial spat = assetManager.loadModel("Models/MyModel.blend");[/java]
Note however that the blend format is less than ideal for distribution and you should convert the models to j3o format using e.g. the jMonkeyEngine SDK.
Thanks for the answer Normen. Iāve tried using this method, and it throws a NullPointerException: The pointer points to nothing. Hereās the first part of the error stack:
java.lang.NullPointerException: The pointer points to nothing!
at com.jme3.scene.plugins.blender.file.Pointer.fetchData(Pointer.java:92)
at com.jme3.scene.plugins.blender.meshes.MeshHelper.getVertices(MeshHelper.java:548)
at com.jme3.scene.plugins.blender.meshes.MeshHelper.toMesh(MeshHelper.java:120)
Now naturally this means something is invalid in the .blend file, but could anyone give some advice as to where to find the problem or how to solve it? Our modeller is still learning the ropes too, so I donāt think heāll know the answer himself.
I have problems loading scenes with BlenderLoader. I tried the following:
[java]
assetManager.registerLoader(BlenderLoader.class, āblendā);
LoadingResults level = (LoadingResults) assetManager.loadModel(ālevels/00/00/00_00.blendā);
for (Spatial scene : level.getScenes())
rootNode.attachChild(scene);
for (Light l : level.getLights())
rootNode.addLight(l);
[/java]
But this gives me an empty scene. (The file only has one single scene, in case you are wondering.) From jMEās output, it seems that no object is ever added to the āSceneā node. The following works:
[java]
assetManager.registerLoader(BlenderLoader.class, āblendā);
LoadingResults level = (LoadingResults) assetManager.loadModel(ālevels/00/00/00_00.blendā);
for (Spatial object : level.getObjects())
rootNode.attachChild(object);
for (Light l : level.getLights())
rootNode.addLight(l);
[/java]
(I donāt want to use that version as I fear that this breaks parenting relationships between objects.)
OK Iāll check this out.
Maybe Iāve missed something during attaching nodes to the scene
OK,
Iāve made some changes and bugfixing.
Try now to load the scene and let me know if it worked
Nice work! Tested this a little, unfortunately having some problems with texturing:
I can texture blenderās (2.59) default cube, and its duplicates (using Shift+D) with different textures and these works. But if I create new object and texture it, that texture doesnt show up in my jme3 test.
I load my scene just using
[java]
Spatial scene = assetManager.loadModel(āModels/test.blendā);
rootNode.attachChild(scene);
[/java]
Oops, my bad, I forgot to add MATERIALS to new objects (I just dragānādropped TEXTURES to them). Now I can see my beautiful couch scene with textures
I have the problem, that my imported blender models, donāt receive any ambient light. Maybe thereās a setting somewhere that I have missed. Iāve tried different material shading and texture influence settings and ambient color in the world dialog as well. An .obj file works fine if I set an ambient color in the blender world panel. I am using Blender 2.59 and the latest nightly of the monkey SDK.
My .blend scenes does not render right any more, some objects have wrong positions and rotations (I have updated jme & jmp+plugins).
Big thanks so far, Iāve really been waiting for something like this. However Iām facing some problems.
Hello,
I have some problems importing blender models.
In blender I have a textured object without UV problems.