[Bf-blender-cvs] [8c0bcfbd31e] temp-geometry-nodes-mesh-modifier: correct recursive dupli instancing
Jacques Lucke
noreply at git.blender.org
Tue Dec 8 13:21:15 CET 2020
Commit: 8c0bcfbd31e5da89957c31bcf74d1417427e1488
Author: Jacques Lucke
Date: Mon Dec 7 13:13:38 2020 +0100
Branches: temp-geometry-nodes-mesh-modifier
https://developer.blender.org/rB8c0bcfbd31e5da89957c31bcf74d1417427e1488
correct recursive dupli instancing
===================================================================
M source/blender/blenkernel/intern/object_dupli.c
===================================================================
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 9a8c560f116..d5434710e23 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -829,13 +829,18 @@ static void make_duplis_instances_component(const DupliContext *ctx)
size_to_mat4(scale_matrix, scales[i]);
float rotation_matrix[4][4];
eul_to_mat4(rotation_matrix, rotations[i]);
- float matrix[4][4];
- mul_m4_m4m4(matrix, rotation_matrix, scale_matrix);
- copy_v3_v3(matrix[3], positions[i]);
- mul_m4_m4_pre(matrix, ctx->object->obmat);
+ float instance_offset_matrix[4][4];
+ mul_m4_m4m4(instance_offset_matrix, rotation_matrix, scale_matrix);
+ copy_v3_v3(instance_offset_matrix[3], positions[i]);
+ float matrix[4][4];
+ mul_m4_m4m4(matrix, ctx->object->obmat, instance_offset_matrix);
make_dupli(ctx, object, matrix, i);
- make_recursive_duplis(ctx, object, matrix, i);
+
+ float space_matrix[4][4];
+ mul_m4_m4m4(space_matrix, instance_offset_matrix, object->imat);
+ mul_m4_m4_pre(space_matrix, ctx->object->obmat);
+ make_recursive_duplis(ctx, object, space_matrix, i);
}
}
More information about the Bf-blender-cvs
mailing list