schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.15k stars 275 forks source link

Volume in different states ignore assigned color ramps #289

Closed Finnem closed 1 year ago

Finnem commented 1 year ago

Hi! I ran into the following issue playing around with volumes: When using multiple states any volume but the volume at state 1 will be assigned a default color ramp and it seems impossible to change it.

cmd.volume_ramp_new("test1_ColorRamp", [\
    0.008676594531528439, 0.19215686274509805,0.21176470588235294,0.5843137254901961, 0.03,\
    0.14422443906344906, 0.9999231064975009,0.9976163014225298,0.7454056132256824, 0.005,\
    0.27977228359536965, 0.6470588235294118,0.0,0.14901960784313725, 0.1,\
])
cmd.volume("test1", "RegularData_0_density", "test1_ColorRamp",  state = 1)    

cmd.volume_ramp_new("test2_ColorRamp", [\
    0.008676594531528439, 0.19215686274509805,0.21176470588235294,0.5843137254901961, 0.03,\
    0.14422443906344906, 0.9999231064975009,0.9976163014225298,0.7454056132256824, 0.005,\
    0.27977228359536965, 0.6470588235294118,0.0,0.14901960784313725, 0.1,\
])
cmd.volume("test1", "RegularData_0_density", "test2_ColorRamp",  state = 2)

Results in the following: State 1: grafik State 2: grafik

The images should be the same (as test2_ColorRamp and test1_ColorRamp are the same) but they are obviously not. The color ramp can also not be changed in the UI (also not through the panel interface and not to default color ramps such as fofc).

The full code to produce this outcome: volume_test.zip

JarrettSJohnson commented 1 year ago

Thanks for the report. Let me know if this latest commit works for you.