0

I am aware that you can move and rotate objects around to 'animate' them but I have a different question: Is there a way to animate rigged models in Ursina? And if so, How?

I have scoured the internet for answers to this question but I have not found any helpful answers, does anybody know?

Spiceinajar
  • 101
  • 1
  • 10
  • you can use [AnimationFrame3d](https://www.ursinaengine.org/cheat_sheet_dark.html#FrameAnimation3d) – Tanay Mar 14 '22 at 18:11

1 Answers1

2

You can simply use Panda3D's built-in Actor class which handles animations, and then reparent it to the Entity you want to animate :

from ursina import *
from direct.actor.Actor import Actor

app = Ursina()

entity = Entity()
# animations are stored within the file
actor = Actor("filename.gltf")
actor.reparentTo(entity)

actor.play("animationname1")

app.run()
  • Is there a way to store multiple animations in one .gltf or do you have to have a separate .gltf is you want multiple animations? – Spiceinajar May 07 '22 at 12:13
  • I don't think panda3d will ever accept it. https://docs.panda3d.org/1.10/python/programming/models-and-actors/multi-part-actors mention how to handle multiple animations in a single actor but I recommend checking out Mr. Robot code from GitHub for a better view. https://github.com/ggonzalez87/MrRobotoGame/blob/master/src/World.py#L567-L570 – Lixt Jan 10 '23 at 18:25