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:
authorHans Goudey <h.goudey@me.com>2021-07-14 17:51:28 +0300
committerHans Goudey <h.goudey@me.com>2021-07-14 17:51:28 +0300
commitc202d3865904903a73a18822613f625a3bee344b (patch)
treea5c00dae340b6c3795d238acdd639428e3d28daa /source/blender/makesrna/intern/rna_internal_types.h
parent37a5ff4a8470a0040f88228bbf3d439c42389446 (diff)
Python API: Add functions to ensure and clear IDProperties
This adds id_properties_clear() and id_properties_ensure() functions to RNA structs. This is meant as an initial change based on discussion in review of D9697. However, they may be useful in other situations. The change requires refactoring the internal idproperties callback to return a pointer to the IDProperty pointer, which actually turns out to be quite a nice cleanup. An id_properties attribute could be added in the future potentially. Differential Revision: https://developer.blender.org/D11908
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index ee60b199d64..479306e8c06 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -54,7 +54,7 @@ typedef void (*ContextPropUpdateFunc)(struct bContext *C,
typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr);
typedef int (*EditableFunc)(struct PointerRNA *ptr, const char **r_info);
typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index);
-typedef struct IDProperty *(*IDPropertiesFunc)(struct PointerRNA *ptr, bool create);
+typedef struct IDProperty **(*IDPropertiesFunc)(struct PointerRNA *ptr);
typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr);
typedef char *(*StructPathFunc)(struct PointerRNA *ptr);
@@ -559,7 +559,7 @@ struct StructRNA {
*/
StructInstanceFunc instance;
- /* callback to get id properties */
+ /** Return the location of the struct's pointer to the root group IDProperty. */
IDPropertiesFunc idproperties;
/* functions of this struct */