5 years agoCleanup: rename cos-angle to match BLI_math
Campbell Barton [Tue, 19 Apr 2016 21:45:16 +0000 (07:45 +1000)]
Cleanup: rename cos-angle to match BLI_math

5 years agoMinor optimization for limited-dissolve
Campbell Barton [Tue, 19 Apr 2016 09:13:39 +0000 (19:13 +1000)]
Minor optimization for limited-dissolve

Use dot product instead of angle.

5 years agoFix crash in rB37493fb9f - there is no guaranty CTX_wm_foo() will return a valid...
Bastien Montagne [Tue, 19 Apr 2016 20:51:46 +0000 (22:51 +0200)]
Fix crash in rB37493fb9f - there is no guaranty CTX_wm_foo() will return a valid pointer!

5 years agoCleanup unused header includes from previous commit.
Bastien Montagne [Tue, 19 Apr 2016 15:53:46 +0000 (17:53 +0200)]
Cleanup unused header includes from previous commit.

5 years agoCleanup: move operators & related code of files & append/link to relevant dedicated...
Bastien Montagne [Tue, 19 Apr 2016 15:08:31 +0000 (17:08 +0200)]
Cleanup: move operators & related code of files & append/link to relevant dedicated source files.

This commit adds a new `wm_files_link.c` which contains everything related to append/link code,
moved from `wm_operators.c` (rather small currently, but will expand quite a bit with future reload & asset works).

It also moves all load/save .bland files (and related userpref/startup stuff) from `wm_operators.c`
to `wm_files.c` (some helper funcs were already there).

This also makes `wm_operators.c` significantly lighter.

5 years agoFix T48198: Missing plus sign to open the tool shelf in text editor
Julian Eisel [Tue, 19 Apr 2016 19:01:55 +0000 (21:01 +0200)]
Fix T48198: Missing plus sign to open the tool shelf in text editor

Did not happen when using screen layout saved in default startup.blend

5 years agoToggle to standard cursor when opening menus/popups
Julian Eisel [Tue, 19 Apr 2016 14:04:44 +0000 (16:04 +0200)]
Toggle to standard cursor when opening menus/popups

Cursor is now set to standard arrow-cursor when opening menu, and reset to previous one when closing it. Previously it just stayed as it was before, e.g. the edit mode cross-cursor stayed active even if a menu was opened.

Fixes T48192.

5 years agoCycles: Improvements and fixes for the resumable render
Sergey Sharybin [Tue, 19 Apr 2016 10:54:29 +0000 (12:54 +0200)]
Cycles: Improvements and fixes for the resumable render

- Fix wrong current sample reported in the log
- Also includes fix for progressive refine log
- Explicitly print to the stdout that resumable render is enabled
- Print error message and abort when passing wrong values for the
  resumable render. Never waste someone's compute power for wrong

Fixes T48185: Cycles resumable num chunks breaks sample counter

5 years agoFix T48193: Incorrect keyframe_insert docs
Campbell Barton [Tue, 19 Apr 2016 08:25:56 +0000 (18:25 +1000)]
Fix T48193: Incorrect keyframe_insert docs

5 years agoMinor edits to last commit
Campbell Barton [Tue, 19 Apr 2016 03:07:01 +0000 (13:07 +1000)]
Minor edits to last commit

Avoid redundant tests

5 years agoFix T47998: Limited dissolve fails /w holes
Campbell Barton [Tue, 19 Apr 2016 02:11:51 +0000 (12:11 +1000)]
Fix T47998: Limited dissolve fails /w holes

Holes with flat surfaces could have their edges dissolved causing degenerate faces.
Now check that collapsing a vertices isn't creating self-overlapping faces.

5 years agoCleanup: pass event args as const
Campbell Barton [Sun, 17 Apr 2016 20:20:42 +0000 (06:20 +1000)]
Cleanup: pass event args as const

5 years agoCycles microdisplacement: add max subdivision setting
Mai Lavelle [Mon, 18 Apr 2016 20:35:49 +0000 (22:35 +0200)]
Cycles microdisplacement: add max subdivision setting

This is to prevent situations such as when the camera gets very close to a mesh
and causes it to be tessellated into an excessive amount of micropolygons. In
REYES this is known as the eye-splits problem.

Reviewed By: brecht

Differential Revision:

5 years agoCycles microdisplacement: fix handling of triangles in DiagSplit
Mai Lavelle [Mon, 18 Apr 2016 20:29:25 +0000 (22:29 +0200)]
Cycles microdisplacement: fix handling of triangles in DiagSplit

Theres still more room for improvement but this makes things useable.

Reviewed By: brecht

Differential Revision:

5 years agoFix: Make it easier to tell if Color Swatches are greyed out or not
Joshua Leung [Mon, 18 Apr 2016 12:42:59 +0000 (00:42 +1200)]
Fix: Make it easier to tell if Color Swatches are greyed out or not

This commit makes disabled/inactive color swatches look more obviously disabled
by halving their alpha values. It is necessary because the results of
ui_widget_color_disabled() (which is usually used when disabling widgets)
get overwritten by the color filling code here.

To avoid confusion, the checkerboard background (when the color genuinely has
alpha) will still only show in those cases. That is, when disabled, color swatches
won't show the checkerboard unless the color actually has an alpha component if it
wasn't disabled.

5 years agoFix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke...
Joshua Leung [Mon, 18 Apr 2016 12:18:29 +0000 (00:18 +1200)]
Fix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke thickness

As soon as you started trying to smooth a stroke, the thickness of the stroke
would quickly drop right down to near zero, if "affect pressure" was enabled.

This step got accidentally missed when restoring the affect pressure functionality to
the stroke smoothing brush code, following cleanups from the stroke quality patch.

5 years agoCycles microdisplacement: scene level render and preview dicing rates
Mai Lavelle [Sun, 17 Apr 2016 18:15:50 +0000 (20:15 +0200)]
Cycles microdisplacement: scene level render and preview dicing rates

This makes it easier to control overall dicing rate without having to tweak
every object. The preview rate makes viewport editing more interactive. The
default preview rate of 8 is roughly 64 times faster for some operations.

Reviewed By: brecht

Differential Revision:

5 years ago"View Frame" now works in the sequencer too
Joshua Leung [Sun, 17 Apr 2016 00:26:44 +0000 (12:26 +1200)]
"View Frame" now works in the sequencer too

5 years agoFix a few compiler warnings with OS X / clang.
Brecht Van Lommel [Sat, 16 Apr 2016 22:51:29 +0000 (00:51 +0200)]
Fix a few compiler warnings with OS X / clang.

5 years agoFix T48171: activating spacebar search menu over text button activates it or shows...
Brecht Van Lommel [Sat, 16 Apr 2016 22:22:42 +0000 (00:22 +0200)]
Fix T48171: activating spacebar search menu over text button activates it or shows tooltip.

5 years agoCycles: Refactor Image Texture limits.
Thomas Dinges [Sat, 16 Apr 2016 18:48:33 +0000 (20:48 +0200)]
Cycles: Refactor Image Texture limits.

Instead of treating Fermi GPU limits as default,
and overriding them for other devices,
we now nicely set them for each platform.

* Due to setting values for all platforms,
we don't have to offset the slot id for OpenCL anymore,
as the image manager wont add float images for OpenCL now.

* Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU,
so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht

Differential Revision:

5 years agoAnim Editors: "View Frame" Operator - Code Cleanups/Reshuffling + NLA/Timeline Support
Joshua Leung [Sat, 16 Apr 2016 15:44:10 +0000 (03:44 +1200)]
Anim Editors: "View Frame" Operator - Code Cleanups/Reshuffling + NLA/Timeline Support

* Reshuffled code for existing "View Frame" implementations, and removed leftover
  comment from some of the the copy-and-paste used to build it.
* Added support for this operator in the NLA and Timeline

5 years agoAssorted enum tweaks
Joshua Leung [Sat, 16 Apr 2016 15:28:45 +0000 (03:28 +1200)]
Assorted enum tweaks

* Knock out "Python" FModifier entry - It really hasn't been coded yet!
* Add icon for "Match Indices" driver eyedropper mode. It should help provide
  a bit more of a hint of what it does, but it also doesn't look quite as nice now.

5 years agoExperimental Drivers UI Tweak: Use icons for variable types
Joshua Leung [Sat, 16 Apr 2016 15:27:26 +0000 (03:27 +1200)]
Experimental Drivers UI Tweak: Use icons for variable types

This commit aims to streamline the driver variables layout a bit
* Each variable type now has an icon. (The loc diff and rot diff ones are placeholders,
  which could deserve something better/dedicated if we continue to use this)
* Instead of taking up an entire row, the variable type dropdown now only shows
  an icon, and is located before the variable name field.

Feedback wanted: Is this more/less confusing than it was?

5 years agoTweaks to Streamline Drivers UI - Don't use uiTemplateAnyID for properties where...
Joshua Leung [Sat, 16 Apr 2016 15:05:24 +0000 (03:05 +1200)]
Tweaks to Streamline Drivers UI - Don't use uiTemplateAnyID for properties where only objects can be used

5 years agoCycles: Insert util_texture.h in CMakeLists to make Cycles compile again after recent...
Thomas Beck [Sat, 16 Apr 2016 09:58:38 +0000 (11:58 +0200)]
Cycles: Insert util_texture.h in CMakeLists to make Cycles compile again after recent refactory.

5 years agoCleanup: Move texture definitions to util, to avoid bad level include.
Thomas Dinges [Fri, 15 Apr 2016 21:01:20 +0000 (23:01 +0200)]
Cleanup: Move texture definitions to util, to avoid bad level include.

