schrodinger / pymol-open-source

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

cmd.png cannot inherit the result of cmd.ray for image output #281

Closed SynchronyML closed 1 year ago

SynchronyML commented 1 year ago

My PyMOL version is 2.5.0. In the operation of my drawing, I found that the same command is valid in the GUI mode terminal, but it wasinvalid in the cmd script. This bothers me a lot.

The command in the GUI terminal is: ray; png test_tets.png The script command of cmd is: cmd.ray(); cmd.png('test_test.png',width=2000, height=2000,dpi=800)

Below is the script I am trying to run with all and only required pdb files

`from pymol import cmd

protein = '5tbm.txt' cmd.load(protein, "protein_tmp")

cmd.color('slate','(name C*)') # cmd.set('ray_trace_gain',1) cmd.set('ambient',1) cmd.set('reflect',0.8) # #default 0.5 cmd.set('direct',1)
cmd.set('spec_direct',0)
cmd.set('light_count',8) cmd.set('edit_light',5)
cmd.set('shininess',0)
cmd.set('specular',0)
cmd.set('specular_intensity',0)

cmd.set('')

cmd.ray(width=800, height=800) # cmd.ray(int width,int height,int renderer=-1,float shift=0) cmd.png('test_test.png') `

pdb file as below 5tbm.txt

SynchronyML commented 1 year ago

Sorry, the markdown format transmission of test.py is wrong, I will re-upload the txt file test.txt

JarrettSJohnson commented 1 year ago

Can you elaborate on what's invalid? Do you get an error message or incorrect rendering? On my end, it seemed to have produced the expected image.

SynchronyML commented 1 year ago

I'm sorry to disturb you. I was sick yesterday, my carelessness caused my mistake. I revisited today and found it ok

JarrettSJohnson commented 1 year ago

No worries. Hope you feel better!