22 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 19 Sep 2018 16:42:17 +0000 (18:42 +0200)]
Merge branch 'master' into blender2.8

22 months agoCycles: Cleanup, double semicolon
Sergey Sharybin [Wed, 19 Sep 2018 16:41:43 +0000 (18:41 +0200)]
Cycles: Cleanup, double semicolon

22 months agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Wed, 19 Sep 2018 16:19:49 +0000 (18:19 +0200)]
Merge branch 'master' into blender2.8

22 months agoSpelling fixes in comments and descriptions, patch by luzpaz.
Brecht Van Lommel [Wed, 19 Sep 2018 15:48:11 +0000 (17:48 +0200)]
Spelling fixes in comments and descriptions, patch by luzpaz.

Differential Revision:

22 months agomake.bat: fix build error when there are spaces in the path to svn/git/cmake
Ray Molenkamp [Wed, 19 Sep 2018 16:16:46 +0000 (10:16 -0600)]
make.bat: fix build error when there are spaces in the path to svn/git/cmake

22 months agoDepsgraph: Another followup to the previous commit
Sergey Sharybin [Wed, 19 Sep 2018 16:03:15 +0000 (18:03 +0200)]
Depsgraph: Another followup to the previous commit

Apparently, only mesh objects has SHADING component.

22 months agoFix wrong pointer used in modifier stack
Sergey Sharybin [Wed, 19 Sep 2018 15:51:14 +0000 (17:51 +0200)]
Fix wrong pointer used in modifier stack

Was passing pointer to a pointer of context.

22 months agoDepsgraph: Correction for the previous commit
Sergey Sharybin [Wed, 19 Sep 2018 15:49:08 +0000 (17:49 +0200)]
Depsgraph: Correction for the previous commit

22 months agoCleanup: Remove some DerivedMesh wrappers for modifiers
Jacques Lucke [Wed, 19 Sep 2018 14:59:05 +0000 (16:59 +0200)]
Cleanup: Remove some DerivedMesh wrappers for modifiers

Specifically the deformVerts_DM, deformMatrices_DM, deformVertsEM_DM and deformMatricesEM_DM functions are not used anymore.

Reviewer: brecht

22 months agoGP: Verify weight data is correct before assigning
Antonioya [Wed, 19 Sep 2018 15:26:09 +0000 (17:26 +0200)]
GP: Verify weight data is correct before assigning

22 months agoGP: Fix crash when select vertex group in modifiers
Antonioya [Wed, 19 Sep 2018 15:20:39 +0000 (17:20 +0200)]
GP: Fix crash when select vertex group in modifiers

22 months agoDepsgraph: Ensure shading update order
Sergey Sharybin [Wed, 19 Sep 2018 15:14:27 +0000 (17:14 +0200)]
Depsgraph: Ensure shading update order

Previously it was possible to have geometry component to
tag batch for DIRTY_ALL and shading to tag with SHADING_UPDATE.

Now there is a relation between uber eval and shading, which
solves this issue.

22 months agoGP: Fix copy frame error in dopesheet
Antonioya [Wed, 19 Sep 2018 14:46:56 +0000 (16:46 +0200)]
GP: Fix copy frame error in dopesheet

22 months agoDepsgraph: Always assume scene camera is visible
Sergey Sharybin [Wed, 19 Sep 2018 14:43:59 +0000 (16:43 +0200)]
Depsgraph: Always assume scene camera is visible

Allows to disable camera collection to make objects to go out of
the way, but still be able to animate.

22 months agoFix wrong CUDA version warning in cmake.
Brecht Van Lommel [Wed, 19 Sep 2018 14:04:11 +0000 (16:04 +0200)]
Fix wrong CUDA version warning in cmake.

Fix suggested by Dalai.

22 months agoFix T56697: missing viewport update after keyframe edits in animation editors.
Brecht Van Lommel [Wed, 19 Sep 2018 14:17:24 +0000 (16:17 +0200)]
Fix T56697: missing viewport update after keyframe edits in animation editors.

It was updating during transform, but not a final time after keyframes get
reordered or merged.

22 months agoUI: make new icon consistent with other places.
Brecht Van Lommel [Wed, 19 Sep 2018 08:19:45 +0000 (10:19 +0200)]
UI: make new icon consistent with other places.

22 months agoFix own mistake in previous commit.
Bastien Montagne [Wed, 19 Sep 2018 14:09:52 +0000 (16:09 +0200)]
Fix own mistake in previous commit.

22 months agoDepsgraph: Make visible update to operate on per-component level
Sergey Sharybin [Wed, 19 Sep 2018 13:46:03 +0000 (15:46 +0200)]
Depsgraph: Make visible update to operate on per-component level

22 months agoDespgraph: Keep track of per-component visibility
Sergey Sharybin [Wed, 19 Sep 2018 13:21:51 +0000 (15:21 +0200)]
Despgraph: Keep track of per-component visibility

The idea of those flags is to avoid evaluation of operations
which are not needed to bring visible objects to an up to date

Previously, dependency graph attempted to do combine those
into an ID level flag. In practice it proved to be rather
tricky, since there could be dependency cycles on ID level
which will not exist on component level.

22 months agoDepsgraph: Connect duplicating geometry to duplicator
Sergey Sharybin [Wed, 19 Sep 2018 13:09:55 +0000 (15:09 +0200)]
Depsgraph: Connect duplicating geometry to duplicator

This allows to force duplicated object to be fully evaluated for

Previously only transform component of duplicated object was
forced to become evaluated.

22 months agoDepsgraph: Make geoemtry to tag function more reusable
Sergey Sharybin [Wed, 19 Sep 2018 13:06:18 +0000 (15:06 +0200)]
Depsgraph: Make geoemtry to tag function more reusable

22 months agoDepsgraph: Correct early output in collections
Sergey Sharybin [Wed, 19 Sep 2018 10:12:02 +0000 (12:12 +0200)]
Depsgraph: Correct early output in collections

Need to ensure objects from collection which was built but
is became visible in the new "context" are poked for re-built.

This should be rather cheap, since this only will update
their visibility flag.

Can not rely on visibility flush here, since there is no
relations between collection and its objects.

22 months agoDepsgraph: Handle text datablock in ID builder
Sergey Sharybin [Wed, 19 Sep 2018 08:30:41 +0000 (10:30 +0200)]
Depsgraph: Handle text datablock in ID builder

Just silence the assert/print, we do not add text data blocks
to dependency graph.

22 months agoAddon Utils: Green light the uv layout addon
Dalai Felinto [Wed, 19 Sep 2018 13:57:37 +0000 (13:57 +0000)]
Addon Utils: Green light the uv layout addon

22 months agoDepsgraph/RNA: Fix broken 'dupliobject' RNA interface.
Bastien Montagne [Wed, 19 Sep 2018 13:44:10 +0000 (15:44 +0200)]
Depsgraph/RNA: Fix broken 'dupliobject' RNA interface.

Previous code would crash on whole lot of accessors in case current item
was not a real dupli instance.

And code was missing access to crucial dupli (world) matrix! Pretty
useless without that.

Also reordered a bit members in here, let's try to keep a bit of logic...

22 months agoFix possible misuse of `BLI_strncpy`.
mano-wii [Wed, 19 Sep 2018 12:04:55 +0000 (09:04 -0300)]
Fix possible misuse of `BLI_strncpy`.

Same issue as rB39f7c8256d58.

22 months agoGP: Fix stupid mistake
Antonioya [Wed, 19 Sep 2018 10:15:53 +0000 (12:15 +0200)]
GP: Fix stupid mistake

22 months agoGP: Remove unneeded flag
Antonioya [Wed, 19 Sep 2018 10:15:05 +0000 (12:15 +0200)]
GP: Remove unneeded flag

22 months agoFix T56756: Pivot Point update issue(minor issue).
Bastien Montagne [Wed, 19 Sep 2018 09:41:16 +0000 (11:41 +0200)]
Fix T56756: Pivot Point update issue(minor issue).

22 months agoMerge branch 'master' into blender2.8
Bastien Montagne [Wed, 19 Sep 2018 09:12:45 +0000 (11:12 +0200)]
Merge branch 'master' into blender2.8

22 months agoFix unused var in case Alembic is not enabled, in own previous commit.
Bastien Montagne [Wed, 19 Sep 2018 09:11:39 +0000 (11:11 +0200)]
Fix unused var in case Alembic is not enabled, in own previous commit.

Sorry for the noise...

