Forum

Armature export problem

20 March 2015 02:44 #1747

Hi,

I'm exporting an skinned model using Rigify addon using blend4web v15.02 and Blender 2.73 and I get the following error:

Traceback (most recent call last):
File "/Users/imanolmartin/Library/Application Support/Blender/2.73/scripts/addons/blend4web/anim_baker.py", line 54, in execute
bpy.ops.object.mode_set(mode='POSE')
File "/Applications/Blender/blender.app/Contents/MacOS/../Resources/2.73/scripts/modules/bpy/ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect

location: <unknown location>:-1

I'm a bit lost here, any idea of what I am doing wrong?.

Thanks and congrats for the great work.
20 March 2015 10:26 #1748
Hi,

It is pretty difficult to say what is the issue without seeing the scene.
Could you please give us an example of the blend file which is causing this error?
It is better to attach it to the post. Or, if you don't want to share your work right now, you can send it to my email: evgeny-ar@blend4web.com
Blend4Web developer
21 March 2015 12:35 #1764
Hi Evgeny and thanks you for your fast response.

Attached you have a test case I've made showing the error. It's a simple rig made using Rigify Addon that's what I normally use for rigging. If you just select the armature and hit on "Bake" you will see the error.

Thanks again.
21 March 2015 16:48 #1766
Hi,

confirmed that crash, will look after weekend. Thanks for the test case!
Development Lead | Twitter
23 March 2015 12:00 #1775
We have investigated your file. The problem is that one of the Armature objects on the scene is hidden. Thus, our bake script was not able to work properly. For now you can just unhide "metarig" object. This will be solve in the upcoming release this week.

Thanks for pointing out the bug!
Blend4Web developer
23 March 2015 20:37 #1786
Hi Evgeny,

Thanks, that seems to be the reason. By the way, it also fails if it is in another layer, I suppose it's the same case as being hidden.

I've made it visible and it's baking the actions correctly, I get a _B4W_BAKED action for each on of the actions I have. Then I export everything but I don't see any animation present when I open it in the Viewer. I've followed the instructions in the documentation so I'm not sure what am I doing wrong. You can reproduce it using the test case above. If you need any other detail, let me know.

Thanks again.
24 March 2015 11:55 #1795
Hi,

Actually, you don't need the metarig object. You can set Do Not Export flag on it.
As it is described in the documentation you can also set Animation: Use Default flag in order the animation to be played automatically, and set the required behavior for the rig object.
Also, you need to apply "Mirror" modifier if you want to use armature animation. (This is a Blend4Web limitation for now)
Blend4Web developer
25 March 2015 02:37 #1807
Thanks again Evgeny,

So I had "Apply modifiers" activated in my object's blend4web export settings as I was using a Mirror modifier, but that also applied the Armature modifier and that seems to be the reason why the animations were not being exported. I have applied the mirror modifier as you said and now my animations are exported.

Now I'm facing another issue: the animations are exported but they are not correct. They are fine in Blender but they are not correct when I open the export in the viewer. I have tried to apply all transformations to the object and armature and also activated "Apply scale" in the objects blend4web export options but it doens't seem to help. Any idea of what I am doing wrong?. The whole object is just one mesh and it just have the armature modifier (as I have already applied the mirror one).

Here is a video demonstrating the issue: https://youtu.be/7F68ohX6JQA

Thanks once again for your support.
25 March 2015 11:01 #1815
Most likely, the issue is that the armature's and object's origins are in different locations. If you will force the origins to have same coords the animation will be fixed.
Our users face this restriction pretty often, so we will fix this in future releases.
Blend4Web developer
26 March 2015 01:20 #1827
Hi Evgeny,

I've set both objects origins to the same position but It doesn't seem to be working with my current rig. I just have rigged it again with the origins already set at the same position (before making the poses) and it seems to be working now. Any chances of fixing that for my current rigs without needing to re-rig again?

Thanks for your support.
 
Please register or log in to leave a reply.