3 years agoGPencil: Added operators to select first and last points of strokes
Joshua Leung [Mon, 9 May 2016 05:23:15 +0000 (17:23 +1200)]
GPencil: Added operators to select first and last points of strokes

These are useful for removing overshoots at the end of closed strokes (for fills)

3 years agoGraph Editor: Ctrl-Click keyframing now deselects all existing keyframes by default
Joshua Leung [Mon, 9 May 2016 04:58:12 +0000 (16:58 +1200)]
Graph Editor: Ctrl-Click keyframing now deselects all existing keyframes by default

Now, when creating new keyframes in the graph editor by ctrl-clicking, only
the newly created keyframes will be selected. This is a little workflow tweak
to make it faster to work, as you no longer have to deselect all, and then
re-select the newly added keys in order to manipulate them.

The old behaviour (not modifying the selection status of the old keys) has been
kept, but is now available via Shift-Ctrl-Click.

Feature request from @Shhlife

3 years agoCleanup: More byte -> byte4 renaming for consistency.
Thomas Dinges [Mon, 9 May 2016 00:22:01 +0000 (02:22 +0200)]
Cleanup: More byte -> byte4 renaming for consistency.

3 years agoInfo Header / URLs: Fix community link + https'ification.
Aaron Carlisle [Sun, 8 May 2016 21:38:41 +0000 (23:38 +0200)]
Info Header / URLs: Fix community link + https'ification.

3 years agoFix T48380: fix for recent image manager code cleanup.
Brecht Van Lommel [Sun, 8 May 2016 19:41:25 +0000 (21:41 +0200)]
Fix T48380: fix for recent image manager code cleanup.

3 years agoCode cleanup: use special type instead of node names.
Brecht Van Lommel [Sat, 7 May 2016 22:41:01 +0000 (00:41 +0200)]
Code cleanup: use special type instead of node names.

3 years agoCode cleanup: tweaks to image manager code found while looking into previous bug.
Brecht Van Lommel [Sun, 8 May 2016 18:18:52 +0000 (20:18 +0200)]
Code cleanup: tweaks to image manager code found while looking into previous bug.

3 years agoFix T48377: Cycles crash removing float image texture node during viewport render.
Brecht Van Lommel [Sun, 8 May 2016 17:48:22 +0000 (19:48 +0200)]
Fix T48377: Cycles crash removing float image texture node during viewport render.

3 years agoFix T48372: missing OS X trackpad scroll support for increasing loop cut / bevel...
Brecht Van Lommel [Sun, 8 May 2016 16:14:44 +0000 (18:14 +0200)]
Fix T48372: missing OS X trackpad scroll support for increasing loop cut / bevel segments.

3 years agoDocs: explain some details of RNA enums
Campbell Barton [Sun, 8 May 2016 16:32:54 +0000 (02:32 +1000)]
Docs: explain some details of RNA enums

3 years agoCycles: Fix two small memory leaks and deduplicate table freeing
Lukas Stockner [Sat, 7 May 2016 23:44:01 +0000 (01:44 +0200)]
Cycles: Fix two small memory leaks and deduplicate table freeing

This commit makes remove_table skip the freeing if the offset is
already set to invalid - or, if it wasn't, set it to invalid after freeing.

That's what the current code was already doing in the Manager classes,
this change allows them to just call remove without the additional code.

Also, two potential memory leaks where new tables were always allocated
without freeing the old ones are fixed.

Reviewers: sergey, dingto, brecht

Differential Revision:

3 years agoCleanup: warnings
Campbell Barton [Sun, 8 May 2016 15:16:58 +0000 (01:16 +1000)]
Cleanup: warnings

3 years agoGPencil Onion Skinning: Setting before/after to -1 will turn off onionskinning in...
Joshua Leung [Sun, 8 May 2016 15:03:40 +0000 (03:03 +1200)]
GPencil Onion Skinning: Setting before/after to -1 will turn off onionskinning in that direction

This is an experimental option that I found would have been useful to have,
when making my earlier anim test. The only contentious point is whether it's
better to use a separate boolean flag (perhaps bound to the labels) instead
of overloading this setting (and describing the usage in the tooltip).

3 years agoFix: Toggling "lock layer" for GPencil layers in the dopesheet didn't update the...
Joshua Leung [Sun, 8 May 2016 14:49:32 +0000 (02:49 +1200)]
Fix: Toggling "lock layer" for GPencil layers in the dopesheet didn't update the layers UI

3 years agoFix: Lasso select for Grease Pencil doesn't work in the Nodes Editor
Joshua Leung [Sun, 8 May 2016 14:44:21 +0000 (02:44 +1200)]
Fix: Lasso select for Grease Pencil doesn't work in the Nodes Editor

In the nodes editor, Ctrl-LMB-drag is taken by "Cut", and it seems impossible
for any other keymap to override that. Instead, the default lasso select hotkey
there is Ctrl-Alt-LMB-drag instead.

To get Grease Pencil lasso select (in GP Editmode) to work in the Nodes Editor too,
this commit adds the Ctrl-Alt-LMB-drag binding here too. However, to make things easier,
this extra binding will be part of the Grease Pencil keymap everywhere. There doesn't
seem to be any conflicts with having this in place - until we find them, this should
be ok to have.

3 years agoTweak to GPencil layers UI layout
Joshua Leung [Sun, 8 May 2016 14:04:28 +0000 (02:04 +1200)]
Tweak to GPencil layers UI layout

I'm still not happy with this layout as it is now, but it seems a bit less unbalanced
than what I'd been trying before. So, let's leave this as-is for now.

3 years agoTweaks for a tooltip I missed during earlier review for D1886
Joshua Leung [Sun, 8 May 2016 14:00:23 +0000 (02:00 +1200)]
Tweaks for a tooltip I missed during earlier review for D1886

3 years agoA "better" (?) fix for msvc silliness - used in one other place in all of Blender
Joshua Leung [Sun, 8 May 2016 13:46:18 +0000 (01:46 +1200)]
A "better" (?) fix for msvc silliness - used in one other place in all of Blender

3 years agoFix compiling on MSVC - M_PI undefined
Joshua Leung [Sun, 8 May 2016 13:31:13 +0000 (01:31 +1200)]
Fix compiling on MSVC - M_PI undefined

3 years agoAction Editor: Initial support for a Properties Region
Joshua Leung [Sun, 8 May 2016 02:38:30 +0000 (14:38 +1200)]
Action Editor: Initial support for a Properties Region

This commit adds some of the initial support for a properties region in the
Action Editor. There are currently no panels to display, as there is still
a lot of work required to port over the required internal architecture to
support the panels seen in the Graph Editor.

3 years agoD1886: GPencil - Add smooth iterations parameter to get better quality
Antonio Vazquez [Sun, 8 May 2016 01:38:54 +0000 (13:38 +1200)]
D1886: GPencil - Add smooth iterations parameter to get better quality

After some test, a new iteration parameter has been added in order to
apply repetitive smoothing to the stroke. By default 1 iteration is applied,
but can used any number between 1 and 3.

The repetition uses different levels of intensity from 100% of the defined smooth
factor for the first loop, 50% for the second and 25% for the third. We use in each
loop a smaller value in order to avoid deform too much the stroke.

3 years agoFix for D1705: Update to fix the bug with extra triangles that produces glitches...
Antonio Vazquez [Sat, 7 May 2016 11:40:59 +0000 (23:40 +1200)]
Fix for D1705: Update to fix the bug with extra triangles that produces glitches in some situations

3 years agoGPencil Fills: Small reshuffle of UI buttons
Joshua Leung [Sun, 1 May 2016 12:58:53 +0000 (00:58 +1200)]
GPencil Fills: Small reshuffle of UI buttons

Now, stroke-related things (thickness, volumetric, points) and fill-related things
(HQ fill) are in the relevant columns, instead of having some in each column.

3 years agoCode Cleanup: Just a bit more tidying up comments/whitespace/etc.
Joshua Leung [Sat, 30 Apr 2016 00:47:07 +0000 (12:47 +1200)]
Code Cleanup: Just a bit more tidying up comments/whitespace/etc.

There is still some instability in how the triangulations are happening,
where the triangle count of the resulting triangulation fluctuates resulting
in weird artifacts sometimes.

To reproduce, try drawing some U-shapes, and keep reloading the file.

3 years agoFix for potential bug with new GP Fill
Joshua Leung [Thu, 28 Apr 2016 15:25:48 +0000 (03:25 +1200)]
Fix for potential bug with new GP Fill

While trying to track down why I still keep getting some random "extra" triangles
showing up when reloading files with fills, I noticed that there's an index mismatch
here that may cause problems in some rare cases:

There are "gps->totpoints" items in tmp_triangles, but there should only be
"gps->tot_triangles" triangles in the gps->triangles array. If for whatever reason
some of the triangles in tmp_triangles are invalid, this could have meant that
while a tmp_triangles candidate was skipped, a corresponding slot for a valid
triangle also got skipped.

3 years agoCode Cleanups: A bunch of tweaks to tidy up things from the GPencil Fill patch
Joshua Leung [Thu, 28 Apr 2016 15:12:53 +0000 (03:12 +1200)]
Code Cleanups: A bunch of tweaks to tidy up things from the GPencil Fill patch

3 years agoD1705: Fix Grease Pencil Fill for Concave Shapes
Antonio Vazquez [Thu, 28 Apr 2016 13:10:33 +0000 (01:10 +1200)]
D1705: Fix Grease Pencil Fill for Concave Shapes

Improve filling for concave shapes using a triangulation of the stroke.
The triangulation information is saved in an internal cache and only is
recalculated if the stroke changes.

The triangulation is not saved in .blend file.

Reviewers: aligorith

Maniphest Tasks: T47102

Differential Revision:

3 years agoFix T48373: Crash when using dynamic paint with brush material.
Bastien Montagne [Sun, 8 May 2016 09:39:45 +0000 (11:39 +0200)]
Fix T48373: Crash when using dynamic paint with brush material.

`dynamicPaint_doMaterialTex` was called from inside an omp parallel section with brush->dm
itself, and not the local dm copy. Generating looptri data is not thread safe at all...

3 years agoCycles: Cleanup: Swap order of the RNG-state-initializing for-loops
Lukas Stockner [Sat, 7 May 2016 23:22:28 +0000 (01:22 +0200)]
Cycles: Cleanup: Swap order of the RNG-state-initializing for-loops

Swap the for-loops in the RenderBuffer reset code to follow the convention
of looping over y in the outer loop.
The improved cache performance won't really be noticable here, but it's nicer
if it follows the usual style.

3 years agoClamp dot-product to avoid precision error
Campbell Barton [Sat, 7 May 2016 14:02:34 +0000 (00:02 +1000)]
Clamp dot-product to avoid precision error

Would only happen in degenerate cases.

3 years agoCleanup: Remove unneded (void) line, we don't have ifdefs here anymore.
Thomas Dinges [Sat, 7 May 2016 13:55:28 +0000 (15:55 +0200)]
Cleanup: Remove unneded (void) line, we don't have ifdefs here anymore.

3 years agoCleanup: whicespace
Campbell Barton [Sat, 7 May 2016 13:58:04 +0000 (23:58 +1000)]
Cleanup: whicespace

3 years agoCorrect render-border line width
Campbell Barton [Sat, 7 May 2016 13:53:35 +0000 (23:53 +1000)]
Correct render-border line width

3 years agoCorrect error in wrapped array-span-iteration
Campbell Barton [Sat, 7 May 2016 13:47:58 +0000 (23:47 +1000)]
Correct error in wrapped array-span-iteration

3 years agoFix T48368: Cycles mix RGB constant folding bug after recent refactor.
Brecht Van Lommel [Sat, 7 May 2016 12:08:00 +0000 (14:08 +0200)]
Fix T48368: Cycles mix RGB constant folding bug after recent refactor.

3 years agoCurve Fitting: better fallback when least-square solution fails
Campbell Barton [Sat, 7 May 2016 10:32:28 +0000 (20:32 +1000)]
Curve Fitting: better fallback when least-square solution fails

Take curvature into account when calculating handle length.

Gives significantly better results for curve dissolve and 10-20% more efficient freehand drawing.

3 years agoFix error copying cubic data
Campbell Barton [Sat, 7 May 2016 09:15:27 +0000 (19:15 +1000)]
Fix error copying cubic data

3 years agoFix T48362: Spin tool broken after recent commit.
Bastien Montagne [Sat, 7 May 2016 09:58:33 +0000 (11:58 +0200)]
Fix T48362: Spin tool broken after recent commit.

Typo in rBrBa48d74079, spin tool was now using the wrong view axis.

3 years agoFix cycles-xml with OSL support after changes inroduced in 1422f0dd1697d7b671a7b447fd...
Martijn Berger [Sat, 7 May 2016 08:50:21 +0000 (10:50 +0200)]
Fix cycles-xml with OSL support after changes inroduced in 1422f0dd1697d7b671a7b447fd58db7dfe775821

3 years agoSome fixes for CUDA runtime compile:
Thomas Dinges [Fri, 6 May 2016 21:11:41 +0000 (23:11 +0200)]
Some fixes for CUDA runtime compile:
* When Baking wasn't used we got an error.
* On top of Volume Nodes (NODES_FEATURE_VOLUME), we now also check if we need volume sampling code,
so we can disable that as well and save some further compilation time.

3 years agoCycles: Make CUDA adaptive feature compile a Debug flag.
Thomas Dinges [Fri, 6 May 2016 20:34:15 +0000 (22:34 +0200)]
Cycles: Make CUDA adaptive feature compile a Debug flag.

If the CUDA Toolkit is installed and the user is on Linux,
adaptive, feature based CUDA runtime compile is now possible to enable via:

* Debug menu (Debug value 256) in the Cycles UI.

3 years agoFix T47657: Using template_list() with invoke_props_dialog()
Bastien Montagne [Fri, 6 May 2016 19:56:54 +0000 (21:56 +0200)]
Fix T47657: Using template_list() with invoke_props_dialog()

popups have no wm_region in context, using wm_menu here.

Not working perfect, but at least it prevents crash.

3 years agoFix T48262: Crash when trying to render a scene without camera.
Bastien Montagne [Fri, 6 May 2016 19:41:56 +0000 (21:41 +0200)]
Fix T48262:  Crash when trying to render a scene without camera.

3 years agoImage Editor: Add border zoom
Campbell Barton [Fri, 6 May 2016 18:22:48 +0000 (04:22 +1000)]
Image Editor: Add border zoom

Use Shift-B, UV border-select-pinned is now Ctrl-B.

Patch from @rav66

3 years agoFix recent issue in recent BVH snap/cache
Campbell Barton [Fri, 6 May 2016 16:59:19 +0000 (02:59 +1000)]
Fix recent issue in recent BVH snap/cache

The derivedMesh could free a tree stored by the cache.
Now check the cached tree is valid.

3 years agoCorrect in-range assert (zero is valid)
Campbell Barton [Fri, 6 May 2016 16:13:39 +0000 (02:13 +1000)]
Correct in-range assert (zero is valid)

3 years agoDerivedMesh: don't allocate a new material array each draw
Campbell Barton [Fri, 6 May 2016 15:58:28 +0000 (01:58 +1000)]
DerivedMesh: don't allocate a new material array each draw

3 years agoClip invisible parts of image when drawing in 2D textures and GLSL Modes
Sergey Sharybin [Fri, 6 May 2016 14:54:07 +0000 (16:54 +0200)]
Clip invisible parts of image when drawing in 2D textures and GLSL Modes

This commit avoids draw of invisible parts of image in image editor,
making it faster to re-draw the image.

Especially handy when painting on a high-res image when zoomed-in.

3 years agoCleanup: Move full SVM statistics to VLOG(2) verbosity level.
Thomas Dinges [Fri, 6 May 2016 12:39:41 +0000 (14:39 +0200)]
Cleanup: Move full SVM statistics to VLOG(2) verbosity level.

3 years agoCleanup: Rename texture slots to float4 and byte, to distinguish from future float...
Thomas Dinges [Fri, 6 May 2016 11:42:50 +0000 (13:42 +0200)]
Cleanup: Rename texture slots to float4 and byte, to distinguish from future float (single channel) and half_float slots.

Should be no functional changes, tested CPU and CUDA.

3 years agoCode refactor: Change Cycles ImageManager arrays.
Thomas Dinges [Fri, 6 May 2016 09:57:30 +0000 (11:57 +0200)]
Code refactor: Change Cycles ImageManager arrays.

This commit simplifies the code for the image arrays. Instead of having 2 arrays for float and byte textures,
we now use an array here. This simplifies the code (avoids code duplication), and makes it possible to easily extend it
with float1 and half-float types in the future.

Only tested with CPU yet, plus some cleanup / code de-duplication is still possible here.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: jesterking, sergey

Differential Revision:

3 years agoTweak precision for interocular distance and convergence plane
Sergey Sharybin [Fri, 6 May 2016 10:32:23 +0000 (12:32 +0200)]
Tweak precision for interocular distance and convergence plane

Previous number of digits after point was not really useful, especially
for the interocular distance where it's quite common to go sub-cm precision.

3 years agoSpeedup of regular 2D painting
Sergey Sharybin [Fri, 6 May 2016 09:48:07 +0000 (11:48 +0200)]
Speedup of regular 2D painting

Yet another commit which makes painting aware of multi-threaded systems.

3 years agoCloth: Fix shrinking to properly respond to animated min/max and weight.
Alexander Gavrilov [Mon, 18 Apr 2016 15:49:03 +0000 (18:49 +0300)]
Cloth: Fix shrinking to properly respond to animated min/max and weight.

Enable dynamic restlen recomputation based on sew flag and update the
shrink factor math within it to call the new utility function.

3 years agoCloth: Change ClothVertex::xrest to actually store the rest position.
Alexander Gavrilov [Mon, 18 Apr 2016 15:48:22 +0000 (18:48 +0300)]
Cloth: Change ClothVertex::xrest to actually store the rest position.

Originally the value was only needed when building the springs,
so a pointer to the input data was somewhat ok. However, recalculating
spring length dynamically requires keeping the actual value around.

3 years agoPart of D1903: Dynamic base mesh for cloth simulation
Luca Rood [Mon, 11 Apr 2016 09:21:17 +0000 (12:21 +0300)]
Part of D1903: Dynamic base mesh for cloth simulation

A function that recalculates cloth spring lengths.

3 years agoCloth: Ignore zero-restlen sewing springs in average length computation.
Alexander Gavrilov [Mon, 18 Apr 2016 15:47:38 +0000 (18:47 +0300)]
Cloth: Ignore zero-restlen sewing springs in average length computation.

The average length is used to adjust self-collision and stiffness
to match mesh density, and in either case considering the always zero
restlen sewing springs doesn't actually make much sense.

The struct_springs variable is also used for other things like total
spring count, so a new one needed for the true struct springs.

3 years agoCloth: Use Geometrical Mean for averaging cloth shrink factor.
Alexander Gavrilov [Mon, 18 Apr 2016 15:47:16 +0000 (18:47 +0300)]
Cloth: Use Geometrical Mean for averaging cloth shrink factor.

This comes out of considering a one-dimensional transition in weight
on a rectangular cloth grid. At the transition face loop, one side
of each rectangular face would be scaled by k1, and the opposite one
by k2, thus turning the rectangle into a trapezoid. Averaging would
be used to choose the scale factor for the remaining two sides.

If Geometrical Mean, i.e. sqrt(k1*k2) is used, it so happens that the
diagonals of the trapezoid also end up scaled by sqrt(k1*k2) compared
to the original rectangle. This means that the same scale factor is
correct for both structural and shear springs, which is not the case
with simple average.

3 years agoCloth: Fix the shrink feature to be controlled by the sewing spring flag.
Alexander Gavrilov [Thu, 28 Apr 2016 14:53:34 +0000 (17:53 +0300)]
Cloth: Fix the shrink feature to be controlled by the sewing spring flag.

Previously it was all over the place: without a vertex group it was
always enabled, and with it it depended on the Self Collision option
due to a likely editing mistake. Now it should be in sync with what
disables the fields in the UI.

The verts->shrink_factor field is changed to just cache the vertex
weight, with the shrink_min/shrink_max interpolation done later.
This is because cloth_apply_vgroup only runs if there are vertex
groups, and thus the factor may not update after property changes.

In addition, bending springs are now also affected by the shrink
factor to avoid visible distortion in object shape at high shrink.

3 years agoCloth: Invalidate cache when sewing springs are toggled on or off.
Alexander Gavrilov [Mon, 18 Apr 2016 15:46:32 +0000 (18:46 +0300)]
Cloth: Invalidate cache when sewing springs are toggled on or off.

3 years agoForce Fields: Fix Texture with both Use Coordinates and 2D enabled.
Alexander Gavrilov [Mon, 18 Apr 2016 15:45:34 +0000 (18:45 +0300)]
Force Fields: Fix Texture with both Use Coordinates and 2D enabled.

From description, Use Coordinates evaluates the texture using
target coordinates in the local space of the force field object.
2D is supposed to ignore the Z coordinate. Thus one would assume
that if both are enabled, the force field effect would move with
the force field object, and Z would be 0.

However, instead first the 2D option projects points onto a plane
passing through the global zero and orthogonal to the local Z,
and only then the resulting point is transformed into local space.
Z is not locked at 0, so procedural textures like Spherical Blend
don't work as expected.

To fix this, apply local transform first, and then just clear Z if 2D.

3 years agoImplement threaded partial display buffer update
Sergey Sharybin [Fri, 6 May 2016 08:04:29 +0000 (10:04 +0200)]
Implement threaded partial display buffer update

This speeds up update of display buffer when affected area is big enough.

Mainly helpful for cases when doing long fast strokes when painting.

3 years agoCleanup: warnings
Campbell Barton [Fri, 6 May 2016 06:49:25 +0000 (16:49 +1000)]
Cleanup: warnings

Values set but not used

3 years agoFix T48356: Bridge tool creates self-intersecting loop
Campbell Barton [Fri, 6 May 2016 00:20:16 +0000 (10:20 +1000)]
Fix T48356: Bridge tool creates self-intersecting loop

When loops are planar to eachother, initialize their winding based on surrounding geometry.

3 years agoFix error bridging edge loops flipping
Campbell Barton [Thu, 5 May 2016 22:51:44 +0000 (08:51 +1000)]
Fix error bridging edge loops flipping

Calculating the winding failed when faces exist on both sides of the edge.

3 years agoCycles: Comment out unused function arguments
Sergey Sharybin [Thu, 5 May 2016 21:46:50 +0000 (23:46 +0200)]
Cycles: Comment out unused function arguments

3 years agoMulti-thread generated image creation
Sergey Sharybin [Thu, 5 May 2016 21:33:40 +0000 (23:33 +0200)]
Multi-thread generated image creation

Gives about 2x speedup on laptop when creating new hires generated image,
regardless of it's type (color, color grid, uv grid).

3 years agoCorrect snap checks for edges & faces
Campbell Barton [Thu, 5 May 2016 21:44:07 +0000 (07:44 +1000)]
Correct snap checks for edges & faces

Snap targets can't contain vertices which are being transformed

3 years agoDon't overwrite existing snap context
Campbell Barton [Thu, 5 May 2016 20:47:21 +0000 (06:47 +1000)]
Don't overwrite existing snap context

Re-activating transform would overwrite previous context, leaking memory.

3 years agoCleanup: style
Campbell Barton [Thu, 5 May 2016 20:29:39 +0000 (06:29 +1000)]
Cleanup: style

3 years agoMissed last commit
Campbell Barton [Thu, 5 May 2016 20:27:42 +0000 (06:27 +1000)]
Missed last commit

3 years agobvhutils: remove bitmap counting
Campbell Barton [Thu, 5 May 2016 20:10:37 +0000 (06:10 +1000)]
bvhutils: remove bitmap counting

All callers pass in valid number

3 years agoCleanup: rename getepsilon -> get_epsilon
Campbell Barton [Thu, 5 May 2016 20:03:03 +0000 (06:03 +1000)]
Cleanup: rename getepsilon -> get_epsilon

3 years agoAdd asserts to check bvhutils args are correct
Campbell Barton [Thu, 5 May 2016 20:00:36 +0000 (06:00 +1000)]
Add asserts to check bvhutils args are correct

Would have prevented previous error going unnoticed.

3 years agoFix crash adding byte color grid images
Sergey Sharybin [Thu, 5 May 2016 20:04:31 +0000 (22:04 +0200)]
Fix crash adding byte color grid images

3 years agoCode cleanup: simplify SVM stack assignment.
Brecht Van Lommel [Mon, 2 May 2016 18:12:42 +0000 (20:12 +0200)]
Code cleanup: simplify SVM stack assignment.

3 years agoCode cleanup: remove some unused functions.
Brecht Van Lommel [Mon, 2 May 2016 19:30:37 +0000 (21:30 +0200)]
Code cleanup: remove some unused functions.

3 years agoCode refactor: reduce special node types, use generic constant folding.
Brecht Van Lommel [Sun, 1 May 2016 22:05:16 +0000 (00:05 +0200)]
Code refactor: reduce special node types, use generic constant folding.

3 years agoFix Cycles emission node being unnecessarily tagged as spatially varying.
Brecht Van Lommel [Sun, 1 May 2016 22:37:42 +0000 (00:37 +0200)]
Fix Cycles emission node being unnecessarily tagged as spatially varying.

3 years agoFix OS X build error after SSE changes, BLI_math_base.h conflicts with EXR headers.
Brecht Van Lommel [Thu, 5 May 2016 19:39:10 +0000 (21:39 +0200)]
Fix OS X build error after SSE changes, BLI_math_base.h conflicts with EXR headers.

3 years agoFix for fix, sorry for the noise
Campbell Barton [Thu, 5 May 2016 19:46:07 +0000 (05:46 +1000)]
Fix for fix, sorry for the noise

3 years agoMissed last commit
Campbell Barton [Thu, 5 May 2016 19:42:00 +0000 (05:42 +1000)]
Missed last commit

3 years agoCorrect own mistake int recent transform API edits
Campbell Barton [Thu, 5 May 2016 19:40:07 +0000 (05:40 +1000)]
Correct own mistake int recent transform API edits

Need to return number of enabled elements.

3 years agoFix error not using the cached BVH tree
Campbell Barton [Thu, 5 May 2016 19:17:34 +0000 (05:17 +1000)]
Fix error not using the cached BVH tree

3 years agoTransform/Snap: EditMesh/BKE_bvhutils API improvements
Germano Cavalcante [Thu, 5 May 2016 18:49:21 +0000 (04:49 +1000)]
Transform/Snap: EditMesh/BKE_bvhutils API improvements

Separate the creation of trees from EditMesh from the creation of trees from DerivedMesh.
This was meant to simplify the API, but didn't work out so well.

`bvhtree_from_mesh_*` actually is working as `bvhtree_from_derivedmesh_*`.
This is inconsistent with the trees created from EditMesh. Since for create them does not use the DerivedMesh.

In such cases the dm is being used only to cache the tree in the struct DerivedMesh. What is immediately released once
bvhtree is being used in functions that change(tag) the DM cleaning the cache.

- Use a filter function so users of SnapObjectContext can define how edit-mesh elements are handled.
- Remove em_evil.
- bvhtree of EditMesh is now really cached in the snap functions.
- Code becomes organized and easier to maintain.

This is an important patch for future improvements in snapping functions.

3 years agoOptimize linear<->sRGB conversion for SSE2 processors
Sergey Sharybin [Thu, 5 May 2016 17:25:08 +0000 (19:25 +0200)]
Optimize linear<->sRGB conversion for SSE2 processors

Using SSE2 intrinsics when available for this kind of conversions.

It's not totally accurate, but accurate enough for the purposes where
we're using direct colorspace conversion by-passing OCIO.

Partially based on code from Cycles, partially based on other online

Makes projection painting on hi-res float textures smoother.

This commit also enables global SSE2 in Blender. It shouldn't
bring any regressions in supported hardware (we require SSE2 since
2.64 now), but should keep an eye on because compilers might have
some bugs with that (unlikely, but possible).

3 years agoDocs: scanfill.c purpose
Campbell Barton [Thu, 5 May 2016 14:37:31 +0000 (00:37 +1000)]
Docs: scanfill.c purpose

3 years agoFix T48320: Freestyle renders wrong edges of objects which in the other RenderLayer.
Tamito Kajiyama [Thu, 5 May 2016 14:09:22 +0000 (23:09 +0900)]
Fix T48320: Freestyle renders wrong edges of objects which in the other RenderLayer.

FSAA sample files in EXR format are no longer always updated (after some
changes between 2.73 and 2.74 releases), and the reported bug was caused
by old samples from a previous frame that were being merged by mistake.

The present revision addresses the documented issue by entirely skipping
the rendering of auto-generated scenes when there are no Freestyle strokes
to render, which suppresses sample merging of the render layers that were
not rendered.

3 years agoOptimize projection painting with big brushes
Sergey Sharybin [Thu, 5 May 2016 12:45:00 +0000 (14:45 +0200)]
Optimize projection painting with big brushes

Multi-threaded partial buffer update, gives about 2x speedup with
big brushes.

Thanks Campbell for testing and benchmarking!

3 years agoOptimize threaded scanline processor
Sergey Sharybin [Thu, 5 May 2016 12:18:11 +0000 (14:18 +0200)]
Optimize threaded scanline processor

Avoid memory allocation for task data.

3 years agoSimplify scanline threaded processor used by GPU_verify_image
Sergey Sharybin [Thu, 5 May 2016 11:15:51 +0000 (13:15 +0200)]
Simplify scanline threaded processor used by GPU_verify_image

Just avoid some unneeded initialization functions when the threaded
processor is simple enough to only depend on current chunk start
scanline and number of scanlines.

3 years agoFix project paint using uninitialized edit-region
Campbell Barton [Thu, 5 May 2016 10:57:54 +0000 (20:57 +1000)]
Fix project paint using uninitialized edit-region

First stroke always had the minimum rectangle set to 0,0 which could cause a largre region of pixels to be
unnecessarily updated.

3 years agoCurve Fitting: avoid clamping fallback handles.
Campbell Barton [Thu, 5 May 2016 10:30:08 +0000 (20:30 +1000)]
Curve Fitting: avoid clamping fallback handles.

3 years agoOptimize Blank and Color Grid generated images
Sergey Sharybin [Thu, 5 May 2016 10:02:40 +0000 (12:02 +0200)]
Optimize Blank and Color Grid generated images

Avoid unnecessary pixels linearization gives nice speedup.

3 years agoCorrect error in recent smoothview edits
Campbell Barton [Thu, 5 May 2016 09:58:03 +0000 (19:58 +1000)]
Correct error in recent smoothview edits

3 years agoFix typo in previous commit
Sergey Sharybin [Thu, 5 May 2016 09:33:13 +0000 (11:33 +0200)]
Fix typo in previous commit

Thanks Julian Eisel (Severin) for the heads up!

3 years agoOptimization for initial display of high res textures in viewport
Sergey Sharybin [Thu, 5 May 2016 09:25:31 +0000 (11:25 +0200)]
Optimization for initial display of high res textures in viewport

Multi-thread all the color space conversion operations.

Gives speedup from 0.8 to 0.1 seconds on a model with 4k etxture on it.

3 years agoImage Paint: fix for calls to GPU_free_image while painting
Campbell Barton [Thu, 5 May 2016 08:52:11 +0000 (18:52 +1000)]
Image Paint: fix for calls to GPU_free_image while painting

The width and height of of the region to update are often zero,
skip calling GPU_paint_update_image in this case.

3 years agoFix T48210: Editing all selected buttons fails to auto-key
Campbell Barton [Wed, 4 May 2016 16:37:46 +0000 (02:37 +1000)]
Fix T48210: Editing all selected buttons fails to auto-key

3 years agoUI: avoid getting the active button when its already known
Campbell Barton [Wed, 4 May 2016 16:21:29 +0000 (02:21 +1000)]
UI: avoid getting the active button when its already known