[Papervision3D] Bug in DisplayObject3D::updateMaterials - Papervision3D Public Beta 2.0 - Great White (September 9th, 2008)

Marc Bauer nesium at gmail.com
Thu Dec 4 01:41:25 PST 2008


since it seems, that my message never was received by the list, i resend the
original ...

i think i've come across in the specified method. i'm trying to replace the
material for the top side of a cube. the material which i try to insert is a
compositematerial with a bitmapmaterial and a flatshadermaterial in it.
after doing this i get the following exception:

TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at
org.papervision3d.materials.shadematerials::FlatShadeMaterial/drawTriangle()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/materials/shadematerials/FlatShadeMaterial.as:44]
    at
org.papervision3d.materials.special::CompositeMaterial/drawTriangle()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/materials/special/CompositeMaterial.as:66]
    at
org.papervision3d.core.render.command::RenderTriangle/render()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/core/render/command/RenderTriangle.as:78]
    at
org.papervision3d.render::BasicRenderEngine/doRender()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/render/BasicRenderEngine.as:256]
    at
org.papervision3d.render::BasicRenderEngine/renderScene()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/render/BasicRenderEngine.as:168]
    at
org.papervision3d.view::AbstractView/onRenderTick()[/Users/marc/Desktop/RSFPrototype/client/lib/pv3d/org/papervision3d/view/AbstractView.as:55]


the problem seems to be in this if-clause:

// register shaded materials with its object
if(true || newMaterial is AbstractLightShadeMaterial || newMaterial is
ShadedMaterial)
{
       newMaterial.registerObject(do3d);
}

so it seems to me (without knowing the exact internals) that a
shadedmaterial always needs to have registered the display object for which
it's used. in my case i have this compositematerial, which is neither a
AbstractLightShadeMaterial nor a ShadedMaterial.
CompositeMaterial::registerObject would call registerObject for all it's
contained materials, which i need for the flatshadedmaterial contained in
the compositematerial. so, removing the condition fixed the problem for me.


cheers,
marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20081204/5ba3255d/attachment.html>


More information about the Papervision3D mailing list