Closed Liquid-Blocks closed 2 years ago
Hi @Liquid-Blocks,
So basically we will create these methods as below:
Is that correct?
Yes that is correct, sorry for the slow response
Hi @Liquid-Blocks,
While implementing, I notice that animation loading must use object.scene which comes from avatar loading callback. Is it fine if I call animation loading inside avatar loading callback?
Hi @codeeMadness, that is a good question, I think the best would be to save the loading result in a class attribute and try to pass the Object.scene as an argument of the animation loading so that it can be its own independent method.
Hi @Liquid-Blocks , Your suggestion is fine. However, the callback in loading avatar usually called after animations loading, I also tried with Promise, but it always load animation first. I guess they both run the callback, so these process will run in synchronize way.
OK, so this is my implementation so far:
It could stay like this for now since we don't have any case where it is pertinent to load an avatar without the animations.
We can do further experimentation with the callbacks when the need arises
Hi @Liquid-Blocks , I have changed a little bit. We will pass animation loading as a callback for avatar loading. So we can load avatar with or without animations and otherwise. Please take a look at PR and you can see.
branch was merged
In the
AvatarController
, the avatar loading is nested inside the animation loading logic. This implementation makes it quite difficult to manipulate the animations and allow custom animations.We want the avatar loading and the animation loading to be separate methods:
AvatarController.loadAvatar(avatarUrl)
AvatarController.loadAnimations(animationsUrl)
This implementation will allow more granular control on the animations down the line. In the next phase, all we need to do for custom animations, is create access methods to the
AvatarController.animations
object.