From 554afabf7580d60cc1990bb9df9d9940cb1fb1c3 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 30 Sep 2022 18:54:26 +0300 Subject: Attribute Node: refactor lookup to remove duplication between engines. Currently lookup of Object and Instancer attributes is completely duplicated between Cycles, Eevee and Eevee Next. This is bad design, so this patch aims to deduplicate it by introducing a common API in blenkernel. In case of Cycles this requires certain hacks, but according to Brecht it is planned to be rewritten later for more direct access to internal Blender data anyway. Differential Revision: https://developer.blender.org/D16117 --- source/blender/makesrna/intern/rna_depsgraph.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index eb39492c7dc..db5b3c33c59 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -61,6 +61,14 @@ void **rna_DepsgraphIterator_instance(PointerRNA *ptr) } # endif +/* Temporary hack for Cycles until it is changed to work with the C API directly. */ +DupliObject *rna_hack_DepsgraphObjectInstance_dupli_object_get(PointerRNA *ptr) +{ + RNA_DepsgraphIterator *di = ptr->data; + DEGObjectIterData *deg_iter = (DEGObjectIterData *)di->iter.data; + return deg_iter->dupli_object_current; +} + static PointerRNA rna_DepsgraphObjectInstance_object_get(PointerRNA *ptr) { RNA_DepsgraphIterator *di = ptr->data; -- cgit v1.2.3