Commit Graph

2984 Commits

Author SHA1 Message Date
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
d12ceec401 Fix T39861: UI destroys float precision.
Note this is only a workaround in fact, adding some precision in radians case.
Validating the field will still generate a precision loss (doing otherwise is
doable-ish, but likely to backfire and/or add too much complexity in an already
complex area).
2014-04-24 17:31:14 +02:00
43d695e82e Code cleanup: view2d api naming 2014-04-21 18:47:17 +10:00
9ae0e585b0 View2d: API Cleanup for view<->region conversion
View2D had some inconsistencies making it error prone in some cases.

- Inconstant checking for NULL x/y args.
  Disallow NULL args for x/y destination pointers, instead add:
  - UI_view2d_region_to_view_x/y
  - UI_view2d_view_to_region_x/y

- '_no_clip' suffix wasn't always used for non-clipping conversion,
  switch it around and use a '_clip' suffix for all funcs that clip.

- UI_view2d_text_cache_add now clips before adding cache.

- '_clip' funcs return a bool to quickly check if its in the view.

- add conversion for rectangles, since this is a common task:
  - UI_view2d_view_to_region_rcti
  - UI_view2d_region_to_view_rctf
2014-04-21 16:59:40 +10:00
b1e1f86eb7 Fix for UI_view2d_to_region_float (was ignoring x,y args)
use this for grease pencil stroke conversion to avoid float->int->float conversion.
2014-04-21 14:30:13 +10:00
1a1bc281e6 Code cleanup: style 2014-04-21 01:01:33 +10:00
a1cab0d38d Style cleanup 2014-04-17 20:03:39 +10:00
3e3efae7e9 Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.

own tests give approx 22% overall speedup.
2014-04-17 16:04:28 +10:00
1b9db9911d Code cleanup: use bools
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-04-17 16:04:28 +10:00
a5b9f22454 BGE - button for deactivate sensors, controllers and actuators
This change introduces a new checkbox to deactivate the sensors, controllers and/or actuators. It is useful during the development phase to avoid delete sensors, controllers or actuators if you want to test something new.

NOC: The wiki page is being updated (the images mostly), but the feature is already in the 2.71 release log.

{F61628}

Reviewers: moguri, dfelinto, campbellbarton, dingto, #user_interface, billrey

Reviewed By: moguri

CC: billrey

Differential Revision: https://developer.blender.org/D16
2014-04-16 22:40:07 -03:00
09e5aa5156 Fix T39234: popup menus behave poorly when they have not enough width for all their columns.
Issue fixed by:
* Not having constant width for all columns, but adapt each to its content's width;
* Adapting undo's menu height to undo list length (so that we never have more than three columns).

It is still possible to get issues in extreme cases (small screen, high DPI size,
long op names everywhere...), but this should now be rare corner cases.

Also fixes a minor glitch with undo menu (first column had one item less than the others...).
2014-04-15 16:49:49 +02:00
a7241d09cd GHash: add typed hash functions (were all (void *))
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing.
- BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *)

This also showed up incorrect use of inthash, which was using a pointer.
2014-04-15 14:22:36 +10:00
0d38f21cbc Fix the eyedropper not working properly with different scene linear spaces
Either was some residue from the past or somebody didn't implement this in
the right way.

Also fixed memory leak in ED_space_clip_color_sample() caused by missing
image buffer release.
2014-04-14 13:48:20 +06:00
2025e4cbb9 Code cleanup: quiet warnings & style 2014-04-13 11:26:31 +10:00
a2b3c93852 Slight modification to previous color wheel tweak.
Do not use compat version, we do not have a valid previous value really
to use here.
2014-04-12 19:33:28 +03:00
fb7df275b8 Fix for color pickers:
HSL/HSV value would still get converted from linear values.
2014-04-11 23:45:59 +03:00
2d655d370d Fix T39627
HSL sliders jumping. The issue here is that we store HSV in display
space.
To correctly account for that, made sure HSV/HSL is now using the
displayed
color to compute the values in the sliders. RGB values still show
the property values (linear for linear, gamma corrected for gamma
corrected)

