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:
authorJoseph Eagar <joeedh@gmail.com>2022-06-01 01:46:09 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-06-01 01:46:09 +0300
commit75162ab8c23937fce64e7b2674cc706a008ded96 (patch)
treee164662b22459b49aec8dcf4b597ea05ebfa80cd /source/blender/blenkernel/BKE_attribute.h
parent511a08585d2934b38e7d3de447752686b5f0e15b (diff)
Fix T97408: Temporary fix for attribute convert undo
Sculpt undo now detects if an attribute layer has changed type/domain and unconverts it back. This is a temporary workaround to a more fundamental bug in the undo system. Memfile undo assumes it can always rebuild the application state from the prior undo step, which isn't true with incremental undo systems. The correct fix is to push an extra undo step prior to running an operator if an incremental undo system is active and the operator is using memfile undo.
Diffstat (limited to 'source/blender/blenkernel/BKE_attribute.h')
-rw-r--r--source/blender/blenkernel/BKE_attribute.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h
index f3a29736bc8..c7ea12a7065 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -43,6 +43,8 @@ typedef enum AttributeDomainMask {
ATTR_DOMAIN_MASK_ALL = (1 << 5) - 1
} AttributeDomainMask;
+#define ATTR_DOMAIN_AS_MASK(domain) ((AttributeDomainMask)((1 << (int)(domain))))
+
/* All domains that support color attributes. */
#define ATTR_DOMAIN_MASK_COLOR \
((AttributeDomainMask)((ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_CORNER)))
@@ -62,8 +64,13 @@ bool BKE_id_attribute_remove(struct ID *id,
struct CustomDataLayer *BKE_id_attribute_find(const struct ID *id,
const char *name,
- int type,
- AttributeDomain domain);
+ const int type,
+ const AttributeDomain domain);
+
+struct CustomDataLayer *BKE_id_attribute_search(const struct ID *id,
+ const char *name,
+ const CustomDataMask type,
+ const AttributeDomainMask domain_mask);
AttributeDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer);
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer);