blender.git
2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sun, 1 Apr 2018 09:14:09 +0000 (11:14 +0200)]
Merge branch 'master' into blender2.8

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sun, 1 Apr 2018 09:03:25 +0000 (11:03 +0200)]
Merge branch 'master' into blender2.8

- Undo that changes modes currently asserts,
  since undo is now screen data.

  Most likely we will change how object mode and workspaces work
  since it's not practical/maintainable at the moment.

- Removed view_layer from particle settings
  (wasn't needed and complicated undo).

2 years agoCorrect accidental changes by C Logging addition
Campbell Barton [Sun, 1 Apr 2018 08:16:28 +0000 (10:16 +0200)]
Correct accidental changes by C Logging addition

Error in 891c1cfc9a3

2 years agoResolve unsigned comparison error w/ MSVC
Campbell Barton [Sun, 1 Apr 2018 05:41:23 +0000 (07:41 +0200)]
Resolve unsigned comparison error w/ MSVC

2 years agoCleanup: remove global header
Campbell Barton [Sun, 1 Apr 2018 05:24:45 +0000 (07:24 +0200)]
Cleanup: remove global header

2 years agoCleanup: warning
Campbell Barton [Sat, 31 Mar 2018 21:51:38 +0000 (23:51 +0200)]
Cleanup: warning

2 years agoRemoved by accident in last commit
Campbell Barton [Sat, 31 Mar 2018 21:47:05 +0000 (23:47 +0200)]
Removed by accident in last commit

2 years agoUndo: unified undo system w/ linear history
Campbell Barton [Mon, 19 Mar 2018 13:17:59 +0000 (14:17 +0100)]
Undo: unified undo system w/ linear history

- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
  should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
  undo data is restored.
- Some undo types accumulate changes (image & text editing)
  others store the state multiple times (with de-duplication).
  This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
  manage restoring correct ID's.
  Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
  Previously this wasn't done, making history fail in some cases.
  This can be optimized to skip some combinations of undo steps.

grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.

See D3113

2 years agoBLF: Remove debug print
Clément Foucault [Sat, 31 Mar 2018 18:33:05 +0000 (20:33 +0200)]
BLF: Remove debug print

"this is not the commit you're looking for"

2 years agoBLF: Fix Vertical/Horizontal layout switch.
Clément Foucault [Sat, 31 Mar 2018 18:26:09 +0000 (20:26 +0200)]
BLF: Fix Vertical/Horizontal layout switch.

This was breaking the first drawcall after a simple/non-simple shader
switch.

2 years agoUI: Perf: Batch icons drawcalls together.
Clément Foucault [Sat, 31 Mar 2018 17:32:28 +0000 (19:32 +0200)]
UI: Perf: Batch icons drawcalls together.

For this we use a new shader that gets it's data from a uniform array.
Vertex shader position the vertices using these data.

Using glUniform is way faster than using imm for that matter.

Like BLF rendering, UI icons are always (as far as I know) non occluded and
displayed above everything else. They also does not overlap with texts so
they can be batched at the same time.

2 years agoBLF: Perf: Do not call FT_Set_Char_Size every time.
Clément Foucault [Sat, 31 Mar 2018 14:12:00 +0000 (16:12 +0200)]
BLF: Perf: Do not call FT_Set_Char_Size every time.

Using FT_Set_Char_Size is slow. Calling it only when needed is more clever.

2 years agoBLF: Perf: Add a kerning cache table for ascii chars.
Clément Foucault [Sat, 31 Mar 2018 13:24:10 +0000 (15:24 +0200)]
BLF: Perf: Add a kerning cache table for ascii chars.

This adds less than a megabyte of mem usage.
FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly
remove this cost.

One concern though: I don't know if the kerning data is constant for every
sizes but it seems to be the case. I tested different fonts at different
dpi scalling and saw no differences.

2 years agoBLI_sort_utils: add pointer sorting callback
Campbell Barton [Sat, 31 Mar 2018 17:25:27 +0000 (19:25 +0200)]
BLI_sort_utils: add pointer sorting callback

Also rename Pointer -> Ptr

2 years agoLogging: fix own error with formatting
Campbell Barton [Sat, 31 Mar 2018 13:43:47 +0000 (15:43 +0200)]
Logging: fix own error with formatting

2 years agoUse int instead of bool
Campbell Barton [Sat, 31 Mar 2018 13:33:15 +0000 (15:33 +0200)]
Use int instead of bool

Causes issues when including in some files.

2 years agoLogging: add argument --log-show-basename
Campbell Barton [Sat, 31 Mar 2018 13:27:06 +0000 (15:27 +0200)]
Logging: add argument --log-show-basename

Optionally strips leading path from filenames when logging.

2 years agoCleanup: --help text output
Campbell Barton [Sat, 31 Mar 2018 12:53:15 +0000 (14:53 +0200)]
Cleanup: --help text output

Some arguments missed their <value>.

2 years agoCleanup: blf internal struct naming
Campbell Barton [Sat, 31 Mar 2018 11:40:23 +0000 (13:40 +0200)]
Cleanup: blf internal struct naming

- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.

2 years agoCleanup: BLF batch drawing naming
Campbell Barton [Sat, 31 Mar 2018 11:09:03 +0000 (13:09 +0200)]
Cleanup: BLF batch drawing naming

- batching -> batch_draw.
- ct & size -> len.
- start/end -> begin/end (follow GL convention).

2 years agoLogging: add ability to exclude categories.
Campbell Barton [Sat, 31 Mar 2018 10:52:47 +0000 (12:52 +0200)]
Logging: add ability to exclude categories.

2 years agoDocs: doxygen docs for clog
Campbell Barton [Sat, 31 Mar 2018 10:26:37 +0000 (12:26 +0200)]
Docs: doxygen docs for clog

2 years agoFix clog: own error allocating from static buffer
Campbell Barton [Sat, 31 Mar 2018 09:25:49 +0000 (11:25 +0200)]
Fix clog: own error allocating from static buffer

2 years agoFix logger build w/ MSVC
Campbell Barton [Sat, 31 Mar 2018 07:18:30 +0000 (09:18 +0200)]
Fix logger build w/ MSVC

2 years agoBuild deps: do sndfile patch also on linux platform
Arto Kitula [Fri, 30 Mar 2018 23:15:13 +0000 (02:15 +0300)]
Build deps: do sndfile patch also on linux platform

2 years agoGWN: Perf: Bypass glUseProgram(0)
Clément Foucault [Fri, 30 Mar 2018 21:27:45 +0000 (23:27 +0200)]
GWN: Perf: Bypass glUseProgram(0)

I left a flag to quickly debug if something is wrong.
But now that everything uses shader, it seems to be alright since a shader
is always set active before drawing.

2 years agoUI: Perf: Do not use implicit Attrib fill.
Clément Foucault [Fri, 30 Mar 2018 20:51:28 +0000 (22:51 +0200)]
UI: Perf: Do not use implicit Attrib fill.

2 years agoBFL: Fix broken vertical texts.
Clément Foucault [Fri, 30 Mar 2018 20:50:17 +0000 (22:50 +0200)]
BFL: Fix broken vertical texts.

I've made a separate version of the geom shader that works with full
3D modelviewmat.

This commit also includes some fixup inside blf_batching_start().

2 years agoDRW: Add BLF_batch_reset to be able to use BLF inside DRW.
Clément Foucault [Fri, 30 Mar 2018 19:10:24 +0000 (21:10 +0200)]
DRW: Add BLF_batch_reset to be able to use BLF inside DRW.

2 years agoUI: Perf: Add BLF batching for File browser and UI blocks.
Clément Foucault [Fri, 30 Mar 2018 19:09:24 +0000 (21:09 +0200)]
UI: Perf: Add BLF batching for File browser and UI blocks.

This batch together most of the calls that can be batch together.

2 years agoBLF: Add Batching capabilities.
Clément Foucault [Fri, 30 Mar 2018 18:59:45 +0000 (20:59 +0200)]
BLF: Add Batching capabilities.

You can now use BLF_batching_start and BLF_batching_end to batch every
drawcall to BLF together minimizing the overhead introduced by BLF and the
opengl driver.

These calls cannot be nested (for now).

If the modelview matrix changes, previously batched calls are issued and a
the process resume with the new matrix.

However the projection matrix MUST not change and gl scissors as well.

2 years agoGPUFramebuffer: Fix assert triggering another assert.
Clément Foucault [Fri, 30 Mar 2018 18:15:03 +0000 (20:15 +0200)]
GPUFramebuffer: Fix assert triggering another assert.

2 years agoBLF: Use Batch API instead of IMM.
Clément Foucault [Fri, 30 Mar 2018 17:16:14 +0000 (19:16 +0200)]
BLF: Use Batch API instead of IMM.

This is not a perfect win just yet. It's now calling glBufferSubData for
every call (instead of using glMapBufferRange which is almost faster), but
with this system we will be able to batch drawcalls together.

See next commit.

2 years agoGWN: Add GWN_vertbuf_vertex_count_set.
Clément Foucault [Fri, 30 Mar 2018 16:10:08 +0000 (18:10 +0200)]
GWN: Add GWN_vertbuf_vertex_count_set.

This allows us to specify a the number of vertices to upload to the gpu.
This is to keep the same allocation on the System Memory but send the least
amount of data to the GPU/Driver.

2 years agoC Logging: use instead of printf for messages
Campbell Barton [Thu, 29 Mar 2018 18:38:32 +0000 (20:38 +0200)]
C Logging: use instead of printf for messages

- See `--log` help message for usage.
- Supports enabling categories.
- Color severity.
- Optionally logs to a file.
- Currently use to replace printf calls in wm module.

See D3120 for details.

2 years agobuild_deps: Disable building docs for OIIO
Thomas Beck [Fri, 30 Mar 2018 12:58:22 +0000 (14:58 +0200)]
build_deps: Disable building docs for OIIO

Two issues are fixed with this commit:

1) When we build OIIO (on unixoid build environments) and no /src/doc/oiiotool was present we had no build target for it (which led to a build error). As we don't need docs for OIIO, we disable it now.

2) We specified a var that OIIO does not recognize (was removed upstream a long time ago): ILMBASE_VERSION.

2 years agoSelect Grouped: Collection Part II
Dalai Felinto [Thu, 29 Mar 2018 23:01:27 +0000 (20:01 -0300)]
Select Grouped: Collection Part II

Selecting not only the objetcs directly linked to the selected collection.
So we also do it for the objetcs in the nested collections, just as we can
do from the outliner.

2 years agoCollections: API to select all scene collection objects
Dalai Felinto [Thu, 29 Mar 2018 23:00:34 +0000 (20:00 -0300)]
Collections: API to select all scene collection objects

2 years agoSelect Grouped: Collection Part I
Dalai Felinto [Thu, 29 Mar 2018 20:41:17 +0000 (17:41 -0300)]
Select Grouped: Collection Part I

Use Shift+G > Collection. If there is only one collection, it just selects it,
if there are multiple ones user get to pick which one to select.

This is the same behaviour we have for groups. Note, we only select objects
directly in the collection, not the ones in any nested collection.

Feature suggested by Pablo Vazquez (venomgfx)

2 years agoFix typo in outliner Select Objects tooltip
Dalai Felinto [Thu, 29 Mar 2018 21:52:42 +0000 (18:52 -0300)]
Fix typo in outliner Select Objects tooltip

