Jump to content

Blender exporter available


Josh
 Share

Recommended Posts

Question... Does the Steppng ignore set keyframes and only interpolate the frames between the keyframes of your animation. This is important to know.

 

 

I agree. Personally i would go for step = 1 , this is how it works with Unity, why restricting in LE3 ?

Stop toying and make games

Link to comment
Share on other sites

This will go with my other posted report a few hours ago. I went ahead and did a complete clean install of Leadwerks. Same problems.

I am still running Ubuntu 12.04 LTS and not 14.04 as I waiting on the official release update for 14.04 through the update manager. As stated in other posting I could do it through the terminal but rather wait. Maybe the cause of some problems.

 

An update: If I select "all actions" in the exporter options then the animation is exported. Now this could be because I opened the action editor and it creates a default action which now needs to be exported.

 

Next, I will test exporting an animation without opening the action editor using the same simple model but a new Blender scene so I have a clean slate.

 

Update2: I created an animation without opening the action editor. The animation was not exported when not selecting "all actions" in the exporter options

 

Update3: I opened the action editor and selected ArmatureAction, the default action that Blender creates.

Now I can export the animation without selecting "all actions" in the exporter options. Go figure...blink.png

-----------------------------------------------------------------------------------------------------------------------------------

Now to the other problem which could be Leadwerks related only.

When I get the Blender exported animated model into Leadwerks using the exporter, the model has no scene lighting on it either in the model editor or the main scene. I have to reapply the material in the model editor choosing Surface 0. Upon saving in the model editor the the scene lighting on the model is seen in the editor but the icon in the asset window goes blank. When I reopen the model editor it is blank. The model is there, I imagine but is invisible. If I place the model in the scene the wireframe is seen but the model itself is invisible in the 3D viewport.

 

I have none of these problems with using the FBX format for exporting animations just to let you know.

 

My head is starting to spin around with all this stuff happening so I hope it is some help to you even if it is confusing.

Link to comment
Share on other sites

digman thank you again for detailed report.We will start to figure out of how to solve all the problems you described.

 

About Animation stepping

In case of step=1 each Blender frame will be added so every your keyframe also will be in model.

In case of step>1 guaranted only first and last keyframe - others may be interpolated. Let's say you have keyframes in 1, 7, and 10 frames and set step=3 - then will be exported frames 1, 3, 6, 9, 10 i.e. keyframe 7 will be present only in interpolation phase on frame 6.

We will set step=1 as default value so to do an optimization or not will be a user's decision

  • Upvote 1
Link to comment
Share on other sites

Problems fixed to the time of this post:

 

1. Taking into count Intensity slot to detect Specular map

2. Default animation step set to 1 to not confuse newcomers

3. If no actions selected in Action editor then first one exported in case of "all actions" not choosen

4. Added a binormals and tangents calculation. Without it animated models was looking unlit.

 

Plugin can be dowloaded here https://github.com/alrusdi/leadwerks-blender-exporter

Link to comment
Share on other sites

It appears that 1-4 are all solved now... I will test some more but so far so good.

---------------------------------------------------------------------------------------------------------------

Now moving on to a more complex rig animation and the problems encountered there...

 

Problem 1: The exporter exports the control bones just not the deformation bones attached to the mesh vertices. These control bones are not needed in the exported file as no mesh vertex information is written for them. They are just control bones and it's normal to have these in a rig for animating purposes. Most of the time in Blender you do not see the control bones as they have been replaced by control bone shapes but the bones are still there. In my blend file the control bones have yet to be replaced by control bone shapes.

--------------------------------------------------------------

The FBX exporter so far on my rigs only exports the deformation bones attached to the mesh vertices. It also has a selection to only select the deformation bones in it's exporter options. The problem for the Leadwerks exporter is shown in the image "exporter man,". The top 8 bones which are control bones. The FBX exporter exports the bones as shown in "FBX man" and only the deforming bones attached to the mesh vertices are exported.

-------------------------------------------------------------

Side Note: This is a simple rig, a complex blender rig would have deformation bones plus separate FK and IK bones driving the deforming bones by constraints. For sure you would not want all these bones to be included in the export. The separate FK and IK bones are not attached to any mesh vertices but simply drive the deformation bones. The generated Rigify rig is set up this way. Not the Meta rig which is adjusted to first conform to your humanoid model. After you conform and attach the rigify meta rig to your mesh then you generate (under the armature tab) the real rig with all it's control bones shapes and FK and IK bones. The purpose of this is so you can blend FK and IK animation using the same rig. I am adding this information here just to be safe as you might know this information already.

---------------------------------------------------------------

Problem 2: Since the exporter is exporting the control bones as well, it might be screwing up the mesh. That is a possible cause of the stretching of the mesh shown in the model editor window. (image "exporter man" If that is not the problem then it would be problem 3...

----------------------------------------------------------------

Problem 3: You can not adjust the axis orientation of your model in the Blender exporter settings. You can do this in the FBX exporter settings. In the Model editor the animation plays the opposite direction as it is played in Blender. The man instead of squatting, rises instead...

-----------------------------------------------------------------

Problem 4: This relates to problem 3: Since you can not adjust the axis orientation this creates the problems describe. Examine the model on the far right of the image "axis" this is how the current Blender exporter for Leadwerks exports the axis orientation in the model from Blender. The middle image is how the FBX exporter exports the model axis orientation after adjusting the axis in the FBX exporter settings. The FBX exporter axis settings are shown on the far left of the same image. Y is up and Z is forward. which is the default for Leadwerks, shown in the picture "Leadwerks axis". This is true not just for the default Leadwerks player model but the CSG brushes as well.

------------------------------------------------------------------

Problem 5: This also relates to the above. When creating your own player model with a camera attached to the head bone you need the correct axis, otherwise your player walks backwards. I would imagine it would affect the NPC players as well. I think it would be best for all models static and animated to be exported with the correct leadwerks axis orientation.

------------------------------------------------------------------

I have no problems with the FBX animation exporting on this more complex rig and animation. The animation is correct, exported bones are correct and the adjusted axis orientation is also correct. This is for your information.

-----------------------------------------------------------------

I have included the blend file and fbx file used for testing. As always let me know if the zip files appear incorrect or missing parts.

Note : Hover your cursor over a uploaded image to see the image file name in my post here.

Note2: Again sorry for the Linux model editor errors on animated meshes. Nothing I can do about that but the animations do play as stated before.

Note3: In my rig, I have off turned the IK modifier for the arms but not for the the legs . The purpose of this rig is to have FK on the top of the model and IK for the legs. Only the control bones and FK bones that are needed appear, the rest are hidden on other bone layers.

Note4: I noticed that the bone hierarchy is setup different from the FBX export. The difference is shown in the two images "exporter man and FBX man".

Note5: I need to make you aware that when you get the correct axis orientation the male model will appear in the model editor facing away from you. I think the possible reason for this is most of the default models included in Leadwerks do not have the default Leadwerks axis orientation. It might be possible that Josh just adjusted the model editor to reflect the models axis orientation so they would be facing you in the model editor. You would have to ask him as I am only making a quess here. This is only a model editor axis facing deal. It does not effect the animation in the model editor or the main scene as the model has the correct axis orientation in the main 3D viewport scene.

---------------------------------------------------------------------

Male model not shown for texture or normal map quality but just for testing animated model exporting.

---------------------------------------------------------------------

Sorry for the long winded post, lots to cover and got to love screen sharing when available over typing in a number of cases...

post-11675-0-52874800-1402422379_thumb.png

post-11675-0-66463800-1402422398_thumb.png

post-11675-0-49999500-1402422420_thumb.png

post-11675-0-33678600-1402422438.png

man2.zip

Link to comment
Share on other sites

  • 2 weeks later...

Busy over the weekend but will test as soon as possible... thanks for the update...

 

Edit :

I did a quick test, The model now plays correctly in the model editor. It appears no control bones are imported. The axis is now correct but the animated model is facing -Z forward instead of Z forward.

 

I am not a programmer so I will have to learn how to attached a camera to the head bone in a lua script to test if the animated player model walks backwards. This is the problem we had when I was working on the Phobia game which I had to leave because of health reasons. We had to export the animated player's model's axis Z forward so you the player would walk forward in the game engine.

 

If you just can add a choice of which Z direction to choose from in the Blender leadwerks exporter then that would solve any problems on the Z direction you would need per model... Give the user the choice of which Z axis direction to choose from either Z forward or -Z forward

 

This was not a in-depth test but I thought you deserved some feedback to let you know you are getting real close to the finish line...

 

P.S. If you have or know of a tutorial on attaching a camera to the head bone, that would help...

 

EDIT2: I noticed that the Model's Z forward axis is facing the correct direction but the player model is not in the 3D viewport. The model is still facing -Z forward which is opposite of the Leadwerks default player. I do know if this is a problem or not. I will not know till, I can test in the animation in the game engine. You might have already tested attaching a camera to the head bone of the player model. Please inform me if you have...

 

When you export a model through the FBX exporter It also changes the z direction of the model as well. This is shown in one of my uploaded pictures.The player model animation might now play correctly in the game engine because even though the model is facing -z forward the direction of the Z axis is Z forward. Though to keep things as simple as possible it would be better to have the model facing the same Z forward direction. This gets back to the choice of Z axis direction to choose for the user in the exporter... All the above is for your consideration of course and what is possible in scripting the exporter.

 

I will keep posting my edits here in this post...

Link to comment
Share on other sites

Z Forward axis direction of the model's facing is fixed on my animated model per your last post.

 

Ok, other than this last one static model axis direction facing problem, I think your are pretty much ready for release. I do need though to remind everyone I am only one tester and have reported most of the problems here in this thread. I of course could keep testing but like any software you could test till the cows come home and still when a large number of users use the exporter, there could be a few bugs found but hopefully very, very few.

 

Airusdi, you have done a very good job here and worked hard. Thanks.

 

OK, on the last problem.

A static model for some reason imports into leadwerks with the correct Z Forward axis orientation but the model is facing along the X axis in Leadwerks. Just like the animated model it needs the model facing to face Z Forward ...

 

I have no idea why static models do not come in Facing Z Forward when the animated models correctly import. They are both setup the same in Blender. Shown in picture "Facing" is the Blender monkey facing the x axis but with the correct Z Forward axis orientation.

 

Also one last picture which is not a problem but just shows that the FPS arms and weapon face the Z Forward as well. This is the same as the default player in Leadwerks... I believe no will have problems with their animations as long as this reminds true when they export from Blender. All my models in blender are setup in the Front view (Ortho) in Blender.

 

I uploaded a new hero blend. Corrected a small problem and the monkey blend...

 

I am done thrashing as Josh would say..

 

Again thanks for this great addition to Leadwerks...

post-11675-0-75200500-1403386070_thumb.png

Blends.zip

post-11675-0-76844200-1403386575.png

Link to comment
Share on other sites

I am getting too busy to test much more. I did notice now though that the imported models both static and animated need their normals recalulated in the model editor for them to recieve the scene lighting correctly.

 

Recalculating for the static models is not a problem but can cause some problems with animated models. Shown in my uploaded picture.

Now the male model was imported into Blender, so I do not know if it is the reason for the mesh tearing after recalculation or not. You would have to test some animations with models created inside blender.

 

Blendswap is a great place to get blender models both for static and animated.

 

The recalculation method of " Average normal" will not tear the mesh but the recalculation is not good.

 

If possible can you make it so that the models do not need their normals recalculated after importing.

 

The FBX exporter imports models with no need of recalculating the normals once they are imported. I do not have to recalculate the animated model's normals and I get no tearing of the mesh.

You can download the two new blend files to test with from my other post, One has the animation man and the other is just the Blender monkey.

 

I will post my final thoughts on the exporter in my next post...

post-11675-0-66082100-1403455697_thumb.png

Link to comment
Share on other sites

In the above post, I found one area to correct if possible. The below is just my final thoughts on the exporter.

 

First, alrusdi creating an exporter is not easy job with all the variables in Blender. I would hope that after the general release that Josh will retain you for further development of the exporter.

 

Now for the reason of the above statement. With all the available rigs and static models for blender with various users creating them plus users importing models into blender, I know there will be more problems encountered. I have tested a few rigs and static models, some have problems exporting out. It is beyond the scope of this post to inform you about them as it take hours to make a good bug report test. You have to test whether it was a possible user error in creating the model or animation or a problem in the exporter. That will just have to come when there is the general release of the exporter and more users are exporting from Blender into Leadwerks and posting here. My time now is very limited for testing.

Link to comment
Share on other sites

If possible can you make it so that the models do not need their normals recalculated after importing.

Thank you digman for report. I'll see what can be done with normals. Recalculation destroys the model completely in my case (it's even not seen in model editor after save).

 

Can you post here a links to models on blendswap which has problems with exporting? May be i found an issues myself.

Link to comment
Share on other sites

The disappearing of my model was happening on my end as well just did not mention it as I do like to mention problems till I can give you complete information. Also the disappearing just could be a Leadwerks bug.

 

I figured out that the static model from BlendSwap problem I was having was based on the creator of the model. I will explain. I tested this model the other day...

 

The blendswap model was not importing into Leadwerks with the correct Z forward orientation plus they were sometimes facing incorrect as well.

 

In Blender when you are in Object mode(not edit mode) and you transform an object you must use CTRL plus the A key to set the transforms for rotation, scale and location. Even though the model appears to be transformed in the viewport, it is a virtual transform till you set it as explained above. Many newer Blender users to not know this.

 

The exporter expects the model to be Centered in the world on the X Y and Z plus the object facing forward in Front view. This is how all my testing models have been set up. This is the default Blender axis orientation and model facing. I thought it best to give you the default blender setup when you were scripting for exporter.

 

Once I had set transformations Rotation, Location (scale not needed) for the horse model to 0,0,0 on all axis, then the horse was correctly imported using the exporter.

 

Now to rigs... I kept my rig at a basic level, just deformation bones and control bones that had no control bone shapes applied to them. The exporter works correctly on this type of rig.

 

