WIP: Dae-animation support

Nelsson Huotari requested to merge unelsson/openmw:daeanimation into master

#5456 (closed)

This MR implements a basic bridge for osgAnimations(dae) to OpenMW in the most format-agnostic way possible. Took a while to figure out what goes where, and this is the first system that works. I haven't given any thought to optimization, just tried to make one simple thing that works.

I'm not sure what to do next. It's probably a good time to give some feedback. Is this a good approach in the first place?

Issues of this MR:

  • Currently, the root bone of object has to be named "root". If root bone with this name isn't found, the game crashes.
  • The BasicAnimationManager is currently found only for model with a similar structure as Seymour.dae, it might or might not work for other models.
  • There are sometimes errors when loading models, result is marker_error. This happens when loading a save with a dae-model that wasn't there during the save (loading from memory with istringstram). This is likely related to OpenMW vfs using relative paths, and Collada plugin only accepting URI-paths.
  • Collada models only accept "file" URI-paths for textures, this is an OSG limitation.
  • Relative paths for image textures don't work with OpenMW's vfs yet.
  • Animated characters can't move in the world yet, possibly related to world translations
  • Bounding box support in files is not tested/researched
  • Doesn't properly support and control correctly which animations are played. This is not straightforward to solve, because animations in OpenMW are (to my understanding, partly guesswork) controlled by timed keyframes that are all pieces of one animation. In nif-format (again, guessing) textkeys are used to store information of each animation's place in timeframe. Collada, BasicAnimationManager and Godot's exporter handle animations through separate clips (which have start and end). KeyFrameManager (callback) gets time, but not the animation that is played. Intermediate layer might have to frame-by-frame convert this "nif-time" into correct clips in osgAnimation::BasicAnimationManager.
  • caps do matter in animation names (e.g. "Idle" doesn't work, while "idle" does)

OSG dae plugin issues

Issues with Godot Engine's "Better" Collada exporter for Blender

Issues of Unkown cause

  • "Failed to find matching <bind_vertex_input> for CHANNEL1, Error: Extra content at the end of the document" is a common error in dae animation files. It might be an exporter problem, or OSG dae plugin parsing problem.
Edited by Nelsson Huotari

Merge request reports