========= Animation ========= .. py:currentmodule:: p3dsdk .. py:class:: Animation .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only AnimationCurve -------------- .. py:class:: AnimationCurve .. py:method:: id :property: The id of the animation curve. :type: str, read-only .. py:method:: color :property: The color of the animation curve. :type: ColorRgb :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: name :property: The name of the animation curve. :type: str, read-only .. py:method:: key_frame_data :property: The data of the curve in json. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_key_frames() Returns the list of :py:obj:`AnimationKeyFrame`. :returns: The list of :py:obj:`AnimationKeyFrame`. :rtype: list(AnimationKeyFrame) .. py:method:: key_frame_from_id(id) Returns a :py:obj:`AnimationKeyFrame` with the id. :param id: Id of the key frame. :type id: str :returns: The :py:obj:`AnimationKeyFrame` with the given id. :rtype: AnimationKeyFrame .. py:method:: insert_key_frame(time, value) Add a :py:obj:`AnimationKeyFrame` to the curve at the given time with the given value. :param time: Time at which the key frame will be inserted. :type time: float :param value: The value of the key frame. :type value: float :returns: The newly inserted :py:obj:`AnimationKeyFrame`. :rtype: AnimationKeyFrame :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove_key_frame(id) Remove the :py:obj:`AnimationKeyFrame` with the given id. :param id: The id of the key frame to be removed. :type id: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete this curve. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. AnimationEasingType ------------------- .. py:class:: AnimationEasingType .. py:attribute:: LINEAR :annotation: = 0 Linear. .. py:attribute:: EASING_IN :annotation: = 1 Quad easing in. .. py:attribute:: EASING_OUT :annotation: = 2 Quad easing out. .. py:attribute:: EASING_IN_OUT :annotation: = 3 Quad easing in out. AnimationKeyFrame ----------------- .. py:class:: AnimationKeyFrame .. py:method:: id :property: The id of the key frame. :type: str, read-only .. py:method:: name :property: The name of the curve containing this keyframe. :type: str, read-only .. py:method:: value :property: The value of the key frame. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: time :property: The time of the key frame in seconds. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: right_tangent_type :property: The right tangent type. :type: KeyFrameTangentType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: left_tangent_type :property: The left tangent type. :type: KeyFrameTangentType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: right_tangent_value :property: The right tangent value. :type: Vector2 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: left_tangent_value :property: The left tangent value. :type: Vector2 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. CameraAnimation --------------- .. py:class:: CameraAnimation Base class: :py:class:`Animation` .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only .. py:method:: remove() Delete the camera animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. CameraBezierPathAnimation ------------------------- .. py:class:: CameraBezierPathAnimation Base class: :py:class:`CameraAnimation` .. py:method:: duration :property: The duration of the animation. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: position_type :property: The position type of the animation. :type: CameraBezierPathAnimationPositionType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: bezier_path_used_for_position :property: The Bezier path used for position. :type: BezierPath :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: position_bezier_path_inverted :property: Whether the Bezier path used for position is inverted. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: position_null :property: The null used for position. :type: Null :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: position_fixed_from :property: The fixed position camera origin. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: position_fixed_to :property: The fixed position camera target. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_type :property: The target type of the animation. :type: CameraBezierPathAnimationTargetType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: bezier_path_used_for_target :property: The Bezier path used for target. :type: BezierPath :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_bezier_path_inverted :property: Whether the Bezier path used for target is inverted. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_null :property: The null used for target. :type: Null :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_fixed_direction :property: The fixed direction for the target. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_fixed_direction_up :property: The fixed direction up vector for the target. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: target_fixed :property: The fixed position for target. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete the camera animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this camera Bezier path animation. :returns: The duplicated camera Bezier path animation. :rtype: CameraBezierPathAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. CameraBezierPathAnimationPositionType ------------------------------------- .. py:class:: CameraBezierPathAnimationPositionType .. py:attribute:: FOLLOW_BEZIER_PATH :annotation: = 0 Follow Bezier path. .. py:attribute:: FIXED :annotation: = 1 Stationary. .. py:attribute:: FOLLOW_NULL :annotation: = 2 Follow Null. CameraBezierPathAnimationTargetType ----------------------------------- .. py:class:: CameraBezierPathAnimationTargetType .. py:attribute:: FOLLOW_BEZIER_PATH :annotation: = 0 Follow Bezier path. .. py:attribute:: FOLLOW_POSITION_PATH :annotation: = 1 Follow the position path. .. py:attribute:: FIXED_DIRECTION :annotation: = 2 Prevent modification of the camera orientation. .. py:attribute:: FIXED_POSITION :annotation: = 3 Stationary. .. py:attribute:: FOLLOW_NULL :annotation: = 4 Follow Null. CameraBookmark -------------- .. py:class:: CameraBookmark .. py:method:: id :property: Id of the camera bookmark. :type: str, read-only .. py:method:: enabled :property: Whether the camera bookmark is included in the animation. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: name :property: The name of the camera bookmark. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: index :property: The index of the camera bookmark in the animation. :type: int :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: sleep :property: The duration of the pause of the bookmarked image (in seconds). :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duration :property: The duration of the animated transition to the next bookmark (in seconds). :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: smoothness :property: The fluidity of the camera behavior. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: path_type :property: The type of camera path. :type: CameraBookmarkPathType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: turn_duration :property: The percentage of the step dedicated to the rotation (in percentage). :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: turn_count :property: The number of 360-degree turns to carry out. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this camera bookmark. :returns: The duplicated camera bookmark. :rtype: CameraBookmark :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete a camera bookmark. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. CameraBookmarkAnimation ----------------------- .. py:class:: CameraBookmarkAnimation Base class: :py:class:`CameraAnimation` .. py:method:: duration :property: The global duration of the animation. :type: float, read-only .. py:method:: sleep_add_constant :property: The constant to add to each camera bookmark sleep value (in seconds). :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: sleep_factor :property: The factor to multiply each camera bookmark sleep value. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duration_add_constant :property: The constant to add to each camera bookmark duration value (in seconds). :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duration_factor :property: The factor to multiply each camera bookmark duration value. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: closed_path :property: Animate the transition between the last and the first bookmarks when the animation playback is looped. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete the camera animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_camera_bookmarks() List all the camera bookmarks in the animation. :returns: The list of camera bookmarks in the animation. :rtype: list(CameraBookmark) .. py:method:: find_camera_bookmark_in_animation(id) Find camera bookmark in the animation using :py:obj:`id`. :param id: Id of the camera bookmark to find. :type id: str :returns: The camera bookmark found. :rtype: CameraBookmark .. py:method:: add_new_camera_bookmark_to_animation(name) Add a camera bookmark to the animation. :param name: Name for the new camera bookmark. :type name: str :returns: The newly added camera bookmark. :rtype: CameraBookmark :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove_camera_bookmark_from_animation(bookmark) Camera bookmark to remove from the animation. :param bookmark: Camera bookmark to remove. :type bookmark: CameraBookmark :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: add_camera_from_camera_group_to_animation(group) Add a camera bookmark to the animation. :param group: Camera group containing camera to add to the animation. :type group: CameraGroup :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this camera bookmark animation. :returns: The duplicated camera bookmark animation. :rtype: CameraBookmarkAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. CameraBookmarkPathType ---------------------- .. py:class:: CameraBookmarkPathType .. py:attribute:: LINEAR :annotation: = 0 Straight path. .. py:attribute:: JUMP :annotation: = 1 Moves from one stage to the next with no transition. .. py:attribute:: ORBIT :annotation: = 2 Circular path. .. py:attribute:: HEAD :annotation: = 3 Pivots the camera. .. py:attribute:: SPLINE :annotation: = 4 Smooths the transitions when the camera moves from bookmark to bookmark. ChannelsAnimation ----------------- .. py:class:: ChannelsAnimation Base class: :py:class:`Animation` .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only .. py:method:: list_available_channels(object) List all channels that can be animated for the :py:obj:`SceneObject` .. note:: only :py:obj:`SceneObject` of type :py:obj:`Axis`, :py:obj:`Null` and :py:obj:`Vector` can be animated, object of other types will return an empty list. :param object: Object for which the list of channels that can animated will be returned. :type object: SceneObject :returns: The list all paths to channels that can animated for the :py:obj:`object`. :rtype: list(str) .. py:method:: animated_channels_for(id) Add a :py:obj:`Vector` animation of the :py:obj:`channel`. :param id: Id for the object to get the list of animated paths. :type id: str :returns: The list of animated channel path, the list is empty if the given object is not animated by this animation. :rtype: list(str) .. py:method:: remove() Delete the channels animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. ChannelsCurveAnimation ---------------------- .. py:class:: ChannelsCurveAnimation Base class: :py:class:`ChannelsAnimation` .. py:method:: duration :property: The duration of the animation. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_available_channels(object) List all channels that can be animated for the :py:obj:`SceneObject` .. note:: only :py:obj:`SceneObject` of type :py:obj:`Axis`, :py:obj:`Null` and :py:obj:`Vector` can be animated, object of other types will return an empty list. :param object: Object for which the list of channels that can animated will be returned. :type object: SceneObject :returns: The list all paths to channels that can animated for the :py:obj:`object`. :rtype: list(str) .. py:method:: animated_channels_for(id) Add a :py:obj:`Vector` animation of the :py:obj:`channel`. :param id: Id for the object to get the list of animated paths. :type id: str :returns: The list of animated channel path, the list is empty if the given object is not animated by this animation. :rtype: list(str) .. py:method:: remove() Delete the channels animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_curves() Returns the list of curves for this animation. :returns: The list of :py:obj:`Curve` contained in this animation. :rtype: list(AnimationCurve) .. py:method:: add_axis_channel_animation(object) Add a :py:obj:`Axis` animation of the :py:obj:`channel`. :param object: Axis object to animate. :type object: Axis :returns: The created :py:obj:`Curve` for this channel animation. :rtype: AnimationCurve :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: add_null_channel_animation(object, channel) Add a :py:obj:`Null` animation of the :py:obj:`channel`. :param object: Null object to animate. :type object: Null :param channel: Path to the channel to animate, separated with '/'. :type channel: str :returns: The created :py:obj:`Curve` for this channel animation. :rtype: AnimationCurve :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: add_vector_channel_animation(object) Add a :py:obj:`Vector` animation of the :py:obj:`channel`. :param object: Vector object to animate. :type object: Vector :returns: The created :py:obj:`Curve` for this channel animation. :rtype: AnimationCurve :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this channels animation. :returns: The duplicated channels animation. :rtype: ChannelsCurveAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. ChannelsSimpleAnimation ----------------------- .. py:class:: ChannelsSimpleAnimation Base class: :py:class:`ChannelsAnimation` .. py:method:: duration :property: The duration of the animation. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: initial_value :property: The initial value of the animation. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: final_value :property: The final value of the animation. :type: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: easing :property: The easing of the animation. :type: AnimationEasingType :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: list_available_channels(object) List all channels that can be animated for the :py:obj:`SceneObject` .. note:: only :py:obj:`SceneObject` of type :py:obj:`Axis`, :py:obj:`Null` and :py:obj:`Vector` can be animated, object of other types will return an empty list. :param object: Object for which the list of channels that can animated will be returned. :type object: SceneObject :returns: The list all paths to channels that can animated for the :py:obj:`object`. :rtype: list(str) .. py:method:: animated_channels_for(id) Add a :py:obj:`Vector` animation of the :py:obj:`channel`. :param id: Id for the object to get the list of animated paths. :type id: str :returns: The list of animated channel path, the list is empty if the given object is not animated by this animation. :rtype: list(str) .. py:method:: remove() Delete the channels animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: set_axis_channel_animation(object, start, end) Set a :py:obj:`Axis` animation of the :py:obj:`channel`. :param object: Axis object to animate. :type object: Axis :param start: Initial value for channel animation. :type start: float :param end: Final value for channel animation. :type end: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: set_null_channel_animation(object, channel, start, end) Set a :py:obj:`Null` animation of the :py:obj:`channel`. :param object: Null object to animate. :type object: Null :param channel: Path to the channel to animate, separated with '/'. :type channel: str :param start: Initial value for channel animation. :type start: float :param end: Final value for channel animation. :type end: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: set_vector_channel_animation(object, start, end) Set a :py:obj:`Vector` animation of the :py:obj:`channel`. :param object: Vector object to animate. :type object: Vector :param start: Initial value for channel animation. :type start: float :param end: Final value for channel animation. :type end: float :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this channels animation. :returns: The duplicated channels animation. :rtype: ChannelsSimpleAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. ConfigurationKeyAnimation ------------------------- .. py:class:: ConfigurationKeyAnimation Base class: :py:class:`Animation` .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only .. py:method:: list_symbols() List of symbols defined for this configuration key animation. :returns: The list of symbols defined for this configuration key animation. :rtype: list(str) .. py:method:: list_values() List of values defined for this configuration key animation, if the parameter is a check box there is no available values. :returns: The list of values defined for this configuration key animation or an empty list if the parameter is a check box. :rtype: list(str) .. py:method:: set_configuration_symbol(label, value) Set :py:obj:`value` for the :py:obj:`symbol` for this animation. :param label: The label of the symbol to be used in the animation. :type label: str :param value: The value of the symbol. :type value: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: set_check_box_configuration_symbol(label, value) Set :py:obj:`value` for the :py:obj:`symbol` for this animation. :param label: The label of the symbol to be used in the animation. :type label: str :param value: The value of the symbol. :type value: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: keep_previous_value(label) Keep previous value for the symbol with the label :py:obj:`label` for this animation. :param label: The label of the symbol to be modified in the animation. :type label: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: initialize_from_configuration_preset(preset) Initialize the configuration for this animation using the :py:obj:`preset`. :param preset: The configuration preset from which the animation configuration will be initialized. :type preset: ConfigurationPreset :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this configuration key animation. :returns: The duplicated configuration key animation. :rtype: ConfigurationKeyAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete the configuration key animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. KeyFrameTangentType ------------------- .. py:class:: KeyFrameTangentType .. py:attribute:: BEZIER :annotation: = 0 Bezier Path. .. py:attribute:: LINEAR :annotation: = 1 Linear. .. py:attribute:: STEP :annotation: = 2 Step. ProductKeyAnimation ------------------- .. py:class:: ProductKeyAnimation Base class: :py:class:`Animation` .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only SurfaceBakedAnimation --------------------- .. py:class:: SurfaceBakedAnimation Base class: :py:class:`ChannelsAnimation` .. py:method:: duration :property: The duration of the animation. :type: float, read-only .. py:method:: list_available_channels(object) List all channels that can be animated for the :py:obj:`SceneObject` .. note:: only :py:obj:`SceneObject` of type :py:obj:`Axis`, :py:obj:`Null` and :py:obj:`Vector` can be animated, object of other types will return an empty list. :param object: Object for which the list of channels that can animated will be returned. :type object: SceneObject :returns: The list all paths to channels that can animated for the :py:obj:`object`. :rtype: list(str) .. py:method:: animated_channels_for(id) Add a :py:obj:`Vector` animation of the :py:obj:`channel`. :param id: Id for the object to get the list of animated paths. :type id: str :returns: The list of animated channel path, the list is empty if the given object is not animated by this animation. :rtype: list(str) .. py:method:: remove() Delete the channels animation. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: duplicate() Duplicate this channels animation. :returns: The duplicated channels animation. :rtype: SurfaceBakedAnimation :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. TextureAnimation ---------------- .. py:class:: TextureAnimation Base class: :py:class:`Animation` .. py:method:: id :property: The id of the animation. :type: str, read-only .. py:method:: name :property: The name of the animation. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The animation type. :type: TimelineTrackType, read-only .. py:method:: duration :property: The duration of the animation. :type: float, read-only