We could change the way we store HSV uniformly (ie in all the code), but
we would need to add many more conversions in the picker code to account
for storing it that way. Also it doesn't make sense: Color pickers
should help with -visible- color selection. It may
be worth changing the RGB sliders as well.
My fix takes into account the way HSV is stored in HSVCube as well in
the code.
2014-04-11 15:13:11 +03:00
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
6238fb4c43 UI: de-duplicate UI_OT_copy_to_selected_button poll/exec 2014-04-11 08:33:54 +10:00
df63e8fd93 Speedup track preview widget for byte images
This gives a huge speedup gain for cases when you've got
rather huge markers on a byte images.

Done by skipping IMB_float_from_rect()/IMB_rect_from_float()
for such cases. We can sample the buffers without color space
conversion.
2014-04-10 21:14:36 +06:00
e6ca6956d3 Remove extra glEnd() call. 2014-04-10 01:26:23 +03:00
708b8d8716 Color pickers:
* Code Cleanup
* Fix some more color correction cases that were left unattended. (NDOF,
resetting the operation in circle pickers)
2014-04-07 19:35:29 +03:00
602629502c Clicking outside menus wasn't closing when opened from non menu popups 2014-04-04 07:33:42 +11:00
c019ae5ea3 I18N: add missing lines
Reviewed By: mont29

Differential Revision: https://developer.blender.org/D328
2014-04-03 22:49:27 +04:00
51abc2becd Fix for T39537 wasn't complete, buttons in popups remained unset. 2014-04-03 20:49:40 +11:00
f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
9caf702941 UI: Tweak last commit for UIList and image scopes' grip size.
Sorry, forgot the --hold arg to last arc land, wanted to check this before pushing... :/
2014-04-02 13:22:12 +02:00
9b3bd5582b Replace resize code of image scopes by use of new GRIP button.
This deduplicates/simplifies some code. Also cleanup up a bit scopes UI code!

Use new GRIP button for uiList grab-resize.

This allows us to greatly simplifies the code, and get rid of a few hacks in uiList event handling!

Note autosize mode of uiList is now trigered by any value of list_grip below a given threshold, rather than the fixed zero value...

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D343
2014-04-02 13:09:43 +02:00
4faef1e10c Add drag-resize to uiTemplatePreview (mat/tex/etc. preview widget).
This is done by adding a new button type, GRIP, similar to other numbuttons
(scroll, slider, ...), which here controls the preview height.

Then, we add a new DNA struct to be able to save that height in Blend files
(note I choose not to use Panel struct for this, because we would then have the
same limitation we used to have with uiLists, only one preview per panel
and no preview outside panel).

This implies a change to template_preview UI RNA/py API (each preview needs an ID),
but this is backward compatible, as by default datablock type will be used if no ID is
given (which means e.g. all material previews with no ID will have same height).

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D342
2014-04-02 13:03:11 +02:00
def5999f9b UI: support for dragging popups title area 2014-04-02 18:43:53 +11:00
442f2df736 Code cleanup: avoid redundant lookups for subwindows 2014-04-02 17:33:20 +11:00
fb25a86f43 Fix T39537: Multi button editing is unreliable 2014-04-01 22:10:41 +11:00
eaaacfc7b8 UI: Color-Ramp handles
- display handles with solid color.
- active handle is highlighted.
- 1/4 of the colorband draws solid.
- use old-style handles when zoomed out.

D289 by Charlie Jolly with own modifications.
2014-03-29 15:36:50 +11:00
1af69b6df3 Implement asymmetric and free handles type for masks
Summary:
The title actually says it all, it's just possible to
have independent free handles for mask splines. Also
it's now possible to have aligned handles displayed
as independent handles.

Required changes in quite a few places, but they're
rather straightforward.

From user perspective there's one really visible change
which is removed Handle Type menu from the panel. With
asymmetric handles it's not clear which handle type to
display there. So now the only way to change handle type
is via V-key menu.

Rewrote normal evaluation function to make it deal
with new type of handles we support. Now it works in
the following way:

- Offset the original spline by maximal weight
- Calculate vector between corresponding U positions
  on offset and original spline
