blender.git
2 years agoPyAPI: add function to check any mathutils type
Campbell Barton [Wed, 29 Nov 2017 05:09:46 +0000 (16:09 +1100)]
PyAPI: add function to check any mathutils type

Also add CheckExact versions of type checking macros.

2 years agoRNA: sync API changes from 2.8
Campbell Barton [Wed, 29 Nov 2017 03:09:49 +0000 (14:09 +1100)]
RNA: sync API changes from 2.8

2 years agoRNA: Allow structs to define tags for their properties
Julian Eisel [Wed, 29 Nov 2017 02:52:06 +0000 (13:52 +1100)]
RNA: Allow structs to define tags for their properties

Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.

2 years agoPyAPI: PyC_Err_PrintWithFunc utility function
Campbell Barton [Wed, 29 Nov 2017 02:41:10 +0000 (13:41 +1100)]
PyAPI: PyC_Err_PrintWithFunc utility function

Move function error printing utility into py_capi_utils.

2 years agoCleanup (remove commented OMP directive).
Bastien Montagne [Tue, 28 Nov 2017 15:31:11 +0000 (16:31 +0100)]
Cleanup (remove commented OMP directive).

2 years agoRemoving OMP: BKE's tracking_stabilize.
Bastien Montagne [Tue, 28 Nov 2017 11:38:10 +0000 (12:38 +0100)]
Removing OMP: BKE's tracking_stabilize.

Again, 2 times quicker with BLI than with OMP (from about 5ms to 2.5ms
per frame for the parallelized loop, on a rather small video...).

2 years agomakesdna/makesrna: silence output by default
Campbell Barton [Tue, 28 Nov 2017 09:27:40 +0000 (20:27 +1100)]
makesdna/makesrna: silence output by default

No need to print status for basic & reliable operations,
build systems can output operations they run if needed,
or debug output changed in the source if developers are debugging.

Nice for ninja, so any printed text hints at a problem to fix.

2 years agoFix T53145: bevel tool does not start with amount at zero.
Brecht Van Lommel [Mon, 27 Nov 2017 15:55:27 +0000 (16:55 +0100)]
Fix T53145: bevel tool does not start with amount at zero.

2 years agoCleanup: indentation
Sergey Sharybin [Mon, 27 Nov 2017 15:22:09 +0000 (16:22 +0100)]
Cleanup: indentation

2 years agoRemove workaround for loopcut and DM stability
Sergey Sharybin [Mon, 27 Nov 2017 14:39:32 +0000 (15:39 +0100)]
Remove workaround for loopcut and DM stability

Neither me nor Campbell could redo the issue, lets get rid of this workaround
and fix it properly if still needed.

2 years agoDepsgraph: Make sure unexpected configuration does not happen
Sergey Sharybin [Mon, 27 Nov 2017 13:51:49 +0000 (14:51 +0100)]
Depsgraph: Make sure unexpected configuration does not happen

2 years agoSequencer: Fix missing FX compositor when starting rendering from frame with DoF...
Sergey Sharybin [Mon, 27 Nov 2017 13:24:16 +0000 (14:24 +0100)]
Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled

2 years agoSequencer: Add option to render OpenGL preview with DoF
Sergey Sharybin [Fri, 24 Nov 2017 11:19:26 +0000 (12:19 +0100)]
Sequencer: Add option to render OpenGL preview with DoF

The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!

2 years agoRefactor view3d offscreen drawing to avoid having multiple boolean arguments
Sergey Sharybin [Fri, 24 Nov 2017 10:43:16 +0000 (11:43 +0100)]
Refactor view3d offscreen drawing to avoid having multiple boolean arguments

This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable
meaning.

2 years agoTracking: Cleanup. make code friendly for multi-column editing
Sergey Sharybin [Mon, 27 Nov 2017 07:50:01 +0000 (08:50 +0100)]
Tracking: Cleanup. make code friendly for multi-column editing

2 years agoCleanup: incorrect comment
Campbell Barton [Mon, 27 Nov 2017 04:15:56 +0000 (15:15 +1100)]
Cleanup: incorrect comment

2 years agoCleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!
Bastien Montagne [Sun, 26 Nov 2017 18:18:12 +0000 (19:18 +0100)]
Cleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!

So this deduplicates and simplifies code, yeah.

Also, as an odd bonus, new code seems slighly quicker than previous one
(about 5 to 10% quicker).

2 years agoRemoving OMP: BKE's mask_rasterize.c
Bastien Montagne [Sun, 26 Nov 2017 18:06:26 +0000 (19:06 +0100)]
Removing OMP: BKE's mask_rasterize.c

Once again nothing much to say here, except that whole mask rendering
process from VSE is about 25% quicker now. ;)

2 years agoRemoving OMP: autotrack BKE code.
Bastien Montagne [Sun, 26 Nov 2017 16:25:41 +0000 (17:25 +0100)]
Removing OMP: autotrack BKE code.

Pretty straightforward this time, we already have a single struct
pointer containing all needed data (or nearly).

And we gain about 10-15% speed on tracking! :)

2 years agoRemoving OMP: bmesh_operators.c
Bastien Montagne [Sun, 26 Nov 2017 14:51:50 +0000 (15:51 +0100)]
Removing OMP: bmesh_operators.c

Two more 'not really useful' cases (OMP only shows some noticeable
speedup with above 1M elements, and since this is quick operation anyway
compared to even ather basic operators, gain is in the 1% area of total
processing time in best case).

So not worth parallelizing here, we'll gain much more on tackling heavy
operations. ;)

And BMesh is free from OMP now!

2 years agoRemoving OMP: bmesh_interp.c
Bastien Montagne [Sun, 26 Nov 2017 12:06:39 +0000 (13:06 +0100)]
Removing OMP: bmesh_interp.c

Performances tests on this one are quite surprising actually...
Parallelized loop itself is at least 10 times quicker with new BLI_task
code than it was with OMP. And subdividing e.g. a heavy mesh with 3
levels of multires (whole process) takes 8 seconds with new code, while
10 seconds with OMP one. And cherry on top, BLI_task code only uses
about 50% of CPU load, while OMP one was at nearly 100%!

In fact, I suspect OMP code was not properly declaring outside vars,
generating a lot of uneeded locks.

Also, raised the minimum level of subdiv to enable parallelization,
tests here showed that we only start to get significant gain with subdiv
levels of 4, below single threaded one is quicker.

2 years agoRemoving OMP: nuke last usages in bmesh_mesh.c
Bastien Montagne [Sun, 26 Nov 2017 10:36:50 +0000 (11:36 +0100)]
Removing OMP: nuke last usages in bmesh_mesh.c

Those three ones were actually giving no significant benefits, in fact
even slowing things down in one case compared to no parallelization at
all (in `BM_mesh_elem_table_ensure()`).

Point being, once more, parallelizing *very* small tasks (like index or
flag setting, etc.) is nearly never worth it.

Also note that we could not easlily use per-item parallel looping in
those three cases, since they are heavily relying on valid
loop-generated index (or are doing non-threadable things like allocation
from a mempool)...

2 years agoFix T53349: AO bounces not working correct with OpenCL.
Mathieu Menuet [Sun, 26 Nov 2017 14:50:36 +0000 (15:50 +0100)]
Fix T53349: AO bounces not working correct with OpenCL.

2 years agoCleanup: rename edge -> edges
Campbell Barton [Sun, 26 Nov 2017 09:13:18 +0000 (20:13 +1100)]
Cleanup: rename edge -> edges

2 years agoMinor improvement to last commit
Campbell Barton [Sun, 26 Nov 2017 07:34:21 +0000 (18:34 +1100)]
Minor improvement to last commit

Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.

2 years agoBMesh: improve edge rotate when edges share faces
Campbell Barton [Sun, 26 Nov 2017 06:48:00 +0000 (17:48 +1100)]
BMesh: improve edge rotate when edges share faces

Previously outcome depended on order of edges,
now the longest boundary edges are rotated first,
then the faces connected edges.

This gives more predictable results, allowing regions containing
a vertex fan to be rotated onto the next vertex.

2 years agoCleanup: move edge-rotate into own file
Campbell Barton [Sun, 26 Nov 2017 02:40:26 +0000 (13:40 +1100)]
Cleanup: move edge-rotate into own file

2 years agoFix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated...
Joshua Leung [Sun, 26 Nov 2017 00:05:33 +0000 (13:05 +1300)]
Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB

2 years agoFix for Fix (c): broken atomic lock in own bmesh code.
Bastien Montagne [Sat, 25 Nov 2017 22:14:54 +0000 (23:14 +0100)]
Fix for Fix (c): broken atomic lock in own bmesh code.

That was a nasty one, Debug build would never have any issue (even tried
with 64 threads!), but Release build would deadlock nearly immediately,
even with only 2 threads!

What happened here (I think) is that gcc optimizer would generate a
specific path endlessly looping when initial value of virtual_lock was
FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas
completely. Which would have been correct, should v_no[0] not have been
shared (and modified) by multiple threads. ;)

Idea of that (broken) for loop was to avoid completely calling the
atomic cas as long as v_no[0] was locked by some other thread, but...
Guess the avoided/missing memory barrier was the root of the issue here.

Lesson of the evening: Remember kids, do not trust your compiler to
understand all possible threading-related side effects, and be explicit
rather than elegant when using atomic ops!

Side-effect lesson: do check both release and debug builds when messing
with said atomic ops...

2 years agoFix broken atomic_cas lock in own recent commit in bmesh.
Bastien Montagne [Sat, 25 Nov 2017 19:28:12 +0000 (20:28 +0100)]
Fix broken atomic_cas lock in own recent commit in bmesh.

Using atomic cas correctly is really hairy... ;)

In this case, the returned value from cas needs to validate *two*
conditions, it must not be FLT_MAX (which is our 'locked' value and
would mean another thread has already locked it), but it also must be
equal to previously stored value...

This means we need two steps per loop here, hence using a 'for' loop
instead of a 'while' one now.

Note that collisions are (as expected) very rare, less than 1 for 10k
typically, so did not catch the issue initially (also because I was
mostly working with release build to check on performances...).

2 years agoDepsgraph: Cleanup, indentation
Sergey Sharybin [Fri, 24 Nov 2017 14:45:41 +0000 (15:45 +0100)]
Depsgraph: Cleanup, indentation

2 years agoDepsgraph: Allow finding operations after construction is done
Sergey Sharybin [Fri, 24 Nov 2017 14:37:51 +0000 (15:37 +0100)]
Depsgraph: Allow finding operations after construction is done

2 years agoDepsgraph: Deduplicate operation node finding logic
Sergey Sharybin [Fri, 24 Nov 2017 14:35:42 +0000 (15:35 +0100)]
Depsgraph: Deduplicate operation node finding logic

2 years agoDepsgraph: Use proper return type for find_node method
Sergey Sharybin [Fri, 24 Nov 2017 14:34:53 +0000 (15:34 +0100)]
Depsgraph: Use proper return type for find_node method

2 years agoDepsgraph: Use get_ prefix for function which expect operation to exists
Sergey Sharybin [Fri, 24 Nov 2017 14:32:29 +0000 (15:32 +0100)]
Depsgraph: Use get_ prefix for function which expect operation to exists

2 years agoDepsgraph: Make has_ prefixed function to return boolean
Sergey Sharybin [Fri, 24 Nov 2017 14:26:54 +0000 (15:26 +0100)]
Depsgraph: Make has_ prefixed function to return boolean

2 years agoDepsgraph: Introduce explicit method which finds operation or returns NULL
Sergey Sharybin [Fri, 24 Nov 2017 14:24:33 +0000 (15:24 +0100)]
Depsgraph: Introduce explicit method which finds operation or returns NULL

2 years agoDepsgraph: Make more clear what find_operation() is doing for component
Sergey Sharybin [Fri, 24 Nov 2017 14:21:50 +0000 (15:21 +0100)]
Depsgraph: Make more clear what find_operation() is doing for component

2 years agoCleanup leftover timing debug prints from own recent commits.
Bastien Montagne [Fri, 24 Nov 2017 09:43:29 +0000 (10:43 +0100)]
Cleanup leftover timing debug prints from own recent commits.

Sorry about that...

2 years agoCleanup: -Wnonnull-compare GCC warning
Campbell Barton [Fri, 24 Nov 2017 03:28:35 +0000 (14:28 +1100)]
Cleanup: -Wnonnull-compare GCC warning

2 years agoMinor cleanup for own recent commits.
Bastien Montagne [Thu, 23 Nov 2017 21:43:11 +0000 (22:43 +0100)]
Minor cleanup for own recent commits.

2 years agoGetting rid of OMP: first usage of new parallel BMesh items iteration instead.
Bastien Montagne [Thu, 23 Nov 2017 20:21:32 +0000 (21:21 +0100)]
Getting rid of OMP: first usage of new parallel BMesh items iteration instead.

`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2930

2 years agoBMesh: add limited support for parallelization over some basic iterators.
Bastien Montagne [Thu, 23 Nov 2017 20:19:54 +0000 (21:19 +0100)]
BMesh: add limited support for parallelization over some basic iterators.

This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are
supported.

2 years agoatomic_ops: add `atomic_cas_float` helper.
Bastien Montagne [Thu, 23 Nov 2017 20:17:16 +0000 (21:17 +0100)]
atomic_ops: add `atomic_cas_float` helper.

2 years agoAdd a new parallel looper for MemPool items to BLI_task.
Bastien Montagne [Thu, 23 Nov 2017 20:14:43 +0000 (21:14 +0100)]
Add a new parallel looper for MemPool items to BLI_task.

It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.

2 years agoAdd ability to use more than one mempool iterator simultaneously.
Bastien Montagne [Thu, 23 Nov 2017 20:12:00 +0000 (21:12 +0100)]
Add ability to use more than one mempool iterator simultaneously.

This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).

2 years agoatomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.
Bastien Montagne [Thu, 23 Nov 2017 19:18:21 +0000 (20:18 +0100)]
atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.

Checking for type sizes is much nicer with a static assert!

2 years agoAdd non-gcc variant of static assert macro.
Bastien Montagne [Thu, 23 Nov 2017 19:15:15 +0000 (20:15 +0100)]
Add non-gcc variant of static assert macro.

Adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html.

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.

2 years agoFix T53145: bevel tool fails when used a second time.
Brecht Van Lommel [Thu, 23 Nov 2017 19:14:31 +0000 (20:14 +0100)]
Fix T53145: bevel tool fails when used a second time.

Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.

2 years agoFix T53171: lamp specials strength tweak fails with renamed emission nodes.
Brecht Van Lommel [Thu, 23 Nov 2017 18:13:31 +0000 (19:13 +0100)]
Fix T53171: lamp specials strength tweak fails with renamed emission nodes.

2 years agoFix T53360: crash with GLSL bump mapping and missing group output node.
Brecht Van Lommel [Thu, 23 Nov 2017 17:12:32 +0000 (18:12 +0100)]
Fix T53360: crash with GLSL bump mapping and missing group output node.

2 years agoFix T53276: encoding output quality UI clarification.
Brecht Van Lommel [Thu, 23 Nov 2017 16:55:25 +0000 (17:55 +0100)]
Fix T53276: encoding output quality UI clarification.

2 years agoFix T53357: harmless assert after recent addition of render time pass.
Brecht Van Lommel [Thu, 23 Nov 2017 16:00:18 +0000 (17:00 +0100)]
Fix T53357: harmless assert after recent addition of render time pass.

2 years agoFix inaccuracy when storing material ID pass in half float multilayer EXR.
Brecht Van Lommel [Thu, 23 Nov 2017 15:27:22 +0000 (16:27 +0100)]
Fix inaccuracy when storing material ID pass in half float multilayer EXR.

These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.

2 years agoFix T53348: Cycles difference between gradient texture on CPU and GPU.
Brecht Van Lommel [Thu, 23 Nov 2017 15:10:38 +0000 (16:10 +0100)]
Fix T53348: Cycles difference between gradient texture on CPU and GPU.

2 years agoMoar attempt to fix bloody MSVC intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:58:20 +0000 (16:58 +0100)]
Moar attempt to fix bloody MSVC intrinsic mess...

2 years agoAttempt to fix bloody MSVC atomic intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:53:03 +0000 (16:53 +0100)]
Attempt to fix bloody MSVC atomic intrinsic mess...

2 years agoatomic_ops: add char versions of uint8_t atomic primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:23:45 +0000 (16:23 +0100)]
atomic_ops: add char versions of uint8_t atomic primitives.

2 years agoCleanup: use signed atomic ops when needed.
Bastien Montagne [Thu, 23 Nov 2017 15:14:53 +0000 (16:14 +0100)]
Cleanup: use signed atomic ops when needed.

2 years agoatomic_ops: add signed versions of primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:13:23 +0000 (16:13 +0100)]
atomic_ops: add signed versions of primitives.

Reason is motsly that dealing with type conversion in calling code is
not great, makes it less readable, and can generate hidden bugs in case
original type changes and atomic primitive calls are not updated
accordingly...

2 years agoDepsgraph: Cleanup, deduplicate code around component registration
Sergey Sharybin [Thu, 23 Nov 2017 14:23:19 +0000 (15:23 +0100)]
Depsgraph: Cleanup, deduplicate code around component registration

2 years agoDepsgraph: Cleanup, split build_object() a bit
Sergey Sharybin [Thu, 23 Nov 2017 11:01:31 +0000 (12:01 +0100)]
Depsgraph: Cleanup, split build_object() a bit

2 years agoDepsgraph: Cleanup, always call full `object`
Sergey Sharybin [Thu, 23 Nov 2017 10:39:28 +0000 (11:39 +0100)]
Depsgraph: Cleanup, always call full `object`

2 years agoRevert "BLI_utildefines: Support SWAP macro with two args"
Campbell Barton [Thu, 23 Nov 2017 04:19:24 +0000 (15:19 +1100)]
Revert "BLI_utildefines: Support SWAP macro with two args"

This reverts commit d749320e3b10161430bc4cb7dd92edb63712bf8c.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.

2 years agoUse custom SWAP macro for swapping userdef data
Campbell Barton [Thu, 23 Nov 2017 04:18:22 +0000 (15:18 +1100)]
Use custom SWAP macro for swapping userdef data

Avoids complicating the common case

2 years agoFix T53274: Saving template prefs overwrites default prefs
Campbell Barton [Wed, 22 Nov 2017 16:10:58 +0000 (03:10 +1100)]
Fix T53274: Saving template prefs overwrites default prefs

2 years agoBLI_utildefines: Support SWAP macro with two args
Campbell Barton [Wed, 22 Nov 2017 15:44:02 +0000 (02:44 +1100)]
BLI_utildefines: Support SWAP macro with two args

2 years agoWM: minor correction to user-pref writing
Campbell Barton [Wed, 22 Nov 2017 06:11:03 +0000 (17:11 +1100)]
WM: minor correction to user-pref writing

When saving templates had wrong return value.

2 years agoFix T53313: bevel shader with transmission render artifacts.
Brecht Van Lommel [Tue, 21 Nov 2017 23:49:12 +0000 (00:49 +0100)]
Fix T53313: bevel shader with transmission render artifacts.

2 years agoRemoving OMP: get rid of usages in /bmesh/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:55:07 +0000 (17:55 +0100)]
Removing OMP: get rid of usages in /bmesh/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.

2 years agoRemoving OMP: get rid of last bit in /editors/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:52:25 +0000 (17:52 +0100)]
Removing OMP: get rid of last bit in /editors/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

2 years agoCleanup: We do not use camel case in Blender code
Sergey Sharybin [Tue, 21 Nov 2017 16:34:44 +0000 (17:34 +0100)]
Cleanup: We do not use camel case in Blender code

At least not for variables.

2 years agoFix T53371: Keying Node fails with values above 1
Sergey Sharybin [Tue, 21 Nov 2017 16:31:45 +0000 (17:31 +0100)]
Fix T53371: Keying Node fails with values above 1

This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over
exposured.

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.

2 years agoCycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.
Stefan Werner [Tue, 21 Nov 2017 09:43:40 +0000 (10:43 +0100)]
Cycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.

2 years agoCycles: Fix OSL brick node after recent fix
Mai Lavelle [Tue, 21 Nov 2017 09:29:31 +0000 (04:29 -0500)]
Cycles: Fix OSL brick node after recent fix

2 years agoCycles: Workaround for performance loss with the CUDA 9.0 SDK.
Stefan Werner [Tue, 21 Nov 2017 09:29:11 +0000 (10:29 +0100)]
Cycles: Workaround for performance loss with the CUDA 9.0 SDK.

CUDA 9.0.176 apparently caused some slow down on high-end Pascal cards that can be mitigated by increasing the number of registers. See https://developer.blender.org/F1142667 for a detailed comparison.

2 years agoFix T53365: OpenCL has wrong shading of brick texture
Mai Lavelle [Tue, 21 Nov 2017 05:38:02 +0000 (00:38 -0500)]
Fix T53365: OpenCL has wrong shading of brick texture

Looks like some weird compiler difference with signed vs unsigned ints.

2 years agoDisable adding scene sequence strips into themselves
Campbell Barton [Tue, 21 Nov 2017 05:33:36 +0000 (16:33 +1100)]
Disable adding scene sequence strips into themselves

D2923 by @spockTheGray w/ edits, see T52586 for details

2 years agoCleanup: redundant ELEM use
Campbell Barton [Tue, 21 Nov 2017 05:14:31 +0000 (16:14 +1100)]
Cleanup: redundant ELEM use

2 years agoCode cleanup: fix harmless compiler warning.
Brecht Van Lommel [Mon, 20 Nov 2017 22:32:06 +0000 (23:32 +0100)]
Code cleanup: fix harmless compiler warning.

2 years agoFix build with OSL 1.9.x, automatically aligns to 16 bytes now.
Brecht Van Lommel [Sat, 18 Nov 2017 05:11:17 +0000 (06:11 +0100)]
Fix build with OSL 1.9.x, automatically aligns to 16 bytes now.

2 years agoCycles: Fix wrong behavior of sharpness in Cubic SSS
Sergey Sharybin [Mon, 20 Nov 2017 10:40:55 +0000 (11:40 +0100)]
Cycles: Fix wrong behavior of sharpness in Cubic SSS

Was giving difference when using sharpness of 1.0 and 0.999 even though the
result was expected to be really close to each other.

This SSS profile will probably be removed in the future in favor of more
physically bases Burley, but for the time being don't see anything wrong
fixing an existing code.

2 years agoFix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Bastien Montagne [Mon, 20 Nov 2017 09:12:21 +0000 (10:12 +0100)]
Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.

Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.

2 years agoUV Cube Project: improve default behavior
Campbell Barton [Mon, 20 Nov 2017 08:51:19 +0000 (19:51 +1100)]
UV Cube Project: improve default behavior

- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.

2 years agoFix T53342: Outliner 'select hierarchy' broken
Campbell Barton [Mon, 20 Nov 2017 05:01:04 +0000 (16:01 +1100)]
Fix T53342: Outliner 'select hierarchy' broken

Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.

2 years agoFix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Bastien Montagne [Sun, 19 Nov 2017 19:42:55 +0000 (20:42 +0100)]
Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.

Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.

2 years agoOption not to select with un-hide
Campbell Barton [Sun, 19 Nov 2017 15:28:07 +0000 (02:28 +1100)]
Option not to select with un-hide

D1518 from @mba105 w/ edits

2 years agoCleanup: remove BKE_utildefines
Campbell Barton [Sun, 19 Nov 2017 14:35:49 +0000 (01:35 +1100)]
Cleanup: remove BKE_utildefines

This was meant to be used for less general macros but was never used.

Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST

2 years agoFix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove...
Joshua Leung [Sun, 19 Nov 2017 14:06:13 +0000 (03:06 +1300)]
Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button

2 years agoCleanup - Style
Joshua Leung [Sun, 19 Nov 2017 13:56:40 +0000 (02:56 +1300)]
Cleanup - Style

2 years agoFix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail
Joshua Leung [Sun, 19 Nov 2017 13:55:17 +0000 (02:55 +1300)]
Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail

2 years agoFix compiler warning
Joshua Leung [Sun, 19 Nov 2017 13:08:55 +0000 (02:08 +1300)]
Fix compiler warning

--> render_result.c:832 - formal parameter 6 different from declaration

2 years agoFix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transformi...
Joshua Leung [Sun, 19 Nov 2017 12:47:21 +0000 (01:47 +1300)]
Fix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transforming)" option

2 years agoBake Action operator: Added missing Bendy Bones support
Joshua Leung [Sun, 19 Nov 2017 12:32:03 +0000 (01:32 +1300)]
Bake Action operator: Added missing Bendy Bones support

2 years agoTweaks to make it easier to update bone motion paths (without the active bone needing...
Joshua Leung [Sun, 19 Nov 2017 12:00:27 +0000 (01:00 +1300)]
Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)

This commit introduces the following changes:
* Modified the poll callback on the "Update Paths" operator for bones
  so that it only checks if there are bones that have motion paths
  (instead of checking whether the active bone has paths).

  This makes it easier to update paths without having to first select one
  that has them - useful when the paths are all on hidden/hard-to-select bones.

* Add a readonly property, "has_motion_paths" to the animviz.motion_path
  RNA struct, providing easier access to the internal flag used above.
  This makes it possible for the UI to display the "Update" button without
  having to check various bones for motion paths.

Notes:
* The flag being used in these changes already existed, and was only really
  intended for internal use. However, since it was already used in many places
  for determining if auto-update of all bone paths was needed (e.g. after certain
  editing ops), it should be safe to use here too.

* The update_paths operator currently bakes all paths when activated, so there's
  currently no loss of functionality with changing to not checking if the active
  bone has any paths (e.g. we couldn't only update the active bone only either).
  That is still listed as a todo in the code.

2 years agoPasting poses now updates motion paths
Joshua Leung [Sun, 19 Nov 2017 11:31:07 +0000 (00:31 +1300)]
Pasting poses now updates motion paths

2 years agoFix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected
Joshua Leung [Sun, 19 Nov 2017 11:28:03 +0000 (00:28 +1300)]
Fix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected

There were 2 issues here (first was the one reported):
1) Curve shape changes if multiple consecutive pairs of keyframes
   are selected. The problem is that after the first pair is handled,
   subsequent pairs get sampled on the basis of the modified curve.

2) With multiple separate "islands" selected, unselected points in between
   would get ignored, causing the entire curve to get sampled.

2 years agoSwap priority of system path overrides for dev builds
Julian Eisel [Sun, 19 Nov 2017 11:24:12 +0000 (12:24 +0100)]
Swap priority of system path overrides for dev builds

Suggested by Campbell, thanks!

Also moved the exception into own function and improved comments.

Fixes T53008.

2 years agoVertex Paint: missed removing settings from UI
Campbell Barton [Sun, 19 Nov 2017 06:00:56 +0000 (17:00 +1100)]
Vertex Paint: missed removing settings from UI

2 years agoFix T53347: Vertex paint crash on undo/exit
Campbell Barton [Sun, 19 Nov 2017 05:45:27 +0000 (16:45 +1100)]
Fix T53347: Vertex paint crash on undo/exit