Forum

User posts Marcos Calvi
07 June 2017 00:18
Hello again:

I've been trying to animate a character for a videogame and I have encountered an unexpected problem with the export. I have two separated blender files: one the scenery and other the character. I import the character to the main file (the scenery) as a dupligroup, similar to the Petigor setup. The animations work well in Blender and in the fast preview, too. They are skeletal animations, the setup for the bones is basically copied from the Petigor model. I have baked the animation and it keeps working well. But when I run the exported file in json the animated character gets completely messed up.


Another curious thing is that it deforms diferently depending which direction you are looking at. I´m getting to the point that I'm going to have to start from scratch as I think the scenery file has some problem I can't find.
Do anyone know which can be the problem? It is strange that the preview works ok and then the exported json does not.

I will be gateful with any suggestion.
22 May 2017 13:30
Happy to help
22 May 2017 00:35
Hi again:

At last I found the way and it was more a problem with the documentation than anything. In this example of the api docs:

var m_fps = require("fps");

var move_cb = function(forw_back, right_left) {
    console.log(forw_back, right_left);  
}

m_fps.enable_fps_controls({
    character : null,
    element : null,
    motion_cb : move_cb
});


the motion_cb is not correctly set with that syntax. You have to do it:

m_fps.enable_fps_controls(character, null, move_cb);
// Without the brackets


And it gets correctly configured. Then when you move you get the callback correctly and you can trigger the appropiate actions. Fine.
21 May 2017 22:48
Thank you Will for taking the time of answering me. I have watched the videos and got a better understanding of the baking process, I haven't done anything yet with blend4web but it seems pretty easy.

But what I'm asking for is about the fps module that now comes integrated in the api. You have the basic movements of the character already implemented and a state machine and several tweaks for controllers even VR. So I would like to understand it and follow that line.

If I get the trick I will post it here.

Thank you
20 May 2017 14:37
Hello again:

I keep trying with the fps module. I've been setting up an scenery, which has been very interesting, configuring the lens flare, day time and all that is really easy with the api options, great work. The sea is still half the way as it is a pretty complex setup to understand, up to now I have had good results with the normal maps and the foam, now I'm gonna try to understand how the coastline works, I stil haven't get it. If you have any hint it will be welcome.

The tree setup with the wind system is great, too. I have only found a bit of problems in the vertex painting as it would left some of the vertex static and the mesh of the trunk would mess up. Repainting the vertex I got a better result but still need to get better at that. Anyway it is very convincing the wind setup and all that.

But, now I'm starting with the animations of the character, I'm not sure which is the best approach to bind the animations to the character physics object. Would adding a new action to the key with a callback to call the exported skeletal animation be a good approach? I don´t see how to modify the default states of the character to apply the corresponding animations: walk, run…

If you can help me with this I will be grateful.
Thank you
18 May 2017 21:37
Hello again:

I keep trying with the fps module. I've been setting up an scenery, which has been very interesting, configuring the lens flare, day time and all that is really easy with the api options, great work. The sea is still half the way as it is a pretty complex setup to understand, up to now I have had good results with the normal maps and the foam, now I'm gonna try to understand how the coastline works, I stil haven't get it. If you have any hint it will be welcome.

The tree setup with the wind system is great, too. I have only found a bit of problems in the vertex painting as it would left some of the vertex static and the mesh of the trunk would mess up. Repainting the vertex I got a better result but still need to get better at that. Anyway it is very convincing the wind setup and all that.

But, now I'm starting with the animations of the character, I'm not sure which is the best approach to bind the animations to the character physics object. Would adding a new action to the key with a callback to call the exported skeletal animation be a good approach? I don´t see how to modify the default states of the character to apply the corresponding animations: walk, run…

If you can help me with this I will be grateful.
Thank you
26 April 2017 12:51
Hi there:

I've been taking a look at the fps module included in the api and I have come up with a couple of questions. How do you change the behaviour of the shift key to do the opositte, run when pressed and walk without it being pressed? How do you use the motion_cb rewrite? Do you completely rewrite the motion_cb or do you add the funcionalities you need after the default callback is called?

It seems the fps module can be helpful, mainly with the compatibility across browsers and different platforms but you should at least update the fps tutorial in the blog to let people understand the basics.
14 April 2017 15:19
Well, it's been a while since I posted this bug but at last it was my fault. It was simply an option in Firefox called Find As Your Type, it can be deactivated in the advanced tab of the Firefox preferences.

Only one more question remains, can this option be ignored from javascript? It would be useful to check for the web browser and in case it is Firefox deactivate that option, I don't know if this can be done in the dom or window classes ???
16 January 2017 12:39
It's been a while since I have been experiencing this bug in Firefox, since the last update I think this happens. If you create a FPS setup and you open it in Firefox when you hit for example, the forward key as soon as you push the key a search bar appears at the bottom of the screen and starts getting the characters you are pushing.

Have anyone notice this behaviour? And, is there a workaround to this? I hope is not my browser, I have installed it recently and everything seems to work ok. Prior to the last update I've been working in Firefox normally.

Cheers
Marcos
18 December 2016 17:58
Ok, I'll try that. Thank you.