Commit Graph

548 Commits

Author SHA1 Message Date
865796375b Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
2015-11-09 21:00:53 +01:00
e5916187e8 First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.

That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.

Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.

Future plans are also to be able to relocate missing libs and reload them at runtime.

Code notes:
    - Placeholder ID is just a regular datablock of same type as expected linked one,
      with 'default' data, and a LIB_MISSING bitflag set.
    - To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
        + Allocation of memory itself.
        + Setting of all internal data to default values.

See also the design task (T43351).

Reviewed by @campbellbarton, thanks a bunch!

Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
Julian Eisel
ef629e0d50 Quiet warnings
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
2015-09-04 01:04:37 +02:00
559e1434d8 parenthisize macro args to avoid errors 2015-08-02 13:54:06 +10:00
cdbb60b0a3 Select Shortest Path for edit-curve
D1391 by @pink.vertex with own fixes/edits
2015-07-09 17:03:00 +10:00
ee1b1b9e59 Curve: change rules wrt active bezier
Activate the vertex even if only a single handle is selected
2015-07-09 14:52:01 +10:00
161bbfcd19 Add BKE_nurb_bpoint_calc_normal 2015-07-09 02:56:04 +10:00
973afa0172 Cleanup: use listbase clear 2015-06-20 17:09:05 +10:00
22a4fcb146 Fix T44991: Apply transform skips poly-radius 2015-06-08 12:58:50 +10:00
e4cd4c383f Cleanup: style 2015-05-13 06:10:49 +10:00
a09341469e Depsgraph: Add evaluation callbacks for granular nodes update
This commit only adds callbacks which then later be used with major dependency
graph commit, keeping the upcoming commit more clean to follow.

Should be no functional changes so far still.
2015-05-12 16:06:37 +05:00
a5dead2e8c Fix T44604 bad quality of rake with bezier curves.
We can calculate tangents analytically for bezier curves, so just make
them awesome. New code uses forward differencing calculation for
efficiency just like curve calculation.

Picture before/after:

http://www.pasteall.org/pic/87843
2015-05-07 18:10:48 +02:00
be228d33f1 Curves: don't use 'charidx' for regular curves
Code attempted to sync them with materials,
but its not needed (and wasn't reliable).
2015-04-29 00:29:32 +10:00
4288ab16e5 Add material slot reorder buttons 2015-04-28 07:30:04 +10:00
1c96a84320 Cleanup: use BKE_animdata_* prefix 2015-04-04 15:13:56 +11:00
9683c2b129 Fix T42833: Kink on nurbs curve
Threshold for normalizing was too big.
2015-02-27 20:16:51 +11:00
9e9cd77b8d Compiler warning: double-promotion 2015-02-01 01:17:21 +11:00
027361c898 Fix T41834: Ctrl+LMB, Extrude Curves 2+ splines
Extrude and Ctrl+LMB now support multiple selected vertices.
Also maintain active vertices.

D964 by Tyler Sliwkanich with own modifications
2015-01-26 21:08:43 +11:00
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