Commit Graph

90 Commits

Author SHA1 Message Date
e6838ec5b0 * Change to the working of the left mouse select preference
Previously, the implementation of this was quite awkward, with
the preference swapping mouse buttons globally, rather than just 
selection, as is advertised on the pref. This had the effect of 
changing the painting in sculpt/texture paint/weight paint/etc to 
the left mouse button. This was totally silly, since when using a 
tablet, left mouse select is the sane way to go, but it meant 
that every time you wanted to sculpt or paint, you had to switch 
the mouse buttons around so you could actually use the tablet as 
normal.

This commit fixes that, and makes the preference do just what it 
says, use left mouse for selection (i.e. in object/edit mode) and 
only that.
2007-08-20 01:32:15 +00:00
d44d203893 == Sculpt Mode ==
* Made partial redraw mode a bit more robust, fixed a couple of potential problem spots
* Fixed display of smooth stroke with partial redraw.
2007-06-25 04:55:09 +00:00
b7c8eb39ed == Sculpt Mode ==
Removed the draw_flag field from SculptData, moved the two draw flags over to SculptData.flags
2007-06-24 23:02:58 +00:00
8cf2d5ca4a == Sculpt Mode ==
Added a new input control that smooths the brush stroke.

This option controlled by the menu item Sculpt>Input Control>Smooth Stroke. When enabled, the brush has a delayed effect on the model; a green line is drawn to indicate the smoothed path of the stroke. After ~200 pixels, the first half of the stroke will be applied to the model; the process then repeats, with a new segment of the stroke being applied to the model after every 200 pixels. On mouse up, any remaining portion of the stroke will be applied.

Other changes:
* Added a flags field to SculptData; currently only used for smooth stroke but other flags can be moved into it
* Moved the damaged_rects/verts into SculptSession
* Simplified brush application by moving init_editdata into do_symmetrical_brush_actions
* Removed Averaging from sculpt Input menu; smooth stroke should take its place

TODO:
* Fix display of the smooth line in Partial Redraw mode
* Make the smoothing and delay factors adjustable
* Optimize the stroke application (currently using the old 'dot' style of applying the brush)
2007-06-24 22:28:28 +00:00
531ffedba9 == Sculpt Mode ==
Kind of fixed [#6688] sculpt - if 2.44 blend is openned in 2.43 with flatten brush selected causes crash

* Added better handling for new brushes; if more brushes are added they will no longer cause a crash (but this doesn't help older Blenders compiled without this fix.)
2007-06-04 08:03:37 +00:00
4ec6f1b4e4 == Sculpt Mode ==
Fixed bug #6631, Sculpt Tool don't works correctly on a mesh with Armature modifier

* Modified the calculation of projected (2D) vertex locations to use deformed vertex locations when appropriate
2007-05-03 19:39:23 +00:00
674f23c536 == Sculpt Mode ==
Fixed bug #6639 ] Sculpt mode clearing brush texture causes a crash (null pointer)

* Added code to clear the brush texture preview (used for propset) when deleting a brush texture
* Added a check in tex_strength() for an empty (NULL) texture slot to prevent the crash
2007-05-03 19:11:54 +00:00
7fe8ea861a == Sculpt Mode ==
Fix for bug #6556, Sculpt draw/inflate brush strength is dependent on object scale value

Added a scaling factor to brushes that adjusts for objects which have been scaled. Usually this means that the vertex locations are also scaled up or down.
2007-04-16 05:57:06 +00:00
bbceedced0 * Tablet support fixup
This commit should hopefully fix some of the problems some people were
having with tablet support in sculpt mode, and also the problems I made
visible with my previous commit related to number field dragging.

Now, all the ghost related stuff is tucked away in ghostwinlay.c and a
simple Blender API, similar to the existing get_mbut() for example, is
provided to access the tablet data. As with the other mouse related data in
Blender, the tablet data is cached upon each mouse move or click, in the
Window struct.

You can now just use:

float get_pressure(void);
void get_tilt(float *xtilt, float *ytilt);
short get_activedevice(void);

to get such data from the tablet. Documentation on the returned data
is in ghostwinlay.c in the _Window struct definition.


Brecht and Nicholas, I've updated the painting and sculpt code and it works
just fine here, you may want to give it a check though to make sure I
haven't done anything silly.
2007-04-05 12:42:07 +00:00
afdd54fa37 moved source and text to american spelling
* colour -> color
* centre -> center
* normalise -> normalize
* modelling -> modeling
2007-04-04 13:18:41 +00:00
6b4f197983 == Sculpt Mode ==
Added a #define for the number of vertices the flatten brush should sample when calculating the distance to flatten to.
2007-03-17 20:11:50 +00:00
e4881c25c5 Fixed array declaration in sculptmode.c 2007-03-15 20:19:34 +00:00
a567e43628 == Sculpt Mode ==
* Added new brush, "Flatten". This brush pushes vertices along the normal defined by the average normal of each vertex within the brush area. The vertices are pushed towards the plane defined by vertices towards the edge of the brush. Essentially, this means that the direction of flattening is dependent on the surface beneath the brush.

* In order to make space for the flatten brush, the controls inside the Sculpt palette were widened to 268. (Note that the panel width didn't change, so it still fits properly in the vertical layout.)

* Todo: it would probably make sense to make the "View" slider available under the Brush tab available for the Flatten brush (currently it's only used for the Draw brush.)
2007-03-14 20:00:01 +00:00
04337d4ada == Sculpt Mode ==
Added a SculptSession parameter to sculptmode_propset_end, to avoid propset_end creating a new session (propset_end is called when freeing the session, so this can cause a memory leak.)
2007-02-27 23:54:55 +00:00
4b0db88d3e == Sculpt Mode ==
Removed special Sculpt Mode undo code. Sculpt Mode undo is no longer so useful, since in order to make it more correct it has gotten slower, so normal BIF_undo_push is used now. Fixes bug with Shape Keys, sculpting on a shape key wasn't doing undo properly.
2007-02-27 06:22:41 +00:00
d3f9e661de == Sculpt Mode ==
Followup to joeedh's commit, removed use of RenderInfo struct from Sculpt Mode.
2007-02-26 21:28:46 +00:00
eb7b0df8ea =Armature Undo Fix=
I forgot a few hide functions that needed undo pushes, and misnamed
an undo push in one of them.
2007-02-26 19:34:38 +00:00
53855b4a43 == Multires ==
Fixed bug #6056, Brush Grab in SculptMode don't works for ShapeKeys

* Grab Brush stores active vertices differently from other brushes, need to read from a different List when updating shape keys.
2007-02-23 06:02:46 +00:00
a7bccae477 == Sculpt Mode ==
* Replaced get_tex_angle() with tex_angle() and set_tex_angle(). This removes the need to do a bunch of error-prone NULL checking everywhere the texture angle is used.
2007-02-22 18:49:00 +00:00
05de3fb3d5 Bugfix #6053
When in sculptmode, enter editmode, add faces or vertices, exit editmode,
then undos/redos screw up mesh.

Now the stack for sculpt is freed. Later on one could precisely test why
this undo isn't resistant to such changes.
2007-02-15 20:32:08 +00:00
20a9712219 === bugfix ===
- possible fix for crash mentioned in [ #5781 ] Sculpt Brush Tool not working correctly
- workaround for possible compiler glitch with floating point conversion.
2007-02-14 19:40:17 +00:00
e215937509 Sculptmode fix:
Texture brushes were writing outside of array boundary. Might be the bad
one as reported for windows...
2007-02-14 12:31:00 +00:00
25d017b338 bugfix #5872
Crash when in sculptmode, add armature, switch to object mode.
2007-01-29 19:26:11 +00:00
c7718d2bcd - bugfix in Sculpt (irc reported): using a Texture Brush, and then unlink
the texture (in texture buttons) crashed painting. Reason was reading
  a NULL pointer.

- fix for bufix: commit by Ken Hughes accidentally deleted a bugfix
  (yafray render doesn't support bake, and should return)

- tooltip fix
2007-01-28 12:20:07 +00:00
21f431047f Fixed bug #5742, Crash on sculpt mode. This bug was triggered when adding a new object while already in sculpt mode. Sculpt mode wasn't being deactived on cameras, lamps, etc. Fixed in add_object_draw() by turning off G_SCULPTMODE, also by adding a check in sculpt_init_session() to be sure any previous session is free'd before making a new one. 2007-01-18 07:04:08 +00:00
5f798002c9 Added a new function+struct to glutil that takes care of reading in the OpenGL data needed for gluProject/gluUnProject. This allows retopo and sculptmode to share some of the same code, and is probably useful elsewhere as well. 2007-01-17 03:57:01 +00:00
49d1d10c1b Disable partial mesh visibility when leaving sculptmode. 2007-01-16 06:36:50 +00:00
e835a0ea55 Removed draw_mode from SculptData, replaced with draw_flag, which currently controls whether to use partial redraw and whether to draw the brush circle. Added new menu option for display of brush circle. 2007-01-14 04:55:51 +00:00
a1033a2878 Added warning for if user attempts to sculpt on a shapekey without turning on the lock (doesn't make sense to sculpt on an interpolated shapekey.) 2007-01-12 08:23:40 +00:00
49caf7ef6a Added a couple things my last commit missed; one more usage of set_sculpt_object removed, also added a check to make sure the user doesn't try to use partial visiblility on a mesh with shapekeys 2007-01-12 06:13:33 +00:00
25361281a1 Removed set_sculpt_object. Tested with sculpt undo, sculpt+multires, sculpt+partial visibility, and sculpt+shapekeys, seems stable. 2007-01-12 05:13:36 +00:00
413ff0ca2d Changed the way sculptmode interacts with shape keys. Vertex coordinates are now copied into the active key at the end of each brush action. (This is in preperation for removing the function set_sculpt_object.) 2007-01-12 04:47:38 +00:00
271e1ac00f Sculptmode bugfix: textures were not being scaled correctly to a [0,1] range for brush strength. 2007-01-09 03:17:03 +00:00
7177bf9321 Added a few comments to sculptmode.c 2007-01-07 19:37:24 +00:00
641679effc Bugfix #5578
ShapeKeys could get corrupted when using the sliders (or relative values).
Was caused by 25 dec commit to get SculptMesh work with Shapes... very
strange implementation here. For now, disabled this function to enter when
not in sculpt mode, while waiting for Nichololas to make it definite OK.
2007-01-07 16:41:44 +00:00
31e4149c44 Reverted my fix for bug #5539, brush circle cursor is slow. The fix was causing more sculptmode drawing artifacts for some users. Since this is a non-critical performance related bug, it can wait until after 2.43. 2007-01-04 07:03:00 +00:00
0762a5a975 Fixed bug #5582, Subsurfed Multires'd objects don't display properly with interactive display unset. Added a new function for sculptmode that checks to make sure that not only are there some modifiers active, but that they are actually enabled for realtime editing. 2007-01-04 06:11:45 +00:00
430f6d04b1 Sculptmode propset bugfix: texture angle should be ignored if there's no texture enabled. 2007-01-02 22:53:44 +00:00
0909fa71ea Added Ctrl+FKey shortcut for rotating the brush texture. Also improved the drawing of rotated brushes in propset mode. 2006-12-31 21:55:12 +00:00
e9bdfa4a3a Fixed bug #5556, sculpt - rotated texture is shown unrotated in the brush image 2006-12-31 19:49:59 +00:00
d63a2760b0 Extended the brush texture rotate option to work with Tile mode. 2006-12-31 11:31:39 +00:00
8b60504199 Bugfix for sculptmode texture tiling: tile size should not be affected by brush size. 2006-12-31 11:17:57 +00:00
34286476a5 Added texture rotation for sculpt brush (only drag mode for now.) 2006-12-29 23:14:34 +00:00
6a2ad12956 More improvements to the sculpt brush panel. Texture scale can now be set independently on the X/Y/Z axes for 3D textures and the X/Y axes for tiled brushes. The sizes can be locked together for 1:1 scaling. 2006-12-29 21:53:52 +00:00
b0dbba33f4 Reorganized brush palette into three columns. Changed brush View slider to the range [0-10], since there's really no need to it to values like 93%, 90% is close enough. 2006-12-29 20:13:03 +00:00
2f7abb43f7 Bug fix: if a file is saved with sculptmode on and a brush with a texture is enabled, the brush image must be loaded before it can be used. 2006-12-29 09:51:29 +00:00
dcb47000f7 Fixed case where sculpt brush texture is not set 2006-12-29 09:32:57 +00:00
d9e0e883f2 Sort-of-fix for bug #5382, sculpt - image/texture brush heavily distorted when not sculpting flat relative to screen
Fix for bug #5248, sculpt - mirrored tiled texture odd results

Changed the algorithm used for projecting the brush texture onto the model. The old algorithm was never implemented properly, causing increasingly
wonky distortions of the brush as it got farther away from parallel to the screen. The new system uses the screen coords of vertices, the obvious
advantage being that 2D screen coords can be mapped quite easily to 2D texture coords. The main disadvantage of this method is that there are still
distortions in the brush as the surface beneath it becomes less parallel the screen. These distortions, however, are not as bad as the old ones
because they are predictable from the user's perspective. (It's analogous to a movie being projected onto a sphere; if the viewer is in front of the
sphere there is no apparent distortion, but from the side the movie appears stretched and distorted.)

This may still be worth revisiting after the release.
2006-12-29 08:40:19 +00:00
ef0d41b956 Fix for bug #5539, brush circle cursor is slow. 2006-12-28 23:23:10 +00:00
356ea2ff28 Added numerical input for sculptmode propset 2006-12-28 08:24:37 +00:00