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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-12-18 12:13:43 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-12-18 12:13:43 +0300
commit7ab8c906865dddf2ef6164b6271e4469a3a95319 (patch)
tree7604626d0d6c56f6fcf5ca3233ec29bec4c623be /source/blender/makesrna/RNA_access.h
parent994648a6741087ae40227037ee87395aa18f5b18 (diff)
Serious cleanup/refactor/fixing of new RNA comparison code.
Code also handling auto-generation of static overrides. Aside from some naming consistency cleanup, this commit: * Is the first step addressing the 'operator' issue with static overrides, by implementing a first version of the 'restore from reference' behavior. * Fixes several issues that were discovered on the way in enhanced RNA comparision code, like the 'zero-length dynamic array' case, or some infinite looping caused by some non-ID pointers (that for some mysterious reasons did not show up previously...). * Factorizes a bit said RNA comparison code (auto-static override generation and comparison/check were essentially doing the same thing).
Diffstat (limited to 'source/blender/makesrna/RNA_access.h')
-rw-r--r--source/blender/makesrna/RNA_access.h33
1 files changed, 25 insertions, 8 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 8d66f59dde5..415e018a3c1 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -1251,14 +1251,35 @@ typedef enum eRNACompareMode {
RNA_EQ_COMPARE,
} eRNACompareMode;
-bool RNA_property_equals(struct PointerRNA *a, struct PointerRNA *b, struct PropertyRNA *prop, eRNACompareMode mode);
-bool RNA_struct_equals(struct PointerRNA *a, struct PointerRNA *b, eRNACompareMode mode);
+bool RNA_property_equals(struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, struct PropertyRNA *prop, eRNACompareMode mode);
+bool RNA_struct_equals(struct PointerRNA *ptr_a, struct PointerRNA *ptr_b, eRNACompareMode mode);
/* Override. */
+/* flags for RNA_struct_override_matches. */
+typedef enum eRNAOverrideMatch {
+ /* Do not compare properties that are not overridable. */
+ RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE = 1 << 0,
+ /* Do not compare properties that are already overridden. */
+ RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN = 1 << 1,
+
+ /* Create new property override if needed and possible. */
+ RNA_OVERRIDE_COMPARE_CREATE = 1 << 16,
+ /* Restore property's value(s) to reference ones if needed and possible. */
+ RNA_OVERRIDE_COMPARE_RESTORE = 1 << 17,
+} eRNAOverrideMatch;
+
+typedef enum eRNAOverrideMatchResult {
+ /* Some new property overrides were created to take into account differences between local and reference. */
+ RNA_OVERRIDE_MATCH_RESULT_CREATED = 1 << 0,
+ /* Some properties were reset to reference values. */
+ RNA_OVERRIDE_MATCH_RESULT_RESTORED = 1 << 1,
+} eRNAOverrideMatchResult;
+
bool RNA_struct_override_matches(
- struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference,
- struct IDOverrideStatic *override, const bool ignore_non_overridable, const bool ignore_overridden);
+ struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, const char *root_path,
+ struct IDOverrideStatic *override, const eRNAOverrideMatch flags,
+ eRNAOverrideMatchResult *r_report_flags);
bool RNA_struct_override_store(
struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, PointerRNA *ptr_storage,
@@ -1268,10 +1289,6 @@ void RNA_struct_override_apply(
struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, struct PointerRNA *ptr_storage,
struct IDOverrideStatic *override);
-bool RNA_struct_auto_override(
- struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference,
- struct IDOverrideStatic *override, const char *root_path);
-
struct IDOverrideStaticProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop);
struct IDOverrideStaticProperty *RNA_property_override_property_get(PointerRNA *ptr, PropertyRNA *prop, bool *r_created);