4 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Tue, 25 Oct 2016 11:18:41 +0000 (11:18 +0000)]
Merge remote-tracking branch 'origin/master' into blender2.8

4 years agoOpenGL: mesh batch cache (WIP)
Mike Erwin [Tue, 25 Oct 2016 09:31:25 +0000 (05:31 -0400)]
OpenGL: mesh batch cache (WIP)

Gawain batches are built on demand while drawing, then kept in this per-DerivedMesh cache.

A mesh's batches try to share vertex buffers as much as possible.

Not sure if this file is the best home for this code, but functions in this file are the only users of the cache. So maybe.

Big part of T49165

4 years agomake View3D depth debug code optional
Mike Erwin [Tue, 25 Oct 2016 08:46:07 +0000 (04:46 -0400)]
make View3D depth debug code optional

Quick hack to optionally disable depth buffer debugging at compile time.

Will this be useful for users or just during development?

4 years agoOpenGL: 3D View background & depth buffer details
Mike Erwin [Tue, 25 Oct 2016 08:39:55 +0000 (04:39 -0400)]
OpenGL: 3D View background & depth buffer details

Surveying buffer usage & clears for new viewport. Not yet perfect, but closer. Committing from Mac so I can test this on Windows.

Using new matrix API (T49450) for gradient background.

4 years agoCMake: Followup to previous commit, try to ensure -ldl is always last
Sergey Sharybin [Tue, 25 Oct 2016 08:22:03 +0000 (10:22 +0200)]
CMake: Followup to previous commit, try to ensure -ldl is always last

Seems CMake will rearrange and copy libraries which are passed to the linker
when some of the libraries is listed twice (for example, -lz from png libraries
and -l for blender itself). This was causing libopenimageio to be added somewhere
at the end of linking flags without -ldl followed after which was causing linking

4 years agoFix possible compilation error with OIIO enabled
Sergey Sharybin [Tue, 25 Oct 2016 07:28:25 +0000 (09:28 +0200)]
Fix possible compilation error with OIIO enabled

OIIO library has plugin API which uses dlopen()/dlclose() so need to
link OIO libraries against dl library.

4 years agoOpenGL: new built-in shaders for mesh edges
Mike Erwin [Tue, 25 Oct 2016 07:19:10 +0000 (03:19 -0400)]
OpenGL: new built-in shaders for mesh edges

4 years agoOpenGL: clean up glActiveTexture usage
Mike Erwin [Tue, 25 Oct 2016 05:02:41 +0000 (01:02 -0400)]
OpenGL: clean up glActiveTexture usage

Removed some of my earlier glActiveTexture calls. After reviewing the
code I now trust that GL_TEXTURE0 is active by default. Fewer GL calls,
same results.

Fixed some misuse of glActiveTexture & glUniformi, mostly my fault.
Caught by --debug-gpu on Windows. Don't know why this appeared to be
working previously!

Plus some easy cleanup nearby.

4 years agoViewport: original gradient background
Dalai Felinto [Mon, 24 Oct 2016 19:40:34 +0000 (19:40 +0000)]
Viewport: original gradient background

Last but not least, fix the original 3d view background based on
@merwin's comment.

4 years agoViewport: move the background to the "modern" viewport
Dalai Felinto [Mon, 24 Oct 2016 18:58:12 +0000 (18:58 +0000)]
Viewport: move the background to the "modern" viewport

This also leaves room for the gradient background Mike Erwin wants to

4 years agoimmediate mode: background
Dalai Felinto [Mon, 24 Oct 2016 17:01:25 +0000 (17:01 +0000)]
immediate mode: background

There is a problem here, which is that we can't use immediate mode here
until we rely on `GPU_material_bind`.

(cc: @merwin)

4 years agoCycles: Add AVX2 path to subsurface triangle intersection
Sergey Sharybin [Mon, 24 Oct 2016 14:56:41 +0000 (16:56 +0200)]
Cycles: Add AVX2 path to subsurface triangle intersection

Similar to regular triangle intersection case. Gives about 3% speedup rendering
SSS object on my desktop,

Question: how to avoid such a code duplication in a nice way without speed loss?

4 years agoViewport: fix depth filled before solid plates
Dalai Felinto [Mon, 24 Oct 2016 12:58:23 +0000 (12:58 +0000)]
Viewport: fix depth filled before solid plates

4 years agoCycles: Don't use guarded vector for statically initialized data
Sergey Sharybin [Mon, 24 Oct 2016 12:18:22 +0000 (14:18 +0200)]
Cycles: Don't use guarded vector for statically initialized data

This will confuse hell of a guarded allocators because it is possible
to have allocation happened prior to Blender's guarded allocator is
fully initialized.

This was causing crashes and assert failures when running blender
with fully guarded memory allocator.

4 years agoCycles: Fix shadowing variable which also causes use of uninitialized variable
Sergey Sharybin [Mon, 24 Oct 2016 12:04:31 +0000 (14:04 +0200)]
Cycles: Fix shadowing variable which also causes use of uninitialized variable

Was causing wrong aperture for panorama cameras.

Seems to be a regression in 371d357.

4 years agoCycles: Fix static initialization order fiasco
Sergey Sharybin [Mon, 24 Oct 2016 11:43:55 +0000 (13:43 +0200)]
Cycles: Fix static initialization order fiasco

Initialization order of global stats and node types was not strictly
defined and it was possible to have node types initialized first and
stats after that. This will zero out memory which was allocated from
the statistics causing assert failure when de-initializing node types.

4 years agoCycles: Fix uninitialized variable from the previous commit
Sergey Sharybin [Mon, 24 Oct 2016 10:54:24 +0000 (12:54 +0200)]
Cycles: Fix uninitialized variable from the previous commit

4 years agoCycles: Remove explicit std:: from types where possible
Sergey Sharybin [Mon, 24 Oct 2016 10:31:11 +0000 (12:31 +0200)]
Cycles: Remove explicit std:: from types where possible

We have our own abstraction level on top of the STL's implementation.
This commit will guarantee our tweaks are used for all cases.

4 years agoCycles: Cleanup, style
Sergey Sharybin [Mon, 24 Oct 2016 10:26:12 +0000 (12:26 +0200)]
Cycles: Cleanup, style

4 years agoFix T49818: Crash when rendering with motion blur
Sergey Sharybin [Mon, 24 Oct 2016 09:46:26 +0000 (11:46 +0200)]
Fix T49818: Crash when rendering with motion blur

It was possible to have non-initialized unaligned BVH split
to be used when regular BVH split SAH was inf. Now we ensure
that unaligned splitter is only used when it's really initialized.

It's a regression and should be in 2.78a.

4 years agoCycles: Cleanup, spaces
Sergey Sharybin [Mon, 24 Oct 2016 09:10:35 +0000 (11:10 +0200)]
Cycles: Cleanup, spaces

4 years agoOpenGL: triple buffer tweaks
Mike Erwin [Mon, 24 Oct 2016 09:06:45 +0000 (05:06 -0400)]
OpenGL: triple buffer tweaks

Works great on Mac now. Will test on Windows & Linux (Mesa) tomorrow. Related to T49505

Main fix is glActiveTexture and immUniform1i.

TEXTURE_2D vs TEXTURE_RECTANGLE is now a compile-time option. Both are available starting in GL 3.1 so there's no need for a run-time check.

Removed glClears that I don't think are necessary.

Prevent TEXTURE_2D from creating extra mipmap levels. We only need level 0.

Some minor cleanup: booleans and variable declarations.

4 years agoFix unlikely uninitialized pointer usage.
Bastien Montagne [Mon, 24 Oct 2016 08:25:04 +0000 (10:25 +0200)]
Fix unlikely uninitialized pointer usage.

Reported by Coverity.

4 years agoFix T49827L Crash linking material while in Material viewport shading mode
Sergey Sharybin [Mon, 24 Oct 2016 08:09:13 +0000 (10:09 +0200)]
Fix T49827L Crash linking material while in Material viewport shading mode

Material linking might and does change the way how drawObject is calculated
but does not tag drawObject for recalculation in any way.

Now use dependency graph to tag draw object for reclaculation. Currently do
this using OB_RECALC_DATA taq since tagging is not very granular yet. In the
future we can introduce ore granular tagging in the new dependency graph

Simple and safe for 2.78a.

