Commit Graph

430 Commits

Author SHA1 Message Date
5d61cbf008 Curves: BKE_nurb_copy left duplicate arrays
While callers accounted for this, its quite error prone. Just NULL instead.
2015-01-26 18:22:54 +11:00
95847f6ac7 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Propper fix reverting most of rB60e70c0c6014e5, which was only partial specific fix.
This code uses generic `BKE_id_lib_local_paths()` func to handle all possible paths.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D977
2015-01-09 09:53:58 +01:00
23e14259d2 Code cleanup: synchronize const qualifiers between declaration and definition 2014-10-31 16:17:02 +01:00
4268f1c8f2 Fix T42018: Crash when displaying beveled poly-curves with spline bevfac mapping
This fix is for 2.72.
2014-09-30 15:58:19 +06:00
3a40aed3d5 Cleanup: use float versions of functions when in/output are floats 2014-09-24 14:55:02 +10:00
95db507eff Curve: Remove assert in BKE_curve_bevelList_make
Failed on any cyclic poly line.
2014-09-10 10:48:01 +10:00
94f35ecf1b Fix setting Curve-handle type moving the wrong one
Issue noted in T35952, now if you convert a free handle to an aligned handle,
it will move the selected handle.
2014-09-04 16:14:02 +10:00
4987eb4dc9 Fix T35952: Switching a single handle to free would lock the others alignment 2014-09-04 15:43:21 +10:00
e8f3fa99de Support more object types scene-scale (on creation)
- lamp
- camera
- font
- empty & effector

Also fix inconsistency with apply transform
(modified shape-keys for meshes but not curve/lattice)
2014-09-01 21:01:11 +10:00
d93c07d987 Cleanup 2014-08-21 09:23:07 +10:00
e1eb2e99f7 Correction to previous curve bevlist commit 2014-08-18 21:16:21 +06:00
6c7467e0da Fix T41085: Blender crashes when using "spline" or "segments" for bevel curve factor.
Root of the issue goes to the fact that bevel list calculation might drop some points
if they're at the same position. This made spline length calculation goes wrong.

Now the length of the bevel segments is stored in the bevel list, so values are
always reliable.

Initial patch by Lukas Treyer with some tweaks from me.
2014-08-18 17:38:20 +06:00
7df4fc5eaf Spelling 2014-08-13 09:34:37 +10:00
1097a3f70d Add helper to validate (and fix) material indices of meshes' polygons, curves' splines and texts' letters.
Useful especially for importer addons.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D650
2014-07-17 17:16:07 +02:00
804f58c0de Curve: zero memory on access rather then calloc
also remove redundant check
2014-06-19 15:30:08 +10:00
4b4bb410e0 Curve: replace calloc with malloc for values immediately written into 2014-06-15 14:36:33 +10:00
57372f4ef8 Curve: use zero length array for BevList for less confusing syntax 2014-06-15 14:23:23 +10:00
6a75ecda9b Code cleanup: spelling 2014-06-14 00:47:10 +10:00
bc9e66f083 Revert fix for T38594, caused T40186 (just accept limitation for now) 2014-05-27 21:29:52 +10:00
d84af360ca EditCurve: Replace -1 with CU_ACT_NONE define 2014-05-26 09:37:04 +10:00
eaf815f14a Fix for curve having invalid active vertex after setting type
also allow passing NULL vertex to BKE_curve_nurb_vert_active_set
2014-05-26 09:35:32 +10:00
be980b9f7d 3D Text: Change textbox placement to ignore font scale
Logic here was very stupid, texboxes would have their initial
locations scaled by font size but not their width/height.

Now its possible to change font size while keeping the textbox layout.

Other fixes

- tab character didn't work properly with textboxes.
- memory leak when VFontData was missing.
2014-05-16 10:32:29 +10:00
dc03a5ebe3 FCurve: handle calculation was measuring new handle lengths and not using for new ratio 2014-05-14 13:10:45 +10:00
4875a665cc Fix T40176: Curve Functions broken in several addons
Regression since 94e5e2f.

Handbook example about what happens when you use copy-paste
and don't test code after you did a cleanup.
2014-05-13 16:39:51 +02:00
ea6671a630 Fix for aligned handles in masking and curve objects
The issue has been introduced in 0985bb4, made it so curves and masks
stick to old behavior.

FCurves are still flaky, namely, grabbing both handles selected would
change the length of one of the handles which is not nice imo.
2014-05-03 21:58:02 +02:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
1ef06abc5e Fix T39947: Aligned handle behaviour problem in graph editor
Error in recent change to handle behavior
2014-04-30 02:43:55 +10:00
94e5e2f5d8 Code cleanup: simplify reallocs using MEM_recalloc 2014-04-29 07:50:25 +10:00
4de62241e4 Fix for typo in comment 2014-04-28 17:16:09 +12:00
0985bb483d Fix T38594: Incorrect behaviour when editing aligned handles in curve editor
With the right handle selected, the movement of the left handle appears constrained
to the frame it is currently on, leading to unpredictable and wild overshoots of the
bezier curve. There appears to be little benefit in doing so.

