Forum

How to create instance of armature linked model?

02 August 2015 20:37 #3280
Hi, all.

I am working on a prototype of a multiplayer game while leaving the creative aspect to an artist. B4W seems to meet that requirement really well, thanks! However…

I can't figure out how to create an instance of an avatar for each player that logs in. I see that I can clone a mesh, but I can't clone the associated armature. Currently, I have a handful of avatars off screen, waiting to be pulled in when someone connects. Clearly that won't work when more people log in than I have placeholders.

How do you go about instantiating an existing object that includes non-mesh components? I'm sorry if this has been posted elsewhere!

Thanks.
02 August 2015 21:11 #3281
Just to follow up… am I over complicating this? Should I just load the avatar from a different .blend every time I want to create an instance like the 'Furnishing the Room' example (https://www.blend4web.com/en/article/63/) does ? That feels heavy, but perhaps I'm not understanding something.
03 August 2015 08:14 #3282
linkhttps://www.blend4web.com/en/article/119/

~/blend4web_sdk_free/deploy/tutorials/examples/
make a game example gave the details about how to make a game.
I believe Golem is a good example. When someone login, there will be a spawn of "Golem".
03 August 2015 13:16 #3285
Good day!
Making a game example uses cached golems models so there is no real instancing in this example.

Should I just load the avatar from a different .blend every time I want to create an instance like the 'Furnishing the Room' example
Actually, this is not about loading from a different .blend file but loading from a .json file which has links to all needed resources. So generally, all the required data will be cached after the first upload. (If not only a user disabled caching for some reason). And you shouldn't have any problems with armature this way.
Blend4Web developer
03 August 2015 17:58 #3296
Okay, great. That's what I ended up doing. Thanks!

When you say 'cached', I assume you mean the browser cache, not something B4W is doing, right? Won't this force B4W to re-parse the .json file every time I instantiate an object ( via m_data.load() ) from the file? Is there a more efficient way I should consider?
03 August 2015 19:04 #3299
Yes, this is not a very optimized way of cloning objects, but this is the easiest one. Currently, we have limitations on cloning skinned objects, lamps and cameras. All these are pretty tough tasks but are working on improvement.
Blend4Web developer
03 August 2015 20:09 #3303
Cool. Thanks for the help!
09 February 2016 02:30 #7262

Ответ на сообщение пользователя Evgeny Rodygin
Yes, this is not a very optimized way of cloning objects, but this is the easiest one. Currently, we have limitations on cloning skinned objects, lamps and cameras. All these are pretty tough tasks but are working on improvement.

Sorry to rez this, but I thought I'd mention that this became a blocker for me. With twenty skinned objects being loaded (vs. cloned), the load times were painful. Is cloning skinned objects still on the roadmap?
09 February 2016 12:32 #7278
Ответ на сообщение пользователя rknopf
Sorry to rez this, but I thought I'd mention that this became a blocker for me. With twenty skinned objects being loaded (vs. cloned), the load times were painful. Is cloning skinned objects still on the roadmap?

Yes. I can assume, this feature can be introduced in 2 or maybe 3 releases. We'll make the copy function to work properly with the whole object hierarchy. Thus, you will only need to copy a parent object so that all its children will be copied automatically. And there will be an option to disable this behavior.
Blend4Web developer
 
Please register or log in to leave a reply.