Alright!
Neew version uploaded.
It fixes a bug in the Controller loading code and the code now handles MDL “states”.
======================================
EDIT: This was unclear… it was late and I was tired
“States” are what NWN calls animations but as a “aniamtion” cna just be anew static position, and the base ground-state can have motion, I thought “state” was a cleaner term.
SO lets try re-explaining that…
NWN Mdls have various settinsg set by “controllers”. There sia default set that is in the main scene graph. Controllers coem in two types. Fixed value controlelrs and time-keyed controllers. Time-keyed con trolers animate the parameters in much the same way that J3D behaviors typically do.
Additionally each MDL faile can contain named dummy scene graphs that just contain alternate sets of controllers that over-lay the ones in the main scene graph. NWN calles these “aniamtions” but I call tyhem “states” because an NWN “animation” can be all static controlelrs and thus not really animate at all.
My loader code extends SceneBase witha MDLSceneBase calss that has an entry poitn to return the state list. Each state has a name that cna be fecthed from it, The state that was in the main scene graph is called “_ground”, the rest are named whatevr the name of that dummy tree was in teh file (these are the animation names you see in NWN C).
Each MDLState has two methdos on it. applyStatic() and applyDynamic(float time). applyStatic() applies all the static controllers of that state to the model. You call this when you chnage states. applyDynamic(flaot time) applies the time-keyed controlers for that particaulr moment in time. In genreal when you chnage states yo ushoudl call both applyStatic() and applyDynamic(0). It does the rest.
MDLViewer shows how all this is used.
==========================================
Sorry no docs yet. You can see how they are used by lookign at the new MDLViewer class which now supports state switching and an animation-slider.
Next on my list is looking at getting the particle systems working…