4 years agoFix mistake in BKE_mesh_new_from_object handling of materials in MetaBall case.
Bastien Montagne [Mon, 24 Oct 2016 08:06:00 +0000 (10:06 +0200)]
Fix mistake in BKE_mesh_new_from_object handling of materials in MetaBall case.

Typo, spoted by Coverity scan.

To be backported to 2.78a.

4 years agoOpenGL: add NormalMatrix & inverse to new API
Mike Erwin [Mon, 24 Oct 2016 03:37:53 +0000 (23:37 -0400)]
OpenGL: add NormalMatrix & inverse to new API

Part of T49450

4 years agoa place to cache draw data in DerivedMesh
Mike Erwin [Mon, 24 Oct 2016 03:22:16 +0000 (23:22 -0400)]
a place to cache draw data in DerivedMesh

DerivedMesh owns this cache and cleans up as part of DM cleanup. DM has no idea what is stored in this cache. Loose coupling FTW

4 years agoGawain: fixups & progress for batch API
Mike Erwin [Mon, 24 Oct 2016 03:16:54 +0000 (23:16 -0400)]
Gawain: fixups & progress for batch API

4 years agoFix memory leak when using depth-only shader
Julian Eisel [Sun, 23 Oct 2016 22:03:55 +0000 (00:03 +0200)]
Fix memory leak when using depth-only shader

4 years agoAPI doc: enable 'split index' option.
Aaron Carlisle [Sun, 23 Oct 2016 15:47:56 +0000 (17:47 +0200)]
API doc: enable 'split index' option.

4 years agoDisplace modifier: add global/local space option for X/Y/Z/XYZ directions.
Quentin Wenger [Sun, 23 Oct 2016 12:04:27 +0000 (14:04 +0200)]
Displace modifier: add global/local space option for X/Y/Z/XYZ directions.

Reviewed By: brecht

Differential Revision:

4 years agoSystem info: make it more resiliant to errors.
Bastien Montagne [Sun, 23 Oct 2016 11:12:58 +0000 (13:12 +0200)]
System info: make it more resiliant to errors.

Using context manager for output file itself, and whole try/except block
to at least catch and print error in file.

Also some minor tweaks to previous 'list add-ons' commit.

4 years agoSystem info: also report enabled add-ons.
Bastien Montagne [Sun, 23 Oct 2016 11:05:47 +0000 (13:05 +0200)]
System info: also report enabled add-ons.

Based on idea & patch by @lijenstina over IRC (iirc :/ ).

4 years agoAdd a built-in sphinx extension to allow cross-linking to the blender manual.
Aaron Carlisle [Sun, 23 Oct 2016 09:14:48 +0000 (11:14 +0200)]
Add a built-in sphinx extension to allow cross-linking to the blender manual.

This works by downloading the objects.inv file (
and using it to resolve links with blender-manual: before them.

4 years agoCycles: OpenCL 3d textures support.
Hristo Gueorguiev [Sat, 22 Oct 2016 21:38:42 +0000 (23:38 +0200)]
Cycles: OpenCL 3d textures support.

Note that volume rendering is not supported yet, this is a step towards that.

Reviewed By: brecht

Differential Revision:

4 years agoFix Cycles address space OpenCL error after recent fix.
Brecht Van Lommel [Sat, 22 Oct 2016 21:25:39 +0000 (23:25 +0200)]
Fix Cycles address space OpenCL error after recent fix.

4 years agoGPencil: New option to lock strokes to axis
Antonioya [Sat, 22 Oct 2016 14:44:11 +0000 (16:44 +0200)]
GPencil: New option to lock strokes to axis

Now, the strokes can be locked to a plane set in the cursor location.
This option allow the artist to rotate the view and draw keeping the
strokes flat over the surface. This option is similar to surface option
but doesn't need a object.

The option is only valid for 3D view and strokes in CURSOR mode.

4 years agoFix T49750: Cycles wrong ray differentials for perspective and stereo cameras.
Brecht Van Lommel [Sat, 22 Oct 2016 13:59:23 +0000 (15:59 +0200)]
Fix T49750: Cycles wrong ray differentials for perspective and stereo cameras.

4 years agoFix T49656: Crash when starting playback while using JACK audio with A/V sync
Jörg Müller [Sat, 22 Oct 2016 13:00:32 +0000 (15:00 +0200)]
Fix T49656: Crash when starting playback while using JACK audio with A/V sync

When ED_screen_animation_play is called from wm_event_do_handlers,ScrArea *sa = CTX_wm_area(C); is NULL in ED_screen_animation_timer.
Informing the audio system in CTX_data_main_set, that a new Main has been set.

4 years agoFix T49657: Audio backend "Jack" should be named "JACK".
Jörg Müller [Sat, 22 Oct 2016 12:20:47 +0000 (14:20 +0200)]
Fix T49657: Audio backend "Jack" should be named "JACK".

4 years agoFix T49764: Audio strips crackle when animating the volume
Jörg Müller [Sat, 22 Oct 2016 11:38:41 +0000 (13:38 +0200)]
Fix T49764: Audio strips crackle when animating the volume

- Implemented linear interpolation for volume changes in the software
- Using this in the software device.

4 years agoFix compiling with blenderplayer (once again...)
Julian Eisel [Fri, 21 Oct 2016 22:30:28 +0000 (00:30 +0200)]
Fix compiling with blenderplayer (once again...)

4 years agoViewport: use depth shader to debug the depth
Dalai Felinto [Fri, 21 Oct 2016 20:50:00 +0000 (20:50 +0000)]
Viewport: use depth shader to debug the depth

At the moment this already shows that the depth is the same after the solid plates and in the very end of drawing, while they should be different. Later on we can adapt this to show different buffers we want to debug.

I am using near=0.1, far=2.0 for my tests. I decided not to make a doversion for near/far because this is for debugging only

4 years agoViewport: create a shader to show depth images linearized
Dalai Felinto [Fri, 21 Oct 2016 20:48:08 +0000 (20:48 +0000)]
Viewport: create a shader to show depth images linearized

4 years agoViewport: add missing alpha for stereo
Dalai Felinto [Fri, 21 Oct 2016 20:42:33 +0000 (20:42 +0000)]
Viewport: add missing alpha for stereo

4 years agoViewport: Bring camera, speaker, rigid body shape and bounding box
Dalai Felinto [Fri, 21 Oct 2016 17:26:42 +0000 (17:26 +0000)]
Viewport: Bring camera, speaker, rigid body shape and bounding box

4 years agoOpenGL: disable GL_CULL_FACE state only when needed
Mike Erwin [Fri, 21 Oct 2016 20:25:17 +0000 (16:25 -0400)]
OpenGL: disable GL_CULL_FACE state only when needed

The active camera has a solid "up" triangle instead of the usual outline. We want to see both sides of this triangle. Disable face culling only when drawing the active camera, not for every camera.

4 years agoFix T49789: Compositor mix node interpolation bug
Sergey Sharybin [Fri, 21 Oct 2016 15:56:09 +0000 (17:56 +0200)]
Fix T49789: Compositor mix node interpolation bug

4 years agoFix T49804: Display grid Scale/Subdivision are sometimes disabled in View3D when...
Bastien Montagne [Fri, 21 Oct 2016 14:06:53 +0000 (16:06 +0200)]
Fix T49804: Display grid Scale/Subdivision are sometimes disabled in View3D when they should not.

Not really possible to precisely detect all cases in which they should or
should not be active, but at least now it won't show as disabled when it
actually has some effects.

4 years agoFix build for gameengine
Dalai Felinto [Fri, 21 Oct 2016 12:50:04 +0000 (12:50 +0000)]
Fix build for gameengine

4 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 21 Oct 2016 12:22:50 +0000 (12:22 +0000)]
Merge remote-tracking branch 'origin/master' into blender2.8


4 years agoCycles: Fix another OpenCL logging issue
Lukas Stockner [Fri, 21 Oct 2016 00:49:00 +0000 (02:49 +0200)]
Cycles: Fix another OpenCL logging issue

Previously an error message would be printed whenever the OpenCL build produced output.
However, some frameworks seem to print extra information even if the build succeeded, so now the actual returned error is checked as well.
When --debug-cycles is activated, the build output will always be printed, otherwise it only gets printed if there was an error.

