Changes between Version 2 and Version 3 of ChimeraAnimationState
- Timestamp:
- Dec 22, 2010, 1:06:57 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChimeraAnimationState
v2 v3 32 32 The savepos/reset functionality works with a tuple: 33 33 {{{ 34 #!python 34 35 # 35 36 # savepos returns a tuple of various parameters (my comments added) 36 37 # 37 return ( 38 chimera.viewer.scaleFactor, #cam 39 chimera.viewer.viewSize, #cam 40 cam.center, #cam 41 cam.nearFar, #cam 42 cam.focal, #cam 43 xforms, # spatial/geometry 44 clips, # per-model clipping 45 chimera.openModels.cofrMethod, # spatial/geometry 46 cofr, # spatial/geometry 47 chimera.viewer.clipping #cam 48 ) 49 }}} 50 38 return ( 39 chimera.viewer.scaleFactor, #cam 40 chimera.viewer.viewSize, #cam 41 cam.center, #cam 42 cam.nearFar, #cam 43 cam.focal, #cam 44 xforms, # spatial/geometry 45 clips, # per-model clipping 46 chimera.openModels.cofrMethod, # spatial/geometry 47 cofr, # spatial/geometry 48 chimera.viewer.clipping #cam 49 ) 50 }}} 51 52 53 == State Parameters: Saving Immutable State == 54 55 Options for saving state: 56 57 1. incremental diff for sequential key-frames 58 2. saving immutable openModels.list() 59 a. saving to RAM 60 b. saving to disk (pickle, sqlite, etc.) 61 c. optimization issues (threading) 62 d. see http://docs.python.org/library/persistence.html 51 63 52 64 … … 55 67 Something like this gains access to a lot of view parameters: 56 68 {{{ 69 #!python 57 70 for n in dir(chimera.viewer): 58 71 print n, eval('type(chimera.viewer.%s)' % n) … … 67 80 From the [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html FAQ], item (7): Some attributes return a copy of an object. 68 81 {{{ 82 #!python 69 83 >>> xf = model.openState.xform # xf is a copy of the model's Xform matrix. 70 84 >>> xf.zRotate(45) # This will not rotate the model. … … 86 100 Get a PDB molecule to play with: 87 101 {{{ 102 #!python 88 103 chimera.runCommand('open 2por') 89 104 om = chimera.openModels.list(all=True) … … 93 108 Exploring color properties: 94 109 {{{ 110 #!python 95 111 >>> por2.color 96 112 <_chimera.MaterialColor object at 0x3d50dc8> … … 109 125 Chimera material attributes are collected with color attributes. 110 126 {{{ 127 #!python 111 128 # chimera.Material object 112 129 >>> por2.color.material … … 141 158 142 159 {{{ 160 #!python 143 161 # 144 162 # Working with a specific active model: … … 178 196 179 197 {{{ 198 #!python 180 199 181 200 >>> dir(model_openState.xform)
![[Chimera Issue Tracking System]](/trac/chimera/chrome/site/chimera_logo.png)