LineArt: Fix back transformation issue for v3
Line art v3 strokes should not move along with the grease pencil object to keep the same behaviour as the old line art. Now fixed.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_threads.h"
|
||||
|
||||
@@ -963,6 +964,7 @@ namespace blender::bke::greasepencil {
|
||||
class Drawing;
|
||||
}
|
||||
void MOD_lineart_gpencil_generate_v3(const LineartCache *cache,
|
||||
blender::float4x4 mat,
|
||||
Depsgraph *depsgraph,
|
||||
blender::bke::greasepencil::Drawing &drawing,
|
||||
int8_t source_type,
|
||||
|
||||
@@ -5640,6 +5640,7 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
|
||||
}
|
||||
|
||||
void MOD_lineart_gpencil_generate_v3(const LineartCache *cache,
|
||||
blender::float4x4 inverse_mat,
|
||||
Depsgraph *depsgraph,
|
||||
blender::bke::greasepencil::Drawing &drawing,
|
||||
const int8_t source_type,
|
||||
@@ -5865,8 +5866,7 @@ void MOD_lineart_gpencil_generate_v3(const LineartCache *cache,
|
||||
int i;
|
||||
LISTBASE_FOREACH_INDEX (LineartEdgeChainItem *, eci, &cwi.chain->chain, i) {
|
||||
int point_i = i + up_to_point;
|
||||
float *point = (float *)&point_positions[point_i];
|
||||
copy_v3_v3(point, eci->gpos);
|
||||
point_positions[point_i] = blender::math::transform_point(inverse_mat, float3(eci->gpos));
|
||||
point_radii.span[point_i] = thickness / 2.0f;
|
||||
point_opacities.span[point_i] = opacity;
|
||||
|
||||
|
||||
@@ -802,8 +802,11 @@ static void generate_strokes(ModifierData &md,
|
||||
return *grease_pencil.get_editable_drawing_at(layer, current_frame);
|
||||
}();
|
||||
|
||||
float4x4 mat = ctx.object->world_to_object();
|
||||
|
||||
MOD_lineart_gpencil_generate_v3(
|
||||
lmd.cache,
|
||||
mat,
|
||||
ctx.depsgraph,
|
||||
drawing,
|
||||
lmd.source_type,
|
||||
|
||||
Reference in New Issue
Block a user