session.MNSession
session.MNSession()Attributes
| Name | Description |
|---|---|
| n_items | The number of items being tracked by this session. |
Methods
| Name | Description |
|---|---|
| clear | Remove references to all molecules, trajectories and ensembles. |
| get_object | Try and get an object from Blender’s object database that matches the uuid given. |
| prune | Remove any session entities whose Blender object no longer exists. |
| register_entity | Add entity to the session, keyed by its uuid. |
| remove | Remove an entity by uuid, along with the objects backing it. |
| remove_entity | Remove entity from the session. |
clear
session.MNSession.clear()Remove references to all molecules, trajectories and ensembles.
get_object
session.MNSession.get_object(uuid)Try and get an object from Blender’s object database that matches the uuid given.
If nothing is be found to match, return None.
prune
session.MNSession.prune()Remove any session entities whose Blender object no longer exists.
register_entity
session.MNSession.register_entity(item)Add entity to the session, keyed by its uuid.
remove
session.MNSession.remove(uuid)Remove an entity by uuid, along with the objects backing it.
An entity whose object has already been deleted - from the outliner, or with bpy.data.objects.remove() - is still dropped from the session rather than raising, so that removing is always safe to call.
remove_entity
session.MNSession.remove_entity(uuid)Remove entity from the session.