HottBJ 0.3d Released, with Morph support

HottBJ 0.3f released.



This fixes problems with modifying and re-using skins and armatures.  The HottBJ improvements depend on supporting fixes in jME, so you will need to update your jME source from svn too.  For viewers reading this post after the release of jME 2.x stable, that distribution should work fine too.



I am hopeful that this release will also eliminate the need to apply bone heat for skin & bones.  Testers or I will report back here about that.

hi! first time playing with HottBJ, amazing work! noob question: I am trying to export a mesh with two textures: base and lightmap… in blender, they are two UV texture layers at the mesh level.

when I export the jme-xml, the render state list only display one texture (base). lightmap texture is missing…

what is the right way to achieve this? thks…

cesarpachon said:

hi! first time playing with HottBJ, amazing work! noob question: I am trying to export a mesh with two textures: base and lightmap.. in blender, they are two UV texture layers at the mesh level.
when I export the jme-xml, the render state list only display one texture (base). lightmap texture is missing..
what is the right way to achieve this? thks..


Check the console output as the exporter runs.  It should report that it is dropping the unsupported texture.  Only mapping to colors is supported now IIRC.  Anybody who wants support for other types of mappings is welcome to contribute.

thanks for your quick reply. As you said, it was more a issue with configuring properly the materials in blender. right now the jme-xml file export a texture element with two com.jme.image.Texture2D childrens, so, that is working. there is a thing I see: there is only one textBuf element in the file… I was expecting two (one for each texture layer, because each texture is using a different uv mapping coords set).  :?

cesarpachon said:

thanks for your quick reply. As you said, it was more a issue with configuring properly the materials in blender. right now the jme-xml file export a texture element with two com.jme.image.Texture2D childrens, so, that is working. there is a thing I see: there is only one textBuf element in the file.. I was expecting two (one for each texture layer, because each texture is using a different uv mapping coords set).  :?


Ah.  I remember looking into the newish named-uvTexture-layer feature now.  I vaguely, and perhaps incorrectly, remember that the purpose of the feature was design-time switching only.  Where the designer can play with a dozen textures if they want, but if you render, only the current or active texture is used.  Is that wrong?  Is there a way to associate specific image files with specific uv texture layers?  It could be that I came to this conclusion because the Blender Python API gives me no way to access multiple uv texture layers (similar to how they give no Python access to Action pose labels).

In any case, HottBJ will not support what you want to do in the near future.

I've verified that with release 0.3f, HottBJ no longer requires Bone Heat, and I've verified that it does not require a weight to be set for each vertex.



I'll update HottBJ docs and tutorials accordingly as I have time.

hi! I finally was able to render a object in JME with multiple UV texture coordinates by each texture… the way I did that was editing manually the jme-xml file, and add the second set of coordinates as com.jme.scene.TexCoords element, so, the texBuf element has two children now.

so, at least in the JME side, it is possible to do that.



regarding the Python API, I discovered that it did exist a way to access the uv coords of all the uvlayers, this is my test script:



from Blender import Mesh
me = Mesh.Get('Plano')
print("list of layers")
for layer in me.getUVLayerNames():
  print(layer)
  me.activeUVLayer = layer
  me.update()
  for f in me.faces:
    print(f.uv)



this script prints the list of available layer, with all their uv coords.
it would be nice to see this feature added in the exporter.. maybe I would help with that?
:roll:


blaine said:


Ah.  I remember looking into the newish named-uvTexture-layer feature now.  I vaguely, and perhaps incorrectly, remember that the purpose of the feature was design-time switching only.  Where the designer can play with a dozen textures if they want, but if you render, only the current or active texture is used.  Is that wrong?  Is there a way to associate specific image files with specific uv texture layers?  It could be that I came to this conclusion because the Blender Python API gives me no way to access multiple uv texture layers (similar to how they give no Python access to Action pose labels).

In any case, HottBJ will not support what you want to do in the near future.
cesarpachon said:

hi! I finally was able to render a object in JME with multiple UV texture coordinates by each texture.. the way I did that was editing manually the jme-xml file, and add the second set of coordinates as com.jme.scene.TexCoords element, so, the texBuf element has two children now....