22 months agoMesh Sequence Cash: do not *always* report as depending on time!
Bastien Montagne [Wed, 19 Sep 2018 09:08:27 +0000 (11:08 +0200)]
Mesh Sequence Cash: do not *always* report as depending on time!

22 months agoFix T56838: Quick smoke failing with Python error.
Bastien Montagne [Wed, 19 Sep 2018 08:32:58 +0000 (10:32 +0200)]
Fix T56838: Quick smoke failing with Python error.

Again the change to @ operator for matrix multiplication...

22 months agoCleanup: Unused variable in release build
Sergey Sharybin [Wed, 19 Sep 2018 07:48:32 +0000 (09:48 +0200)]
Cleanup: Unused variable in release build

22 months agoSubdiv: CCG, remove redundant call
Sergey Sharybin [Wed, 19 Sep 2018 07:48:07 +0000 (09:48 +0200)]
Subdiv: CCG, remove redundant call

22 months agoEditMesh: show the spin arc as a thin ribbon
Campbell Barton [Wed, 19 Sep 2018 07:50:31 +0000 (17:50 +1000)]
EditMesh: show the spin arc as a thin ribbon

Closer to the design from T54661

22 months agoGizmo: tweaks to dial drawing
Campbell Barton [Wed, 19 Sep 2018 07:47:15 +0000 (17:47 +1000)]
Gizmo: tweaks to dial drawing

- Add Arc-Inner-Factor, to increase the inner arc radius from 0
  (show as a disk).
- When showing an angle value, show the angle-end line thicker
  (since thats whats being adjusted).
- Remove offset used by arc drawing which caused aliasing artifacts.

22 months agoGizmo: exclude arc from selection
Campbell Barton [Wed, 19 Sep 2018 06:46:29 +0000 (16:46 +1000)]
Gizmo: exclude arc from selection

Also disable polygon smooth before drawing arc.

22 months agoEditMesh: orient spin arc to follow the cursor
Campbell Barton [Wed, 19 Sep 2018 06:40:39 +0000 (16:40 +1000)]
EditMesh: orient spin arc to follow the cursor

22 months agoGizmo: remove matrix rotation for the dial gizmo
Campbell Barton [Wed, 19 Sep 2018 06:22:01 +0000 (16:22 +1000)]
Gizmo: remove matrix rotation for the dial gizmo

This makes it impossible to rotate the gizmo using the matrix Y axis.

Testing without this and I can't find any cases it breaks.

22 months agoCorrect polygon_smooth being left enabled
Campbell Barton [Wed, 19 Sep 2018 05:31:53 +0000 (15:31 +1000)]
Correct polygon_smooth being left enabled

22 months agoCleanup: comments
Campbell Barton [Wed, 19 Sep 2018 03:41:52 +0000 (13:41 +1000)]
Cleanup: comments

22 months agoGizmo: dial3d option to show the final angle
Campbell Barton [Wed, 19 Sep 2018 03:35:15 +0000 (13:35 +1000)]
Gizmo: dial3d option to show the final angle

Was showing modal-delta-angle, which isn't useful for the spin tool.

22 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 19 Sep 2018 03:33:01 +0000 (13:33 +1000)]
Merge branch 'master' into blender2.8

22 months agoFix unreported: Undo of texts pasted in the Text Editor misses one character.
mano-wii [Wed, 19 Sep 2018 02:11:59 +0000 (23:11 -0300)]
Fix unreported: Undo of texts pasted in the Text Editor misses one character.

Caused by commit rB28c34ae7e2d6
Unlike `strncpy`, `BLI_strncpy` ensures the last character is '\0'.

22 months agoBLI_utildefines: rename pointer conversion macros
Campbell Barton [Wed, 19 Sep 2018 02:05:58 +0000 (12:05 +1000)]
BLI_utildefines: rename pointer conversion macros

Terms get/set don't make much sense when casting values.

Name macros so the conversion is obvious,
use common prefix for easier completion.


22 months agoFix unreported: Undo of texts pasted in the Text Editor misses one character.
mano-wii [Wed, 19 Sep 2018 02:11:59 +0000 (23:11 -0300)]
Fix unreported: Undo of texts pasted in the Text Editor misses one character.

Caused by commit rB28c34ae7e2d6
Unlike `strncpy`, `BLI_strncpy` ensures the last character is '\0'.

22 months agoCleanup: replace pointer/int casts with macros
Campbell Barton [Wed, 19 Sep 2018 02:22:23 +0000 (12:22 +1000)]
Cleanup: replace pointer/int casts with macros

22 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 19 Sep 2018 02:14:36 +0000 (12:14 +1000)]
Merge branch 'master' into blender2.8

22 months agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 19 Sep 2018 02:05:08 +0000 (12:05 +1000)]
Merge branch 'master' into blender2.8

22 months agoCleanup: trailing space
Campbell Barton [Wed, 19 Sep 2018 02:04:34 +0000 (12:04 +1000)]
Cleanup: trailing space

22 months agoCleanup: missed when using doxy groups
Campbell Barton [Wed, 19 Sep 2018 01:55:41 +0000 (11:55 +1000)]
Cleanup: missed when using doxy groups

22 months agoMulti-Objects: Initial select similar support
Dalai Felinto [Tue, 18 Sep 2018 22:21:10 +0000 (19:21 -0300)]
Multi-Objects: Initial select similar support

Note: I had to add an epsilon on top of the threshould for SIMVERT_NORMAL.
Otherwise I was getting differences such as 0.000000something when comparing
supposed-to-be-identical normals.

The way I see it, the Threshold option is a user feature, where users can
control more or less what they want selected. While the epsilon is a
non-negotiable requirement for our float comparison here.

This includes support for:

Not included and currently not supported/disabled:

While we are working on this, we prevent users from using the non-ported modes.
Note: the bmo_similar.c file is still around, to be removed in the near future.

Everyone: Please fell free to jump in and help tackling the missing modes.

For details on the implementation discussion:

22 months agoMove select similar to its own file
Dalai Felinto [Tue, 18 Sep 2018 22:20:49 +0000 (19:20 -0300)]
Move select similar to its own file

22 months agoCleanup: replace comment headings w/ doxy groups
Campbell Barton [Wed, 19 Sep 2018 01:50:35 +0000 (11:50 +1000)]
Cleanup: replace comment headings w/ doxy groups

Also minor changes:

- Remove unused headers.
- rename SimpleExprParseState -> ExprParseState
- rename max_ops -> ops_count_alloc

  Was misleading since maximums are often limits which can't be exceeded.

22 months agoCleanup: BLI_expr_pylike argument ordering
Campbell Barton [Wed, 19 Sep 2018 01:40:40 +0000 (11:40 +1000)]
Cleanup: BLI_expr_pylike argument ordering

- Order array length after the array.
- Put return argument last.

22 months agoCleanup: rename BLI_simple_expr -> BLI_expr_pylike_eval
Campbell Barton [Wed, 19 Sep 2018 00:40:35 +0000 (10:40 +1000)]
Cleanup: rename BLI_simple_expr -> BLI_expr_pylike_eval

Simple isn't a good prefix for library names since
lots of unrelated modules could be called 'simple'.

Include 'py' in module name since this is a subset of Python,
one of the main motivations for this is to be Python like/compatible.

22 months agoCleanup: style
Campbell Barton [Wed, 19 Sep 2018 00:29:57 +0000 (10:29 +1000)]
Cleanup: style

22 months agoCorrect invalid enum default
Campbell Barton [Wed, 19 Sep 2018 00:14:37 +0000 (10:14 +1000)]
Correct invalid enum default

22 months agoCleanup: remove dummy tooltips
Campbell Barton [Tue, 18 Sep 2018 22:34:41 +0000 (08:34 +1000)]
Cleanup: remove dummy tooltips

22 months agoUV Snap: minor uv-nearest optimizations
Campbell Barton [Tue, 18 Sep 2018 23:54:36 +0000 (09:54 +1000)]
UV Snap: minor uv-nearest optimizations

- Pass in the snap distance
  (to avoid comparisons in the multi-object version).
- Loop directly over BMLoop's (without using the iterator).
- Use squared distance instead of manhattan.

22 months agoFix T56827: Crash when enable onion skin in multiwindow
Antonioya [Tue, 18 Sep 2018 21:18:48 +0000 (23:18 +0200)]
Fix T56827: Crash when enable onion skin in multiwindow

The problem was the cache was not set as dirty if one of the window had the overlay disabled.

22 months agoGP: Remove vertex transformation when mode is not EDIT mode
Antonioya [Tue, 18 Sep 2018 20:36:39 +0000 (22:36 +0200)]
GP: Remove vertex transformation when mode is not EDIT mode

22 months agoGP: Change Frames title for Onion panel
Antonioya [Tue, 18 Sep 2018 20:15:04 +0000 (22:15 +0200)]
GP: Change Frames title for Onion panel

22 months agoGP: change hide icon in materials
Antonioya [Tue, 18 Sep 2018 20:10:43 +0000 (22:10 +0200)]
GP: change hide icon in materials

22 months agoLookDev: Use theme background instead of world color
Clément Foucault [Tue, 18 Sep 2018 20:18:49 +0000 (22:18 +0200)]
LookDev: Use theme background instead of world color

This is much less confusing than relying on an hidden parameter (the world
color) that you can only see if you disable the world node tree.

22 months agoEevee: Rename "Trace Quality" into "Trace Precision"
Clément Foucault [Tue, 18 Sep 2018 19:39:15 +0000 (21:39 +0200)]
Eevee: Rename "Trace Quality" into "Trace Precision"

The thing is that the quality is something a bit subjective regarding this
option value.

A more precise trace will have more noise so quality is also diminished in
a way. I believe that using "Precision" is more correct than "Quality" in
this case.

22 months agoLookDev: Use black background color if world is not present
Clément Foucault [Tue, 18 Sep 2018 14:05:10 +0000 (16:05 +0200)]
LookDev: Use black background color if world is not present

22 months agoStudioLight: Fix crash when closing blender
Clément Foucault [Tue, 18 Sep 2018 13:35:51 +0000 (15:35 +0200)]
StudioLight: Fix crash when closing blender

The studiolight was being free after the window manager and was attempting
to stop the job again.

22 months agoFix T54685: EditMesh UV's transform snapping only checks active object
Alan [Tue, 18 Sep 2018 19:20:14 +0000 (16:20 -0300)]
Fix T54685: EditMesh UV's transform snapping only checks active object

Reviewers: dfelinto

22 months agoUV_OT_align: Cleanup (use enum instead of chars for modes enum
Dalai Felinto [Tue, 18 Sep 2018 18:54:41 +0000 (15:54 -0300)]
UV_OT_align: Cleanup (use enum instead of chars for modes enum

Also tested the straighten option and it is working-ish.

That said, I think straighten should take all the meshes vertices to determine
the line you want to use as reference. However we would need a different way to
determine the first and last uvs to use as reference for the line.

22 months agoUI: hide "Active Tool" panel header.
William Reynish [Tue, 18 Sep 2018 17:24:16 +0000 (19:24 +0200)]
UI: hide "Active Tool" panel header.

22 months agoSplash: add first time setup and templates to splash screen.
Brecht Van Lommel [Tue, 18 Sep 2018 15:44:14 +0000 (17:44 +0200)]
Splash: add first time setup and templates to splash screen.

The first time setup screen only has the interaction preset currently, some
more work is needed to be able to set e.g. the language or compute device
here as in the mockups.

The splash screen stayed the same for now, to make room for the templates
most of the links are now in the Help menu. If there are no recent files yet
the links still show.

The splash screen buttons implementation was fully moved to Python, in the
WM_MT_splash menu.

22 months agoWorkspaces: move 2D Animation, VFX and Video workspaces into own templates.
Brecht Van Lommel [Wed, 12 Sep 2018 09:28:49 +0000 (11:28 +0200)]
Workspaces: move 2D Animation, VFX and Video workspaces into own templates.

These can now be acessed from the File > New, Ctrl+N, or the splash screen.
Since these are application templates, users can save a separate startup.blend
for each. User preferences are shared between these templates though.

This also fixes some issues in the default startup.blend (triangulated cube..).

Differential Revision:

22 months agoApplication Templates: make templates more prominent in the UI.
Brecht Van Lommel [Tue, 28 Aug 2018 13:12:14 +0000 (15:12 +0200)]
Application Templates: make templates more prominent in the UI.

The goal here is to make app templates usable for default templates
that we can ship with Blender. These only have a custom startup.blend
currently and so are quite limited compared to app templates that fully
customize Blender.

But still it seems like the same kind of concept where we should be
sharing the code and UI. It is useful to be able to save a startup.blend
per template, and I can imagine some scripting being useful in the future
as well.

Changes made:

* File > New and Ctrl+N now list the templates, replacing a separate
  Application Templates menu that was not as easy to discover.
* File menu now shows name of active template above Save Startup File
  and Load Factory Settings to indicate these are saved/loaded per
* The "Default" template was renamed to "General".
* Workspaces can now be added from any of the template startup.blend
  files when clicking the (+) button in the topbar.

* User preferences are now fully shared between app templates, unless
  the template includes a custom userpref.blend. I think this will be
  useful in general, not all app templates need their own keymaps for
* Previously Save User Preferences would save the current app template
  and then Blender would start using that template by default. I've
  disabled this, to me it seems it was unintentional, or at least not
  clear at all that saving user preferences also makes the current

Differential Revision:

22 months agoUI: don't show Redo Unsupported, just hide buttons in that case.
Brecht Van Lommel [Tue, 18 Sep 2018 15:55:39 +0000 (17:55 +0200)]
UI: don't show Redo Unsupported, just hide buttons in that case.

22 months agoGP: Change isolate layer icon
Antonioya [Tue, 18 Sep 2018 17:01:05 +0000 (19:01 +0200)]
GP: Change isolate layer icon

22 months agoSubdiv: CCG, implement stitching of given faces
Sergey Sharybin [Tue, 18 Sep 2018 15:46:00 +0000 (17:46 +0200)]
Subdiv: CCG, implement stitching of given faces

Will speed up (or rather bring speed back to what it is supposed to be)
for brushes like smooth.

22 months agoSubdiv: CCG, make inner face grids averaging more reusable
Sergey Sharybin [Tue, 18 Sep 2018 15:35:59 +0000 (17:35 +0200)]
Subdiv: CCG, make inner face grids averaging more reusable

22 months agoSubdiv: CCG, initial grids stitching implementation
Sergey Sharybin [Tue, 18 Sep 2018 15:09:08 +0000 (17:09 +0200)]
Subdiv: CCG, initial grids stitching implementation

Currently is only working on an "inner" grid boundaries.
Need to implement averaging across face edges.

22 months agoSubdiv: CCG, evaluate final position for multires
Sergey Sharybin [Tue, 18 Sep 2018 12:23:35 +0000 (14:23 +0200)]
Subdiv: CCG, evaluate final position for multires

This makes it so coordinates and normals for CCG are calculated
with mutires displacement taken into account. This solves issues
with multires displacement being lost when entering sculpt mode.

The missing part is averaging of normals along grid boundaries.
But even then sculpting shows decent results.

The plan to solve that would be to introduce function to stitch
grids, which can also be used by Smooth brush which requires

22 months agoMerge branch 'master' into blender2.8
Bastien Montagne [Tue, 18 Sep 2018 12:31:44 +0000 (14:31 +0200)]
Merge branch 'master' into blender2.8

22 months agoFix T56833: "zoom to cursor" in Clip editor not handling aspect ratio.
Bastien Montagne [Tue, 18 Sep 2018 12:30:06 +0000 (14:30 +0200)]
Fix T56833: "zoom to cursor" in Clip editor not handling aspect ratio.

Trivial fix, just using same code as in Image editor...

22 months agoGPUShader: Manually validate sampler count
Clément Foucault [Tue, 18 Sep 2018 12:22:42 +0000 (14:22 +0200)]
GPUShader: Manually validate sampler count

This happens on NVidia GPUs, using more textures than the maximum allowed
by the gl will NOT trigger a linking issue (maybe because of bindless
texture implementation?).

So in this case we manually count the number of samplers per shader stage
and compare it against the GL limit. We discard the shader if the sampler
count is too high. This shows the user something is wrong with the shader.

22 months agoSupport evaluating simple driver expressions without Python interpreter.
Alexander Gavrilov [Sat, 15 Sep 2018 12:32:40 +0000 (15:32 +0300)]
Support evaluating simple driver expressions without Python interpreter.

Recently @sergey found that hard-coding evaluation of certain very
common driver expressions without calling the Python interpreter
produces a 30-40% performance improvement. Since hard-coding is
obviously not suitable for production, I implemented a proper
parser and interpreter for simple arithmetic expressions in C.

The evaluator supports +, -, *, /, (), ==, !=, <, <=, >, >=,
and, or, not, ternary if; driver variables, frame, pi, True, False,
and a subset of standard math functions that seem most useful.

Booleans are represented as numbers, since within the supported
operation set it seems to be impossible to distinguish True/False
from 1.0/0.0. Boolean operations properly implement lazy evaluation
with jumps, and comparisons support chaining like 'a < b < c...'.

Expressions are parsed into a very simple stack machine program
that can then be safely evaluated in multiple threads.

Reviewers: sergey, campbellbarton

Differential Revision:

22 months agoCMake: remove PYTHON_NUMPY_INCLUDE_DIRS as a cache variable on macOS/Windows.
Brecht Van Lommel [Mon, 17 Sep 2018 09:10:45 +0000 (11:10 +0200)]
CMake: remove PYTHON_NUMPY_INCLUDE_DIRS as a cache variable on macOS/Windows.

It's in a fixed location on those platforms, and having it as a cache variable
just means things break when we upgrade to a new Python version.

22 months agoUI: use monochrome lock icons next to decorators.
Brecht Van Lommel [Fri, 14 Sep 2018 17:54:07 +0000 (19:54 +0200)]
UI: use monochrome lock icons next to decorators.

22 months agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 18 Sep 2018 09:49:08 +0000 (11:49 +0200)]
Merge branch 'master' into blender2.8

22 months agoClose OpenEXR thread pool on exit
Sergey Sharybin [Tue, 18 Sep 2018 09:10:49 +0000 (11:10 +0200)]
Close OpenEXR thread pool on exit

This partially solves ASAN report about unfreed memory. There is still
something in the report, need to have a closer look with debug version
of OpenEXE library.

22 months agoFix T56831: Crash - Transfer Weight & changing it's properties.
Bastien Montagne [Tue, 18 Sep 2018 07:41:33 +0000 (09:41 +0200)]
Fix T56831: Crash - Transfer Weight & changing it's properties.

Usual Undo/Redo case with operators needing evaluated data...

22 months agoCleanup: spelling
Campbell Barton [Tue, 18 Sep 2018 06:35:13 +0000 (16:35 +1000)]
Cleanup: spelling

22 months agoGizmo: de-duplicate poll logic
Campbell Barton [Tue, 18 Sep 2018 06:10:07 +0000 (16:10 +1000)]
Gizmo: de-duplicate poll logic

Checking the active tool or operator was a common way to check
if the gizmo was still in use.

22 months agoGizmo: dial3d option to get angles w/o wrapping
Campbell Barton [Tue, 18 Sep 2018 04:58:20 +0000 (14:58 +1000)]
Gizmo: dial3d option to get angles w/o wrapping

Needed for spinning multiple revolutions.

22 months agoGizmo: add snap & tweak to the dial widget
Campbell Barton [Tue, 18 Sep 2018 04:38:05 +0000 (14:38 +1000)]
Gizmo: add snap & tweak to the dial widget

Allows holding Ctrl to snap w/ the spin tool.

22 months agoCleanup: group gizmo dial members into structs
Campbell Barton [Tue, 18 Sep 2018 04:13:35 +0000 (14:13 +1000)]
Cleanup: group gizmo dial members into structs

22 months agoCorrect view orientation update in last commit
Campbell Barton [Tue, 18 Sep 2018 04:03:50 +0000 (14:03 +1000)]
Correct view orientation update in last commit

22 months agoGizmo: use spin widgets by default
Campbell Barton [Tue, 18 Sep 2018 03:24:35 +0000 (13:24 +1000)]
Gizmo: use spin widgets by default

- Now the spin tool has a persistent gizmo.
- Uses scene orientation, with additional view orientation.
- Uses the cursor center, ignoring the pivot since the
  selection center is rarely useful.
- Disable most of the redo gizmo's for now since they overlap,
  only allow adjusting the angle.

  Note: mixing new action with adjusting previous is confusing,
  we'll want to have design guidelines regarding this.

22 months agoCleanup: spin redo naming changes
Campbell Barton [Tue, 18 Sep 2018 03:22:14 +0000 (13:22 +1000)]
Cleanup: spin redo naming changes

22 months agoFIX: linker error with a 'make deps' library set and opencollada enabled.
Ray Molenkamp [Tue, 18 Sep 2018 00:06:02 +0000 (18:06 -0600)]
FIX: linker error with a 'make deps' library set and opencollada enabled.

PCRE_LIBRARIES was not being set if the pcre library was found but not the headers.