Commit Graph

1108 Commits

Author SHA1 Message Date
Campbell Barton
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
Campbell Barton
7da2175271 KDTree: deprecate 'normal' argument
Normals for each kdtree node were allocated but never used,
and search args only use in particles/boids code.
2014-03-18 09:14:47 +11:00
Campbell Barton
ec4e12d9a2 Code cleanup: comments and typos 2014-03-18 05:40:18 +11:00
Campbell Barton
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
Campbell Barton
19ae921495 CMake: fix for standalone player and remove recast modifier reference 2014-03-14 17:05:58 +11:00
Bastien Montagne
0141265073 Fix T39152: Blender crash when duplicate mesh with hooks and laplacian deform.
We can't simply dupalloc cache_system (LaplacianSystem), it has quite a few allocated data we'd need to dupalloc as well,
not to mention (nl) context... Much safer to just set it to NULL in new copy imho!

This commit is to be backported to 2.70 release!
2014-03-13 12:54:07 +01:00
Sergey Sharybin
6ddb1faca9 Fix T38962: Boolean modifier crashes when only right operand has UV layer 2014-03-05 14:29:02 +06:00
Bastien Montagne
dad9600004 Fix T38941: Laplacian Deform crashes on OSX
When vgroup was invalid somehow (e.g. empty, as in this case) and bind could not happen, code was dereferencing a NULL pointer...
2014-03-04 09:09:38 +01:00
Campbell Barton
6f6be7c936 Fix T38859: Laplacian Deform Crash 2014-02-27 15:03:03 +11:00
Campbell Barton
ca2b4323a8 Fix T38003: Skin modifier crash with long edges 2014-02-25 23:03:26 +11:00
Sergey Sharybin
1130c53cdb Fix T38755: Crash when having cyclic dependency and curve deform
Issue was caused by undefined object update order and in some
cases NULL pointer will be de-referenced.

Added on-demand curve path calculation, just the same creepy call
of BKE_displist_make_curveTypes(). This violates DAG and might
end up in a difficult to troubleshoot race condition if there'll
be some issues with how dependencies are calculated in DAG, but
this is the easiest and safest way to solve the bug at this stage,
2014-02-24 19:15:52 +06:00
Campbell Barton
b7fa08f88a Code cleanup: style 2014-02-22 11:14:15 +11:00
Campbell Barton
c625658a92 Fix T38567: Branch smoothing on skin modifier broken
own regression when changing delete commands
2014-02-19 16:43:13 +11:00
Sergey Sharybin
8a32f2c6d6 Remove left-over form debug time 2014-02-17 23:38:12 +06:00
Campbell Barton
5621e63d36 Code cleanup: duplicate headers 2014-02-14 10:55:38 +11:00
Jens Verwiebe
9185ab5d9c Fix scons compiling after carve changes 2014-02-13 23:21:13 +01:00
Martijn Berger
3f1a5902b9 fix scons / cmake desynchronization issue with including carve headers 2014-02-13 20:40:38 +01:00
Sergey Sharybin
83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Campbell Barton
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Howard Trickey
b4fb1e6d9f Bevel Modifier: fix bug T37916, bad result after mirror modifier.
Bevel needs the vertex normals to be correct and they are not
normally recalculated after a previous modifier, like mirror.
Adding 'dependsOnNormals' -> returns true to modifier info
for Bevel fixes the problem.
2014-02-07 10:46:22 -05:00
Brecht Van Lommel
52bae9691b Fix T38521: skin modifier crash with zero radius vertices. 2014-02-07 13:41:42 +01:00
Campbell Barton
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
Campbell Barton
fed1b8b16d Code cleanup: suffix vars to make obvious they are squared 2014-02-03 02:46:45 +11:00
Lukas Tönne
2b55d7895c Fix T38403: Laplacian smooth on instanced objects leads to crash.
The laplacian modifiers (smooth and deform) use the OpenNL library,
which is not threadsafe due to the use of a global context variable.
Ideally this would be changed so that an explicit context can be
created for every caller of the OpenNL functions, but since OpenNL's
most recent version is from 2010 this is unlikely to happen.

As a workaround for now just use a mutex to prevent conflicting OpenNL
calls. Eventually OpenNL can be replaced by eigen or ceres.
2014-01-30 13:09:32 +01:00
Campbell Barton
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
Campbell Barton
1c29fd77d3 Code Cleanup: style and correct API class ref 2014-01-26 22:17:01 +11:00
Howard Trickey
2a8f6e2fd9 Bevel modifier can use vertex groups for edge bevel now.
Until now, the "vertex group" limit method in the modifier
only worked for "vertex only" bevels. With this change,
edges with both ends in a vertex group will be beveled
in the non-"vertex only" case.
Also changed the test for being in a vertex group from
"any nonzero weight" to "weight >= 0.5". This is because
cascaded bevels on disjoint vertex groups did not give
disjoint bevels, because weight interpolation would give
non-zero weights to newly created vertices in earlier bevels.
Chose 0.5 because that won't result from interpolation, but
still allows some dilution (e.g., cascaded bevels on the
same vertex group).
2014-01-24 12:42:20 -05:00
Bastien Montagne
c37e8ecc50 Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true/false in code using them). 2014-01-23 14:52:46 +01:00
Campbell Barton
63ccb26303 Code Cleanup: spelling 2014-01-17 17:35:03 +11:00
Campbell Barton
7df8452d1a BMesh: add bmesh delete functions that dont depend on operator flags 2014-01-17 14:55:06 +11:00
Joshua Leung
5c74ac2c2a Build Modifier - Add "Reversed" Option
This commit introduces the ability to make the Build Modifier operate in reverse,
essentially allowing it to be used as a "deconstruction" effect.

(See D219 for more details about use cases for this)
2014-01-17 14:53:04 +13:00
Campbell Barton
9cc5c157e8 Minor change to last commit to solidify, only allocate bitmap as needed 2014-01-17 06:59:14 +11:00
Sergey Sharybin
e9fb4299eb Fix T38116: Crash when using solidify modifier on multi-user mesh
Issue was caused by solidify modifier using original vertices bitfield
to store tags. This isn't thread-safe obviously. Now use bitmap to store
needed tags.

Reviewed by Campbell, thanks!
2014-01-16 17:49:33 +06:00
Campbell Barton
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
Sergej Reich
a86f43df9f Fix T38227: Cloth cache storing only every 10 frames.
Make sure pointcache step is set to 1 for cloth when copying objects.
2014-01-15 06:47:03 +01:00
Campbell Barton
b8b412230b Code Cleanup: use iroundf
also increase precision of rctf print functions
2014-01-15 13:40:40 +11:00
Howard Trickey
86616c675a Bevel Modifier: add width type and profile control.
This adds to the modifier the new controls that have been
added to the bevel tool.
2014-01-14 11:07:45 -05:00
Campbell Barton
c48c62a831 Code Cleanup: replace checks for ima->source with BKE_image_is_animated 2014-01-14 04:59:58 +11:00
Sergey Sharybin
ac077f016d Remove direct displist creation from array modifier
First of all, it was needed to have that set scenes fix which
was done recently so curve is being evaluated properly on file
load.

And last but not least, also needed to tag DAG node to evaluate
path regardless to curve datablock settings so curve length is
always known.
2014-01-13 15:57:51 +06:00
Sergey Sharybin
f00f959d52 Remove direct displist creation from curve deform
This solves threading conflict which happens when having
multiple objects using Curve Deform modifier with the same
curve datablock. This conflict was caused by the fact that
curve_deform_verts() used to temporary override curve's
flags to make it path is there.

Actually, it was setting CU_FOLLOW flag temporary which
was only used where_on_path() (only in terms that this
temporary assignment only affected this function) but it
is now commented out for a while, so no reason to set
this flag temporary, If it's ever to be done, we'll need
to pass flags as an additional function argument.

For the path creation i've extended DegNode structure
which now holds extra bits which indicates what additional
data depending on the graph topology is to be evaluated.

Currently this is only used to indicate that curve needs
path to be evaluated regardless to cu->flag state. This
is so Curve Deform modifier is always happy.

In the future this flag might also be used to indicate
whether bmesh verts are to update (see recent commit to
3-vertex parent crash fix) or to indicate that the object
is the motherball etc.
2014-01-13 15:57:51 +06:00
Campbell Barton
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
Howard Trickey
49aa701645 Add profile control parameter to Bevel.
Parameter controls concavity / convexity.
    <.25 means: concave inward
    .25 means: straight slanted
    >.25 means: concave outward
    .5 means: circular (the default)
    1 means: straight along original sides
For now, there is a hard lower limit of .15
because more work is needed to get decent
results in the range below that.

The profile is actually a superellipse, and the
parameter is 1/4 of the exponent in the implicit equation
for a superellipse, except at the extreme values of 0 and 1.
2014-01-08 07:40:01 -05:00
Campbell Barton
d490e686f0 Fix T38100: laplacian smooth crash 2014-01-08 03:56:43 +11:00
Sergey Sharybin
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06:00
Campbell Barton
a5606fadbb Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derived 2013-12-26 08:27:08 +11:00
Campbell Barton
d064968c27 Fix T37914: Mask modifier behaves differently until painted 2013-12-24 14:39:14 +11:00
Campbell Barton
0a5e00e8e8 Code Cleanup: style 2013-12-24 05:04:29 +11:00
Campbell Barton
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
Campbell Barton
b01cbede04 error in last commit, missing normal update. 2013-12-22 07:19:48 +11:00
Campbell Barton
a183aa6c67 error in last commit, flag names. 2013-12-22 07:16:41 +11:00