2 years agoCollections: API to get collection from index
Dalai Felinto [Thu, 29 Mar 2018 20:28:05 +0000 (17:28 -0300)]
Collections: API to get collection from index

2 years agoCollections: API to check if object is in collection
Dalai Felinto [Thu, 29 Mar 2018 19:23:43 +0000 (16:23 -0300)]
Collections: API to check if object is in collection

2 years agoPyDoc: Merge manual docs for bge.texture
Aaron Carlisle [Thu, 29 Mar 2018 22:02:04 +0000 (18:02 -0400)]
PyDoc: Merge manual docs for bge.texture

https://docs.blender.org/manual/en/dev/game_engine/python_api/videotexture.html

Had a few things that this file did not while this file having things the other did not.
To fix, I merged both documents into the python api.

2 years agoBLF: Reduce the size of the buffer requested to IMM.
Clément Foucault [Thu, 29 Mar 2018 18:45:22 +0000 (20:45 +0200)]
BLF: Reduce the size of the buffer requested to IMM.

There is no point to not call strlen if the number of char is large.

2 years agoBLF: Perf: Divide by 6 the amount of verts sent to the GPU.
Clément Foucault [Thu, 29 Mar 2018 18:22:31 +0000 (20:22 +0200)]
BLF: Perf: Divide by 6 the amount of verts sent to the GPU.

This means smaller imm buffer usage.

This does not reduce the number of drawcalls.

This uses geometry shader which is slow for the GPU but given we are really
CPU bound on this case, it should not matter.

A perfect implementation would:
- Set the glyph coord in a bufferTexture and just send the glyph ID to the
  GPU to read the bufferTexture.
- Use GWN_draw_primitive and draw 2*strllen triangle and just retrieve the
  glyph ID and color based on gl_VertexID / 6.
- Stream fixed size buffer that the Driver can discard quickly but this is
  the same as improving IMM directly.

2 years agoGWN: Add immVertex4f.
Clément Foucault [Thu, 29 Mar 2018 18:13:00 +0000 (20:13 +0200)]
GWN: Add immVertex4f.

2 years agoUI: Edit mode move edge data tool into a menu
Aaron Carlisle [Thu, 29 Mar 2018 18:26:49 +0000 (14:26 -0400)]
UI: Edit mode move edge data tool into a menu

UI: Edit mode move edge data tool into a menu

See also:

- D1741
- T46853

Reviewers: Severin, meta-androcto, campbellbarton

Subscribers: mont29, #user_interface

Tags: #user_interface

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

2 years agoPyDocs: Adde link to Wikipedia page for mathutils.Euler class
Aaron Carlisle [Thu, 29 Mar 2018 18:25:13 +0000 (14:25 -0400)]
PyDocs: Adde link to Wikipedia page for mathutils.Euler class

This update adds a link to the Wikipedia article "Euler angles" to the description of the mathutils.Euler class.
I initially was not sure what a "Euler" represented in Blender API, but found the Wikipedia article helpful. I believe others will find the link helpful too if it appears in the class documentation.

This is similar to the Wikipedia links that appear in the mathutils.Matrix class, e.g: https://docs.blender.org/api/blender_python_api_current/mathutils.html?highlight=euler#mathutils.Matrix.adjugate

Author: @justasb

Reviewers: campbellbarton, trumanblending, Blendify

Reviewed By: Blendify

Subscribers: Blendify

Tags: #bf_blender

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

2 years agoCleanup: Use uppercase UI_ prefix for external functions
Julian Eisel [Thu, 29 Mar 2018 15:21:02 +0000 (17:21 +0200)]
Cleanup: Use uppercase UI_ prefix for external functions

Using uppercase prefixes is our convention for external functions.
"External" as in functions exposed to the outside of interface/ directory.

2 years agoFix Blenderplayer compile error
Julian Eisel [Thu, 29 Mar 2018 15:15:35 +0000 (17:15 +0200)]
Fix Blenderplayer compile error

