diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 15:18:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 15:23:35 +0300 |
commit | e8f8c13d4b76ba587ef7cf33370b286d4fbd36bc (patch) | |
tree | 371472ae220ad8740b310aaa8f4c5746448302c5 /source/blender/blenkernel/intern/idtype.c | |
parent | 0c062a9e082130212447c2b67e8e16b8a2e622d1 (diff) | |
parent | 44bb73e765a6f79bc14a46449368f83e572d8bad (diff) |
PointCloud: Initial rendering support for Workbenchtmp-pointcloud-render
Also includes outline overlays. Removes the temp overlay drawing
We make the geometry follow camera like billboards this uses less
geometry. Currently we use half octahedron for now. Goal would be
to use icospheres.
This patch also optimize the case when pointcloud has uniform radius.
However we should premultiply the radius prop by the default radius
beforehand to avoid a multiplication on CPU.
Differential Revision: https://developer.blender.org/D8301
Diffstat (limited to 'source/blender/blenkernel/intern/idtype.c')
-rw-r--r-- | source/blender/blenkernel/intern/idtype.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index 2684e964eb1..1166ad9ad2f 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -36,8 +36,11 @@ #include "BLT_translation.h" #include "DNA_ID.h" +#include "DNA_node_types.h" +#include "DNA_scene_types.h" #include "BKE_main.h" +#include "BKE_node.h" #include "BKE_idtype.h" @@ -470,3 +473,33 @@ short BKE_idtype_idcode_iter_step(int *index) { return (*index < ARRAY_SIZE(id_types)) ? BKE_idtype_idcode_from_index((*index)++) : 0; } + +/** Wrapper around IDTypeInfo foreach_cache that also handles embedded IDs. */ +void BKE_idtype_id_foreach_cache(struct ID *id, + IDTypeForeachCacheFunctionCallback function_callback, + void *user_data) +{ + const IDTypeInfo *type_info = BKE_idtype_get_info_from_id(id); + if (type_info->foreach_cache != NULL) { + type_info->foreach_cache(id, function_callback, user_data); + } + + /* Handle 'private IDs'. */ + bNodeTree *nodetree = ntreeFromID(id); + if (nodetree != NULL) { + type_info = BKE_idtype_get_info_from_id(&nodetree->id); + if (type_info->foreach_cache != NULL) { + type_info->foreach_cache(&nodetree->id, function_callback, user_data); + } + } + + if (GS(id->name) == ID_SCE) { + Scene *scene = (Scene *)id; + if (scene->master_collection != NULL) { + type_info = BKE_idtype_get_info_from_id(&scene->master_collection->id); + if (type_info->foreach_cache != NULL) { + type_info->foreach_cache(&scene->master_collection->id, function_callback, user_data); + } + } + } +} |