entities.Ensemble

entities.Ensemble(file_path)

Attributes

Name Description
instance_collection The instances of the ensemble.
styles Get the styles in the tree.

Methods

Name Description
create_object Create a 3D object for the ensemble.
get_view Get the 3D bounding box of the entity object
set_frame Update the underlying data to correspond to changes in the scene frame.

create_object

entities.Ensemble.create_object(
    name='NewEnsemble',
    node_setup=True,
    world_scale=0.01,
    fraction=1.0,
    simplify=False,
)

Create a 3D object for the ensemble.

Parameters

Name Type Description Default
name str The name of the model, by default “NewEnsemble” 'NewEnsemble'
node_setup bool Whether to setup nodes for the data and instancing objects, by default True True
world_scale float Scaling transform for the coordinates before loading in to Blender, by default 0.01 0.01
fraction float The fraction of the instances to display on loading. Reducing can help with performance, by default 1.0 1.0
simplify bool Whether to instance the given models or simplify them for debugging and performance, by default False False

Notes

Creates a data object which stores all of the required instancing information. If there are molecules to be instanced, they are also created in their own data collection.

get_view

entities.Ensemble.get_view()

Get the 3D bounding box of the entity object

set_frame

entities.Ensemble.set_frame(frame)

Update the underlying data to correspond to changes in the scene frame.

This method should be implemented by subclasses to update the entity’s data based on the given frame number. This can include updating positions and performing other necessary calculations.

Args: frame (int): The frame number to update the entity’s data to.

Raises: NotImplementedError: If the method is not implemented by a subclass.