4 years agoOpenGL: draw lamp objects with new imm mode
Mike Erwin [Thu, 20 Oct 2016 20:55:40 +0000 (16:55 -0400)]
OpenGL: draw lamp objects with new imm mode

Previous commit in blender2.8 branch had some... unintended
consequences. This one should be better.

Part of T49043. Also uses new matrix API (T49450)

4 years agoOpenGL: box & circle outline functions that work with 3D position (z=0)
Mike Erwin [Thu, 20 Oct 2016 18:33:32 +0000 (14:33 -0400)]
OpenGL: box & circle outline functions that work with 3D position (z=0)

New immediate mode API is strict about attribute formats. These new functions make existing code easier to port.

Supports T49043

4 years agoGawain: closer integration of immediate mode & matrix APIs
Mike Erwin [Thu, 20 Oct 2016 18:29:59 +0000 (14:29 -0400)]
Gawain: closer integration of immediate mode & matrix APIs

- any shader program can use matrix state (not only built-in shaders)
- you can mix matrix & begin/end calls, and the bound shader will use the latest matrix state

Part of T49450 & T49043

4 years agoOpenGL: dirty bit for GPU matrix API
Mike Erwin [Thu, 20 Oct 2016 18:17:54 +0000 (14:17 -0400)]
OpenGL: dirty bit for GPU matrix API

Have matrices changed since the most recent bind?

Part of T49450

4 years agoAlembic: only export custom data (UVs, VCols) once, on the first frame.
Kévin Dietrich [Thu, 20 Oct 2016 17:43:22 +0000 (19:43 +0200)]
Alembic: only export custom data (UVs, VCols) once, on the first frame.

This would cause Alembic to throw an exception and fail exporting
animations because it was trying to recreate and overwrite the
attributes for each frame.

4 years agoFix T49797: Exception from scene update handler might leak external engine descriptors
Sergey Sharybin [Thu, 20 Oct 2016 11:32:52 +0000 (13:32 +0200)]
Fix T49797: Exception from scene update handler might leak external engine descriptors

This was causing memory leaks in Cycles.

Some more detailed information in the comment in the code.

Seems to be safe and nice enough for 2.78a.

4 years agoimmediate mode: outliner background
Dalai Felinto [Thu, 20 Oct 2016 01:43:46 +0000 (01:43 +0000)]
immediate mode: outliner background

I tried using immRecti instead, but it didn't work. The current approach
should be more efficient anyways (since GL_TRIANGLE_FAN wouldn't work

4 years agoimmediate mode: ed_util.c
Dalai Felinto [Wed, 19 Oct 2016 23:59:22 +0000 (23:59 +0000)]
immediate mode: ed_util.c

note: I switched one of the glVertex2iv into glVertex2fv to use the same attrib_id

4 years agoPython API: add full_path parameter for bpy.ops.ui.copy_data_path_button.
christian brinkmann [Wed, 19 Oct 2016 22:27:14 +0000 (00:27 +0200)]
Python API: add full_path parameter for bpy.ops.ui.copy_data_path_button.

Also use the operator as part of the UI keymap now, to deduplicate code and let
users configure a custom shortcut.

Reviewed By: brecht

Differential Revision:

4 years agoFix T49793 : Fix enabling SSE2 globally for msvc.
lazydodo [Wed, 19 Oct 2016 16:06:45 +0000 (10:06 -0600)]
Fix T49793 : Fix enabling SSE2 globally for msvc.

When feeding msvc both /arch:sse2 and /arch:sse it's not smart enough to pick the best option, just goes with the last option

4 years agoFix T49775: Appending data with internal dependency cycles prevents correct clearing...
Bastien Montagne [Wed, 19 Oct 2016 12:29:43 +0000 (14:29 +0200)]
Fix T49775: Appending data with internal dependency cycles prevents correct clearing of linked data-blocks.

This is not a simple fix, but imho still needs to be backported to 2.78a...

4 years agoOpenGL: draw empties with new imm mode
Mike Erwin [Wed, 19 Oct 2016 08:01:15 +0000 (04:01 -0400)]
OpenGL: draw empties with new imm mode

Part of T49043

4 years agoOpenGL: draw cameras using new matrix API
Mike Erwin [Wed, 19 Oct 2016 00:57:36 +0000 (20:57 -0400)]
OpenGL: draw cameras using new matrix API

Also removed some extra push/pops.
Ref T49450

4 years agoOpenGL: draw cameras with new immediate mode
Mike Erwin [Wed, 19 Oct 2016 00:27:24 +0000 (20:27 -0400)]
OpenGL: draw cameras with new immediate mode

Mostly the same as before. Except:
- avoid drawing same lines multiple times
- helper functions take "bool filled" argument instead of GLenum
- drawcamera_volume draws its own near & far planes

4 years agoGawain: yet another way to set uniform color
Mike Erwin [Wed, 19 Oct 2016 00:22:22 +0000 (20:22 -0400)]
Gawain: yet another way to set uniform color

4 years agofix narrow text entry fields
Mike Erwin [Tue, 18 Oct 2016 21:34:29 +0000 (17:34 -0400)]
fix narrow text entry fields

widget_draw_text was calculating wrong display length when field is too narrow to show entire input string. Gawain assert caught this 11 function calls away!

Thanks to @ianwill for reporting.

4 years agoskip drawing of gpencil strokes with overall thickness <= zero
Mike Erwin [Tue, 18 Oct 2016 17:12:40 +0000 (13:12 -0400)]
skip drawing of gpencil strokes with overall thickness <= zero

Fixes an assert in drawing code.

Might need further work to support variable-thickness strokes (from pressure-sensitive stylus). This all is due for geometry shader overhaul anyway.

4 years agodraw gpencil dots smooth
Mike Erwin [Tue, 18 Oct 2016 17:07:35 +0000 (13:07 -0400)]
draw gpencil dots smooth

Some strokes are just single dots. Draw these smooth / antialiased.

4 years agoOpenGL: new built-in shader for smooth round 3D points
Mike Erwin [Tue, 18 Oct 2016 17:03:30 +0000 (13:03 -0400)]
OpenGL: new built-in shader for smooth round 3D points

4 years ago[msvc] Minor cleanup in blenkernel.
lazydodo [Tue, 18 Oct 2016 15:25:14 +0000 (09:25 -0600)]
[msvc] Minor cleanup in blenkernel.

this patch resolves the following warnings;

Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 764
Warning C4098 'attach_stabilization_baseline_data': 'void' function returning a value blenkernel\intern\tracking_stabilize.c 139
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\cachefile.c 148
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\paint.c 413
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\editderivedmesh.c 591
Warning C4028 formal parameter 3 different from declaration blenkernel\intern\library_remap.c 709
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 754
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 758
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 759
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 763
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 764
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 765
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 769
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\ocean.c 770
Warning C4028 formal parameter 1 different from declaration blenkernel\intern\DerivedMesh.c 3458

It's mostly things where the signature in the .h and the actual implementation in the .c do not match.  And a bunch functions who do not match the TaskRunFunction declaration cause they leave out the __restrict keyword.

Reviewers: brecht, juicyfruit, sergey

Reviewed By: sergey

Subscribers: Blendify

Differential Revision:

4 years ago[windows] Create A Blender Desktop Shortcut in the msi installer , fixes T49522
lazydodo [Tue, 18 Oct 2016 15:21:58 +0000 (09:21 -0600)]
[windows] Create A Blender Desktop Shortcut in the msi installer , fixes T49522

4 years agoFix: Append 'Object proxy' hack checking for local/linked usages before those flags...
Bastien Montagne [Tue, 18 Oct 2016 12:15:59 +0000 (14:15 +0200)]
Fix: Append 'Object proxy' hack checking for local/linked usages before those flags were set!

Dummy mistake, to be backported to 2.78a.

4 years agoClarified warning in EnumProperty
Sybren A. Stüvel [Tue, 18 Oct 2016 09:24:33 +0000 (11:24 +0200)]
Clarified warning in EnumProperty

Blender doesn't necessarily crash when Python doesn't keep references to
the returned strings. As a result, someone that implements this incorrectly
could be lulled into a false sense of correctness by Blender not crashing.

4 years agoOpenGL: tweak image shaders & code that uses them
Mike Erwin [Tue, 18 Oct 2016 04:08:34 +0000 (00:08 -0400)]
OpenGL: tweak image shaders & code that uses them

- rename image shaders to describe exactly what they do
- rename inputs to match other built-in shaders
- set & use active texture unit
- no need to enable/disable textures with GLSL
- pull vertex format setup out of loops

4 years agominor cleanup & deprecation
Mike Erwin [Tue, 18 Oct 2016 03:48:12 +0000 (23:48 -0400)]
minor cleanup & deprecation

4 years agoOpenGL: draw image empties with new API
Mike Erwin [Tue, 18 Oct 2016 00:33:59 +0000 (20:33 -0400)]
OpenGL: draw image empties with new API

This extensive rewrite caches the image texture in VRAM. Can handle images up to OpenGL limits (8K or 16K).

Part of T49043 & T49450

4 years agoFixup for doversion (rB8d573aa0 and rBa7e74791)
Dalai Felinto [Mon, 17 Oct 2016 19:43:35 +0000 (19:43 +0000)]
Fixup for doversion (rB8d573aa0 and rBa7e74791)

4 years agoFix for gpu_shader_2D_texture_2D_frag.glsl
Dalai Felinto [Mon, 17 Oct 2016 19:23:01 +0000 (19:23 +0000)]
Fix for gpu_shader_2D_texture_2D_frag.glsl

Report and patch by Willian Padovani Germano (ianwill)

4 years agoProper fix for crash when joining areas that doesn't break manipulators
Julian Eisel [Mon, 17 Oct 2016 17:25:56 +0000 (19:25 +0200)]
Proper fix for crash when joining areas that doesn't break manipulators

Turns out CTX_wm_region returns mostly NULL in wm_manipulatormaps_handled_modal_update. Now propertly unsetting area/region data of handlers when deleting area/region.

4 years agoFix T49722: Appending Bug (Groups).
Bastien Montagne [Mon, 17 Oct 2016 12:49:35 +0000 (14:49 +0200)]
Fix T49722: Appending Bug (Groups).

One day we'll have to reconsider why some many 'real' ID usages are not
refcounting... :(

To be backported to 2.78a.

4 years agoUV Editor: Add filter option to control what is visible when Draw Other Objects is...
Sergey Sharybin [Mon, 17 Oct 2016 12:28:16 +0000 (14:28 +0200)]
UV Editor: Add filter option to control what is visible when Draw Other Objects is enabled

Previously the editor will always try to only show UV faces with the same exact active
image or image texture, which is quite difficult to control on a production shaders, where
each material can have multiple objects assigned.

The idea of this commit is to bring option which allows to easily control what to display
when "Draw Other Objects" is enabled, so currently we can have old behavior ("Same Image")
or tell editor to show everything ("All"). In the future we can extend it with such filters
as "Same Material" and things like that.

Hopefully this will help @eyecandy's workflow of texturing.

4 years agoFix T49738: Hair Add Brush doesn't work
Sergey Sharybin [Mon, 17 Oct 2016 10:37:50 +0000 (12:37 +0200)]
Fix T49738: Hair Add Brush doesn't work

the issue was caused by wrong default value for brush particle count
which was clamped on display from 0 to 1. This is technically a regression
but how to port this to 2.78a?

4 years agoFix T49630: Cycles: Swapped shader and bake kernels
Lukas Stockner [Mon, 17 Oct 2016 10:28:01 +0000 (12:28 +0200)]
Fix T49630: Cycles: Swapped shader and bake kernels

The problem here was, as the title says, that the two kernels were swapped.
Since shader evaluation is only used for building the samling map when World MIS is enabled, rendering without it would still work fine, although baking also was broken.

4 years agoCycles: Improve OpenCL kernel compilation logging
Lukas Stockner [Mon, 17 Oct 2016 09:48:24 +0000 (11:48 +0200)]
Cycles: Improve OpenCL kernel compilation logging

The previous refactor changed the code to use a separate logging mechanism to support multithreaded compilation.
However, since that's not supported by any frameworks yes, it just resulted in bad logging behaviour.
So, this commit changes the logging to go diectly to stdout/stderr once again by default.

4 years agoOpenGL: disable checks for NPOT texture support
Mike Erwin [Mon, 17 Oct 2016 06:36:51 +0000 (02:36 -0400)]
OpenGL: disable checks for NPOT texture support

Non-power-of-two textures are always allowed. Keeping the disabled checks in the code in case we support OpenGL ES in the future. Even then it should be a compile-time check, not at run-time.

4 years agoGawain: tweak tracking of unassigned attributes (no API change)
Mike Erwin [Mon, 17 Oct 2016 03:50:18 +0000 (23:50 -0400)]
Gawain: tweak tracking of unassigned attributes (no API change)

Hoping for a small performance win.

4 years agoOpenGL: draw object centers nicer
Mike Erwin [Sun, 16 Oct 2016 22:49:48 +0000 (18:49 -0400)]
OpenGL: draw object centers nicer

Shaders + new immediate mode = very nice dots.

Part of T49043

4 years agoOpenGL: new built-in shader for smooth round 3D points w/ outline
Mike Erwin [Sun, 16 Oct 2016 22:43:24 +0000 (18:43 -0400)]
OpenGL: new built-in shader for smooth round 3D points w/ outline

4 years agoOpenGL: new immUniformThemeColorShadeAlpha function
Mike Erwin [Sun, 16 Oct 2016 21:04:17 +0000 (17:04 -0400)]
OpenGL: new immUniformThemeColorShadeAlpha function

Plus some naming cleanup.

Supports T49043

4 years agoGawain: new immUniform4fv function
Mike Erwin [Sun, 16 Oct 2016 20:59:57 +0000 (16:59 -0400)]
Gawain: new immUniform4fv function

4 years agofix IS_VIEWPORT_LEGACY macro
Mike Erwin [Sun, 16 Oct 2016 20:56:36 +0000 (16:56 -0400)]

4 years agoFix outliner items sometimes not opening
Julian Eisel [Sun, 16 Oct 2016 19:41:10 +0000 (21:41 +0200)]
Fix outliner items sometimes not opening

Own mistake in 9a9a663f40d55. Guessed there is a case where we have to rebuild the tree but everything seemed fine... It didn't work in display modes like "Data-Blocks".

4 years agoFix T49746: crash loading user preferences with missing operators.
Brecht Van Lommel [Sun, 16 Oct 2016 19:19:52 +0000 (21:19 +0200)]
Fix T49746: crash loading user preferences with missing operators.

4 years agoMore fixes for keyframe theme options
Julian Eisel [Sun, 16 Oct 2016 18:30:51 +0000 (20:30 +0200)]
More fixes for keyframe theme options

Couple of issues here:
* Missing initialization for 3D view keyframe options for "Reset to Default Theme"
* Alpha values not reset correctly on "Reset to Default Theme"
* Alpha values of timeline keyframe options not reset correctly for old files
Also corrected old version patches even though they're overridden later, to avoid more issues in case people copy this code.

Corrections to d7af7a1e04c243 and 8d573aa0ecb61

4 years agoMore fixes for keyframe theme options
Julian Eisel [Sun, 16 Oct 2016 18:30:51 +0000 (20:30 +0200)]
More fixes for keyframe theme options

Couple of issues here:
* Missing initialization for 3D view keyframe options for "Reset to Default Theme"
* Alpha values not reset correctly on "Reset to Default Theme"
* Alpha values of timeline keyframe options not reset correctly for old files
Also corrected old version patches even though they're overridden later, to avoid more issues in case people copy this code.

Corrections to d7af7a1e04c243 and 8d573aa0ecb61

4 years agoFix crash when joining areas (caused by manipulators)
Julian Eisel [Sun, 16 Oct 2016 17:28:12 +0000 (19:28 +0200)]
Fix crash when joining areas (caused by manipulators)

Manipulator code tried to access the removed region from handler->op_region. Use context region now.

4 years agoCleanup: Quiet warnings, use RAD2DEG macro
Julian Eisel [Sun, 16 Oct 2016 15:28:12 +0000 (17:28 +0200)]
Cleanup: Quiet warnings, use RAD2DEG macro

4 years agoFix assert in the wrong place, should be moved earlier to do anything.
Chase Willden [Sun, 16 Oct 2016 13:50:53 +0000 (15:50 +0200)]
Fix assert in the wrong place, should be moved earlier to do anything.

Reviewed By: brecht

Differential Revision: