blender-staging.git
3 years agoGet rid of `BLI_task_pool_stop()`.
Bastien Montagne [Fri, 3 Mar 2017 16:16:39 +0000 (17:16 +0100)]
Get rid of `BLI_task_pool_stop()`.

Comments said that function was supposed to 'stop worker threads', but
it absolutely did not do anything like that, was merely wiping out TODO
queue of tasks from given pool (kind of subset of what
`BLI_task_pool_cancel()` does).

Misleading, and currently useless, we can always add it back if we need
it some day, but for now we try to simplify that area.

3 years agoFix ugly mistake in BLI_task - freeing while some tasks are still being processed.
Bastien Montagne [Fri, 3 Mar 2017 16:12:03 +0000 (17:12 +0100)]
Fix ugly mistake in BLI_task - freeing while some tasks are still being processed.

Freeing pool was calling `BLI_task_pool_stop()`, which only clears
pool's tasks that are in TODO queue, whithout ensuring no more tasks
from that pool are being processed in worker threads.

This could lead to use-after-free random (and seldom) crashes.

Now use instead `BLI_task_pool_cancel()`, which does waits for all tasks
being processed to finish, before returning.

3 years agoUpdate comment which was remained in an old place
Sergey Sharybin [Fri, 3 Mar 2017 15:36:21 +0000 (16:36 +0100)]
Update comment which was remained in an old place

3 years agoCleanup: Indentation
Sergey Sharybin [Fri, 3 Mar 2017 14:53:02 +0000 (15:53 +0100)]
Cleanup: Indentation

3 years agoFix T50842: NLA Influence Curve draws out of bounds when it exceeds the 0-1 range
Joshua Leung [Fri, 3 Mar 2017 12:24:21 +0000 (01:24 +1300)]
Fix T50842: NLA Influence Curve draws out of bounds when it exceeds the 0-1 range

3 years agoCleanup: GPU_select never took NULL rect
Campbell Barton [Fri, 3 Mar 2017 04:40:54 +0000 (15:40 +1100)]
Cleanup: GPU_select never took NULL rect

3 years agoCleanup: redundant header, use const, short -> bool
Campbell Barton [Wed, 1 Mar 2017 15:14:02 +0000 (02:14 +1100)]
Cleanup: redundant header, use const, short -> bool

3 years agoWhen creating texture/image in Texture Paint mode, both datablocks should get the...
Bastien Montagne [Fri, 3 Mar 2017 09:47:22 +0000 (10:47 +0100)]
When creating texture/image in Texture Paint mode, both datablocks should get the same name

The paint slot name was not the same as what is displayed on the texture properties panel.
Instead, the slot type (e.g. "Diffuse Color") was used as the name.

Patch by Suchaaver (@minifigmaster125) with minor changes from @mont29.

Reviewers: mont29, sergey

Maniphest Tasks: T50704

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

3 years agoCycles: Fix possibly uninitialized variable
Sergey Sharybin [Fri, 3 Mar 2017 09:09:42 +0000 (10:09 +0100)]
Cycles: Fix possibly uninitialized variable

Hopefully this was a reason of randomly disappearing textures in our renders.

3 years agoFix T49655: Reloading library breaks proxies.
Bastien Montagne [Fri, 3 Mar 2017 07:52:19 +0000 (08:52 +0100)]
Fix T49655: Reloading library breaks proxies.

Can't say enough how much I hate those proxies... their duality (sharing
some aspects of both direct *and* indirect users) is a nightmare to handle. :(

3 years agoFix own stupid mistake in recent mesh 'split_faces' rework.
Bastien Montagne [Thu, 2 Mar 2017 16:22:03 +0000 (17:22 +0100)]
Fix own stupid mistake in recent mesh 'split_faces' rework.

Was assigning new edge index to ml_prev->e, and then assigning ml_pre->e
to orig_index...

3 years agoFix duplicated 'Accurate' property for manipulator keymap item
Julian Eisel [Thu, 2 Mar 2017 12:39:01 +0000 (13:39 +0100)]
Fix duplicated 'Accurate' property for manipulator keymap item

Is already added through Transform_Properties

3 years agoFix weird "use_planar_constraint" button in redo panel
Julian Eisel [Thu, 2 Mar 2017 12:23:00 +0000 (13:23 +0100)]
Fix weird "use_planar_constraint" button in redo panel

Issue was that the VIEW_OT_manipulator operator calls the transform
operators and passes them it's own operator properties. That means the
transform operator got properties passed that it doesn't have.

3 years agoThreads: Use atomics instead of spin when entering threaded malloc
Sergey Sharybin [Thu, 2 Mar 2017 08:56:25 +0000 (09:56 +0100)]
Threads: Use atomics instead of spin when entering threaded malloc

3 years agoFix another part of T50565: Planar constraints were always initialized to accurate...
Sergey Sharybin [Thu, 2 Mar 2017 11:18:07 +0000 (12:18 +0100)]
Fix another part of T50565: Planar constraints were always initialized to accurate transform

Now it is defined by keymap.

3 years agoFix second part T50565: Using planar transform once makes it enabled by default
Sergey Sharybin [Thu, 2 Mar 2017 10:20:57 +0000 (11:20 +0100)]
Fix second part T50565: Using planar transform once makes it enabled by default

Was caused by property being saved by the operator manager.

3 years agoFix T50830: Wrong context when calling surfacedeform_bind
Luca Rood [Wed, 1 Mar 2017 20:56:10 +0000 (17:56 -0300)]
Fix T50830: Wrong context when calling surfacedeform_bind

The custom poll function for surfacedeform_bind seems to have caused
issues when calling it from Python. Fixed by using the generic modifier
poll function, and setting the button to be active or not in the
Python UI code instead. (there might be a better way, but for now this
works fine)

3 years agoCorrect comment
Aaron Carlisle [Wed, 1 Mar 2017 19:12:03 +0000 (14:12 -0500)]
Correct comment

Thanks to @dingto for noticing.

3 years agoCleanup: Use .enabled instead of .active
Aaron Carlisle [Wed, 1 Mar 2017 18:05:34 +0000 (13:05 -0500)]
Cleanup: Use .enabled instead of .active

3 years agoFix T50565: Planar constraints don't work properly with non-Blender key configurations
Sergey Sharybin [Wed, 1 Mar 2017 16:57:22 +0000 (17:57 +0100)]
Fix T50565: Planar constraints don't work properly with non-Blender key configurations

The issue was introduced by 4df75e5 and seems we just need to explicitly
add new keymap item now.

There is still some difference from old behavior, which is planar transform
is using precision movement since e138cde and here i don't see nice solution
currently: the change was requested here in the studio and it's just a
conflict in picking shift key for something which is not supposed to be
accurate.

At least now it's possible to invoke planar constraint and simply unhold
shift.

3 years agoTask scheduler: Remove query for the pool's number of threads
Sergey Sharybin [Wed, 1 Mar 2017 11:51:51 +0000 (12:51 +0100)]
Task scheduler: Remove query for the pool's number of threads

Not really happy of per-pool threads limit, need to find better
approach to that. But at least it's possible to get rid of half
of the nastyness here by removing getter which was only used in
an assert statement.

That piece of code was already well-tested and this code becomes
obsolete in the new depsgraph and does no longer exists in blender
2.8 branch.

3 years agoAll drop-down buttons should use the same width
raa [Wed, 1 Mar 2017 16:30:18 +0000 (19:30 +0300)]
All drop-down buttons should use the same width

3 years agoCleanup: code-style, duplicate header
Campbell Barton [Wed, 1 Mar 2017 13:16:36 +0000 (00:16 +1100)]
Cleanup: code-style, duplicate header

3 years agoFix text and icon positioning issues
raa [Wed, 1 Mar 2017 13:11:21 +0000 (16:11 +0300)]
Fix text and icon positioning issues

3 years agoTask scheduler: Remove counter of done tasks
Sergey Sharybin [Wed, 1 Mar 2017 11:45:51 +0000 (12:45 +0100)]
Task scheduler: Remove counter of done tasks

This was only used for progress report, and it's wrong because:

- Pool might in theory be re-used by different tasks
- We should not make any decision based on scheduling stats

Proper way is to take care of progress by the task itself.

3 years agoCleanup: Use explicit unsigned int in atomics
Sergey Sharybin [Wed, 1 Mar 2017 11:01:19 +0000 (12:01 +0100)]
Cleanup: Use explicit unsigned int in atomics

3 years agoCleanup: update copyright and Blender description
Aaron Carlisle [Tue, 28 Feb 2017 16:59:18 +0000 (11:59 -0500)]
Cleanup: update copyright and Blender description

3 years agoCycles: Fix division by zero in volume code which was producing -nan
Sergey Sharybin [Tue, 28 Feb 2017 16:33:06 +0000 (17:33 +0100)]
Cycles: Fix division by zero in volume code which was producing -nan

3 years agoFix/workaround T48549: Crash baking high-to-low-poly normal map in cycles
Sergey Sharybin [Tue, 28 Feb 2017 13:08:33 +0000 (14:08 +0100)]
Fix/workaround T48549: Crash baking high-to-low-poly normal map in cycles

For now only prevent crash.

3 years agoFix T49936: Cycles point density get's it's bounding box from basis shape key
Sergey Sharybin [Tue, 28 Feb 2017 11:39:40 +0000 (12:39 +0100)]
Fix T49936: Cycles point density get's it's bounding box from basis shape key

3 years agoCleanup: Grey --> Gray
Aaron Carlisle [Tue, 28 Feb 2017 00:33:57 +0000 (19:33 -0500)]
Cleanup: Grey --> Gray

3 years agoSurface Deform Modifier (SDef)
Luca Rood [Mon, 27 Feb 2017 15:39:14 +0000 (12:39 -0300)]
Surface Deform Modifier (SDef)

Implementation of the SDef modifier, which allows meshes to be bound by
surface, thus allowing things such as cloth simulation proxies.

User documentation: https://wiki.blender.org/index.php/User:Lucarood/SurfaceDeform

Reviewers: mont29, sergey

Subscribers: Severin, dfelinto, plasmasolutions, kjym3

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

3 years agoFix memory leak when making duplicates real and parent had constraints
Sergey Sharybin [Mon, 27 Feb 2017 16:46:21 +0000 (17:46 +0100)]
Fix memory leak when making duplicates real and parent had constraints

Thanks Bastien for help!

3 years agoFix/workaround T50677: Shrinkwrap constraint don't get updated when target mesh gets...
Sergey Sharybin [Mon, 27 Feb 2017 15:27:53 +0000 (16:27 +0100)]
Fix/workaround T50677: Shrinkwrap constraint don't get updated when target mesh gets modified

Do a "full" update on leaving sculpt mode, so we are sure scene will be brought
to a consistent state.

Ideally we'll only do that when there are objects which depends on geometry
without re-calculating self geometry, but that's a bit tricky currently.

3 years agoSimilar to previous commit, but for object constraints
Sergey Sharybin [Mon, 27 Feb 2017 15:19:52 +0000 (16:19 +0100)]
Similar to previous commit, but for object constraints

3 years agoDepsgraph: Shrinkwrap constraint actually depends on geometry
Sergey Sharybin [Mon, 27 Feb 2017 15:00:39 +0000 (16:00 +0100)]
Depsgraph: Shrinkwrap constraint actually depends on geometry

3 years agoCycles: Fix compilation error on vanilla Ubuntu 16.10
Sergey Sharybin [Mon, 27 Feb 2017 14:22:51 +0000 (15:22 +0100)]
Cycles: Fix compilation error on vanilla Ubuntu 16.10

Patch by @swerner, thanks!

3 years agoFix T50634: Hair Primitive as Triangles + Hair shader with a texture = crash
Sergey Sharybin [Mon, 27 Feb 2017 14:11:51 +0000 (15:11 +0100)]
Fix T50634: Hair Primitive as Triangles + Hair shader with a texture = crash

Attributes were not resized after pushing new triangles to the mesh.

3 years agoFix part of T50634: Hair Primitive as Triangles + Hair shader with a texture = crash
Sergey Sharybin [Mon, 27 Feb 2017 12:39:23 +0000 (13:39 +0100)]
Fix part of T50634: Hair Primitive as Triangles + Hair shader with a texture = crash

Wrong formula was used to calculate needed verts and tris to be reserved.

3 years agoCycles: Make it more clear values never changes by using const qualifier
Sergey Sharybin [Mon, 27 Feb 2017 12:30:11 +0000 (13:30 +0100)]
Cycles: Make it more clear values never changes by using const qualifier

3 years agoCleanup: typo in struct name
Campbell Barton [Mon, 27 Feb 2017 09:44:59 +0000 (20:44 +1100)]
Cleanup: typo in struct name

3 years agoCycles: Forgot this in previous commit
Sergey Sharybin [Mon, 27 Feb 2017 11:54:35 +0000 (12:54 +0100)]
Cycles: Forgot this in previous commit

3 years agoCycles: Add more logs about what's going on in shader optimization
Sergey Sharybin [Mon, 27 Feb 2017 11:38:24 +0000 (12:38 +0100)]
Cycles: Add more logs about what's going on in shader optimization

3 years agoCycles: Experiment with replacing Sharp Glossy with GGX when Filter Glossy is used
Sergey Sharybin [Wed, 14 Dec 2016 11:22:57 +0000 (12:22 +0100)]
Cycles: Experiment with replacing Sharp Glossy with GGX when Filter Glossy is used

The idea is to make it simpler to remove noise from scenes when some prop uses
Sharp glossy closure and causes noise in certain cases. Previously Sharp Glossy
was not affected by Filter Glossy at all, which was quite confusing.

Here is a file which demonstrates the issue: {F417797}

After applying the patch all the noise from the scene is gone.

This change also solves fireflies reported in T50700.

Reviewers: brecht, lukasstockner97

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

3 years agoFix missing break setting curve auto-handles
Campbell Barton [Mon, 27 Feb 2017 02:32:45 +0000 (13:32 +1100)]
Fix missing break setting curve auto-handles

3 years agoFix unreported bug: Ensure you have the correct array directory even after the `dm...
Germano Cavalcante [Sun, 26 Feb 2017 17:16:54 +0000 (14:16 -0300)]
Fix unreported bug: Ensure you have the correct array directory even after the `dm->release(dm)`

3 years agoImprove add-on UI error message
Campbell Barton [Sun, 26 Feb 2017 16:54:12 +0000 (03:54 +1100)]
Improve add-on UI error message

Show the paths of the duplicate addons

D791 by @gregzaal

3 years agoCleanup: minor changes to array_store
Campbell Barton [Sun, 26 Feb 2017 04:25:19 +0000 (15:25 +1100)]
Cleanup: minor changes to array_store

- remove unused struct member.
- misleading variable name.

3 years agoFix compiling after a0b8a9f
Jens Verwiebe [Sat, 25 Feb 2017 13:58:08 +0000 (14:58 +0100)]
Fix compiling after a0b8a9f

3 years agoFix (unreported) missing update when adding constraint from RNA.
Bastien Montagne [Sat, 25 Feb 2017 10:27:11 +0000 (11:27 +0100)]
Fix (unreported) missing update when adding constraint from RNA.

3 years agoFix rows with fixed last item (D2524)
raa [Sat, 25 Feb 2017 10:18:41 +0000 (13:18 +0300)]
Fix rows with fixed last item (D2524)

3 years agoAlembic: avoid crashing when reading non-indexed UV params.
Kévin Dietrich [Sat, 25 Feb 2017 06:08:14 +0000 (07:08 +0100)]
Alembic: avoid crashing when reading non-indexed UV params.

3 years agoAlembic: addition of a scope timer to perform basic profiling.
Kévin Dietrich [Sat, 25 Feb 2017 05:18:32 +0000 (06:18 +0100)]
Alembic: addition of a scope timer to perform basic profiling.

3 years agoFix T50698: Cycles baking artifacts with transparent surfaces.
Brecht Van Lommel [Sat, 25 Feb 2017 02:09:02 +0000 (03:09 +0100)]
Fix T50698: Cycles baking artifacts with transparent surfaces.

3 years agoFix build error with macOS / clang / c++11.
Brecht Van Lommel [Sat, 25 Feb 2017 01:35:53 +0000 (02:35 +0100)]
Fix build error with macOS / clang / c++11.

3 years agoFix T50757: Alembic, assign imported materials to the object data
Kévin Dietrich [Fri, 24 Feb 2017 20:19:52 +0000 (21:19 +0100)]
Fix T50757: Alembic, assign imported materials to the object data
instead of to the object itself.

3 years agoFix T50676: Crash on closing while frameserver rendering.
Bastien Montagne [Fri, 24 Feb 2017 13:56:50 +0000 (14:56 +0100)]
Fix T50676: Crash on closing while frameserver rendering.

Can't see any reason to call AUD exit early in WM_exit, that's a
low-level module that has no dependency on anything else in Blender, but
is dependency of some other parts of Blender, so it should rather be
exited late in the process!

3 years agoCycles: Fix compilation warning with CUDA on OSX
Sergey Sharybin [Fri, 24 Feb 2017 13:33:10 +0000 (14:33 +0100)]
Cycles: Fix compilation warning with CUDA on OSX

3 years agoCycles: Fix non-zero exit status when rendering animation from CLI and running out...
Sergey Sharybin [Fri, 24 Feb 2017 13:25:11 +0000 (14:25 +0100)]
Cycles: Fix non-zero exit status when rendering animation from CLI and running out of memory

3 years agoAdd "Gravitation" option to "Force" type force fields
Luca Rood [Thu, 23 Feb 2017 22:00:03 +0000 (19:00 -0300)]
Add "Gravitation" option to "Force" type force fields

This adds an option to force fields of type "Force", which enables the
simulation of gravitational behavior (dist^-2 falloff).

Patch by @AndreasE

Reviewers: #physics, LucaRood, mont29

Reviewed By: #physics, LucaRood, mont29

Tags: #physics

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

3 years agoFix some more minor issue with updated py doc generation.
Bastien Montagne [Thu, 23 Feb 2017 21:31:21 +0000 (22:31 +0100)]
Fix some more minor issue with updated py doc generation.

3 years agoFix stupid mistake in previous commit for release builds of API doc.
Bastien Montagne [Thu, 23 Feb 2017 21:08:01 +0000 (22:08 +0100)]
Fix stupid mistake in previous commit for release builds of API doc.

3 years agoUpdate py API doc generation tools to comply to new name scheme on server.
Bastien Montagne [Thu, 23 Feb 2017 20:24:47 +0000 (21:24 +0100)]
Update py API doc generation tools to comply to new name scheme on server.

 - for rc/release: /api/2.79c/, zip file named blender_python_reference_2.79c_release.zip
 - for dev: /api/master/, zip file named blender_python_reference_2_79_4.zip

3 years agoUsual UI messages fixes...
Bastien Montagne [Thu, 23 Feb 2017 20:10:43 +0000 (21:10 +0100)]
Usual UI messages fixes...

3 years agoCycles: Fix compilation error on 32bit Linux
Sergey Sharybin [Thu, 23 Feb 2017 16:30:26 +0000 (17:30 +0100)]
Cycles: Fix compilation error on 32bit Linux

3 years agoCycles: Fix wrong render results with texture limit and half-float textures
Sergey Sharybin [Thu, 23 Feb 2017 13:46:22 +0000 (14:46 +0100)]
Cycles: Fix wrong render results with texture limit and half-float textures

3 years agoCycles: Add utility function to convert float to half
Sergey Sharybin [Thu, 23 Feb 2017 13:42:06 +0000 (14:42 +0100)]
Cycles: Add utility function to convert float to half

handles overflow and underflow, but not NaN/inf.

3 years agoFix T50656: Compositing node editor is empty, no nodes can be added
Sergey Sharybin [Thu, 23 Feb 2017 10:23:49 +0000 (11:23 +0100)]
Fix T50656: Compositing node editor is empty, no nodes can be added

3 years agoFix T50748: Render Time incorrect when refreshing rendered preview in GPU mode
Sergey Sharybin [Thu, 23 Feb 2017 09:50:46 +0000 (10:50 +0100)]
Fix T50748: Render Time incorrect when refreshing rendered preview in GPU mode

3 years agoFix T50736: Zero streaks in Glare node.
Bastien Montagne [Thu, 23 Feb 2017 09:39:51 +0000 (10:39 +0100)]
Fix T50736: Zero streaks in Glare node.

Please never, ever use same DNA var for two different things. Even worse
if they do not have same type and ranges!

This is only ensuring issues (as described in report, but also if
animating both RNA props using same DNA var... yuck).

And we were not even saving any byte in DNA, could reuse some padding
there to store the two new needed vars (yes, two, since we cannot re-use
existing one if we want to keep backward *and* forward compatibility).

3 years agoFix possible crash in various 3D View operators
Julian Eisel [Thu, 23 Feb 2017 00:59:40 +0000 (01:59 +0100)]
Fix possible crash in various 3D View operators

Was actually harmeless and not crashing, but I'd say more or less only
by luck: the NULL-check for region data would only evaluate to true for
the correct 3D View region. However, if we were to add region data to a
different region type in future, this would lead to undefined behavior
if executed in the wrong region.

3 years agoColumns should be expandable by default
raa [Wed, 22 Feb 2017 21:03:31 +0000 (00:03 +0300)]
Columns should be expandable by default

3 years agoFix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading
Bastien Montagne [Wed, 22 Feb 2017 20:20:50 +0000 (21:20 +0100)]
Fix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading

So... Curve+shapekey was even more broken than it looked, this report was
actually a nice crasher (immediate crash in an ASAN build when trying to
edit a curve shapekey with some viewport rendering enabled).

There were actually two different issues here.

I) The less critical: rB6f1493f68fe was not fully fixing issues from
T50614. More specifically, if you updated obdata from editnurb
*without* freeing editnurb afterwards, you had a 'restored' (to
original curve) editnurb, without the edited shapekey modifications
anymore. This was fixed by tweaking again `calc_shapeKeys()` behavior in
`ED_curve_editnurb_load()`.

II) The crasher: in `ED_curve_editnurb_make()`, the call to
`init_editNurb_keyIndex()` was directly storing pointers of obdata
nurbs. Since those get freed every time `ED_curve_editnurb_load()` is
executed, it easily ended up being pointers to freed memory. This was
fixed by copying those data, which implied more complex handling code
for editnurbs->keyindex, and some reshuffling of a few functions to
avoid duplicating things between editor's editcurve.c and BKE's curve.c

Note that the separation of functions between editors and BKE area for
curve could use a serious update, it's currently messy to say the least.
Then again, that area is due to rework since a long time now... :/

Finally, aligned 'for_render' curve evaluation to mesh one - now
editing a shapekey will show in rendered viewports, if it does have some
weight (exactly as with shapekeys of meshes).

3 years agoCleanup: remove unused orig_nu from keyIndex ghash of editcurves.
Bastien Montagne [Wed, 22 Feb 2017 17:06:09 +0000 (18:06 +0100)]
Cleanup: remove unused orig_nu from keyIndex ghash of editcurves.

3 years agoUse new api doc links
Aaron Carlisle [Wed, 22 Feb 2017 16:17:09 +0000 (11:17 -0500)]
Use new api doc links

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

3 years agoFix Cycles still saving render output when error happened
Sergey Sharybin [Wed, 22 Feb 2017 12:06:24 +0000 (13:06 +0100)]
Fix Cycles still saving render output when error happened

This was fixed ages ago for the interface case but not for the
command line. The thing here is that currently external engines
are relying on reports system to indicate that error happened
so suppressing reports storage in the background mode prevented
render pipeline from detecting errors happened.

This is all weak and i don't like it, but this is better than
delivering black frames from the farm.

3 years agoCycles: Fix shading with autosmooth and custom normals
Sergey Sharybin [Wed, 22 Feb 2017 09:53:28 +0000 (10:53 +0100)]
Cycles: Fix shading with autosmooth and custom normals

New logic of split_faces was leaving mesh in a proper state
from Blender's point of view, but Cycles wanted loop normals
to be "flushed" to vertex normals.

Now we do such a flush from Cycles side again, so we don't
leave bad meshes behind.

Thanks Bastien for assistance here!

3 years agoCycles: Additionally report all OpenCL cflags
Sergey Sharybin [Wed, 22 Feb 2017 09:04:13 +0000 (10:04 +0100)]
Cycles: Additionally report all OpenCL cflags

This way we can control exact spaces and such added to the cflags
which is crucial to troubleshoot certain drivers.

3 years agoRefactor Mesh split_faces() code to use loop normal spaces.
Bastien Montagne [Wed, 22 Feb 2017 08:40:46 +0000 (09:40 +0100)]
Refactor Mesh split_faces() code to use loop normal spaces.

Finding which loop should share its vertex with which others is not easy
with regular Mesh data (mostly due to lack of advanced topology info, as
opposed with BMesh case).

Custom loop normals computing already does that - and can return 'loop
normal spaces', which among other things contain definitions of 'smooth
fans' of loops around vertices.

Using those makes it easy to find vertices (and then edges) that needs
splitting.

This commit also adds support of non-autosmooth meshes, where we want to
split out flat faces from smooth ones.

3 years agoFix Drawing nested box layouts (D2508)
raa [Tue, 21 Feb 2017 18:02:56 +0000 (21:02 +0300)]
Fix Drawing nested box layouts (D2508)

3 years agoCycles: Speedup by avoiding extra calculations in noise texture when unneeded
Mai Lavelle [Tue, 21 Feb 2017 12:24:33 +0000 (07:24 -0500)]
Cycles: Speedup by avoiding extra calculations in noise texture when unneeded

Noise texture is now faster when the color socket is unused. Potential for
speedup spotted by @nutel.

Some performance results:

                     Render Time Before    After    Difference
Gooseberry benchmark         47:51.34    45:55.57       -4%
Koro                         12:24.92    12:18.46     -0.8%
Simple cube (Color socket)      48.53       48.72     +0.3%
Simple cube (Fac socket)        48.74       32.78    -32.7%
Goethe displacement           1:21.18     1:08.47    -15.6%
Cycles brick displacement     3:02.38     2:16.76    -25.0%
Large displacement scene     23:54.12    20:09.62    -15.6%

Reviewed By: sergey

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

3 years agoCleanup: use proper link to the api
Aaron Carlisle [Tue, 21 Feb 2017 01:19:07 +0000 (20:19 -0500)]
Cleanup: use proper link to the api

3 years agoFix T50718: Regression: Split Normals Render Problem with Cycles
Sergey Sharybin [Mon, 20 Feb 2017 10:56:02 +0000 (11:56 +0100)]
Fix T50718: Regression: Split Normals Render Problem with Cycles

The issue seems to be caused by vertex normal being re-calculated
to something else than loop normal, which also caused wrong loop
normals after re-calculation.

For now issue is solved by preserving CD_NORMAL for loops after
split_faces() is finished, so render engine can access original
proper value.

3 years agoMesh faces split: Add missing vertex normal copy
Sergey Sharybin [Mon, 20 Feb 2017 10:47:43 +0000 (11:47 +0100)]
Mesh faces split: Add missing vertex normal copy

3 years agoFix T50719: Memory usage won't reset to zero while re-rendering on two video cards
Sergey Sharybin [Mon, 20 Feb 2017 10:02:19 +0000 (11:02 +0100)]
Fix T50719: Memory usage won't reset to zero while re-rendering on two video cards

Was only visible with Persistent Images option ON.

3 years agoFix a few compiler warnings with macOS / clang.
Brecht Van Lommel [Sat, 18 Feb 2017 22:52:31 +0000 (23:52 +0100)]
Fix a few compiler warnings with macOS / clang.

3 years agoFix T50564: 3D view panning with scroll wheel inconsistent with dragging.
Brecht Van Lommel [Sat, 18 Feb 2017 16:25:12 +0000 (17:25 +0100)]
Fix T50564: 3D view panning with scroll wheel inconsistent with dragging.

3 years agoFix T50614: Curve doesn't restore initial form after deleting all its shapekeys
Bastien Montagne [Fri, 17 Feb 2017 17:55:52 +0000 (18:55 +0100)]
Fix T50614: Curve doesn't restore initial form after deleting all its shapekeys

Logic of handling shapekeys when entering and leaving edit mode for
curves was... utterly broken.

Was leaving actual curve data with edited shapekey applied to it.

3 years agoRemove unused functions related to distance between BoundBox and ray
Germano Cavalcante [Fri, 17 Feb 2017 12:49:20 +0000 (09:49 -0300)]
Remove unused functions related to distance between BoundBox and ray

3 years agoForgotten in last commit: Check the allocation
Germano Cavalcante [Fri, 17 Feb 2017 02:41:38 +0000 (23:41 -0300)]
Forgotten in last commit: Check the allocation

3 years agoDo not release the arrays used in the parameters of the expanded functions of bvhutils
Germano Cavalcante [Fri, 17 Feb 2017 01:55:01 +0000 (22:55 -0300)]
Do not release the arrays used in the parameters of the expanded functions of bvhutils

The release of these arrays should be the programmer's discretion since these arrays can continue to be used.

Only the expanded functions `bvhtree_from_mesh_edges_ex` and `bvhtree_from_mesh_looptri_ex` are currently being used in blender (in mesh_remap.c), and from what I could to analyze, these changes can prevent a crash.

3 years agoMake File: Print 'blender.exe' at the end of the path to run from
Aaron Carlisle [Thu, 16 Feb 2017 22:08:33 +0000 (17:08 -0500)]
Make File: Print 'blender.exe' at the end of the path to run from

3 years agoCleanup: Spelling, Spaces --> Tabs, Whitespace
Aaron Carlisle [Thu, 16 Feb 2017 22:06:03 +0000 (17:06 -0500)]
Cleanup: Spelling, Spaces --> Tabs, Whitespace

3 years agoUI: Move 'relations extras' right below 'relations'
Aaron Carlisle [Thu, 16 Feb 2017 17:01:07 +0000 (12:01 -0500)]
UI: Move 'relations extras' right below 'relations'

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

3 years agoFix T50687: Cycles baking time estimate and progress bar doesn't work / progress...
Sergey Sharybin [Thu, 16 Feb 2017 16:15:08 +0000 (17:15 +0100)]
Fix T50687: Cycles baking time estimate and progress bar doesn't work / progress when baking with high samples

3 years agoRegister test for mesh.split_faces()
Sergey Sharybin [Thu, 16 Feb 2017 14:36:00 +0000 (15:36 +0100)]
Register test for mesh.split_faces()

3 years agoFaces split: Don't leave CD_NORMAL after split
Sergey Sharybin [Thu, 16 Feb 2017 10:00:17 +0000 (11:00 +0100)]
Faces split: Don't leave CD_NORMAL after split

This is supposed to be a temporary layer.

If someone needs loop normals after split it should explicitly
ask for that.

3 years agoCyctes tests: Commit blender.git side changes
Sergey Sharybin [Thu, 16 Feb 2017 09:36:22 +0000 (10:36 +0100)]
Cyctes tests: Commit blender.git side changes

3 years agoCDDM Copy: Only tag data layers dirty if we ignored tessellation data
Sergey Sharybin [Thu, 16 Feb 2017 08:55:44 +0000 (09:55 +0100)]
CDDM Copy: Only tag data layers dirty if we ignored tessellation data

This solves assert failure in CustomData_from_bmeshpoly() happening with
broom.blend file from barber shop SVN.

3 years agoCleanup: Indentation
Sergey Sharybin [Thu, 16 Feb 2017 08:16:20 +0000 (09:16 +0100)]
Cleanup: Indentation