animControl missing in JME3.1 import from Blender 2.78

Hi All, Glad to join the community! :smile:

I have been trying for over a week to get my VERY simple anim to import properly into JME3.1 from a .blend file created in Blender 2.78. Many thanks for the “Creating Assets In Blender 3D” article from here: https://jmonkeyengine.github.io/wiki/jme3/external/blender.html

Twas quite helpful in getting the SkeletonControl importing but for the life of me I am unable to get an AnimControl to show up. When I import the .blend file (here it is: “Link to my site removed by myself since topic is resolved”) the output panel shows no errors and DOES find the name of the animation from the NLA track when converting it to a .j3o file. Then I open it in the scene composer and can see the SkeletonControl but am missing the AnimControl.

It must be something so insignificant (but is significant :stuck_out_tongue:) for I’ve searched this WIKI (great WIKI BTW) and Google and everywhere and to no avail.

I did use the JME3.1 supplied newtpl_anim.blend file which works great! Even got the NPE all working from that, quite a cool learn indeed.

I’ve compared that file in blender to my file (see link above) and the only difference I can find is I have a very simple anim, a cube as a door opening 90 degrees.

I’ve used Blender since 2.5 alpha and, well I’m stumped!

Any and ALL help would be GREATLY appreciated. As I said I’m sure it’s got to be something simple or there would be more posts like mine which there aren’t.

This is my first post so hopefully I’ve given enough upfront info and the file anyone can download to see what I missed.

Many TIA! :smile:

Adam

I tried like hell to make this work myself and although I could get the animation to play after redoing everything it was warping the door. Maybe someone else would have better luck.

I went ahead and remade it from scratch myself, (took 30 seconds) and it worked perfectly.

Some things I saw wrong in your model are,
The animation timeline was off by 2. Your animation was 48 frames but you had the timeline at 50.
The material was not named after the mesh.
You didn’t assign the material to the mesh.
You didn’t UV unwrap it.
You didn’t have a root bone.
You didn’t have a texture for the material. Easy to do just load a image file and hit the little box next to the file path to pack it

If you use the blender importer you have to bake the action.
If you use the ogre exporter, highly recommended, you create a NLA strip for the action and then export the file. Read that page I linked to for ideas on how to create a nla strip.

I suggest you watch these videos to help you learn more about textures and UV unwrapping. Navigate through them to find the ones you need.
https://vimeo.com/nhirsig/videos/sort:alphabetical/format:thumbnail

They are for a earlier blender version but if you read the comments you can get things done right. Besides that, it will be a good exercise for you to learn.

You’re at the beginning of this so don’t get discouraged.

Instead of ogre, which also has its problems sometimes, I’d recommend trying xbuf.

Its not as well documented (on the wiki and hub), but basically you Download a blender plugin and use that to Export “.xbuf” Files which the SDK can Import to j3o. This method is especially the most future proof one.

I think if you cant play an animation channel in jme game you must :
1.first apply the location and rotation of mesh and armature …
2.then in NLA editor push the button down to push down the action onto the top of the NLA stack as a new strip. without doing that in ogre export you can see in Cube.skeleton.xml the animation name is my_animation so in game you must play the channel by this name (in this way I dont know and I dont test the animation channel can play ) …
if push that button the animName will be Action or what you change in NlA editor …

mitem,
Many thanks for the very thorough work details.

I didn’t think the anim length (in frames) was an issue for the JME3.1 newtpl_anim.blend has 250 frames and works. It also has no UV unwrapping nor texture files, hence I thought, hey that works why not mine? :wink:

I tried baking and got the same result but great to hear that and many thanks for the links.

I tried using Ogre and I did get an animControl file, but like many I found that in the end it just didn’t work.

Also MANY thanks for the reply and don’t get discouraged, for I won’t especially with a nice reply like yours! :sunny:

I love doing it all in blender for I have 8 scenes so far in my FPP (all static) that work great with JME (green arrow) import button, and the programming is really easy. So, here I am trying to make the scenes dynamic (doors, drawers, etc animate) and well since it was so easy up till now I guess hitting a block was expected. :sweat_smile:

