blender-staging.git
3 years agoAdd lib for n-dimensional cubic curve fitting
Campbell Barton [Fri, 15 Apr 2016 08:02:17 +0000 (18:02 +1000)]
Add lib for n-dimensional cubic curve fitting

This will be used for calculating bezier curves from freehand drawing,
may be used for other areas too.

Original code from GraphicsGems, 1990 (FitCurve.c),
with updates from OpenToonz, under 3 clause BSD license.
with own minor modifications for integration with Blender:
- support adding extra custom-data.
- improved handle clamping.

3 years agoCycles: Support heat volume attribute
Sergey Sharybin [Fri, 15 Apr 2016 10:02:31 +0000 (12:02 +0200)]
Cycles: Support heat volume attribute

Similar to velocity, it was kind of supported by the mesh manager but
was missing a code in BlenderSession to get actual values.

In Cycles Heat is an attribute which goes from -1 to 1, where -1 is
the coldest ever temperature, 1 is the hottest ever one.

3 years agoCycles: Improve error print a bit
Sergey Sharybin [Fri, 15 Apr 2016 09:24:59 +0000 (11:24 +0200)]
Cycles: Improve error print a bit

3 years agoTests: Fix wrong hash after "no redundant zeroes" commit
Sergey Sharybin [Fri, 15 Apr 2016 08:37:20 +0000 (10:37 +0200)]
Tests: Fix wrong hash after "no redundant zeroes" commit

3 years agoDrivers Editing: Added "Copy/Paste" buttons beside "Add Variable" for copying all...
Joshua Leung [Fri, 15 Apr 2016 08:04:07 +0000 (20:04 +1200)]
Drivers Editing: Added "Copy/Paste" buttons beside "Add Variable" for copying all variables from one driver to another

This was a feature request from a few years back (IIRC from ZanQdo?) to make it
easier to reuse one set of driver variables across several different drivers.

Dev Notes:
* Finally it's done! All that trouble for two little buttons.
* Grr... cmake... grrr!

3 years agoNLA Copy/Paste Modifiers: Apply similar fixes as those done in Graph Editor
Joshua Leung [Sun, 10 Apr 2016 14:42:06 +0000 (02:42 +1200)]
NLA Copy/Paste Modifiers: Apply similar fixes as those done in Graph Editor

3 years agoFix T42148: Copying/Pasting FModifiers copies to all selected FCurves, not just activ...
Joshua Leung [Sun, 10 Apr 2016 14:39:10 +0000 (02:39 +1200)]
Fix T42148: Copying/Pasting FModifiers copies to all selected FCurves, not just active one

3 years agoFModifiers: Various tweaks for consistency + improved behaviour
Joshua Leung [Sat, 9 Apr 2016 06:05:22 +0000 (18:05 +1200)]
FModifiers: Various tweaks for consistency + improved behaviour

* Use an RNA enum callback for NLA FModifier types too
* Cleaned up tooltips for these operators in Graph and NLA editors
* Fix update notifiers after adding FModifiers in the Graph Editor

3 years agoFModifiers: "Add Modifiers" in Graph/NLA Editor buttons now uses a dropdown instead...
Joshua Leung [Sun, 3 Apr 2016 12:30:59 +0000 (00:30 +1200)]
FModifiers: "Add Modifiers" in Graph/NLA Editor buttons now uses a dropdown instead of a button

This brings the UI here more in line with the Constraints and Modifiers UI's.

TODO:
* The tooltips/descriptions on the operators now need fixing, as we can no longer
  use custom tooltips when defining these buttons.
* The operators need to be fixed to only operate on the active data

3 years agoCode Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy...
Joshua Leung [Sat, 2 Apr 2016 12:18:23 +0000 (01:18 +1300)]
Code Cleanup: Add proper defines (with ANIM_* prefix) for animation-related copy-paste buffer free callbacks

3 years agoGraph Editor: Move "View" panel to be the last
Joshua Leung [Fri, 1 Apr 2016 05:42:26 +0000 (18:42 +1300)]
Graph Editor: Move "View" panel to be the last

This change means that when going from having no FCurves active to having
an active FCurve, the properties panels will not get stuck with only showing
the "View" tab, which is not that useful a lot of the time.

