I've been trying to update the color of a GLMeshItem in a 3d pyqtgraph plot with some success. Using the setColor()
member of the GLMeshItem class, I can set the color initially, and sometimes, the face color of the mesh will update, but not always.
I've had this working in the past, so I know it is possible to do, but can't seem to figure it out this time. According to the documentation, setColor()
will Set the default color to use when no vertex or face colors are specified.
I'm a bit confused as to whether this means I can dynamically change colors, or only set the color initially.
For context, I have a 3d plot with a mesh in it. I read date from a file, then want to set the color of the mesh based on that data. I can post more code if needed, but my program is several hundred lines long and would be tricky to extract the necessary bits to make to problem reproducible. If it would help I can definitely do that however. For now here is the line I am using to set the color:
_mesh_model is a GLMeshItem.
Color is a tuple of the form (R, G, B, Alpha)
self._mesh_model.setColor(color)
question from:
https://stackoverflow.com/questions/65875040/updating-the-color-of-a-glmeshitem 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…