Been doing blender for 5+ years and Java since it was code named OAK, hence when JME paired the two, WOW, this is great!

Many, many thanks for the reply/links/critique and tips. When I get a formula on how to do this in a WHOOSH quick easy way sans OGRE I will DEFINITELY give back and publish what I found.

Have a pint on me! :smile:

Adam

Darkchaos,

Thanks!

I did see in the WIKI a few referring to xbuf and will give that a try!

Yes, I like many do not like OGRE. I did get it to give and animControl but it didn’t work, go figure eh? :wink:

Thanks for the reply and tip. I’ll post what I find works and let you and all know!

I Love the blender import for I have 8 scenes (static) in my FPP working flawlessly with JME, now onto adding in that special anim spice for the doors, drawers, etc.

Many thanks for the reply and tip!!!

Adam

yn97,

Thanks!

That’s not the exact issue but thanks.

Yes, I got the NLA and everything working fine, the anim names come through great just wont make an animControl when checking via the scene editor. I do get it via OGRE but it doesn’t play nor look like what I made.

I love the blender/JME coupling for I have 8 scenes in my FPP that (statically) import and work flawless, hence great platform.

I’ll post what I find in a comprehensive format to make this less bumpy :wink:

Many thanks,

Adam

@mitm

I reread you reply and saw your “I went ahead and remade it from scratch myself, (took 30 seconds) and it worked perfectly.”…Could you post a file? I too think that it should be a 30 second easy do but nope. Also I again looked at JME3.1 newtpl_anim.blend sample that works and yes they do have textures but no files nor UV unwrapping, anyway I applied a texture (and material of course) and still same thing. Hence i would greatly appreciate how your 30 second from scratch was made.

I’m far from a noob in blender or java or so just a run down of what was added to the “Creating Assets In Blender3D” article from here: https://jmonkeyengine.github.io/wiki/jme3/external/blender.html

Many thanks!!! Double thumbs up!!! :+1: :+1:

Adam

PS: Neil Hirsig’s tut’s are great. They were the cornerstone of me starting blender 6 years ago…He and I still chat once every year or so…great guy!

What version of 2.78 are you using?

@mitm,

Whew just got me about to sign off for the night!

Good Q!

In my original post header it states 2.78 but not (a,b,c).
JME3.1 has 2.78.b embedded and I am using 2.78c which got me wondering if there is a diff between b&c so I was/am in the process of creating it from scratch in ver. b.

I really appreciate the help!!! :smile:

Yeppers should be a piece of cake, and it’s got to be something VERY small that is missing for the JME3.1 newtpl_anim.blend has LOADS of errors when it imports (but works as in animControl is there whereas mine is missing) and I got one from another post which I can put up on my site if you’d like which is really wacky but hey it works! :confounded:

Well, off to feed the family and do those things :slight_smile:

Sure appreciate your interest & help!!!

We’ll get this I’m SURE!!!

Then we’ll share a pint or 2+ eh? :smile:

Many Thanks!!!

Adam

2.78b had a major buffer problem but not sure if it is the cause of the trouble. I use an external blender 2.78c personally.

