Papervision3D 2.1 – alpha
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






May 27th, 2009 at 5:02 pm
Great job Tim. I think many people has been waiting for this.
I think is great the way you handle materials, and the dae.addFileSearchPath(“”) method.
Thanks!
May 27th, 2009 at 7:02 pm
Wow thanks,
Did a quick test with a quake 2 md2 can be viewed here: http://www.michelvandersteege.nl/test/walking/
Works really good and simple!
May 27th, 2009 at 10:07 pm
Awesome Tim, have a nice vacation.
May 28th, 2009 at 8:10 pm
Thanks Tim. Works awesome. Working on hit detection, if anyone has any hints
May 29th, 2009 at 3:25 am
This is so cool!
Great work.
May 29th, 2009 at 2:08 pm
I want a DAE animation sample like “AnimationTest.as”.
Whatever I tried, a DAE file couldn’t start the animation with Papervisio3D 2.1…
Papervision3D 2.0 can animate a DAE file.
May 30th, 2009 at 12:30 am
Hi Takeshi,
Quite possible there’s some bugs introduced with 2.1.
Now on vacation until June 8th. Happy to help when I’m back.
Until then: try to experiment bit.
Use dae.animation.play() etc.
Quite sure animation should work with 2.1 too
May 31st, 2009 at 12:46 am
Thanks Tim.
Flash CS4 for Windows Vista was OK.
Flash CS3 for Windows Vista was NG.
(Papervision3D 2.1 DAE animation)
June 4th, 2009 at 6:46 pm
Hi Tim…
Thanks for the hard work implementing these much needed features in PV3D… It made the engine much stronger
Are you planning on implementing interpolation between transitions (clips)? Much like the Away3D engine does.
Please check this for more info http://www.closier.nl/blog/?p=83
I think that with this feature (interpolation) and the ones you committed to rev 911 PV3D would be the perfect choice for character animation and control.
Let us know if you’re thinking about implementing this in the near future and get some rest while on vacation. It’s well deserved.
Miguel Kennedy
June 8th, 2009 at 9:46 pm
Hi Tim
I’m trying to use the updated class to import bone-keyed animations from Blender 2.48 but despite everywhichway tweaking cannot get the dae object to display, let alone animate. I think it may be something to do with the materials – I have put the material id in the relevant place and I get a ‘coercion of type string’ error.
I have prviously used the Collada class to import objects with no keyed animation and a uv tex but am keen to do what you have demo’d with the skeleton model.
Do you know of a way to export a bone-keyed animated .dae type from Blender 2.40 into as3/pv3d (I’m at revis 915) and control it as your DAE class implies I should be able to?
Many thanks,
Karl
June 8th, 2009 at 9:46 pm
sorry -meant Blender 2.48
K
June 9th, 2009 at 1:59 am
Hi Miguel,
These transitions seem quite easy to implement.
I’ll look into it asap.
Tim
June 9th, 2009 at 3:44 am
Hi Tim,
That’s awesome news!!! You made my day, really!
Thank you so much for looking into it and for your commitment to the community.
You just got yourself a new fan
Miguel Kennedy
June 9th, 2009 at 4:25 pm
Karl,
Beleive dae export from Blender is not very stable (invalid dae). Especially when it comes to bones / animation.
It could help if you send me the collada file or the .blend.
June 9th, 2009 at 6:13 pm
That’s what I’m thinking too – I’m going to try Cast3d, they have a patch to clean the blender dae. If that doesn’t work, I’ll send the docs. Thanks again. I’ll let you know what happens. K
June 12th, 2009 at 6:24 pm
Hello, i was stucked with C4D DAE export file for quite a long time.
I was about to cancel my project.
Do you have any details about the addons in C4D DAE features please ?
Thank you !
June 12th, 2009 at 9:27 pm
Well, DAE now follows the COLLADA spec better. Hence COLLADA exports from C4D should now work. Did not test extensively, so best is to simply try the updated DAE class.
June 12th, 2009 at 9:40 pm
Thanks for developing these additional features for dae animation, Tim… I too would really appeciate a way to interpolate a smooth blend between various clips.
And if there was a way to specify a duration in seconds for this interpolation between clips, it would give the animator a method to store a library of short clips as “poses” in the dae, and allow to tween between those clip positions. This would help keep the dae file size small, and the range of animation possibilities much higher.
Right now I’m working with a 25 second DAE animation of a 3K humanoid model, which needs to sync with a vocal track. The DAE export from Maya is 5 MB with 30 fps animation, and 2 MB at 15 fps.
The problem is that pv3d can’t seem to synchronize with the audio at 15 fps, even if the Flash document properties are set to 15 fps, the DAE animation still seems to play twice as fast as the audio.
I think the ability to dynamically specify a frameRate for the dae animation, maybe even at runtime, would be very very helpful.
And for long clips, the ability to play DAE frames backwards and/or forwards with a specified duration by frame number would be very helpful, especially if this could be controlled using a Tween class such as TweenMax or Tweener.
June 24th, 2009 at 6:31 pm
How can I export Md2?
June 25th, 2009 at 10:30 pm
Hi Tim,
First let me thank you for the updates, I’m inspired to do so much now that I can import animations. I have a problem though.. i dont understand how clips work and how to define them.. do i label them in 3d software before exp into dae or is it just measured somehow based on keyframe count.. thanx for your time
-eren
July 2nd, 2009 at 8:48 pm
Hi Tim,
I have an application created with pv3d 2.0 that uses an animated collada file.
Whereas before I was able to do this:
channels = dae.getAnimationChannels();
and then this to get to the required frame:
if(channels)
{
for each(var channel:AbstractChannel3D in channels)
{
channel.updateToFrame(currentFrame);
}
}
it seems that we no longer have that option available.
Do you have any advice as to how we should migrate legacy apps that have been created this way to use clips?
July 2nd, 2009 at 10:41 pm
Hi Javad,
You now need to do something like:
var channels : Array = dae.animation.channels;
if(channels)
{
for each(var channel:Channel3D in channels)
{
channel.update( timeInSeconds );
}
}
Note that animation is now time-based instead of frame-based.
You might need to update your apps accordingly.
Check out org.papervision3d.core.controller.AnimationController and the
org.papervision3d.core.animation.* package.
July 5th, 2009 at 6:20 pm
Hi Tim,
Great – using that approach I found that all I needed to do is to divide the frame number that I was using previously by the frame rate of the 3D model.
Given a framerate of 30 for the model if i want to go to frame 6 then my timeInSeconds becomes 6/30.
Overall performance is a lot better too.
Thanks a lot
Javad
July 16th, 2009 at 12:01 pm
Hi Tim, I notice that there were some changes regarding DAE Files with ShadedMaterials within the late revisions of Papervision 2.1
For example:
–
map.load(‘_assets/dae/map.dae’,new MaterialsList({all:new GouraudMaterial(light)}));
map.addEventListener(FileLoadEvent.LOAD_COMPLETE,function(event:FileLoadEvent):void
{
scene.addChild(mapa);
});
–
This works perfect till rev 910 for me… but from 911 I just get Wireframe Material as result. Could you tell me what changed regarding this kind of situation?
Thanks in advance
July 16th, 2009 at 4:50 pm
Hi Marcos,
My bad… will fix in the near future.
new MaterialsList( {all:….} ); doesn’t work with current revision.
You now need to lookup the elements in the COLLADA file and use their @id attribute (or, if not working the @name attribute).
Then use the thus found material-names as follows:
var materials:MaterialsList = new MaterialsList();
materials.addMaterial( myMaterial, myFoundName01 );
materials.addMaterial( myMaterial, myFoundName02 );
etc.
July 19th, 2009 at 9:34 pm
[...] information about PV3D 2.1 can be found in the blog posting by Tim Knip here http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/ Possibly related posts: (automatically generated)Augmented reality shooter shows the future of [...]
July 20th, 2009 at 5:40 pm
Hi,
this example doesn’t seem to build with PV cs4, wich i think is the lastest release. Do you have some tip to fix this problem??
therem isn’t md2.animation and AnimationController doesn’t exist.
Thanks for any help.
July 20th, 2009 at 10:06 pm
Hi Francisco,
Looks like you’re compiling with an old revision of PV3D.
You need to checkout the latest code from SVN trunk : http://code.google.com/p/papervision3d/source/checkout
Then point CS4′s classpath to the checked out source.
August 25th, 2009 at 1:07 pm
Hi Michel,
Your walking Demo is cool.
Can i have the source code ……
Thanks
September 30th, 2009 at 7:33 pm
I managed to control my animation with stop () and play (), I also like to do it through play (md2.animation.clipNames [currentClip]) but do not quite understand the concept of “Clip” in a 3D animation. My question is:
How to mount a 3D animation “Clip” from Blender or is everything in Papervision3D?
October 2nd, 2009 at 1:58 pm
Hi Tim,
I’m using your example and mostly works fine, except that I couldn’t stop the animation after it’s played 1 time (I don’t want it keep looping). Thanks for any suggestion or help.
Rgds,
October 2nd, 2009 at 3:24 pm
Hola para todos
Michel, observé tú trabajo y me gustó mucho:
¿Ahora quiero saber cómo le creas los Clips a la animación?
October 7th, 2009 at 4:47 pm
Hello there,
Great ressource, thx very much ! I do have a bit of a trouble thought. My texture won’t import correctly with the md2 file and it won’t import at all with the dae.
Evrything else is working. I’m using the qtip pro exporter for 3ds max 2010. Maybe i’m not doing it wright. Do you have any ideas ?
Thx so much.
October 9th, 2009 at 2:44 pm
Hi Tim,
Nice stuff there.
I’ve done a lil’ example of an animated CUBE but it seems that teh animation doesn’t work properly.
I’ve done it in C4D R11 with just an scale on X,Y,Z axis, exported as COLLADA, imported as DAE on my papervision file,but I only get the X (or Z) axis animated.
Have u (or somebody else) runned into the same problem?
Thanks
October 24th, 2009 at 6:17 am
Hi Tim.
I have found in testing md2 a problem ,in the clip replay will “jump frame”.
like this
md2.play(“run”);
Observe the animation, you will find this skipping problem(In your md2 example there is also the question)
November 19th, 2009 at 11:14 pm
i’m new to AS3 and papervision. I’ve been trying to use “_currentTime” in abstractChannel3D.as. i finally realized i was not loading “CS4″ pv3d (can i do this using CS3 without error?) i’m trying to get the current time from an animated .DAE, but i’m getting the following error at runtime: error DAE.as line 87 IAnimatable not found etc…
have you heard of this problem? i’ve wasted so much time on this any direction you can give me would be most helpful.
thanks for all this work; it’s truly awesome!
mm
November 19th, 2009 at 11:26 pm
actually the two errors are:
DAE.as at line 87
1045: Interface IAnimationProvider was not found.
November 21st, 2009 at 1:38 am
Hi Michael,
Think CS3 may still ref some old (pre-2.1) classes.
Please try “delete ASO files” in CS3 menu.
Anyways: for sure looks like your mixing 2 different revisions of PV3D
November 24th, 2009 at 8:21 pm
yes, i think you are right. there seems to be some PV3D base classes in my FLAR that the piece is referencing. when i remove them and try to load the CS4 PV3D flash throws many errors. i’ve run out of
i have most my project done, just need a few things to wrap it up. is there any one out there interested in helping me finish? here is the current state of things:
1. print marker: http://www.theredbuzz.com/arTest/Data/visionLogo.pdf
2.) go to: http://www.theredbuzz.com/arTest/
3.) wait for the message at the bottom to say “model loaded”.
4.) press “add video” on the bottom left menu
5.) allow webcam access
6.) hold marker in front of web cam
play with the buttons on the left to scrub various parts of model animation. these will be triggered by user marker movements etc…
thanks.
mm
November 28th, 2009 at 1:29 am
[...] http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/ [...]
December 5th, 2009 at 1:55 am
[...] http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/ [...]
February 6th, 2010 at 2:17 am
I’m having issues with my textures in papervision3d. Can you or someone you know help. Everything is working just the textures sometimes freak out. I’m exporting DAE from 3ds Max and loading externally into Papervision. the sample dae I have works fine. email me at jesse (dot) newsome (at) gmail
I can even paypal a few bucks for some help. I have my animations done I think i’m exporting them wrong or did them wrong from what i’m reading.
February 10th, 2010 at 4:10 pm
The DAE class sometimes has problems choosing the the correct UV “set” (there can be multiple UV sets in a COLLADA file). So if your textures look “weird” you can choose a specific UV set by using DAE#forceCoordSet = mySet. This will force the DAE to pick UV-set “mySet”. Where “mySet” is an integer in range [0 .. numSets].
February 21st, 2010 at 11:02 pm
Were transitions/interpolation ever added? I would really like to see this, as my character has many animations, but many of them don’t really ‘blend’. I’m using r932.
February 22nd, 2010 at 7:11 pm
Great work!
Just a little hint for all guys they try to get their armature animations – from Blender models – work:
Don’t make your armature parent of your object. Use a armature modifier instead and assign your armature as a modifier of your object.
Don’t use the modified translator.py from cast3d website. It won’t work for this dae-parser.
DAE-export settings:
* only export selection
* disable physics
* use relative paths
* use UV-Image Mats
works for me
February 23rd, 2010 at 12:12 am
addition:
But if you want to use the cast3d animation framework and convert your dae to x3c you have to use the translator.py.fix.
March 10th, 2010 at 4:54 am
Tim I’ve been trying you’re added animation controls which work great.. and saves us from manually alot of manual tweening.
But I’ve tried testing the morph animations and I am getting no animation displayed.
This is creating “Shape Keys” animation in Blender and exporting our DAE file.
There are no issues when trying to play a LocRot animation.
Exactly what type of morph animations does the DAE class handle when using Blender?
Thanks Tim.
March 10th, 2010 at 8:29 pm
Hi Rohan,
I’m not sure Blender exports “shape keys” to Collada.
If it does, I’m pretty sure the DAE class *can’t* handle it alas.
Best is to mail me (tim at floorplanner dot com) the blend file and / or collada so I can take a look.
Tim