Example #1
0
from DejaVu.Polylines import Polylines

from mglutil.hostappli import pdb_blender as bl
import Blender
import bpy
from Blender import *
from Blender.Mathutils import *
from Blender import Mesh
from Blender import Object
from Blender import Material
from Blender import Mathutils
from Blender import Window, Scene, Draw

bb=[[0, -400.0, -400.0], [400.0, 400.0, 400.0]]

sc = bl.getCurrentScene()
#display fill box
fbb = bl.box('fillpBB',cornerPoints=bb) #maybe /10.
bl.addObjectToScene(sc,fbb)
#fbb = Box('fillpBB', cornerPoints=bb, visible=1)
#vi.AddObject(fbb)

# create master for extra cellular compartment
# 
bg = bl.newEmpty('extra cellular')
orgaToMasterGeom = {}
g = Geom('extra cellular', visible=0)
orgaToMasterGeom[0] = g
orgaToMasterGeom[h1] = g
bl.addObjectToScene(sc,bg)
# display extra cellular spheres
from mglutil.hostappli import pdb_blender as bl
import Blender
import bpy
from Blender import *
from Blender.Mathutils import *
from Blender import Mesh
from Blender import Object
from Blender import Material
from Blender import Mathutils
from Blender import Window, Scene, Draw


scn = bl.getCurrentScene()

verts1 = []
radii1 = []
colors1 =[]
master = orgaToMasterGeom[h1]
print master

for pos, rot, ingr, ptInd in h1.molecules:
    level = ingr.maxLevel
    px = ingr.transformPoints(pos, rot, ingr.positions[level])
    for ii in range(len(ingr.radii[level])):
        verts1.append( px[level][ii] )
        radii1.append( ingr.radii[level][ii] *2.)
        colors1.append( ingr.color)

print len(verts1)
bg = bl.newEmpty('spheres')
Example #3
0
    You should have received a copy of the GNU General Public License
    along with ePMV.  If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
"""
# display extra cellular spheres
from mglutil.hostappli import pdb_blender as bl
import Blender
import bpy
from Blender import *
from Blender.Mathutils import *
from Blender import Mesh
from Blender import Object
from Blender import Material
from Blender import Mathutils
from Blender import Window, Scene, Draw

scn = bl.getCurrentScene()

verts1 = []
radii1 = []
colors1 = []
master = orgaToMasterGeom[h1]
print(master)

for pos, rot, ingr, ptInd in h1.molecules:
    level = ingr.maxLevel
    px = ingr.transformPoints(pos, rot, ingr.positions[level])
    for ii in range(len(ingr.radii[level])):
        verts1.append(px[level][ii])
        radii1.append(ingr.radii[level][ii] * 2.)
        colors1.append(ingr.color)