Commit Graph

51 Commits

Author SHA1 Message Date
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
Sergey Sharybin
7172316b94 Merging r40366 through r40392 from trunk into soc-2011-garlic 2011-09-20 12:01:16 +00:00
Dalai Felinto
b263aefb0e TexFace to Material Settings big patch
Summary:
========
The idea here is to move the texface options into the material panel.
For images with the change please visit:
http://code.blender.org/index.php/2011/09/bge-material-texface-changes

1 - Some of the legacy problems 2.49 and 2.5x has with the texface system:
==========================================================================
1.1) Shadow, Bilboard and Halo are mutual exclusive (in the code), yet you can
select a face to be more than one mode.
1.2) Sort only works for blend Alpha yet it's an option regardless of the
Transparency Blend you pick.
1.3) Shared doesn't affect anything in BGE.
1.4) ObColor only works for Text objects (old bitmap texts) when using Texture
Face Materials. (not address yet, I so far ignored obcolor)

2 - Notes:
============
2.1) Now "Use Face Textures" in material Option panel will work in Multitexture
even if there is no texture channel.

2.2) In FaceTexture mode it will use TexFace all the time, even if you don't
check the "Use Texture Face" option in the UI. It's a matter of decision, since
the code for either way is there. I decided by the solution that makes the
creation of a material fast - in this mode the user doesn't need to mess with
textures or this "Use Texture Face" option at all. I'm not strong in my opinion
here. But I think if we don't have this then what is the point of the Texture
Face mode?

2.3) I kept references for tface only when we need the image, UV or the tiling
setting. It should help later when/if we split the Image and UV layers from the
tface struct  (Campbell and Brecht proposal).

3 - Changes in a Nutshell:
==========================
3.1) "Texture Face" panel (in the Mesh/Object Data panel) no longer exists. Those settings are all part of the material properties, visible when Game Render is set.

3.2) "Texture Face" Shading mode (in the Render panel) is now called “Single Texture”, it needs a material for special settings (e.g. Billboard, Alpha Sort, …).

3.3) New options in the Material Panel
* Shadeless option in the Material panel is now supported for all three Shading modes.
* Physics is now toggleable, this is the old Collision option.
* Two Side (on) is now called Back Culling (off).
* Alpha Sort is one of the Alpha options, together (and mutually exclusive) to Alpha Blend, Alpha Clip, Add and Opaque (i.e. solid).
* Shadow, Billboard and Halo are grouped in the “Face Orientation” property.
* "Face Textures" and "Face Textures Alpha" (under Options) can be used for all but GLSL shading mode (to be supported in GLSL eventually).
* The backend in the game engine is still the same as before. The only changes are in the interface and in the way you need to think your materials. The bottomline is: It’s no longer possible to share materials between faces that do not share the same game properties.

4 - Acknowledgment:
==================
Mike Pan for the design discussions, and testing along the whole development process.
Vitor Balbio for the first hands-on code with the interface changes. That helped me a lot to push me into work on that.
Benoit Bolsee and Brecht van Lommel for patch review (* no one reviewed the whole patch, or the latest iteractions, so I still hold liability for any problems).
Blender artists that gave feedback and helped testing the patch.

Patch review and original documentation can be found here:
http://wiki.blender.org/index.php/User:Dfelinto/TexFace
http://codereview.appspot.com/4289041/
2011-09-19 19:55:59 +00:00
Sergey Sharybin
0eda51f2ea Fixing issues with i18n stuff:
- Make gettext stuff draw-time. so switching between languages
  can happens without restart now.
- Added option to translate visible interface (menus, buttons, labels)
  and tooltips. Now it's possible to have english UI and localized tooltips.
- Clean-up sources, do not use gettext stuff for things which can be
  collected with RNA.
- Fix issues with windows 64bit and ru_RU locale on my desktop
  (it was codepage issue).
- Added operator "Get Messages" which generates new text block with
  with all strings collected from RNA.
- Changed script for updating blender.pot so now it appends
  messages collected from rna to automatically gathered messages.
  To update .pot you have to re-generate messages.txt using "Get Messages"
  operator and then run update_pot script.
- Clean up old translation stuff which wasn't used and most probably
  wouldn't be used.
- Return back "International Fonts" option, so if it's disabled, no
  gettext lookups happens on draw.
- Merged read_homefile function back. No need in splitting it.

TODO:
- Custom fonts and font size.
  Current font isn't nice at least for russian locale, it's
  difficult to read it.
- Put references to messages.txt so gettext can merge translation when
  name/description of some property changes.
2011-09-15 13:20:18 +00:00
Campbell Barton
df433c7a1d - move vgroup lock buttons on the panel into the vgroup specials menu.
- merge object.vertex_group_lock_all / object.vertex_group_invert_locks / "object.vertex_group_unlock_all into one operator.
- change lock button from a checkbox to a lock icon.
2011-09-14 08:21:21 +00:00
Campbell Barton
98961c9f19 initial cleanup for weight paint branch
- move get_selected_defgroups & count_selected_defgroups into blenkernel
- split calc_weightpaint_vert_color() logic so its more obvious whats default and multipaint behavior
2011-09-14 02:04:26 +00:00
Campbell Barton
b310a76a1b svn merge -r39558:39800 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-13 06:39:17 +00:00
Xiao Xiangquan
981f7fcd0d merge with trunk r39834 2011-09-01 15:08:32 +00:00
Thomas Dinges
4740dce4ec Revert a part of 39385.
Vertex Select Button got somehow into the Mesh panel.
2011-08-22 22:26:25 +00:00
Jason Hays
c58fb76f1a Merged 39338-39558 2011-08-19 17:15:30 +00:00
Campbell Barton
0b23d378fb fix [#28225] Solidify Modifier creates wrong results when vertex group is attached
infact this is not really a bug, irrespective zero vertex group weights gave overlapping geometry which isn't useful, add an option to set the thickness factor for zero weighted verts.
2011-08-14 06:43:58 +00:00
Jason Hays
c57d64468b Merged 39257-39338 2011-08-12 15:48:08 +00:00
Campbell Barton
b374ab919a import common classes from bpy.types, saves ~1000 python getattrs on startup. 2011-08-12 06:57:00 +00:00
Xiao Xiangquan
79656a65e0 finish handle for properties_XXX scripts 2011-08-02 16:51:50 +00:00
Jason Hays
4f8b9a4033 Removed code I no longer needed for multi-paint's newer system.
Added comments to the more complex functions.
2011-07-07 17:59:15 +00:00
Jason Hays
7858d9348e Merged 37865-38124 2011-07-06 13:49:47 +00:00
Campbell Barton
abb21a4da0 fix for python error when pinning a non mesh object in mesh editmode. 2011-07-03 07:21:33 +00:00
Jason Hays
84ea89e25f Merged from trunk with revision range 36835-37865,
(No conflicts had to be manually resolved)
Gave weight paint a basic ability to draw edges and vertices with an option
 (with colors for selected/unselected),
but I didn't make any vertex selection functions available in weight paint mode yet
(tested with edit mode for now).
2011-06-27 17:21:08 +00:00
Campbell Barton
eaae38551f pep8 compliance 2011-06-21 17:17:51 +00:00
Brecht Van Lommel
841c988179 UI: rename mesh Settings panel to Texture Space, since it only contains
settings related to that. Also close by default.
2011-06-06 19:44:28 +00:00
Daniel Salazar
86f2f425bf UI for texture space in mesh/curve/mball data properties
http://pasteall.org/pic/show.php?id=13244
2011-06-04 08:09:34 +00:00
Jason Hays
23737357ff Added a hard coded check box to the vertex group list items in interface/interface_templates.c list_item_row()
Made my 3 new buttons only appear in weight paint mode when there are vertex groups present
in properties_data_mesh.py

I took the now redundant check box out of properties_data_mesh.py

I took out unnecessary code (resulting from copy/paste) from my lock all, unlock all, and invert all functions of object/object_vgroup.c

(and I got rid of a new line in paint_vertex.c :) )
2011-06-03 16:08:03 +00:00
Jason Hays
8684d99e61 Made misc vgroups unable to change bone groups' weights when auto normalize is active
Added buttons for locking all vgroups, unlocking all vgroups, and inverting the locks of all vgroups
2011-06-02 17:28:04 +00:00
Jason Hays
3cde378fea 2011-05-27 19:13:54 +00:00
Nathan Vegdahl
7e5ff01f4a Button for adding shape keys now creates shapes from base mesh instead of
from the current shape mix.  The old behavior is still accessable from the
menu as "New Shape From Mix".

Checked with Sergey and Bassam that this is a good change.  New users
expect the add shape button to simply add a new blank shape, and get
confused when that is not the case.  It is also really easy to
accidentally have other shape information in a new shape when the
"from mix" behavior is default.
2011-05-14 20:23:05 +00:00
Campbell Barton
265cdf29fb fix [#26754] Live Edit and Editing UI scripts don't work 2011-04-04 10:13:04 +00:00
Campbell Barton
0c03fa78c1 fix [#26601] Python error when use of autocomplete
Was a naming collision with 'keys' python method, reserve keys/items/values/get for python.
Updated animsys_update.py for shapekey data paths.

renamed:
  Particle.hair --> hair_keys
  Particle.keys --> particle_keys
  Key.keys --> key_blocks
  EnumProperty.items --> enum_items
  KeyMap.items --> keymap_items 

noted:
  http://wiki.blender.org/index.php/Dev:2.5/Py/API/Updates#Since_2.56a
2011-03-25 02:12:44 +00:00