Commit Graph

437 Commits

Author SHA1 Message Date
1beebcb10c Depsgraph: Reduce number of depsgraph_legacy usages outside of depsgraph 2017-10-20 17:01:35 +02:00
1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
c9aef27326 Depsgraph: Begin work on making depsgraph per-scene-layer
This is a first step towards proper depsgraph "ownership", where
we would allow scene to be in multiple states dependent on active
workspace or scene layer.

This commit introduces a basic API to get proper dependency graph
for a given scene layer. It also renames scene->depsgraph to
depsgraph_legacy, so it's easier to search0-n-replace in the future.
2017-07-13 15:43:36 +02:00
f2a8b74c25 Merge branch 'master' into blender2.8 2017-05-26 19:57:28 +10:00
f78ba0df02 Fix T51350: 2D curve normals flip when deformed
Deforming 2D curves & text with modifiers/shape-keys
could flip the normals.

Now check the back-facing flag instead of `z < 0`.
2017-05-26 19:03:30 +10:00
7b45edacab Depsgraph: Remove old header from blenkernel 2017-04-06 16:11:50 +02:00
a1b8c0bca2 Depsgraph: More type definitions to new depsgraph header 2017-04-06 15:37:46 +02:00
5e1d4714fe Fix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading
So... Curve+shapekey was even more broken than it looked, this report was
actually a nice crasher (immediate crash in an ASAN build when trying to
edit a curve shapekey with some viewport rendering enabled).

There were actually two different issues here.

I) The less critical: rB6f1493f68fe was not fully fixing issues from
T50614. More specifically, if you updated obdata from editnurb
*without* freeing editnurb afterwards, you had a 'restored' (to
original curve) editnurb, without the edited shapekey modifications
anymore. This was fixed by tweaking again `calc_shapeKeys()` behavior in
`ED_curve_editnurb_load()`.

II) The crasher: in `ED_curve_editnurb_make()`, the call to
`init_editNurb_keyIndex()` was directly storing pointers of obdata
nurbs. Since those get freed every time `ED_curve_editnurb_load()` is
executed, it easily ended up being pointers to freed memory. This was
fixed by copying those data, which implied more complex handling code
for editnurbs->keyindex, and some reshuffling of a few functions to
avoid duplicating things between editor's editcurve.c and BKE's curve.c

Note that the separation of functions between editors and BKE area for
curve could use a serious update, it's currently messy to say the least.
Then again, that area is due to rework since a long time now... :/

Finally, aligned 'for_render' curve evaluation to mesh one - now
editing a shapekey will show in rendered viewports, if it does have some
weight (exactly as with shapekeys of meshes).
2017-02-22 21:56:49 +01:00
05a60aaa07 Fix T48723: Curve bevel creates invalid geometry 2016-06-25 13:57:35 +10:00
8f0a44a5d5 Cleanup: use BLI_bitmap for bevel-split 2016-06-25 11:24:25 +10:00
f2c40ca9f0 Fix uninitialized memory use lattice-boundbox
Many other places weren't clearing boundbox dirty flag after calculation.
2016-03-04 21:50:54 +11:00
b333a7570f Cleanup: spelling 2015-10-07 15:02:06 +11: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
ecdbe3cc63 Cleanup: style 2015-06-17 07:06:59 +10:00
268524c025 Cleanup: use const for typeinfo 2015-03-30 21:18:49 +11:00
1b327aa219 Fix T44186: Bezier Bevel facto mapping broken when 'start' was set to 'Resolution' and 'end' was not.
Trivial, we need totla_length in that case too.

Safe to be backported to 2.74.
2015-03-30 10:24:26 +02:00
7bc8ddc6e2 use BKE_mball_tessellate.h include
also remove unused includes
2015-03-25 22:40:09 +11:00
0b67c21077 Fix T43807: invalid mesh from 2-sided cyclic curve 2015-02-27 17:43:10 +11:00
8e73b770d4 Remove slurph shape-key feature
This is an old option which wasn't working in over a year without complaint.
2015-01-07 02:06:37 +11:00
915235c87a Cleanup: unused headers 2014-11-28 22:16:14 +01:00
bae0f904ee Fix T42257: Curve vertex parent not working with animation
Vertex parent was using original non-modified nurbs list, simply because
it didn't have something else to operate with.

Now we've got deformed by pre-tessellation modifiers nurbs in the curve
cache which might be used y the vertex parent.
2014-10-21 14:44:08 +02:00
4b4ae8374f Cleanup: style 2014-08-20 08:47:32 +10: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
ea30641d90 Fix T41047: Text objects flipping 2014-08-07 09:14:54 +10:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
0e324b19f9 Cleanup in MBALL/displist: no need to create curvecache for non-basis mballs, will never be used anyway! 2014-07-18 18:08:56 +02:00
b8f04e010a Cleanup: curvecaches for curves, not mballs! 2014-07-18 17:51:44 +02:00
804f58c0de Curve: zero memory on access rather then calloc
also remove redundant check
2014-06-19 15:30:08 +10:00
68a8f0073f Complete last commit.
Sorry, forgot to check other uses of BKE_nurb_makeCurve, NURBS surfaces were affected as well.
2014-06-18 23:53:11 +02:00
4bf8b04025 Fix T40694: Curve path messed up.
Error in rB4b4bb410e04e, BKE_nurb_makeCurve() requires its coord_array to be zero'ed,
hence we need calloc here.
2014-06-18 23:47:40 +02:00
ea3bca75d9 Curve: remove unused displist members 2014-06-15 14:56:59 +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
3286c8f8fb Curve: skip curves when matching bevel-fac (like 2.70) 2014-06-10 22:33:24 +10:00
ae4ed68dfe Code cleanup: style 2014-06-06 07:54:05 +10:00
22cdfd6cac Style cleanup 2014-05-28 15:56:54 +06:00
91a91b9362 Fix T40223: Errors in bevel_factor_mapping_start/end
Initial patch by Lukas Treyer with own fixes added
2014-05-27 00:00:44 +10:00
5680172a3a Fix for out of bounds read calculating spline mapping 2014-05-26 23:53:10 +10:00
159bf9d19c Curve Mapping: disable for cyclic curves (it doesn't make much sense and is buggy) 2014-05-26 23:53:05 +10:00
e9e1357fb9 Fix for out of bounds reads with curve bevel mapping 2014-05-26 23:31:52 +10:00
5ed449dabb Fix mistake in recent patch 2014-05-17 14:36:05 +10:00
1923a8f23a Fix T40223: Setting bevel_factor_mapping_start/end crashes
Patch from Lukas Treyer
2014-05-17 01:01:43 +10:00
03526232d9 Add assert to check for buffer overrun 2014-05-16 18:10:26 +10: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
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +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
a5be03b270 Fix deffects reported by CoverityScan (nothing dramatic, but at least one was a (minor) bug). 2014-03-31 16:42:15 +02:00
a9b82244de Code cleanup: fixes for function prototypes 2014-03-31 17:35:56 +06:00