Another rig I tested the other day had control bone shapes. Control bone shapes are real geometry. The exporter exported these out and created material mat files for them plus the control bones appeared in the editor as well. There are number of ways to set up rigs in blender and for the exporter to work on them all without breaking one method over the other is a hard question to answer.

 

I would suggest for you to download a few rigs from Blendswap, just make a simple animation and use the exporter to see any problems. Sorry, I simply do not have time to do so. The other way is release the exporter once importing the normals is fixed and then go on a case by case bases for any rig or static model problems as users report them. This of course is entirely up to you and Josh.

Link to comment
Share on other sites

> The exporter expects the model to be Centered in the world on the X Y and Z plus the object facing forward in Front view

 

No, it doesn't - seems to be bug.

 

> Another rig I tested the other day had control bone shapes. Control bone shapes are real geometry. The exporter exported these out and created material mat files for them plus the control bones appeared in the editor as well.

 

Also seems to be bug. But because the bone shape is real geometry it will be hard to detect if it needed to be exported.

Link to comment
Share on other sites

> The exporter expects the model to be Centered in the world on the X Y and Z plus the object facing forward in Front view

 

No, it doesn't - seems to be bug.

 

> Another rig I tested the other day had control bone shapes. Control bone shapes are real geometry. The exporter exported these out and created material mat files for them plus the control bones appeared in the editor as well.

 

