Blender animation workflow

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!

Original Post on Discord

by user 826487481092145192

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?

Thanks @marcel :cactus: - 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 :crossed_fingers:

by user 611223118068842528

Hi @Underslunky - sure go ahead :slightly_smiling_face:

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 :face_holding_back_tears:

by user 611223118068842528

Hi @Underslunky 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

Thank you so much Marcel, I really appreciate your help

by user 611223118068842528

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 :slightly_smiling_face: We can do that in a future update if it would be useful for you

Thanks - will check it out shortly

by user 826487481092145192

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

by user 826487481092145192

Yes it is exported to usdz at runtime :slightly_smiling_face: 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 :wink: which others cant/dont have

Thats how these scenes work: Needle Engine Samples all no code created in unity

@marcel :cactus: 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?

by user 826487481092145192

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

do you need the transitions in your animation?

“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