I would try leaving the MovieMaterial with autoUpdate = false - in theory
this should trigger update() once on view.render() and copy the contents to
_renderBitmap, then only again if you set autoUpdate to true or call update
manually. If this doesn't work, try setting autopUpdate to true by default,
then false after the first view.render(). should do the trick

Rob


On Tue, Feb 2, 2010 at 1:50 PM, Post Mesteren <[email protected]> wrote:

> Hello, I'm having issues with MovieMaterials with autoUpdate = false,
> especially wrt calling update() on the MovieMaterial instance before
> being rendered. I.e.,
>  1. Create a Sprite with some contents
>  2. Create a new MovieMaterial(contentSprite, {autoUpdate:false,
> transparent:false})
>  3. Assign material to some object but don't add the object to the scene
> yet
>  4. Call .update() on the moviematerial
>
> The material is rendered all black.
>
> I think this happens because the "movie" is only ever rendered by update()
> if the _renderBitmap is non-null, but it's null before any calls to
> view.render().
>
> What do you think about the following patch, which seems to make things
> work out nicely?
>
> Index: src/away3d/materials/MovieMaterial.as
> ===================================================================
> --- src/away3d/materials/MovieMaterial.as       (revision 2164)
> +++ src/away3d/materials/MovieMaterial.as       (working copy)
> @@ -158,7 +158,7 @@
>         {
>                super.updateMaterial(source, view);
>
> -               if (autoUpdate)
> +               if (autoUpdate || !rendered)
>                 update();
>
>             _session = source.session;
>
>


-- 
Rob Bateman
Flash Development & Consultancy

[email protected]
www.infiniteturtles.co.uk
www.away3d.com

Reply via email to