Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_hair.c
| Show All 22 Lines | |||||
| * \brief Contains procedural GPU hair drawing methods. | * \brief Contains procedural GPU hair drawing methods. | ||||
| */ | */ | ||||
| #include "DRW_render.h" | #include "DRW_render.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_collection_types.h" | |||||
| #include "DNA_customdata_types.h" | #include "DNA_customdata_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_particle_types.h" | #include "DNA_particle_types.h" | ||||
| #include "BKE_duplilist.h" | #include "BKE_duplilist.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "GPU_shader.h" | #include "GPU_shader.h" | ||||
| ▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Object *dupli_parent = DRW_object_get_dupli_parent(object); | Object *dupli_parent = DRW_object_get_dupli_parent(object); | ||||
| DupliObject *dupli_object = DRW_object_get_dupli(object); | DupliObject *dupli_object = DRW_object_get_dupli(object); | ||||
| if (psys) { | if (psys) { | ||||
| if ((dupli_parent != NULL) && (dupli_object != NULL)) { | if ((dupli_parent != NULL) && (dupli_object != NULL)) { | ||||
| if (dupli_object->type & OB_DUPLICOLLECTION) { | if (dupli_object->type & OB_DUPLICOLLECTION) { | ||||
| copy_m4_m4(dupli_mat, dupli_parent->obmat); | copy_m4_m4(dupli_mat, dupli_parent->obmat); | ||||
| Collection *collection = dupli_parent->instance_collection; | |||||
| if (collection != NULL) { | |||||
| sub_v3_v3(dupli_mat[3], collection->instance_offset); | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| copy_m4_m4(dupli_mat, dupli_object->ob->obmat); | copy_m4_m4(dupli_mat, dupli_object->ob->obmat); | ||||
| invert_m4(dupli_mat); | invert_m4(dupli_mat); | ||||
| mul_m4_m4m4(dupli_mat, object->obmat, dupli_mat); | mul_m4_m4m4(dupli_mat, object->obmat, dupli_mat); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines | |||||