HottBJ 0.3d Released, with Morph support

http://pub.admc.com/misc/jme/hottbj-0.3d.zip

There is a new Online Help Page available through the exporter which explains each of the new game integration features (Mountpoints, hot skin meshes, morphing, etc.).



See this post:

http://jmonkeyengine.com/forum/index.php?topic=11751.msg87840#msg87840

for screen shots.  I was going to take new screen shots since I vertex colored the model, but that really doesn’t make it look any better.  Vertex coloring with very low vertex density looks like sh**.



Test drive it at http://pub.admc.com/misc/morphplay01.jnlp.

(You’ll see what I mean about the poor quality of the vertex coloring).

Click the iconified icon at lower left to display the Tree widget then click on SuzanneMesh in the tree.  That will change the Properties Widget to display the MorphingTriMesh properties.  Use the first pulldown to select demonosity or alienness then use the scroll bar to play.

general question about the exporter how does it handle scene export does it separate indiviual obj into nodes :slight_smile: or lump them as trimeshes :(, does it support groups, in that it will recognise "grouped"  objects in blender and wrap them in a node preferably without "flattening" the group into a single trimesh.



what I want to do is build my level in blender, break them up into rooms and sectors and export the entire scene to jme and detach reattach rooms sectors as necessary

mcbeth said:

general question about the exporter how does it handle scene export does it separate indiviual obj into nodes :) or lump them as trimeshes :(, does it support groups, in that it will recognise "grouped"  objects in blender and wrap them in a node preferably without "flattening" the group into a single trimesh.

what I want to do is build my level in blender, break them up into rooms and sectors and export the entire scene to jme and detach reattach rooms sectors as necessary


Good questions.  Generally, HottBJ attempts to reproduce the structure as it is in Blender, limited by capability differences between jME and Blender, performance-improvement opportunities, and limited development time.

For independent Blender Mesh Objects (Object + Mesh pairs), HottBJ will export them as Node+Geometry pairs.  The Geometry will be a TriMesh unless the Mesh contains only Quad faces in Blender.  I'm thinking about an option to eliminate unnecessary Nodes, because since jME meshes can have a transform but Blender Meshes do not, the Nodes could be an unnecessary peformance and complexity cost (though, as I said, they do keep the scene closer to what it was in Blender).

HottBJ will never merge multiple Meshes.  Ashton is currently working on support for Material Indexes, and that would break single Blender Meshes into multiple jME TriMeshes if Indexes are used.

When you say "Group", I don't know if you mean generally, as accomplished by parenting, or Blender's named group function as described at http://wiki.blender.org/index.php/Doc:Manual/Modelling/Objects/Groups_and_Parenting#Grouping_objects.  HottBJ does not support named Groups, and I don't think it would be worth the effort to support them, since in the end it would require custom code on the jME side anyways.  If you mean parenting, yes, HottBJ preserves Blender Object parenting.


If your Blender Outliner looks like

    - House
        - Sector A
            - Bathroom
                - BathroomMesh
            - MasterBedroom
                - MasterBedroomMesh
        - Sector B
            - LivingRoom
                - LivingRoomMesh
            - Office
               - OfficeMesh
            - Gym
                - GymMesh
        ...



Then on the jME side, you can detach and re-attach Nodes "Sector A" and "Sector B".

However, when the goal is dynamic attaching/reattaching, that's usually better managed by having each attachable sub-scene in its own model file.  You can load and save the sub-scenes easier, and if you want better performance, you can write and save these subscenes as binary .jme files.  On the Blender side, Layers are an excellent way to view and work with any subset of the nodes at the same time, and then export only intersections with the selected layers (like "Sector A")... i.e. use Blender Layers to specify target model file.  If you use Layers for other organizational purposes, Blender named Groups and other features can be used for export selection.

yeah I was thinking named groups, but it u are suggesting that parenting will produce a node tree for a sector, thats cool too, I was thinking that this might make it easy to strip out common geomerty(small_table, small_table.001)  for sharednodes


For anybody who had portability problems with Modeler, or who was just frustrated with the bugs, Modeler has been overhauled.  No major new features, but many bugs and behavior problems are fixed, it starts up much quicker, and it’s prettier.



Still requires Java 6.



Launcher with Morphing Suzanne model:  http://pub.admc.com/modeler/modeler-demo.jnlp



Launcher with no model.  You use your own with file navigator, URL, or constructor or factor specs:  http://pub.admc.com/modeler/modeler.jnlp



Same as previous, but restores default video settings:  http://pub.admc.com/modeler/modeler-reset.jnlp



FYI:  I’m upgrading the AnimalNode control widget now.  When that’s done, I’ll add a launcher above to demo Mountpoints/Hot-skinning, etc.

Thank you very much blaine!

The Exporter and Modeler is very nice :smiley:

I've used it a lot!



tim8dev

tim8dev said:

Thank you very much blaine!
The Exporter and Modeler is very nice :D
I've used it a lot!

tim8dev


Thanks very much.  Let me know of any issues with the new Modeler, please.  (Please scan the bug list in the help page before reporting though).

I'd love it if somebody could test on Mac, particularly with the navigation keys (Java's terrible keyboard control makes this platform-sensitive).  Macs also have other known issues with recent JOGL and Java features.

