Commit Graph

11 Commits

Author SHA1 Message Date
Campbell Barton
97d62f0183 style cleanup 2013-01-15 23:15:32 +00:00
Campbell Barton
d984c46701 remove type checks on drawing uiList's,
if the list is given the wrong item then the script needs to be fixed, better not fail silently.

left in checks as commented out asserts.
2012-12-28 10:45:59 +00:00
Bastien Montagne
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
Campbell Barton
13254cde8c Alternate mask spline feather offset calculation method: now there are 2 [Even | Smooth]
- Even preserves thickness but can give unsightly loops
- Smooth gives nicer shape but can give unsightly feather/spline mismatch for 'S' shapes created by beziers.

This is an example where smooth works much nicer.

http://www.graphicall.org/ftp/ideasman42/mask_compare.png
2012-08-27 09:44:56 +00:00
Campbell Barton
9281f3e27e rename mask 'Shrink/Fatten' --> 'Scale Feather' 2012-08-17 13:59:08 +00:00
Campbell Barton
dd2f172fc4 add animation buttons to mask toolbar 2012-08-13 09:13:19 +00:00
Sergey Sharybin
a334b5a4b6 Made feather self-intersection check an option.
Useful in cases when masking stuff like self-intersecting
ropes. This could probably be smarter option, but can't
currently think about robust approach here.
2012-08-06 15:20:14 +00:00
Campbell Barton
2553cdf195 style cleanup 2012-07-29 12:07:06 +00:00
Thomas Dinges
ab38e1d379 User Interface Scripts:
* Code cleanup, removed unneeded code.
* Style cleanup, don't break lines to early 
(unless marked as pep8-80 or pep8-120 compliant) 
* Keep 1 line after layout declaration empty.
2012-07-29 10:03:46 +00:00
Campbell Barton
eed0fda33c add mask buttons into the image space 2012-07-25 13:44:07 +00:00
Campbell Barton
c01a561ca7 split out mask UI into their own classes. 2012-07-25 13:09:12 +00:00