Commit Graph

12499 Commits

Author SHA1 Message Date
Martin Poirier
1cec028c91 fix remaining bug in straighten command
restrict snapping to exact (poly) points when snapping to the currently drawn stroke.
2009-01-29 22:45:59 +00:00
Martin Poirier
a17eade622 - Made embbed point rely on last embbed preview (when holding down shift and moving mouse around) for finding the proper depth. This makes it much easier to do polylines on partially occluded areas: just shift-hover a visible section than move to where you want along the volume before clicking to place a point (this sounds complicated but it isn't).
- Replace Cutout command by Straighten. Fonctionnality is the same except that it now keeps points in between cuts, just straightens them.
2009-01-26 22:43:12 +00:00
Martin Poirier
fc7af897b7 Prevent overdrawing to trigger when starting a stroke by snapping to an existing point.
Overdrawing copies point type from start and end point (better for polyline)
misc renaming some structs and vars (cleanup mostly)
2009-01-23 21:34:51 +00:00
Martin Poirier
c6715de1e9 misc bug fixes and display adjustments 2009-01-21 22:20:16 +00:00
Martin Poirier
16aa62e058 Command Gesture - Polygonize
New command option to turn continuous strokes into polylines.
2009-01-16 20:24:31 +00:00
Martin Poirier
9f742a0ba1 Don't change point type on overdrawn when there's only one. 2009-01-09 22:13:59 +00:00
Martin Poirier
07599ab3b2 limit overdraw to at least start or end near another stroke (otherwise, all strokes that crossed others replace them entirely). 2009-01-09 20:50:13 +00:00
Martin Poirier
7e76ce5d67 missing test for start of line caused crashes. 2009-01-09 20:35:37 +00:00
Martin Poirier
f1c4b4e7c5 Last version of overdraw didn't work great with polylines. Fix this and misc wrong initial values. 2009-01-09 19:25:10 +00:00
Martin Poirier
133ddcff04 display overdrawn stroke in gray, to easily see what is being replaced. 2009-01-08 18:23:48 +00:00
Martin Poirier
1240b0272d adjust strokes by redrawing over them
(has to be turned on in the panel because it can give unexpected results sometimes right now)

http://vimeo.com/2753749

http://blenderartists.org/~theeth/bf/etch-a-ton/adjust.ogv
2009-01-07 21:46:10 +00:00
Martin Poirier
9b3727b5e0 Fix crasher on non-reset pointer. Mostly happened panning view while drawing. 2009-01-06 19:00:22 +00:00
Martin Poirier
f6f309d2d1 In the panel, next to the number of joints, display the name of the current bone while sketching joints. Displays "Bone offset" when the next bone is not connected. Displays "Done" when all joints have been draw (note: you can draw more joints then needed, the retargetting algo will use the most useful ones).
Convert gesture is back. This time, it's a 3 straight line that cross itself once gesture (like drawing a triangle and recrossing the first line).
2009-01-06 18:10:13 +00:00
Martin Poirier
4a3630751d Cleaner code for gestures.
Command gesture (for flatten and cutout) now needs to intersect a line in two points and end in a pig tail (loop and intersect itself).

This is easier than the cross three times and self interesect once of before.
2008-12-19 19:47:25 +00:00
Martin Poirier
0611154cfe Flatten and Cut Out tools for correcting errors in strokes.
Ogg Video: http://blenderartists.org/~theeth/bf/etch-a-ton/gesture_command.ogv
Vimeo: http://vimeo.com/2546077
2008-12-16 21:07:12 +00:00
Martin Poirier
6651af413d When not using quick mode, automatically select the last drawn stroke. 2008-12-09 21:25:30 +00:00
Martin Poirier
2b9a6251d1 Reeb graph filtering
Add exception to normal nodes preservation when that node is the root node. In that case, pruning the arc is A-OK and in fact needed.
2008-12-09 20:46:25 +00:00
Martin Poirier
93efabc0d9 Off by one error at the end of reeb and sketch iterators causing despair and dismay. 2008-12-09 00:46:05 +00:00
Martin Poirier
28786f55e6 Retarget bug: missing angle cost on last bone. 2008-12-02 21:29:31 +00:00
Martin Poirier
e2fb12ea18 Step 3/3, merging subdivision/bone creation methods using iterators
This also adds a special Embedding option called "Peel Objects". This option makes the embedding snap consider objects as whole, taking the first and last hit of each of them to calculate the embedding point (instead of peeling with first/second, third/fourth and so on). This option is useful if you have mecanical pieces with lots of details (as single objects) and want to put bones in the middle (think of adding bones to a mecha, for example).
2008-11-29 20:37:10 +00:00
Martin Poirier
d467158158 Second step out of three for merging sketching subdivision methods with graph subdivision methods.
Graph subdivision uses graph arc iterators.
2008-11-24 19:24:49 +00:00
Martin Poirier
933ac8db12 Link pole controls to the parent of the bone with the IK constraint.
Presumably, this should give better result, but tests where not conclusive.
2008-11-24 17:48:40 +00:00
Martin Poirier
8a4a2d96d0 Fix bug with name templating text buttons (wrong event). 2008-11-22 22:22:38 +00:00
Martin Poirier
6ae70999b9 Cache the armature template graph while in editmode.
Display the number of joints in the selected template in the sketch panel
When using selected bones as template, turn off Connected if bone has a parent that is not copied.
2008-11-22 17:58:49 +00:00
Martin Poirier
c6ff0ec49d Change name templating to &S and &N (less potential bugs).
It now also accepts lower case versions (&s and &n).
2008-11-20 22:23:01 +00:00
Martin Poirier
0f3e985aca merging trunk 17485:17520 2008-11-20 21:57:21 +00:00
Martin Poirier
520a5b0926 Crasher fix.
If vertex groups had % in them, the function making the menu string would crash (in release only).
2008-11-20 21:45:22 +00:00
Campbell Barton
935ed8a53b commit yesterday broke scaling in the sequencer (dumb mistake)
also changed 3 if's into a switch statement for selecting the interpolation.
2008-11-20 00:34:24 +00:00
Martin Poirier
9bb9859753 draft for arc iterators to unify code.
Just moving code to work home, nothing to see here.
2008-11-19 20:01:13 +00:00
Campbell Barton
f8e56e96bf Split up the following imbuf functions in 2...
void bicubic_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
void neareast_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);
void bilinear_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float v, int xout, int yout);

Added...
void bicubic_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);
void neareast_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);
void bilinear_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v);

This is needed so for projection painting but generally useful if you want to get the interpolated color of a pixel in an image without having a destination imbuf.

While editing these I noticed the functons are a bit dodgy, they assume the input ImBuf has matching float/chr buffer to the output.
2008-11-19 03:28:07 +00:00
Campbell Barton
a4776347ea bicubic_interpolation - dont use pow(val, 3.0f) at all, do (val*val*val) instead,
Tested overall speedup is about 5x when scaling 4096x4096 -> 4000x4000 in the sequencer.

There were some artifacts in the resulting image but double checked and the old code gives the same problems.
Added back old code with #if 0's since its a bit more readable.
2008-11-19 02:07:23 +00:00
Martin Poirier
9ba822c4d7 Fix leak on exit (it's not a real fix, still uses silly global mem) 2008-11-17 23:02:53 +00:00
Martin Poirier
c08d374df2 merging trunk 17457:17485 2008-11-17 22:19:05 +00:00
Martin Poirier
826c6d935d QuatOne was so wrong is would make Hamilton cry.
Thankfully, very little code used it, the only exception being the retarget code in etch-a-ton.
2008-11-17 22:13:45 +00:00
Martin Poirier
2d0a005aaa Template retarget now works with normal conversion (not in Quick mode that is). 2008-11-17 21:11:12 +00:00
Martin Poirier
497c9b4ce7 Use grease pencil manhattan distance threshold for strokes. 2008-11-17 21:03:41 +00:00
Martin Poirier
139f6bb1aa New option for roll correction.
Calculate new roll based on the angle to the normal of the joint (cross produce of the two bones).

This works best in some cases but not in others, so it's an option for now.

I'll have to see if I can iron the left over kinks, then it can be made the default (with Align to view an added option).
2008-11-17 20:38:04 +00:00
Campbell Barton
3a1cfa5015 Added BF_PROFILE_LINKFLAGS, Compiling with BF_PROFILE=1 was also throwing a python error. 2008-11-17 10:43:12 +00:00
Martin Poirier
0bee65b624 Fix compilation on OS X
Patch by dfelinto
2008-11-17 00:54:45 +00:00
Hamed Zaghaghi
da1738377f 17973Patch by dfelinto, and also fixed a bug in 2d-filters 2008-11-15 12:10:16 +00:00
Martin Poirier
d2023e070c Pkey toggle sketching panel
(it used to do select parent, but that's already done with [ and ] for children, no need for a second key).
2008-11-14 17:33:15 +00:00
Martin Poirier
6eda50f8d9 Merging trunk 17342:17457 2008-11-14 16:09:23 +00:00
Martin Poirier
59ac45dd12 Reset max cost to FLT_MAX (this fixes a bug with early culling)
Optimization when number of buckets == number of joints
2008-11-14 15:46:51 +00:00
Martin Poirier
9c30c74bd5 Stroke conversion wasn't quite ok with unaligned armatures.
Last bugfix before sleep I swear.
2008-11-14 03:52:04 +00:00
Martin Poirier
7401c57fb3 Transform Roll Fixes for editbone. Special case for rotation, we don't need to guess in those case and the result is better if we use the real rotation. 2008-11-14 03:13:40 +00:00
Joshua Leung
fece3f5e97 Bugfix:
Grease Pencil crashed after duplicating a screen-area, and deleting a layer from the original screen-area. The duplication code was not reassigning some pointers.
2008-11-14 02:13:10 +00:00
Campbell Barton
ff0c599c4b update for compiling cross compiling win32 on linux, had a lot of trouble with makesdna, the only way I could build and link was as a
win32 binary.
Still unable to link blender.exe
and run with wine.
2008-11-13 23:12:38 +00:00
Martin Poirier
dc4ef17eea ==Armature==
Fix the roll mess in transform. Since roll is based on an automatically calculated up axis, transforming bones would mess up bone orientation. This code automatically adjusts the roll value to keep bone orientation as consistant as possible. That works all around in transform for all transformations.

Doesn't work with x-axis mirror though as that doesn't use transform elements (fixing it would be nice for later)

Most interesting is that it works with the mirror tool (obviously), so you don't have to fix all the rolls after mirroring one side of an armature.

It could be made an option if someone presents a good enough point for that, but I can't see why you'd want the previous mess instead.

NB: this also ports a utility fonction from etch-a-ton to set bone roll from an up axis.
2008-11-13 22:35:40 +00:00
Martin Poirier
e76f7e7930 Normal Orientation on EditBones uses roll for Z axis. 2008-11-13 21:44:32 +00:00
Martin Poirier
3d6be3536f Fix saving and loading of the template variable (it incorrectedly counted as a user). 2008-11-13 18:57:10 +00:00