4 years agoC99/C++11: replace deprecated finite() by isfinite().
Brecht Van Lommel [Sun, 15 May 2016 22:48:02 +0000 (00:48 +0200)]
C99/C++11: replace deprecated finite() by isfinite().

4 years agoFix C++11 build issues on OS X, remove references to outdated libs.
Brecht Van Lommel [Mon, 16 May 2016 18:03:59 +0000 (20:03 +0200)]
Fix C++11 build issues on OS X, remove references to outdated libs.

4 years agoCode refactor: use shader pointers rather than shader indexes.
Brecht Van Lommel [Sat, 14 May 2016 12:50:03 +0000 (14:50 +0200)]
Code refactor: use shader pointers rather than shader indexes.

4 years agoCode refactor: use dynamic shader node array lengths now that OSL supports them.
Brecht Van Lommel [Sat, 7 May 2016 23:54:35 +0000 (01:54 +0200)]
Code refactor: use dynamic shader node array lengths now that OSL supports them.

4 years agoCode refactor: add some array utility methods, fix leak in assignment operator.
Brecht Van Lommel [Sat, 7 May 2016 17:47:08 +0000 (19:47 +0200)]
Code refactor: add some array utility methods, fix leak in assignment operator.

4 years agoBendy Bones: Small ui tweak
Thomas Beck [Tue, 17 May 2016 16:08:04 +0000 (18:08 +0200)]
Bendy Bones: Small ui tweak

Change the order of the bending controls ("Curve XY Offsets") so the user can activate both InX and OutX by holding down the left mouse button. This way, it's easy to bend symmetrically on X or Y.

4 years agoFix T48434: Missing meta support in new depsgraph
Sergey Sharybin [Tue, 17 May 2016 15:52:23 +0000 (17:52 +0200)]
Fix T48434: Missing meta support in new depsgraph

4 years agoBendy Bones: Advanced B-Bones for Easier + Simple Rigging
Joshua Leung [Tue, 17 May 2016 15:19:06 +0000 (03:19 +1200)]
Bendy Bones: Advanced B-Bones for Easier + Simple Rigging

This commit/patch/branch brings a bunch of powerful new options for B-Bones and
for working with B-Bones, making it easier for animators to create their own
rigs, using fewer bones (which also means hopefully lighter + faster rigs ;)
This functionality was first demoed by Daniel at BConf15

Some highlights from this patch include:
* You can now directly control the shape of B-Bones using a series of properties
  instead of being restricted to trying to indirectly control them through the
  neighbouring bones.  See the "Bendy Bones" panel...

* B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone.
  This is useful for things like eyebrows and mouths/eyelids

* You can now make B-Bones use custom bones as their reference bone handles,
  instead of only using the parent/child bones. To do so, enable the
  "Use Custom Reference Handles" toggle. If none are specified, then the BBone will
  only use the Bendy Bone properties.

* Constraints Head/Tail option can now slide along the B-Bone shape, instead of
  just linearly interpolating between the endpoints of the bone.

For more details, see:

-- Credits --
Original Idea: Daniel M Lara (pepeland)
Original Patch/Research: Jose Molina
Additional Development + Polish: Joshua Leung (aligorith)
Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)

4 years agoFix CUDA MEMCPY condition, it should only copy 3D, 2D or 1D.
Thomas Dinges [Mon, 16 May 2016 22:37:34 +0000 (00:37 +0200)]
Fix CUDA MEMCPY condition, it should only copy 3D, 2D or 1D.

Found by Brecht, thanks!

4 years agoCycles / Requested Features: Volume was missing in logging print.
Thomas Dinges [Mon, 16 May 2016 22:36:22 +0000 (00:36 +0200)]
Cycles / Requested Features: Volume was missing in logging print.

4 years agoUsual i18n/UI messgaes fixes...
Bastien Montagne [Mon, 16 May 2016 19:46:55 +0000 (21:46 +0200)]
Usual i18n/UI messgaes fixes...

