Home | Features | Roadmap | Learn | Documentation | |||||
Latest version: Tramway SDK 0.0.9 Github Quick links Home Get Started |
Adding AnimationsFirst, make sure that you have installed the Blender animation exporter plugin. Next up, create a 3D model of something, create an armature for it and rig it. NoteTramway SDK only allows 4 bones to influence a single vertex. Take this into account when vertex weight painting. If the exporter sees that a single vertex has weights for more than 4 bones, it will pick only 4 of the vertex groups that have the greatest weight for export. For the animations, you will need to open the Blender's Action Editor. Each exported animation will be a single action. When creating an animation, make sure that each bone that will be animated has a keyframe at frame zero and another keyframe at the end of the animation, on whichever frame you decide to put it. NoteUse only LocRotScale keyframes, otherwise the exporter will explode and your computer will catch on fire. This might be fixed sometime in the future. NoteTramway SDK only uses linear interpolation, so make sure to set it in your keyframes, so that you see the animation in Blender just like it will look like when rendered by the framework. NoteSince animations are resources with names, do not use a name with any spaces for your action name.
After the animation or animations are finished, select
File » Export » Tram Animation Exporter
option. In the file dialog, navigate to Each Blender action will get saved into its own animation file.
If you want an example of a rigged 3D model and an animation, take a look at
the Playing the animationFirst, set up the 3D model.
toilet = tram.components.Render()
Then, let's load the Animation which we created.
animation = tram.render.animation.Find(
Next, let's set up the AnimationComponent, which will be playing our animation.
armature = tram.components.Animation()
After both the Render and the Animation components have been initialized, we can link them together.
toilet:SetArmature(armature)
Finally, we can play back the Animation on the AnimationComponent, which will be visible on the RenderComponent, to which we linked it to.
armature:Play("toilet-lid-open-close")
Animation being played on a 3D model. ExerciseThe example above shows only the most basic animation playback option. Try changing the animation playback parameters. Try pausing, continuing and stopping animations. Fade them in and fade them out.
|
|
|||
|