2 years agoUI: Fix out of bound read catched by asan.
Clément Foucault [Thu, 29 Mar 2018 14:46:28 +0000 (16:46 +0200)]
UI: Fix out of bound read catched by asan.

2 years agoUI: Perf: Group fill/border/emboss batches together.
Clément Foucault [Thu, 29 Mar 2018 14:35:45 +0000 (16:35 +0200)]
UI: Perf: Group fill/border/emboss batches together.

This roughly halves the number of drawcalls from widgetbase_draw.

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Thu, 29 Mar 2018 13:36:34 +0000 (10:36 -0300)]
Merge remote-tracking branch 'origin/master' into blender2.8

Fix for T54437: Sequencer preview uses last updated scene

The fix started in master, moving EvaluationContext initialization
before we leave `deg_evaluate_on_refresh()`.

Upon merging master we can fix the actual issue which was to set
the EvaluationContext depsgraph even if the depsgraph was already updated.

2 years agoMerge commit 'origin/master^' into blender2.8
Dalai Felinto [Thu, 29 Mar 2018 13:36:01 +0000 (10:36 -0300)]
Merge commit 'origin/master^' into blender2.8

2 years agoDepsgraph: initialize EvaluationContext even if nothing to update
Dalai Felinto [Thu, 29 Mar 2018 12:56:06 +0000 (09:56 -0300)]
Depsgraph: initialize EvaluationContext even if nothing to update

This is required to T54437 (sequencer preview uses last updated scene).
Although the fix itself needs to be in 2.8, for the 2.8 specific
initialization code.

2 years agoUI: Perf: widgetbase: Replace imm usage by a batch cache.
Clément Foucault [Thu, 29 Mar 2018 01:21:03 +0000 (03:21 +0200)]
UI: Perf: widgetbase: Replace imm usage by a batch cache.

Introduce a UI batch cache. For the moment it's only used by widgetbase so
leaving it interface_widgets.c. If it grows, it can have its own file.

Like all preset batches (batches used by UI context), vaos must be refreshed
each time a new window context is binded.

This still does 3 GWN_batch_draw in the worst cases but at least it does
not use the IMM api.

I will continue and batch the 3 calls together since we are really CPU
bound, so shader complexity does not really matters.

I cannot spot any difference on all the widgets I could test. I did not use
any unit tests so I cannot tell if there is really any defects.

This is not a complete rewrite but it adresses the top bottleneck found
after a profilling session.

2 years agoGPUShader: Add specialized widget base shader.
Clément Foucault [Thu, 29 Mar 2018 01:06:33 +0000 (03:06 +0200)]
GPUShader: Add specialized widget base shader.

This vertex shader let us draw widgets with batches instead of imm calls.

2 years agoGWN: Batch: Add GWN_batch_uniform_4fv_array
Clément Foucault [Thu, 29 Mar 2018 01:00:29 +0000 (03:00 +0200)]
GWN: Batch: Add GWN_batch_uniform_4fv_array

2 years agoEEVEE: Fix bad framebuffer configuration
Clément Foucault [Thu, 29 Mar 2018 11:43:23 +0000 (13:43 +0200)]
EEVEE: Fix bad framebuffer configuration

Was causing black / corrupted scene because of broken downsample

Add a debug check to not run into this problem again.

2 years agoParticles: Fix missing hair dynamics
Sergey Sharybin [Thu, 29 Mar 2018 10:43:00 +0000 (12:43 +0200)]
Particles: Fix missing hair dynamics

Only if all the nasty looking bugs had such a simple solution...

2 years agoParticles: Remove dedicated recalc field from ParticleSettings
Sergey Sharybin [Wed, 28 Mar 2018 15:32:51 +0000 (17:32 +0200)]
Particles: Remove dedicated recalc field from ParticleSettings

Use more generic id->recalc flag.

Also sanitize flag flush from settings to particle system.
Need to do such flush before triggering point cache reset, since
point cache reset will do some logic based on what flags are set.