Also seems to be bug. But because the bone shape is real geometry it will be hard to detect if it needed to be exported.

 

Ah yes, one should never assume concerning the centering of the objects for the exported as I did. The problem just could have been simply that the creator of the model had not set the transformations as I explained earlier whether it is was set for world center or set somewhere off world center.

 

Rigs can get complicated for sure but I have no new information to give you at this time per my previous suggestions.

Link to comment
Share on other sites

> Another rig I tested the other day had control bone shapes. Control bone shapes are real geometry. The exporter exported these out and created material mat files for them plus the control bones appeared in the editor as well.

 

Also seems to be bug. But because the bone shape is real geometry it will be hard to detect if it needed to be exported.

 

Generally speaking people keep their control bones on a seperate layer and the base shapes used to alter their appearens on another layer again which is hidden to avoid clutter.

 

If the exporter only exported visible layers wouldn't this problem solve it self?

 

 

Nb. I've not yet had time to test the exporter so the above may well be how it works

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Generally speaking people keep their control bones on a seperate layer and the base shapes used to alter their appearens on another layer again which is hidden to avoid clutter.

 

If the exporter only exported visible layers wouldn't this problem solve it self?

 

Currenly exported all "mesh-like" objects on any layers of current scene. If more than one root objects on scene then each one is exported to separate file.

ARMATURE type is special case - exported only deform bones for influenced meshes.

 

Bone shape can be part of scene and in this case do not export it will be wrong behavior. But it probably rare case...

Link to comment
Share on other sites

Bone shape can be part of scene and in this case do not export it will be wrong behavior. But it probably rare case...

 

Actually having custom shapes for control bones is more the rule than the exception.

 

Imagine trying to animate this bird;

 

thumb_rigging.jpg

 

if all the control bones were identical cones

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Actually having custom shapes for control bones is more the rule than the exception.

Yes it's probably normal to not export mesh if it used as Bone shape. Will add this feature.

 

 

This is not regular bones, what is this system (never used it in BLender) ?

No, it's very regular bones. Each bone can have custom visual representation as shown on picture below:

bone_shape.png

  • Upvote 2
Link to comment
Share on other sites

Yes it's probably normal to not export mesh if it used as Bone shape. Will add this feature.

 

 

 

No, it's very regular bones. Each bone can have custom visual representation as shown on picture below:

bone_shape.png

Yes, Custom bone shapes are used all the time, I would not want to animate without them other than a more simple animation plus bones can be hidden on other layers and how you can have extra bones to drive the IK and FK through the use of constraints. I mentioned all the above facts several times. My rig as stated was a rig just to work through the first problems encountered of getting the correct bones to export and the correct orientation of the rigged model for animation.

 

In my last several post, I stated there could be some more problems to work through and suggested downloading and testing a few rig types... There is even the rigify rig that can be tested as well. No problem finding a number of Blender rigs to test. Of course when a new version of the exporter is released, I will test it out but unfortunately at the moment I do not have much time for deep testing...

 

Having the feature not to export the control bone shapes would be great as the rig I tested the control bone shapes were exported and material mat files created plus for some reason the control bones were exported as well. The control bones do not get exported in my basic rig.

Link to comment
Share on other sites

The way how exporter works with animation alowing any rig. Rigify with MakeHuman model was second model which i tested for support.

For bone shapes visibility... It will be little bit unclear in exporter code to discard them. To resolve this problem i suggest an addittional option in exporter "Export only visible layers". So everyone will be alllowed to choose which parts of scene to export. Is it will be good enough?

 

It is possible to resolve this problem even in current exporter version - just select your rig and use "Export only selected objects" option when exporting. In this case bone shapes will not be exported.

  • Upvote 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...