How to load animations made in Blender to ARKit? - swift

I made a 3D object in Blender and made some custom animation to it. However, I manage to load the object to the scene, but not the animation.
This is what it appears to me at the Entities tab
I was searching about "How to load custom animations in ARKit", but couldn't find anything besides this link:
https://blog.pusher.com/animating-3d-model-ar-arkit-mixamo/
In there it tells you how to download and play some animations with Mixamo, but I want to load the animations that I made in Blender.
Just for the record, I'm new in this field of ARKit programming and I'm learning by myself.
Any suggestions? Thanks in advance!

When we're talking about animation it's better to talk in context of SceneKit and Core Animation frameworks.
Here's what Apple says about it:
SceneKit also uses CAAnimation objects for animations created using external 3D authoring tools (3dsMax, Maya, Blender) and saved in scene files. For example, an artist might create a game character with animations for walking, jumping, and other actions. You incorporate these animations into your game by loading animation objects from the scene file using the SCNSceneSource class and attaching them to the SCNNode object that represents the game character.
But remember: you need to export your animations as .dae file format. And your animations must be baked (you need to transform all animation and deformations into keyframes (for every frame) on the timeline regardless of how the animation is done).

Related

Adobe Animate generic animations to Unity with local skeleton

I came across the problem of exporting Animate animations to unity. In animate these animations are bound to a certain skeleton, this skeleton can be customized (clothing, hairstyle, weapon, etc.) but the animation will still play ideally. I want to bring these animations to unity, but I want to keep the customization option in tact.
The solutions so far were to convert to PNG sequence or to use some export tools, however every solution exports static animations, without any further customization support.
Is there any options to retain and transfer the skeleton data to unity or maybe exporting skeletons directly, idk. Anything will help

What is the best way to make slight feature changes to imported unity assets?

I found a pack of unity assets (these 3D characters with built-in animations) that serves my purposes very well, but I want make slight feature changes to some of them. For example, I would want to change the color of some, maybe add a horn or other utensil, make the tail longer etc. I would like these changes to impact the animations minimally. I am wondering about what is the best workflow for this.
I looked into importing the .fbx files into Blender to make such featural changes, but the animations are not retained in Blender (this seems to inevitable according to some?). In general, most information is about workflows going from Blender to Unity, rather than the other way. I am thinking of importing the .fbx files into Blender regardless, without the animations, changing some features, and then importing back into Unity, hoping that the Unity animations can snap back onto the modified creature.
Since I am a beginner with both Unity and Blender, I wanted to check whether this is has a chance to work or whether there are better alternatives. Many thanks.
Unity animation if done using the main tool is probably just animating properties of the model/objects that are exposed to Unity's serialized interface, e.g. color, position, etc. So, either they animated the model hierarchy inside Unity (sounds unlikely), in which case the animation is part of an animation clip, or they did it in Blender, in which case the animation should be part of the fbx.
You can try an application like Fbx Review to view the fbx file and see if it includes the animation.
Unity Animation
Unity binds its animation streams with Transform/GameObject names. As long as you don't modify the hierarchy of the model, you should be able to modify it in blender like you want and later import into Unity.
Fbx Animation
Simply import into Blender, and make any changes that don't break the animations.
Alternative
If you really must, you can modify the imported mesh inside the Unity Editor. There's a few tools available for this in the assetstore.
Last Bet
Simply email the asset seller and ask them what the best way to proceed would be. For a 150$, they will probably be willing to provide this amount of support.

RealityKit – Playing multiple animations in USDZ file

Has anyone found a workflow to create multiple animations for a skeletal mesh packaged in a USDZ file and playback the animations using RealityKit?
I have a skeletal mesh with two animations (idle & run). I want to package them into a single USDZ file (or even multiple USDZ files if I have to) to be used in RealityKit.
I have been able to create an FBX for export of my skeletal mesh and the animations, and ship them up to sketchfab for a valid USDZ export that RealityKit can understand. I do not know how to package the second animation into a single USDZ file and then use SWIFT to playback the specific animations based off of specific events.
There seem to be a lot of posts from about a year ago on the topic with no real answers and little activity since. Any pointers would be appreciated.
Although in SceneKit you can play multiple animations using .dae model, in RealityKit 2.0 you still have no possibility to play multiple animations found in any .usdz model. Look at this post and this post.
There is only one animation is accessible using the following code now:
let robot = try ModelEntity.load(named: "drummer")
let anchor = AnchorEntity()
anchor.children.append(robot)
arView.scene.anchors.append(anchor)
robot.playAnimation(robot.availableAnimations[0].repeat(duration: .infinity),
transitionDuration: 0.5,
startsPaused: false)
When you choose second or third element in collection (if it really exists), your app crashes:
modelWithMultipleAnimations.availableAnimations[1]
modelWithMultipleAnimations.availableAnimations[2]

How to integrate Spine animations to a SpriteKit game

I need to integrate animations to an iOS SpriteKit game. The artist provides them in Spine format. Such animation consists of a set of images, a .spine file describing the animations and a .json file describing the metadata.
I see two possible ways to solve this problem:
Find (or make) a module allowing to add nodes and related animations from Spine files to a SpriteKit scene.
Convert the animation to a different format which can be imported to SpriteKit easily.
Please, share your experience. Any help is welcomed!
There is a library that allows you to do exactly that. Installing & usage examples are in the description of the library.
https://github.com/maxgribov/Spine

2D Game Character Animation in iPhone - How is it done?

What I mean is, do animators work on an animation in say Flash (or some other kind
of key frame animation program) and then export it to the iphone somehow?
For example, say I am an animator and I want to create a person waving for an iphone
game. What type of external program would I use and then what libraries on the iphone
sdk would I use to load them in?
I think it all depends on how in depth you want to get. Making a 2D game is a broad statement. For example, to make what you ask. You would just make a series of PNG images for a cell based animation of the wave. wave1.png, wave2.png, waveN.png...
Then load the PNG images in and then play them in sequence. You can do this with UIImageView, Core Animations classes, or manually your self with UIImages and UIViews.
There a lot of great game engines you can check out too. Here is a link for an example of what is available. Game Engines
For the best performance, most companies/developers use OpenGL to do both 2D and 3D style games. You can utilize a lot of tricks for the textures used in your games.
The iPhone natively supports key frame animation with the CAKeyframeAnimation class.
I think the most popular framework for 2D games is Cocos2D: http://cocos2d.org/