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();
}
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…
thanks for this – you saved me considerable time today… not to mention hair and fingernails
you rock, thank-you!
You saved my day ! Thanks a lot, it now works like a charm.