Commit Graph

30618 Commits

Author SHA1 Message Date
Nicholas Bishop
52418868eb Fix for size of VBO index type when drawing multires in sculpt mode.
The VBO index type can be either ushort or uint depending on the grid
size. The comparison was checking how many quads are in the array, but
this was incorrect; the size of the index elements should depend on
the maximum value they reference, i.e. the maximum coord/normal
element.
2012-03-16 23:21:40 +00:00
Campbell Barton
fa17b0a911 add select invert for lattice 2012-03-16 23:01:37 +00:00
Campbell Barton
875b69fa52 fix for own silly mistake with face creation (wasnt checking more then 1 vert was selected) 2012-03-16 22:24:56 +00:00
Campbell Barton
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
Antony Riakiotakis
56da174b14 bugfix. Brush zoom could fail if uv sculpting was on 2012-03-16 21:26:18 +00:00
Nicholas Bishop
fd2ea6b966 Follow up to fix in r44919: use standard stats in paint modes.
Removed the special case for header statistics in sculpt/paint
modes. The information provided was less useful, and less accurate
even because it didn't reflect multires.
2012-03-16 20:42:29 +00:00
Alexander Kuznetsov
ed44ddd816 Patch by Psy-Fi + my minor changes
Adds conformation on exit for windows. Needs to be enabled in user perf.

Tried to edit blender.exe.manifest for more modern dialog look, but didn't work out.
2012-03-16 17:37:45 +00:00
Bastien Montagne
2caa507b7e i18n stuff: adds translation_context to RNA structs (used for there ui name), and a first default "Operator" one for all operators' label.
The fact is, operators' label are nearly always verbs, while properties labels are nearly always nouns. So this should already solve many translations' problems regarding noun/verb confusion.

This commit also simplifies a bit i18n usage:
*Now IFACE_ and TIP_ macros (or there context versions, CTX_IFACE_/TIP_) are used nearly everywhere (with one exception, where code is a bit complex and needs to manually test whether ui/tip translations is allowed, so no need to redo it later through those macros).
*Also, those macros are now defined to NOP in case WITH_INTERNATIONAL is false, which avoid testing that define everywhere in code!
2012-03-16 15:39:25 +00:00
Sergey Sharybin
d110ae7791 Allow merging two tracks in cases when they've got overlapping tracked/keyframed
frame ranges using average position of both tracks as position/
2012-03-16 14:06:43 +00:00
Sergey Sharybin
d6339e94fe Fix #30561 Modifiers with use_apply_on_spline = True do not work on curve with shapekeys 2012-03-16 11:46:08 +00:00
Nicholas Bishop
0a9f817d35 Fix object mode check in stats_update.
Was checking object flag rather than mode.
2012-03-16 08:46:55 +00:00
Campbell Barton
f91407150a bmesh py api:
initial support for editing bmesh customdata per vert/edge/face/loop

shapes, crease, bevel weights working, missing UVs and Vertex Colors still.
2012-03-16 08:26:22 +00:00
Campbell Barton
1823bb4abb fix for building bmesh bevel with scons (source file was left out) 2012-03-16 05:25:02 +00:00
Campbell Barton
ebec111618 bmesh py api:
Wrap customdata, so far you can access the data layers in a pythonic way but not manipulate the customdata yet.

provides dictionary like access to customdata layers, eg:
  texpoly = bm.faces.tex["UVMap"]
  print(bm.verts.shape.keys())  # un-intended pun, keys() works on all layers.
  print("MyInt" in bm.edges.int)  # __contains__
  layer = bm.faces.get("CheckForLayer")
2012-03-16 05:03:13 +00:00
Nicholas Bishop
815beed922 Fix for multires VBO drawing in sculpt mode.
Forgot to use return value of function creating the index buffer.
2012-03-16 04:11:35 +00:00
Campbell Barton
eab24df950 bmesh: being back bevel modifier from 2.62 stable.
this is no big improvement but at least its not a regression.

using the new operator for the bevel modifier can be enabled again be uncommenting a define.
2012-03-15 23:56:46 +00:00
Campbell Barton
bed5ae5366 *picky* fix for edge rotate
- Edge rotate would leave verts selected, this would give problems because those selections would leave edges that would try to rotate when run again. now de-select old verts on edge rotate.

- Rotating into hidden verts gave odd results, now make sure hidden state is ok.

