Subclassing DirectFrame and using getTightBounds()

Hi there,

Two issues, not sure if I’m doing something wrong or have misunderstood how things work.

If I subclass DirectFrame, objects aren’t drawn.

class Test(DirectFrame): pass

a = Test(frameSize=(-1,1,-1,1), frameColor=(0,0,1,1), pos=(1,-1,-1))
b = DirectFrame(frameSize=(-1,1,-1,1), frameColor=(1,0,0,1), pos=(1,-1,1))

Only shows the red frame (the one that isn’t subclassed). Why is this?

Using getTightBounds() or getBounds() always returns 0

print b.getTightBounds()
print b.getBounds()

(Point3(0, 0, 0), Point3(0, 0, 0))
[0.0, 0.0, 0.0, 0.0]

How can I effectively get the frame’s boundaries?

Thanks in advance :slight_smile:


Hi, welcome to the forums!

This thread should answer your question:
[Issues with inheritance)

Many thanks :slight_smile:
Issue 1 solved with ninja trick.

Any hints for issue 2?

You can try b[‘frameSize’] to return the specified size of the DirectFrame. But if it’s returning 0 for bounds, it may in fact be empty.