[Bf-blender-cvs] [79924fce49] clay-engine: RNA: use new getter/setter functions for LayerEngineSettings

Dalai Felinto noreply at git.blender.org
Fri Feb 3 15:07:12 CET 2017


Commit: 79924fce490cc85cfee7fd2a5431b912b40deef8
Author: Dalai Felinto
Date:   Fri Feb 3 15:06:11 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB79924fce490cc85cfee7fd2a5431b912b40deef8

RNA: use new getter/setter functions for LayerEngineSettings

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

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 08ac178383..9eb54e3204 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2371,33 +2371,24 @@ static StructRNA *rna_CollectionEngineSettings_refine(struct PointerRNA *ptr)
 
 /****** clay engine settings *******/
 
-#define RNA_LAYER_ENGINE_GET_SET(_TYPE_, _CLASS_, _NAME_)                          \
+#define RNA_LAYER_ENGINE_GET_SET(_TYPE_, _NAME_)                                   \
 static _TYPE_ rna_LayerEngineSettings_##_NAME_##_get(PointerRNA *ptr)              \
 {                                                                                  \
 	CollectionEngineSettings *ces = (CollectionEngineSettings *)ptr->data;         \
-	                                                                               \
-	_CLASS_ *prop = (_CLASS_ *)BKE_collection_engine_property_get(ces, #_NAME_);   \
-	BLI_assert(prop);                                                              \
-	                                                                               \
-	return prop->value;                                                            \
+	return BKE_collection_engine_property_value_get_##_TYPE_(ces, #_NAME_);        \
 }                                                                                  \
 	                                                                               \
 static void rna_LayerEngineSettings_##_NAME_##_set(PointerRNA *ptr, _TYPE_ value)  \
 {                                                                                  \
 	CollectionEngineSettings *ces = (CollectionEngineSettings *)ptr->data;         \
-	                                                                               \
-	_CLASS_ *prop = (_CLASS_ *)BKE_collection_engine_property_get(ces,  #_NAME_);  \
-	BLI_assert(prop);                                                              \
-	prop->data.flag |= COLLECTION_PROP_USE;                                        \
-	                                                                               \
-	prop->value = value;                                                           \
+	BKE_collection_engine_property_value_set_##_TYPE_(ces, #_NAME_, value);        \
 }
 
 #define RNA_LAYER_ENGINE_GET_SET_FLOAT(_NAME_) \
-	RNA_LAYER_ENGINE_GET_SET(float, CollectionEnginePropertyFloat, _NAME_)
+	RNA_LAYER_ENGINE_GET_SET(float, _NAME_)
 
 #define RNA_LAYER_ENGINE_GET_SET_INT(_NAME_) \
-	RNA_LAYER_ENGINE_GET_SET(int, CollectionEnginePropertyInt, _NAME_)
+	RNA_LAYER_ENGINE_GET_SET(int, _NAME_)
 
 
 RNA_LAYER_ENGINE_GET_SET_INT(type)




More information about the Bf-blender-cvs mailing list