[Bf-blender-cvs] [4f80260f116] blender2.8: Expand the collection settings RNA API for arrays

Dalai Felinto noreply at git.blender.org
Wed May 10 20:04:58 CEST 2017


Commit: 4f80260f1160178a47180ccc0b82a11437388a83
Author: Dalai Felinto
Date:   Wed May 10 20:04:50 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB4f80260f1160178a47180ccc0b82a11437388a83

Expand the collection settings RNA API for arrays

===================================================================

M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 0f904ab214b..614189e7bef 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2498,7 +2498,23 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr,
 {                                                                                  \
 	IDProperty *props = (IDProperty *)ptr->data;                                   \
 	BKE_collection_engine_property_value_set_##_TYPE_(props, #_NAME_, value);      \
+}
+
+#define RNA_LAYER_ENGINE_GET_SET_ARRAY(_TYPE_, _ENGINE_, _MODE_, _NAME_, _LEN_)    \
+static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_get(PointerRNA *ptr, _TYPE_ *values) \
+{                                                                                  \
+	IDProperty *props = (IDProperty *)ptr->data;                                   \
+	IDProperty *idprop = IDP_GetPropertyFromGroup(props, #_NAME_);                 \
+	if (idprop != NULL) {                                                          \
+		memcpy(values, IDP_Array(idprop), sizeof(_TYPE_) * idprop->len);           \
+	}                                                                              \
 }                                                                                  \
+	                                                                               \
+static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, const _TYPE_ *values) \
+{                                                                                  \
+	IDProperty *props = (IDProperty *)ptr->data;                                   \
+	BKE_collection_engine_property_value_set_##_TYPE_##_array(props, #_NAME_, values); \
+}
 
 #define RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(_NAME_) \
 	RNA_LAYER_ENGINE_GET_SET(float, Clay, COLLECTION_MODE_NONE, _NAME_)




More information about the Bf-blender-cvs mailing list