![]() I spent a week trying to find a prebuilt solution when I should have spent a couple of hours exploring the DAEs generated from my 3D program. (i.e., you could break the animations into parts and animate the characters arms independently from the legs, you could store multiple animations in the same DAE file etc.). As a bonus, you will gain a lot of control by pulling out the animations explicitly. I wrote the code in Swift (~25 lines) and even though it had to recurse through the node tree, it seemed to take negligable time. MySCNNode.addAnimation(måAAnimationGroup, forKey: "myAnimationName") If you do a recursive top-down traversal of the nodes stored in the DAE, then the first node you encounter with an animation, call it 'mySCNNode', can be used: MåAAnimationGroup.duration = CAKeyframeAnimation1.duration Then I created a single CAKeyframeAnimation and loaded its 'animations' array with the individual CAKeyframeAnimations: In lieu of finding some service to convert the DAE files animations from Maya ("ConvertToXcodeCollada" stopped working for me), what I ended up doing was writing code to traverse the Maya-generated-DAE file's rootnode tree and gather up the individual node's CAKeyframeAnimations (which were inside CAAnimationGroups). In the scenekit scene editor go to editor->convert to to scenekit scene file format(scn) The code I listed above assums the models are converted to scn. The project this is part of is written in swift (which I hate) so if you're not familiar with swift any code I could provide may not be terribly helpful. ![]() bvh motion capture files and edited to fixate the model location and keep it's feet above the floor), then the animation was run through ConvertToXcodeCollada and placed in an scnassets folder in the project. The model was built in Makehuman, imported to Blender, animated in blender (using the cmu. ![]() ![]() If you still need it to be a simple cube I'll try to get on that later today but this model was already built, rigged and animated from a project I have on the back burnder at the moment. It's in dae format so you can open it in cheetah, but it should work fine in xcode as is. It's not a simple cube it's a fully rigged human with the animation converted for xcode compatibility. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |