GPv3: Empty grease pencil object crash #119690
@ -610,7 +610,8 @@ static GPENCIL_tObject *grease_pencil_object_cache_populate(GPENCIL_PrivateData
|
||||
using namespace blender::bke::greasepencil;
|
||||
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(ob->data);
|
||||
const bool is_vertex_mode = (ob->mode & OB_MODE_VERTEX_PAINT) != 0;
|
||||
const std::optional<blender::Bounds<float3>> bounds = grease_pencil.bounds_min_max_eval();
|
||||
const std::optional<blender::Bounds<float3>> bounds =
|
||||
|
||||
grease_pencil.bounds_min_max_eval().value_or(blender::Bounds(float3(0)));
|
||||
|
||||
const bool use_stroke_order_3d = (grease_pencil.flag & GREASE_PENCIL_STROKE_ORDER_3D) != 0;
|
||||
GPENCIL_tObject *tgp_ob = gpencil_object_cache_add(pd, ob, use_stroke_order_3d, bounds);
|
||||
|
Loading…
Reference in New Issue
Block a user
Since you're using
value_or
now, this can just beconst blender::Bounds<float3> bounds
.Done. BTW
bounds
passed togpencil_object_cache_add()
, should I remove optional from function declaration?Yes! It looks like GPv2 was already using
value_or
so that can be changed as well. So thengpencil_object_cache_add
can just getBounds<float3>
.