- BMO_slot_buffer_hflag_disable / BMO_slot_buffer_hflag_enable now have flushing for the hide flag too.
2012-03-15 23:23:04 +00:00
Sergey Sharybin
91c1f9ee77 Commit patch from Nicholas Bishop with some small modifications
to make nicer displaying of brush names.
2012-03-15 21:11:14 +00:00
Campbell Barton
2c895318e9 quiet debug print(), reported as [#30552], but infact is harmless. 2012-03-15 20:25:07 +00:00
Bastien Montagne
c9d0de49b9 mesh_validate code for bmesh (i.e. polys/loops).
Everything seems to work well (many tests making random changes over various meshes went good), but the code is a bit complex and hard to follow, due to the various possibilities of invalid poly/loop combinations… Code also makes more operations than previous tri/quad faces version (hence is a bit slower), but I don’t think we can do otherwise, it’s just the price for bmesh flexibility. ;)

Note: added the py script I used to make the tests, under source/tests/...
2012-03-15 20:10:07 +00:00
Campbell Barton
e24d221e2a add missing break statement from recent brush code refactor,
selecting texture paint brush would never run brush_generic_tool_set()
2012-03-15 19:24:16 +00:00
Thomas Dinges
1002714fd8 2.6 User Interface:
* New Icons for the File menu, patch by David Klein (cgeffex). Thanks a lot!
* This patch also adds a new icon for the use_filter_text in Filebrowser.
2012-03-15 14:36:54 +00:00
Nicholas Bishop
9dd4058833 Add RNA for brush capabilities (sculpt-only for now.)
Added a new RNA-only nested structure, Brush.SculptCapabilities. It
contains read-only properties that use the current sculpt tool (and
occasionally other brush properties) to determine whether some feature
is available.

For example, the grab and snake-hook brushes don't support the
strength property. Querying brush.sculpt_capabilities.has_strength
will return false only if one of these brushes is selected.
2012-03-15 09:10:54 +00:00
Campbell Barton
c38e8e7a66 missed these last commit 2012-03-15 06:51:09 +00:00
Nicholas Bishop
e945acdd21 Un-abbreviate 'use_space_atten' (Brush RNA) to 'use_space_attenuation'. 2012-03-15 06:39:54 +00:00
Campbell Barton
6ed9c58a3d prepare for adding bmesh py api for customdata layer access - no functional changes. 2012-03-15 06:08:27 +00:00
Nicholas Bishop
f53888c5cc Code cleanup: simplify brush tool selection operators.
Created a single unifed operator, PAINT_OT_brush_select, to replace
BRUSH_OT_sculpt_tool_set, BRUSH_OT_vertex_tool_set,
BRUSH_OT_weight_tool_set, and BRUSH_OT_image_tool_set.
2012-03-15 05:59:44 +00:00
Campbell Barton
b40386a3e3 fixes for vertex color (found when brining X3D import back)
- tessface vertex color had the wrong sized array passing to rna_iterator_array_begin
- re-calculating tessface's would clear them if they were already created (own mistake)
- ED_mesh_color_add initialized tessface vertex colors from the loop color array

