Page 2 of 2

Re: help scripting to export figures as jpg...

Posted: Tue May 19, 2015 10:10 am
by riviere
Hi Sylvain,
Negative color values are not valid, I'm not sure what it will do... For fusions the "neutral" color is normally white (100, 100, 100).
To have transparency, you can specify RGBA colors, with 4 values, the 4th being opacity, and use the option color_mode='RGBA' in setColors:

Code: Select all

p.setColors(colors=[100,0,0, 50]*20+[0,100,0, 80]*20+[0,0,100, 100]*20, color_mode='RGBA')
Denis

Re: help scripting to export figures as jpg...

Posted: Tue May 19, 2015 3:52 pm
by SylvainT
riviere wrote:Hi Sylvain,
Negative color values are not valid, I'm not sure what it will do... For fusions the "neutral" color is normally white (100, 100, 100).
To have transparency, you can specify RGBA colors, with 4 values, the 4th being opacity, and use the option color_mode='RGBA' in setColors:

Code: Select all

p.setColors(colors=[100,0,0, 50]*20+[0,100,0, 80]*20+[0,0,100, 100]*20, color_mode='RGBA')
Denis
Thanks Denis!

But that does not seem to do what I'm looking for... I think it's because I'm working with a fusion object (a textured mesh)... What I'd like to have is this:
- for some value of the texture, the mesh is visible (and let's say, it's all red)
- for some other value of the texture, the mesh is invisible (transparant)

I've just played with the opacity of the mesh and the color palette of the texture (as you described), but I cannot find a combination that does what I want properly... Any idea?

Cheers,

Sylvain

Re: help scripting to export figures as jpg...

Posted: Tue May 19, 2015 5:21 pm
by riviere
Hi,
It's because the default texture mapping mode is modulating the mesh color with the texture color, not replacing it.
Try setting the fusion texturing mode to replace mode:

Code: Select all

a.execute('TexturingParams', objects=[fusion], mode='replace')
Denis