Warning: Calling TGLSceneShape.UnAssociateNode

My class inherited from TCastleAbstractPrimitive.
As geometry, I use FGeometry: TIndexedTriangleSetNode.
I am changing texture coordinates to my FGeometry.TexCoord:= FTextureCoordinate.
Everything works fine, but when I close the program, I get the “Warning: Calling TGLSceneShape.UnAssociateNode on X3D node that is already not associated with anything: TextureCoordinate. This can happen when you manually change nodes.” warning. What it affects and how to avoid it?

It’s a bug in CGE. The engine automatically manages internal associations between nodes and TGLSceneShape instances (for speed), and it seems it fails in this case, at finalization. You should never see this warning :slight_smile:

If you can provide a testcase to reproduce that would be much appreciated.

TestExamle.zip (137.5 KB)
The warning occurs after the program is closed.

Thank you very much, I didn’t yet fix it but I confirm I can reproduce the bug with your code. Added to automatic tests in Testcase for error "TGLSceneShape.UnAssociateNode on X3D node that is · castle-engine/[email protected] · GitHub (added in a branch unassociate-bug → and, correctly, testing that branch fails now).

Will let here know when it’s fixed :slight_smile:

Fixed (in this commit: Move associated shape when changing TexCoord of geometry node · castle-engine/[email protected] · GitHub ). As usual, Jenkins will build a new CGE version to download from Download | Castle Game Engine with this fix in 6-8 hours.

Thanks for reporting!

1 Like