The effect of this patch is that makes it so that instead of trying (initially) to
maintain the same distance between the two handles and then overshooting randomly
later, the handles now try to keep the same distance from each other (i.e. similar
doing a rotation around the keyframe) at all times. While this means that it isn't
possible to set up assymetric handles (i.e. where ease in to the key is less than the
ease out for example) using aligned handles (it's still possible using free; it's just
a lot more work to keep them aligned), the benefits of removing of the random blips and jumps
when things jump outweight the losses.


Patch by Brecht
2014-04-28 17:15:23 +12:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
a3f5e6c76f Fix T39266: Weird Skin modifier shutdown
Fix wrong quat being calculated for curve's path.
Also avoid some divisions by zero.

Happened in cases when all the curve points have the same coord.
2014-04-11 17:56:08 +06:00
1e6d2b1dbf Code cleanup: remove paranoid NULL check 2014-04-08 07:46:28 +10:00
c61eb64f06 Fix T39635: Crash convening curve to mesh 2014-04-08 07:41:38 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
0782187979 Code cleanup: BKE_nurbList_handles_set used some strange logic 2014-03-30 15:04:20 +11:00
1f58bfb8be Code cleanup: de-duplicate cotangent weight function & add arg sizes 2014-03-30 11:08:33 +11:00
1af69b6df3 Implement asymmetric and free handles type for masks
Summary:
The title actually says it all, it's just possible to
have independent free handles for mask splines. Also
it's now possible to have aligned handles displayed
as independent handles.

Required changes in quite a few places, but they're
rather straightforward.

From user perspective there's one really visible change
which is removed Handle Type menu from the panel. With
asymmetric handles it's not clear which handle type to
display there. So now the only way to change handle type
is via V-key menu.

Rewrote normal evaluation function to make it deal
with new type of handles we support. Now it works in
the following way:

- Offset the original spline by maximal weight
- Calculate vector between corresponding U positions
  on offset and original spline
- Normalize this vector.

Seems to be giving more adequate results and doesn't
tend to self-intersect as much as old behavior used to,

There're still some changes which needed to be done, but
which are planned for further patch:

- Support colors and handle size via themes.
- Make handles color-coded, just the same as done for
  regular bezier splines in 3D viewport.

Additional changes to make roto workflow even better:
- Use circles to draw handles
- Support AA for handles
- Change click-create-drag to change curvature of the
  spline instead of adjusting point position.

Reviewers: campbellbarton

CC: sebastian_k, hype, cronk

Differential Revision: http://developer.blender.org/D121
2014-03-28 17:54:38 +06:00
Lukas Treyer
97cb76a45d Bevel Factor Mapping
Bevel Factor Mapping allows to control the relation between bevel factors
(number between 0 and 1) and the rendered start and end point of a beveled
spline.

There are three options: "Resolution", "Segments", "Spline". "Resolution"
option maps bevel factors as it was done < 2.71, "Spline" and "Segments"
are new.

* "Resolution“: Map the bevel factor to the number of subdivisions of a
  spline (U resolution).
* "Segments“: Map the bevel factor to the length of a segment and to the
  number of subdivisions of a segment.
* "Spline": Map the bevel factor to the length of a spline.

Reviewers: yakca, sergey, campbellbarton

CC: sanne

Differential Revision: https://developer.blender.org/D294
2014-03-28 16:44:33 +06:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
4cfd14644b 3D Text: textbox selection while in editmode
D395 from Henrik Aarnio with some improvements.
2014-03-11 17:16:08 +11:00
b839fb9bb7 Fix T38985: Setting endpoint_u property while creating spline in Python gives strange behavior 2014-03-07 14:05:38 +06:00
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
f29dadc5ea Code cleanup: comment unused code in calchandleNurb_intern
Also remove outdated comments.
2014-03-01 12:58:52 +11:00
ba08031783 Fix T38817: FCurve autoclamp error
Animating large values with auto handles didn't work well,
(large variations on the Y axis would shrink handles).
2014-02-28 12:11:09 +11:00
4622fc418e Fix T38863: FCurve auto-clamp allows handle to move past X bounds
F-Curves with large Y axis had strange behavior where the handles could
stretch out on the X axis rather then clamping as they do at smaller sizes.
2014-02-27 17:15:49 +11:00
55fe91abf3 Code cleanup: curves calculation was using offsets confusingly
also avoid calculating handle length when align isn't used.
2014-02-27 17:03:35 +11:00
572a199a24 Fix for off-by-one error switching nurbs direction 2014-02-20 20:11:03 +11:00