As Killing as possible deformations with
bounded distoration animations

View the Project on GitHub maximlevitsky/animations-editor-bdmorph

Getting started

You start by creating a new video project from some form of an existing data.
It can be either an existing planar mesh (in usual OBJ format) or a picture.
in later case you will be be asked to draw the outline of the subject you want to animate using the picture as reference.
Currently only one subject is supported, but in future versions you could use an picture that has more that one subject


Its also possible to create a new outline from the scratch by doing File->Create model

Outline Editor


The editor is pretty basic so far, but good enough for the task.
  1. To start, left click on a place where you want to put the first vertex.
  2. Everytime you click again, a new edge will form, from the selected vertex to a new vertex at point of the click.
  3. The selected vertex (green) can be changed by clicking another vertex and not moving the mouse.
  4. Clicking and dragging an vertex moves it and doesn't change the selection.
  5. Clicling in middle of an edge, splits the edge in two.
  6. Right clicking an vertex or an edge, erases it.
  7. The outline can be loaded from .poly files by clicking 'Import' and saved to .poly file using 'Save'
  8. To create an mesh with 'holes' in it, place an standalone vertex inside each hole



  9. The Create Mesh button invokes code from Triangle, a library that creates De-Launchy triangiliation of the polygon you had drawn.
    You can use Mesh Density button to control the density of the resulting mesh.
    Default density is OK in most cases, and high density doesn't contribute to quality, but rather slows things down.
    It included mostly as a streess tesing measure.

    Keyframe editor


    Here you can apply deformations to the mesh in very similiar way as in the original KVF project.
    To do so, you pin the vertices which you want rougly not to move and then drag the ones that you think will give you the right deformation

    1. Adding/removing pins (pinning) is done either when the Pin mode is selected or when you hold the Shift button while clicking on an vertex.
      A pin is removed by clicking on it.
    2. Control points weight allows you to tweak the KVF algorithm to give more or less weight to the pin points
      Low values cause global movements, while high values cause distorations.
    3. Reset Control Points removes all the pins.
    4. Reset restores the keyframe back to its creation point.
      Undo/Redo do their usual thing.
    5. Hightlight selected vertex is semi-debug feature to show what face and what vertex is under the mouse.
      Both on the screen and in the statusbar.
    6. Mouse wheel zooms, and dragging with right button moves the model on the screen (but model remains the same internally).


    Animation Editor

    Here you add/remove the keyframes.
    1. 'Big plus' adds new keyframe and initializes it to be exactly like the last one
      If you want to add an keyframe in the middle, you can right click an keyframe and choose Clone Keyframe
    2. Delting an keyframe is also done with right click menu. You can't delete the last keyframe.
    3. Each keyframe has a time asscociated with it, which is the relative moment from start of the video, at which it will be displayed.
      This can be changed by right clicking the keyframe and using Edit time
      Note that change affects all following frames in the way that only display duration of frame that is before current one is changed.
    4. Frame can be loaded from an mesh file, as long as the mesh has same faces and same vertex count.
      This allows you to save the current frame, and later load it.
      To do so, use Load from file righ click menu.
    5. Lastly if you stop animation in the middle, you can convert the interpolated frame to a keyframe by pressing Convert to keyframe button.


    Animations

    Finally you can preview animations and save the output to a video file, a project file, etc etc.
    1. Dragging the slider creates interpolated frame according to its new position.
      You can see the current time in the side bar.
    2. As said earlier at any time you can convert an interpolated frame to a new keyframe.
      Unless you do so however, the interpolated frame can't be edited.
      You can only zoom and move it as usual.
    3. Play/Loop/Rewind buttons do their usual thing to play back the animation on the screen.
      While the animation is running, the Play button changes to the Pause button
    4. Spacebar works like Play/Pause button
    While the interpolated frame is visible, three debug features are shown in the side panel:
    1. Show anchor edge: shows the the edge that is selected to start mapping from.
      This is because, due to the nature of BDMORPH algorthm, the solution is only known up to the movement,scale and rotation.
      So one of the edges is chosen to be lineary interpolated between keyframes and rest, according to solution.
      In next version, you will have ability to choose it, and have smarter way to choose it automatically
    2. Show starting model: overlays wireframe of the first keyframe from pair of keyframes used to create the interpolated frame over it.
    3. Target FPS: changes the FPS, the animation algorithm tries to acheeve. Moslty amusement feature if you set it low.


    Wrapping it up

    At any moment you can save output in varity of ways:
    1. Save current mesh to file: Choose Save and set the output file name to name.obj
    2. Save video project: Choose Save and set the output file name to name.vproject
      In this case all the keyframes, pins, start times will be saved in this file, and you can later load it
      WARNING: the format of this file is subject to change.
    3. Save screenshot: Chooose 'save screenshot' from the menu
    4. Create video file: choose 'Export video' from the menu.
      output is tested on mp4 and avi formats, in both cases H264 video codec is used, and video size is 1024x768
      In future versions, more settings controlling the video output will be provided.
      Note that due to a bug somewhere, the mp4 output doesn't play in some players


    Note that everytime you import an mesh, outline or a video project, and a texture with same name exists in the folder, its loaded. This is why you see the garbage above, because it loads the screenshot as texture.