A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.
This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.
Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.
Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:
https://reuse.software/faq/
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
*
|
|
* Pose Backups can be created from the current pose, and later restored. The
|
|
* backup is restricted to those bones animated by a given Action, so that
|
|
* operations are as fast as possible.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "BLI_listbase.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct PoseBackup;
|
|
|
|
/**
|
|
* Create a backup of those bones that are selected AND animated in the given action.
|
|
*
|
|
* The backup is owned by the caller, and should be freed with `BKE_pose_backup_free()`.
|
|
*/
|
|
struct PoseBackup *BKE_pose_backup_create_selected_bones(
|
|
const struct Object *ob, const struct bAction *action) ATTR_WARN_UNUSED_RESULT;
|
|
|
|
/**
|
|
* Create a backup of those bones that are animated in the given action.
|
|
*
|
|
* The backup is owned by the caller, and should be freed with `BKE_pose_backup_free()`.
|
|
*/
|
|
struct PoseBackup *BKE_pose_backup_create_all_bones(
|
|
const struct Object *ob, const struct bAction *action) ATTR_WARN_UNUSED_RESULT;
|
|
bool BKE_pose_backup_is_selection_relevant(const struct PoseBackup *pose_backup);
|
|
void BKE_pose_backup_restore(const struct PoseBackup *pbd);
|
|
void BKE_pose_backup_free(struct PoseBackup *pbd);
|
|
|
|
/**
|
|
* Create a backup of those bones that are animated in the given action.
|
|
*
|
|
* The backup is owned by the Object, and there can be only one backup at a time.
|
|
* It should be freed with `BKE_pose_backup_clear(ob)`.
|
|
*/
|
|
void BKE_pose_backup_create_on_object(struct Object *ob, const struct bAction *action);
|
|
|
|
/**
|
|
* Restore the pose backup owned by this OBject.
|
|
*
|
|
* \return true on success, false if there was no pose backup to restore.
|
|
*
|
|
* \see #BKE_pose_backup_create_on_object
|
|
*/
|
|
bool BKE_pose_backup_restore_on_object(struct Object *ob);
|
|
|
|
/**
|
|
* Free the pose backup that was stored on this object's runtime data.
|
|
*/
|
|
void BKE_pose_backup_clear(struct Object *ob);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|