Example #1
0
def get_scene(scene):
    display.set(CONFIG[scene]['image'])
    toadd = [SCENE_PAGE_HEADER.format(scene)]
    for title in CONFIG[scene]['moods']:
        toadd.append(SCENE_PAGE_ELEMENT.format(title, scene))
    toadd.append(SCENE_PAGE_FOOTER)
    return ''.join(toadd)
Example #2
0
def get_scene(scene):
    display.set(CONFIG[scene]['image'])
    toadd = [SCENE_PAGE_HEADER.format(scene)]
    for title in CONFIG[scene]['moods']:
        toadd.append(SCENE_PAGE_ELEMENT.format(title, scene))
    toadd.append(SCENE_PAGE_FOOTER)
    return ''.join(toadd)
Example #3
0
def vmd_prepare_scene():
    """Change the lighting and background so it is the same for each image when rendering."""
    VMD.evaltcl("light 1 off")
    VMD.evaltcl("display shadows off")
    color_display = color.get_colormap("Display")
    color_display["Background"] = "white"
    color.set_colormap("Display", color_display)
    display.set(depthcue=0)
    display.update()
    display.update_ui()
Example #4
0
def vmd_render_scene(image_out,
                     image_size=[2000, 2000],
                     renderer="TachyonLOptiXInternal",
                     frame_idx=0):
    """
    Render the image using renderer with resolution image_size.
    """
    disp_default_size = display.get("size")
    # higher resolution
    display.set(size=image_size)
    display.update()
    display.update_ui()
    VMD.evaltcl("light 0 off")
    render.render(renderer, "{}.ppm".format(image_out))
    VMD.evaltcl("light 0 on")
    image = Image.open("{}.ppm".format(image_out))
    image.save("{}.png".format(image_out), format="PNG")
    #display.set(size=disp_default_size)
    display.update()
    display.update_ui()
    os.remove("{}.ppm".format(image_out))
Example #5
0
 def image2(self):
     display.set("assets/graves.png")
     return "ok"
Example #6
0
 def image(self):
     display.set("assets/forest.png")
     return "ok"
Example #7
0
    home)
#cbz_gaff2_lmpdat = "{}/Research/FORCE_FIELDS/AMBER/Molecules/CBZ_gaff2/4.2.test_MDs/Iteration_3-2/Iteration-3-2_best.lmpdat".format(home)
#cbz_gaff2_dcd    = "{}/Research/FORCE_FIELDS/AMBER/Molecules/CBZ_gaff2/4.2.test_MDs/Iteration_3-2/Iteration-3-2_best_in_vacuo.dcd".format(home)
#cbz_gaff_lmpdat  = "{}/Research/FORCE_FIELDS/AMBER/Molecules/CBZ_gaff2/4.2.test_MDs/Standard_gaff/CBZ.lmpdat".format(home)
#cbz_gaff_dcd     = "{}/Research/FORCE_FIELDS/AMBER/Molecules/CBZ_gaff2/4.2.test_MDs/Standard_gaff/Standard_gaff_in_vacuo.dcd".format(home)
cbz_gaff2_lmpdat = "{}/Research/PAPERS/2017_12/CBZ_FF-evaluation/results/average_structures/cbz_gaff2_average.lmpdat".format(
    home)
cbz_gaff_lmpdat = "{}/Research/PAPERS/2017_12/CBZ_FF-evaluation/results/average_structures/cbz_gaff_average.lmpdat".format(
    home)

# change the scene
VMD.evaltcl("display shadows off")
color_display = color.get_colormap("Display")
color_display["Background"] = "white"
color.set_colormap("Display", color_display)
display.set(depthcue=0)

# load mol and change its representation
# geometry optimized cbz
licor_style = "Licorice 0.1 50 50"
sel_no_h = "not element H"

if molecule.exists(0) != 1:
    molecule.load("xyz", cbz_gOpt)
    molrep.modrep(0,
                  0,
                  sel=sel_no_h,
                  style=licor_style,
                  material="AOChalky",
                  color="ColorID 7")
Example #8
0
 def image2(self):
     display.set("assets/graves.png")
     return "ok"
Example #9
0
 def image(self):
     display.set("assets/forest.png")
     return "ok"