ggmolvis.utils.utils

Utility functions for working with Blender objects and data.

Functions:

convert_list_to_array(value)

look_at(camera_position, target_position)

Calculate the rotation matrix for a camera to point towards a target position.

quaternion_to_euler(quaternion)

Convert quaternion to Euler angles.

euler_to_quaternion(euler_angles)

Convert Euler angles to quaternion.

validate_properties(func)

suppress_blender_output()

Context manager to suppress Blender's low-level stdout and stderr output.

Functions

convert_list_to_array(value)

euler_to_quaternion(euler_angles)

Convert Euler angles to quaternion.

lerp(a, b, t)

Linearly interpolates between two arrays a and b by a factor of t. Parameters: a (np.ndarray): The starting array. b (np.ndarray): The ending array. t (float or np.ndarray): The interpolation factor, where 0 <= t <= 1. If t is an array, it should be broadcastable to the shape of a and b. Returns: np.ndarray: The interpolated array.

look_at(camera_position, target_position)

Calculate the rotation matrix for a camera to point towards a target position.

quaternion_to_euler(quaternion)

Convert quaternion to Euler angles.

suppress_blender_output()

Context manager to suppress Blender's low-level stdout and stderr output.

validate_properties(func)