[Bf-blender-cvs] [141f0f4c471] master: BKE_context: macro to access ID's while looping

Campbell Barton noreply at git.blender.org
Mon Apr 16 16:19:37 CEST 2018


Commit: 141f0f4c4717a8f6090515779de10e205455644b
Author: Campbell Barton
Date:   Mon Apr 16 16:19:16 2018 +0200
Branches: master
https://developer.blender.org/rB141f0f4c4717a8f6090515779de10e205455644b

BKE_context: macro to access ID's while looping

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

M	source/blender/blenkernel/BKE_context.h

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

diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index 4da6a61cbfa..6de323258bd 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -230,6 +230,10 @@ void CTX_data_list_add(bContextDataResult *result, void *data);
 		BLI_freelistN(&ctx_data_list);                                        \
 } (void)0
 
+#define CTX_DATA_BEGIN_WITH_ID(C, Type, instance, member, Type_id, instance_id)      \
+	CTX_DATA_BEGIN(C, Type, instance, member) \
+	Type_id instance_id = ctx_link->ptr.id.data; \
+
 int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *));
 
 #define CTX_DATA_COUNT(C, member) \



More information about the Bf-blender-cvs mailing list