[Papervision3D] Displaying a preloader for a Collada (.DAE) file
Admiral
admiral at nuclearpixel.com
Thu Sep 2 21:05:58 PDT 2010
Pardon, what?
In the message that you just sent to me, there are so many chains of
conversation going that I have lost track of any original message you
might have meant to send to me.
Can you please clarify?
Talk with you soon,
-Admiral
On Sep 2, 2010, at 9:54 PM, amandak695 [via Papervision3D] wrote:
>
> Admiral wrote:
> I am very interested in learning about how you would go about
> applying a callback function to a material that already exists on a
> DAE. Does anyone know how you would go about using
> BitmapFileMaterial.callback?
>
> As it is in my scene, I have a function that I call when a DAE has
> completed loading, and I apply it like this:
>
> <pre>
> package {
>
> //...import everything...
>
> public class myScene extends Sprite {
>
> //...set up all my variables, camera, scene,
> viewport...
> var model = new DAE();
>
> public function myScene(){
> //...position the camera, add the viewport,
> all of that...
>
>
> model.addEventListener(FileLoadEvent.ANIMATIONS_COMPLETE,
> daeLoadHandler);
> model.load('model.dae');
>
> addEventListener(Event.ENTER_FRAME, loop);
> }
>
> //...define the loop function, make it render...
>
> public function daeLoadHandler(event:Event){
> var daeInstance = event.target;
> for (var matName:String in
> daeInstance.materials.materialsByName) {
> var daeMat:MaterialObject3D =
> daeInstance.materials.materialsByName[ matName ];
> daeMat.callback = callbackFunction;
> }
> }
>
> public function callbackFunction(event:Event){
> //...make my preloader animation go away...
> }
>
> }
> }
> </pre>
>
> My code breaks at the bolded line above; I'm not sure how to use
> 'callback'. Any ideas, anyone?
>
> For the longest time, I had been battling with the issue of not
> being able to display a progress bar for the percent loaded of all
> of the DAE files I was pulling into my scenes. Now that I've got
> that figured out, it seems that my next challenge is to find a way
> to find out the download progress of all of the bitmap files that
> belong to the materials that come on those DAEs by default... I
> really don't want to have to spend the time to put those materials
> on my DAEs in my 3D app just to have to assign them to the model
> again in my actionscript.
>
> I think it would be the greatest thing since sliced bread if someone
> could find a way to return an overall download progress percentage
> from an array of assets they want loaded.
>
> Eric-Paul Lecluse, thank you for bringing to my attention the
> 'callback' property and 'COLLADA_MATERIALS_DONE' event.
>
> Has anyone been able to make any use of the 'COLLADA_MATERIALS_DONE'
> event? Might you be kind enough to post a quick example of how to
> use it?
>
> -Admiral
>
>
>
>
> Eric-Paul Lecluse wrote:
> Hey Tim,
>
> The ProgressEvent.PROGRESS works great for the DAE/XML, but not for
> possible bitmap textures that are loaded in automatically. The Collada
> class used the FileLoadEvent.COLLADA_MATERIALS_DONE, but this seems to
> be unimplemented in the DAE.
>
> Now, there is the static BitmapFileMaterial.callback
> <http://lostboys.epologee.net/papervision/greatwhite.doc/html/org_paperv
> ision3d_materials_BitmapFileMaterial.html#callback> , to which you
> could
> assign a method that's triggered when all bitmap loading has finished.
> But I'm not sure if you want us abusing that property instead of maybe
> listening to an event of a kind.
>
> What's your advice?
>
> Cheers,
> Eric-Paul.
>
>
> -----Original Message-----
> On Behalf Of Tim Knip
> Subject: Re: [Papervision3D] Displaying a preloader for a Collada
> (.DAE) file
>
> dae = new DAE();
> dae.addEventListener( ProgressEvent.PROGRESS, myLoadHandler );
> dae.load( "myfile.DAE" );
>
> Tim
> 2007/12/25, garion1 <rowan at simplicit.co.za>:
>
> >
> > Can someone please explain how to display a preloader for a .dae
> file.
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> Thanks you for the post.
> http://moviesonlineworld.com
>
>
> View message @ http://papervision3d.758870.n4.nabble.com/Displaying-a-preloader-for-a-Collada-DAE-file-tp782807p2525082.html
> To unsubscribe from Re: Displaying a preloader for a Collada (.DAE)
> file, click here.
>
--
View this message in context: http://papervision3d.758870.n4.nabble.com/Displaying-a-preloader-for-a-Collada-DAE-file-tp782807p2525091.html
Sent from the Papervision3D mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20100902/3a5c3e6c/attachment.html>
More information about the Papervision3D
mailing list