Thanks for saving me time by looking into that.  I'm refactoring how HottBJ exports materials now for a 0.4 series, primarily to accommodate upcoming work to support multiple materials per mesh.  There are so many inter-related features supported by HottBJ that it takes a lot of difficult work for every little change, and this refactor requires many changes.  One goal is for the redesign to accommodate uv Texture layers.

When I finish this refactor, it may make sense for you to add in the uv Texture functionality, but the necessary prep work which I'm doing now requires understanding of intricacies of many inter-related systems.

UPDATE:  I forgot to cover the requirements for the location of mountable item origins.  That is now committed in the dev version of the integ features help page.  Thanks to Monkeybrainz for noticing.
cesarpachon said:

hi! I finally was able to render a object in JME with multiple UV texture coordinates by each texture.. the way I did that was editing manually the jme-xml file, and add the second set of coordinates as com.jme.scene.TexCoords element, so, the texBuf element has two children now.
so, at least in the JME side, it is possible to do that.
...


Nothing in your post gives an indication of how you are associating texture file A (out of texture files A, B,...) with "coords" list X (out of coord lists X, Y,...).  Does the sequence of the <texBuf> children need to parallel the sequence of the <texture> children?  I could figure out myself by running tests, but I don't want to get distracted from my primary goal of supporting material indexes.  Could you email your working *-jme.xml file to  blaine (at) admc (dot) com?  No need to send the texture files if you assure me that the *-jme.xml file works.
blaine said:

Nothing in your post gives an indication of how you are associating texture file A (out of texture files A, B,...) with "coords" list X (out of coord lists X, Y,...).  Does the sequence of the <texBuf> children need to parallel the sequence of the <texture> children? 

I got this info from the wiki: http://www.jmonkeyengine.com/wiki/doku.php?id=multitexturing

First, Geometry maintains a buffer of texture coordinates. These coordinates define how to apply the Texture in general. That is, at a specific vertex, what fragment of the texture map should be applied. When using hardware multitexturing there is a 1-to-1 correspondence to texture units and geometry texture coordinates. That is, if there are two Textures in a TextureState to be used for multitexturing, there should be two texture coordinate buffers in Geometry. If a buffer is not there, the corresponding Texture will not be rendered.


so, here was from where I borrow the idea for my little experiment of modify manually the jme-xml. just adding a second TextCoords element within textBuf, in the same order that the Texture2D elements in the TextureState node.

blaine said:

Could you email your working *-jme.xml file to  blaine (at) admc (dot) com?  No need to send the texture files if you assure me that the *-jme.xml file works.


sure! this is the file: http://www.cesarpachon.com/jmonkey/plano_multi.xml

Excellent.  I like it when once in a while things work as you would expect them to.



I should be able to work this into the 0.4 series of HottBJ.

cesarpachon:  Please try hottbj-0.4a-SNAPSHOT.zip.



As the name indicates, this is a snapshot and has not been regression tested.  I may well have broken non-multi-channel or non-texture behavior.  If so, that will all get fixed before the next public release.



This snapshot includes support for multiple texture channels and multiple uv layers per Material.  It also applies a more consistent and robust rule set for converting Material-related multiplexing (OB and ME types) to jME scene structures.  All with the known constraint that if you use material indexes, only the default (first) is honored.

hi! results of a quick test:

  1. using the same model: two uvlayers, two materials, two textures:

    throws the message "multiple indexing materials is not complete" as you warn in your previous post.
  2. if I delete both materials, but let the two uvlayers, in the console appears a index list error.
  3. if I delete only one material, it exports one material and one uvlayer, ignoring the other uvlayer.



    I wonder why with this same model (case 1) I did can export with the previous version of the exporter. (that exports two materials and one uvlayer)… or maybe I am missing something in the blender configuration?  :?




Great to hear that the work continues to bring more features to the animation system!



Regarding my earlier problem to connect Empties to Bones. They persisted! After a few hours of cursing Blender i have finally found the problem. Since i'm new to Blender, i'm not using hot-keys, and instead rely on the menus. This did not work, as you have to be in Pose mode and there's no option for that in that menu. However, the hot-key ctrl-p works just fine. So if anyone else has the same problem i did (and i found a few when googling around), here it is again:



