diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-02-02 17:34:39 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-02-02 17:34:39 +0300 |
commit | ed00f7c65e27be5aae16c3b8dbf13e281cf94f9c (patch) | |
tree | 207b70afc610d113ef8050e8e051733136a8c711 | |
parent | 14285445283ecc8890f7e1c4b4eb92cef3f0a8ed (diff) | |
parent | 9e0c876aadd9641fa9e8d6d8717c757b8b528d8b (diff) |
Merge branch 'blender-v2.92-release'
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_wireframe.c | 8 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_hair.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index 617dda56421..7ba5fb3a426 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -20,6 +20,7 @@ * \ingroup draw_engine */ +#include "DNA_collection_types.h" #include "DNA_mesh_types.h" #include "DNA_particle_types.h" #include "DNA_view3d_types.h" @@ -141,7 +142,12 @@ static void wireframe_hair_cache_populate(OVERLAY_Data *vedata, Object *ob, Part float dupli_mat[4][4]; if ((dupli_parent != NULL) && (dupli_object != NULL)) { if (dupli_object->type & OB_DUPLICOLLECTION) { - copy_m4_m4(dupli_mat, dupli_parent->obmat); + unit_m4(dupli_mat); + Collection *collection = dupli_parent->instance_collection; + if (collection != NULL) { + sub_v3_v3(dupli_mat[3], collection->instance_offset); + } + mul_m4_m4m4(dupli_mat, dupli_parent->obmat, dupli_mat); } else { copy_m4_m4(dupli_mat, dupli_object->ob->obmat); diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c index cc0aa09ed97..86f1b0e0ebb 100644 --- a/source/blender/draw/intern/draw_hair.c +++ b/source/blender/draw/intern/draw_hair.c @@ -28,6 +28,7 @@ #include "BLI_string_utils.h" #include "BLI_utildefines.h" +#include "DNA_collection_types.h" #include "DNA_customdata_types.h" #include "DNA_modifier_types.h" #include "DNA_particle_types.h" @@ -195,7 +196,12 @@ void DRW_hair_duplimat_get(Object *object, if (psys) { if ((dupli_parent != NULL) && (dupli_object != NULL)) { if (dupli_object->type & OB_DUPLICOLLECTION) { - copy_m4_m4(dupli_mat, dupli_parent->obmat); + unit_m4(dupli_mat); + Collection *collection = dupli_parent->instance_collection; + if (collection != NULL) { + sub_v3_v3(dupli_mat[3], collection->instance_offset); + } + mul_m4_m4m4(dupli_mat, dupli_parent->obmat, dupli_mat); } else { copy_m4_m4(dupli_mat, dupli_object->ob->obmat); |