5 years agoCurve draw fix w/ surface offset + only-first enabled
Campbell Barton [Fri, 15 Apr 2016 20:43:53 +0000 (06:43 +1000)]
Curve draw fix w/ surface offset + only-first enabled

In this case the initial offset needs to be applied to the rest of the stroke.

5 years agoFix T48157: 3D view's depth of field isn't displayed correctly with scene units scale.
Bastien Montagne [Fri, 15 Apr 2016 14:17:21 +0000 (16:17 +0200)]
Fix T48157: 3D view's depth of field isn't displayed correctly with scene units scale.

focus distance is given in BU, no need to scale it at all.

5 years agoFix T48139: Checker texture strange behavior in cycles
Sergey Sharybin [Fri, 15 Apr 2016 13:29:12 +0000 (15:29 +0200)]
Fix T48139: Checker texture strange behavior in cycles

Seems particular CUDA implementations has some precision issues,
which made integer coordinate (which was expected to always be
positive) to go negative.

5 years agoUI: copy to selected: add 'single'/'all' options to buttons' menu when relevant.
Bastien Montagne [Fri, 15 Apr 2016 13:17:18 +0000 (15:17 +0200)]
UI: copy to selected: add 'single'/'all' options to buttons' menu when relevant.

Same as reset or anim keyframe/driver operators... Inconsistency reported by Leon Cheung
through IRC, thanks.

5 years agoCode Cleanup: Fix up various odds and ends
Joshua Leung [Fri, 15 Apr 2016 10:08:13 +0000 (22:08 +1200)]
Code Cleanup: Fix up various odds and ends

5 years agoCode Cleanup: Remove unused define left over from earlier versions of this code
Joshua Leung [Fri, 15 Apr 2016 10:05:18 +0000 (22:05 +1200)]
Code Cleanup: Remove unused define left over from earlier versions of this code

5 years agoRemove a leftover from older code
Sergey Sharybin [Fri, 15 Apr 2016 13:06:08 +0000 (15:06 +0200)]
Remove a leftover from older code

5 years agoCycles: Optimization to spatial BVH build
Sergey Sharybin [Fri, 15 Apr 2016 12:27:23 +0000 (14:27 +0200)]
Cycles: Optimization to spatial BVH build

Simple fix: release lock earlier.

Reduces spatial split build time from 96 to 53sec on the Bunny.blend
(using studio Intel for benchmark).

NOTE: Timing difference is not that spectacular when comparing numbers
with builds before memory optimization, but even then it's about 20%
faster build.

5 years agoFix T48151: Brush texture overlay won't refresh automatically in UV editor when chang...
Bastien Montagne [Fri, 15 Apr 2016 11:13:00 +0000 (13:13 +0200)]
Fix T48151: Brush texture overlay won't refresh automatically in UV editor when changed in buttons window.

Simple solution is to get rid of this stupid `rna_TextureSlot_brush_update` func, and do what it was doing directly
in BR case of `rna_TextureSlot_update`. That way, all updates to brush texture will invalidate correctly the overlay.

Note that this double definition of texture pointer for brushes looks rather fishy, am really not convinced this helps
keeping things simple and clear at all (what happened here is that texture selector in image paint editor was using
'texture' member of brush itself, which was performing correct RNA update, while context-based brush texture selector
from buttons space was using 'texture' member of the TextureSlot struct, which had default texture update callback
which was not invalidating overlay).

5 years agoNew freehand curve drawing tool
Campbell Barton [Fri, 15 Apr 2016 08:10:05 +0000 (18:10 +1000)]
New freehand curve drawing tool

- Access with Shift-LMB or from the 'Create' toolbar tab.
- Uses curve fitting for bezier curves, with error and corner angle options.
- Optional tablet pressure to curve radius mapping.
- Depth can use the cursor or optionally draw onto the surface,
  for the entire stroke or using the stroke start.
- Stroke plane can optionally be perpendicular to, or aligned to the surface normal.
- Optional radius tapering and for start/end points.
- Supports operator redo and calling from Python.

5 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.

5 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.

5 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

5 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

5 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!

5 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

5 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

5 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

5 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.

* 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

5 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

5 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.

5 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.

5 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.

5 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

5 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.

5 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

5 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

5 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

5 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

5 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).

5 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.

5 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

5 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:

5 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.

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

5 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'

5 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

5 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

5 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.

5 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

5 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.

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

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

5 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.

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

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

5 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:

5 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:

5 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:

5 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:

5 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

5 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.

5 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

5 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.

5 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.

5 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.

5 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

5 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:

5 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.

5 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

5 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'...

5 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.

5 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.

5 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

5 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

5 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:

5 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

5 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

5 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.

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

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

5 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

5 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'