This will solve crash caused by threaded update which will set
some bitflags while point cache reset is in progress.

2 years agoCleanup, silence compiler warning in release build
Sergey Sharybin [Thu, 29 Mar 2018 10:40:23 +0000 (12:40 +0200)]
Cleanup, silence compiler warning in release build

2 years agoDraw manager: Make particle code drawing closer to old viewport
Sergey Sharybin [Thu, 29 Mar 2018 10:30:20 +0000 (12:30 +0200)]
Draw manager: Make particle code drawing closer to old viewport

The way how particle state is to be accessed or used did not change
in Blender 2.8, so the drawing code should follow old design.

This code is somewhat duplicated from drawobject.c, but old draw
code is on the way to be removed anyway.

This fixes issue with disappearing particles when tweaking number
of particles.

2 years agoDraw manager: Make evaluation context a part of context state
Sergey Sharybin [Thu, 29 Mar 2018 10:18:07 +0000 (12:18 +0200)]
Draw manager: Make evaluation context a part of context state

This way we don't have to re-initialize the full evaluation
context in every area we need it.

2 years agoDraw manager: Use C99 struct initialization
Sergey Sharybin [Thu, 29 Mar 2018 10:05:07 +0000 (12:05 +0200)]
Draw manager: Use C99 struct initialization

Allows us to easily add fields which we never want to
be initialized, but still keep sane order of fields in
the structure itself.

2 years agoDraw manager: Use utility functions for dealing with state memset
Sergey Sharybin [Thu, 29 Mar 2018 09:43:42 +0000 (11:43 +0200)]
Draw manager: Use utility functions for dealing with state memset

2 years agoDraw manager: Cleanup, early output
Sergey Sharybin [Thu, 29 Mar 2018 08:33:02 +0000 (10:33 +0200)]
Draw manager: Cleanup, early output

Do early output and reduce level of indentation.

2 years agoDepsgraph: Tag datablock with original update flag
Sergey Sharybin [Thu, 29 Mar 2018 08:08:56 +0000 (10:08 +0200)]
Depsgraph: Tag datablock with original update flag

Tagging based on components might not be granular enough.

For example, for particles we would want to know what part
of particles was changed exactly. For the flushing we wouldn't
worry too much, because we will want less granular updates
there anyway.

2 years agoFix T54457: build error with OpenVDB versions newer than 3.
Brecht Van Lommel [Thu, 29 Mar 2018 05:20:16 +0000 (07:20 +0200)]
Fix T54457: build error with OpenVDB versions newer than 3.

Solution provided by Sven-Hendrik Haase.

2 years agoFix T54455: OpenCL build error after recent changes.
Brecht Van Lommel [Thu, 29 Mar 2018 05:11:22 +0000 (07:11 +0200)]
Fix T54455: OpenCL build error after recent changes.

2 years agoCycles: take into account diffuse roughness for roughness baking.
Matt Heimlich [Wed, 28 Mar 2018 21:18:46 +0000 (23:18 +0200)]
Cycles: take into account diffuse roughness for roughness baking.

Roughness baking previously defaulted to 1.0 for all diffuse materials,
now we also bake roughness values of Oren-Nayer and Principled Diffuse.

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

2 years agoMove to Collection - Add new collection
Dalai Felinto [Wed, 28 Mar 2018 20:14:40 +0000 (17:14 -0300)]
Move to Collection - Add new collection

Include option to create new collection and move objects to this
collection.

Based on suggestion by Pablo Vazquez (venomgfx) and my own feedback.

2 years agoMove to Collection - Skip Master Collection nested level
Dalai Felinto [Wed, 28 Mar 2018 18:25:35 +0000 (15:25 -0300)]
Move to Collection - Skip Master Collection nested level

Have the Master Collection always opened. This removes one level of nesting.
As suggested by Pablo Vazquez (venomgfx).

