[Bf-blender-cvs] [5752e4f06f6] blender2.8: WM: message bus rna utilkity macros

Campbell Barton noreply at git.blender.org
Fri Apr 27 08:28:37 CEST 2018


Commit: 5752e4f06f61f9df72454b81f2d7e3f008dc40eb
Author: Campbell Barton
Date:   Fri Apr 27 08:23:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5752e4f06f61f9df72454b81f2d7e3f008dc40eb

WM: message bus rna utilkity macros

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

M	source/blender/windowmanager/message_bus/wm_message_bus.h

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

diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h
index 8a800d18101..e0ccf0309f1 100644
--- a/source/blender/windowmanager/message_bus/wm_message_bus.h
+++ b/source/blender/windowmanager/message_bus/wm_message_bus.h
@@ -232,6 +232,21 @@ void WM_msg_subscribe_ID(
 void WM_msg_publish_ID(
         struct wmMsgBus *mbus, struct ID *id);
 
+#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) { \
+	 wmMsgParams_RNA msg_key_params_ = {{{0}}}; \
+	extern PropertyRNA rna_##type_##_##prop_; \
+	RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \
+	msg_key_params_.prop = &rna_##type_##_##prop_; \
+	WM_msg_publish_rna_params(mbus, &msg_key_params_); \
+} ((void)0)
+#define WM_msg_subscribe_rna_prop(mbus, id_, data_, type_, prop_, value) { \
+	wmMsgParams_RNA msg_key_params_ = {{{0}}}; \
+	extern PropertyRNA rna_##type_##_##prop_; \
+	RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \
+	msg_key_params_.prop = &rna_##type_##_##prop_; \
+	WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
+} ((void)0)
+
 /* Anonymous variants (for convenience) */
 #define WM_msg_subscribe_rna_anon_type(mbus, type_, value) { \
 	WM_msg_subscribe_rna_params( \



More information about the Bf-blender-cvs mailing list