Using C++, R23. I've got an ObjectData plugin that represents a volume in the viewport.
One of the representations is a velocity field, which is just a bunch of lines with colors.
I'm inserting a LineObject in GetVirtualObjects() to do the job, and it is being generated and working as expected, but I'm not sure how to pass my custom colors.
Is there something like the VertexColorTag for a PolygonObject or an alternative routine?
alternative: don't use LineObject. Draw a bunch of colorful lines in Draw()
Hey @PluginStudent, yeah that's an alternative but I want to avoid overriding Draw() unless there's no other way.
thank you for reaching out to us. Generally speaking there is no vertex-color-like feature for LineObject or SplineObject. It depends a bit on what you are trying to do (regarding scale of drawing operations) what could be considered to be the "best" solution for your problem.
For option No. 2 you have a few sub-options:
n <= 128 LineObject
As I said in the beginning, there are no direct solutions for your problem (to my knowledge), but hopefully these options can give you an idea on how to proceed.
@ferdinand thank you for the suggestions, totally forgot to write back.
Grouping the LineObject objects by a few shades worked out pretty well.
Hey I recently noticed that when I get over 2 million points and 1 million segments the viewport freezes. The UI is still responsive so I can reduce the lines in my object and it starts drawing in the viewport again.
So I'm wondering if this is expected for this amount of points and segments? I haven't found anything that is obviously wrong in my implementation yet.
thank you for reaching out to us. I can reproduce your problem and this would have not been something which we would have expected. If you go significantly over one million segments (1.1 million still works for me for example) no matter if in one node or scattered over multiple nodes, the viewport will freeze.
It is a bit hard to assess for us at the moment if this a bug or just a limitation of our viewport API. We will investigate the problem and I will report back here if there are going to be any short or mid-term fixes for that (or not if this is a limitation). For now there is unfortunately nothing you can do, since spreading out the segments over multiple nodes won't help you.
Sorry for the inconvenience and cheers,