Animated Meshes 0.3.2 - ZackWilde27/Z3dPy GitHub Wiki

z3dpy.AniMesh(frameList, vPos)

Creating

With Blender, each frame of the timeline is exported as an OBJ, it doesn't matter how it was animated or made, since it's all vertex animation.

Loading

Exporting OBJs as an animation will create a file for each frame.

image

To load these, call LoadAniMesh() and remove the number from the name

myAnim = z3dpy.LoadAniMesh("mesh/anim.obj")

enemy = z3dpy.Thing([myAnim], [15, 30, 0])

To get the animations to play, the frame counter needs to be incremented during the draw loop.


while True:
    # Render 3D
    for tri in z3dpy.Raster():
        z3dpy.PgDrawTriFL(tri, screen, pygame)

    pygame.display.flip()

    # ThingIncFrames() will increment the frame counter for all animeshes in a thing.
    z3dpy.ThingIncFrames(enemy)