Shows how to switch between different render modes and explains some of the rendermode parameters.
scene.RemoveAll()
eh=io.LoadPDB("data/sdh.pdb")
sdh_go=gfx.Entity("SDH2", eh.Select("cname=A"))
scene.Add(sdh_go)
scene.CenterOn(sdh_go)
def Tube():
sdh_go.SetRenderMode(gfx.TUBE)
sdh_go.tube_options.SetTubeRadius(0.8)
sdh_go.ColorBy("abfac",gfx.BLUE,gfx.RED)
sdh_go.RadiusBy("abfac",0.8,2.2)
def Trace():
sdh_go.SetRenderMode(gfx.LINE_TRACE)
sdh_go.GetOptions(gfx.LINE_TRACE).SetLineWidth(2.5)
def Spheres():
sdh_go.SetRenderMode(gfx.CPK)
sdh_go.GetOptions(gfx.CPK).SetSphereDetail(4)
def Cartoon():
sdh_go.SetRenderMode(gfx.RenderMode.HSC)
sdh_go.SetColor(gfx.Color(0.5, 0.5, 0.5), '')
sdh_go.SetColor(gfx.Color(0,1,0),"rtype=H")
sdh_go.SetDetailColor(gfx.Color(0.7,1.0,0.8),"rtype=H")
sdh_go.SetColor(gfx.Color(1,0,0),"rtype=E")
sdh_go.SetDetailColor(gfx.Color(1.0,0.8,0.2),"rtype=E")
Cartoon()