Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/source/autosummary/ggmolvis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

analysis
base
camera
data
ggmolvis
light
properties
renderer
sceneobjects
utils
world
16 changes: 0 additions & 16 deletions docs/source/autosummary/ggmolvis.world.rst

This file was deleted.

512 changes: 401 additions & 111 deletions examples/ggmolvis_basic.ipynb

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions ggmolvis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Molecular visualization with Blender
"""

import sys
import os
import shutil
import tempfile
Expand All @@ -15,6 +16,11 @@
import atexit

from loguru import logger
logger.remove()
logger.add(
sink=sys.stderr,
level="INFO",
format="<level>{level}</level> | <level>{message}</level>")

__version__ = version("ggmolvis")

Expand Down
4 changes: 0 additions & 4 deletions ggmolvis/analysis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def _update_frame(self, frame):
# TODO: Implement this method
pass

@property
def camera_world(self):
return self._camera_world

def render(self, **kwargs):
# set the render movie end frame to the number of frames in the trajectory
bpy.context.scene.frame_end = self.analysis.atomgroup.universe.trajectory.n_frames
Expand Down
10 changes: 8 additions & 2 deletions ggmolvis/analysis/rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ def _visualize(self):
return self

@property
def camera_world(self):
return self.mobile_mol.camera_world
def _view_location(self):
"""Get the view location for the camera"""
return self.mobile_mol._view_location

@property
def _view_rotation(self):
"""Get the view rotation for the camera"""
return self.mobile_mol._view_rotation

@property
def _camera_view_active(self):
Expand Down
57 changes: 1 addition & 56 deletions ggmolvis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Union

from . import SESSION
from .delegated_property import DelegatedProperty

class GGMolvisArtist(ABC):
"""Abstract class for all visualizations in GGMolVis.
Expand All @@ -30,33 +31,17 @@ class GGMolvisArtist(ABC):
The scale of the object in the world. It is different
from the scale in Blender as it is directly applied to
the coordinates of the object. Default is 0.01
visible: bool
Visibility of the object. Default is True
z_order: int
Z-order of the object. The object with higher z-order
will be rendered on top of the object with lower z-order. Default is 0
session: MNSession
The linked `MNSession` object in molecularnodes package
ggmolvis: set
The set of all `GGMolvisArtist` objects in the session
subframes: int
Number of subframes to render. It will be a global setting
for all objects. Default is 0. For clarity, when subframes is set to `1`
the total frame count will double, and when it is set to `2` the
total frame count will triple.
average: int
Number of flanking frames to average over--this can help reduce
"jittering" in movies. In contrast to `subframes`, no new frames
are added. It will be a global setting for all objects. Default is 0.
"""
def __init__(self):
# only one MNSession will be used to keep everything in sync.
self._session = SESSION

# default world_scale value used in Molecular Node
self._world_scale = 0.01
self._visible = True
self._z_order = 0
self._name = self.__class__.__name__

#
Expand Down Expand Up @@ -85,34 +70,10 @@ def world_scale(self):
def world_scale(self, value):
self._world_scale = value

@property
def visible(self):
return self._visible

@visible.setter
def visible(self, value):
self._visible = value

@property
def z_order(self):
return self._z_order

@z_order.setter
def z_order(self, value):
self._z_order = value

@property
def session(self):
return self._session

def set_visible(self):
"""Set the object to be visible"""
self._visible = True

def set_invisible(self):
"""Set the object to be invisible"""
self._visible = False

@abstractmethod
def _update_frame(self, frame):
"""Abstract method to update the object's state for the given frame"""
Expand All @@ -122,22 +83,6 @@ def _update_frame(self, frame):
def ggmolvis(self):
return self.session.ggmolvis

@property
def subframes(self):
return self.ggmolvis.subframes

@subframes.setter
def subframes(self, value):
self.ggmolvis.subframes = value

@property
def average(self):
return self.ggmolvis.average

@average.setter
def average(self, value):
self.ggmolvis.average = value

def _remove(self):
"""Remove the object from the session"""
self.session._ggmolvis.remove(self)
Expand Down
136 changes: 0 additions & 136 deletions ggmolvis/camera.py

This file was deleted.

Loading
Loading