Age | Commit message (Collapse) | Author |
|
Resolves unit tests failure since the D15085.
Also addressed API documentation and formatting format.
Differential Revision: https://developer.blender.org/D15162
|
|
acceleration, lens length, and power
`TEMPERATURE` type was also missing, not only the new-ish
`TIME_ABSOLUTE` one...
Added a static assert on the size of the `bpyunits_ucategories_items`
array, and a comment on anonymous enum of `B_UNIT_`, in the hope this
won't happen again in the future.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
|
|
Allows to define properties which will have proper units displayed
in the interface. The internal storage is expected to be seconds
(which matches how other times are stored in Blender).
Is not immediately used in Blender, but is required for the upcoming
feature in Cycles X (D11526)
The naming does not sound very exciting, but can't think of anything
better either.
For test it probably easiest to define FloatProperty with subdtype
of TIME_ABSOLUTE.
Differential Revision: https://developer.blender.org/D11532
|
|
This commit renames the functions in "BKE_unit.h` to be consistent
with the naming in the rest of blenkernel.
bUnit_AsString -> BKE_unit_value_as_string_adaptive
bUnit_AsString2 -> BKE_unit_value_as_string
bUnit_ReplaceString -> BKE_unit_replace_string
bUnit_ApplyPreferredUnit -> BKE_unit_apply_preferred_unit
bUnit_ToUnitAltName -> BKE_unit_name_to_alt
bUnit_ClosestScalar -> BKE_unit_closest_scalar
bUnit_BaseScalar -> BKE_unit_base_scalar
bUnit_IsValid -> BKE_unit_is_valid
bUnit_GetSystem -> BKE_unit_system_get
bUnit_GetBaseUnit -> BKE_unit_base_get
bUnit_GetBaseUnitOfType -> BKE_unit_base_of_type_get
bUnit_GetName -> BKE_unit_name_get
bUnit_GetNameDisplay -> BKE_unit_display_name_get
bUnit_GetIdentifier -> BKE_unit_identifier_get
bUnit_GetScaler -> BKE_unit_scalar_get
bUnit_IsSuppressed -> BKE_unit_is_suppressed
Differential Revision: https://developer.blender.org/D8828
|
|
Based on the original patch by Vaishnav S (@padthai), this adds
support for temperature units. Initially supported units are Celsius,
Kelvin, and Fahrenheit.
The units aren't used anywhere with this commit. Those changes should
happen in separate patches by adding PROP_TEMPERATURE to RNA property
definitions. But it should be ensured that the various solvers and
simulations actually properly use real units.
The complexity of some of the changes comes from the fact that these
units have offsets from each other as well as coefficients. This also
makes the implementation in the current unit system troublesome.
For example, entering 0C evaluates correctly to 273K, but 0C + 0C
doubles that result, because each unit value is evaluated separately.
This is quite hard to solve in the general case with Blender's current
unit system, though, so it is not handled in this commit.
Differential Revision: https://developer.blender.org/D4401
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
Prepare for enabling ReflowComments.
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
This affects point, spot and area lights. Sun light strength remains without
a unit. This change does not affect .blend file compatibility in any way, as
with the rest of the unit system it's purely a display and editing feature.
Not used for Cycles yet, that will be done after unifying the settings with
Eevee.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
|
|
I only specified the identifiers for the units that are actually accessible for now.
This way we can postpone some decisions for now. E.g. if it should be `METER_SQUARE`, `SQUARE_METER`, `METER_SQ`, ...
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3945
|
|
Users can select the main unit they want to use now.
Previously the displayed unit always depended on the magnitude of the value.
The old behavior can be restored by switching to the "Adaptive" mode for length, mass and time units.
Meters, kilograms and seconds are the default units for new and old scenes.
The selected unit is also the default unit for user input.
E.g. if cm is selected, whenever the user inputs a unitless number into a field of type length, it will be interpreted as cm.
Reviewer: brecht
Differential: https://developer.blender.org/D3740
|
|
Differential Revision: https://developer.blender.org/D3719
|
|
Also make return args explicit.
|
|
unit.c intentionally doesn't include DNA or BKE headers (except its own)
|
|
assumes translations are in meters.
Turned out there were several issues in handling of scale parameter by numinput.
Fixed that by factorizing more some code in common with 'usual' numbuttons eval code
(new `bUnit_getScaleUnit()` helper will return valid scaled value, depending on
given system and type).
Now, numinput behaves as expected - using default unit amended by scale in case no unit is given
(i.e. entering '20' with a scale of 0.01 will give you 20cm, and '20cm' as well!).
|
|
|
|
When converting text to value, units' "value" had only 6 digits of precision,
leading to annoying loss of precision esp. when mixing big and small units
(like e.g. miles and inches).
|
|
|
|
|
|
Summary:
This completly changes the way modal numinput is handled. Now, edited expression is a string, which then gets unit- and py-evaluated to get a float value.
We gain many power and flexibility, but lose a few "shortcuts" like '-' to negate, or '/' to inverse (if they are really needed, we still can add them with modifiers, like e.g. ctrl-/ or so).
Features:
- units (cm, ", deg, etc.).
- basic operations from python/BKE_unit (+, *, **, etc.), and math constants and functions (pi, sin, etc.).
- you can navigate in edited value (left/right key, ctrl to move by block) and insert/delete chars, e.g. to fix a typo without having to rewrite everything.
- you can go to next/previous value with (ctrl-)TAB key.
- As before, hitting backspace after having deleted all leading chars will first reset the edited value to init state, and on second press, the whole "modal numinput" editing will be cancelled, going back to usual transform with mouse.
Notes:
- Did not touch to how values are shown in header when modal numinput is not enabled (would do that in another commit), so this is still quite inconsistent.
- Added back radian support in BKE_unit.
- Added arcminute/arcsecond to BKE_unit.
(those unit changes affect all angle UI controls, btw, so you can now enter radians or longitude/latitude values when in degrees units).
Related to T37600.
Reviewers: brecht, campbellbarton, carter2422
Reviewed By: brecht, campbellbarton, carter2422
Thanks everybody!
Differential Revision: http://developer.blender.org/D61
|
|
they do.
I've added a separate camera unit type. It's a bit strange to have an exception for
this but it ensures units are shown in familiar millimeters and it also ensures
backwards compatibility.
|
|
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|
|
also removed some unused function definitons.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
|
|
|
|
|
|
the sequencer
[#25159] Vertex locations dont read correctly and are not labeled correctly in the properties bar.
- non rna buttons can now have units set.
- calls with invalid units system now raises an assert().
- include .mxf in filter.
|
|
|
|
- ortho grid now draws scaled by the view3d 'Scale' setting, venomgfx noticed this was missing.
- so as not to confuse add scale next to unit display text, so rather then "Metres" it shows "Metres x 1.5" otherwise its confusing that grid lines are not in exact units.
- changed grid spacing to grid scale (needed for more logical behavior with units)
- when units are enabled grey out subdivisions.
|
|
- rna buttons with units set now use the units base value for snapping.
- bone head/tail radius could be set negative.
matt: removed a check in ui_is_but_unit() which made angle buttons return false, what was this for?
|
|
angles, etc.)
from Lorenzo Tozzi (oni_niubbo) with minor edits.
--- from the tracker
The present situation is this: due to bug#22274, during editing, UTF chars are stripped from buttons with a unit associated
(length, angles, etc.).
Example: if the button displays '90°' and you click on it with LMB, the editing string will become '90'.
The problem arises if you use microns: '34µm' becomes '34' that blender interprets as 34 meters. So clicking on a button
and hitting enter won't confirm the previous value, but will change it (very badly also).
Of course nobody is using microns in blender, but the problem will arise when we will implement areas and option 'Separate
Units' will be enabled. The value '2m² 3cm²' will become '2m' during editing.
This patch solves the problem rewriting the string in a smarter way than just stripping the UTF chars: the unit is translated
from unit->name_short ('µm') to unit->name_alt ('um'). So clicking on '34µm' the editing string will become
'34um'.
--- end
note: rather then allowing empty strings in name_alt field I made it so if the unit system was the default one a NULL name_alt will just strip the string, since its the default its not needed.
|
|
|
|
|
|
bUnit_ReplaceString
|
|
|
|
dimension for the smallest grid cell.
still need to make this work with grid snapping.
|
|
|
|
- typing in numbers without any units will use the units displayed before editing the value.
- fixed some errors
|
|
- currently only distances work.
- user preferences, edit section to set the units and scale.
- option to display pairs (nicer for imperial display?)
- support for evaluating multiple comma separated values eg: 2',11" ..or.. 5ft, 4mil
- comma separated expressions/values accumulate 1+1,2**3,4cm/3
- attempted fast conversion from a value to a string so button drawing isn't too slow.
* imperial long/short *
- mile, mi
- yard, yd
- foot, '
- inch, "
- thou, mil
* metric long/short *
kilometer, km
meter, m
centimeter, cm
millimeter, mm
micrometer, um
nanometer, nm
picometer, pm
|