LineSegs setColor

Hey all,

While trying to create my gizmos I’m coming up against a problem I don’t fully understand. Parts of the gizmo are poly based and created with GeomVertexData, some are lines create with lineSegs.

It seems however that a node path created from lineSegs doesn’t want to change colour with setColor, whereas a bunch of polys created with GeomVertexData will. This has led me to derive the NodePath class with custom setColor methods to go through and individually change the colours of the vertices that make up the lineSegs.

All seems to work until I try and reparent my custom nodePath. Sometimes calling ‘type( customPath )’ after reparenting shows the correct custom class, sometimes it shows the default Panda NodePath class. I can only assume that during reparenting the custom nodePath is rendered obsolete and a new (default) one is created in its place.

If the above is correct, how should I go about creating classes for primitive data, including lineSegs? Has anyone encountered this thing before?

Cheers!

Use priority override, or use setColorScale.

Worked like a charm. Thanks!!

Hi

Did you try to call setColor on the LineSeg node itself ?
That’s what I do in C++ and it works, I don’t call set_color on the NodePath