Commit Graph

787 Commits

Author SHA1 Message Date
4e981dc566 Fix #33345: Crash when using bpy.ops.sculpt.brush_stroke
It was kind of a regression in behavior in svn rev46862 which made it so
blender crashes if stroke is done from the script.

It should bring back the behavior back and made it so blender doesn't crash,
however it's probably not full fix and some further work is needed to make
call of stroke operator usable from the addon.
2012-11-29 13:24:02 +00:00
9fc95bd7ee use min/max inline functions where MIN2/MAX2 were doing type conversion. 2012-10-27 11:18:54 +00:00
6e62491c5a Fix #32522: Object's diffuse color not showing in Sculpt Mode
Added option to display object's diffuse color multiplied by sculpting
mask. This option could be found in Options panel of toolshelf when in
sculpting mode.

Thanks to Nicholas and Brecht for reviewing the patch!
2012-10-22 17:33:53 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
8b7896814f code cleanup: reduce change the size of some float vectors that were bigger then they needed to be.
update to clang_array_check.py - parse function definitions lazily for some speedup.
2012-10-08 07:08:29 +00:00
39a96e9e3f disable padding warning for DNA, gave problems with struct bounds padding which DNA ignores.
tag operator callbacks as needing their return values used. These are not directly called in many places so the inconvenience is minimal.
2012-10-06 00:42:30 +00:00
636a8d49a6 fix for crash in own recent masking commit with 'flood fill' operator. 2012-10-02 05:12:49 +00:00
df298490b8 mask data is no longer automatically added when sculpting (except when there is a multi-res modifier). 2012-10-01 05:19:57 +00:00
3e9a09d385 fix for some crashes running operators in background mode. 2012-09-23 05:33:23 +00:00
edb78d090c code cleanup:
- make view3d project names more consistent.
- remove apply_project_float() its not needed.
- update comments referencing an old function name.
- move doxygen docs into the C file, prefer they are kept here to avoid getting out of sync with code.
2012-09-20 04:56:24 +00:00
0d5d2146eb code cleanup: make shape key api names consistent with our new convention. 2012-09-19 10:12:07 +00:00
8b6046cdad Fix for order of creating mesh and filling in SculptSession
This would use proper draw_pbvh for initially calculated PBVH.

Wasn't harmful since this flag used to be updated form update_mesh_elements,
but it's still better to have things consistent all over.
2012-09-07 10:59:01 +00:00
ed36c625ee fix for assert when going from edit mode directly into sculpt mode.
the tessellation faces were not pre-calculated.
2012-08-01 17:25:10 +00:00
e32c60284a style cleanup 2012-07-29 00:20:28 +00:00
1091030c11 mask now draws in the image view, misc minor edits. 2012-07-25 13:44:59 +00:00
7cc5af4ef3 minor refactor for rect functions. more consistent naming. 2012-07-15 00:29:56 +00:00
8b865c01cd style cleanup: comments 2012-06-30 22:49:33 +00:00
a45cba5f71 Add missing brush types to sculpt_tool_name()
This function is used to name undo pushes in sculpt mode, was missing
some of the newer brush types. Also tweaked the switch statement so
that it will warn for future missing cases and removed extraneous
breaks.
2012-06-28 19:12:00 +00:00
74c9c24d27 style cleanyp 2012-06-23 23:22:19 +00:00
2062ca6b6c Decrease frequency of mallocs during multires sculpt smoothing
Patch from Jason Wilkins.

Creates a pool of allocations (one for each OpenMP thread) rather than
allocating every time do_multires_smooth_brush() is called.
2012-06-12 11:22:10 +00:00
51d9bf725d style cleanup 2012-06-10 19:59:02 +00:00
dc3645df1a Bugfix for autosmooth in sculpt mode.
This option was broken for non-multires meshes (not sure for how
long), as the pmap was not getting calculated.

Added a more general check for whether the pmap is needed, also added
an assert to warn about this in future.
2012-06-10 16:22:58 +00:00
32530c2827 Quite some warnings... 2012-06-07 18:21:07 +00:00
1931aac1f7 style cleanup: (indentation) 2012-06-06 14:48:39 +00:00
5f95f7d2ad Add input sample averaging to PaintStroke.
Averages input samples to make the brush stroke smoother. Only mouse
location is averaged right now, not pressure/tilt/etc.

The DNA is in struct Paint.num_input_samples, RNA is
Paint.input_samples. In combination with PaintStroke usage this change
applies to sculpt, vpaint, and wpaint.

The range of useful values varies quite a bit depending on input
device; mouse needs higher values to match tablet pen, so set max
samples pretty high (64).

Release note section:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Sculpting#Input_Stroke_Averaging
2012-05-21 23:32:46 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
997d7d50c9 Fix sculpt layer brush, broken by texture changes in r46651. 2012-05-19 23:11:46 +00:00
9dd981a440 style cleanup: block comments 2012-05-16 23:37:23 +00:00
9afb36b1e3 Add 'area' mode for brush texture projection.
This is similar to the 'view' mode, but uses the average local surface
normal rather than the view normal for projection.

Original code by Jason Wilkins (GSoC).

Documentation:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Sculpting#Brush_Map_Mode
2012-05-15 04:50:57 +00:00
cb24a9505a Code cleanup: refactor sculpt normal and related functions. 2012-05-15 04:44:20 +00:00
028e21adb3 Code cleanups for sculpt-related code.
* Renamed flip_coord as flip_v3_v3
* Added flip_v3 for same input/output
* Moved special case for grab brush's normal into calc_area_normal()
* Renamed 'fixed' texture mode as 'view plane', mirrors
  Brush.sculpt_plane terminology
2012-05-15 04:44:13 +00:00
c1570d9f49 code cleanup: missed some min/max use of float[3], also found case of DO_MIN/MAX re-reading same value from array 4 times when it can do once (use minf rather then MIN2, same for maxf) 2012-05-12 22:34:20 +00:00
ce17c35240 style cleanup: mainly sculpt/whitespace 2012-05-11 08:05:47 +00:00
919b363d13 Update the keymap for the mask brush.
* Add MKEY as a toggle for the mask brush. We could use ALT similar to
  SHIFT toggling the smooth brush, but it would conflict with MMB
  emulation (not to mention many window managers.)

* When the mask brush is active, SHIFT toggles it into smooth mode.
2012-05-10 20:35:41 +00:00
c8465eb42c Add mask brush for sculpt mode.
The mask brush currently has two modes, 'draw' and 'smooth'.
2012-05-10 20:35:32 +00:00
72de988d0f Use paint mask when calculating sculpt strength. 2012-05-10 20:34:54 +00:00
c9c0bfeeb8 Ensure mask layers are always present in sculpt mode. 2012-05-10 20:34:35 +00:00
f751d0f6ae Replace hardcoded DMGridData structure with CCGElem/CCGKey.
* Changes to DerivedMesh interface: DMGridData has been removed,
  getGridData() now returns an array of CCGElem pointers. Also added
  getGridKey() to initialize a CCGKey (implemented only by
  CCGDerivedMesh.)

* PBVH: added BLI_pbvh_get_grid_key().

* A lot of code is affected, but mainly is just replacing
  DMGridData.co, DMGridData.no, and sizeof(DMGridData) with the
  CCG_*_elem functions, removing the reliance on grid elements of
  exactly six floats.
2012-05-10 20:33:09 +00:00
a8e8775cb8 Code cleanup: make changes suggested by check_style for sculpt-related files. 2012-05-06 22:12:26 +00:00
53b221960a Last part of fix for [#31157]: Some (actually, 172) operators have no tooltip.
Only remaining undocumented one is IMAGE_OT_record_composite (not sure what it actually does, nor even whether it’s actually working or not...).

Note that I didn’t bother with operators flagged as OPTYPE_INTERNAL!
2012-05-06 15:03:31 +00:00
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
6292fb4cbd code cleanup: BKE_libblock_find_name() now takes an ID constant rather then a string. 2012-05-05 17:00:11 +00:00
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
084fedd03a code cleanup: brush/camera naming 2012-05-05 00:58:22 +00:00
ae585d5969 fix for last commit, (warning was without openmp only) 2012-05-03 20:26:05 +00:00
dfb3e41cf9 code cleanup: minor changes to get trunk compiling with strict warnings. 2012-05-03 19:47:16 +00:00
90b0be522c Patch [#30965] Cancel Sculpt Stroke w/ ESCAPE
If the RMB has not been released after starting a sculpt stroke, then hitting escape will cancel the stroke in progress and undo any changes to the mesh.

This is a slightly faster work-flow than using undo, is a feature available in other paint programs, and also puts in place the infrastructure to add other keys later that could tweak strokes in different ways.
2012-05-03 04:11:53 +00:00
2a6217859e Patch [#30255] Center Last Stroke
Enables the NUMPERIOD view centering operator to work in sculpt mode.  Hitting NUMPERIOD while in sculpt mode will center the view on the end of the last sculpting stroke made by the user.

This is useful for quickly refocusing on the current work area without fussing with the view controls.

It does not zoom into the stroke (slide only).

It does nothing if there have been no strokes.
2012-05-03 03:51:30 +00:00