Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- 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
2021-06-10Add unit for time stored in secondsSergey Sharybin
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
2020-09-09Cleanup: Rename public "bUnit" functionsHans Goudey
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
2020-09-07UI: Add temperature unitsHans Goudey
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
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
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
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
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
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-17Units: add support for light power units in Watt. Use for Eevee lights.Brecht Van Lommel
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.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
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.
2019-01-09Fix T60338: Allow user to input units of another systemJacques Lucke
2019-01-08Fix T60327: Value input with adaptive imperial units not working properlyJacques Lucke
2018-11-15Units: Identifiers in PythonJacques Lucke
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
2018-10-03Units: Support for fixed unitsJacques Lucke
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
2018-09-24Spelling fixes in comments and descriptions, patch by luzpaz.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3719
2016-05-03Cleanup: use const for units APICampbell Barton
Also make return args explicit.
2014-08-26Move bUnit_getScaleUnit -> BKE_scene_unit_scaleCampbell Barton
unit.c intentionally doesn't include DNA or BKE headers (except its own)
2014-08-26Fix T41590: When scene scale is not 1.0, and units are "None," Blender ↵Bastien Montagne
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!).
2014-08-20BKE_units: Some cleanup (mostly bools instead of ints).Bastien Montagne
2014-06-17Fix some loss of precision in BKE's unit code.Bastien Montagne
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).
2014-02-03Code cleanup: use bools where possibleCampbell Barton
2014-01-04UI: Use bool rather then int/short's where possibleCampbell Barton
2013-12-21Support units in modal numinputBastien Montagne
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
2013-03-13Fix #34481: camera focal length and sensor size did not use units yet, now ↵Brecht Van Lommel
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.
2012-05-13code cleanup: header cleanup and remove some duplicate defines.Campbell Barton
2012-02-17unify include guard defines, __$FILENAME__Campbell Barton
without the underscores these clogged up the namespace for autocompleation which was annoying.
2011-11-05use (const char*) rather than (char*) where possible.Campbell Barton
also removed some unused function definitons.
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n
2011-10-10fix bad svn ID tagsCampbell Barton
2011-10-10header cleanup (no functional changes)Campbell Barton
2011-02-18doxygen: blenkernel under core as module.Nathan Letwory
2010-12-10bugfix [#25154] .MXF files should be included as a known video file type in ↵Campbell Barton
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.
2010-11-23use unit system for the grid floor (was only ortho before).Campbell Barton
2010-11-23Changes to the ortho grid drawing based on discussion with Ton.Campbell Barton
- 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.
2010-09-16- bone roll now in degrees not radians.Campbell Barton
- 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?
2010-09-15patch [#23758] Better handling of UTF chars in UNITS fields (lengths, ↵Campbell Barton
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.
2010-02-12correct fsf addressCampbell Barton
2009-08-17units with no separator can now be typed into number buttons - eg, 5'7" 2km4mCampbell Barton
2009-08-13added string max length option for unit functions bUnit_AsString and ↵Campbell Barton
bUnit_ReplaceString
2009-08-12unit grid snap while transforming, display units in the header.Campbell Barton
2009-08-12when units are enabled use them for 3d viewport grid drawing, display the ↵Campbell Barton
dimension for the smallest grid cell. still need to make this work with grid snapping.
2009-08-12Set the clickstep for unit buttons to each click moves 1 unit.Campbell Barton
2009-08-12- was displaying 1cm as 10mm because of double precission problem.Campbell Barton
- typing in numbers without any units will use the units displayed before editing the value. - fixed some errors
2009-08-11user interface units, off by default.Campbell Barton
- 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