3 years agoCycles: Yet another fix for camera in volume
Sergey Sharybin [Thu, 14 Apr 2016 15:20:17 +0000 (17:20 +0200)]
Cycles: Yet another fix for camera in volume

Was an embarrassing glitch in original optimization policy,
the for-loops can't be de-duplicated here.

3 years agoCompositor: Fix image and render layer always extending edges
Sergey Sharybin [Thu, 14 Apr 2016 09:20:00 +0000 (11:20 +0200)]
Compositor: Fix image and render layer always extending edges

It was no more possible to translate two images, put one on top of
another in order to do things like mapping VR views.

3 years agoRemove redundant abs ray/line point functions
Campbell Barton [Thu, 14 Apr 2016 03:00:53 +0000 (13:00 +1000)]
Remove redundant abs ray/line point functions

3 years agoMath Lib: ray_point_factor_v3 functions
Campbell Barton [Thu, 14 Apr 2016 01:45:37 +0000 (11:45 +1000)]
Math Lib: ray_point_factor_v3 functions

Gives a bit better precision than creating a line in some cases,
use for ED_view3d_win_to_3d.

3 years agoCycles: Resolve ridiculous amount of memory used by spatial split builder
Sergey Sharybin [Wed, 13 Apr 2016 12:22:53 +0000 (14:22 +0200)]
Cycles: Resolve ridiculous amount of memory used by spatial split builder

This was only visible on systems with lots of threads and root of the issue
was that we've been pre-allocating too much memory for all the threads.

Now we only pre-allocate data for the main thread and rest of the threads
does allocation on-demand.

This brings down memory usage from 36Gig to 6.9Gig when building spatial
split for the Bunny.blend file on our Intel beast.

Originally regression was happened by the threaded spacial split builder
commit.

3 years agoFix T47813: Cycles Standalone not respecting integrator sample_clamp_direct
Sergey Sharybin [Wed, 13 Apr 2016 08:39:21 +0000 (10:39 +0200)]
Fix T47813: Cycles Standalone not respecting integrator sample_clamp_direct

3 years agoCleanup string includes after versioning commits
Thomas Dinges [Thu, 31 Mar 2016 22:44:35 +0000 (00:44 +0200)]
Cleanup string includes after versioning commits

3 years agoShow version number in UI as well
Thomas Dinges [Thu, 31 Mar 2016 11:35:31 +0000 (13:35 +0200)]
Show version number in UI as well

3 years agoTweaks to the version string formation
Sergey Sharybin [Thu, 31 Mar 2016 07:44:09 +0000 (09:44 +0200)]
Tweaks to the version string formation

Couple of things:

- No need to use string streams to format the version string,
  we can do it at compile time and don't bother with anything
  at runtime.

- Function declaration was wring and would have caused linking
  conflicts in cases when util_version.h was included from
  multiple places.

We should have an utility function to get Cycles version so
applications which are linked to Cycles dynamically can query
the version, but that can't be done as an inlined function in
header and would need to be a function properly exported to a
global symbol table (aka, be implemented in a .cpp file).

3 years agoAdd a version number to Cycles standalone
Thomas Dinges [Wed, 30 Mar 2016 23:13:13 +0000 (01:13 +0200)]
Add a version number to Cycles standalone

Now Cycles has its own versioning, that is mainly interesting for external projects, which integrate the engine.

We start with version 1.7.0. Reasons for that:

* The engine is too mature for a 1.0 release.
* We assume that Cycles inside of Blender 2.61 was version 0.1. We count upwards in 0.1 steps, therefore Cycles inside of Blender 2.77 would be 1.7.

We use a common versioning scheme here, with 3 decimals for the major, minor and patch level.

At the moment cycles --version can be used to display the version, easy to parse for external projects. The info will be added to the UI later aswell.

3 years agoCycles: Minor cleanup, whitespace around keyword and preprocessor indent
Sergey Sharybin [Wed, 13 Apr 2016 06:58:52 +0000 (08:58 +0200)]
Cycles: Minor cleanup, whitespace around keyword and preprocessor indent

3 years agoCycles microdisplacement: preserve smooth normals for linear subdivison
Mai Lavelle [Tue, 12 Apr 2016 23:17:34 +0000 (01:17 +0200)]
Cycles microdisplacement: preserve smooth normals for linear subdivison

This way we prevent cracks in the model due to discontinuous normals, by using
smooth normals for displacement instead of always getting flat normals after
linear subdivision.

Reviewed By: brecht

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

3 years agoFix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups
Sergey Sharybin [Tue, 12 Apr 2016 15:14:13 +0000 (17:14 +0200)]
Fix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups

This is a regression since 4310128 which is cased by really bad logic:
there might be dependencies between dupli-objects, which means _if_ we
really want to ensure derived mesh on dupli creation we have to do it
before any matrix is overwritten.

I'm not sure if such derived mesh trick is really the only way to go
without major refactor, but seems simple fix for now will do it.

3 years agoMissed last commit
Campbell Barton [Tue, 12 Apr 2016 14:49:47 +0000 (00:49 +1000)]
Missed last commit

3 years agoCorrect UI messages: hyphenate 'add-ons'
Campbell Barton [Tue, 12 Apr 2016 14:29:01 +0000 (00:29 +1000)]
Correct UI messages: hyphenate 'add-ons'

3 years agoCycles: Add missing velocity attribute to builtin image loader
Sergey Sharybin [Tue, 12 Apr 2016 11:25:20 +0000 (13:25 +0200)]
Cycles: Add missing velocity attribute to builtin image loader

For some reason other parts of blender importer were assuming velocity
is supported, but actual loader was not aware of that.

Fixes T48064: Adding velocity attribute crashes render

3 years agoCycles: Avoid crash when accessing non-existing volume attribute
Sergey Sharybin [Tue, 12 Apr 2016 11:02:05 +0000 (13:02 +0200)]
Cycles: Avoid crash when accessing non-existing volume attribute

3 years agoCMake: consistency check now reports stale ignores
Campbell Barton [Tue, 12 Apr 2016 10:08:25 +0000 (20:08 +1000)]
CMake: consistency check now reports stale ignores

Also update ignore list.

3 years agoRemove exception for file which no longer exists
Sergey Sharybin [Tue, 12 Apr 2016 09:55:24 +0000 (11:55 +0200)]
Remove exception for file which no longer exists

3 years agoFix T47443: Circle & UV Sphere aren't aligned
Campbell Barton [Tue, 12 Apr 2016 09:40:39 +0000 (19:40 +1000)]
Fix T47443: Circle & UV Sphere aren't aligned

D1912 by @samb96

Change the starting point of the UV sphere so that it is aligned with the circle, cylinder, and cone primitives.

3 years agoRemove any wrangler utility scripts
Sergey Sharybin [Tue, 12 Apr 2016 09:07:23 +0000 (11:07 +0200)]
Remove any wrangler utility scripts

3 years agoCMake: ignore header
Campbell Barton [Tue, 12 Apr 2016 08:44:54 +0000 (18:44 +1000)]
CMake: ignore header

3 years agoCMake: Partially revert recent missing headers commit
Sergey Sharybin [Tue, 12 Apr 2016 06:54:34 +0000 (08:54 +0200)]
CMake: Partially revert recent missing headers commit

The header which was put to the CMake project is not by any means used
during compilation, it is only used when manually updating CUDA wrangler
from CUDA headers.

3 years agoCleanup: use bool
Campbell Barton [Tue, 12 Apr 2016 01:26:06 +0000 (11:26 +1000)]
Cleanup: use bool

3 years agoCMake: add missing headers
Campbell Barton [Tue, 12 Apr 2016 01:22:30 +0000 (11:22 +1000)]
CMake: add missing headers

3 years agoCycles microdisplacement: UI tweak to use split column
Mai Lavelle [Mon, 11 Apr 2016 22:02:59 +0000 (00:02 +0200)]
Cycles microdisplacement: UI tweak to use split column

Reviewed By: brecht, dingto

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

3 years agoCycles microdisplacement: refactor to move some tesselation code from SubdMesh to...
Mai Lavelle [Mon, 11 Apr 2016 21:46:00 +0000 (23:46 +0200)]
Cycles microdisplacement: refactor to move some tesselation code from SubdMesh to Mesh

Reviewed By: brecht

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

3 years agoCycles microdisplacement: change use subdivision bool to subdivision type enum
Mai Lavelle [Mon, 11 Apr 2016 21:07:42 +0000 (23:07 +0200)]
Cycles microdisplacement: change use subdivision bool to subdivision type enum

This is only the UI change, there is no underlying code change in this commit.

Reviewed By: brecht

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

3 years agoCycles microdisplacement: perform subdivision dicing in raster space
Mai Lavelle [Mon, 11 Apr 2016 20:49:09 +0000 (22:49 +0200)]
Cycles microdisplacement: perform subdivision dicing in raster space

NOTE: this is only the first of many patches towards completing the subdivison
and displacement system in Cycles. These patches will be reviewed and committed
one by one over the coming weeks.

Reviewed By: brecht, sergey

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

3 years agoCycles: Cleanup, make some comments easier to read on split editors
Sergey Sharybin [Mon, 11 Apr 2016 15:58:16 +0000 (17:58 +0200)]
Cycles: Cleanup, make some comments easier to read on split editors

3 years agoCycles: Remove hair support from volume BVH traversal
Sergey Sharybin [Mon, 11 Apr 2016 14:45:55 +0000 (16:45 +0200)]
Cycles: Remove hair support from volume BVH traversal

There are couple of reasons:

- Volume shader on hair does behave really weird anyway and it's
  not something considered a bug really.

- Volume BVH traversal were only used by camera-in-volume check,
  which doesn't really make sense to take hair into account since
  it'll be rendered wrong anyway.

Such a removal makes both code easier to extend further (as in,
no need to worry about those traversal for hair bvh) and also
reduces stress on GPU compilers.

3 years agoCycles: Remove unused SAH from BVH pack
Sergey Sharybin [Mon, 11 Apr 2016 14:18:33 +0000 (16:18 +0200)]
Cycles: Remove unused SAH from BVH pack

3 years agoCycles: Rename tri_woop to tri_storage
Sergey Sharybin [Mon, 11 Apr 2016 12:54:58 +0000 (14:54 +0200)]
Cycles: Rename tri_woop to tri_storage

It's no longer a pre-computed data and just a storage of triangle
coordinates which are faster to access to.

3 years agoFix T48084: Solidify uses alternate quad-direction
Campbell Barton [Mon, 11 Apr 2016 12:56:17 +0000 (22:56 +1000)]
Fix T48084: Solidify uses alternate quad-direction

This prevents twisted quads from self-intersecting.

This change makes the duplicate surface match the first vertex in the face,
so the diagonal indices match in the face copy.

3 years agoFix T48082: Unwrap overwrites face selection
Campbell Barton [Mon, 11 Apr 2016 10:24:46 +0000 (20:24 +1000)]
Fix T48082: Unwrap overwrites face selection

Sync selection option made adding a new UV layer select all edit-mesh faces.
Now just select the UV's, ignoring sync-select option.

3 years agoFix T48103: Wrong renders on AMD OpenCL when Light Falloff node is used
Sergey Sharybin [Mon, 11 Apr 2016 08:54:41 +0000 (10:54 +0200)]
Fix T48103: Wrong renders on AMD OpenCL when Light Falloff node is used

3 years agoBGE: Fix T48071: Global logic manager
Porteries Tristan [Sun, 10 Apr 2016 15:36:10 +0000 (17:36 +0200)]
BGE: Fix T48071: Global logic manager

Previously the logic manager was used as a global variable for SCA_ILogicBrick::m_sCurrentLogicManager,
this request to always update it before run any python script and allow call function like
ConvertPythonTo[GameObject/Mesh]. The bug showed in T48071 is that as exepted the global
m_sCurrentLogicManager is not updated with the proper scene logic manager.
Instead of trying to fix it by updating the logic manager everywhere and wait next bug report to add
a similar line. The following patch propose a different way:
- Every logic brick now contain its logic manager to SCA_ILogicBrick::m_logicManager, this value is
  set and get by SCA_ILogicBrick::[Set/Get]LogicManager, It's initialized from blender conversion and
  scene merging.
- Function ConvertPythonTo[GameObject/mesh] now take as first argument the logic manager to find name
  coresponding object or mesh. Only ConvertPythonToCamera doesn't do that because it uses the
  KX_Scene::FindCamera function.

Reviewers: moguri

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

3 years agoCycles: Fix rare dead-locks on TaskScheduler::exit()
Sergey Sharybin [Sun, 10 Apr 2016 19:18:54 +0000 (21:18 +0200)]
Cycles: Fix rare dead-locks on TaskScheduler::exit()

