#Blender animation workflow

1 messages · Page 1 of 1 (latest)

daring bluff
#

I'm having a lot of difficulty understanding how to set up and trigger different animations. The docs are a bit confusing for me.
Is anyone able to share a blend file with multiple buttons triggering different animations on a single armature?

Should this be achievable through components alone or does it require typescript?

A few more worked examples in the docs would be really helpful!

abstract whale
#

Hi, i can provide you with an example tomorrow.
it might need a little bit of js (it integrates in blender automatically) right now because button events in blender dont take arguments i think to trigger a specific animation - i will double check tomorrow and give you an update or simple script to make it work here

#

Do you have a specific goal in mind on what you want to make? Or are you mainly experimenting at this point?

latent furnace
#

Thanks @abstract whale - I could share a file with you to illustrate my intentions if that's ok?
The endgame - I want to make an AR Avatar compatible with iOS and Android where no download is necessary. The Avatar will be the face the welcomes an audience to an exhibition.
The PoC - I have a blocky character with 4 animations - idle, hello, sad, chat
I've placed 4 'buttons' in the scene hoping to link the button tap event to trigger different animations.

We are experimenting with options but I'm really rooting for Needle to be a big help 🤞

abstract whale
#

Hi @latent furnace - sure go ahead 🙂

latent furnace
#

This is as far as I got last night, but by the end of the evening I was tired and just setting things randomly trying to understand what they did 🥹

abstract whale
#

Hi @latent furnace so your setup was almost correct + there was one of our components not exposed in Blender to make it work in AR on Android and iOS (I'll add it with the next update tomorrow)

That component is PlayAnimationOnClick. Add it to your button objects and assign the object itself as a "click target"

I can ping you tomorrow once the update is out

latent furnace
#

Thank you so much Marcel, I really appreciate your help

abstract whale
#

Hi, the latest blender version adds this component. Let me know if it works for you

#

We also have PlayAudioOnClick actually which might be cool for this too - but I also need to expose it 🙂 We can do that in a future update if it would be useful for you

daring bluff
#

Thanks - will check it out shortly

#

AudioOnClick also sounds like ti would be a great help.
Anything that limits the need to code directly.
I'm curious about the USDZ export -
When I browse the folder structure of the projects I see a Scene.glb in the assets folder, but there isn't anywhere I can find a USDZ file when that component is added to the project. I know it works because I get the Quick Look option on my iOS device

abstract whale
#

Yes it is exported to usdz at runtime 🙂 when you click the button we convert whatever you assign in your scene (what is assigned in the usdzexporter component) which is super flexible. And we attach interactivity at runtime 😉 which others cant/dont have

daring bluff
#

@abstract whale I'm very close now but still not quite right.
I think I've followed the instructions but I've included Needle Animator transitions (only after I wasn't seeing what I expected) so those might be unnecessary.

I've added PlayAnimationOnClick to all buttons, but what seems to be happening is that a master animation is playing on load

So there is a default state which should play the Passive animation, but what seems to be happening is that the "Hello" in looping on load.

The buttons are clearly active, but they only trigger the same animation loop.

If I were to debug in the script where should I be looking?

abstract whale
#

Make sure you dont have a lot of other animation components on objects. The first scene you sent had animation and animator components on different objects as well as nla tracks - you might not want or need any of that which might be what you see at runtime now. and make sure to add an empty "default" animator state (the yellow one) so that the animator doesnt play anything on start automatically

abstract whale
#

"passive" state was set to looping

#

i also removed all transitions

#

I'm checking again - something seems not right in the assigned animation states at runtime

#

maybe a bug in the exporter with that

#

i'll get back to you in a moment

daring bluff
#

That's looking good 🤞🏻

abstract whale
#

Will make an update in a moment 🙂

#

Just a blender export bug

abstract whale
#

Just updated + added the PlayAudioOnClick component

#

you can import an audioclip (1) and assign it. Then add a _AudioSource somewhere in the scene and assign it too (the next engine release will make that optional so you dont have to have manually assign an audiosource)

daring bluff
#

That's crazy good. Thanks Marcel.
I look forward to playing with this.

abstract whale
#

I already updated blender with this component + fixed the animation bug

#

you can update to this #📚-releases message

#

there should be a button in the needle engine addon or Needle Engine panel to notify you when a new update is available

abstract whale
#

There's always a separation of Needle Engine (runs in the browser and uses threejs) and integrations for e.g. Unity or Blender which export the data to be used by the engine. They can (and are) updated separatly as needed 🙂

abstract whale
#

Let me know when you have tried and how it went 🙂

daring bluff
#

Hi Marcel -
Definitely made progress, thanks - I got this deployed on Glitch which is basically where I want to be. When the audio source is fully implemented that'll be really great!
https://silly-subdued-amaryllis.glitch.me/
However, unless I have done something wrong in creating the NLA tracks, the buttons didn't automatically trigger the correct animations.
For instance "Sad" button does "Sad" animation, but for the correct "Hello" animation, I had to select the "Passive" animation. For "Chat" I needed to select the "Hello" animation, and for the "Passive" button, I had to select the "Chat" animation 🙂

I see a couple of possibilities - when I test the animations in the blend file they match up correctly to the actions I expect and are in the Needle Animator node setup (see image attached). It is feasibile that I have misunderstood something about NLA *but *within the Blender environment everything is behaving as I'd expect. In the PlayAnimationOnClick component, I'm using the stateName that I have assigned in the Node (I set the label value to the same as the name too)

I was wondering instead if the animations were exported by the Add On component via an index which wasn't matching up correctly to the animation tracks?

Latest Blend file attached : - thanks again for your help. It'd be great to see this integration keep developing.

abstract whale
# abstract whale

Hi, thanks for the feedback! I'll go through it in a little bit just wanted to note that you can already use the audio like this noted here in the screenshot

daring bluff
#

Ah - I misunderstood - I thought I could add the audio in but that it wouldn't be playable until you had made an engine update

abstract whale
#

Hi, the issue is being caused by a change in the blender gltf export where the exporter (by blender) sorts the animations after they have already been collected which is unexpected - so they end up in a different order in the file. I've raised an issue in the blender exporter and look at a possible workaround

#

I've added a workaround that should fix the issue. Can you try updating to 0.32.11 ?

daring bluff
#

Cool thanks @abstract whale - it's sometimes reassuring to find out I wasn't just "doing it wrong!"

daring bluff
#

Can confirm that 0.32.11 works well for this issue. Additionally it fixed the default Anim state issue I was seeing so I don't have to leave it blank anymore

abstract whale
#

Great to hear!

daring bluff
#

I should let you know that I couldn't get PlayAudioOnClick to work though - see screen shot:
I'm on Blender 3.6.5 LTS. I couldn't populate the audio source through the file browser window, and I couldn't assign the target object either from a drop down or with the picker tool.
I ended up using Python console to make the obj assignments but still wasn't able to trigger the sound I'm afraid

abstract whale
#

You need to add an audio file to blender wiht the + icon (right side of the first row)
Then you need to assign an AudioSource component to one object in your scene (e.g. the root of your scene) which you can then select in the target dropdown. Sorry it's a bit of a hazzle in Blender there right now. We hope to improve this over time 🙂