2 years agoMove to Collection - initial operator
Dalai Felinto [Wed, 28 Mar 2018 17:54:17 +0000 (14:54 -0300)]
Move to Collection - initial operator

How to use: Select a few objects, and press "M" in the viewport.

If you hold ctrl the objects will be added to the selected collection.
Otherwise they are removed from all their original collections and moved
to the selected one instead.

Development Notes
=================
The ideal solution would be to implement an elegant generic multi-level
menu system similar to toolbox_generic() in 2.49.

Instead I used `uiItemMenuF` to acchieve the required nesting of the menus.

The downside is that `uiItemMenuF` requires the data its callback uses to be
always valid until the menu is discarded. But since there is no callback we
can call when the menu is discarded for operators that exited with
`OPERATOR_INTERFACE`.

That means we are using static allocated data, that is only freed next time
the operator is called. Which also means there will always be some
memory leakage.

Reviewers: campbellbarton

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

2 years agoCleanup: Tooltip spelling
Aaron Carlisle [Wed, 28 Mar 2018 17:09:00 +0000 (13:09 -0400)]
Cleanup: Tooltip spelling

2 years agobuild_deps: disable hdf5 lib support
Ray Molenkamp [Wed, 28 Mar 2018 16:48:52 +0000 (10:48 -0600)]
build_deps: disable hdf5 lib support

we do not ship with hdf5 support for alembic on any of the platforms.

2 years agoFix Collada: broken tangents with Camera Animation import for xfov
Gaia Clary [Wed, 28 Mar 2018 15:56:09 +0000 (17:56 +0200)]
Fix Collada: broken tangents with Camera Animation import for xfov

When importing an xfov curve, we must transformed the data to
Lens opening angles in degrees. While the curve value itself is
correctly transformed, the transformation of the tangents has been
forgotten. this is fixed now.

2 years agoCycles: don't require pthreads as dependency on Windows.
Jeff Witthuhn [Wed, 28 Mar 2018 09:31:51 +0000 (11:31 +0200)]
Cycles: don't require pthreads as dependency on Windows.

Use C++11 threads when available, and native critical section on Windows.
Later on we can remove pthread code when C+11 becomes required.

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

2 years agoClay: Remove warning.
Clément Foucault [Wed, 28 Mar 2018 09:33:23 +0000 (11:33 +0200)]
Clay: Remove warning.

2 years agoCleanup: typo in function name
Campbell Barton [Wed, 28 Mar 2018 09:23:38 +0000 (11:23 +0200)]
Cleanup: typo in function name

2 years agoBLI_array: utility to check memory is zerod
Campbell Barton [Wed, 28 Mar 2018 06:59:26 +0000 (08:59 +0200)]
BLI_array: utility to check memory is zerod

2 years agoFix missing confirm quit dialog on macOS, after recent changes.
Brecht Van Lommel [Wed, 28 Mar 2018 08:50:06 +0000 (10:50 +0200)]
Fix missing confirm quit dialog on macOS, after recent changes.

2 years agoCycles: Fix bad register cast in sseb
Sergey Sharybin [Wed, 28 Mar 2018 08:34:31 +0000 (10:34 +0200)]
Cycles: Fix bad register cast in sseb

This is currently unused code, but causes gcc-8 to fail.

2 years agoUI: Perf: Don't use implicit Attrib.
Clément Foucault [Tue, 27 Mar 2018 22:05:14 +0000 (00:05 +0200)]
UI: Perf: Don't use implicit Attrib.

Implicit attrib is doing memcpy which seems to be slower compared to
individual immAttrib*.

Only fixed the ones who appeared in my profilling logs.

2 years agoUI: Perf: Group drawcalls inside ui_draw_panel_dragwidget
Clément Foucault [Tue, 27 Mar 2018 22:00:00 +0000 (00:00 +0200)]
UI: Perf: Group drawcalls inside ui_draw_panel_dragwidget

16 Drawcalls > 1 Drawcall

