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.
This commit is contained in:
2022-05-31 15:46:09 -07:00
parent 511a08585d
commit 75162ab8c2
5 changed files with 105 additions and 3 deletions

View File

@@ -7,12 +7,22 @@
#pragma once
#include "BKE_attribute.h"
#include "DNA_customdata_types.h"
#ifdef __cplusplus
extern "C" {
#endif
void ED_operatortypes_geometry(void);
struct Mesh;
void ED_operatortypes_geometry(void);
bool ED_geometry_attribute_convert(struct Mesh *mesh,
const char *layer_name,
CustomDataType old_type,
AttributeDomain old_domain,
CustomDataType new_type,
AttributeDomain new_domain);
#ifdef __cplusplus
}
#endif