Page MenuHome

UI: Remove incorrect RNA percentage property definitions
Needs ReviewPublic

Authored by Hans Goudey (HooglyBoogly) on Oct 25 2020, 10:25 PM.

Details

Summary


We now have a nice preference to control whether to display factors or
percentages, so it doesn't make sense to manually define properties with
percentages anymore.

In two cases the percentage property was actually used incorrectly, as
pointed out in T82070. The range was [0, 1], but the properties were still
displayed as percentages:

Given the the existance of RNA_def_float_factor, this patch completely
removes RNA_def_float_percentage to prevent further confusion. I would
be fine leaving this change out, but it's worth considering.

Fixes T82070

Diff Detail

Repository
rB Blender
Branch
prop-percentage-incorrect-fix (branched from master)
Build Status
Buildable 11024
Build 11024: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Oct 25 2020, 10:25 PM

When I search for "PROP_FLOAT, PROP_PERCENTAGE" I get a few matches like eraser_strength_factor, I guess they are cases where the developer wanted to force display of percents, or just old code?

  • Changes missed in previous commit
Hans Goudey (HooglyBoogly) retitled this revision from UI: Remove RNA percentage property definitions to UI: Remove incorrect RNA percentage property definitions.

When I search for "PROP_FLOAT, PROP_PERCENTAGE" I get a few matches like eraser_strength_factor, I guess they are cases where the developer wanted to force display of percents, or just old code?

Yeah, I'm not quite sure about that. I would like to discuss with the UI team whether there are circumstances where it's better to force the display of percentages with PROP_PERCENTAGE. If so there should be some guideline for when it makes sense.

Campbell Barton (campbellbarton) requested changes to this revision.Oct 28 2020, 11:13 AM

Generally seems fine, calling this percent no longer makes any sense though.

Suggest to rename to factor, the UI label as well.

This revision now requires changes to proceed.Oct 28 2020, 11:13 AM

Right, good point. I think I prefer "Ratio" here since it's more specific to this action.
If you have a strong preference though, I can use "Factor".