Fix T37993: mass of Rigid Body ignores scene unit scale

Mass units weren't scaled in the ui.
This commit is contained in:
Sergej Reich 2013-12-31 17:58:55 +01:00
parent aaabac069f
commit 33a027b3a3
Notes: blender-bot 2023-02-14 11:25:10 +01:00
Referenced by issue #37993, mass of Rigid Body ignores scene unit scale
1 changed files with 3 additions and 0 deletions

View File

@ -1757,6 +1757,9 @@ static double ui_get_but_scale_unit(uiBut *but, double value)
else if (unit_type == PROP_UNIT_VOLUME) {
return value * pow(unit->scale_length, 3);
}
else if (unit_type == PROP_UNIT_MASS) {
return value * pow(unit->scale_length, 3);
}
else if (unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
Scene *scene = CTX_data_scene(but->block->evil_C);
return FRA2TIME(value);