4 years agoRemove strict header, gives issues with gcc5x
Campbell Barton [Mon, 16 May 2016 19:26:09 +0000 (05:26 +1000)]
Remove strict header, gives issues with gcc5x

4 years agoCleanup: use const args
Campbell Barton [Mon, 16 May 2016 17:07:40 +0000 (03:07 +1000)]
Cleanup: use const args

4 years agoCustomData: Support for >2gig layers
Campbell Barton [Mon, 16 May 2016 17:01:32 +0000 (03:01 +1000)]
CustomData: Support for >2gig layers

4 years agoCleanup: simplify checks calculating tangents
Campbell Barton [Mon, 16 May 2016 15:58:07 +0000 (01:58 +1000)]
Cleanup: simplify checks calculating tangents

4 years agoBLI_task: Add new 'BLI_task_parallel_range_finalize()'.
Bastien Montagne [Mon, 16 May 2016 15:15:18 +0000 (17:15 +0200)]
BLI_task: Add new 'BLI_task_parallel_range_finalize()'.

Together with the extended loop callback and userdata_chunk, this allows to perform
cumulative tasks (like aggregation) in a lockfree way using local userdata_chunk to store temp data,
and once all workers have finished, to merge those userdata_chunks in the finalize callback
(from calling thread, so no need to lock here either).

Note that this changes how userdata_chunk is handled (now fully from 'main' thread,
which means a given worker thread will always get the same userdata_chunk, without
being re-initialized anymore to init value at start of each iter chunk).

4 years agoBLI_task: Add back lost 'push_from_thread' change to BLI_task_parallel_range() & co.
Bastien Montagne [Mon, 16 May 2016 14:46:54 +0000 (16:46 +0200)]
BLI_task: Add back lost 'push_from_thread' change to BLI_task_parallel_range() & co.

4 years agoFix T48447: Inactive menu items don't grey-out icons
Campbell Barton [Mon, 16 May 2016 14:15:21 +0000 (00:15 +1000)]
Fix T48447: Inactive menu items don't grey-out icons

4 years agoBLI_task: make foreach loop index hleper lockfree, take II.
Bastien Montagne [Mon, 16 May 2016 13:57:19 +0000 (15:57 +0200)]
BLI_task: make foreach loop index hleper lockfree, take II.

New code is actually much, much better than first version, using 'fetch_and_add' atomic op
here allows us to get rid of the loop etc.

The broken CAS issue remains on windows, to be investigated...

4 years agoAtomic ops: add 'fetch_and_add_uint32' op.
Bastien Montagne [Mon, 16 May 2016 13:56:39 +0000 (15:56 +0200)]
Atomic ops: add 'fetch_and_add_uint32' op.

Needed for next commit.

4 years agoCleanup rna_Brush_direction_itemf()
Bastien Montagne [Mon, 16 May 2016 13:54:18 +0000 (15:54 +0200)]
Cleanup rna_Brush_direction_itemf()

Some variants of gcc compilation were reporting 'control reaching end of non-void function' error
in this switch/case maze. Either use break everywhere or not at all (which is simpler, since we
only always return anyway...).

4 years agoCycles: Cleanup after recent refactor
Sergey Sharybin [Mon, 16 May 2016 08:55:50 +0000 (10:55 +0200)]
Cycles: Cleanup after recent refactor

Wrong indentation, wrong spacing.

4 years agoRevert "Docs: smoke typo corrections"
Campbell Barton [Sun, 15 May 2016 23:28:46 +0000 (09:28 +1000)]
Revert "Docs: smoke typo corrections"

This reverts commit b13bc48932761dd813597507b1a1dc86d951ebff.

Wasn't only typo fixes, broke compiling

4 years agoDocs: smoke typo corrections
Campbell Barton [Sun, 15 May 2016 21:52:56 +0000 (07:52 +1000)]
Docs: smoke typo corrections

patch by @Blendify

4 years agoCurve Fitting: correct circular tangent length calculation
Campbell Barton [Sun, 15 May 2016 21:35:44 +0000 (07:35 +1000)]
Curve Fitting: correct circular tangent length calculation

Method for scaling is still not perfect but quite close.

4 years agoFix T48422: Revert "BLI_task: nano-optimizations to BLI_task_parallel_range feature."
Bastien Montagne [Sun, 15 May 2016 19:11:36 +0000 (21:11 +0200)]
Fix T48422: Revert "BLI_task: nano-optimizations to BLI_task_parallel_range feature."

There are some serious issues under windows, causing deadlocks somehow (not reproducible under linux so far).

Until further investigation over why this happens, better to revert to previous
spin-locked behavior.

This reverts commits a83bc4f59707ab and 98123ae9168.

4 years agoBGE: Fix KX_LightObject python API documentation.
Porteries Tristan [Sun, 15 May 2016 14:56:40 +0000 (14:56 +0000)]
BGE: Fix KX_LightObject python API documentation.

Replace "..attribute::" by ".. attribute::".

4 years agoFix T48425: Armature Symmetrize is flipping Custom Shape parameter.
Bastien Montagne [Sun, 15 May 2016 10:35:01 +0000 (12:35 +0200)]
Fix T48425: Armature Symmetrize is flipping Custom Shape parameter.

In case not all bones are selected, not all possible mirrors are set in editbone->temp.ebone,
so we need to search them...

4 years agoFix an error in new lockfree parallel_range_next_iter_get() helper.
Bastien Montagne [Sat, 14 May 2016 16:02:34 +0000 (18:02 +0200)]
Fix an error in new lockfree parallel_range_next_iter_get() helper.

Reading the shared state->iter value after storing it in the 'reference' var could in theory
lead to a race condition setting state->iter value above state->stop, which would be 'deadly'.

This **may** be the cause of T48422, though I was not able to reproduce that issue so far.

4 years agoFix Cube generated UV's rotated incorrectly
Campbell Barton [Sat, 14 May 2016 12:55:55 +0000 (22:55 +1000)]
Fix Cube generated UV's rotated incorrectly

4 years agoFix T48426: Use same length for all header message strings.
Bastien Montagne [Sat, 14 May 2016 08:00:52 +0000 (10:00 +0200)]
Fix T48426: Use same length for all header message strings.

Some languages like Chinese or Japanese take three or four bytes per char...

Also fixed some missing translation markers for UI header messages.

4 years agoCorrect BM_iter_mesh_bitmap_from_filter return
Campbell Barton [Fri, 13 May 2016 18:49:42 +0000 (04:49 +1000)]
Correct BM_iter_mesh_bitmap_from_filter return

4 years agoCorrect asserts
Campbell Barton [Fri, 13 May 2016 18:05:18 +0000 (04:05 +1000)]
Correct asserts

4 years agoFix script_paths(check_all=True) missing script paths
Campbell Barton [Fri, 13 May 2016 17:25:06 +0000 (03:25 +1000)]
Fix script_paths(check_all=True) missing script paths

BLENDER_SYSTEM_SCRIPTS wasn't included in bpy.utils.script_paths()

4 years agoFix compilation with strict compiler flags
Sergey Sharybin [Fri, 13 May 2016 15:37:39 +0000 (17:37 +0200)]
Fix compilation with strict compiler flags

Some const qualifier was discarding.

4 years agoFix T48421: AO pass broken, only works when AO in cycles is enabled
Sergey Sharybin [Fri, 13 May 2016 15:33:26 +0000 (17:33 +0200)]
Fix T48421: AO pass broken, only works when AO in cycles is enabled

4 years agoCleanup: rna naming, indentation
Campbell Barton [Fri, 13 May 2016 15:28:21 +0000 (01:28 +1000)]
Cleanup: rna naming, indentation

4 years agoFix T48416: Impossible to copy a linked object from a file to another one mantaining...
Bastien Montagne [Fri, 13 May 2016 12:07:30 +0000 (14:07 +0200)]
Fix T48416: Impossible to copy a linked object from a file to another one mantaining the linked library.

