UnitSettings::scale_length was used to scale reported
values for operators (translate, shrink-fatten, voxel-size).
This isn't expected as the value isn't editable when the unit-system
is set to None.
Add BKE_unit_value_as_string_scaled utility function for clarity &
to ensure scaling is only applied when it should be.
The current temperature unit adjusts to Celsius or Fahrenheit based on
unit system, but specifically for color temperatures the convention is
to display them in Kelvin, and it'd be strange to e.g. see 11240°F when
opening the white balance panel.
Therefore, this adds a dedicated Color Temperature unit, and uses it
for the two existing blackbody temperature inputs in shader nodes.
Pull Request: https://projects.blender.org/blender/blender/pulls/123337
This commit tweaks some unit names:
- Remove `name_alt` for square mile "sq m" and cubic mile "cu m" as
they could easily be confused with meters.
- Correct plural forms for the ton units: rename "ton" to "tonne" for
the metric ton, and "tonnes" to "tons" for the imperial (short) ton.
Identifiers are unchanged.
- Swap `name_short` and `name_alt` for metric ton, hour, and second,
as `name_short` is used for UI display and should use the official
symbol. Keep the other form as `name_alt` for input.
- Use "t" and "tn" respectively as short names for the metric and
imperial (short) ton.
- Rename radian's short name "r" to "rad", keep it as alt name.
- Introduce alt names for km/h (kph), arcminutes (amin),
arcseconds (asec), for convenience.
References:
- https://en.wikipedia.org/wiki/Ton
- https://en.wikipedia.org/wiki/Tonne
Ref: !116762
Extract:
- Compositor error messages.
- `bUnitDef`s were broken after cleanup commit 2b77cd726d. Since each
unit's "display name" is now preceded by a consistent "name_display"
comment, the regex which extracts the unit is greatly simplified.
It now relies on the presence of the comment instead of the struct
order.
- "Preset" menu and "Apply Preset" button from the curveprofile
template.
- Operator labels from the catalog context menu.
Disambiguate:
- "Bake Data": can mean "Which data to bake" (verb), or "The data that
were baked" (noun).
- "Cache" in the Simulation Nodes panel is a verb, not a noun.
- "Mix" in the snapping menu is a noun, not a verb.
- "Top" and "Bottom" can mean the upper part of an object or the
highest point or element of something like a menu or list.
Pull Request: https://projects.blender.org/blender/blender/pulls/115963
When units were initially defined having each on their own line was
compact, since them more fields have been added, making the lines
overly long and the difference between each field non-obvious.
Further, the conversion from C to C++ [0], wrapped definitions onto the
same line (for some reason), resulting in lines over 700 wide.
Use clang-format & add struct ID's for clarity.
[0]: 129f78eee7
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).
However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.
This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.
Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).
Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.
Pull Request #110944
Also see #103343.
Couldn't move two files yet:
* `softbody.c`: The corresponding regression test fails. It seems like the
conversion to C++ changes floating point accuracy, but it's not clear where that happens exactly.
* `writeffmpeg.c`: Is a bit more complex to convert because of the static array in `av_err2str`.
Pull Request: https://projects.blender.org/blender/blender/pulls/110182