- Normalize this vector.

Seems to be giving more adequate results and doesn't
tend to self-intersect as much as old behavior used to,

There're still some changes which needed to be done, but
which are planned for further patch:

- Support colors and handle size via themes.
- Make handles color-coded, just the same as done for
  regular bezier splines in 3D viewport.

Additional changes to make roto workflow even better:
- Use circles to draw handles
- Support AA for handles
- Change click-create-drag to change curvature of the
  spline instead of adjusting point position.

Reviewers: campbellbarton

CC: sebastian_k, hype, cronk

Differential Revision: http://developer.blender.org/D121
2014-03-28 17:54:38 +06:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
551d1a1ed5 Code cleanup: style 2014-03-24 13:14:19 +11:00
44d6c686fa Fix for Layout.operator_enum ignoring alignment 2014-03-20 01:34:24 +11:00
c450ea2ab0 Fix T39203: Boid particle naming UI semi-freeze
uiList was not handling correctly UI_BUT_DISABLED TEX name buttons!
2014-03-18 15:24:34 +01:00
eaf387b8df UI: bypass text clipping on buttons with no text 2014-03-18 11:07:10 +11:00
4d44f70d5f Follow up to previous commit:
Make HSL wheel useful in compositing.

In HSL, 0.5 lightness corresponds to most vibrant colors so make that
default for locked wheels (previous value of 1.0 just made it white).
Also, unlock the wheel for both very bright and very dark colors.
2014-03-18 01:33:28 +02:00
06de5be90e Fix T39228 Gamma/lift/gain are burned out in the circular color pickers
and value/lightness slider stops midway.

Issue here is manyfold:

Color wheel does not support properties with different soft min/max
values than 1.0 (which after experimenting a little I left as is), and
also color management is completely destroying the mapping between the
value slider and the RNA property value range. To solve this I have
disabled color management by setting the property to gamma corrected
(only in RNA, Sequence editor coders please check!), otherwise it will
just become a big mess of tracking where color comes from and what kind
of color transforms it needs in different color pickers (if property has
non normalized range etc). HSL is not really meant to represent colors
outside a normalized space so I have disabled setting lightness above
1.0 in this model.

This will work, however it is hacking a color picker to do something
other than what it is supposed to do: pick a color from the screen
accurately. Which means normalized values always. The non normalized
colors picked for lift/gain/gamma through the pickers do not correspond
to any accurate colors; they are rather a user friendly way to 'sort of'
choose a color and a gamma with an indication of maximum value.

I think that lift/gamma/gain nodes need a dedicated widget for this
(besides it is quite clear that some options are written for that use
case) -or- a separate gamma multiplier for the picked color (which
should itself be in a normalized space)
2014-03-18 01:08:36 +02:00
a861e5572a UI: Add theme color for viewport overlay
Was using wire or black in many places, this color is used for cursor,
camera guides, transform helper lines. So its possible to have a dark
background with light overlay color.

Patch D331 by Brita, with some edits.
2014-03-18 05:40:18 +11:00
7227117bed Fix own bug reported on irc by Venomgfx, missing value slider in color
pickers.
2014-03-17 20:01:33 +02:00
37dd7360d6 Code cleanup: naming conventions 2014-03-16 22:11:14 +11:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
433d55e9b4 Code cleanup: spelling & style 2014-03-15 23:46:02 +11:00
8f1a6e26b6 Fix Circle picker not liking linear color properties much. Again, visual
result for picked color was different from what was displayed on color
wheel under the cursor.
2014-03-14 02:30:27 +02:00
33f51abe4e Better fix for T37545.
This was supposed to fix inaccuracies between S-H wheel but it makes the
colors selected through the SV-H color cube wrong (see http://
%28SV-H%29-Inaccurate). Instead of deactivating color management for SV
and H widgets just reenable correction for the Hue wheel. This is wrong
because HSV always refers to display space and we -have- to account for
that when using linear color RNA properties.
2014-03-14 01:42:50 +02:00
5e56f45a66 Fix own bug after HSL picker commit. HSV Cube based pickers missed HSV
buttons.
2014-03-13 18:43:21 +02:00