Age | Commit message (Collapse) | Author |
|
Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.
|
|
|
|
Numeric input wasn't checking numbers were finite,
could crash transforming with skin modifier.
|
|
Use BPY_execute_* prefix for all Python execution commands
|
|
|
|
matching convention for fixed length api, eg: copy_v3_fl
|
|
Make the UI API more consistent and reduce confusion with some naming.
mainly:
- API function calls
- enum values
some internal static functions have been left for now
|
|
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!).
|
|
amount type.
Turned out to be a clean/fix up of modal bevel tool, percentage mode handling was broken,
numinput handling was broken, etc.
Also added a way to switch between bevel types (modes) with M key, and tweaked a bit
numinput code to return early in case of 'char' event with ctrl modifier.
|
|
second time
Commented out the 'no zero' protection of scaling transforms for numinput.
Issue is, once an axis has null scale, you can't regrow it from transform code
(you have to directly edit the scale property). This is not ideal, but getting
good behavior in this case is hairy...
Yet, when using numinput, you type precise values, so if you want to set it to zero,
set it to zero. User is assumed responsible, we should avoid too much 'invisible magic'
when handling precise inputs. ;)
Note: an idea for possible future feature would be to have an 'absolute' mode for numinput
(allowing to type in real value, not factors).
|
|
|
|
|
|
|
|
|
|
Ways how it was resetting its values (backspace) was far from satisfaying. Now, e.g. when scaling, it will reset at 1 (or whatever mouse-value it was before entering numinput), instead of some ugly 0.0 value.
Implementation details:
* Values passed to applyNumInput() are stored as default ones (val_org), if it is not EDITED.
* applyNumInput() returns a boolean saying whether it actually set values or not.
* When backspace hits its ultimate step (where it clears all EDITED flags and reset all default values),
it sets a temp FAKE_EDITED flag that will be used to apply one last time values of numinput
(so that default values actually get applied!).
There are important things to note here for code using numinput:
* Values passed to applyNumInput() should be valid and are stored as default ones (val_org), if it is not EDITED.
* bool returned by applyNumInput should be used to decide whether to apply numinput-specific post-process to data.
* *Once applyNumInput has been called*, hasNumInput returns a valid value to decide whether to use numinput as drawstr source or not.
Those two steps have to be separated (so do not use a common call to hasNumInput() to do both in the same time!).
|
|
Not 100% certain if this fixes, I will ask the user to verify through
buildbot.
|
|
possible.
There was actually a few bugs in new event handling of numinput :/
In case of 2.70 'a' release, this commit should be considered imho.
|
|
Hack around event code and check against ascii code, this way keyboards with "complex" access to '=' and '*' are still able to toggle numinput modes.
|
|
expected behavior from users!
|
|
Add 'pad *' in addition to '=' to toggle basic/advanced numinput modes.
|
|
This allows to get the same "quickies" as in previous (2.69) code, (XYZ, -/, etc.), yet keeping nice non-conflicting new stuff like cursor navigation or copy/paste.
You can switch to full mode hitting '=', and back to simple mode hitting 'ctrl ='.
|
|
Since there isn't always a numpad available this should work.
|
|
additional 'noise' digits.
Expose float precision helper in UI_interface.h API, so that numinput can use this helper as numbuttons already do.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D186
|
|
|
|
happening again.
|
|
Previous one was way over complicated, and did not worked with units!
|
|
multi-bytes utf8 chars (like the '°' of angle values), now call BLI_utf8_invalid_strip() to prevent this.
|
|
|
|
have to use ctrl to activate them)...
|
|
numinput).
|
|
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
|
|
redraw flag were mixing up types - int/char/bool, add enum type to use instead.
|
|
|
|
paste errors), also remove BKE_script.h
|
|
|
|
bevel/inset/marker-move would use uninitialized memory when used as modal operators and pressing backspace after entering values.
|
|
|
|
This commit adds "shift" and numtype to both Bevel and Inset mesh operators.
It also gets rid of the magicnumber used in NumInput to str operation (currently, 20 chars per element, now defined as NUM_STR_REP_LEN in ED_numinput.h).
|
|
investigation lead to finding 3 bugs here...
- transform key input handling didnt ignore minus key on an unsigned value as it should.
- not being able to set numcuts to 0 made typing in numbers not very useful.
- backspace would set the cuts to an unsigned value.
|
|
|
|
|
|
else if's
|
|
|
|
fix for sequencer unique naming which was missed with string length update.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
- remove print from numinput and get rid of some float/double warnings.
- nicer align line-number in text editor.
|
|
|
|
|
|
MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
|