— Shang Liang

MovieMaterial updateBitmap Bug In Papervision3D 2.0 GreatWhite

In latest PV3D 2.0 (GreatWhite) revision, MovieMateiral and MovieAssetMateiral’s updateBitmap function is broken. The problem is that updateBitmap function is actually an empty function. The class hierarchy goes like this: MovieAssetMaterial -> MovieMateiral -> BitmapMaterial -> TriangleMaterial -> MaterialObject3D. updateBitmap is defined in MaterialObject3D as an empty function and it was never overridden along the path.

If you are not patient to wait for their next release, the problem can be solved by putting PV3D1.7 updateBitmap function back into the MovieMaterial class.

public override function updateBitmap():void
{
	// using int is much faster than using Math.floor. And casting the variable saves in speed from having the avm decide what to cast it as
	var mWidth:int = int(movie.width);
	var mHeight:int = int(movie.height);    

	if( allowAutoResize && ( mWidth != bitmap.width || mHeight != bitmap.height ) )
	{
		// Init new bitmap size
		initBitmap( movie );
	}

	drawBitmap();
 }

4 comments
  1. sonicoliver says: November 3, 200812:10 am

    another way is to simply enable the animated property, then disable it again… that’s what I’m doing, I don’t know if updateBitmap() is depreciated. It would be better, I don’t know why it’s not included…

  2. Michael says: November 4, 20089:37 pm

    thanks for this – you saved me considerable time today… not to mention hair and fingernails :)

  3. oliver says: November 14, 20089:24 pm

    you rock, thank-you!

  4. iwantjelly says: August 31, 200910:44 am

    You saved my day ! Thanks a lot, it now works like a charm.

Submit comment

For spam filtering purposes, please copy the number 6041 to the field below: