Just committed rev. 911 to the Papervision3D SVN trunk. Rev. 911 and upwards will become Papervision3D 2.1 because the changes made are quite big.
Major changes where made to the DAE, MD2 and animation classes.
NOTE:
This revision is considerably different then previous revisions. Use with care!
At this point its not advised to use rev. 911 for production.
This revision fixes several issues regarding the DAE class:
- vertex-animation
- nested animations
- Cinema4D support
- morph-weight animation
- splines
- cloning
- play(), play(”clipName”), stop(), pause(), resume()
- more…
The whole org.papervision3d.core.animation.* package has been revamped completely to allow for the changes in the DAE class.
DAE Example:
var autoPlay : Boolean = false; // don't play animations automatically var dae : DAE = new DAE( autoPlay, "myCollada" ); dae.addEventListener(FileLoadEvent.LOAD_COMPLETE, onDaeComplete); dae.addEventListener(FileLoadEvent.LOAD_PROGRESS, onDaeLoadProgress); // optionally pass materials to DAE // NOTE: here's a change with previous revs : // 1. lookup the <material> elements in the COLLADA file (inside <library_materials>). // 2. write down / remember the @id attribute of the <material> element. // 3. materials.addMaterial( myMaterial, materialElementID ). // ==> this will probably change in future revs var materials : MaterialsList = new MaterialsList(); // If textures fail to load optionally add some search-paths // (relative to the swf): dae.addFileSearchPath( "images" ); dae.addFileSearchPath( "textures" ); // set to true if you get a script-timeout error var asyncParsing : Boolean = false; // load it! dae.load( "/path/to/dae", materials, asyncParsing ); /** * The DAE has loaded completely */ private function onDaeComplete(event : FileLoadEvent) : void { var dae : DAE = event.target as DAE; // add to scene scene.addChild( dae ); // start playing animation (if any available) // other animation controls include : // 1. play( "clipName ") // 2. stop() // 3. pause() // 4. resume() // 5. playing (getter: bool indicating if playing) dae.play(); // lets create a clone // NOTE: DAE#clone() is somewhat bugged still, // but seems to work in most cases var clone : DAE = dae.clone() as DAE; // add clone to scene scene.addChild( clone ); // move it a bit clone.x = 200; } private function onDaeLoadProgress(event : FileLoadEvent) : void { }
MD2 Example:
var md2 : MD2 = new MD2(); var material : MaterialObject3D = new WireframeMaterial(); md2.addEventListener(FileLoadEvent.LOAD_COMPLETE, onMD2Complete); md2.load("/path/to/md2", material); scene.addChild(md2); private function onMD2Complete(event : FileLoadEvent) : void { var md2 : MD2 = event.target as MD2; md2.play(); // or play some clip : // md2.play( "run" ) }
Animation:
Click the image below to show an example of the new animation controls.

Download the source of this example here.
The DAE and MD2 class implement IAnimatable, IAnimationProvider and IControllerProvider, which can be found in the org.papervision3d.core.animation.* package.
- IAnimatable provides the play(), stop(), pause() and resume() methods.
- IAnimationProvider provides a getter / setter #animation for low level access to org.papervision3d.core.controllers.AnimationController
- IControllerProvider provides a getter / setter #controllers for low level access to the different controllers:
As so much has changed I’m sure some bugs are introduced. Please let me know!
PS: I’ll be on vacation until june 8th, so its unlikely I’ll be able to fix any bugs before that time.
PS2: Many people have helped by submitting code-snips, reporting bugs etc. I’ll credit you all when I’m back