When the Moon is full it was possible to have a dead-lock in task
scheduler's  exit() method.

Similar problem was fixed in Blender's task scheduler 3 years ago
in bae2a2c.

3 years agoDocs: comment on line-sphere intersection
Campbell Barton [Sun, 10 Apr 2016 12:18:05 +0000 (22:18 +1000)]
Docs: comment on line-sphere intersection

3 years agoCleanup a bit particle distribution code.
Bastien Montagne [Sat, 9 Apr 2016 20:42:52 +0000 (22:42 +0200)]
Cleanup a bit particle distribution code.

Also do proper intial/final checks to avoid adding particle on zero-weight extreme items,
instead of using cheap tricks like 'small offset'...

3 years agoFix T47983, Take II: Particles - Emit from Verts emits double on one vert.
Bastien Montagne [Sat, 9 Apr 2016 16:59:05 +0000 (18:59 +0200)]
Fix T47983, Take II: Particles - Emit from Verts emits double on one vert.

Previous fix made another issue even more visible, leading to +1 particle on first vert
and none on last one. This commit should fix both original and new issues.

3 years agoFix T48078: incorrect OS X command for retrieving number of CPUs on in Makefile.
Brecht Van Lommel [Fri, 8 Apr 2016 21:58:37 +0000 (23:58 +0200)]
Fix T48078: incorrect OS X command for retrieving number of CPUs on in Makefile.

3 years agoFix T48088: Reproducible crash: Edges + Array Mod + Hair Particles.
Bastien Montagne [Fri, 8 Apr 2016 14:26:42 +0000 (16:26 +0200)]
Fix T48088: Reproducible crash: Edges + Array Mod + Hair Particles.

Code did not consider the possibility to have no face at all! :P

3 years agoFix broken by D1880 line stipple deactivation
Alexander Romanov [Fri, 8 Apr 2016 09:20:43 +0000 (12:20 +0300)]
Fix broken by D1880 line stipple deactivation

3 years agoWide lines + line stipple deprecated API replacement
Alexander Romanov [Fri, 8 Apr 2016 07:58:40 +0000 (10:58 +0300)]
Wide lines + line stipple deprecated API replacement

The patch contains an implementation of the wide lines and the line stipple that is necessary for OpenGL upgrade.

For the implementation I have chosen the geometry shader because it required minimum changes for the wrapper calls and such implementation is the best for the "basic shader" architecture.

There are few shortcomings that can be corrected in future. They all are related to the fact that the lines in one strip are not connected with each other. So the stipple pattern is not continuous on the common vertex of two lines. There is also no continuity of form (each line is an independent rectangular).
But the advantage is that even outdated glBegin, glVertex work! Though with the above restrictions.
Continuity of form and stipple can be implemented with additional attributes, and it will require more changes in calls.

At the moment, the patch replaces calls for some "gestures". It works satisfactorily for "cross" or "rectangular" and not so good for "lasso" and "circle" due to the above-mentioned shortcomings.

Don't forget to set USE_GLSL to true for testing.

Alexander Romanov (Blend4Web Team)

Reviewers: merwin, brecht

Reviewed By: merwin, brecht

Subscribers: aligorith, Evgeny_Rodygin, AlexKowel, yurikovelenov

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

3 years agoCycles: Fix misleading remaining time report when using infinite number of samples...
Sergey Sharybin [Wed, 6 Apr 2016 14:30:52 +0000 (16:30 +0200)]
Cycles: Fix misleading remaining time report when using infinite number of samples in viewport

3 years agoCycles: Fix compilation error of Hair BSDF GLSL shader
Sergey Sharybin [Wed, 6 Apr 2016 13:40:55 +0000 (15:40 +0200)]
Cycles: Fix compilation error of Hair BSDF GLSL shader

3 years agoFix missing viewport update when tree output is in a node
Sergey Sharybin [Wed, 6 Apr 2016 13:23:26 +0000 (15:23 +0200)]
Fix missing viewport update when tree output is in a node

There was already an attempt to do it, but it worked incorrect because
of wrong recursion check.

3 years agoCycles: Avoid possibly uninitialized variable
Sergey Sharybin [Wed, 6 Apr 2016 08:51:04 +0000 (10:51 +0200)]
Cycles: Avoid possibly uninitialized variable