Hi.

New to jME and the forums. I've gone through the animation tutorials with great results.

Thanks alot for those! Hope to see more.



Thought i'd mention an issue i had, and how it was solved, for any others who encounter the same thing:

I had a character had a few additional limbs replaced and even though i reapplied bone weights afterwards some vertices refused to follow the armature when exported.

Eventually, i selected all edges in Blender, and selected "Object/Edges/Clear seams" and "Object/Edges/Clear sharp", after which the exporter handled it correctly.

Some time after this, Blender decided to delete my armature when saving, and now i have even graver, but similar problems with the new one and the above solution doesn't work, so i'm not sure if it works every time. But at least it's worth trying.



Best regards,

Rickard

I am working on similar problems myself.



Unless Blender is doing some magic with those seams (which is entirely possible), the seams should just effect UV maps and such, not vert locations or bone influences.  Is your animated model image textured?  If so, could you see what happens if you disable texturing?  (I'm not recommending as a work-around, but just to help get to the core of the problem).


rickard said:

Hi.
New to jME and the forums. I've gone through the animation tutorials with great results.
Thanks alot for those! Hope to see more.

Thought i'd mention an issue i had, and how it was solved, for any others who encounter the same thing:
I had a character had a few additional limbs replaced and even though i reapplied bone weights afterwards some vertices refused to follow the armature when exported.
Eventually, i selected all edges in Blender, and selected "Object/Edges/Clear seams" and "Object/Edges/Clear sharp", after which the exporter handled it correctly.
Some time after this, Blender decided to delete my armature when saving, and now i have even graver, but similar problems with the new one and the above solution doesn't work, so i'm not sure if it works every time. But at least it's worth trying.

Best regards,
Rickard

Is your animated model image textured?  If so, could you see what happens if you disable texturing?  (I'm not recommending as a work-around, but just to help get to the core of the problem).


It's uvmapped with a suitable texture. I just tried removing the material altogether, with the same result. It seems the problem i'm having since the armature was replaced is slightly different though. Now it's random vertex chunks all over the body that are affected.
It feels somehow as if the bone weight doesn't get applied everywhere.

Tell me if there's anything else you want me to try.

/Rickard

Please go to http://www.jmonkeyengine.com/forum/index.php?topic=12009.0 for the re-weighting discussion.

I have a couple of questions regarding this release;



Morphing seems like it could be very useful, how is it memory wise? Do you need to keep all morphable meshes in memory, or will it create a new one so you can dump the original ones (in case you don't want to do any further morphing).



My original plan was to go for a single mesh, and then scale bones, in-engine, for character customization, but would morphing be better for that purpose? I guess there could be a problem additional skin nodes, though, since the armature remains unmodified.



Regarding mount points. I've been able to successfully export Empties as mount points and attach items to them, but i don't get how you attach it to the armature. The screenshot clearly shows it nested by the hand bone, but i can't attach a Modifier to my Empties.

I would be most grateful for a further explanation.



Thanks



Best regards,

Rickard

rickard said:

I have a couple of questions regarding this release;

Morphing seems like it could be very useful, how is it memory wise? Do you need to keep all morphable meshes in memory, or will it create a new one so you can dump the original ones (in case you don't want to do any further morphing).

My original plan was to go for a single mesh, and then scale bones, in-engine, for character customization, but would morphing be better for that purpose? I guess there could be a problem additional skin nodes, though, since the armature remains unmodified.

Regarding mount points. I've been able to successfully export Empties as mount points and attach items to them, but i don't get how you attach it to the armature. The screenshot clearly shows it nested by the hand bone, but i can't attach a Modifier to my Empties.
I would be most grateful for a further explanation.

Thanks

Best regards,
Rickard


Great questions, Rickard.  I'm glad to see somebody interested in the advanced features.

Morph memory usage:  Right now all of the morphs are kept in memory.  My intention is to add an option to automatically cache the member morphs to local binary *.jme files.  That would be easy to do, and if you want that feature before I get to it, I welcome you to implement it.  But for the special case where you want to do a one-time morph, it may be easier for you to just programmatically detach the member morphs after you morph().  You could also do that manually with an editor by exporting to jME XML after doing the morph, then use an editor to remove the member node elements.  I guess this could result in validation failures when the MorphingTrimesh tries to load with zero member morphs, but if you get that far I can help you or enhance the code if that turns out to be necessary.

WRT your scaling use case, I can't quite tell your ultimate purpose.  If you want to scale the entire model equally, then just scale the appopriate high-level node and be done with it.  If you want to selectively scale parts, then use Modeler to interactively apply scales to bones and geometries and let me know how that works!  I don't understand how you get from "then scale bones" to "the armature remains unmodified".  If you scale bones, then the armature gets modified.

The empties get parented to individual bones inside of Blender.  Please re-check the HottBJ help pages, the forum posts, and the anim tutorial on that point.  If you check and I have not adequately explained how to accomplish that, please post the references and I'll fix the documentation on that point.  If you parent a mount point to an individual bone, then it will be attached to the armature.

Thanks for the replies.


If you want to selectively scale parts, then use Modeler to interactively apply scales to bones and geometries and let me know how that works!


Will do! I was actually planning to scale them procedurally, in-game. Maybe that's not possible for one reason or another, but i'll try that anyhow!

I don't understand how you get from "then scale bones" to "the armature remains unmodified".  If you scale bones, then the armature gets modified.


Sorry for being unclear. I mean that if you morph the mesh, the armature remains unmodified, which could cause problems with skin nodes.
Scaling bones wouldn't have that problem.

The empties get parented to individual bones inside of Blender.


This was what i was looking for, thanks. Without double checking, i don't think the documentation mentions this, but i'll check again to be sure. When experimenting, i believe i only parented the Armature.

Best regards,
Rickard
rickard said:

Thanks for the replies.

If you want to selectively scale parts, then use Modeler to interactively apply scales to bones and geometries and let me know how that works!


Will do! I was actually planning to scale them procedurally, in-game. Maybe that's not possible for one reason or another, but i'll try that anyhow!


The idea is to do it interactively just to see the effects.  Then you will know what you need to do programmatically.  That's the main reason the feature is there in Modeler.


I don't understand how you get from "then scale bones" to "the armature remains unmodified".  If you scale bones, then the armature gets modified.


Sorry for being unclear. I mean that if you morph the mesh, the armature remains unmodified, which could cause problems with skin nodes.
Scaling bones wouldn't have that problem.


The deduction is only true if you morph the skin such that the relative distance/directions to the bones are no longer appropriate for the movements you need.  Morphing skins does not in itself break skin & bones.  The relocated skin vertexes will be influenced in the same way as the original vertex locations were influenced.

Scaling bones may or may not lead to further complications with the animation system.  Give it a try.
rickard said:

The empties get parented to individual bones inside of Blender.


This was what i was looking for, thanks. Without double checking, i don't think the documentation mentions this, but i'll check again to be sure. When experimenting, i believe i only parented the Armature.
...
Rickard


This should be documented in the appropriate HottBJ Online Help page, even if it is documented in a forum or elsewhere.

http://jmonkeyengine.googlecode.com/svn/branches/blenderjme/src/hottbj/integfeatures.html#mountpoints
This is the dev version, so the version label up top appears as a variable.  The HottBJ Online Help will continue to show the old page until I build the next HottBJ release and you upgrade to that.

Initial testing of Bone scaling inside the engine are positive (and slightly hilarious).

A couple of notes;

You can't currently select a Bone by name, only by position in the arraylist. Work-around is to create a convenience method.

Scaling a bone will also scale all the children. Not ideal, but it should be possible to work around that as well (rescaling all children afterwards).

Some bounding problems occur as the character expands outside its old bounds. Haven't found a way to sort that yet (haven't tried much either).

rickard said:

Initial testing of Bone scaling inside the engine are positive (and slightly hilarious).
A couple of notes;
You can't currently select a Bone by name, only by position in the arraylist. Work-around is to create a convenience method.

I did create such a convenience method, and I use it all the time for this.  See the usage of Node.descendantMatches() in XmlAnimator.java.


Scaling a bone will also scale all the children. Not ideal, but it should be possible to work around that as well (rescaling all children afterwards).

The effect you notice here is the reason why bone scaling in Blender is incompatible with jME.


Some bounding problems occur as the character expands outside its old bounds. Haven't found a way to sort that yet (haven't tried much either).


Hm.  The default game loops update the world bounds each frame.  Are you sure that you're allocating BoundingVolume instances upon loads?
I did create such a convenience method, and I use it all the time for this.  See the usage of Node.descendantMatches() in XmlAnimator.java.


Ah, excellent. I created one of my own, but put it in my Actor class, so it's not that pretty.

Hm.  The default game loops update the world bounds each frame.  Are you sure that you're allocating BoundingVolume instances upon loads?


Yes. I also forced an updateModelBounds() and updateWorldBounds() after scaling. But i haven't had time to test much yet, it could be something else (like my y-offset after terrain collision being hard coded or something like that).
So never mind this, for now.

hi! hum… I am not really sure if that feature is design-time only… I am inclined to think that it is not the case, because I am playing with a blender lightmapped model that was originally designed to be exported and played within the irrlitch engine. so, at least with irrlitch, you can execute at runtime a model with different textures and uv coordinates by each texture (that is how they implement the lightmap trick…) I am going to research a bit more about other ways to do that in JME…