GPv3: Frame All/Selected keyframes
Update the `ACTION_OT_view_all` and `ACTION_OT_view_selected` operators to take into account grease pencil keyframes. Pull Request: https://projects.blender.org/blender/blender/pulls/111480
This commit is contained in:
committed by
Falk David
parent
6221ff436f
commit
3ee7900775
@@ -198,6 +198,19 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
else if (ale->datatype == ALE_GREASE_PENCIL_CEL) {
|
||||
const blender::bke::greasepencil::Layer &layer =
|
||||
static_cast<GreasePencilLayer *>(ale->data)->wrap();
|
||||
|
||||
for (const auto [key, frame] : layer.frames().items()) {
|
||||
if (onlySel && !frame.is_selected()) {
|
||||
continue;
|
||||
}
|
||||
*min = min_ff(*min, float(key));
|
||||
*max = max_ff(*max, float(key));
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
FCurve *fcu = (FCurve *)ale->key_data;
|
||||
float tmin, tmax;
|
||||
|
||||
Reference in New Issue
Block a user