Mayavi: saving to .wrl changes glyph color

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mayavi: saving to .wrl changes glyph color

Frédéric Vogt-3
Hi everyone,

I have an mlab.figure, in which I plot sequentially a set of white points, a set of colored cubes, a set of colored cones, a set of colored spheres (all with mlab.points3d), and finally, a set of black cylinders via mlab.plot3d. For the colored glyphs, I always specify the colorbar and the vmin/vmax range in the potting call.

Now for the bug: as soon as I save the view to a .wrl file, the color range of both the cubes and the cones change instantly and are not following the vmin/vmax values I set (both in the interactive window AND in the .wrl file). The white dots are still white, the black rods still black, and the colored spheres (the last set of colored points to be plotted) are still ok.

Has anyone encountered something like this before ?

Note that if I open the Mayavi pipeline (from the Mayavi scene window), all the color ranges look good - to revert back to what I want, I need to click on 'Use default range' (in the appropriate sub-menu), and then un-click it again - only this seems to refresh the view. So far, the same weird thing happens if I save in .oogl or in .iv format, but not in the .obj format !

Any suggestion appreciated - I'd be curious to know why saving my file to .wrl seems to toggle 'on' the 'Use default range' color mode ...

Cheers,
Frédéric

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi: saving to .wrl changes glyph color

Gael Varoquaux
On Mon, Sep 09, 2013 at 07:34:04PM -0400, Frédéric Vogt wrote:
> Has anyone encountered something like this before ?

I believe that this has indeed been reported before.

I had in mind that it was a VTK bug, but I am not completely convinced
how that would interact with the scalar range as you are describing. It
would be interesting to ask on the VTK mailing list.

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi: saving to .wrl changes glyph color

Frédéric Vogt-3
Hi Gaël,

Thanks for the suggestion - I'll try to see if anyone on the VTK side has any idea. For now, I'll most likely 'fix' this by (A) ensuring that all my color values are within the set range (and altering them if not), and (B) adding two points with the min and max values associated. That way, the 'default' scaling is the one I want, and the bug will have no effect. The drawback is that I need to add 2 'fake points' per datasets somewhere on my plot... not that elegant, but anyway ...

Cheers,
Frédéric


On 10/09/2013, at 2:26 AM, Gael Varoquaux wrote:

> On Mon, Sep 09, 2013 at 07:34:04PM -0400, Frédéric Vogt wrote:
>> Has anyone encountered something like this before ?
>
> I believe that this has indeed been reported before.
>
> I had in mind that it was a VTK bug, but I am not completely convinced
> how that would interact with the scalar range as you are describing. It
> would be interesting to ask on the VTK mailing list.
>
> Gaël
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev