Fix #124297: GPv3: Build modifier natural drawing speed fix #124350
@ -766,7 +766,6 @@ static Drawing legacy_gpencil_frame_to_grease_pencil_drawing(const bGPDframe &gp
|
||||
/* Curve Attributes. */
|
||||
SpanAttributeWriter<bool> stroke_cyclic = attributes.lookup_or_add_for_write_span<bool>(
|
||||
"cyclic", AttrDomain::Curve);
|
||||
/* TODO: This should be a `double` attribute. */
|
||||
SpanAttributeWriter<float> stroke_init_times = attributes.lookup_or_add_for_write_span<float>(
|
||||
"init_time", AttrDomain::Curve);
|
||||
SpanAttributeWriter<int8_t> stroke_start_caps = attributes.lookup_or_add_for_write_span<int8_t>(
|
||||
@ -795,10 +794,8 @@ static Drawing legacy_gpencil_frame_to_grease_pencil_drawing(const bGPDframe &gp
|
||||
}
|
||||
|
||||
stroke_cyclic.span[stroke_i] = (gps->flag & GP_STROKE_CYCLIC) != 0;
|
||||
/* TODO: This should be a `double` attribute. */
|
||||
/* Truncating time in ms to uint32 then we don't lose precision in lower bits. */
|
||||
stroke_init_times.span[stroke_i] = float(uint32_t(uint64_t(gps->inittime * (double)1e3))) /
|
||||
float(1e3);
|
||||
stroke_init_times.span[stroke_i] = float(uint32_t(gps->inittime * double(1e3))) / float(1e3);
|
||||
ChengduLittleA marked this conversation as resolved
Outdated
|
||||
stroke_start_caps.span[stroke_i] = int8_t(gps->caps[0]);
|
||||
stroke_end_caps.span[stroke_i] = int8_t(gps->caps[1]);
|
||||
ChengduLittleA marked this conversation as resolved
Outdated
Falk David
commented
Use Use `double(1e3)`.
No need to cast to `uint64_t` before casting to `uint32_t`.
|
||||
stroke_softness.span[stroke_i] = 1.0f - gps->hardness;
|
||||
|
@ -591,8 +591,7 @@ struct PaintOperationExecutor {
|
||||
bke::SpanAttributeWriter<float> init_times = attributes.lookup_or_add_for_write_span<float>(
|
||||
"init_time", bke::AttrDomain::Curve);
|
||||
/* Truncating time in ms to uint32 then we don't lose precision in lower bits. */
|
||||
init_times.span[active_curve] = float(uint32_t(uint64_t(self.start_time_ * double(1e3)))) /
|
||||
float(1e3);
|
||||
init_times.span[active_curve] = float(uint64_t(self.start_time_ * double(1e3))) / float(1e3);
|
||||
ChengduLittleA marked this conversation as resolved
Outdated
Falk David
commented
Same as above, no need to cast to Same as above, no need to cast to `uint64_t` before casting to `uint32_t`.
|
||||
curve_attributes_to_skip.add("init_time");
|
||||
init_times.finish();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
We can remove this TODO I think