also made rna's mesh.tessface_vertex_colors.new() work like tessface_uv_textures.new()
where layers can be added as long as polygons are not present.
2012-03-15 05:40:33 +00:00
Nicholas Bishop
7081abf51f Remove unused parameter from multires_dm_create_from_derived. 2012-03-15 04:08:57 +00:00
Campbell Barton
be7477c638 fix [#30542] Shear Vertical Seg Faults Blender
honor the T_FREE_CUSTOMDATA flag.
2012-03-15 00:57:14 +00:00
Campbell Barton
ea79c470d2 bmesh: Fkey now creates faces from 5 or more disconnected vertices.
Added function: BM_face_create_ngon_vcloud
creating quads and tris use this too since it finds the best face winding direction based on surrounding face (if any)
2012-03-14 22:57:15 +00:00
Campbell Barton
c2d93e8d4a comment cleanup 2012-03-14 22:39:56 +00:00
Lukas Toenne
6f7eb383c8 Use helper functions in node_select when selecting/deselecting nodes and sockets in operators. This ensure that sockets are not selected on their own (parent node is always selected too). 2012-03-14 18:10:57 +00:00
Lukas Toenne
6624090a23 Make extension mode (shiftkey) mandatory for socket selection. Otherwise the user can end up with unexpectedly selected nodes, since socket selection allows selecting inputs and outputs from different nodes, which in turn also mean the parent nodes are selected. This fits the workflow better, you already needed to press shiftkey before to use the auto-connect operator. It will also solve some problems with the upcoming reroute nodes, where the node is basically a single socket. 2012-03-14 17:52:50 +00:00
Sergey Sharybin
930f43bd96 Fix crash on edge extrude from textured view
Issue was caused by MFACE layer adding for even DM without tessellated faces
which lead to adding new layer but with NULL data. This causes issues when layer
with faces (after extrude) was attempting to add because currently CD only checks
if layer type exists but does not check for size of the layer.

Solved by not adding MFACE layer if there's no tessellated faces.
2012-03-14 14:09:56 +00:00
Antony Riakiotakis
a829a905da fix hang when loop selecting an ngon. We need to check if edge currently walked on has already been added 2012-03-14 13:52:17 +00:00
Jens Verwiebe
639cf31f8a Avoid a sigsev after 44830 when reports is empty, clang compile work 2012-03-14 12:03:49 +00:00
Sergey Sharybin
f1da62d31f Switch *nix fileops from calling external commands via system() to posix api calls
which resolves some possible issues with operating files with quotes and backslashes.

Also this might resolve (or at least help) resolving compilation error on GNU Hurd platform
which will help a lot maintaining Blender for Debian.
2012-03-14 09:39:43 +00:00
Nicholas Bishop
bbb76ccb25 Fix for multires undo with partial visibility. 2012-03-14 08:14:03 +00:00
Nicholas Bishop
4d3f11c66f Fix some errors in partial visibility drawing.
Also changed show-in-border key to SHIFT+H as suggested by Daniel
Salazar.
2012-03-14 07:37:47 +00:00
Nicholas Bishop
7454d939c5 Add partial visibility operator including keymaps and menu items.
Uses HKEY for border hide, CTRL+HKEY for border show, and ALT+HKEY for
show all.

Documentation:
http://wiki.blender.org/index.php/User:Nicholasbishop/PartialVisibility

Code review:
http://codereview.appspot.com/5695043
2012-03-14 06:32:43 +00:00
Nicholas Bishop
68b8f3b0a8 Skip hidden elements in PBVH iterator, raycast, and drawing. 2012-03-14 06:32:25 +00:00
Nicholas Bishop
b37a355c8e Copy hidden flag to vertices when applying multires modifier. 2012-03-14 06:32:13 +00:00
Nicholas Bishop
521e724edd Skip hidden elements in PBVH iterator, raycast, and drawing. 2012-03-14 06:32:03 +00:00
Nicholas Bishop
8717e35db3 Add DerivedMesh.gridHidden and CCGDM implementation. 2012-03-14 06:31:49 +00:00
Nicholas Bishop
82840ef94b Add MDisps.hidden bitmap.
Updates SDNA, customdata functions, and file read/write. Also adds
accessor functions to BKE paint.
2012-03-14 06:31:38 +00:00
Nicholas Bishop
0c91821364 Add new CCG accessor functions.
ccg_gridsize() converts a level into gridsize, ccg_factor() is for
converting coordinates between different multires levels.
2012-03-14 06:31:24 +00:00
Nicholas Bishop
7f2acc173e Add BKE mesh function to update edge/poly hidden flags from verts. 2012-03-14 06:31:14 +00:00
Nicholas Bishop
38d4848020 Don't wait for sculpt stroke to create PBVH.
This idea is borrowed from the multires modifier, which already
checked if the object was in sculpt mode and, if so, created the
PBVH. That check is now moved higher up the chain into
mesh_build_data(), so that it occurs for CDDerivedMesh too.

This also replaces an assert in cdDM_getPBVH for tesselated mesh faces
with a call to create them if missing.
2012-03-14 06:30:55 +00:00
Campbell Barton
ee9a00948b mathutils py api:
Vector.angle_signed(other)
  for 2D vectors to get the clockwise angle between them.

  in BLI math its called - angle_signed_v2v2()

shorthand for...

  atan2f((v1[1] * v2[0]) - (v1[0] * v2[1]), dot_v2v2(v1, v2))

also corrects compile error in last commit.
2012-03-14 06:14:15 +00:00