Fix T87297: Gpencil - Disable Frames and Start delay when use Factor
After talking with the GP team, we agree in disable these options when the factor is used in Build modifier.
This commit is contained in:
parent
3e3363a6ed
commit
bcf524328f
Notes:
blender-bot
2023-02-14 01:35:49 +01:00
Referenced by issue #87297, Grease Pencil Build Modifier: 'Frames' and 'Start Delay' values should be ignored when 'Use Factor' is checked.
|
@ -455,8 +455,10 @@ static void generate_geometry(
|
|||
/* Compute start and end frames for the animation effect
|
||||
* By default, the upper bound is given by the "maximum length" setting
|
||||
*/
|
||||
float start_frame = gpf->framenum + mmd->start_delay;
|
||||
float end_frame = start_frame + mmd->length;
|
||||
float start_frame = is_percentage ? gpf->framenum : gpf->framenum + mmd->start_delay;
|
||||
/* When use percentage don't need a limit in the upper bound, so use a maximum value for the last
|
||||
* frame. */
|
||||
float end_frame = is_percentage ? start_frame + 9999 : start_frame + mmd->length;
|
||||
|
||||
if (gpf->next) {
|
||||
/* Use the next frame or upper bound as end frame, whichever is lower/closer */
|
||||
|
@ -547,6 +549,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|||
PointerRNA *ptr = gpencil_modifier_panel_get_property_pointers(panel, &ob_ptr);
|
||||
|
||||
int mode = RNA_enum_get(ptr, "mode");
|
||||
const bool use_percentage = RNA_boolean_get(ptr, "use_percentage");
|
||||
|
||||
uiLayoutSetPropSep(layout, true);
|
||||
|
||||
|
@ -558,8 +561,12 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|||
uiItemS(layout);
|
||||
|
||||
uiItemR(layout, ptr, "transition", 0, NULL, ICON_NONE);
|
||||
uiItemR(layout, ptr, "start_delay", 0, NULL, ICON_NONE);
|
||||
uiItemR(layout, ptr, "length", 0, IFACE_("Frames"), ICON_NONE);
|
||||
row = uiLayoutRow(layout, true);
|
||||
uiLayoutSetActive(row, !use_percentage);
|
||||
uiItemR(row, ptr, "start_delay", 0, NULL, ICON_NONE);
|
||||
row = uiLayoutRow(layout, true);
|
||||
uiLayoutSetActive(row, !use_percentage);
|
||||
uiItemR(row, ptr, "length", 0, IFACE_("Frames"), ICON_NONE);
|
||||
|
||||
uiItemS(layout);
|
||||
|
||||
|
@ -567,7 +574,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|||
uiLayoutSetPropDecorate(row, false);
|
||||
uiItemR(row, ptr, "use_percentage", 0, "", ICON_NONE);
|
||||
sub = uiLayoutRow(row, true);
|
||||
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_percentage"));
|
||||
uiLayoutSetActive(sub, use_percentage);
|
||||
uiItemR(sub, ptr, "percentage_factor", 0, "", ICON_NONE);
|
||||
uiItemDecoratorR(row, ptr, "percentage_factor", 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue