Commit Graph

127 Commits

Author SHA1 Message Date
cd4123e1db use inline BLI_math functions for dot product and length calculation. 2012-01-22 17:20:37 +00:00
0e4f4acc2f comment unused vars 2012-01-09 22:18:04 +00:00
4e98dbe528 error in recent commit - disallow selecting hidden verts. 2012-01-03 02:45:03 +00:00
1e18da32fb replace:
CTX_data_pointer_get_type(C, "object", &RNA_Object).data
with api call:
  ED_object_context(C)

... since getting the context object is such a common operation.
2012-01-02 17:15:24 +00:00
aa43cab820 weight paint buttons now work in weight paint vertex select mode 2012-01-02 16:59:46 +00:00
74a1123059 Quite some compiler warnings... 2011-12-17 16:22:08 +00:00
994f4bb3f7 Code cleanup: fix a few warnings (>= 0 and == -1 tests on unsigned types). 2011-12-17 01:13:02 +00:00
27a56719a8 minor vertex group edits
* when freeing a deform weight, use one less memcpy call.
* vgroup_delete_object_mode(), was looping on the deform verts twice when it didn't need to.
2011-12-14 23:53:46 +00:00
3d5330f789 vertex group changes,
use more api functions more (some vertex group editing functions were copied about), also make some functions int oapi calls.

- remove defgroup_find_index(), use BLI_findlink instead since they both work the same way.
- move static function getNearestPointOnPlane() to BLI_math api function closest_to_plane_v3()
- ED_vgroup_give_parray() added option to return an array where unselected verts are NULL (simplifies code & works for lattice when it didn't before).
- more consistant error checking of ob->actdef.
2011-12-14 21:08:08 +00:00
f025b7b511 went over all uses of MDeformWeight.def_nr and made sure the value is clamped when used as an array index. 2011-12-09 08:20:27 +00:00
36e7a22fcc Disable redo for some vertex group operators to prevent confusing
situation when changing properties in redo panel messes up things.

This should help in cases described in #29527: Vgroup assign, remove and undo
2011-12-08 11:02:29 +00:00
2b49d05338 fix for NULL pointer free and add in some checks, while looking into bug [#29521],
add asserts so we know if an invalid active index is ever set.
2011-12-07 09:13:15 +00:00
eb233d9332 syncing some minor formatting edits from bmesh branch. 2011-12-04 23:04:43 +00:00
b202bf0564 fix [#29450] Mirror Vertex Groups issue 2011-11-30 07:11:29 +00:00
85497e35d0 Added method clear to most of collections which supports new/remove.
This method not added to animation-specific structures yet/
2011-11-23 16:12:11 +00:00
49ccf975f2 minor cleanup
- use NULL rather then 0 for pointers
- use static functions where possible
- add own includes to ensure func's and their declarations don't get out of sync.
2011-11-14 16:05:44 +00:00
094c9799f9 quiet -Wdouble-promotion warnings 2011-11-11 12:00:08 +00:00
2ad80bf3bb vertex group mirror
- now works in vertex select + weight paint mode.
- added option not to mirror all vertex groups.
2011-11-01 08:11:55 +00:00
bcdcbb65c1 macro to check if an object type supports vgroups 2011-11-01 06:45:36 +00:00
99075b35ed fix [#29044] applying mirror modifier causes crash; something with vertex groups? 2011-10-27 07:54:32 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
5cf593a778 strcpy() --> BLI_strncpy(), where source strings are not fixed and target size is known. 2011-10-19 23:10:54 +00:00
90b38eaa0c Minor: Other UI strings typos and tweaks. Also updated french po & mo. 2011-10-02 08:46:46 +00:00
018fa1540e whitespace edits, make formatting for functions consustent at least within the file. 2011-09-28 05:53:40 +00:00
3cff99c9a1 Commented and tagged some unused vars (gcc warnings...). Also fixed some uninitialized warnings. 2011-09-26 13:24:42 +00:00
dc09774fb6 use bli math functions for vgroup_fix operator. 2011-09-22 05:05:26 +00:00
f1a227cf43 check that descriptions dont end with a '.', for non release builds.
this is annoying for translators so rather then correct along the way which gives merge conflicts for branches - print a complaint message.
2011-09-21 17:52:51 +00:00
2cbf475fb2 Merged 40338-40364 2011-09-19 15:36:30 +00:00
f157a543c6 /blender/editors: Removed final points in UI strings and messages.
Plus a few cuts in very long lines…
2011-09-19 12:26:20 +00:00
a89b253aa6 edits to radish before merge with trunk
- removed some unused functions.
- renamed vars to make more sense paint_vertex.c 'flags' --> 'lock_flags'
- some odd modifications were made in unrealted, commented code, copy these back from trunk.
- rename vertex_group_fix 'cp' property to 'accuracy'
- make style more consistant with trunk.
- remove 'Radish' comments.
2011-09-19 02:43:03 +00:00
73863a1da5 Split do_weight_paint_vertex() to isolate the simple case.
Added a tool-tip to the "fix deforms" op.

Removed code markers:
"Radish"
2011-09-18 17:10:28 +00:00
a9c99f58f4 Changed the branch code markers to say "Radish" in response to a review.
They weren't & aren't meant to show ownership, they just help me navigate my related code.
2011-09-18 03:49:00 +00:00
1b5d16f1bf I made multitude of fixes based on the comments provided online:
Removed the drawSelectedVerts and added drawSelectedVertices, which uses dm->foreachMappedVert.

In calc_weightpaint_vert_color():
Made the weight paint color black and return instead of input=-1

Made the pose bone selection normal when multi-paint is inactive.

Name fix for functions using mv instead of mvert.

Used vector functions provided by the math lib.

Changed some MEM_callocN references to be stacks.

Changed dm_deform_clear to use ob->derivedDeform primarily

Made the variable "float **changes" into "float (*changes)[2]"

Used CTX_data_active_object() in place of CTX_data_pointer_get_type()

Added the invert selection hotkey "Ctrl+I" to weight paint's vertex mask.
2011-09-18 01:09:18 +00:00
a31869f267 some picky rna/variable renaming:
Mesh.wp_vert_sel --> use_paint_mask_vertex
2011-09-14 08:45:12 +00:00
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
86777f46e1 - use a flag define for bDeformGroup->flag rather than setting TRUE/FALSE
- rename RNA bDeformGroup.flag to "lock_weight"
2011-09-14 07:07:17 +00:00
4c99d83b56 another cleanup pass, quiet all warnings for GCC
- comment unused funcs/vars.
- replace some allocs with stack variables.
- use BLI_math functions to replace in-line vector math.
2011-09-14 05:25:43 +00:00
46eff26312 Small tweaks to vgroup_fix related functions.
Added further documentation.
2011-08-11 17:42:54 +00:00
e9393aa252 Added an error msg for Fix Deforms tool for active mirror modifiers
Stopped trying to draw verts with subdivision surface modifier active--
or any other time the dm->drawSelectedVerts function is 0.
2011-08-10 15:50:21 +00:00
a42426071b Weight Paint's vertex selection tools use zbuf like face select.
Removed the extra, unused object mode specific selection functions I had added
(they aren't being used anywhere as of now, and they didn't support zbuffering).
2011-08-09 16:32:15 +00:00
5e7ad7a66d Fixes a memory allocation problem
Uses functions that reduce duplicate code for clearing/recalculating deformations.
2011-08-07 17:19:18 +00:00
0e9e74ec8a Fixed a small problem with the Fix Deforms op involving the case where a weight was zero.
Adjusted the distance limitations on the UI to be more reasonable.
2011-08-04 16:07:24 +00:00
5b64ea472c Fix deform op tweaks:
The distance to/from the plane was added to the UI
The change that makes the vertex closest to the desired point is used instead of the most significant change.
2011-08-03 17:45:09 +00:00
566d936179 'Fix Deforms' op added to weight paint tools to smooth (remove/reduce) spiking caused by bones by altering vgroup weights
--it's still really simplistic (and slow!) so don't try fixing an entire mesh! xD
Also, don't use it on a mesh with a mirror modifier yet, just noticed that it does both vertices instead of one.

Minor UI text update for Vertex Masking
2011-07-29 17:36:49 +00:00
fb3783bd13 Added vertex masking support for the weight paint vgroup functions including:
Normalize, Normalize All, Invert, Clean, and Levels.

Face mask and vertex select/mask are now mutually exclusive options.

Went ahead and allowed vertex selection support and masking for vertex paint.
2011-07-20 15:56:35 +00:00
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
7fd1fe9fc8 draw sequences with invalid effect frame ranges pink to highlight they are invalid and wont render. 2011-06-07 18:34:33 +00:00
299602b360 fix for vertex group copy to selected
- was using un-initialized stack memory if the source / target object had no vertex group.
- if the target object had no vertex groups it would fails silently (not a bug but not very good functionality)
- added an error message if any copying fails.
2011-06-07 18:04:03 +00:00
e55833a094 fix [#27572] Mirror Shapekey and Mirror vertex Group not working for Lattice. 2011-06-06 06:40:09 +00:00
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