Commit Graph

8136 Commits

Author SHA1 Message Date
161f502485 Fix for #32162 psys rotation causes size issues for particle instances
- The original scaling of the object wasn't taken into account when not using the particle dupliobject rotation option.
2012-07-22 23:07:43 +00:00
76bea854b6 code cleanup: replace cos(M_PI / 4) and sin(M_PI / 4) with M_SQRT1_2 define
also some minor style cleanup.
2012-07-22 18:40:50 +00:00
e58104c515 Bugfix [#32017] Infinite recursion in depsgraph material/node driver handling
When initially coding this functionality, I was aware of the potential for
infinite recursion here, just not how frequently such setups are actually
used/created out in the wild (nodetree.ma_node -> ma -> ma.nodetree is all too
common, and often even with several levels of indirection!).

However, the best fix for these problems was not immediately clear. Alternatives
considered included...
 1) checking for common recursive cases.  This was the solution employed for one
of the early patches committed to try and get around this. However, it's all too
easy to defeat these measures (with all the possible combinations of indirection
node groups bring).
 2) arbitrarily restricting recursion to only go down 2/3 levels? Has the risk
of missing some deeply chained/nested drivers, but at least we're guaranteed to
not get too bad. (Plus, who creates such setups anyway ;)
*3) using the generic LIB_DOIT flag (check for tagged items and not recurse down
there). Not as future-proof if some new code suddenly decides to start adding
these tags to materials along the way, but is easiest to add, and should be
flexible enough to catch most cases, since we only care that at some point those
drivers will be evaluated if they're attached to stuff we're interested in.
 4)  introducing a separate flag for Materials indicating they've been checked
already. Similar to 3) and solves the future-proofing, but this leads to...
 5) why bother with remembering to clear flags before traversing for drivers to
evaluate, when they should be tagged for evaluation like everything else?
Downside - requires depsgraph refactor so that we can actually track the fact
that there are dependencies to/from the material datablock, and not just to the
object using said material. (i.e. Currently infeasible)
2012-07-22 16:14:57 +00:00
9b51503307 style cleanup 2012-07-21 22:58:08 +00:00
62a73381a7 use fabsf when using floats. 2012-07-21 15:27:40 +00:00
1bb7cfded6 Merge mask fixes from tomato branch
--
svn merge -r49075:49076 -r49086:49087  ^/branches/soc-2011-tomato
2012-07-21 09:01:39 +00:00
250cdd5e52 code cleanup: remove commented includes - mostly from 2.4x 2012-07-18 23:07:07 +00:00
c8029bffd9 workaround for a bug with zero edges getting removed got feather faces out of sync and crashed 2012-07-18 16:24:13 +00:00
c0e004bd61 add difference blending mode, also fix error in last commit 2012-07-18 13:44:48 +00:00
73a778a4d0 change bucket size to give better performance for high detail 4k masks, also clamp from 0-1 for each layer when accumulating. 2012-07-18 13:34:14 +00:00
cfb3194945 code cleanup for mask capping 2012-07-18 12:54:13 +00:00
61ef13752d chance semi-circle mask capping resolution based on size. 2012-07-18 12:45:20 +00:00
eceec8856d minor edits to mask rasterizer. 2012-07-18 12:17:12 +00:00
e80918604a Fixed wrong self-intersection check for non-closed splines 2012-07-18 11:48:13 +00:00
8f32070e9d fix incorrect assert for mask face checking, also correct own bad spelling 2012-07-18 11:01:23 +00:00
c05af6210e Fixed crash of self-intersection loop in special cases
It was wrongly calculated bucket number per side in cases when some
of segments is filling the whole bounding box across some of dimension.

Solved by limiting buckets at least to 1 in such cases.
2012-07-18 10:22:56 +00:00
88fddb3cc3 make links now allows groups - this means you can make objects have matching groups to the active more easily. 2012-07-18 09:45:50 +00:00
7baa8d5203 mask rasterizer unfilled line end capping now works with aspect and blending. 2012-07-17 20:40:12 +00:00
b6a9ffffed wip mask capping - works but needs aspect correction and to be faded out. 2012-07-17 20:01:01 +00:00
2c2e1775f9 Feather self-intersection test speed up
Made some minor optimization such as:

- Avoid using "%" operation in loops, replace with a check
  for index "overflow".
- Use pre-computed values for scaling feather coordinates
  to 0 .. 1 space.

This allowed to reach couple of milliseconds of boost.

Another change is to use higher number of buckets (up to 512).
This doesn't took significantly more memory (like uses only 10MB
of memory for average splines) and allows to have 30-50x boost
for average splines.

Use dynamically calculated number of buckets for this, to be
sure segments would fit two buckets.

Also fixed intersection detection in some cases when edge is
shared between two buckets -- it is possible that such edge
would cross third bucket and intersect edge from there.
2012-07-17 16:22:18 +00:00
9c714f695a fix for particle system using uninitialized stack memory with midpoint of rk4 integrators. 2012-07-17 13:28:30 +00:00
6f0950a1f4 use math vector init functions 2012-07-17 12:05:15 +00:00
e35d3083ec Fixed crash when rasterizing spline with only one point
It was an issue in new feather self-intersection test code.
2012-07-17 10:43:57 +00:00
f4cff34392 disable feather collapse during drawing, its very slow. 2012-07-17 09:56:10 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
1f96470b5d Fixed disappearing in some circumstances feather
Real fix would be to find a point which is definitely now on loop
to be collapsed, but that's for a bit later. This commit should
remove possible stoppers.
2012-07-16 19:23:15 +00:00
5915b53350 Fixed crash caused by recent feather collapse commit 2012-07-16 18:34:57 +00:00
92205486e7 Masks: feather self-intersection collapse function
This implements simple function which collapses internal loops
caused by self-intersections into a singularity.

This loops can't be removed because rasterizer expects points
of feather be aligned with points from spline itself.
2012-07-16 17:54:28 +00:00
3a039d0e10 Put paint mask grid allocation in a critical section
When OpenMP is enabled, memory allocation needs to be protected.

Fixes bug [#32111] Memory management regression from svn_46520
projects.blender.org/tracker/index.php?func=detail&aid=32111&group_id=9&atid=498
2012-07-16 16:55:58 +00:00
7881d2c1a8 correct own error in logic for skipping mask layers, inverted mask layers with zero alpha still need to be evaluated. 2012-07-16 15:40:47 +00:00
f9e63430ac use calculated spline resoltion rather then fixed at 32. 2012-07-16 14:17:01 +00:00
5b4a455569 defailt to ease weight interpolation 2012-07-16 13:12:52 +00:00
9362a01ff3 fix for crash & leak when layer render option is disabled. 2012-07-16 13:00:54 +00:00
f6b3a6e6f3 fix for occasional crash with splines a lot larger then the view 2012-07-16 12:49:01 +00:00
e32d963478 mask rasterizer - use quad interpolation - gets rid of ugly diagonal banding, introduces glitch with bowtie quads, will have to fix next. 2012-07-16 12:08:28 +00:00
a2e2489f61 correct own naming error BLI -> BKE 2012-07-16 08:53:11 +00:00
60cfbaeb1e mask blending modes: lighten/darken/multiply/replace 2012-07-16 07:23:16 +00:00
8e7aa50021 fix crash for empty or single vertex layers. 2012-07-16 07:04:10 +00:00
6f01b0b11f small speedup for mask rasterizer, only do single sided check for triangle intersection. 2012-07-16 06:39:40 +00:00
8c77b35f4f svn merge -r48944:48942 .
revert moving the file, adding a new module didnt resolve linking issue.
2012-07-15 16:57:21 +00:00
701a16c9dd moving mask rasterizer file, this breaks building, will fix next commit 2012-07-15 16:16:34 +00:00
1723d51edb replace fminf with minf 2012-07-15 15:11:52 +00:00
02bac0bebf falloff option for mask layers 2012-07-15 03:11:07 +00:00
7cc5af4ef3 minor refactor for rect functions. more consistent naming. 2012-07-15 00:29:56 +00:00
f8bf58e0f2 fix for some bugs when the mask layer was outside the view, also clamp the layer buckets within the view. 2012-07-15 00:07:41 +00:00
593163e6e5 fix for minor error in previous commit (wasnt connecting right faces for cyclic mask), also avoid doing more area calculations then needed when checking if the mouse is moving away from uiBlock. 2012-07-14 23:26:54 +00:00
1cee8ea8ed unfilled-cyclic curves now works as expected, also fix for own crash on 32bit systems. 2012-07-14 23:23:24 +00:00
41fe8b9ea9 use a different setting for fill/cyclic - you may want to have unfilled cyclic curves. 2012-07-14 20:53:52 +00:00
5e7f8b83ed mask rasterizer, render unclosed splines as lines. 2012-07-14 20:29:17 +00:00
6986f671ee code cleanup 2012-07-14 19:21:13 +00:00