3 years agoQuiet warning for release build
Campbell Barton [Wed, 6 Apr 2016 08:26:39 +0000 (18:26 +1000)]
Quiet warning for release build

3 years agoFix leak w/ missing external mesh customdata
Campbell Barton [Wed, 6 Apr 2016 06:14:30 +0000 (16:14 +1000)]
Fix leak w/ missing external mesh customdata

3 years agoTweak fill-region method to produce fewer 'gaps'
Campbell Barton [Wed, 6 Apr 2016 05:07:37 +0000 (15:07 +1000)]
Tweak fill-region method to produce fewer 'gaps'

3 years agoFix camera view-border line width
Campbell Barton [Wed, 6 Apr 2016 04:27:37 +0000 (14:27 +1000)]
Fix camera view-border line width

3 years agoCorrect error checking for wrong frame range
Campbell Barton [Tue, 5 Apr 2016 23:41:30 +0000 (09:41 +1000)]
Correct error checking for wrong frame range

3 years agoCleanup: indentation
Campbell Barton [Tue, 5 Apr 2016 23:30:20 +0000 (09:30 +1000)]
Cleanup: indentation

3 years agoCleanup: arg docstrings
Campbell Barton [Tue, 5 Apr 2016 23:28:22 +0000 (09:28 +1000)]
Cleanup: arg docstrings

3 years agoRender frame arg parsing, list and range support
Campbell Barton [Tue, 5 Apr 2016 21:34:20 +0000 (07:34 +1000)]
Render frame arg parsing, list and range support

Support a comma separated list of frames, as well as frame ranges using the '..' separator.

eg: `blender my.blend --render-frame 1,2,10..40,100..200`

3 years agoExpose new Recast partitioning methods for navmesh generation
Reinier de Blois [Tue, 5 Apr 2016 18:38:42 +0000 (20:38 +0200)]
Expose new Recast partitioning methods for navmesh generation

This patch depends on D1747, which upgrades the Recast version.  It exposes the new Recast partitioning methods in the navmesh generation.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

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

3 years agoUpdate Recast version to 1.5.0
Reinier de Blois [Tue, 5 Apr 2016 18:34:00 +0000 (20:34 +0200)]
Update Recast version to 1.5.0

The version of Recast that Blender ships with is from 2009.  This patch updates the Recast version to the latest version, 1.5.0.  The Detour version remains untouched.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

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

3 years agoFix UV-Editor crashes w/ over SHRT_MAX UV's
Campbell Barton [Tue, 5 Apr 2016 10:42:21 +0000 (20:42 +1000)]
Fix UV-Editor crashes w/ over SHRT_MAX UV's

3 years agoRevert "Cycles: Remove the Preetham Sky model."
Thomas Dinges [Tue, 5 Apr 2016 10:25:54 +0000 (12:25 +0200)]
Revert "Cycles: Remove the Preetham Sky model."

This reverts commit d91316dc672dc1ee69fbd24d2f00124a24b75c6b.

3 years agoFix T48054: Blender 2.77 doesn't import blenders fbx, due to recent changes in anim...
Bastien Montagne [Tue, 5 Apr 2016 09:51:54 +0000 (11:51 +0200)]
Fix T48054: Blender 2.77 doesn't import blenders fbx, due to recent changes in anim RNA API.

Please do not break API when not absolutely needed, here it was a mere parameter order issue...

3 years agoFix T47705: Freestyle line glitch.
Tamito Kajiyama [Tue, 5 Apr 2016 07:08:45 +0000 (16:08 +0900)]
Fix T47705: Freestyle line glitch.

The addressed issue is a regression from Blender 2.75, after the internal
switch from double to single precision floating-point numbers in the
Freestyle code base.  Face normal calculations require the higher
precision during the computations, even though the results can be stored
as single precision numbers.

3 years agoCleanup: Typo fixes after BVH commits.
Thomas Dinges [Mon, 4 Apr 2016 23:20:18 +0000 (01:20 +0200)]
Cleanup: Typo fixes after BVH commits.

3 years agoPyDriver support for all RNA property types
Campbell Barton [Mon, 4 Apr 2016 21:02:43 +0000 (07:02 +1000)]
PyDriver support for all RNA property types

Support for driver variables that don't resolve to numbers, eg:
objects, bones, curves... etc.

Without this, Python expressions to access this data needed to use an absolute path from `bpy.data`,
however this is inconvenient, breaks easily (based on naming) and wouldn't set the dependencies correctly.

3 years agoCycles: Fix wrong camera in volume check when domain is only visible to camera rays
Sergey Sharybin [Mon, 4 Apr 2016 17:30:38 +0000 (19:30 +0200)]
Cycles: Fix wrong camera in volume check when domain is only visible to camera rays

3 years agoCycles: Fix regression caused by recent camera-in-volume commit
Sergey Sharybin [Mon, 4 Apr 2016 16:24:40 +0000 (18:24 +0200)]
Cycles: Fix regression caused by recent camera-in-volume commit

Stupid me forgot that we don't have stop-element in the stack yet.

3 years agoCycles: Fix regular BVH not having proper visibility flags
Sergey Sharybin [Mon, 4 Apr 2016 16:10:24 +0000 (18:10 +0200)]
Cycles: Fix regular BVH not having proper visibility flags

This was caused by recent threading commit. Now because of all children
are set when they're ready need to explicitly update all parent's visibility.

3 years agoFix T48045: Freestyle ID user decrement error.
Bastien Montagne [Mon, 4 Apr 2016 13:43:45 +0000 (15:43 +0200)]
Fix T48045: Freestyle ID user decrement error.

This fixes reported issue, but there could be more of those hidden in Freestyle code,
it did not handle user refcount at all (and the fact it by-passes BKE in some places
for efficiency does not help here).

Note that this should be relatively harmless, since freestyle uses own Main during
render, so everything is cleaned up in the end in any case... But better try to
handle IDs correctly here too. :)

3 years agoUpdate hash for an OBJ unit test
Sergey Sharybin [Mon, 4 Apr 2016 13:22:31 +0000 (15:22 +0200)]
Update hash for an OBJ unit test

3 years agoCycles: Make spatial split BVH multi-threaded
Sergey Sharybin [Mon, 4 Apr 2016 12:43:21 +0000 (14:43 +0200)]
Cycles: Make spatial split BVH multi-threaded

The title actually covers it all, This commit exploits all the work
being done in previous changes to make it possible to build spatial
splits in threads.

Works quite nicely, but has a downside of some extra memory usage.
In practice it doesn't seem to be a huge problem and that we can
always look into later if it becomes a real showstopper.

In practice it shows some nice speedup:

- BMW27 scene takes 3 now (used to be 4)
- Agent shot takes 5 sec (used to be 80)

Such non-linear speedup is most likely coming from much less amount
of heap re-allocations. A a downside, there's a bit of extra memory
used by BVH arrays. From the tests amount of extra memory is below
0.001% so far, so it's not that bad at all.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

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

3 years agoCycles: Solve possible issues with running out of stack memory allocator
Sergey Sharybin [Mon, 4 Apr 2016 12:10:09 +0000 (14:10 +0200)]
Cycles: Solve possible issues with running out of stack memory allocator

Policy here is a bit more complicated, if tree becomes too deep we're
forced to create a leaf node and size of that leaf wouldn't be so well
predicted, which means it's quite tricky to use single stack array for
that.

Made it more official feature that StackAllocator will fall-back to
heap when running out of stack memory.

It's still much better than always using heap allocator.

3 years agoCycles: Log overall time spent on building object's BVH
Sergey Sharybin [Mon, 4 Apr 2016 11:43:19 +0000 (13:43 +0200)]
Cycles: Log overall time spent on building object's BVH

We had per-tree statistics already, but it's a bit tricky to see overall
time because trees could be building in parallel.

In fact, we can now print statistics for any TaskPool.

3 years agoCycles: Log allocation slop factor for BVH arrays
Sergey Sharybin [Mon, 4 Apr 2016 10:55:24 +0000 (12:55 +0200)]
Cycles: Log allocation slop factor for BVH arrays

Currently they're staying at 1 (actual size over capacity), but we
will be changing it quite soon in order to avoid having too much
memory re-allocation happening at a BVH build time and will be
playing with different policies for that.

3 years agoFix missing ID_SO sound type in outliner's ID types.
Bastien Montagne [Mon, 4 Apr 2016 10:35:59 +0000 (12:35 +0200)]
Fix missing ID_SO sound type in outliner's ID types.

Note that we may want to review that some day, we have quite a bit of ID types here that are
'blend file' view only, might be worth splitting the check based on this.

3 years agoCycles: Tweak to stack allocator used by BVH builder
Sergey Sharybin [Mon, 4 Apr 2016 10:23:23 +0000 (12:23 +0200)]
Cycles: Tweak to stack allocator used by BVH builder

In some files stack memory was overruning the pre-allocated stack.

Perhaps we should fall-back to a hep-allocated stack so release builds
don't crash in works case but just becoming slower.

3 years agoSmoke: Don't use `min` as an uniform name
Sergey Sharybin [Mon, 4 Apr 2016 09:58:27 +0000 (11:58 +0200)]
Smoke: Don't use `min` as an uniform name

This is an attempt to fix report T47991.

3 years agoCycles: Make curves modified by a taper object with modifier considered a deform...
Sergey Sharybin [Mon, 4 Apr 2016 09:39:04 +0000 (11:39 +0200)]
Cycles: Make curves modified by a taper object with modifier considered a deform modified

That might consider a bit more objects to be considered deform modified,
but it covers common case of using taper object without require of doing
recursive checks.

In worst case it'll be just some extra synchronization time, no render
time difference will happen for false-positive because of extra checks
happening in Cycles.

3 years agoFix T48002: Wrong behavior with "RGB to Intensity" in Image textures
Sergey Sharybin [Mon, 4 Apr 2016 09:28:14 +0000 (11:28 +0200)]
Fix T48002: Wrong behavior with "RGB to Intensity" in Image textures

There was some extra linearization happening in such cases.

3 years agoFix curve editmode adding 3D primitives w/ 2D curves
Campbell Barton [Mon, 4 Apr 2016 08:34:04 +0000 (18:34 +1000)]
Fix curve editmode adding 3D primitives w/ 2D curves

3 years agoFix curve adding 3D nurbs when 2D is set
Campbell Barton [Mon, 4 Apr 2016 07:47:55 +0000 (17:47 +1000)]
Fix curve adding 3D nurbs when 2D is set

Ctrl-LMB ignored 2D constraint

3 years agoFix curve hide keeping spline active
Campbell Barton [Mon, 4 Apr 2016 07:55:28 +0000 (17:55 +1000)]
Fix curve hide keeping spline active

3 years agoFix curve, missing update on Ctrl-LMB
Campbell Barton [Mon, 4 Apr 2016 08:18:21 +0000 (18:18 +1000)]
Fix curve, missing update on Ctrl-LMB

3 years agoFix curve add-vertex w/ 2D curves
Campbell Barton [Mon, 4 Apr 2016 08:01:01 +0000 (18:01 +1000)]
Fix curve add-vertex w/ 2D curves

Project the point onto the 2d place where possible.

3 years agoMove some debug print under G.debug
Sergey Sharybin [Mon, 4 Apr 2016 07:57:40 +0000 (09:57 +0200)]
Move some debug print under G.debug

It's not like every debug build is benefiting from this print..

3 years agoFix uninitialized variable use w/ VSE transform
Campbell Barton [Mon, 4 Apr 2016 02:41:31 +0000 (12:41 +1000)]
Fix uninitialized variable use w/ VSE transform

3 years agoCycles: Remove the Preetham Sky model.
Thomas Dinges [Sat, 2 Apr 2016 21:36:14 +0000 (23:36 +0200)]
Cycles: Remove the Preetham Sky model.

The improved Hosek / Wilkie model was added during my GSoC 2013 and the default since then.

The older model was kinda kept for compatibility, but after more than 2 years it's time to remove it.
The Hosek / Wilkie model is more realistic anyway, and people who really want a day / night transition can mix the Sky Shader with another one (e.g. color) and fade between the two.

3 years agoFix T47971: rigid body baking crash due to thread race condition.
Brecht Van Lommel [Sat, 2 Apr 2016 02:24:24 +0000 (04:24 +0200)]
Fix T47971: rigid body baking crash due to thread race condition.

3 years agoFix T48030: Can't zoom VSE properties panel
Campbell Barton [Sat, 2 Apr 2016 07:52:52 +0000 (18:52 +1100)]
Fix T48030: Can't zoom VSE properties panel