towfiqi

Hi,

I have character skeleton. It has multiple face parts and multiple animations : blink, laugh, speaking etc. The speaking animation only works with mouth slot and the blink animation only works with the eyes slot and the brows slot.

What I am trying to do is, mix 2 animations so that they run together. For example, I want to mix the blink and the speaking animations so that they run together and make it look like the character is blinking while speaking.

I tried setMix without any luck. I am not sure I have correctly implemented it though.

animationStateData.setMix("blink", "speak", 0.8)
animationState.setAnimation(0, "blink", true);
Thanks

---

Ok. I figured it out. Looks like I have to play the 2nd animation in different track.

I have one other question. How do I change the canvas background to transparent? Its currently gray. I tried clearColor but its still gray.
canvas = document.getElementById("canvas");
var config = { alpha: true };
gl = canvas.getContext("webgl", config) || canvas.getContext("experimental-webgl", config);
gl.clearColor(1, 0, 0, 1);
towfiqi
  • Сообщения: 9

badlogic

Glad you figured out the first issue.

As for a transparent WebGL canvas, you'll have to set the clearColor to (0, 0, 0, 0), where the last parameter is the alpha value used to clear the canvas.
Аватара пользователя
badlogic

Mario
  • Сообщения: 2065

towfiqi

Just tried that. still gray.

For reference, I am having the same issue as this:
I want to set the SpineWidget background transparent

Thanks
towfiqi
  • Сообщения: 9

badlogic

Then you must be calling gl.clearColor() somewhere else with the rgba values for (non-transparent) gray.
Аватара пользователя
badlogic

Mario
  • Сообщения: 2065

towfiqi

You are correct! I don't know why I did not check that earlier. Thanks for your help! :)
towfiqi
  • Сообщения: 9


Вернуться в Runtimes