[Bf-blender-cvs] [64293a277f3] master: Merge branch 'blender-v3.1-release'
Jacques Lucke
noreply at git.blender.org
Tue Feb 22 13:57:14 CET 2022
Commit: 64293a277f3532c2e3048234950be250e1e9e90c
Author: Jacques Lucke
Date: Tue Feb 22 13:57:05 2022 +0100
Branches: master
https://developer.blender.org/rB64293a277f3532c2e3048234950be250e1e9e90c
Merge branch 'blender-v3.1-release'
===================================================================
===================================================================
diff --cc source/blender/draw/engines/eevee/eevee_data.c
index 58676caa6f9,58ea682c060..253981d321b
--- a/source/blender/draw/engines/eevee/eevee_data.c
+++ b/source/blender/draw/engines/eevee/eevee_data.c
@@@ -139,53 -159,28 +144,28 @@@ EEVEE_ObjectMotionData *EEVEE_motion_bl
return ob_step;
}
- static void *motion_blur_deform_data_get(EEVEE_MotionBlurData *mb, Object *ob, bool hair)
+ EEVEE_GeometryMotionData *EEVEE_motion_blur_geometry_data_get(EEVEE_ObjectMotionData *mb_data)
{
- if (mb->geom == NULL) {
- return NULL;
- }
- DupliObject *dup = DRW_object_get_dupli(ob);
- void *key;
- if (dup) {
- key = dup->ob;
- }
- else {
- key = ob;
- }
- /* Only use data for object that have no modifiers. */
- if (!BKE_object_is_modified(DRW_context_state_get()->scene, ob)) {
- key = ob->data;
- }
- key = (char *)key + (int)hair;
- EEVEE_GeometryMotionData *geom_step = BLI_ghash_lookup(mb->geom, key);
- if (geom_step == NULL) {
- if (hair) {
- EEVEE_HairMotionData *hair_step;
- /* Ugly, we allocate for each modifiers and just fill based on modifier index in the list. */
- int psys_len = (ob->type != OB_CURVES) ? BLI_listbase_count(&ob->modifiers) : 1;
- hair_step = MEM_callocN(sizeof(EEVEE_HairMotionData) + sizeof(hair_step->psys[0]) * psys_len,
- __func__);
- hair_step->psys_len = psys_len;
- geom_step = (EEVEE_GeometryMotionData *)hair_step;
- geom_step->type = EEVEE_MOTION_DATA_HAIR;
- }
- else {
- geom_step = MEM_callocN(sizeof(EEVEE_GeometryMotionData), __func__);
- geom_step->type = EEVEE_MOTION_DATA_MESH;
- }
- BLI_ghash_insert(mb->geom, key, geom_step);
+ if (mb_data->geometry_data == NULL) {
+ EEVEE_GeometryMotionData *geom_step = MEM_callocN(sizeof(EEVEE_GeometryMotionData), __func__);
+ geom_step->type = EEVEE_MOTION_DATA_MESH;
+ mb_data->geometry_data = geom_step;
}
- return geom_step;
- }
-
- EEVEE_GeometryMotionData *EEVEE_motion_blur_geometry_data_get(EEVEE_MotionBlurData *mb, Object *ob)
- {
- return motion_blur_deform_data_get(mb, ob, false);
+ return mb_data->geometry_data;
}
- EEVEE_HairMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_MotionBlurData *mb, Object *ob)
+ EEVEE_HairMotionData *EEVEE_motion_blur_hair_data_get(EEVEE_ObjectMotionData *mb_data, Object *ob)
{
- return motion_blur_deform_data_get(mb, ob, true);
+ if (mb_data->hair_data == NULL) {
+ /* Ugly, we allocate for each modifiers and just fill based on modifier index in the list. */
- int psys_len = (ob->type != OB_HAIR) ? BLI_listbase_count(&ob->modifiers) : 1;
++ int psys_len = (ob->type != OB_CURVES) ? BLI_listbase_count(&ob->modifiers) : 1;
+ EEVEE_HairMotionData *hair_step = MEM_callocN(
+ sizeof(EEVEE_HairMotionData) + sizeof(hair_step->psys[0]) * psys_len, __func__);
+ hair_step->psys_len = psys_len;
+ hair_step->type = EEVEE_MOTION_DATA_HAIR;
+ mb_data->hair_data = hair_step;
+ }
+ return mb_data->hair_data;
}
/* View Layer data. */
More information about the Bf-blender-cvs
mailing list