diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-09-30 18:54:26 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-09-30 20:01:57 +0300 |
commit | 554afabf7580d60cc1990bb9df9d9940cb1fb1c3 (patch) | |
tree | fdd40672265c948b600482d3b17d9667dbf17844 /source/blender/makesrna/intern | |
parent | 42eda155df3b77a49c4c1aa3ddcc681e43771111 (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; |