1.5.1 : NodePath.flattenLight

Prof. Yelon, it seems that your new make_consistent_state doesn’t consider this case :

def createIntersectionMarker():
    # create intersection marker
    length=.16
    offset=.015
    color=(0,0,0,0)
    cornerColor=(0,0,0,1)
    intersectionMarker = aspect2d.attachNewNode('')
    axis=intersectionMarker.attachNewNode('')
    axisGeomDum=axis.attachNewNode('')
    axisGeomDum.attachNewNode( createLshape(
       length,color,cornerColor,thickness=4)).setPos(offset,0,offset)
    #__________
    length+=.02
    color=(.5,.5,.5,0)
    cornerColor=(1,0,0,1)
    axisGeomDum=axis.attachNewNode('')
    axisGeomDum.attachNewNode( createLshape(
       length,color,cornerColor,thickness=2)).setPos(offset,0,offset)
    ############################################################################
    intersectionMarker.flattenLight()#   <-------------------- CRAZYNESS
    ############################################################################
    intersectionMarker.setTransparency(1)

def createLshape(length=1, color=(0,0,0,1), cornerColor=None, thickness=1):
    LS=LineSegs()
    LS.setColor(*color)
    LS.setThickness(thickness)
    LS.moveTo(0,0,length)
    LS.drawTo(0,0,0)
    LS.drawTo(length,0,0)
    node=LS.create()
    if cornerColor:
       LS.setVertexColor(1,*cornerColor)
    return node

createIntersectionMarker()

That does, indeed, create crazyness. I’ll see if I can debug it.

PS. Thank you for including a runnable sample. I wish it was this easy every time!

OK, I found the bug. Recently, we made a change to how ColorAttrib works. We tried to make this change consistently throughout the codebase, but we missed a few places. In particular, we missed a place in class LineSegs.

I’ve checked a fix into CVS, but I’m not going to release a new panda version today. Instead, here’s a temporary workaround: always put a ColorAttrib onto any node created by the LineSegs class, like this:

node = LS.create()
node.setAttrib(ColorAttrib.makeVertex())

To all of those who might search the forums and find this answer: this temporary workaround only relevant until about May 20, 2008.

GREAT news !
Thank you. :smiley:

This doesn’t seem to be fixed yet in 1.5.3

Right. It is in CVS, but it either wasn’t yet tagged for 1.5.3, or it was checked in after 1.5.3 had been tagged.
Most likely, this change will get picked up in the next release.

panda3d.cvs.sourceforge.net/pand … x?view=log