Commit Graph

77 Commits

Author SHA1 Message Date
Bastien Montagne
138c9dba9b Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.

See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.

Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.

Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.

Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:32:57 +01:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Campbell Barton
8e73b770d4 Remove slurph shape-key feature
This is an old option which wasn't working in over a year without complaint.
2015-01-07 02:06:37 +11:00
Daniel Salazar
c721ef5fd6 Slight improvements to vgroup tooltips 2014-11-17 07:58:22 -06:00
Bastien Montagne
00ff9da2ee ShapeKeys: rework 'move skey' code, and add options to move to first/last position.
Main moving logic is moved to new `BKE_keyblock_move()`, which makes it available from anywhere.
In addition, move code was reworked so that it only loops once on whole keyblocks list,
and it accepts arbitrary org and dest indices, not only neighbor ones.

Partly based on work by revzin (Grigory Revzin) in his soc-2014-shapekey GSoC branch, thanks!
2014-10-21 12:07:24 +02:00
gaiaclary
10da6ddbee Automatic commit by arc 2014-07-16 14:03:37 +02:00
gaiaclary
7eb539c04b Sort vertex groups by Armature Hierarchy
Sort vertex groups by Armature Hierarchy

Reviewers: mont29

Differential Revision: https://developer.blender.org/D649
2014-07-16 14:03:36 +02:00
Bastien Montagne
875aff2a9a Fix T39897: shape keys created while the Relative checkbox is unchecked start out with frame=0
So! First, frame for absolute shape keys: never allow a new key to have the same pos as an
existing one (this does not make sense). This way, the two workflows are possible (create
all keys and then animate ctime, or animate ctime and then create keys where you need them).

Also, fixed UIList for shapekeys, the "absolute" test was wrong, and better to show frame
value, even though not editable, than nothing in case of absolute keys.

And finally, add getter to RNA 'frame' readonly value, so that we output real frame values,
and not dummy internal ones (which are /100) in our API.
2014-05-18 22:05:21 +02:00
Campbell Barton
a15be34389 Code cleanup: unused python vars & imports
Use frosted rather then pyflakes
2014-04-25 05:36:16 +10:00
fab96b5913 UI List: remove separate name text fields.
It was never the intention to have these separate, and now that we can rename
directly in the list there is no more need for them.
2013-11-24 14:27:02 +01:00
Bastien Montagne
4c52e737df Add ctrl-click rename to most lists in Blender UI and templates/examples.
Notes:
* Did not touch to addons, that's up to the authors. ;)
* Did not removed any "name" field below lists. We might want to do this in some cases (less UI clutter), but probably not always, so will let maintainers of the related areas decide here.
2013-11-23 20:54:32 +01:00
Bastien Montagne
f842ce82e6 UI List: ctrl click on names in list can be used for renaming.
Summary:
More information here:
http://lists.blender.org/pipermail/bf-committers/2013-November/042113.html

Reviewers: brecht

Reviewed By: brecht

CC: mont29

Differential Revision: http://developer.blender.org/D8
2013-11-23 18:43:23 +01:00
Campbell Barton
1ea47c9af9 Code Cleanup: style, spelling and pep8 edits 2013-11-20 03:40:10 +11:00
Thomas Dinges
f79eff2984 Interface / Template Lists:
* Reduce the space of more lists, should be all in bl_ui/
2013-10-13 23:24:37 +00:00
Thomas Dinges
56e326caf1 Properties Editor / Mesh Data:
* Give the uiLists a default size of 1, when we don't have any element in it. This saves some space.

Vertex Groups and Shape Keys list will jump to 5 as before when we have an element, due to the additional buttons, for the others, just grow with additional elements.
2013-10-13 22:26:53 +00:00
Bastien Montagne
5b83a89c81 Followup to r59434 : py UI scripts edits.
Notes:
* Made those edits by full checking of py files, so I should have spoted most needed edits, yet it remains quite probable I missed a few ones, we'll fix if/when someone notice it...
* Also made some cleanup "on the road"!
2013-08-23 20:41:21 +00:00
Brecht Van Lommel
1268eda19b Fix #35994: shape key mirror without topology did not properly work after
doing mirror with topology.
2013-07-04 11:37:32 +00:00
Joshua Leung
4f3f95751a Bugfix [#35936] Can't create new vertex group when using Ctrl G menu
This was caused by r.57812

There were two problems here:
  1) vertex_group_vert_select_unlocked_poll()  had faulty logic which meant that
it always failed when there were no vgroups present yet - the final return
always just fell through
  2) Since the "Assign to New Groups" option was actually implemented using the
same operator as "Assign to Active Group" (just with an extra parameter set), if
the active group was locked, it was not possible to "Assign to New Group" (even
though a new group would not be locked).
2013-07-01 13:02:53 +00:00
Brecht Van Lommel
77e0709e48 Fix #35551: the topology mirror setting affected shape key and vertex group but
this was confusing as there was no setting visible for it. Now these menus
contain an entry to mirror without and with topology mirror.
2013-06-28 17:13:09 +00:00
Campbell Barton
5f0731dc8d add option to remove all shape keys at once (access from shape key menu on panel).
Without this there was no easy way to get a WYSIWYG copy of a mesh that had shape keys,
since removing them would adjust the mesh.
2013-06-05 06:34:18 +00:00
Gaia Clary
6d9fcdf983 Added 'clear active group' to object data properties -> Vertex Groups -> pulldown menu 2013-06-04 22:30:41 +00:00
Bastien Montagne
23aa0c9067 Fix uilists showing data names translated (reported on bf-translations ML by Satoshi Yamasaki aka yamyam, thanks!). 2013-02-08 16:01:21 +00:00
Campbell Barton
97d62f0183 style cleanup 2013-01-15 23:15:32 +00:00
Gaia Clary
51f36ac80a Added new function 'Remove Selection from All Vertex Groups' to the Vertex Group Special functions popup 2013-01-15 16:07:43 +00:00
Bastien Montagne
d2f9b8a2c0 Fix [#33825] Menu list widget does not work on UV and Vertex Colors
Own stupid mistake in recent UI list refactor - those two lists are a good example where a non-void 'id' is necessary, as they use the same class in the same window... Else, the same object is shared by the two, which can't work! :)
2013-01-10 18:54:01 +00:00
Campbell Barton
ceb9701507 don't store bevel weights or edge crease customdata layers in editmode unless they are needed.
configurable in 'Geometry Data' panel, will be added when running crease edges transform for example.
2013-01-10 04:43:31 +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
Sv. Lockal
dd2d54bae9 Use own list of actions for Vertex Group Lock operator instead of reusing Select All actions.
Previous actions and descriptions were confusing, e. g. UnLock All used the description of Deselect All.
2012-12-12 10:21:24 +00:00
Thomas Dinges
22e0ffa05b Added back "mesh.customdata_clear_skin"... followup for r50802 2012-09-21 22:33:43 +00:00
Thomas Dinges
0916de7a02 Fix for r50790, removed operator printed error into the console... 2012-09-21 13:41:43 +00:00
Campbell Barton
fd44038ed7 remove sticky buttons from the UI, this functionality may be removed and has had no UI access since 2.49 2012-09-21 10:40:48 +00:00
Campbell Barton
1f8f7310e9 calculate sticky wasnt working very well and had a few glites -
updating data was only being done on the active object but sticly was being calculated for the selection.

split this into 2 operators, one that works on the selection and another that operates on the active object - so we can have a button in the mesh panels that calculates sticky.

also note that there was no way to calculate sticky from the UI - perhaps this feature should die a quiet death?

anyway - it works better then it used to for now.
2012-09-21 06:37:42 +00:00
Campbell Barton
b889e9c573 There was no way to remove mesh data layers from the interface - add a panel that works in object an editmode.
currently can remove sticky/mask/skin vertex layers.

regarding the skin layer - while adding and removing the modifier normally works fine, its not 100% reliable since the mesh may be linked into another scene, or be a linked duplicate and the object with the modifier deleted.
2012-09-21 03:41:59 +00:00
Bastien Montagne
02ec32b60e Fix [#32163] vertex groups get wiped.
Usual "persistent" operator option... I guess there are still a few others that keep hiding in the dust! :)
2012-07-23 12:27:26 +00:00
Sergey Sharybin
74625c8d54 Minor interface change: space between vertex group specials menu and up/down buttons 2012-07-11 10:41:26 +00:00
Sergey Sharybin
28002edb6b Finish changes in up/down arrows for menus
Restored single triangle for special menus, which still isn't perfect but
probably makes more sense.

Added drawflag bit flags to button, which is currently used to declare, that
button need to have up/down arrows. This is needed because it's tricky to
distinguish if button should have such arrows. For example, ID search buttons
is a simple block button which doesn't directly mean it'll have pop-up menu
and not all buttons which cases pop-up menu to display need to have such
arrows.

So currently only ID selector button is forcing up/down arrows to be displayed,
all the rest buttons now behaves in the same way as it used to be before.
2012-05-23 14:24:40 +00:00
Ton Roosendaal
2d0c5b9017 Long old UI annoyance:
The up/down triangle icon for menus was not drawing when a menu had
an icon; even though space was reserved there. Note: this can only
work now with removing the ugly "down triangle" icon from buttons like
next to the Material list box (button pops up menu with tools).

Looks nicer this way anyway.
2012-05-22 15:50:13 +00:00
Campbell Barton
4a788a2277 expose absolute shape keyblock interpolation in the ui 2012-05-22 13:43:36 +00:00
Campbell Barton
2a54ef0442 there was no way to reset timing for absolute shape keys, add an operator to do so. 2012-04-05 06:10:15 +00:00
Campbell Barton
db562488d6 report [#30814] Absolute Shape Keys not working in 2.6
This report points out thet absolute shape keys are unusable.

The problem is there was no way to adjust the play time of a shape key (all absolte shape keys would start at frame zero with no way to change the speed).

Added an 'eval_time' property to the key block that works like the curve path evaluation time, so the time in the keyblock can be controlled.
2012-04-05 05:05:18 +00:00
Campbell Barton
23c8298ca0 fix for python called operators getting/setting the operator last used state, also set object.vertex_group_assign.new to false when accessed from blenders UI 2012-03-22 02:00:14 +00:00
Campbell Barton
68a8efa8d3 display keyblock mute in the shape key list.
Realize this is bcon3 but this is was very bad IMHO.
- button adjusting key block was in between 2 object settings - which is misleading/confusing.
- you needed to click through all shapes to check which was muted, currently you's assume 1.0 means the shape is enabled.
2012-01-30 09:49:30 +00:00
Campbell Barton
aa43cab820 weight paint buttons now work in weight paint vertex select mode 2012-01-02 16:59:46 +00:00
Campbell Barton
77bdef4d22 py scripts - replace bad uses of len(),
checking if the collection is True is faster since it only checks if it has at least one item, rather then going over all items.
2012-01-02 16:18:39 +00:00
Thomas Dinges
e07d4aed45 * Fix some wrong icon names in MESH_MT_vertex_group_specials, they caused errors.
Reported by Uncle_Entity in IRC.
2011-11-26 14:04:33 +00:00
Brecht Van Lommel
2345efc6c5 Patch #29336: renaming UV (Texture) Layer to UV Map in the user interface,
by Gaia Clary.

Rationale: the name was confusing and not always used consistently, and this
map itself is not something that can be layered, rather the map can be used
as texture coordinates in some layered setup.

The original intent was to indicate this contained more than just UV's, but
the game engine settings have already been moved out, and apparently users
didn't really get this from the name anyway.
2011-11-23 17:25:25 +00:00
Campbell Barton
d541a200c2 rename user interface operator properties from 'op' to 'props' 2011-10-23 00:53:50 +00:00
Campbell Barton
f4c56a879d remove use of gettext: _("...") style translation now its handled by rna. 2011-09-21 15:18:38 +00:00
Campbell Barton
8f5112f191 pep8 update & some minor cmake edits. 2011-09-20 18:29:19 +00:00