When writing temp blenbuffer file, libraries of linked datablocks where not tagged correctly, which
means they were not put in the temp Main used to write the buffer, resulting in implicit localization
of linked data.

4 years agoFix T48416: Impossible to append from another file without localizing also all indire...
Bastien Montagne [Fri, 13 May 2016 10:54:09 +0000 (12:54 +0200)]
Fix T48416: Impossible to append from another file without localizing also all indirectly linked data.

Previous to 2.77, this used to be default behavior, was changed in rB591f4549c958b.

However, in most append cases, you do want a full localization of your data, so this new behavior
is kept by default, but there is now an option in append operator to only localize the 'first level'
of data (i.e. datablocks from linked library itself, and not those from other 'sub-libraries').

4 years agoFix T47652: Texture shading mode fails to update material colors
Campbell Barton [Fri, 13 May 2016 12:03:18 +0000 (22:03 +1000)]
Fix T47652: Texture shading mode fails to update material colors

4 years agoArmature meshdeform evaluation: parallelize computation of bbones deform matrices.
Bastien Montagne [Fri, 13 May 2016 09:05:12 +0000 (11:05 +0200)]
Armature meshdeform evaluation: parallelize computation of bbones deform matrices.

On big and complex rigs like blendrig or koro, it can give up to ~10% more FPS in best cases.
Hard to tackle all cases in tests though, so please report any unexpected slowdown
in armature animation playback!

4 years agoBLI_task: add support for listbase parallelized for loops.
Bastien Montagne [Fri, 13 May 2016 09:03:04 +0000 (11:03 +0200)]
BLI_task: add support for listbase parallelized for loops.

Code by @sergey, with small edits and doc by @mont29.

4 years agoCleanup: fix inconsitency in dynamicPaint_outputLayerExists()
Bastien Montagne [Thu, 12 May 2016 11:15:55 +0000 (13:15 +0200)]
Cleanup: fix inconsitency in dynamicPaint_outputLayerExists()

Dyna WPaint indeed only uses first output layer, but better be consistent in those cases...

4 years agoDynapaint: cleanup of BKE code.
Bastien Montagne [Thu, 12 May 2016 10:08:03 +0000 (12:08 +0200)]
Dynapaint: cleanup of BKE code.

Line lengths, monolined 'if' statements, int -> bool, etc.

Also, replaced some internal cooked stuff by BLI helpers (most notably, the
'is inside UV triangle' code in `dynamicPaint_createUVSurface()`), and some
other minor optimizations.

4 years agoBLI_math: add 'equals_m4m4' (and 'm3' variant) helpers.
Bastien Montagne [Thu, 12 May 2016 10:07:31 +0000 (12:07 +0200)]
BLI_math: add 'equals_m4m4' (and 'm3' variant) helpers.

4 years agoCycles: Scale debug pass with number of samples
Sergey Sharybin [Fri, 13 May 2016 09:21:00 +0000 (11:21 +0200)]
Cycles: Scale debug pass with number of samples

This way it's easier to compare different renders together without
worrying about scale too much.

4 years agoImage editor: Show actual value of single-channel buffer in sample info
Sergey Sharybin [Fri, 13 May 2016 09:19:32 +0000 (11:19 +0200)]
Image editor: Show actual value of single-channel buffer in sample info

Previously if image only had single channel only z buffer value was displaying.
This isn't handy for cases when you've got single channel buffer which is not
a z buffer.

Also fixed possible read past the array.

4 years agoinstall_deps: Avoid conflicts on Arch-based systems when gcc-multilib is installed
Mai Lavelle [Thu, 12 May 2016 22:17:14 +0000 (18:17 -0400)]
install_deps: Avoid conflicts on Arch-based systems when gcc-multilib is installed

install_deps can fail due to conflict between gcc (referenced by base-devel) and
gcc-multilib if the latter is installed. This avoids the conflict by filtering
the contents of base-devel when needed.

Reviewers: mont29

Differential Revision:

4 years agoCycles: Add support for single channel byte textures.
Thomas Dinges [Thu, 12 May 2016 12:51:42 +0000 (14:51 +0200)]
Cycles: Add support for single channel byte textures.

This way, we also save 3/4th of memory for single channel byte textures (e.g. Bump Maps).

Note: In order for this to work, the texture *must* have 1 channel only.
In Gimp you can e.g. do that via the menu: Image -> Mode -> Grayscale

4 years agoFix array bounds compile warning.
Thomas Dinges [Thu, 12 May 2016 12:20:12 +0000 (14:20 +0200)]
Fix array bounds compile warning.

4 years agoFix T48413: editmesh intersect tool crash
Campbell Barton [Thu, 12 May 2016 10:58:20 +0000 (20:58 +1000)]
Fix T48413: editmesh intersect tool crash

Its important to add tri-edge intersections from both sides.

4 years agoCorrect debug prints
Campbell Barton [Thu, 12 May 2016 10:01:49 +0000 (20:01 +1000)]
Correct debug prints

4 years agoFix depsgraph tagging during the relations build pass.
Lukas Tönne [Thu, 12 May 2016 07:54:08 +0000 (09:54 +0200)]
Fix depsgraph tagging during the relations build pass.

Followup commit to 18e5e2fa1ac26ccbbd0cc8b486a5d92be6888021. Needs the same
treatment in the second pass when ID tags are reset again.

4 years agoBMesh: avoid calling delete operator w/ face dissolve
Campbell Barton [Thu, 12 May 2016 06:45:47 +0000 (16:45 +1000)]
BMesh: avoid calling delete operator w/ face dissolve

In nearly all cases this isn't needed.

4 years agoFix missing piece in recent rBce65fae8f32c (support for '+' key).
Bastien Montagne [Thu, 12 May 2016 06:00:55 +0000 (08:00 +0200)]
Fix missing piece in recent rBce65fae8f32c (support for '+' key).

Thanks to Daniel Rivera (Dr2d4) for the headup!

4 years agoRecent bmesh face-join caused regression (T48407)
Campbell Barton [Thu, 12 May 2016 06:07:14 +0000 (16:07 +1000)]
Recent bmesh face-join caused regression (T48407)

4 years agoCleanup: Fix typo.
Thomas Dinges [Thu, 12 May 2016 00:11:19 +0000 (02:11 +0200)]
Cleanup: Fix typo.

4 years agoArmature outline drawing used single width line
Campbell Barton [Wed, 11 May 2016 21:13:11 +0000 (07:13 +1000)]
Armature outline drawing used single width line

Only set line width in pose-mode

4 years agoBMesh: use active face fallback w/ select-path
Campbell Barton [Wed, 11 May 2016 21:09:08 +0000 (07:09 +1000)]
BMesh: use active face fallback w/ select-path

From user perspective, last selected face is the same as the active face,
use this as a fallback.

4 years agoCleanup: Remove outdated comment and add new one about slot IDs.
Thomas Dinges [Wed, 11 May 2016 20:25:48 +0000 (22:25 +0200)]
Cleanup: Remove outdated comment and add new one about slot IDs.

4 years agoCycles: Add support for single channel float textures on CPU.
Thomas Dinges [Mon, 9 May 2016 10:51:42 +0000 (12:51 +0200)]
Cycles: Add support for single channel float textures on CPU.

Until now, single channel textures were packed into a float4, wasting 3 floats per pixel. Memory usage of such textures is now reduced by 3/4.
Voxel Attributes such as density, flame and heat benefit from this, but also Bumpmaps with one channel.
This commit also includes some cleanup and code deduplication for image loading.

Example Smoke render from Cosmos Laundromat:
Memory here went down from ~600MB to ~300MB.

Reviewers: #cycles, brecht

Differential Revision:

4 years agoBMesh: ignore non-manifold face connections
Campbell Barton [Wed, 11 May 2016 20:00:05 +0000 (06:00 +1000)]
BMesh: ignore non-manifold face connections

Was showing an error message,
now dissolve the faces that and delimit at non-manifold boundaries.

4 years agoBMesh: add BMW_ISLAND_MANIFOLD
Campbell Barton [Wed, 11 May 2016 19:58:38 +0000 (05:58 +1000)]

An island walker that only walks over manifold edges.

4 years agoBMesh Island Walker: use direct loop access
Campbell Barton [Wed, 11 May 2016 19:30:20 +0000 (05:30 +1000)]
BMesh Island Walker: use direct loop access

4 years agoBMesh: remove exception from face-join function
Campbell Barton [Wed, 11 May 2016 18:42:45 +0000 (04:42 +1000)]
BMesh: remove exception from face-join function

Callers need to check for NULL, if we need to know exact cause it could be a return arg.

4 years agoBMesh: boundary walker, skip non-manifold loops
Campbell Barton [Wed, 11 May 2016 18:39:01 +0000 (04:39 +1000)]
BMesh: boundary walker, skip non-manifold loops

Instead of setting an exception, treat non-manifold edges as boundaries.

4 years agoBMesh: add check for manifold loop
Campbell Barton [Wed, 11 May 2016 18:37:36 +0000 (04:37 +1000)]
BMesh: add check for manifold loop

4 years agoCleanup: only use r_ prefix for return args
Campbell Barton [Wed, 11 May 2016 18:36:16 +0000 (04:36 +1000)]
Cleanup: only use r_ prefix for return args

4 years agoCleanup: unused win32 headers
Campbell Barton [Wed, 11 May 2016 18:35:40 +0000 (04:35 +1000)]
Cleanup: unused win32 headers

4 years agoerror in last commit
Campbell Barton [Wed, 11 May 2016 15:43:56 +0000 (01:43 +1000)]
error in last commit

4 years agoCorrect check for tree being in BVH cache
Campbell Barton [Wed, 11 May 2016 15:39:33 +0000 (01:39 +1000)]
Correct check for tree being in BVH cache

4 years agoRemove pointer typedef from BVHCache
Campbell Barton [Wed, 11 May 2016 15:37:01 +0000 (01:37 +1000)]
Remove pointer typedef from BVHCache

Used ** arguments unnecessarily,
also replace BLI_linklist_apply with while loop.

4 years agoFix crash snapping to mesh with no geometry
Campbell Barton [Wed, 11 May 2016 14:57:18 +0000 (00:57 +1000)]
Fix crash snapping to mesh with no geometry

4 years agoCycles: Use explicit qualifier for single-argument constructors
Sergey Sharybin [Wed, 11 May 2016 14:50:10 +0000 (16:50 +0200)]
Cycles: Use explicit qualifier for single-argument constructors

Almost in all cases we want such constructors to be explicit, there are
exceptions but only in few places.

4 years agoFix incorrect FLT_MIN use
Campbell Barton [Wed, 11 May 2016 11:36:42 +0000 (21:36 +1000)]
Fix incorrect FLT_MIN use

4 years agoTransform Volume rewrite/refactor
Germano Cavalcante [Wed, 11 May 2016 09:59:02 +0000 (19:59 +1000)]
Transform Volume rewrite/refactor

Take advantage of the efficiency provided by the snap_context.

Also fixes errors:
- volume snap fails based on view angle (T48394).
- multiple instances of dupli-objects break volume calculation.

4 years agoBMesh: correct fix for face-join removing attached faces
Campbell Barton [Wed, 11 May 2016 10:09:40 +0000 (20:09 +1000)]
BMesh: correct fix for face-join removing attached faces

4 years agoFix for inline documentation of FOREACH_NODETREE.
Lukas Tönne [Wed, 11 May 2016 08:52:41 +0000 (10:52 +0200)]
Fix for inline documentation of FOREACH_NODETREE.

Was missing id macro variable.

4 years agoFix for node tree ID tagging in new depsgraph.
Lukas Tönne [Wed, 11 May 2016 08:51:10 +0000 (10:51 +0200)]
Fix for node tree ID tagging in new depsgraph.

Nested node trees are not handled in BKE_main_id_tag_all.

4 years agoDepsgraph: Add some missing relations
Sergey Sharybin [Wed, 11 May 2016 07:23:11 +0000 (09:23 +0200)]
Depsgraph: Add some missing relations

Those cases requires not only geometry component, but also a transform one
to be ready before evaluation can start.

4 years agoBLI_kdopbvh: Use distance for BLI_bvhtree_ray_cast_all
Campbell Barton [Wed, 11 May 2016 04:33:49 +0000 (14:33 +1000)]
BLI_kdopbvh: Use distance for BLI_bvhtree_ray_cast_all

Pass distance argument so its possible to limit the range we get all hits from.

Other changes:

- Use boundbox test before calling callback, avoids redundant calls.
- Remove meaningless return value.
- Add doc string, explaining purpose of this function.

4 years agoCMake: optional date/time overrides for reproducible builds
Campbell Barton [Tue, 10 May 2016 16:43:58 +0000 (02:43 +1000)]
CMake: optional date/time overrides for reproducible builds

4 years agoFix T48387: Mirror weights keeps groups assigned
Campbell Barton [Tue, 10 May 2016 15:32:26 +0000 (01:32 +1000)]
Fix T48387: Mirror weights keeps groups assigned

Swapping the weights kept zero weight verts assigned.

4 years agoBMesh: only remove loose geometry when joining faces
Campbell Barton [Tue, 10 May 2016 15:14:46 +0000 (01:14 +1000)]
BMesh: only remove loose geometry when joining faces

Joining faces could remove faces that happened to share an edge that would normally be removed.

4 years agoBLI_task: nano-optimizations to BLI_task_parallel_range feature.
Bastien Montagne [Tue, 10 May 2016 15:49:27 +0000 (17:49 +0200)]
BLI_task: nano-optimizations to BLI_task_parallel_range feature.

This commit makes use of new taskpool feature (instead of allocating own tasks),
and removes the spinlock used to generate chunks (using atomic ops instead).

In best cases (dynamic scheduled loop with light processing func callback), we
get a few percents of speedup, in most cases there is no sensible enhancement.

4 years agoDepsgraph: A bit of experiment with skipping where_is_bone if channels is taged as...
Sergey Sharybin [Tue, 10 May 2016 15:30:19 +0000 (17:30 +0200)]
Depsgraph: A bit of experiment with skipping where_is_bone if channels is taged as done

This is what old dependency graph was doing and apparently this avoids some updates,
however it's not really clear why those nodes are considering done. Maybe just because
of the way how relations are working. But needs a closer investigation.

4 years agoAvoid per-constraint-target call of strlen
Sergey Sharybin [Tue, 10 May 2016 15:15:16 +0000 (17:15 +0200)]
Avoid per-constraint-target call of strlen

It's enough to do one single comparison to see if the string is empty or not.

4 years agoOptimize action constraint by avoid memory allocation
Sergey Sharybin [Tue, 10 May 2016 14:45:27 +0000 (16:45 +0200)]
Optimize action constraint by avoid memory allocation

4 years agoAttempt to fix blenplayer after recent changes
Sergey Sharybin [Tue, 10 May 2016 14:14:24 +0000 (16:14 +0200)]
Attempt to fix blenplayer after recent changes

4 years agoRevert "Task scheduler: Avoid mutex lock in number manipulation functions"
Sergey Sharybin [Tue, 10 May 2016 13:43:03 +0000 (15:43 +0200)]
Revert "Task scheduler: Avoid mutex lock in number manipulation functions"

Appears mutex was guarateeing number of tasks is not modified at moments
when it's not expected. Removing those mutexes resulted in some hard-to-catch
locks where worker thread were waiting for work by all the tasks were already

This reverts commit a1d8fe052ccd8945f14be5a50bd5af581b89c643.

4 years agoDepsgraph: Use some more threading when tagging and finalizing evaluation
Sergey Sharybin [Tue, 10 May 2016 13:36:27 +0000 (15:36 +0200)]
Depsgraph: Use some more threading when tagging and finalizing evaluation

Also don't reset values there which were re-set on the next evaluation anyway.

4 years agoTask scheduler: Avoid mutex lock in number manipulation functions
Sergey Sharybin [Tue, 10 May 2016 12:59:19 +0000 (14:59 +0200)]
Task scheduler: Avoid mutex lock in number manipulation functions

It seems using atomic operations here we can avoid having mute without
breaking anything.

Thanks Bastien for double-checking the changes!

4 years agoFix T48393: Blender player doesn't start on files saved with with cyrillic letters...
Sergey Sharybin [Tue, 10 May 2016 12:30:41 +0000 (14:30 +0200)]
Fix T48393: Blender player doesn't start on files saved with with cyrillic letters in path

4 years agoFix own mistake in rBd617de965ea20e5d5 from late December 2015.
Bastien Montagne [Tue, 10 May 2016 10:52:44 +0000 (12:52 +0200)]
Fix own mistake in rBd617de965ea20e5d5 from late December 2015.

Brain melt here, intention was to reduce number of tasks in case we have not much chunks of data to loop over,
not to increase it!

Note that this only affected dynamic scheduling.

4 years agoDepsgraph: For big graphs update pending parents in threads
Sergey Sharybin [Tue, 10 May 2016 11:02:54 +0000 (13:02 +0200)]
Depsgraph: For big graphs update pending parents in threads

Gives additional speedup from ~88 to ~91 fps with a test rig.

4 years agoDepsgraph: Comment evaluation priority out for now
Sergey Sharybin [Tue, 10 May 2016 10:05:09 +0000 (12:05 +0200)]
Depsgraph: Comment evaluation priority out for now

It uses some additional compute power and the evaluation priority is
not even used.

This brings fps 88.2 with blenrig_for_debugging.blend on this desktop.

4 years agoDepsgraph: Avoid multipel editors update per same ID
Sergey Sharybin [Tue, 10 May 2016 09:25:57 +0000 (11:25 +0200)]
Depsgraph: Avoid multipel editors update per same ID

Simple thing, and apparently fps goes up to 80 with the demo file from jpbouza.

Not sure why at this point fps is so much higher than the old dependency graph
here now. And it's definitely something what others should verify as well.

4 years agoDepsgraph: Don't leave active thread if there's only one children node
Sergey Sharybin [Tue, 10 May 2016 08:39:38 +0000 (10:39 +0200)]
Depsgraph: Don't leave active thread if there's only one children node

This reduces stress on the task scheduler and avoids some unwanted overhead
caused by all the threading business in the cases when there's only one
children node. We try to immediately switch to it's evaluation now, keeping
active thread up and running.

This bumps FPS from 58 to 64 on the blenrig test file from jpbouza.

4 years agoTask scheduler: Add thread-aware task push routines
Sergey Sharybin [Tue, 10 May 2016 07:55:58 +0000 (09:55 +0200)]
Task scheduler: Add thread-aware task push routines

This commit implements new function BLI_task_pool_push_from_thread()
who's main goal is to have less parasitic load on the CPU bu avoiding
memory allocations as much as possible, making taks pushing cheaper.

This function expects thread ID, which must be 0 for the thread from
which pool is created from (and from which wait_work() is called) and
for other threads it mush be the ID which was sent to the thread working

This reduces allocations quite a bit in the new dependency graph,
hopefully gaining some visible speedup on a fewzillion core machines
(on my own machine can only see benefit in profiler, which shows
significant reduce of time wasted in the memory allocation).

4 years agoCorrect armature-sketch snap context use
Campbell Barton [Tue, 10 May 2016 06:36:46 +0000 (16:36 +1000)]
Correct armature-sketch snap context use

Use scene snap mode.
Also allow passing NULL ray-depth which falls back to BVH_RAYCAST_DIST_MAX.