Make sure you are in "Pose" mode.

Select the bone and object(Empty) you would like to parent to the bone.

CTRL+P to bring up the Parent menu, and select "Bone".

rickard said:

Great to hear that the work continues to bring more features to the animation system!

Regarding my earlier problem to connect Empties to Bones. They persisted! After a few hours of cursing Blender i have finally found the problem. Since i'm new to Blender, i'm not using hot-keys, and instead rely on the menus. This did not work, as you have to be in Pose mode and there's no option for that in that menu. However, the hot-key ctrl-p works just fine. So if anyone else has the same problem i did (and i found a few when googling around), here it is again:

Make sure you are in "Pose" mode.
Select the bone and object(Empty) you would like to parent to the bone.
CTRL+P to bring up the Parent menu, and select "Bone".


I completely agree that that sequence is incredibly non-intuitive.  When I first tried to do this, I was in the same place as you.  I posted the question to the blenderartists forum and got an answer in a day.  I'm adding to my TODO list to add that to the HottBJ Troubleshooting and Game Integ. help pages.

The 2nd step in your 3-step procedure is off a tiny bit.  EITHER

       
  • select the target bone-to-be-parent in pose mode first

  •    
  • select the Empty Object (which will switch you to Object mode)

  •    
  • SHIFT-select the Armature Object


or

       
  • select the Empty Object (which will switch you to Object mode)

  •    
  • SHIFT select the target bone-to-be-parent in outliner UNDER THE POSE NODE


These just replace the step #2 above, rickard's #1 and #3 are still necessary.  Like I said, I'll be adding the procedure to the HottBJ online help.
cesarpachon said:

hi! results of a quick test:
1. using the same model: two uvlayers, two materials, two textures:
throws the message "multiple indexing materials is not complete" as you warn in your previous post.

Actually, when I posted that, I forgot that I added temporary code to not just ignore non-0 indexing, but to purposefully ditch if there are multiple indexes.
To test with that distro, do not use multiple indexes.  Multiple materials are not needed for a single Object to use multiple textures, regardless of whether there are multiple uvlayers.


2. if I delete both materials, but let the two uvlayers, in the console appears a index list error.

Probably a consequence of Blender's common failure of leaving artifacts.  Blender does not update the size of the list, but just fills vacated elements with Nones.  I want to get the basic code working right before complicating it with work-arounds for special cases like that.  Pull a backup .blend and add just the Material that you need.

3. if I delete only one material, it exports one material and one uvlayer, ignoring the other uvlayer.

Ditto.

I wonder why with this same model (case 1) I did can export with the previous version of the exporter. (that exports two materials and one uvlayer).. or maybe I am missing something in the blender configuration?  :?


Because before HottBJ was not smart enough to realize that it should not try to apply your multiple Materials to a single jME Node/Geometry.  This snapshot purposefully prohibits you from using multiple materials for a single Object.  If you create a Model with a single Material, without "holes" in the Material Index list, you should be able to do what you want to:  multiple texture "channels" with or without multiple uv layers.

My primary task for today is to support material indexes = multiple-materials-per-object.  That is a lot of work because I have to divide up the single Blender Mesh into X jME Geometries.

I shouldn't have let this topic get hijacked.  To continue our discussion about texture channel, uvlayer, and material indexing issues, please open a topic in an appropriate Forum and add a link here.



I'll be more careful in the future to ensure that discussion in the Release Announcement forum has some relevance to a Release Announcement.



UPDATE:  I've now working on a rather massive refactor to accommodate all holes in material, texture, and uvlayer lists.  When I finish this, cesarpachon's issues should all be taken care of.

The tex coords discussion is continued here.

blaine: I have some further problems with the mount points. Could you take a look at this thread and see if you can figure out the issue?

http://www.jmonkeyengine.com/forum/index.php?topic=12071.0



Thanks!

sorry for a noob question



but in a netbeans aplication, where i put the files that was genereted by blender?

i have to create a folder for this?



thanks