Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-11-11 19:51:38 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-11-12 16:36:22 +0300
commitb4cfe80547244e69017bb9c8432a4b18c21b5a6b (patch)
treed755d8fbe10634f2763fd66426df75824b76b382 /source/blender/blenkernel/BKE_action.h
parent5f7d5c0809104bf702dff4be1b706c6841095fda (diff)
Assets: Store Action sub-type in asset metadata
Blender 3.0 will only support single-frame Actions in the pose library. The goal of this patch is to lay the groundwork for making it possible for the Asset Browser to reject/hide "animation snippet" Action assets. Determining whether an Action has one or more frames (i.e. whether it has a single pose or animation) requires inspecting the Action itself, and thus loading the data-block itself. This would make it impossible to quickly determine from the asset browser. To solve this, the Action is inspected before saving, and a `"is_single_frame"` boolean (well, 0/1 integer) IDProperty is added. Reviewed by: Severin Differential Revision: https://developer.blender.org/D13202
Diffstat (limited to 'source/blender/blenkernel/BKE_action.h')
-rw-r--r--source/blender/blenkernel/BKE_action.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 9f69c5e3976..db55daddba6 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -125,6 +125,16 @@ struct bActionGroup *BKE_action_group_find_name(struct bAction *act, const char
/* Clear all 'temp' flags on all groups */
void action_groups_clear_tempflags(struct bAction *act);
+/**
+ * Return whether the action has one unique point in time keyed.
+ *
+ * This is mostly for the pose library, which will have different behaviour depending on whether an
+ * Action corresponds to a "pose" (one keyframe) or "animation snippet" (multiple keyframes).
+ *
+ * \return `false` when there is no keyframe at all or keys on different points in time, `true`
+ * when exactly one point in time is keyed. */
+bool BKE_action_has_single_frame(const struct bAction *act);
+
/* Pose API ----------------- */
void BKE_pose_channel_free(struct bPoseChannel *pchan);