예제 #1
0
def modify_delete_index(collection_name, index, batoms = None):
    # Modify atom scale (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    print('Delete atoms')
    batoms.delete(index)
예제 #2
0
def modify_supercell(collection_name, supercell, batoms=None):
    # Modify atom scale (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    print('drawing atoms')
    batoms *= supercell
    batoms.draw()
예제 #3
0
def load_frames(collection_name, movie, batoms = None):
    """
    """
    from blase.bio import Blase
    print('Rendering atoms')
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    batoms.load_frames()
예제 #4
0
def render_atoms(collection_name, output_image = 'bout.png', batoms = None):
    """
    """
    from blase.bio import Blase
    print('Rendering atoms')
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    batoms.render(output_image = output_image)
예제 #5
0
def modify_color(collection_name, atoms_list, color, batoms=None):
    # Modify atom radius (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    print('drawing atoms')
    batoms.draw_atoms(props={atoms_list: {
        'color': color,
    }})
예제 #6
0
def modify_boundary(collection_name, cutoff, batoms = None):
    # Modify atom cutoff (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    print('drawing atoms')
    batoms.coll.blase.boundary = cutoff
    # if batoms.atoms.pbc.any():
        # batoms.draw_atoms_boundary(cutoff=cutoff)
    batoms.draw()
예제 #7
0
def modify_model_type(collection_name, model_type, batoms = None):
    # Modify atom scale (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    for obj in coll.all_objects:
        bpy.data.objects.remove(obj)
    print('drawing atoms')
    batoms.coll.blase.model_type = model_type
    batoms.draw()
예제 #8
0
def modify_pbc(collection_name, pbc, batoms=None):
    # Modify atom scale (all selected)
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    batoms.atoms.pbc = pbc
예제 #9
0
def modify_materials(collection_name, model_type, atoms=None):
    coll = bpy.data.collections[collection_name]
    if not batoms:
        batoms = read_blase_collection(coll)
    print('drawing atoms')
    batoms.draw_atoms()