Commit Graph

10 Commits

Author SHA1 Message Date
Campbell Barton 36c273b1f7 - bone roll now in degrees not radians.
- 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-16 04:19:22 +00:00
Campbell Barton 7d8f0fce7a patch [#23758] Better handling of UTF chars in UNITS fields (lengths, 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-09-15 17:37:00 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton 9f973bca78 units with no separator can now be typed into number buttons - eg, 5'7" 2km4m 2009-08-17 12:48:56 +00:00
Campbell Barton 52a6a07d67 added string max length option for unit functions bUnit_AsString and bUnit_ReplaceString 2009-08-13 17:05:27 +00:00
Campbell Barton b8fcda9ea5 unit grid snap while transforming, display units in the header. 2009-08-12 17:02:03 +00:00
Campbell Barton 45ba3d31c0 when units are enabled use them for 3d viewport grid drawing, display the dimension for the smallest grid cell.
still need to make this work with grid snapping.
2009-08-12 14:11:53 +00:00
Campbell Barton 8641833b57 Set the clickstep for unit buttons to each click moves 1 unit. 2009-08-12 08:16:10 +00:00
Campbell Barton 63b276efbf - was displaying 1cm as 10mm because of double precission problem.
- typing in numbers without any units will use the units displayed before editing the value.
- fixed some errors
2009-08-12 07:23:10 +00:00
Campbell Barton b2a77852ff user interface units, off by default.
- 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
2009-08-11 18:53:01 +00:00