Ill give a short rundown of steps since you are familiar with blender.

  1. Create new file with default cube with units = metric.
  2. In front/ortho drag cube to Y = 1.1, Y = 1.
  3. In right ortho, scale Y = .5
  4. Apply location, rotaion, scale.
  5. In front ortho with cursor centered, add single bone. Name this bone Root.
    Edit: The models origin must be in the same location as the root bones origin.
  6. With bone selected, tab into edit mode.
  7. With tip selected, extrude Z until bone tip is centered at top of mesh.
  8. Select the base of this bone and using the manipulator drag the base down until centered at bottom of mesh.
  9. Select the root bone body and in the Bone tab deselect Deform.
  10. Tab out of edit mode.
  11. With the bones still selected, change into pose mode.
  12. Select the mesh first, followed by the TOP bone only.
  13. Ctrl + P and parent with automatic weights.
  14. Select the mesh, add and apply a triangulate modifier.
  15. In the material tab create a new material.
  16. Name the material the same name as the mesh.
  17. With the mesh selected tab into edit mode and with all vertices selected, assign the material to the mesh.
  18. In the Texture tab, create a new texture.
  19. In the image panel of the texture tab select open and find a texture (image) of your choice.
  20. Click the box next to the path to pack the image.
  21. From the info header change the layout to UV editing.
  22. In the UV Image editor select new and create a new image. Name it whatever you want.
  23. In the 3d view, still in edit mode, select all vertices if not already selected.
  24. Unwrap the mesh. Edit: Save the UV image.
  25. From the info header, change the layout to animation.
  26. In the dope sheet editor change the context to Action Editor.
  27. In the 3d view select N to open the properties panel.
  28. Change to front view ortho. Tab out of edit mode.
  29. Select the armature TOP bone.
  30. Change your timeline end to 48 and advance the timeline to frame 1.
  31. In the properties panel, right click over rotation and insert a single keyframe.
  32. Advance the timeline to 48.
  33. In the 3d view Rotate the TOP bone, Z restrained, 90.
  34. Insert another keyframe for rotation.
  35. Save.

You file is now ready to import or export. If importing with the SDK importer you have to bake the action and after import delete the camera and lights it creates unless you delete them from the file first. If using ogre, select the mesh and armature and export.

Edit: Forgot to mention that after unwraping don’t forget to save the image. Its also good practice to hit the F button in the Action Editor when creating an action.

@mitm
Hey, well it took 3 trys, 1st two no animControl showed in the scene composer, on the 3rd WooHoo :joy:

But, and there always is one eh :wink: I still have a problem which when I get it fixed I’ll tell you what I did. Many THANKS for the detailed effort!!! Double thumbs up :+1: :+1:!!!

I had a feeling that the extra bone was needed and in order to parent to extra bone named Root.001 I had to uncheck the “eye” symbol on the “Root” bone so I could parent ONLY to the sub bone Root.001.

Note: In tries 1&2 when I moved the base of Root.001 to the bottom, great, but (always are eh) when (and I have NO idea why) I toggled out of edit mode it joined the 2 bones into a singular Root.001 :confounded:

Yes I use as you stand alone 2.78c and as you also delete camera and light(s) from all my scenes for export.

The bake I did on only the start and end frames.

I’m 99% there because I NOW have an animControl and need to cogitate what step(s) are n eeded to get there. The reason it’s (for me) not 100% is because that darned Root.001 rotates (z confined of course :wink:) but though the mesh is parented to it “with auto weights” good call, I missed that one, the mesh doesn’t rotate with the bone??? But This is cool and I’ll get it for sure and as I said I’ll find exactly the recipe and reply…JEEZ I SURE do VERY MUCH APPRECIATE “YOU” & your MAJOR EFFORT!!! A few cold pints on me for sure!!!

Now off to make that extra 1% into gold pressed latinum!!! :wink:

AGAIN, M A J O R THANKS!!!

Back at you in a while…WooHoo!!!

Adam

UPDATE: OK I am now at 100% and with a very short list of ToDo’s which given the hour here I will post in detail tomorrow…Way COOL, it worked the 1st time…No baking, or UV, and a single bone.

Me “Thinkst” :wink: it was the “Auto Weights” GREAT CALL!!! I’ll try tomorrow with and w/o and see if that was the key which I’m sure it is!!! So, this is GREAT for we now have a VERY short list which I’ll post and YES I was able to do it in about 1 minute.

WAY COOL!!!

Add one more pint to the ones I owe ya!!!
:+1: :+1: :thumbsup:

Yep a TRIPLE INDEED!!!

=======================================================================
Update: Well aren’t I something?

For the missing piece which was to Parent the object WITH “Automatic Weights” is in the tutorial. I have no idea how I missed that (Major RTFM on me) for that was ALL I needed to make that work.

I even looked at my .pdf printout from that page and yup…It’s there!!!

Gosh, egg on face indeed!!!

None of the extra steps above are needed but I sure do appreciate you time, effort, patience and fortitude @mitm!!!

If I JUST read the IN BOLD (again HOW did I miss that???) clue, that was all that was needed.

Double Duh on me :tired_face: