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:
authorJulian Eisel <julian@blender.org>2021-10-21 21:42:41 +0300
committerJulian Eisel <julian@blender.org>2021-10-21 23:18:59 +0300
commita28614879986c26c7d354ebe659e2e327503ed28 (patch)
tree882f021eab1441c29e150069a4c64bee1f81d50d /source/blender/editors/asset/ED_asset_type.h
parent9aab1a46263a87980efa18ba35d87814eb2f4cda (diff)
Assets: Allow specific data-block types to be enabled by default
Updates UI code so that we can enable the asset UI for specific data-block types by default, i.e. irrespective of the "Extended Asset Browser" experimental feature. "Mark as Asset" and "Clear Asset" are always visible in the Outliner context menu now, but are grayed out if not applicable and show a disabled hint in the tooltip. A known side-effect of this: The "Mark as Asset" and "Clear Asset" operators are enabled for action data-blocks now, even though only pose actions created through the Pose Libraries add-on are supported. If this is something worth addressing is being discussed still. Differential Revision: https://developer.blender.org/D12955 Reviewed by: Sybren Stüvel
Diffstat (limited to 'source/blender/editors/asset/ED_asset_type.h')
-rw-r--r--source/blender/editors/asset/ED_asset_type.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/editors/asset/ED_asset_type.h b/source/blender/editors/asset/ED_asset_type.h
new file mode 100644
index 00000000000..ba0a3d2812f
--- /dev/null
+++ b/source/blender/editors/asset/ED_asset_type.h
@@ -0,0 +1,55 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup edasset
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ID;
+
+bool ED_asset_type_id_is_non_experimental(const struct ID *id);
+
+/**
+ * Check if the asset type for \a id (which doesn't need to be an asset right now) can be an asset,
+ * respecting the "Extended Asset Browser" experimental feature flag.
+ */
+bool ED_asset_type_is_supported(const ID *id);
+
+/**
+ * Get the filter flags (subset of #FILTER_ID_ALL) representing the asset ID types that may be
+ * turned into assets, respecting the "Extended Asset Browser" experimental feature flag.
+ * \note Does not check for #BKE_id_can_be_asset(), so may return filter flags for IDs that can
+ * never be assets.
+ */
+int64_t ED_asset_types_supported_as_filter_flags(void);
+
+/**
+ * Utility: A string enumerating the non-experimental asset types. This is useful info to
+ * the user, it should be displayed in tooltips or messages. Macro to support concatenating static
+ * strings with this (not all UI code supports dynamic strings nicely).
+ * Should start with a consonant, so usages can prefix it with "a" (not "an").
+ */
+#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_UI_STRING "Pose Action"
+
+#ifdef __cplusplus
+}
+#endif