Do I need to say more?

2 years agoUI: Perf: Make icon_draw_texture use GWN_draw_primitive.
Clément Foucault [Tue, 27 Mar 2018 21:57:29 +0000 (23:57 +0200)]
UI: Perf: Make icon_draw_texture use GWN_draw_primitive.

This bypass the use of immediate mode for theses drawcalls. Placement and
and icon select (via uvs) is done inside the vertex shader.

2 years agoGPUShader: Cleanup: Remove unused uniform_interface.
Clément Foucault [Tue, 27 Mar 2018 21:51:23 +0000 (23:51 +0200)]
GPUShader: Cleanup: Remove unused uniform_interface.

2 years agoDRW: Opti: Make cursor use batch instead of immediate API.
Clément Foucault [Tue, 27 Mar 2018 21:50:26 +0000 (23:50 +0200)]
DRW: Opti: Make cursor use batch instead of immediate API.

This is also much cleaner and taking 1 drawcall instead of 2.

2 years agoUI: Fix assert cause by vertex count being too small.
Clément Foucault [Tue, 27 Mar 2018 15:58:05 +0000 (17:58 +0200)]
UI: Fix assert cause by vertex count being too small.

2 years agoUI: Perf: Optimize widgetbase_draw.
Clément Foucault [Tue, 27 Mar 2018 14:58:11 +0000 (16:58 +0200)]
UI: Perf: Optimize widgetbase_draw.

Drawcall per window redraw on default layout:
- 4100+ without patch
- 1270 with patch

Theses drawcalls meant a lot of driver overhead since they each correspond
to one glMapBuffer which is slow.

2 years agoFix T54435: Quit prompt fails w/ fractional scale
Campbell Barton [Tue, 27 Mar 2018 14:46:10 +0000 (16:46 +0200)]
Fix T54435: Quit prompt fails w/ fractional scale

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 27 Mar 2018 13:09:00 +0000 (15:09 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: global undo (minor changes to internals)
Campbell Barton [Tue, 27 Mar 2018 12:44:17 +0000 (14:44 +0200)]
Cleanup: global undo (minor changes to internals)

- Get memory usage from MemFile instead of MEM API
  avoids possible invalid when threads alloc memory.
- Use size_t instead of uint and uintptr_t to store size.
- Rename UndoElem.str -> filename
- Rename MemFileChunk.ident -> is_identical

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 27 Mar 2018 05:08:58 +0000 (07:08 +0200)]
Merge branch 'master' into blender2.8

2 years agoCleanup: move paint curve undo into own file
Campbell Barton [Tue, 27 Mar 2018 05:05:07 +0000 (07:05 +0200)]
Cleanup: move paint curve undo into own file

2 years agoFix T54420: too much volume render noise with multiple volume objects.
Brecht Van Lommel [Mon, 26 Mar 2018 10:13:36 +0000 (12:13 +0200)]
Fix T54420: too much volume render noise with multiple volume objects.

Random numbers for step offset were correlated, now use stratified samples
which reduces noise as well for some types of volumes, mainly procedural
ones where the step size is bigger than the volume features.

2 years agoEevee Shaders: Fix "No matching overloaded function"
Germano [Mon, 26 Mar 2018 22:11:02 +0000 (19:11 -0300)]
Eevee Shaders: Fix "No matching overloaded function"

invert -> inverse

2 years agoGPUFramebuffer: Fix compiler warning about return value.
Clément Foucault [Mon, 26 Mar 2018 15:54:35 +0000 (17:54 +0200)]
GPUFramebuffer: Fix compiler warning about return value.

2 years agoFix bad merge resolution from previous commit
Sergey Sharybin [Mon, 26 Mar 2018 12:59:55 +0000 (14:59 +0200)]
Fix bad merge resolution from previous commit

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 26 Mar 2018 12:56:00 +0000 (14:56 +0200)]
Merge branch 'master' into blender2.8