Changes between Version 2 and Version 3 of ChimeraAnimationState


Ignore:
Timestamp:
Dec 22, 2010, 1:06:57 PM (15 years ago)
Author:
Darren Weber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ChimeraAnimationState

    v2 v3  
    3232The savepos/reset functionality works with a tuple:
    3333{{{
     34#!python
    3435#
    3536# savepos returns a tuple of various parameters (my comments added)
    3637#
    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 
     38return (
     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
     55Options 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
    5163
    5264
     
    5567Something like this gains access to a lot of view parameters:
    5668{{{
     69#!python
    5770for n in dir(chimera.viewer):
    5871    print n, eval('type(chimera.viewer.%s)' % n)
     
    6780From the [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/faq.html FAQ], item (7): Some attributes return a copy of an object.
    6881{{{
     82#!python
    6983>>> xf = model.openState.xform  # xf is a copy of the model's Xform matrix.
    7084>>> xf.zRotate(45)              # This will not rotate the model.
     
    86100Get a PDB molecule to play with:
    87101{{{
     102#!python
    88103chimera.runCommand('open 2por')
    89104om = chimera.openModels.list(all=True)
     
    93108Exploring color properties:
    94109{{{
     110#!python
    95111>>> por2.color
    96112<_chimera.MaterialColor object at 0x3d50dc8>
     
    109125Chimera material attributes are collected with color attributes.
    110126{{{
     127#!python
    111128# chimera.Material object
    112129>>> por2.color.material
     
    141158
    142159{{{
     160#!python
    143161#
    144162# Working with a specific active model:
     
    178196
    179197{{{
     198#!python
    180199
    181200>>> dir(model_openState.xform)