1
1

Compare commits

...

9590 Commits

Author SHA1 Message Date
Daniel Griffin
cec4fc3bd3 Enabled Multi-Object-Mode for CURVE_OT_select_less 2018-05-29 23:59:07 -07:00
Daniel Griffin
ee80a79945 Enabled Multi-Object-Mode for CURVE_OT_select_more 2018-05-29 23:52:11 -07:00
Daniel Griffin
25fcc24470 Enabled Multi-Object-Mode for CURVE_OT_de_select_last 2018-05-29 23:30:32 -07:00
Daniel Griffin
d4a4751d98 Enabled Multi-Object-Mode for CURVE_OT_de_select_first 2018-05-29 23:22:53 -07:00
Daniel Griffin
c3dfe47dfc Enabled Multi-Object-Mode for CURVE_OT_select_next and CURVE_OT_select_previous. 2018-05-29 22:42:56 -07:00
Daniel Griffin
4962103391 Merge branch 'blender2.8' into Multi_Object_Curve_Tools 2018-05-29 20:57:59 -07:00
9992079d59 EEVEE: LookDev, reset camera settings 2018-05-29 22:02:36 +02:00
36e6d44c90 Fix last commit. 2018-05-29 15:58:56 -03:00
00dc1c08aa Fix T55223: Crash when changing lattice resolution. 2018-05-29 15:39:44 -03:00
f8908f0d43 Correct last commit
Left unneeded code in space_context_cycle_invoke
2018-05-29 18:18:36 +02:00
e9cd2fb23b Keymap: partially implement changes from T55162
- Use Tab key for search.
- Number keys switch modes.
- The number of the current mode can open a submode menu
  (currently only works for edit-mode)
- Ctrl-Tab, Ctrl-Shift-Tab - cycle workspaces.
2018-05-29 17:52:27 +02:00
929c78e33c EEVEE: LookDev blurred background 2018-05-29 17:50:51 +02:00
Dalai Felinto
08b8fa0863 Cleanup 2018-05-29 17:33:14 +02:00
Dalai Felinto
85d845ef98 Fix crash when moving object parented to a curve
Note, we can probably remove scene from BKE_object_where_is_calc
and force to always use it from depsgraph.
2018-05-29 17:33:07 +02:00
Dalai Felinto
5eda9732b3 Use the correct time to evaluate object in BKE_object_where_is_calc functions 2018-05-29 17:05:32 +02:00
Dalai Felinto
e2bac484e0 Use correct time for curve parent evaluation
Time should alwaus come from depsgraph, not scene.
2018-05-29 17:05:32 +02:00
36e9ed98e7 StudioLight: Calculate Specular irradiance 2018-05-29 16:29:11 +02:00
f98c838b71 EEVEE: LookDev reversed the background fadeout 2018-05-29 16:22:53 +02:00
d5889f57ae EEVEE: LookDev fadeout to the world horizon color 2018-05-29 16:22:53 +02:00
8f670dd855 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_material.h
	source/blender/blenkernel/BKE_mesh.h
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/material.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/render/render_preview.c
	source/blender/makesrna/intern/rna_object.c
2018-05-29 16:02:53 +02:00
f7af08b5fe Cleanup: Get rid of G.main in BKE_material.
Note that in some cases, this only moves the G.main case to somne other
places - in particular, RNA getters/setters are becoming annoying here...
2018-05-29 15:49:21 +02:00
9d037153f7 Object Modes: disable mode switching on selection
See T55246
2018-05-29 15:47:08 +02:00
44b99d1052 For 2.8, bring back debug mode indices display. 2018-05-29 09:31:00 -04:00
43584f4a41 Missed own last commit 2018-05-29 15:17:34 +02:00
Dalai Felinto
bc54823376 Fix T55244: Parenting object(s) to curve crashes blender
There is a chance parts of Blender call BKE_object_workob_calc_parent
with ob->parent objects that are outside the depsgraph.

This we can tackle later since these are corner cases anyways,
and this fix fixes all parenting operators in Blender.
2018-05-29 15:11:20 +02:00
8b24f45e6b Object Modes: only use selection for mode switch
Selection is no longer needed for an object to be considered in a mode.

Part of T55246 design task, fixes T55187
2018-05-29 14:21:18 +02:00
03b0495d04 Fix: Only change transform mode from translation to rotation/scale when no valid bones were found in an armature
This commit fixes a problem the Spring team were having in the shot files 01_030/050 with
the camera rig, where when you tried grabbing/translating the bones of the camera rig,
they would only keep rotating/scaling instead.

The reason for this is that with the multi-object editing support added into the transform
system, this code would now get run for all the other objects that were being included
in Pose Mode, even if no bones from those armatures were selected. Since no valid translatable
bones were found in those other armatures, the transform mode would get reset upon
encountering one of those other bones.
2018-05-29 12:27:04 +02:00
756b70c6c3 UI: Expand space sub-types into the menu
Initial support for expanding editors, see: T54744
2018-05-29 12:15:26 +02:00
d4ac65d003 Cleanup: use same 'depsgraph' name everywhere outside of DEG space.
'graph' is waaaayyyyy too generic name outside of DEG context, and
better try to use same name everywhere!
2018-05-29 12:07:48 +02:00
643259415d EEVEE: LookDev fade out background option 2018-05-29 12:06:48 +02:00
a0b08e7b66 EEVEE: LookDev use_scene_light draw option
Scene lights are rendered when
 - v3d is not available
 - or shading type is other then OB_MATERIAL
 - or shading type is OB_MATERIAL and use_scene_light is true
2018-05-29 11:01:25 +02:00
2bb4977c4a Fix T55203: Particle hair weights are not preserved 2018-05-29 10:36:19 +02:00
77e32e8819 EEVEE: LookDev overlays enabling
The mirror ball and diffuse ball are only rendered when overlays are
turned on and the lookdev overlay is turned on.
2018-05-29 09:08:32 +02:00
Daniel Griffin
9f59448083 Enabled Multi-Object-Mode for CURVE_OT_select_nth, CURVE_OT_hide, and CURVE_OT_reveal. 2018-05-28 23:01:17 -07:00
c72a204001 make.bat : fix release build not getting the right settings. 2018-05-28 21:50:59 -06:00
6946c41340 Merge remote-tracking branch 'origin/master' into blender2.8 2018-05-28 20:07:51 -06:00
d6a4b23f8b make.bat : improve error message while detecting the msvc runtime when using clang 2018-05-28 20:07:24 -06:00
3ad9a94c9d Merge remote-tracking branch 'origin/master' into blender2.8 2018-05-28 19:57:50 -06:00
9450792bf2 make.bat : add support for building with ninja and clang together. 2018-05-28 19:56:17 -06:00
4e5d5b3a9e COW operators: Fix VIEW3D_OT_view_all cursor not updating with shift+c center cursor
This differential fixes a bug for resetting view (shift+c).
Bug description: When 3D cursor is placed randomly somewhere, and shift+c is pressed,
the cursor is not shown to reset at world center.

Reviewers: sergey, aligorith, brita_

Reviewed By: brita_

Subscribers: brita_

Differential Revision: https://developer.blender.org/D3423
2018-05-28 23:45:22 +02:00
eb2491363a Cleanup: fix some harmless compiler warnings. 2018-05-28 23:27:40 +02:00
359469a39a Fix T55204: proxy object disappearing randomly.
The problem was a missing depsgraph relation between the transforms of
the object and its proxy, it was only there for the pose.
2018-05-28 23:24:16 +02:00
9b1a15d8f8 Fix assert in workbench drawing, instance data not big enough. 2018-05-28 23:19:57 +02:00
3c1483cf1e COW operators: Fix drag and dropping of color properties 2018-05-28 23:07:23 +02:00
5d1a172783 Merge remote-tracking branch 'origin/master' into blender2.8 2018-05-28 14:35:59 -06:00
81060ff6b2 Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming

Things to note:

1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)

2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)

victor_cpu
	msvc:3099.51
	clang:2796.43

pavillon_barcelona_cpu
	msvc:1872.05
	clang:1827.72

koro_cpu
	msvc:1097.58
	clang:1006.51

fishy_cat_cpu
	msvc:815.37
	clang:722.2

classroom_cpu
	msvc:1705.39
	clang:1575.43

bmw27_cpu
	msvc:552.38
	clang:561.53

barbershop_interior_cpu
	msvc:2134.93
	clang:1922.33

3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.

4) X64 only currently, X86 builds but crashes on startup.

5) Tested with llvm/clang 6.0.0

6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration

7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.

8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.

9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
Dalai Felinto
66577c8732 Rename EEVEE visibility group > collection
I think we should rename the DNA as well, and break the 0.01 files using this feature.
But I will leave this decision to Clement.
2018-05-28 21:27:00 +02:00
cf60939a59 Ugly Hacky Fix: Clear Loc/Rot/Scale + Autokey now works for bones
This is a hacky fix so that animators can use this tool again with autokey enabled
(which they do all the time). The issue here is that the tool writes the new (0)
values to the original data, but insertkey now reads from evaluated data (so that
keying interpolated values works). However, the cleared values do not get re-evaluated
or flushed before insertkey gets to it (via auto keying), meaning that the wrong values
get keyed.

There may be better solutions for this, but for now, this is the simplest fix that
I can get working.
2018-05-28 20:25:03 +02:00
69d3a08557 EEVEE: lookdev default materials 2018-05-28 19:35:08 +02:00
e63fbc992d Fix T55231: Setting bone.select from RNA didn't tag for copy on write
This was causing problems with addons such as the Selection Sets addon used
in studio by the animators.
2018-05-28 18:52:04 +02:00
e9cf3b5347 CoW: Skip pointers that are used in Lattice edit mode. 2018-05-28 13:47:05 -03:00
46d7c55b17 Cleanup: Fix typo: updata -> update 2018-05-28 13:47:04 -03:00
f8d0447dfb CoW: Skip used pointers in MetaBall edit mode. 2018-05-28 13:47:04 -03:00
f36315dd34 CoW: Skip pointers used in Text edit mode. 2018-05-28 13:47:03 -03:00
98d4d4ce58 Tool System: workaround psys cursor conflict
This needs to be solved properly, for now add cursor-click tool
which can co-exist w/ particle paint.
2018-05-28 18:16:01 +02:00
42d6b8efc0 RNA: re-enable property notifiers
While these will be removed eventually,
it makes tracking down COW buts a hassle.
2018-05-28 18:16:01 +02:00
d2f8b48f01 Depsgraph: preserve memory caches for particles when creating Copy-on-Write
Solves issue with particle memory cache ignored.

Thanks Bastien for review!
2018-05-28 18:06:45 +02:00
2f56bf3535 Workbench: Fix uninitialized variable usage. 2018-05-28 12:27:50 -03:00
272ca5772d EEVEE: LookDev storage list wrongly used 2018-05-28 17:18:58 +02:00
9b6a30d2cb Fix T55226: outliner glitch with item open/close, after recent optimization. 2018-05-28 17:10:00 +02:00
765fd29d68 EEvEE: LookDev 2018-05-28 17:07:39 +02:00
ce5fa2deca Fix: Action/Graph editor UI's didn't update when channel properties were changed
More MessageBus-related silliness to resolve issue with toggling visibility/mute/locking
status of F-Curves/Groups/etc., as well as other things like modifying active keyframe's
values, or changing properties of F-Modifiers.

I've now ended up just whitelisting in the region subscribers all the animation-related
structs in RNA. But still, that may not be enough to deal with potential issues later
with the property sliders (shown per channel, optionally), which can come from anywhere.

(Spring bug)
2018-05-28 16:54:45 +02:00
1d320f10ac UI: Option to layout properties in two columns
Needed for proposed alternate layout, see T54951.
2018-05-28 16:49:30 +02:00
4045730d58 Fix missing animation curves update when tweaking f-curves
Action is an own datablock, meaning, changes to f-curves needs
to copy those changes to all evaluated versions of action datablock.
2018-05-28 16:45:28 +02:00
e673be1ebc Merge branch 'master' into blender2.8 2018-05-28 15:25:41 +02:00
dc0eed178a Fix Cycles + OSL build error, pass main to node editing functions. 2018-05-28 00:04:14 +02:00
95c5d1193f Merge branch 'master' into blender2.8 2018-05-27 21:10:43 +02:00
fd2c48726f UI: center align number buttons w/o text
This makes supporting split properties and text possible, see T54951
2018-05-27 21:08:50 +02:00
9c8da50106 Slightly blue tinted variation of the upcoming Flatty Dark theme.
It's been requested for a while now and with the upcoming
default dark theme this is a good companion variation.
2018-05-27 19:06:25 +02:00
e7010a05be Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesrna/intern/rna_object_api.c
	source/blender/makesrna/intern/rna_scene.c
	source/blender/makesrna/intern/rna_scene_api.c
2018-05-27 18:52:28 +02:00
38cb29d67e Cleanup: Nuke most of remaining evil G.main from RNA.
The few ones in getters/setters we cannot remove as easily, for now we
can live with those I think...
2018-05-27 18:46:39 +02:00
1863883a24 Merge branch 'master' into blender2.8 2018-05-27 17:26:59 +02:00
edce44d693 Cycles: Fix problems in the IES loader when rendering with no file selected 2018-05-27 17:16:15 +02:00
47f2b3b80d Merge branch 'master' into blender2.8 2018-05-27 12:54:21 +02:00
56254a42e0 UI: replace BLI_strncpy w/ memcpy
Size is already checked.
2018-05-27 12:50:03 +02:00
4ca4e64d25 Grid: Do not go over objects in front/side ortho views.
Fixes T55190 Grid displayed on top of objects in orthographic view
2018-05-27 11:26:17 +02:00
9a74b60367 Merge branch 'master' into blender2.8 2018-05-27 11:06:29 +02:00
474971f3d8 Cleanup: unused var 2018-05-27 11:06:11 +02:00
bc3727a943 Recently added IES conflicts w/ EEVEE 2018-05-27 11:01:46 +02:00
198be6f37b Grid: Fix T51813: Opaque grid on OSX. 2018-05-27 10:50:39 +02:00
06cb460cd7 3D View: minor change to NDOF view orbit
This change is needed for 2.8, where the NULL check isn't a reliable way
of testing if dynamic offset is needed.
2018-05-27 10:34:01 +02:00
12a9e9ae33 Fix restrict error in BLI_str_format_byte_unit
Don't use sprintf to append a string to it's self.

Also correct BLI_str_rstrip_float_zero's return value.
2018-05-27 10:28:04 +02:00
7a0699db34 make.bat : Fix builtime.txt being written in the wrong folder. 2018-05-26 19:20:07 -06:00
48155c210a Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.

Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.

The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.

The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.

Reviewers: #cycles, dingto, sergey, brecht

Reviewed By: #cycles, dingto, brecht

Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey

Differential Revision: https://developer.blender.org/D1543
2018-05-27 01:24:57 +02:00
aefc793a81 Workbench: Shadow: Refine camera in shadow test.
Test if all nearplane points are not in front of the shadow BBox.
2018-05-27 00:15:47 +02:00
60ddea7758 Workbench: Shadows: Add frustum check and camera occlusion test.
If the object is manifold and the camera is in the shadow side, we can
use the depth fail method to fix the inverted shadow glitch.

Unfortunately this does not really work for non-manifold.

Implementation details:
We try to be as efficient as we can, we precompute camera near plane
projected into 2D shadow space so we can test for intersection with the
shadow boundbox easily.

As the intersection test is done in 2D it's pretty fast.
Unfortunately, this means the shadow bounds are all aligned to the same
space and are not the smallest bound we could extract.
2018-05-26 23:31:17 +02:00
975828e23a Armature: Fix warning. 2018-05-26 23:24:11 +02:00
8df99a5d8a DRW: Add new DRW_debug API.
This new API aim to provide simple function that can be called by the draw
engines during any phase of the draw pipeline. All calls are saved and
issued after all engines have finished rendering.

This removes the need of setuping special passes and shading groups for some
simple debug drawing.
2018-05-26 23:24:11 +02:00
c883f09fa8 Workbench: Codestyle 2018-05-26 23:24:11 +02:00
975eac0b07 Workbench: Shadow: Add shader variant for manifold case.
Totally Manifold objects only require a single increment/decrement of the
stencil value. This result in less geometry generated and less overdraw.
2018-05-26 23:21:33 +02:00
0c9974c8cd Workbench: Shadow: Use depth fail method for manifold objects.
Since this method have no failure case for manifold objects, use it.
2018-05-26 23:01:30 +02:00
ef502854fe Threads: add spinlock hit for hyperthreading processors on Windows.
Suggested by Percy Ross Tiglao.
2018-05-26 22:35:30 +02:00
44935fdfa3 Armature: Make Custom bone have the same appearance as other bones.
I had to correct some errors in the winding order of the normal bones.
2018-05-26 22:28:52 +02:00
2241a61aab Armature: Fix missing bone edges in object mode. 2018-05-26 22:28:52 +02:00
6b38fa8cab Armature: Modify Shape outline shader to use Line adjacency instead of tri.
This is much faster and simpler. This is also to make it compatible with
custom bone shape in the future.
2018-05-26 22:28:52 +02:00
581b021a1f Cleanup: unused defines 2018-05-26 13:15:55 +02:00
c9c95ed25f Cleanup: unused defines 2018-05-26 13:12:00 +02:00
75355ef426 RNA: correct naming w/ last cleanup 2018-05-26 13:06:40 +02:00
0d559a6730 RNA: follow boolean naming conventions 2018-05-26 11:54:25 +02:00
6ebcf98943 Cleanup: whitespace, long lines, duplicate include 2018-05-26 11:05:23 +02:00
3e3f6754b4 Cleanup: rename RNA property to match UI 2018-05-26 09:51:21 +02:00
33e45658eb COW Fix: Lamp manipulators 2018-05-26 09:45:58 +02:00
c9db7ceff2 make.bat: Add support for building with ninja.
ninja is an alternative to msbuild designed for fast rebuilds. However there is no IDE support, builds only from the command line.

Comparison between msbuild and ninja for a full build, build time in seconds.

Full Clean Build
msbuild     867.5
Ninja       801.2
Difference  -66.3 (-7.6%)

Minor Change
msbuild      43.0
Ninja        14.9
Difference  -28.1 (-64.4%)

No Changes
msbuild      23.0
Ninja         6.1
Difference  -16.9 (-73.5%)
2018-05-25 21:46:42 -06:00
bae880dc9e make.bat/cleanup: removed stray echo in make.bat 2018-05-25 17:59:07 -06:00
857e4e04d8 make.bat: refactor make.bat
make.bat was starting to become hard to maintain, this refactors it into separate batch files for each stage of the process.

-Improved detection of msvc2013/2015
-Improved failure handling.
-Added check for working msbuild and C++ compiler
-Added verbose switch to ease trouble shooting.
-Added Check if svn/cmake/git are in the path before using them
-Display the build configuration before asking to download the libraries
-Offer an option to recover an interrupted checkout of the libraries.
-Automatically check out sub-modules in-case they are missing.
2018-05-25 17:57:13 -06:00
64ee6f4e9f Fix error when snapping with occlusion.
Face normal may be facing the wrong side.
2018-05-25 18:43:38 -03:00
c9f7a3b32a Fix T55207, fix T55208: hair not positioned correctly after subsurf.
The problem was that the particle system modifier was reading ob->derivedDeform
during modifier stack evaluation. Due to the mesh -> DM conversion this was no
longer set leading to wrong results.

In fact we don't really need the deformed mesh, just the original mesh topology
for face/poly index remapping. So the solution is to use that instead.
2018-05-25 23:20:20 +02:00
4dee702332 Add number and memory size formatting throughout the UI
This commit adds number formatting (thousands separator) to the baking panel. It also adds a new function to format memory sizes (KB/GB/etc) and applies it to the baking panel and scene stats. The new function is unit tested.

Reviewers: Severin
Tags: #user_interface
Differential Revision: https://developer.blender.org/D1248
2018-05-25 22:41:49 +02:00
Dalai Felinto
768706c6a5 Fix eevee render settings not working
This was no longer working since 15c2801aac.
2018-05-25 19:51:18 +02:00
a3a069f493 Tool System: cursor tool now transforms on drag 2018-05-25 19:43:23 +02:00
9dca74f0e5 [windows/make.bat] use a more reliable way of locating visual studio 2017.
The registry hack we were using wasn't very reliable, the recommended way to locating visual studio is using vswhere (15.2 and up), using it also allows to switch between the regular and pre-release versions.
2018-05-25 10:24:01 -06:00
562cf573d3 Multi-Object-Mode: EditMesh UV snap to cursor
D3422 by @Al
2018-05-25 17:28:37 +02:00
1bf2a7709f Timeline: Move Keying settings from sidebar to header as popover
Having them on the sidebar means we have to expand the editor every time.
2018-05-25 17:02:56 +02:00
8a73ea7af2 Use menu back theme colors for popover 2018-05-25 17:02:56 +02:00
988a14aa14 COW Fix: Transforming animated objects would jump when starting transforms
Just as with my earlier fix for bones (0492e56fec),
here we're reading evaluated object values into the "i" versions of each transform
property, and using the original/non-evaluated data for the pointers.

XXX:
What's not clear though is what we should be doing with the "BKE_object_where_is_calc()"
calls here. They currently use ob, but that probably shouldn't happen... and ob_eval
should in theory have a more up-to-date version of what it would need to evaluate!
2018-05-25 16:36:04 +02:00
51926de7f0 UI: popover now only centers on active button once 2018-05-25 16:31:52 +02:00
c0f9f69c7e Fix T55200: dragging object into hidden collection does not hide it. 2018-05-25 16:08:59 +02:00
5901c1ca42 UI: fix event handling direction
Correct arrow key direction in popovers,
also de-duplicate menu callback,
2018-05-25 15:47:12 +02:00
dd22080b9a Fix: X-Axis Mirror option was missing from the Pose Options popover
Although it's mostly a rigging option, sometimes it's useful to have it when posing.
2018-05-25 15:34:25 +02:00
572a9619b9 Remove DerivedMesh: paint_utils.c; Cow-ify PAINT_OT_sample_color
DM was only using it for color sampling in the 3Dview. Now it's properly
using COW evaluated versions of object and mesh instead.
2018-05-25 15:24:30 +02:00
40638e1970 Fix T55062: crash with workspace scene relations.
List of relations was saved with wrong struct type.
2018-05-25 15:06:40 +02:00
657fedbbee Style: use extra space for aligning parameters in a function. 2018-05-25 10:03:25 -03:00
8510472198 Cleanup: Change remaining BKE_scene_frame_get() in constraint.c to use DEG_get_ctime() 2018-05-25 14:49:11 +02:00
14b51b3974 Fix T55197: Dopesheet filtering settings were not triggering refresh anymore due to messagebus crap 2018-05-25 14:43:48 +02:00
Julian Eisel
dc26ef081b Fix T55198: Preferences Keybindings Crash
Operator sanitize function would be called for non operator props. Mistake from
88eafe078a.
2018-05-25 14:04:48 +02:00
45e7d609ce Fix outliner showing objects in collections instances.
It didn't do this before for groups, and while it could be useful this leads
to terrible performance when there are many instances.
2018-05-25 13:48:29 +02:00
2cc53227ab Outliner: optimize lookup of unused tree elements. 2018-05-25 13:48:29 +02:00
b11a1d5da2 UI: support for a popup panel which stays open 2018-05-25 12:55:22 +02:00
e9908134e8 UI: Move UI_paneltype_draw into layout code
No functional changes, needed for persistent popovers.
2018-05-25 12:55:22 +02:00
Dalai Felinto
fbc65c6b28 Fix T55165: Driving camera lens with property behaves unexpectedly
Differential Revision: https://developer.blender.org/D3438
2018-05-25 12:48:33 +02:00
8a78a53e3b Keymap: place cursor on press
Needed for tablet users.
2018-05-25 12:46:52 +02:00
d8a6c1d316 Cleanup/simplification for BKE_modifier_get_evaluated_mesh_from_object
* Added BKE_object_get_evaluated_mesh, which can also be used outside of
Modifier context.
* BKE_modifier_get_evaluated_mesh_from_object is now a dummy wrapper
around BKE_object_get_evaluated_mesh, we do not need anything special
anymore for RENDER quality option, since this is supposed to be handled
at depsgraph level... Maybe we can get rid of it at some point, but kind
of like the idea of keeping it for now, sounds more consitent.
2018-05-25 12:27:54 +02:00
ba6abd83b0 Cleanup: do not make functions for the pleasure of having functions... 2018-05-25 11:39:02 +02:00
f243390bd6 Cleanup: minor details in BKE paint code related to palettes.
* Always use BKE_id_new, unless you have a very good reason to use
lower-level code!
* Prefer to pass actual ID user pointer to functions like id_us_plus & co,
rather than 'floating' ID pointer, when possible. It makes it more clear
who is the user we increase count for!
2018-05-25 11:32:47 +02:00
03a80facfc Fix T55183, fix T55174: crashes with workspace / view layer relation.
Don't store pointers to ViewLayer in the workspace, only names. Add specific
relation type since the generic mechanism makes the code hard to follow.
Integrate with pointer restore for undo and library remapping code to avoid
data going out of sync.

Also add relation automatically if there doesn't exists one yet in
BKE_workspace_view_layer_get, because in general it's really hard to ensure
it will exist when making arbitrary scene changes.

Differential Revision: https://developer.blender.org/D3432
2018-05-25 11:16:58 +02:00
08da2826e0 Merge branch 'master' into blender2.8 2018-05-25 10:52:53 +02:00
9812943931 WM: check modal handlers for keymap lookups
Keep in sync with 2.8x
2018-05-25 10:51:05 +02:00
e31b8303ed UI: fix assert
Replace hard-coded button size check with UI_UNIT_X.

Caused icon-only buttons to have strings assigned based on UI-scale.
2018-05-25 10:45:48 +02:00
230943be2d Fix 3D Cursor w/ interface scale 2018-05-25 10:07:28 +02:00
ef22d2e8ad Merge branch 'master' into blender2.8 2018-05-25 10:04:25 +02:00
d02335a195 3D View: add pixelsize function w/o UI scale 2018-05-25 10:00:51 +02:00
2a6e4f7157 Cleanup: style 2018-05-25 09:45:04 +02:00
a79252d8c7 Keymap: use Ctrl-Shift-Space for fullscreen area
Closer to Shift-Space, less awkward to access.
2018-05-25 09:20:37 +02:00
f04cadd83e UI: Move Split into Mesh Menu
This doesn't just apply to faces.
2018-05-25 08:31:26 +02:00
bc9b202e65 Fix split only checking selected faces 2018-05-25 08:31:26 +02:00
51b2622814 UI: move copy/paste into the object menu
We already have per mode copy/paste in mode specific menus.
2018-05-25 08:20:19 +02:00
b611cecf4e UI: Specials menu update
- Name "Context Menu".
- Make it more context sensitive.
- Remove some more obscure items.

Patch from @billreynish
2018-05-25 08:20:19 +02:00
1be4eba27b Fix crash when entering the curve edit mode. 2018-05-24 19:22:35 -03:00
a0dbaf1d9d ED_transform_snap_object: remove unused bmain parameter in context creation. 2018-05-24 19:09:01 -03:00
302fea6b61 Change defaults
- Vertex/Edge Slide: Correct UV's = ON
- Extrude Along Normals: Even Thickness = ON
- Laplacian Smooth: Lambda Factor = 1.0
- UV/Image Editor: Normalized Coordinates = ON
- Render Image: Dithering = 1
- Image Sequence Auto Refresh = ON

See T54943
2018-05-24 21:33:39 +02:00
5e1021f78f 3D View: remove temporary edge-select hack
This caused a glitch with COW, where forcing edge selection
caused the evaluated scene to enable this afterwards.

Now pass the selection mode as an argument to the draw function.
2018-05-24 20:38:17 +02:00
c72b576aab Fix crash with snap and project to self.
Apparently the original `edit_btmesh` is being freed and the new one has to be referenced
2018-05-24 15:35:20 -03:00
357199375b Correct own last commit 2018-05-24 19:36:38 +02:00
5a431be629 Multi-Object-Editing: MESH_OT_shortest_path_select
Note from revisor: Edit the error message to match the original one.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3351
2018-05-24 19:34:22 +02:00
d209fa6e35 Fix T55184: Edge-loop select fails w/ vert/face modes 2018-05-24 19:31:07 +02:00
0983d97ab9 Fix T55186: Circle and Lasso select were not working on Pose Bones
These needed to be using the COW evaluated data, instead of the raw bone
positions.

All other datatypes still need converting to work with this though.
2018-05-24 19:13:15 +02:00
5e2f9c5c67 Cycles: Cleanup: Remove duplicated atan2f definition for OpenCL
Turns out that atan2f was already defined for OpenCL.
2018-05-24 19:08:06 +02:00
5db7f2c1ee Flatty Light
Add new Status Bar settings and minor tweaks to axis colors inspired by Andy's changes to the theme.
2018-05-24 18:50:02 +02:00
b4a8b81399 Cycles Denoising: Don't use atomics in the accumulation kernel on CPUs
The GPU kernel needs to use atomics for accumulation since all offsets are processed in
parallel, but on CPUs that's not the case, so we can disable them there for a considerable speedup.
2018-05-24 18:44:56 +02:00
b04b933acf UI: use icons in render menu 2018-05-24 18:43:16 +02:00
bef08e63d7 Keymap: remove Ctrl-Up/Down to toggle full-area
This is already accessible via Shift-Space which can be accessed
easily with one hand.
2018-05-24 18:39:05 +02:00
0864a4c1ea Always get a reference point when snapping with the projected elements option enabled. 2018-05-24 13:37:48 -03:00
8ea4539542 UI: View menu area operators now in submenu 2018-05-24 18:35:19 +02:00
f7c75e8bd7 COW Fix: Border selecting bones on rigs broke
Annoyingly, this was working as recently as yesterday...
2018-05-24 18:17:52 +02:00
12b261be41 UI: disable view context w/ OpenGL anim render
The 3D view menu can GL render from a single view
2018-05-24 18:16:06 +02:00
1cf17b257d UI: remove render panel, move operators to menu 2018-05-24 18:10:57 +02:00
132cda3925 Revert "UI: remove 'Render' top level menu"
This reverts commit 10e43c0aef.

After discussion, it's useful to have render menu
for more obscure render options.
2018-05-24 18:10:57 +02:00
7a88a7742b Drivers UI (Part of T55145) - WIP first steps towards getting a floating driver settings panel
This commit adds a new menu entry - "Edit Driver" - the RMB menu that
will show a popover panel displaying the settings for the driver you
activated the menu item on. This shows the popover panel defined in
yesterday's commit (GRAPH_PT_drivers_popover).

It is possible to edit the driver settings from this panel now.
However, do be warned that the functionality presented is highly
WIP still. There are some unresolved issues, such as:
 - The popover disappears too easily on any mouse movements/clicks
   on anything, making the panel less useful right now than it should.

 - The layout still needs refining. Currently the layout that's there
   is a bit of a placeholder until we can play around with it a bit
   more to see/feel what feels good/right or what is too much.

 - The "Open Drivers Editor" on the bottom of the panel doesn't work.
   There are some tricky context tricky things that need to happen here
   to make that case work, since the operator button won't have the necessary
   context info.
2018-05-24 18:10:21 +02:00
b2ee8e1cba Fix typo in editmesh edge delete 2018-05-24 17:49:44 +02:00
72f4bdf604 UI: add top-level 'Edit' menu
Use this for undo/redo, copy/paste & preferences.
2018-05-24 16:48:28 +02:00
6862762685 Cycles/Compositor: Add arctan2 operation to the Math node
The Math node currently has the normal atan() function, but for
actual angles this is fairly useless without additional nodes to handle the signs.

Since the node has two inputs anyways, it only makes sense to add an arctan2 option.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3430
2018-05-24 16:46:02 +02:00
d638ad3b20 Merge branch 'master' into blender2.8 2018-05-24 16:44:26 +02:00
5505ba8d47 Cycles/Eevee: Implement disk and ellipse shapes for area lamps
The implementation is pretty straightforward.

In Cycles, sampling the shapes is currently done w.r.t. area instead of solid angle.

There is a paper on solid angle sampling for disks [1], but the described algorithm is based on
simply sampling the enclosing square and rejecting samples outside of the disk, which is not exactly
great for Cycles' RNG (we'd need to setup a LCG for the repeated sampling) and for GPU divergence.

Even worse, the algorithm is only defined for disks. For ellipses, the basic idea still works, but a
way to analytically calculate the solid angle is required. This is technically possible [2], but the
calculation is extremely complex and still requires a lookup table for the Heuman Lambda function.

Therefore, I've decided to not implement that for now, we could still look into it later on.

In Eevee, the code uses the existing ltc_evaluate_disk to implement the lighting calculations.

[1]: "Solid Angle Sampling of Disk and Cylinder Lights"
[2]: "Analytical solution for the solid angle subtended at any point by an ellipse via a point source radiation vector potential"

Reviewers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D3171
2018-05-24 16:43:47 +02:00
Dalai Felinto
e8c8ff4f86 Fix all modifiers that depended on BKE_modifier_get_evaluated_mesh_from_object
This fix applying the following modifiers:
* Boolean (working already)
* Array
* Mesh Deform
* Surface Deform
* Vertex Weight Proximity

This function was to return evaluated mesh. So it should get the evaluated
object at all times. So in this case it makes more sense to simply pass the
depsgraph (or in this case the ModifierEvalContext that contains both the
depsgraph and the flag.

Solution discussed with Bastien Montagne.
2018-05-24 16:43:21 +02:00
8d9faf840b 3D View: remove poll 3D view for copy/paste
These operators only need selected objects.
2018-05-24 16:40:33 +02:00
10e43c0aef UI: remove 'Render' top level menu
- Toggle render window is in the window menu.
- OpenGL render settings in the 3D View menu.
- Playback animation in the render panel.
2018-05-24 16:20:56 +02:00
58fadb379a Correct last commit 2018-05-24 16:09:20 +02:00
ad9278fdad UI: re-arrange 3D view menus
- Adjusted order and names for better consistency.
- Group add/edit/delete into menu sections.
- Move UV/Vertex color into 'Face Data' menu, matching 'Edge Data'.
- De-duplicate items between vertex/edge/face menu.
- Remove undo/redo menu (to be moved into 'Edit' menu).
- Remove Auto-Merge & Proportional Editing
  (already available from the 3D view).

Patch from @billreynish w/ edits
2018-05-24 16:00:11 +02:00
Dalai Felinto
ec809d0cbf Fix boolean modifier when objects have transformations
Follow up for 9406a1f195.
2018-05-24 15:56:50 +02:00
44bab06960 Fix: Name of selected object/bone + current frame in 3D view didn't take region overlap (for headers-on-bottom) into account 2018-05-24 15:43:46 +02:00
Dalai Felinto
9406a1f195 Fix cannot apply boolean modifier 2018-05-24 15:26:31 +02:00
d64fbe9456 Partial Fix for T55165: Camera manipulator was not updating when the focal length ("lens") parameter was changed directly 2018-05-24 15:26:19 +02:00
0d768cca65 Fix T55177: pose-mode manipulator placement w/ COW 2018-05-24 15:22:15 +02:00
40dfb3eed6 Oops... should rebuild before committing 2018-05-24 15:10:12 +02:00
72039cd7cc Multi Pose: Selecting a bone in one armature doesn't deselect bones in the other armatures
This was actually due to missing COW flushing of pose data on the "other"
objects (only the active object was getting tagged for updates).
2018-05-24 15:05:17 +02:00
c788bd0211 Fix: Several pose select operators were not in fact working with COW
The following operators are fixed in this commit
* POSE_OT_select_linked
* POSE_OT_select_grouped
* POSE_OT_select_mirror
2018-05-24 15:05:17 +02:00
fe820eba92 Cleanup: Some minor tweaks to code 2018-05-24 15:05:17 +02:00
dfb959b6c3 Fix missing ID pointers expansion for ID itself in readfile code.
Was breaking static override chaining (static override of a linked
datablock that is already a static override in it original lib file).

Dummy mistake, thanks to @dfelinto for finding the bug.
2018-05-24 14:56:39 +02:00
b4106ed170 Fix T55175: outliner "Show Active" not working. 2018-05-24 14:48:23 +02:00
39aea50155 Fix T55178: Cursor fails to restore on cancel
574c0fe38f caused complications
restoring the cursor.

Use WM_cursor_modal_set/restore which is intended for operator use,
calling ED_region_cursor_set after an operator runs isn't reliable.
2018-05-24 14:23:32 +02:00
Dalai Felinto
c1361d2651 Depsgraph: tag depsgraph for copy-on-write flush when RNA changes
Fixes bug with changes to properties not being flushed to the COW data.
It fixes T55144.

This is the part of rBb4b745b72064 that is required although slow.
Which was partially addressed but the rest of the commit, which in
turn broke things. So for now let's get RNA to flush slow cow, and
deal with the consequences.
2018-05-24 12:17:55 +02:00
cb3c9cba49 Fix T55171: crash with undo and linked collections.
Collections created in library file versioning need to be set as coming
from the library, otherwise they get freed on undo.
2018-05-24 12:02:56 +02:00
8766ab7526 Fix Lamps, Empties, Cameras and Speakers not using theme colors 2018-05-24 12:01:25 +02:00
b2a2983d14 Slightly smaller triangle collapse icon on panels 2018-05-24 11:23:00 +02:00
70a3b7e70c Fix T55170 and T55167: Crash adding new curve
We do the same solution as we have for mesh_evaluated.
2018-05-24 10:38:39 +02:00
Julian Eisel
2d05f91bea UI: Add theming support for the status-bar
For now not bumping subversion, even though I technically should. We can do if
needed, but would like to avoid bumping it every few days...
2018-05-24 10:26:22 +02:00
3820237ddb Workbench: in editmode the toggle xray option will be disabled
Z-Key was already taken by show hidden wires
2018-05-24 10:23:03 +02:00
7762522ecd Workbench: define to enable/disable revealage buffer. 2018-05-24 09:28:29 +02:00
e561eef3ff Workbench: Revealage buffer 2018-05-24 09:28:29 +02:00
a709e8d6bb Correct last commit 2018-05-24 09:27:13 +02:00
5df8a6eb94 Correct fix for view center
The view layers active object was not being copied.
2018-05-24 09:08:36 +02:00
153c7746ab Revert "Fix COW view center for pose mode"
This reverts commit 485990e4aa.
2018-05-24 09:08:36 +02:00
d7824de8e4 Merge branch 'master' into blender2.8 2018-05-24 09:03:07 +02:00
1318660b04 Fix T55034: Setting duplication group for multiple selected items only
affects one item

UI editing multiple selected items missed the case of PROP_POINTER
properties

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3373
2018-05-24 09:02:17 +02:00
569a5e0d7c Merge branch 'master' into blender2.8 2018-05-24 08:48:40 +02:00
3e9b592b08 Fix Extend property of Lasso select tool in Mask editor not working
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3361
2018-05-24 08:41:13 +02:00
54f2e58452 Fix T54336: Extend property of Lasso select tool in Node editor does not
work

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3360
2018-05-24 08:34:31 +02:00
5ee965eea5 Merge branch 'master' into blender2.8 2018-05-24 08:27:01 +02:00
d78894eb3e Fix T54336: Extend property of Lasso select tool in Node editor does not
work
2018-05-24 08:21:13 +02:00
176e18436c Fix T55137: Compilation failing on non-x86-64 architectures
Some conversion helper functions were (most likely by accident) contained
inside an ifdef for SSE2 support, so on e.g. ARM they would be undefined
and therefore cause compilation to fail.
2018-05-24 01:41:18 +02:00
Julian Eisel
6f20fcd598 UI: Global "Status-bar" Area (WIP)
* Add horizontal bar at bottom of all non-temp windows, similar to the Top-bar.
* Status-bar is hidden in UI-less fullscreen mode
* Current contents are preliminary and based on T54861:
** Left: Current file-path if needed. "(Modified)" note if file was changed.
** Center: Scene statistics (like in 2.7 Info Editor).
** Right: Progress-bars and reports
* Internally managed as own "STATUSBAR" editor-type (hidden in UI).
* Like with the Top-bar, Status-bar data and SDNA writing is disabled.
* Most changes in low-level screen/area code are to support layout bounds that differ from window bounds.

Design task: T54861
Main changes approved by @brecht.
2018-05-23 22:38:25 +02:00
7b58073dc0 Fix INFO_MT_surface_add
It was a copy of `INFO_MT_curve_add` (I'm sure it was not intentional).
2018-05-23 17:27:10 -03:00
67598d39b4 Revert "Depsgraph: refresh RNA that doesn't need a full rebuild"
This reverts commit b4b745b720.

This was causing a problem in 01_025_A.anim.blend from the Spring
production files, where selecting one of Autumn's bones would
result in character jumping back to the origin.
2018-05-23 20:30:17 +02:00
6955add502 Fix T55166: crash joining areas
Caused by own commit 6e40b2de7a,

Tested w/o this call and can't find any errors so commenting the call.
2018-05-23 20:25:55 +02:00
Dalai Felinto
401e975c61 Fix curve not updating when scaling Bevel Object
Note the relationship we need is from the geometry/object to the curve data,
not the curve object.

Related to T55167, though when copy-on-write is enabled, we still get a crash.
2018-05-23 20:05:17 +02:00
933a083587 UI: popup panel operator, as we have for menus 2018-05-23 19:48:28 +02:00
b642b510e1 Fix T55168: missing updates when switching particle system type. 2018-05-23 18:59:26 +02:00
b6725d3cbf Fix wrong object user count on duplicate. 2018-05-23 18:53:37 +02:00
e2a827c848 Fix crash loading without UI, after recent changes. 2018-05-23 18:32:04 +02:00
3fb38d664b Fix T55163: visibility not updated for instanced collections. 2018-05-23 18:32:04 +02:00
342d94c375 Fix compiler error: Stupid const vs non const 2018-05-23 18:29:52 +02:00
7e7680e33b Drivers UI (Part of T55145) - WIP work to prepare a panel we can shove into a popover
HINT: It's called GRAPH_PT_drivers_popover right now
2018-05-23 18:18:58 +02:00
84c3b175f6 Fix typo in header 2018-05-23 17:13:41 +02:00
485990e4aa Fix COW view center for pose mode 2018-05-23 16:45:07 +02:00
0cc2666605 Fix last usages of Scene.r.cfra in modifiers code.
Note that some modifiers-related code in BKE still uses that...
2018-05-23 16:37:36 +02:00
9cb2b9b523 Drivers UI (Part of T55145) - Show datablock that driven property belongs to instead of only the property
Otherwise, it's not clear where things are coming from.

FIXME: The icons for datablocks may not always be correct. It uses the
innermost struct's icon instead of the datablock's icon - e.g. Bone
vs Object/Armature. But, that may make more sense for users?
2018-05-23 16:32:46 +02:00
d185f5be09 Drivers UI (Part of T55145) - Refactor existing UI code to allow it to be reused
The idea is that we may be able to just take this code and put it into a
new popover panel that gets displayed when called from the UI. This should
at least work well for a first pass test of what we want this UI to look like.
2018-05-23 16:32:46 +02:00
d1e8d8f40f Drivers UI: Add the "Update Dependencies" logic into the callbacks that should be run on every button press
In theory, this should mean that we can get rid of the "Update Dependencies"
button. In practice, there may still be cases where it's still needed
(as somehow, it did end up being needed in the past, even though the RNA
calls should in theory be doing everything needed already).
2018-05-23 16:32:46 +02:00
a3ad55b346 Drivers UI: Get rid of dedicated button to remove active driver
There are multiple other ways to do it. Leaving this here just made it
easy (and dangerous) to accidentally remove the driver, and was causing
other problems with other layouts.
2018-05-23 16:32:46 +02:00
57b47ebb28 Drivers UI Cleanup (Part of T55145)
* Remove "Show Debug Info" option. Everyone has it turned on all the time,
  since it's just useful to have
* Make the "Remove Driver" button less prominent. It doesn't happen that much,
  so it shouldn't take up as much room
* Make "expressions" textbox wider (i.e. taking up the whole column width)
  by separating the label and textbox on separate lines.
* Rename "Add Variable" button to make it clearer to users what "variables"
  may be (i.e. they serve as a way to specify Inputs, just like adding a
  "Source Data" node in a nodetree)
* Regroup buttons
2018-05-23 16:32:46 +02:00
83ed0df1c2 Cleanup: Remove unused code 2018-05-23 16:32:46 +02:00
Dalai Felinto
ccabb26082 OpenGL: documentation for the builtin GPU shaders
This is intended to help developers to know how and when to use each shader.
There are plenty of undocumented shaders, but it's a matter of filling them in.

The script I used to quickly find the related shaders for a const is: P700

Original patch: D2318
2018-05-23 16:02:53 +02:00
4a2213dc9a Fix modifiers not using depsgraph time for texture evaluation.
Texture animation seems to be broken anyway currently, but at leat
modifier side it should now be OK.
2018-05-23 15:55:13 +02:00
a455e35343 UI: move vertex/edge/face into header
These are frequently accessed,
so use the newly freed space to make them more prominent.
2018-05-23 15:41:04 +02:00
Dalai Felinto
1ecfe42d37 Remove DEG_TAG_COPY_ON_WRITE tag on rna update for scene.render
This is no longer needed since rBb4b745b72064.
2018-05-23 15:34:48 +02:00
b4b745b720 Depsgraph: refresh RNA that doesn't need a full rebuild
Fixes bug with changes to properties not being flushed to the COW data.
2018-05-23 15:26:50 +02:00
6afccf6348 Workbench: Checkboard pattern for supporting objects 2018-05-23 15:22:51 +02:00
1c572b7412 Fix T55161: outliner Blender File with filter showing irrelevant libraries. 2018-05-23 14:43:24 +02:00
c44ccbc518 Cleanup: fix some weak assumptions in bone renaming code. 2018-05-23 14:23:29 +02:00
e71b12048c WM: add back Ctrl-Space to toggle full area 2018-05-23 14:11:39 +02:00
b4b569feeb Cleanup: rename idname -> name
This isn't for ID's
2018-05-23 14:11:39 +02:00
c0ac479134 Cleanup: shadow variable warning 2018-05-23 14:11:39 +02:00
7c5e174871 Fix T55160: crash renaming view layer. 2018-05-23 13:52:51 +02:00
37b947c7ef Cleanup: remove debug print. 2018-05-23 13:30:36 +02:00
07dee0f79c Fix missing autosmooth in Cycles after copy-on-write changes. 2018-05-23 13:25:06 +02:00
b20449cc08 Cycles/Render API: changes for better copy-on-write support.
Mainly just passing the depsgraph and evaluated scene and camera, instead of
the original one. Patch by Sergey, further modifications by Brecht.
2018-05-23 13:21:02 +02:00
d59b74adb3 Fix T53481: Linked scene crashes on load 2018-05-23 12:51:48 +02:00
858e8f453d Workbench: When in see through mode, only render depth of active object
in EDIT MODE
2018-05-23 12:30:42 +02:00
Julian Eisel
909d548d56 Fix T55072: Top bar disappears when loading factory settings (causing ASAN crash) 2018-05-23 12:06:38 +02:00
5667822876 Cycles: convert pointdensity from DerivedMesh to COW Mesh.
Fixes hang in regression tests.
2018-05-23 11:28:26 +02:00
8dc564096f Workbench: Renamed Object Outline to Outline.
So it fits in the pop-over
2018-05-23 10:57:50 +02:00
8d92873230 Workbench: See through
Unmultiplied the final color during compositing. Same as the revealage
buffer would do
Also use the DRW_STATE_ADDITION_FULL as it is aware of premultiplied
colors
2018-05-23 10:54:22 +02:00
e92baab348 Merge branch 'master' into blender2.8 2018-05-23 10:51:11 +02:00
d886e32270 Cleanup: strip trailing space from interface files 2018-05-23 10:48:50 +02:00
37b5c52f11 Workspace: remove deprecated view layer
Was removed in 2.80.4, this was not default and unsupported for linking.
2018-05-23 09:37:33 +02:00
8ac8ef8ec7 Workbench: Studiolights merge error? 2018-05-23 08:55:14 +02:00
44f78c95be Cleanup: move toolsystem into own include
Many files using the window manager don't access the tool-system.

This avoids rebuilding many files when the tool-system changes.
2018-05-23 08:23:16 +02:00
f5f66d4901 Workbench: Fixed Memory Leak 2018-05-23 08:20:25 +02:00
17aef80207 Multi-Object-Mode: EditCurve Subdivide
D3382 by @dgriffin91
2018-05-23 07:41:58 +02:00
647232f7f1 Multi-Object-Mode: EditCurve Select Linked
D3409 by @dgriffin91
2018-05-23 07:34:10 +02:00
504cbc1954 Merge branch 'master' into blender2.8 2018-05-23 07:30:50 +02:00
103a31f712 Fix incorrect size in aligned lockfree realloc
Thanks to @alikendarfen for finding.
2018-05-23 07:24:57 +02:00
062ee07b7f Fix some Cycles modifier stack issues with copy-on-write.
There's still many problems, but this avoids modifiers being applied twice,
subsurf render levels not being respected and hair render crashing.
2018-05-22 20:01:15 +02:00
78a26f28aa Fix own error using handler after freeing
Was introduced in e7895bac07
Only certain actions caused this, reported as T55155
2018-05-22 19:35:48 +02:00
e6c27b4dab Fix T55071: Brush preview fails 2018-05-22 19:23:06 +02:00
8aebcf8b7d Fix crash in modifier stack after recent changes. 2018-05-22 19:10:30 +02:00
2fb9a50a4f Fix T55146: hair + subsurf modifier not positioning hair correctly.
ORIGSPACE data was not being preserved correctly through subsurf.
2018-05-22 18:43:20 +02:00
c080c096ce Fix crash when HDR images are missing 2018-05-22 18:36:36 +02:00
6e8d4bcd01 Fix T55153: missing updates when changing simplify settings.
This line should not have been removed.
2018-05-22 18:17:28 +02:00
3ada840e65 blenderplayer: add stubs 2018-05-22 17:56:56 +02:00
3c44c67e96 Removed no-longer-required workaround for doubly-deformed meshes 2018-05-22 17:38:27 +02:00
66d18d93c4 Merge branch 'master' into blender2.8 2018-05-22 17:24:32 +02:00
76ece90d4a Fix T55093: Bisect + fill crash 2018-05-22 17:23:25 +02:00
f5d911f8b0 Modifiers: ported Cloth DerivedMesh → Mesh
The modifier is still quite slow; this could be due to caches being written
to a CoW datablock instead of the original one. More investigation is
needed.
2018-05-22 17:11:30 +02:00
e89fa4c85b Cloth Modifier: get time from depsgraph instead of scene 2018-05-22 17:08:57 +02:00
6953c57d2c Fix T55149: missing mesh custom data after modifier stack, after recent changes. 2018-05-22 17:07:59 +02:00
1b164cf81e Workbench: SeeThrough
added a fresnel effect

TODO: solve memory leak
2018-05-22 16:59:43 +02:00
8644eef5c3 COw operators: Fix VIEW3D_OT_snap_selected_to_grid 2018-05-22 16:44:34 +02:00
397665dea3 Fix: Deselecting bones using box select didn't work
Logic here was a bit broken.
1) We need to send updates even when deselecting bones, not only when we
   actually end up select then.
2) Also, when bones are locked for "selectability", they should not be able
   to be deselected.
2018-05-22 16:44:13 +02:00
6573af5211 Drivers Editor UI Tweaks (Part of T55145)
To bring the UI more in line with the proposed design in T54653 for the "Add Drivers"
popup panel (NOTE: this is separate from the "Drivers Editor", in previous commit!),
this commit adds a new panel - "Driven Property" to the Drivers Editor UI.

This basically duplicates the "Active F-Curve" panel (with less options)
to make it easier to see at a glance which property the Drivers Editor is
showing you.
2018-05-22 16:44:13 +02:00
c685c19df9 Drivers UI (Part of T55145): Add "Show Drivers Editor" entry to RMB menus
This commit adds an operator, "Show Drivers Editor", to the RMB menu when
clicking on properties.

As per T54653, this will open a new Graph Editor instance in a new/separate
window (much like how the User Preferences show up in a popup window now),
and will configure all the relevant panels so that you can see and edit the
driver settings immediately without doing a lot of the view configuration steps
that were previously needed.

When doing so on a property that is driven, the driver/fcurve for that property
will be made active in the editor, ready for you to start editing its settings
without having to hunt it down again first.
2018-05-22 16:44:13 +02:00
6f127b22e6 UI Tweak: Make User Preferences window slightly taller, to better fit the contents 2018-05-22 16:44:13 +02:00
6781fac42e Cleanup: warning 2018-05-22 16:12:41 +02:00
ab19609233 Fix T55069: 3D widget misses pivot-point refresh 2018-05-22 16:11:39 +02:00
53d1ec95ea Fix outliner incomplete collections right click menu in Blender File. 2018-05-22 15:49:50 +02:00
96a7ed8a15 Tool System: store operator properties in the tool
This replaces last-used property use which wasn't reliable since
properties were not considered 'set' - causing them to be ignored.
2018-05-22 15:31:06 +02:00
298f8042ef Cleanup: warning 2018-05-22 15:31:06 +02:00
cc9513d944 Fix outliner crashes when dragging elements in some cases.
Avoid rebuilding outliner tree in more cases, also helps performance.
2018-05-22 15:09:21 +02:00
d97471ddf7 Workbench: Fixed memory leak
ImBuf radiance buffers were freed incorrectly
2018-05-22 15:05:11 +02:00
dfe088c5d9 Workbench: SeeThrough draw option
Option to see through all meshes (transparency)

Works for OB_SOLID and OB_TEXTURED. Does not work for
V3D_SHADING_SHADOW.

TODO: Fresnel effect
2018-05-22 14:55:50 +02:00
ff19b527e8 Workbench: Calculate irradiance using radiance buffers 2018-05-22 14:55:50 +02:00
c7df618263 3D Cursor: Clip if behind near plane. 2018-05-22 14:33:07 +02:00
bc46034752 Cleanup: fix compiler warnings. 2018-05-22 14:17:52 +02:00
0d2aa1a7bb Cleanup: make group/collection versioning a bit more clear. 2018-05-22 14:17:51 +02:00
f99197fb2d Transform: Support mixed snap in 3d View.
Allows more than one snap mode to be enabled. So different combinations are possible.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: Christopher_Anderssarian, duarteframos

Tags: #bf_blender_2.8

Differential Revision: D3400
2018-05-22 08:58:56 -03:00
47b9d7494e Experimental Armature Drawing Tweak for Relationship Lines
Only show hierarchy relationship lines when bone or its parent is selected.
This cuts down the clutter visible in general when relationship lines are
enabled (currently they can't be disabled), which should make it more useful
to keep them on (e.g. constraint lines/hints can still be drawn this way).
2018-05-22 13:39:01 +02:00
e12df10120 COW Operators: Fix VIEW3D_OT_snap_cursor_to _active _selected _center and _grid
Reviewers: sergey, aligorith

Differential Revision: https://developer.blender.org/D3414
2018-05-22 12:20:59 +02:00
7f714fdbb2 Depsgraph: Enable copy on write by default
As was decided at today's dev kickoff, we're now moving to having
Copy-on-Write enabled by default, as 2.8 is barely functional with
it off.

To run Blender *without* COW (e.g. for testing), use:
--disable-copy-on-write
2018-05-22 12:00:23 +02:00
9fc5a0c95e Fix area tool getting out of sync w/ active tool 2018-05-22 09:41:41 +02:00
0c1676f388 WM: call keymap callback from manipulators
Not currently needed, add to avoid confusion later on.
2018-05-22 09:27:02 +02:00
6974afba82 WM: use keymap poll for manipulators 2018-05-22 09:22:20 +02:00
bb45381bc2 Merge branch 'master' into blender2.8 2018-05-22 08:49:24 +02:00
28c20fc393 Memory allocator: use lockfree calls internally
Was already used in some areas.
2018-05-22 08:45:47 +02:00
4e14437cb0 Multi-Object-Mode: EditCurve Select Random
D3405 by @dgriffin91
2018-05-22 08:25:05 +02:00
c7903f17a2 Fix memory leak in armature delete 2018-05-22 08:20:19 +02:00
ee1327a84c Multi-Object-Mode: EditLattice Select All
D3164 by @ranjian0
2018-05-22 08:11:13 +02:00
99f994e7ed Fix crash drawing edit-lattice
Edit-mode was never using batch cache.
2018-05-22 08:10:36 +02:00
17778ddeb7 Cleanup: naming
Use 'ob' prefix for objects, 'eval' suffix for evaluated data.
2018-05-22 07:48:12 +02:00
ac476375b1 Cleanup: style, whitespace 2018-05-22 07:39:16 +02:00
67cf4cb5ec Cleanup: replace MEM_SAFE_FREE -> MEM_freeN
No need to check for NULL in this case.
2018-05-22 07:28:14 +02:00
feabab6a9e Fix compilation with ndof code. 2018-05-21 21:18:12 +02:00
612364181a Static Override: Fix drivers' ID target overridability.
You need the whole chain of pointers... This was breaking static
overrides of any rig basically.

Note that this kills performances again (adding several hundreds of
thousands more stuff on a blendrig...), need a better way to handle RNA
override walking.
2018-05-21 21:14:54 +02:00
161ab6109e COW Operators: Fix VIEW3D_OT_ rotate move zoom dolly orbit roll pan smoothview and the ndof versions
Fixes camera view locking, camera related transitions and movements with the active object as pivot point
Note there can still be problems if the active object is not selectable
2018-05-21 20:33:12 +02:00
9f66d00287 CMake: only include licences for enabled libs 2018-05-21 18:41:59 +02:00
13d2df32c7 Fix broken draw code from last Thursday commit.
Seriously... Not all edges have faces!!!!!!!!

Quick fix to make it possible to load/use customshaped bones again, not
100% sure it is correct, but... At least it does not crash anymore!
2018-05-21 18:00:50 +02:00
f0fda91a55 Merge branch 'master' into blender2.8 2018-05-21 17:27:38 +02:00
20bafbd550 Cleanup: unused vars 2018-05-21 17:27:21 +02:00
605e184167 Cleanup: use const for transform internal API 2018-05-21 17:24:14 +02:00
08ba057eef Fix misuse of the use_occlusion_test parameter. 2018-05-21 11:17:19 -03:00
f14e4510ac Transform Snap: Fix normal in the wrong space. 2018-05-21 11:05:34 -03:00
575437ac90 3D View: fix scale of 3D cursor crosshair
Interface scale was applied twice.
2018-05-21 14:51:10 +02:00
fbe73d1f31 UI: fix error for tools w/o a keymap 2018-05-21 13:08:44 +02:00
3b1b625ead UI: use spacebar for toolbar
- This allows quick, consistent toolbar access
  w/o conflicting w/ the keymap.
  Where pressing space before a key activates that operator as a tool
  instead of running immediately.
- Search can still be accessed by pressing spacebar again.
- When there is no toolbar for a space, operator search still opens.
2018-05-21 12:46:26 +02:00
3102821c9c Revert "Fix/workaround RNA build error in C++ API."
This reverts commit 9f2ae547c0.

Args were reordered.
2018-05-21 12:38:52 +02:00
bdc3335016 Merge branch 'master' into blender2.8 2018-05-21 12:37:54 +02:00
882daeffc5 RNA: support for PARM_OUTPUT & PARM_RNAPTR 2018-05-21 12:34:11 +02:00
21777533fb Merge branch 'master' into blender2.8 2018-05-21 12:26:36 +02:00
6d8aa85051 Fix too much memory usage for Cycles attribute map.
Thanks to Thomas Krebs for identifying the problem and solution.
2018-05-21 11:14:59 +02:00
9f2ae547c0 Fix/workaround RNA build error in C++ API.
It seems output parameter needs to be the last one.
2018-05-21 11:13:56 +02:00
0e9605f44d Merge branch 'master' into blender2.8 2018-05-21 10:54:51 +02:00
4198c18f15 Cleanup: correct variable names 2018-05-21 10:53:50 +02:00
698dbd6500 UI: generate dynamic keymap for popup toolbar
Set keys for tools based on the current keymap.

This keeps consistency between tools immediate execution.
2018-05-21 10:46:27 +02:00
351c6d4346 Merge branch 'master' into blender2.8 2018-05-21 10:40:09 +02:00
12a60265cd WM: utility to find a keymap item from an operator
Also RNA access to WM_keyconfig_update,
needed when generating dynamic keymaps used in menus immediately after.
2018-05-21 10:35:44 +02:00
94fd828d75 Error in last commit 2018-05-21 08:22:08 +02:00
768a152883 UI: proof of concept keymap for the popup toolbar 2018-05-20 22:39:19 +02:00
e7895bac07 UI: support for custom keymaps for popovers 2018-05-20 22:39:14 +02:00
46514cf865 COW Operators: Fix VIEW3D_OT_view_all and camera mode of VIEW3D_OT_viewnumpad
Reviewers: sergey, aligorith

Maniphest Tasks: T54829

Differential Revision: https://developer.blender.org/D3314
2018-05-20 20:05:26 +02:00
8e0953eb49 COW Operators: Fix VIEW3D_OT_view_lock_to_active
Reviewers: aligorith, sergey

Maniphest Tasks: T54829

Differential Revision: https://developer.blender.org/D3365
2018-05-20 19:48:58 +02:00
d3def53be5 Workbench: Shadow: Add support for completly manifold geom.
If a mesh is known to be manifold, then it's not necessary to increment the
stencil buffer 2 times anymore. But we still need to account properly for
degenerate triangles.

In this case, only generate a quad if the tri is facing the lamp. If there
is a degenerate loop, the other edge will either cancel the increment (if
it is also facing the light) or not produce a quad (if not facing).

This will always give the correct count.
2018-05-20 19:17:11 +02:00
4bbb1d4e5e DRW: Rename some DRW_STATE_* for more consistency. 2018-05-20 19:17:11 +02:00
7a28dea1e1 Workbench: Shadow: Add Depth Fail method
Also add new debug visualisation.

Depth fail method is not used for the moment but has nice benefits. It will
be used efficiently in the future.
2018-05-20 19:14:22 +02:00
2c6106247b Workbench: Precompute light direction in object space.
Avoid 2 matrix multiplication in the shader.
2018-05-20 19:14:22 +02:00
ef90d46700 Workbench: Shadow: Add geometry instancing extension.
This give a very slight perf boost. (2ms gain over 67ms total in my test)
2018-05-20 19:14:22 +02:00
24cc976d55 Workbench: Shadows: Fix corner case with degenerate triangles.
Seems that degenerate tris are somewhat widely used in modeling. So we need
to fix this. Test the edges in the geom shader since the adjacency info is
only dependant on topology, not actual vertex placement.

This fixes most of the remaining noise issues. Only a few artifacts appear
on really weird models. So if you want to get rid of the artifacts, fix
your model!
2018-05-20 19:14:22 +02:00
687f09a8ad Workbench: Optimize Shadows.
This makes the shadows ~10 times faster in the general case.

This only create extrusion geometry on the outline edges. Also we increment
or decrement the stencil buffer by 2 for each manifold edge and only by 1
for non manifold. This make the algorithm robust yet less heavy than creating
one prism for each triangles.
2018-05-20 19:14:22 +02:00
883cb58355 GWN: Add Line Adjacency primitive support. 2018-05-20 19:14:22 +02:00
4308602d6a Fix: crash when rotating the view in pose mode 2018-05-20 17:44:50 +02:00
8cb6ede2bf UI: locate popover w/ active item under cursor
Use when popover has no parent, useful for accessing the toolbar.
2018-05-20 09:58:46 +02:00
7959617fb6 Cleanup: line length 2018-05-20 09:04:18 +02:00
12eb29fe35 Cleanup: whitespace, duplicate includes 2018-05-20 08:52:56 +02:00
96a3a62861 Hacky Fix: Changing frames by setting Scene.frame_current directly didn't update rigs in 3D viewport
Operators did not suffer from this problem as they were still just using notifiers
directly. The "proper" fix is to use the new message bus system. But, we've
got enough problems dealing with COW already as it is now... moving on.
2018-05-19 20:18:45 +02:00
0492e56fec Fix: When trying to transform animated bones, they would jump to and use random old values
The transform code needed to use data from the "_eval" copy of the posebone
instead of the main-db version, otherwise the initial/reset value would be
wrong, causing the jumping.
2018-05-19 19:54:47 +02:00
aca892832a Add back temporary exception for pose bones in DEG_get_evaluated_rna_pointer()
Without the exception, adding new poses to pose libraries took several seconds
with only <= 4 bones selected. While we may still need this for other cases too,
since bones are such a common use case, it makes sense to provide some level
of optimisation for them.
2018-05-19 19:54:47 +02:00
006b8e6092 Cleanup: Remove temporary debugging code 2018-05-19 19:54:47 +02:00
4a0dea88bf WIP: Improved implementation of DEG_get_evaluated_rna_pointer()
This now works by getting the RNA Path from the given PointerRNA to go from the
ID block to the data it points to, then uses this path to find the new data
relative to the COW ID.

Note: This currently still has all the debug prints left in - As can be seen,
I was testing this against the earlier PoseBone hack/special case. We may still
need to bring such special cases back in future, since looking up RNA Paths
like this can be slow.
2018-05-19 19:54:47 +02:00
6ba28ff8b1 WIP COW Fix: Insert keyframe operators/api now queries depsgraph for evaluated data
When using copy on write, insert keyframe operators were reading from old
bmain data instead of COW data. This meant that inserting keyframes would
often read old/stale data, resulting in invalid keyframes getting created
(e.g. from last transform operation, instead of actual current state).

This commit makes it so that keyframing operators will ask depsgraph for
the evaluated copy of the data, so that it can read values from that. It
introduces a new function - `DEG_get_evaluated_rna_pointer()`, which when
working correctly/fully, should work just like the other `DEG_get_evaluated_*()`
functions, except it lets you pass in an RNA Pointer.

However, currently, this is only done for Pose Bones (as a dirty hack, since this
is an important/pivotal requirement for production) and/or datablock
properties directly (since we can just use the DEG_get_evaluated_id() directly).
on the datablock.

Committing to a branch for now as this all needs more testing. More work to come
later at a more sane time of day!
2018-05-19 19:54:47 +02:00
06737a8258 UI: popover-once (click-drag for single actions)
Experimental support for using popovers like menus,
use this when the user hold the mouse down
(previously this did nothing).

This means turning frequently accessed menu items into
popovers doesn't add more clicks to the existing use case.
2018-05-19 19:16:47 +02:00
e65643b9a3 Cleanup: style
No need to use text keyword arg for labels
2018-05-19 16:25:40 +02:00
7cbf5db248 UI: don't disable snap popover in topbar
Snap settings still apply when transforming (holding Ctrl)

Also no need to prevent proportional edit menu from opening,
showing inactive is enough.
2018-05-19 16:23:54 +02:00
d3c89f50a0 UI: Use popover for toolbar popup operator
- Currently the popup closes immediately, could be made configurable.
- Support exiting popups when their submenu's are accessed.
2018-05-19 10:25:52 +02:00
671797e22e Correct last commit 2018-05-18 23:14:56 +02:00
ddebf1ea3b UI: Add menu to show the toolbar
For people who prefer to keep the toolbar hidden,
expose as a menu (currently Shift-Space).
2018-05-18 22:28:59 +02:00
e785048ef3 Fix snap with occlusion. 2018-05-18 17:26:22 -03:00
4df99bd601 Ruler: Fix mixed snap. 2018-05-18 17:12:20 -03:00
a0b03d3fb2 Tool System: use classmethod for drawing
Allows the toolbar to be included in a popup.
2018-05-18 21:18:33 +02:00
e7d2a4718d Fix popover args when called from Python 2018-05-18 21:00:16 +02:00
1fd11dd3ba Cleanup: comments, use negate_mat3_m4 2018-05-18 19:56:34 +02:00
ffaf55be94 Cycles/Eevee tests: add compare.html to see difference between the engines. 2018-05-18 18:08:01 +02:00
de7635f607 Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get()
There are still probably other massive problems to solve (i.e. which copies
of data cache/sim gets written/read from for COW eval) that need to be solved
before we can get the sims actually running though.
2018-05-18 18:04:35 +02:00
30673ff325 Fix crash when collection view layer cannot be found 2018-05-18 17:56:17 +02:00
f9547ab313 Fix tools not being initialized on startup 2018-05-18 17:36:11 +02:00
c2d5411cbf Fix manipulator removal
The flag could be left set, removing the manipulator type again.
2018-05-18 17:36:11 +02:00
6a782ed767 Eevee: add regression tests.
This adds Eevee render tests using the Cycles files. Currently it must
be enabled by setting WITH_OPENGL_RENDER_TESTS=ON. Once we have reference
images we can enable it by default.

Some of the Cycles and Eevee tests are also currently broken due to
modifier and particle changes.

Differential Revision: https://developer.blender.org/D3182
2018-05-18 17:11:24 +02:00
00071d78bc Merge branch 'master' into blender2.8 2018-05-18 17:11:19 +02:00
29595334f0 COW Fix: POSE_OT_armature_apply (Apply Pose as Rest Pose) now works with COW 2018-05-18 17:07:46 +02:00
d712dd2f19 Cycles tests: move to render/ folder, to share with Eevee. 2018-05-18 16:46:48 +02:00
2d6bfb5b63 Transform: Improve the hierarchy in the choice of snapped elements in the mixed snap.
To snap to small edges in 3d_view is no longer obfuscated by vertices if then is also enabled.
2018-05-18 11:40:32 -03:00
a3070474e2 Clear the ParticleSettings pointer to prevent doubly-freeing it
Not happy with the approach, as it adds to nested_id_hack_discard_pointers(),
but at least it fixes a crash.
2018-05-18 16:29:16 +02:00
db2c966e2c Cleanup: remove unused function. 2018-05-18 10:55:51 -03:00
6776a55464 Fix crash rendering files with Python errors in background mode. 2018-05-18 15:50:08 +02:00
d7ba8611e2 Fix crash with shape keys and modifier stack, after recent changes. 2018-05-18 15:50:08 +02:00
6a64556ba1 Merge branch 'master' into blender2.8 2018-05-18 15:31:53 +02:00
47949fd764 Eevee: Codestyle fix. 2018-05-18 15:33:04 +02:00
83c2febaee Eevee: SSS: Fix compilation errors.
Fix T55114
2018-05-18 15:31:07 +02:00
e077285745 CMake: Add WITH_COMPILER_ASAN option
This supports easy toggling of Address Sanitizer.
2018-05-18 15:22:16 +02:00
4d19f24ba7 Cleanup: remove deprecated definitions 2018-05-18 15:22:16 +02:00
6e48afeb23 Merge branch 'master' into blender2.8 2018-05-18 14:59:38 +02:00
5e7a21a5f5 Fix T55115: crash when iterating SmokeDomainSettings color_grid property
through python
2018-05-18 14:34:27 +02:00
1cc4ab481e Fix crash drawing polygon curves 2018-05-18 14:23:53 +02:00
b167bc2f00 Merge branch 'master' into blender2.8 2018-05-18 13:45:48 +02:00
cb50c288d4 Add missing header 2018-05-18 13:43:41 +02:00
17bd5c9d4b Collections and groups unification
OVERVIEW

* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
  which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
  and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
  for each. For many workflows one view layer can be used, these are more of an
  advanced feature now.

OUTLINER

* The outliner now has a "View Layer" display mode instead of "Collections",
  which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
  These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
  can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
  text gives different results, we'll unify this later.

LINKING AND OVERRIDES

* Collections can now be linked into the scene without creating an instance,
  with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
  but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
  into collections with overrides directly in the scene.

PERFORMANCE

* We tried to make performance not worse than before and improve it in some
  cases. The main thing that's still a bit slower is multiple scenes, we have to
  change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
  updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
  lookups internally and in API functions like visible_get().

VERSIONING

* Compatibility with 2.7 files should be improved due to the new visibility
  controls. Of course users may not want to set up their scenes differently
  now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
  files. There's a few things which are know to be not quite compatible, like
  nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
  #ifdef so it can be removed at the end of the release cycle.

KNOWN ISSUES

* The G-key group operators in the 3D viewport were left mostly as is, they
  need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
  still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
  be done later, we'll have to see how important this is as all objects within
  the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.

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

https://code.blender.org/2018/05/collections-and-groups/
2018-05-18 13:34:24 +02:00
70aec3732d Fix crash running in background mode, after recent changes. 2018-05-18 13:23:14 +02:00
fbcdd07c98 Cleanup: move unneeded struct out of DNA.
The real reason is that there is a conflict between Carbon header defining
a "Collection" struct, and this works around it.
2018-05-18 12:58:24 +02:00
b6a2dbbec2 Tool System: set cursors for draw & transform 2018-05-18 11:57:56 +02:00
17852b079c Tool System: support for tool cursors 2018-05-18 11:44:28 +02:00
6e40b2de7a Fix operator execution resetting the cursor
Area and region are NULL in the context if the operator finishes.
2018-05-18 11:42:58 +02:00
1cf0930e89 Fix manipulator resetting the cursor 2018-05-18 11:42:37 +02:00
2451a1951e Merge branch 'master' into blender2.8 2018-05-18 11:02:39 +02:00
278e3f7d5f Logging: add --show-log-backtrace
Useful in debug builds to see a functions callers.
2018-05-18 11:00:47 +02:00
987d1df571 Tool System: store the active tool in ScrArea
Without this we need to have the context to get the
(space_type, mode) args for an active tool lookup.

For event handling & poll its more convenient to have direct access.
2018-05-18 09:40:52 +02:00
8faa594413 Cleanup: unused DNA 2018-05-18 08:14:36 +02:00
f7e7769260 Cleanup: use '_Runtime' suffix
Allows for more easily finding runtime versions of any struct.
2018-05-18 08:02:32 +02:00
8b9db543fd Tool System: add cursor (currently unused) 2018-05-18 07:58:37 +02:00
bffa9b8012 Cleanup: remove tool definition access function
No longer needed since names not values are compared
when checking if a tool is active.
2018-05-18 07:24:17 +02:00
96fba1e101 Color: Assume Rec 709 in remaining comp nodes
Part of T54798
2018-05-17 17:20:32 -04:00
3af4a46a18 Tool System: tools now initialize on startup 2018-05-17 22:03:34 +02:00
50e3af8899 RNA: quiet warning
Harmless but annoying.
2018-05-17 20:35:46 +02:00
b0c8d35142 Tool System: use context mode
Was using object mode in the workspace API which isn't
useful for accessing tools.
2018-05-17 20:28:14 +02:00
486ff7e52c Merge branch 'master' into blender2.8 2018-05-17 19:55:27 +02:00
54a9136569 RNA: move enums to rna_rna.c
Needed for use in rna non runtime code.
2018-05-17 19:54:35 +02:00
0e0d99161a RNA: move enums to rna_rna.c
Needed for use in rna non runtime code.
2018-05-17 19:10:45 +02:00
b290048257 makesrna: error check from 2.8 2018-05-17 19:05:46 +02:00
b46c707ec2 Fix UV shadow drawing 2018-05-17 18:44:03 +02:00
cadbfa590a Static Override/RNA diffing: Use a nasty macro to factorize a bit the code.
This piece of code remains annoyingly verbose, but at least now we do
not have anymore twice the same logic duplicated between single array
element handling, and non-array properties.
2018-05-17 17:10:35 +02:00
170dd30881 Multi-Object-Mode: EditCuve Select All
D3381 by @dgriffin91
2018-05-17 17:09:02 +02:00
3b6a0f5fe0 Modifiers: ported Surface DerivedMesh → Mesh 2018-05-17 16:21:13 +02:00
edf6676a77 Tool System: per space/mode tool support
This patch adds support for:

- Per space-type tools (3D view and edit).
- Per mode tools (object, edit, weight-paint .. etc).

The top-bar shows the last activated tools options, this is a design
issue with using a global topbar to show per-space settings.

See D3395
2018-05-17 15:57:33 +02:00
20cc14e2b7 Cleanup: warning 2018-05-17 15:51:36 +02:00
9edc64e255 Tag scene & objects for COW update after physics settings changed via RNA 2018-05-17 15:48:23 +02:00
a2438373b3 Modifiers: ported Collision DerivedMesh → Mesh 2018-05-17 15:28:51 +02:00
c48a3afb16 Collision Modifier: get time from depsgraph instead of scene 2018-05-17 15:28:51 +02:00
Dalai Felinto
0ef23786fe EEVEE: Fix Motion Blur for copy-on-write
Get current frame from depsgraph, not scene.
2018-05-17 15:25:43 +02:00
2e635b6500 Outliner: add ID type filter option for Blender File and Orphaned Data. 2018-05-17 14:27:59 +02:00
75321a3d24 Outliner: move filter menu to the left in header. 2018-05-17 14:27:58 +02:00
6d706dc8c7 Outliner: in Blender File, use upper case names and icons. 2018-05-17 14:27:58 +02:00
1f3143fcc7 Outliner: rename Data-Blocks to Data API, to make clear it's low level stuff. 2018-05-17 14:27:58 +02:00
773a60d8f8 Modifiers: ported Particle Instance DerivedMesh → Mesh 2018-05-17 13:45:47 +02:00
ca1f1043d3 Particle System: fixed dupliobject drawing by getting time from depsgraph 2018-05-17 11:42:24 +02:00
12e523d12c Fix menu navigation and modal tools affecting the active region.
We updated the active region during redraw to fix missing updates on
file load, restrict it more now to avoid unwanted updates.
2018-05-17 11:17:45 +02:00
35a298db52 Armature: Fix non working Wireframe option on bones. 2018-05-17 11:11:53 +02:00
ba4d215139 T55090: Proxy bones were not selectable
- Implemented custom selection in pose mode overriding the rest. This
selection mode is only done for bone selection right now
2018-05-17 08:54:40 +02:00
41cba97f47 Cleanup: Use ED_view3d_win_to_ray_ex to get the ray and remove unused parameter. 2018-05-16 23:04:28 -03:00
efe3042368 Transform: Use isect_ray_seg_v3 instead dist_squared_ray_to_seg_v3 in the function that tests the snap on edges. 2018-05-16 22:04:41 -03:00
4b18858660 BLI_math_geom: Separate the isect_ray_seg_v3 from dist_squared_ray_to_seg_v3. 2018-05-16 21:36:41 -03:00
d038f4651e Transform: Fix bugs for the latest changes to the snap system. 2018-05-16 21:32:52 -03:00
Dalai Felinto
07b03ff74d EEVEE Scene: Set all variable as overridable 2018-05-16 23:13:28 +02:00
Dalai Felinto
83e35b682c Remove ViewLayer settings - cleanup 2/2 2018-05-16 23:13:28 +02:00
Dalai Felinto
e51bf11b15 Remove ViewLayer settings - cleanup 1/2 2018-05-16 23:13:28 +02:00
Dalai Felinto
09e419fa8d Move Clay properties into scene
Per collection overrides are gone now.
2018-05-16 23:13:28 +02:00
Dalai Felinto
15c2801aac Move EEVEE properties into scene
We handle doversion for the scene properties, but not for the
view layer overrides.

Overrides will be implemented in a different way via dynamic overrides.
For now this data is completely lost.
2018-05-16 23:13:28 +02:00
Dalai Felinto
d8dca3c3b0 Layer unittest: Disable the override tests
They are failing for some time now, and they will be obsolete soon anyways.
2018-05-16 23:13:28 +02:00
b4648ee379 Cleanup: BKE_bvhuitls: Use a struct rather than re-create each member of it. 2018-05-16 15:26:33 -03:00
91d3a5c1f7 Fix crash when duplicating an object type mesh with raycast operation enabled. 2018-05-16 14:28:28 -03:00
f6601e2deb Tool System: pass space type when setting tool
Internal change only, needed because object mode is now in top-bar.
2018-05-16 19:04:29 +02:00
9abb4b555a Cleanup: unused vars 2018-05-16 19:04:29 +02:00
527c9af48f Static overrides: reduce the amount of instantiated objects when overriding a group.
For now, do not override/instantiate objects used as boneshapes.

Note that this is a rather poor/dirty hack, it seems Spring char groups
still have a lot of other (unused???) shape objects.

Ideally lib groups should be designed more cleanly for the new Static
Override system, putting only really usable objects into 'main' group,
and placing the others in sub-groups, helpers groups, or so...
2018-05-16 19:01:04 +02:00
5ed702dc9c Armature: Fix T55068: Wireframe bones with custom shapes not working in object mode 2018-05-16 18:46:35 +02:00
1b4916054e Armature: Cleanup: Remove unused function and use less silly wire drawing. 2018-05-16 18:46:35 +02:00
f785fb299a Particle edit: Use proper modifier to get evaluated derived mesh from 2018-05-16 17:45:48 +02:00
df963a47fb Particle edit: Fix disappearing child particles when toggling edit mode
Going to object edit mode and back to particle edit mode used to loose all
children from being displayed.
2018-05-16 17:45:48 +02:00
5308e31e41 Fix memleak with meshes having IDProps in modifier stack evaluation.
*Always* use BKE_library API to handle IDs allocation and freeing,
unless you have a very, very, very good reason not to do so - and
perfectly know what you are doing.
2018-05-16 17:35:54 +02:00
48645e55e1 Fix again bloody locked proxy bones...
No idea why that was working this morning, now we do not get CoW tag
anymore (which kind of makes sense since it's set *after* copying
happens...), so just resorting to using the NO_MAIN flag instead.
2018-05-16 17:25:20 +02:00
34c98e3d41 Eevee: Fix missing Ambient Occlusion node in add node menu. 2018-05-16 16:58:32 +02:00
bcfe075f89 Armature: Fix T55070: Bones relationship lines are offsetted
Was missing object matrix multiplication.
2018-05-16 16:58:32 +02:00
a25856f2a8 GPUShader/DRW: Add Transform Feedback support.
This is a usefull feature that can be used to do a lot of precomputation on
the GPU instead of the CPU.

Implementation is simple and only covers the most usefull case.

How to use:
- Create shader with transform feedback.
- Create a pass with DRW_STATE_TRANS_FEEDBACK.
- Create a target Gwn_VertBuf (make sure it's big enough).
- Create a shading group with DRW_shgroup_transform_feedback_create().
- Add your draw calls to the shading group.
- Render your pass normaly.

Current limitation:
- Only one output buffer.
- Cannot pause/resume tfb rendering to interleave with normal drawcalls.
- Cannot get the number of verts drawn.
2018-05-16 16:58:32 +02:00
a3f4c72ec9 Eevee: Add support for Ambient Occlusion node. 2018-05-16 16:58:32 +02:00
c332e6e0d6 Eevee: Change normal buffer texture format for more precision.
This means more accurate SSR with less faceted artifacts.
2018-05-16 16:58:32 +02:00
f1a5fd90ba Shader Node Editor: Add Closure to RGB convertion node.
Patch D3205 by Kanzaki Wataru

Only implemented in Eevee for now. Collapse a closure to RGBA so we can
do NPR stuff on the resulting color.

Use an emission shader to convert the color back to a closure.

Doing this will break PBR and will kill any SSR and SSS effects the shader
the shader rely on. That said screen space refraction and ambient occlusion
are supported due to the way they are implemented.
2018-05-16 16:58:32 +02:00
e862bcd6c8 Workbench: World based studio lighting
Disabled shadows for now as the calculation of the light direction is
still to bogus.
2018-05-16 16:43:10 +02:00
def1c3eb4b Particle System: ported most DerivedMesh → Mesh
There are a few places where DerivedMesh is still used, most notably
when calling the (not yet ported) cloth simulation. There is also still
the use of Object.derivedDeform and Object.derivedFinal. Those places are
marked with a TODO.

Some functions in the editors module were copied to accept Mesh. Those
already had 'mesh' in the name; the copies are suffixed with '__real_mesh'
for easy renaming later when the DM-based functionality is removed.
2018-05-16 16:31:38 +02:00
76b5e38a76 Mesh: Set deformed_only=1 when copied mesh is from main library 2018-05-16 16:13:13 +02:00
739c3e8102 Particle System: use DEG to get current time in psys_get_particle_state() 2018-05-16 16:09:52 +02:00
eacf63c96f Particle System: Pass correct particle index when drawing
Passing the wrong index caused the particles to stop being shown when the
first particle dies.
2018-05-16 16:09:52 +02:00
1b2ba24749 fix build error in last commit. 2018-05-16 11:02:54 -03:00
f0c0d11ea2 Fix T55076: Hack around to break correct behavior of 2.8 and get back broken-used-as-feature one from 2.7.
Locked bones of proxies should not be editable, at all. But lack of
update from linked rest pose in 2.7 allows to pose and animate locked
bones (not to pose them without animation though, or you'd lose your
pose on next file save & reload).

this is used by artists to always lock all their bones in a rig, so that
proxies fully update when lib rig is modified...

For now, restore that broken behavior in 2.8 by not updating proxies
against lib armature in CoW context (makes sense anyway, we are
currently doing a lot of useless thing when copying data for depsgraph
evaluation!).
2018-05-16 15:47:50 +02:00
2ba0951e52 Snap system: Adds support to Clip Planes and uses a clip plane to simulate occlusion
This patch adds support for clip_planes (ie ignore what is behind a face)...

The idea is to first execute a raycast to get the polygon to which the mouse cursor points.
Then a snap test is done on the vertices or edges of the polygon.
Then with the normal and location obtained in raycast a new clip_plane is created and the snap over the whole scene is processed ignoring the elements behind the clip_plane.

Here 2 gif of how the previous patch would work on blender2.79:

{F497176}

{F497177}

Reviewers: mont29, campbellbarton

Reviewed By: campbellbarton

Subscribers: bliblubli

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2527
2018-05-16 10:32:54 -03:00
6a4ba9133c Fix T55097: Mesh Deformation modifier is ignoring Vgroup option 2018-05-16 15:19:10 +02:00
Dalai Felinto
b0cfd7a9b8 Fix T55082: Add Paint Slots for texture painting not working
We changed how this work since the BI removal. But since this operator
was moved to the topbar its poll function was returning false.
2018-05-16 15:02:33 +02:00
2e4c1346bd Popover for snapping settings
See T55038
2018-05-16 14:23:46 +02:00
d9e04cb594 Multi-Object-Mode: EditMesh Tool Bevel (MESH_OT_bevel)
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3352
2018-05-16 14:05:57 +02:00
7fd44e2498 Reverted copying mesh->runtime.deformed_only in CDDM_from_mesh_ex
Doing that copy is the right thing, but only if the mesh has its own
deformed_only flag set correctly. This isn't generally the case, so
keeping dm->deformedOnly = 1 is better.
2018-05-16 13:06:57 +02:00
1bb9ccf887 Multi-Object-Editing: MESH_OT_faces_select_linked_flat
Reviewers: dfelinto

Maniphest Tasks: T54643

Differential Revision: https://developer.blender.org/D3372
2018-05-16 13:04:09 +02:00
d095eea19c Silence warning about functions having no prototype 2018-05-16 06:45:54 -04:00
dbe4189dcd Save 'deform_only' flag in Mesh.runtime
This flag is copied when converting between DM and Mesh.

This flag is set to true in get_mesh(), to mimick the behaviour of
CDDM_from_mesh_ex. This is necessary for the particle system to work
correctly.
2018-05-16 12:41:48 +02:00
46aec45b2a Multi-Object-Editing: intersect boolean (MESH_OT_intersect_boolean)
Reviewers: dfelinto (changed test from totvert to totfacesel before committing)

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3306
2018-05-16 12:29:05 +02:00
Dalai Felinto
807afedf6c Fix check for MESH_OT_intersect 2018-05-16 12:26:32 +02:00
dffd37877d Multi-Object-Editing: intersect (MESH_OT_intersect)
Reviewers: dfelinto

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3307
2018-05-16 12:17:20 +02:00
f7c37c8344 Modifiers: Port mesh_calc_modifiers from DerivedMesh to Mesh
This ports the main modifier eval loop.

A few things haven't been ported yet: tessface and shapekey related code. As
far as I can tell, shapekey code was never entered into.

https://developer.blender.org/D3342
2018-05-16 06:07:50 -04:00
c43dbc2bc2 Add modifier_deformVerts_ensure_normals, modifier_applyModifier_ensure_normals
Same as `modwrap_deformVerts` and `modwrap_applyModifier` but for `Mesh`.
2018-05-16 06:07:50 -04:00
fee50f830d Add BKE_mesh_is_valid
Non modifying version of `BKE_mesh_validate`, mirrors `DM_is_valid` more
closely. Will be used in port of `mesh_calc_modifiers`
from `DerivedMesh` to `Mesh`.
2018-05-16 06:07:50 -04:00
9bcddeca7a Popover for Pivot Point in top bar
From T55038
2018-05-16 12:03:53 +02:00
b6a822d726 Multi-Object-Editing: Weld Edges into Faces(MESH_OT_face_split_by_edges)
Reviewers: dfelinto

Maniphest Tasks: T54643

Differential Revision: https://developer.blender.org/D3308
2018-05-16 11:54:33 +02:00
a6e804eaee Particle system: get current time from depsgraph
This makes the particle animation work again!
2018-05-16 10:50:49 +02:00
ca8e9c881f Workbench: Read studiolights from USER + SYSTEM datafiles 2018-05-16 09:14:20 +02:00
d0b62ce041 Fix navigate widget w/ region overlap 2018-05-16 08:46:40 +02:00
b79fea28e3 Fix visible region overlap calculation
Existing code didn't account for top/bottom overlap.
2018-05-16 08:32:02 +02:00
0a8d6bd893 Transform: Snap: Make sure if bmesh arrays need to be recalculated. 2018-05-15 16:15:14 -03:00
9619a90da1 Scene raycast: The return index should indicate the polygon instead of the looptri.
This was the default behavior and could break some addon since looptri is almost useless for the current python API.
2018-05-15 15:38:17 -03:00
599bf05c56 Merge branch 'master' into blender2.8 2018-05-15 19:53:34 +02:00
bf0d16e30e Workbench: send right event after shadow_shift changes 2018-05-15 19:47:29 +02:00
7a69c59b35 Revert "BLI_kdopbvh: Reference clip_planes callback to find nearest projected."
This reverts commit 717dd4cecd.

It was causing problems in the protactor ruler.
I'll think of a better solution.
2018-05-15 14:37:45 -03:00
4461be1b72 Fix T55032: Redo w/ file saved in edit-mode failed
It's important edit-mode has a step stored for redo to work,
file load now ensures this in a generic way.
2018-05-15 19:37:06 +02:00
50c29e2391 Cleanup: pass the use_depth parameter to the SnapObjectParams struct in the ED_transform_snap_object_project_view3d_mixed. 2018-05-15 14:32:30 -03:00
717dd4cecd BLI_kdopbvh: Reference clip_planes callback to find nearest projected.
Clip_planes are an important parameter to be used in callbacks.
2018-05-15 14:14:25 -03:00
a2dd6fa58b COW Fix: VIEW3D_OT_select_lasso now works for Pose Bones. Other modes untested. 2018-05-15 19:13:25 +02:00
439ccd27e6 BLI_math: Added isect_point_planes_v3_negated function. 2018-05-15 14:10:41 -03:00
ca028f1387 Fix POST_OT_hide/reveal
Apparently they weren't actually working, despite seemingly working
when tested earlier. Argh!
2018-05-15 19:08:00 +02:00
747326ed25 Fix: POSE_OT_visual_transform_apply now works with Copy on Write 2018-05-15 18:39:24 +02:00
c3282cb746 COW Fix: Muting constraints or changing influence did not properly refresh
We need to manually do a copy on write tag here, or else nothing will happen
2018-05-15 18:39:24 +02:00
53c6d3399a Remove G.main usage 2018-05-15 18:39:24 +02:00
Dalai Felinto
9439df1ab8 Copy on write: VIEW3D_OT_clear_render_border + rna 2018-05-15 18:19:08 +02:00
Dalai Felinto
4f8b6428bc Copy on write: VIEW3D_OT_render_border
Drawing is using the original scene (which shouldn't), but regardless
this force tagging to work.
2018-05-15 18:03:10 +02:00
3d1f5cb9a2 Cleanup: Pass Snap Object Params * params to iter_snap_objects.
And remove unnecessary `defaulf:` labels.
2018-05-15 12:44:37 -03:00
92d4fbf5cc Fix Cycles and viewport outline mismatch due to changed sensor size. 2018-05-15 17:32:38 +02:00
13b2ba4fdd Fix Cycles motion blur not working with CoW disabled.
Not so important but convenient for testing, and makes the Cycles tests
pass again for now.
2018-05-15 17:32:38 +02:00
8c44e182f0 Fix mistake in recent outliner rebuild change. 2018-05-15 17:32:38 +02:00
77d6c09ddd Merge branch 'master' into blender2.8 2018-05-15 17:31:26 +02:00
91504ed26e Fix assert using '//' on an unsaved file
Annoying for debug builds.
2018-05-15 17:27:36 +02:00
fda05127db Particle edit: Fix generation of KD tree for emitters
Fixes crahs using puff brush with copy-on-write.
2018-05-15 17:20:02 +02:00
5d879c5d42 particle edit: Fix crash when using without copy-on-write 2018-05-15 17:20:02 +02:00
83155cce5b Particles: Fix uninitialized child orco passed to modifiers
Wrong cleanup done in 51b796ff15.
2018-05-15 17:20:02 +02:00
2d0efe2e78 Particle edit: Need to check DONE flag from evaluated psys 2018-05-15 17:20:02 +02:00
a104c41759 Particle edit: Support children particles display with copy on write 2018-05-15 17:20:02 +02:00
ed0901b47e Depsgraph: Forbid flush across scene->geometry operations
This relations is only to force geometry evaluation to happen
after scene's CoW is done. it was never meant to update geometry
when scene is being tagged.
2018-05-15 17:20:02 +02:00
f43d33d3a4 Depsgraph: Keep track of original particle system
Allows to have quicker lookup in particle edit mode.
2018-05-15 17:20:02 +02:00
4f5bcc30d3 Particle edit: Add missing looking tag in cut brush 2018-05-15 17:20:02 +02:00
e57ba1daf5 Particle edit: Allow children to be visible in edit mode
Follows tool settings, tested without copy-on-write.

Enabling copy-on-write still needs verification and likely some fixing.
2018-05-15 17:20:02 +02:00
f4fd1f1f4b Particle edit: Move cache update to particle batch cache implementation
The idea is to allow "regular" strands to update edit cache and hence
get the final update strands.
2018-05-15 17:20:02 +02:00
e83cee73eb Draw manager: Pass object to hair batch cache
Currently unused, but is required for an upcoming work.
2018-05-15 17:20:02 +02:00
fe01430f74 Particle edit: Make check to work within copy-on-write concept
Not fully optimal, we can probably store pointer to original psys
similar to ID's orig_id.
2018-05-15 17:20:02 +02:00
e5560e8d56 Particle edit: Edit path invalidate should trigger particle system path re-cache
Don't try to bend existing design, just follow it. It's not nice, but is
working. Just bring it back, then repeal and replace system as a whole,
making sure every bit is working according to a design.

Such quick patches only trying to make local sense of a system, defeating
it's design.
2018-05-15 17:20:02 +02:00
c5f469da5e Particle edit: Restore weird-looking conditions in evaluation
They might be looking weird, but they match conditions when children particles
are to be re-calculated for particle edit.
2018-05-15 17:20:02 +02:00
aa312621dc Particle edit: Re-cache edit path if it's NULL
This is what old particle drawing code was doing.
2018-05-15 17:20:02 +02:00
979c48fd66 Particle edit: Decouple caches for regular and edit strands
Makes it possible to have children strands to be visible during combing.
Actual implementation still needs work though.
2018-05-15 17:20:02 +02:00
361bc2bc50 Particle edit: Make visibility check to be per-particle system
This way we can see other particle systems while combing another one.
2018-05-15 17:20:02 +02:00
f25be56bc7 Particle edit: Use proper batch cache flag
Also tag batch for invalidation when using cut brush.
2018-05-15 17:20:02 +02:00
06e9048ade Particle edit: Tag for updates when changing tool settings related on edit mode 2018-05-15 17:20:02 +02:00
7cbb85675a Particle edit: Fix missing hair edit after toggling edit mode 2018-05-15 17:20:02 +02:00
e0b0f7afa0 Fix hair edit mode after recent fix for DEG sued from draw code 2018-05-15 17:20:02 +02:00
b6e3430417 Modifiers on Lattices now work
Tested with Hook and Armature modifiers. Requires CoW to be enabled.
2018-05-15 17:16:23 +02:00
87cd4de3ba Workbench: Renamed Overlap to Outline
Outline is reserved for the Overlap Overlay
2018-05-15 17:03:59 +02:00
a95d417db0 Fix broken PoseMode editing when CoW is enabled.
We need to get data from evaluated object/posechannel too, then...
2018-05-15 16:30:02 +02:00
10fe8ec68f Fix T55078: Assert statement 2018-05-15 16:20:34 +02:00
bcf6cc1f6b Change startup defaults
- Default Lamp increased strength (10x stronger)
- 3D View & Camera Lens = 50mm
- Camera film size = 36x24mm Full Frame
- Render Size Percentage = 100%
- Render Display = New Window
- Scene Units = Metric
- Color Management View = Filmic
- Workbench Object Overlap = ON
- Headers on top for all editors, except the Timeline at the bottom
- Default Properties tab = Object Properties
- Generate UV's = ON

See T47064
2018-05-15 16:14:16 +02:00
197af58baa Workbench: Cleaner Shadow edges own shadow 2018-05-15 15:40:12 +02:00
4d5b7696cb Change preference defaults
- Python tooltips: OFF
- Auto Perspective: ON
- Navigation Manipulator: ON
- Region Overlap: ON

See T47064
2018-05-15 14:32:13 +02:00
13dfa72f26 Add icon placeholders for all the armature ops that got recently added in the toolbar
The icon designers still need to create these, but it's better to have placeholders
so they remember to do it.
2018-05-15 13:50:52 +02:00
c6bceffc4f Fix crash linking/appending from old files in some cases.
Temporary main would not have a lock, which caused crashing when adding
datablocks.
2018-05-15 13:23:01 +02:00
3f20105622 Fix random crashes in the outliner, especially with bigger scenes.
The outliner can redraw quicker without rebuilding the tree, for example when
just moving the mouse and highlighting different items. The way this worked is
that the outliner would be tagged to avoid rebuilding, however if another
operation that does require rebuilding happens in the meantime we could go out
of sync and crash.
2018-05-15 13:02:44 +02:00
8021ac986a Pose Toolbar: Added Breakdowner/Push/Relax as separate tools
Currently all are stacked together, but perhaps if we don't get any other
tools in the meantime, it would make sense to have them separate.

Notes:
* No icons for now...
* There are some 2.8 bugs with the underlying operators (notably multi object)
2018-05-15 12:40:50 +02:00
95e7559bb6 Edit Armature Toolbar: Added some tools for "Shrink Fatten" (Alt-S) type bone transform tools
For fun, I tried adding some more edit armature tools to the toolbar to
check how this is all working. Icons are missing currently, but it's a
nice test.
2018-05-15 12:08:09 +02:00
b3d4f99d48 Fix bone-size crash
Own regression from multi-object transform.
2018-05-15 11:36:39 +02:00
e0903e20a7 Merge branch 'master' into blender2.8 2018-05-15 11:14:33 +02:00
3eb9cc69f2 Cleanup: last spacetype enum name 2018-05-15 11:12:49 +02:00
f1bc899146 Merge branch 'master' into blender2.8 2018-05-15 10:25:49 +02:00
9636cab009 Undo System: remove nested edit-mode undo calls
Regression in recent undo system changes,
This caused T55048.

When each mode had its own undo stack it was important
to initialize it when entering edit-mode.
2018-05-15 10:10:48 +02:00
55b241d32a Fix texture space transform crash
Own regression from multi-object transform.
2018-05-15 09:25:16 +02:00
0fb80cebec Fix T55061: Shadows were not updated during sclupting. 2018-05-15 09:13:47 +02:00
52cb62d502 Merge branch 'master' into blender2.8 2018-05-15 09:08:48 +02:00
ae8225ba6d Fix BMesh bisect not flagging dirty indices 2018-05-15 09:04:12 +02:00
ce27d11595 Workbench: Enable Textures in Edit Mesh Mode
Constructed UV out of BMesh data layers.
2018-05-15 08:58:25 +02:00
04fa65e356 Cleanup: Use switch statement to test the object type in snap functions. 2018-05-14 19:18:26 -03:00
c3b061278e EditMesh: updated extrude manipulator
Now plus icons are used to add,
arrows are used to adjust existing extrusions.
2018-05-14 23:21:59 +02:00
b2b8e1444a Manipulator: outline & helpline options for button 2018-05-14 23:18:36 +02:00
bac9c2dc7d Manipulator: utility to get matrix w/o offset 2018-05-14 23:15:44 +02:00
e159ec8bc1 Cleanup: compiler warnings, use const 2018-05-14 23:12:51 +02:00
bf7c46cae0 Transform: Use the new BLI_bvhtree_find_nearest_projected function to snap. 2018-05-14 16:08:17 -03:00
8cbf402eb6 New function for BLI_kdopbvh: BLI_bvhtree_find_nearest_projected.
This patch does not make any difference for a user's POV. But it is a step for adding the occlusion test for snapping functions.
This new function finds the node(aabb) whose projection is closest to a screen coordinate.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3180
2018-05-14 16:01:36 -03:00
70a60061e5 Fix crash opening 01_015_A.lighting.blend - DL_INDEX3 displist have a single normal, not one per vertex! 2018-05-14 17:41:11 +02:00
Dalai Felinto
7cb2d55bd4 View 3D: Use Z Key for "geometry occlusion" toggle
Note: The header doesn't update until you mouse hover it.
2018-05-14 17:19:10 +02:00
627a783784 Fix error in MESH_OT_edge_face_add changes
Context sensitive create also needs to check selected vertices.

Also correct indentation.
2018-05-14 16:35:51 +02:00
b0f61ea6db Fix error moving pivot
Missed updating keymap RNA paths.
2018-05-14 16:25:47 +02:00
Dalai Felinto
b1dae7bd6f Fix UI failing for vertex paint 2018-05-14 16:11:05 +02:00
Dalai Felinto
fc7316fb54 Multi-Objects: MESH_OT_vert_connect_path by Falk David
With a few changes:
* Use space after if.
* Skip for loop when no selected vertices.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3349
2018-05-14 15:56:26 +02:00
Dalai Felinto
de2d642c84 Multi-Objects: MESH_OT_edge_face_add by Guy Boicey
With changes by Dalai Felinto:
* Indentation
* Skip for loop when no vert/edge are selected

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3233
2018-05-14 15:47:51 +02:00
2b09062def COW Fix: The "layers used" display for armatures did not update after bones were moved between layers
Previously, the "layers_used" value was getting updated by the drawing code.
However, when using copy on write, the drawing code gets evaluated copies of
the armature data instead of the original data, so any updates here fail to
get flushed to the original data, hence the lack of updates in the UI.

Fixed by moving the calculation to RNA when setting bone layers, as it should
have been done originally. (The one downside to this is if we set individual
layer memberships one by one - this could be slower as the recalc would have to
happen each time this changes).
2018-05-14 15:42:57 +02:00
788488b1aa Fix: With no bones selected, move bones to layer operator would display garbage layer set
Was using uninitialised memory
2018-05-14 15:42:57 +02:00
2bf4654052 Fix: POSE_OT_select_constraint_target now works with copy on write 2018-05-14 15:42:57 +02:00
Dalai Felinto
b1d016bc12 MESH_OT_select_mirror: Only report when something to report
Inspired by D3299.
2018-05-14 15:26:29 +02:00
Dalai Felinto
90c9458b2f Multi- Objects: MESH_OT_select_face_by_sides by Rainer Trummer
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3301
2018-05-14 15:23:22 +02:00
Dalai Felinto
4043e4b820 Multi-Object: MESH_OT_vert_connect_concave by Guy Boicey
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3255
2018-05-14 14:56:40 +02:00
9e4709e9a5 Manipulator: fix 2D icon buttons in the 3D view 2018-05-14 14:47:52 +02:00
e5b53fb28c Some cleanup in modifiers' mesh copying. 2018-05-14 14:34:00 +02:00
eabfd031fa Fix T55031: add explicit copy flag to force deep-copying shapekey datablock with 'parent' one.
Chose to change defaut behavior (0-flag one) here, for sake of
consistency. Default behavior of simple BKE_id_copy() remains unchanged
though.
2018-05-14 14:25:13 +02:00
63c2397171 T54643-Multi-Object EditMesh: MESH_OT_select_nth
With changes by Dalai Felinto:
* Move WM_operator.* outside for loop.
* Update error message to handle Mesh and Meshes.
* Skip main functionality when no vert/edge/face is selected.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3371
2018-05-14 14:07:10 +02:00
e33016c77e UI Tweaks in 3D View
* Move Shading modes out of the popover
* Move Show Overlays out of the popover
* Test moving the Mode to the topbar again
* Move submode (select vertex, edge, face) to the topbar
* Remove icon from show_manipulator toggle
2018-05-14 14:00:37 +02:00
Dalai Felinto
3ebe389605 Multi-Object: MESH_OT_select_mirror 2018-05-14 13:47:53 +02:00
bf73628978 Fix extrude adjustment on normal axis 2018-05-14 13:45:34 +02:00
80ccad07cc Fix: Skip missing COW tagging on changing armature layers via RNA
Was causing problems on Spring rig while trying to show/hide armature layers
2018-05-14 13:42:30 +02:00
5205a0f671 Fix incorrect matrix stack push/pop 2018-05-14 13:29:17 +02:00
Dalai Felinto
b942106c73 Multi-Object: MESH_OT_vert_connect_nonplanar by Aeden McClain
With indentation fixes by Dalai Felinto.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3312
2018-05-14 13:04:01 +02:00
Dalai Felinto
016ba0f38b Multi-Objects: VIEW3D_OT_snap_selected_to_gri by Leon Eckardtd
With changes by Dalai Felinto (skip for loop when no vert/edgeface selected).

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3302
2018-05-14 12:52:52 +02:00
261d78a2c6 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-05-14 12:44:05 +02:00
0cfe9f95df Fix extrude manipulator update w/ view orientation 2018-05-14 12:26:40 +02:00
Dalai Felinto
e1cee0ac71 Multi-Object: MESH_OT_convex_hull by Lucas Boutrot
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3223
2018-05-14 12:20:15 +02:00
51341dafc3 Workbench: Named background rendering 2018-05-14 12:07:58 +02:00
6a0d7f9e41 Workbench: Render studio hdr name in selection 2018-05-14 10:32:52 +02:00
258c5f2c0f Particle edit: Avoid depsgraph tag from draw code
Some of the function was intended to be used form drawing as well,
for until that is changed in design we can not use dependency graph
tags form it.
2018-05-14 10:16:41 +02:00
783bb4e1cd Revert "Tag update when using particle edit brushes"
This reverts commit 5dba0b68f8.

Old code was supposed to use this function from draw, and we must never
poke depsgraph from drawing.
2018-05-14 10:16:41 +02:00
50bab7eb8a Workbench: Studio light better diffuse sampling
Increased steps of diffuse sampling for narrow hightlights
2018-05-14 10:04:34 +02:00
95869f5838 Workbench: Support HDR files as HDRI studio lighting
support Radiance HDR files for studio lighting.
Fix crash when studiolight folder does not exist.
2018-05-14 09:56:32 +02:00
379c3e46d5 UV: multi-object project bounds
D3368 by @Al with own edits.
2018-05-14 09:15:43 +02:00
f78ba4bcfe Merge branch 'master' into blender2.8 2018-05-14 09:01:11 +02:00
43ee4d5d7c Cleanup: quiet GCC -Wtype-limits
While the warning can normally be disabled, we don't have have as much
control of warnings when macros are used.
2018-05-14 09:00:42 +02:00
66f0c10f84 Merge branch 'master' into blender2.8 2018-05-14 08:41:15 +02:00
c1d737eb95 BLI_utildefines: re-ordering array delete macro 2018-05-14 08:38:53 +02:00
a0c564f86a Eevee: Hair: Disable SSR for hairs.
SSR does not work with hair strands. Basically, the rays are too much
random to ever converge properly and just result in a soup of self
inter reflections.

So forcing it to not produce any SSR. Could potentially save some bandwidth
by not rendering hair to the SSR buffers.
2018-05-14 00:18:00 +02:00
2c1396b6cb Eevee: Hair: Fix normal distribution of previous commit.
Now it starts to look correct!
2018-05-13 23:12:45 +02:00
0c1c69d8df Eevee: Hair: Remove old hack and replace by new hack.
This is a hack to properly shade wire hairs. Use stochastic sampling and
let TAA solve the noise.

At least it's way more correct than the previous hack.
2018-05-13 22:44:57 +02:00
402442997a GPUTexture: Add Texture Buffer support.
This is needed by opensubdiv and can be helpfull in a lot of other cases.
2018-05-13 22:44:57 +02:00
ddf308b04a EditMesh: Use tweak for extrude tool
Could too easily click to extrude without any offset.
2018-05-13 21:19:22 +02:00
dc4f94783d EditMesh: show XYZ axis for extrude
Always show normal axis since this is the most used,
even when another orientation is selected.
2018-05-13 21:15:56 +02:00
e0a4624acd Eevee: Fix lamp defaulting to no specular.
Was missing a default value.
2018-05-13 21:07:40 +02:00
913bba5038 Fix missing path callback for new Object.display struct. 2018-05-13 19:06:37 +02:00
3767c01269 Fix issue w/ recent tool name use
Use the context space type, not the workspace.
Broke setting tools for the first time.
2018-05-13 18:39:15 +02:00
d21043ba83 Icons: updated transform icons 2018-05-13 18:33:01 +02:00
c40c2b5ab7 UI: fix popovers not properly working with scroll arrows for long menus. 2018-05-13 18:24:13 +02:00
680bdef12a Build deps: avoid ffmpeg external crystalhd library dependency. 2018-05-13 18:24:13 +02:00
64245e735c Icons: fix z-sorting
Was depth sorting per mesh.
2018-05-13 17:10:20 +02:00
Julian Eisel
a23995f42a Fix/workaround crash when appending workspace in edit mode
Linking/appending in edit mode currently isn't supported. For workspaces it
should probably be, but we can look into supporting this later.

For now gray out buttons in "Add Workspace" menu while in edit mode.
2018-05-13 16:49:05 +02:00
Julian Eisel
5717612f7c Fix invisible scroll-bars after file read
Own mistake from 51efeb6834.
2018-05-13 16:39:59 +02:00
5bad5f996f Icons: optionally use material color
The RGB node is used if it exists,
this is multiplied by the vertex color.
2018-05-13 16:24:38 +02:00
Nick Milios
94a62853ae Fix build error with Visual Studio / Windows.
Differential Revision: https://developer.blender.org/D3363
2018-05-13 15:51:42 +02:00
a8e8e08bc6 Revert "UI: geometry-icon alpha blend over existing colors"
This reverts commit 9606d28d40.

Caused issue w/ overlapping triangles,
since this isn't overly important reverting.
2018-05-13 15:39:10 +02:00
9606d28d40 UI: geometry-icon alpha blend over existing colors
Useful to mix pre-defined material colors.
2018-05-13 15:14:26 +02:00
7a2e271e54 Fix compiler warnings. 2018-05-13 14:48:55 +02:00
3469e623d3 UI/Python: layout API support for setting button emboss style. 2018-05-13 13:44:49 +02:00
343c2e94f5 Cleanup: deduplicate layout item initialization. 2018-05-13 12:48:51 +02:00
1ec48f8042 Tool System: Support set w/ space-type argument 2018-05-13 11:49:21 +02:00
06a786f12d UI: show toolbar shortcuts
When toobar text is expanded, show shortcuts
(normally confined to menus).
2018-05-13 10:27:44 +02:00
e7ee9cfd9e Tool System: tools are now set by name
This avoids having to store the tool definition in the operator
properties (on redraw).

Now just set the name, note this means we can't show the keymap in the
tool-tip anymore. This will eventually be shown in the status bar.
2018-05-13 10:01:56 +02:00
e1772dac70 WM: utility to create tool keybindings 2018-05-13 09:34:22 +02:00
cee39da318 WM: Operator to set the tool by name
Needed to bind keys to tools (T55036).
2018-05-13 09:03:37 +02:00
03281c080c Cleanup: indentation 2018-05-13 08:32:47 +02:00
0414b0a0be Cleanup: add function to get class from space type 2018-05-13 08:13:13 +02:00
ece3634497 Cleanup: call toolsystem static methods directly
Note, may move these static methods into their own module.
2018-05-13 08:07:17 +02:00
03e14bfeb6 Versioning: default scene to mean center pivot 2018-05-13 07:29:46 +02:00
9d677212ee Transform: fix regression in bound-box calculation
Error in multi-object merge.
2018-05-13 07:20:35 +02:00
59c6487e93 Merge branch 'master' into blender2.8 2018-05-13 06:56:51 +02:00
b99d064e91 Cleanup: trailing space 2018-05-13 06:44:03 +02:00
7a56d31af3 Fix 3D view axis align flag
Missed from recent pivot-point move to scene.
2018-05-13 06:38:43 +02:00
6c6a394373 Cleanup: Remove unused member. 2018-05-12 23:39:36 -03:00
9c212399c6 BKE_bvhutils: allow caching NULL bvh_trees.
This prevents zero-leafs bvhtrees from being recalculated multiple times.
2018-05-12 19:43:36 -03:00
0d9f77d954 transform_snap_object: perf: Check the distance of the bound_box of objects of type armature and curve first.
And remove unused variables.
2018-05-12 19:39:21 -03:00
375c6a7967 Cleanup: transform_snap_object: Remove unused variables and reuse the precalc used to test the distance to the projected bound_box. 2018-05-12 19:10:23 -03:00
5be0dfe086 Eevee: Fix Dof shader compilation. 2018-05-12 23:28:55 +02:00
d25ec499d8 Eevee: Depht Of Field: Merge Scatter passes together.
This means only one texture to draw to and only one sprite per pixel.

The texture is twice as large and near and far planes are side by side.

The sprite choose the biggest coc to expand to and is redirected to the
area (layer) it belongs to.

The fragment shader discard every pixel that does not belong to the correct
layer.
2018-05-12 23:28:55 +02:00
2dc5a84fad Eevee: Depth of field: Code style fixes. 2018-05-12 23:28:55 +02:00
f9cfb221d6 Eevee: Depth of field: Smooth out bokeh shape.
Due to the scatter operation being done at half resolution, undersampling
is visible at bokeh shape edges (because of the hard cut).

This commit adds a smoothing function to minimize the problem.

Also optimize the bokeh shape parametrization by precomputing a lot of
constants.
2018-05-12 23:28:55 +02:00
74a08cf128 Eevee: Depth of field: Change final blending.
This new blending allows background to fill the gaps left by forground
objects. However this has a drawback, background objects that should be
partially occluded in this case can be seen through the blurred objects.

This does not fix the problem of blurred foreground over sharp background.

Also cleanup code to be simpler and remove unused geometry shader.
2018-05-12 23:28:55 +02:00
894639f9a5 Cleanup: BLI_math: Simplify dist_squared_to_projected_aabb functions. 2018-05-12 18:18:32 -03:00
f897d95372 EditMBall: multi-object select random
D3356 by @Quetzal
2018-05-12 22:16:09 +02:00
1422c0650c UI: move pivot to the topbar
Pivot variables are now stored in scene toolsettings.
2018-05-12 22:04:45 +02:00
e0a561be1f UI: move snap & pet options into the topbar
See: T55038
2018-05-12 19:13:38 +02:00
67dda3611f UI: use icons for orientation types
See: T55038
2018-05-12 19:02:38 +02:00
817bb5d40d Remove unused function: BKE_bvhtree_from_mesh_looptri. 2018-05-12 12:05:54 -03:00
7c1171c246 Replace BKE_bvhtree_from_mesh_looptri with BKE_bvhtree_from_mesh_get.
Must have had a conflict in commit rB82d59c6588d7 when merging branchs.
2018-05-12 11:53:27 -03:00
7e74916562 UI: move GL render to view menu
This was taking valuable header room for a rarely used operator.
2018-05-12 15:02:13 +02:00
90b2e4ce28 UI: move orientation to the topbar
Move manipulator toggle to overlay popover.
2018-05-12 14:56:07 +02:00
b4010005de UI: move general mode options to right of topbar 2018-05-12 14:43:29 +02:00
570455fb83 EditMode: multi-object inset
D3305 by @jfmichaud31
2018-05-12 11:01:32 +02:00
d1b969a0cd EditMode: multi-object UV cube project
D3346 by @Cykyrios
2018-05-12 10:09:37 +02:00
ea43130504 EditMode: multi-object UV cylinder project
D3345 by @Cykyrios
2018-05-12 09:59:25 +02:00
c35af3b056 EditMode: multi-object UV sphere project
D3344 by @Cykyrios
2018-05-12 09:59:18 +02:00
f410e83b2c EditMode: multi-object UV reset
D3343 by @Cykyrios
2018-05-12 09:46:35 +02:00
dcc55c89fa Modifiers: port Remesh from DerivedMesh to Mesh
D3331 by @alikendarfen
2018-05-12 09:33:30 +02:00
df2de43459 Modifiers: ported Wave from DerivedMesh to Mesh
D3350 by @alikendarfen
2018-05-12 09:22:34 +02:00
4dc91ebf81 Merge branch 'master' into blender2.8 2018-05-12 08:22:03 +02:00
1813f00b94 Fix missing fallback in recent aabb precalc func
Also comment unused vars
2018-05-12 08:19:20 +02:00
c84b8d4801 Cleanup: modifier arg wrapping 2018-05-12 08:04:56 +02:00
be8add5d50 Refactor: Move functions to get the distance to a projected aabb to BLI_match and remove confusing parameters. 2018-05-11 20:20:51 -03:00
e4f75f97ba Icons: simpler flattened icon style
Update from @billreynish
2018-05-11 22:28:39 +02:00
6aca3e43ec UI: tweaks to icon defaults
Minor changes to fit w/ new icons.
2018-05-11 22:15:05 +02:00
bd30a6350b Cleanup: remove unused RNA variable 2018-05-11 21:57:02 +02:00
f197134426 Platform: macOS. Allow building on directory with whitespace (For example /Volumes/External HD/blender-build) 2018-05-11 21:56:13 +03:00
5503e2565b Bmesh: Clear possible geometry saved at runtime when converting bmesh to mesh. 2018-05-11 15:48:14 -03:00
0a7736a2e9 Tool System: curve draw options 2018-05-11 20:25:01 +02:00
f3f309c7f8 Tool System: inset & shrink/fatten options 2018-05-11 20:24:06 +02:00
9df6978211 Tool System: mesh rip fill option 2018-05-11 20:22:04 +02:00
194cba8ba4 Merge branch 'master' into blender2.8 2018-05-11 20:13:07 +02:00
925e775818 EditMesh: remove duplicate rip macro
Change the fill setting in the keymap,
this allows tool access the macro with either setting.
2018-05-11 20:02:12 +02:00
73a7885ab3 WM: initialize last used macro properties 2018-05-11 20:01:51 +02:00
ef49a587d4 DRW: Add DRW_UNIFORM_FLOAT_COPY and DRW_UNIFORM_BOOL_COPY.
And also use a union instead of forcing the cast to void*.
2018-05-11 19:00:32 +02:00
10b9c86c80 DRW: Add DRW_view_layer_engine_data_ensure_ex. 2018-05-11 19:00:32 +02:00
054d837e65 Modifiers: ported Laplacian Deform DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3326
2018-05-11 18:10:21 +02:00
f998bad211 Fix: Last of the operators from T54811 now work with Copy on Write 2018-05-11 17:44:10 +02:00
d3c4248946 Workbench: StudioLight HDRI's
The Studio lights are now loaded from disk. The location is
`datafiles/studiolights` they need to be JPG for now. JPG cannot store
HDRI color range but they are clamped inside the Workbench
engine for speed reason. I didn't select JP2K as it might not be
enabled.

Users can add upto 20 HDRI files. This limitation is inside the
RNA_space.c Currently the icons are calculated when you first open the
selection box for the HDRI's. We could add them to a background
rendering later.

I added 2 test files a sky texture rendered in Cycles and an HDRI from
cloud.blender.org.
2018-05-11 17:02:13 +02:00
68b736ce24 Modifiers: ported Laplacian Smooth DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3340
2018-05-11 16:52:01 +02:00
625c2c2943 Use Light Probe icons 2018-05-11 16:02:30 +02:00
f3017bbc06 Icon for Light Probes
Including Cubemap, Grid and Planar

Designed by @wevon with minor modifications as part of T53840. Thanks!
2018-05-11 16:02:30 +02:00
66b3f0b4d0 Depsgraph: Fix redundant nodes built when animation shares same action 2018-05-11 15:49:04 +02:00
2f0aca4596 Particle mode: Fix memory leak with simple interpolated children 2018-05-11 15:40:46 +02:00
b5beb660b3 Modifiers: ported UV Project DerivedMesh → Mesh
Reviewers: sybren

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3316
2018-05-11 15:30:01 +02:00
2c6e523c1f Dar manager: Ignore non-particle-edit objects from particle mode 2018-05-11 15:12:24 +02:00
aefd181b0b Fix crash going to edit mode of particles with copy on write
We can not rely on edit->psys, it is not set for particle edit,
and there is some logic deeper inside which does different things
dependent on that.

We need to replace those checks with some some HAIR vs. PARTICLES
flag and always set psys pointer.
2018-05-11 14:55:58 +02:00
af5428aa2b Modifiers: ported Screw DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3315
2018-05-11 14:43:37 +02:00
690a5f0e50 Depsgraph: Remove workaround for scene free
No functional changes commit ;)
2018-05-11 14:28:03 +02:00
210bedd7e3 Remove debug only code 2018-05-11 14:24:19 +02:00
624829515a Light Probe type name should be CUBEMAP, not SPHERE.
Change requested by @fclem
2018-05-11 13:41:52 +02:00
f74c604646 Remove unused functions which will break with copy-on-write 2018-05-11 12:49:25 +02:00
d50821f145 Particle edit: Initial support of edit with copy-on-write
The idea is that edit mode structure is owned by original object,
and used for drawing. This is a bit confusing, especially since
path cache is also in that structure and needs evaluated object
to calculate cache.

In the future we should split edit data from visualization data,
but that's bigger refactor.
2018-05-11 12:49:25 +02:00
ff3e9d0d90 Particle edit: Fix missing update after undo
Old code was doing draw-time calculations in some cases.
just do the same for now.
2018-05-11 12:49:25 +02:00
96584818b7 Draw manager: Use explicit edit structure passed in 2018-05-11 12:49:25 +02:00
a55c588559 Depsgraph: Move edit mode pointers trickery to own functions 2018-05-11 12:49:25 +02:00
1c6414dd1b Draw manager: Get number of cached segments from edit
This way we know it's in sync with edit mode.
2018-05-11 12:49:25 +02:00
327789eaf8 Draw manager: Add utility function to check whether particle systems are to be drawn 2018-05-11 12:49:25 +02:00
bac9b04778 Add comment about weird special handling of scene freeing in depsgraph. 2018-05-11 11:36:48 +02:00
20b6eabd42 Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:36:48 +02:00
Dalai Felinto
8b41999ea0 Multi-Object: MESH_OT_loop_to_region by Oleg
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3253
2018-05-11 11:34:15 +02:00
17ac0e824b Modifiers: ported Corrective Smooth DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3339
2018-05-11 11:27:04 +02:00
Dalai Felinto
badd88ca02 Multi-Object: MESH_OT_screw by Nick Milios
With small changes.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3276
2018-05-11 11:25:58 +02:00
d5c1c0b10d Fix (unreported) broken freeing code for Sequencer.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.

Annoying in 2.7x, much more critical issue in 2.8!

Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
2018-05-11 11:23:11 +02:00
Dalai Felinto
eacb2eb423 Multi-Object: MESH_OT_select_loose by Falk David
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3276
2018-05-11 11:13:09 +02:00
e0a41fd0ce Modifiers: ported Decimate DerivedMesh → Mesh
Two things to indicate (which als apply before the DM → M port):

- Face count in the UI is not updated and stays at 0
- When planar mode is used, the result is inverted (mirrored along X)
  compared to 2.79

Reviewers: sybren

Differential Revision: https://developer.blender.org/D3303
2018-05-11 11:12:28 +02:00
Dalai Felinto
9d0d7c375e Multi-Object-Editing : MESH_OT_rip by Miguel Pozo
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3266
2018-05-11 10:59:00 +02:00
Dalai Felinto
1fd4449762 Fix memleak on MESH_OT_tris_convert_to_quads 2018-05-11 10:52:46 +02:00
d19c8605f8 Merge branch 'master' into blender2.8 2018-05-11 10:49:58 +02:00
13beeb5892 Fix (unreported) load image code calling icin/preview update from non-Main thread.
Icin/preview only works in main thread, while image loading can be done
from others too... This could have generated random crashes and such.
2018-05-11 10:48:04 +02:00
bcb245bd71 Assign totxxx mesh attributes in BKE_mesh_new_nomain
Reviewers: sybren
2018-05-11 10:37:36 +02:00
4fe5a105f6 Fix bad pointer cast when modifier is used on non-mesh object 2018-05-11 10:14:35 +02:00
b726ff4fc4 EditMesh: multi-object triangle fill
D3336 by @nabbydude
2018-05-11 08:41:04 +02:00
1d8e6c5cd0 EditMesh: multi-object select ungrouped
D3295 by @philippe-bachour
2018-05-11 08:21:26 +02:00
f2b5de6893 Cleanup: whitespace 2018-05-11 08:21:26 +02:00
6d155dc462 T54983: Bone selection overlay
Bone selection overlay is only available in pose mode.
and when active overrules the selection buffer.

This is currently `tricked` by switching the draw engines, but this is
an exception. Not sure how to solve this in a better way.

After this is solved we can look at how to localize the dim effect to only the objects connected to the active armatures. Currently it dims the whole screen (including background).

@campbellbarton I added you as reviewer as it you have done a lot in the DRW_draw_select_loop

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Subscribers: campbellbarton

Tags: #bf_blender_2.8, #code_quest

Maniphest Tasks: T54983

Differential Revision: https://developer.blender.org/D3241
2018-05-11 08:17:05 +02:00
266638d783 EditMesh: multi-object recalculate normals
D3298 by @leonlg
2018-05-11 08:08:01 +02:00
e161c51e7f EditMesh: multi-object select_interior_faces
D3334 by @ThaRemo
2018-05-11 07:59:16 +02:00
b5823c25f8 Cleanup: whitespace 2018-05-11 07:55:41 +02:00
33f3298e28 Cleanup: use 'uint' in draw manager 2018-05-11 07:48:52 +02:00
df10a2e030 Cleanup: style 2018-05-11 07:47:25 +02:00
83a83a3d4b Cleanup: whitespace, duplicate includes 2018-05-11 07:43:20 +02:00
8c96cb55c3 Fix add-manipulator cursor plane calculation
Now use the closest plane facing the view z axis.
2018-05-10 23:06:55 +02:00
be1af8d44c Fix error building 2018-05-10 21:43:15 +02:00
66636e665b Cleanup: Remove redundant parameter. 2018-05-10 16:32:13 -03:00
15580470fd Paint Stroke: Fix strokes drawing. 2018-05-10 16:29:14 -03:00
3f3326af1c EditMesh: add cube interactive tool
Initial add-cube tool which uses the scale cage to resize.

The 3D cursor is currently used to project the cursor onto.

We'll likely have more orientation options in the future.
2018-05-10 20:31:10 +02:00
4332edcc3e Cleanup: warning 2018-05-10 20:31:10 +02:00
d6a7491e78 Make current frame indicator smaller with rounded corners.
Reviewed by Joshua Leung
2018-05-10 19:42:21 +02:00
5df0fed47c Timeline Header Cleanup - Part 3: Consolidate options in a "Playback" popover
The "Playback" popover now combines options from several old menus
and scattered around in other places.
2018-05-10 19:28:37 +02:00
1ac0b4e2ba Timeline Header Cleanup - Part 2: Rearrange buttons (WIP)
NOTE: This is all still heavily WIP, and still requires some additional
layout engine magic to make it all nice.

* Moved current frame, and start/end frame buttons to the end
* Put playback controls in the center
* Remove other more obscure buttons (e.g. Frame menu, lock frame to frame range)

More to follow in next commit...
2018-05-10 19:28:36 +02:00
176cb0c3f8 Timeline Header Cleanup - Part 1: Move Keying Set + Autokeying Settings to Properties Region (NKEY)
Now all Keying Set and Auto Keyframing settings can be found the in NKEY
Properties Region (right-hand-side hidden tab/drawer).

This way, we have more room to display the full names of the settings,
without clogging up the timeline header.
2018-05-10 19:28:36 +02:00
e4c7cef748 Cleanup: warnings 2018-05-10 19:10:16 +02:00
334b1cf92f Cleanup: warnings 2018-05-10 19:07:03 +02:00
55389d4899 Transform: Make snapDerivedMesh use bvhtrees from loose edges and bvhtrees from loose verts.
Bvhtrees take up a lot of memory space, reusing the common bvhtree of looptris to snap to vertices and edges is a good way to save memory.
Unfortunately we have a worsening performance in the snapping operation around 63% (addition to the original time).
But as we often do not need to build a bvhtree of loose verts and loose edges, we have an improvement in cache time :)

Since the CPU time of snapping operations (no matter how higth poly the object is) corresponds to less than 0.01% of all CPU time of a blender frame, that change is not really significant.

Snapping operations on a mesh in edit mode have not changed significantly.

Signed-off-by: Germano <germano.costa@ig.com.br>
2018-05-10 13:40:30 -03:00
a35b9cc302 BKE: bvhutils: Added support for bvhtrees from loose verts and bvhtree from loose edges 2018-05-10 13:35:48 -03:00
be400a0789 UI: Fix time cursor number box styling for Clip Editor's Dopesheet/Graph views 2018-05-10 17:56:12 +02:00
c20cc3cf14 Merge branch 'master' into blender2.8 2018-05-10 14:27:24 +02:00
27da2db0ca 3D View: utility to get matrix from cursor 2018-05-10 12:24:07 +02:00
e6814acf13 Manipulator: API call to invoke on setup
Needed for manipulators that start out interactive,
similar use-case to modal operators, except these can be tweaked after.
2018-05-09 22:43:24 +02:00
80c9cd13da Manipulator: support direct cage3d adjustment
Scale cage relied on transform code,
this adds support for the manipulator corners being modified directly.
2018-05-09 22:37:09 +02:00
d824c80e9f Cleanup: Remove redundant bvh_cache initialization. 2018-05-09 13:28:59 -03:00
37cec42e3d Clay: Cleanup, reduce indentation level 2018-05-09 16:45:04 +02:00
2d5fe40601 Eevee: Cleanup, use NULL instead of static matrix
Those are the same thing now. So no need to keep initializing matrix
over and over.
2018-05-09 16:42:15 +02:00
cb747302dc Correct previous commit 2018-05-09 16:38:38 +02:00
734a232b39 Eevee: Cleanup, reduce indentation level 2018-05-09 16:36:09 +02:00
51445f42ac Workbench: Make hair populating function shorter and nicer 2018-05-09 16:21:24 +02:00
dda7b82dd7 Depsgraph: Tag object for copy-on-write update when toggling particle edit mode 2018-05-09 16:21:24 +02:00
5d71399c04 Depsgraph: Remove particle edit code from evaluation
Everything seems to be working without this, which makes since there is no
evaluation-time edit code in master. The only tricky part here would be that
this means we might want to ensure edit structure exists from inside particle
mode in draw manager.

Other point for not having this code in evaluation is that it's possible to
have same object evaluated in different contexts at the same time, and since
edit structures are supposed to be in original object we might run into
threading conflict.
2018-05-09 16:21:24 +02:00
c7ef9969b9 Particle edit mode: Make selection settings to work with CoW 2018-05-09 16:21:24 +02:00
Dalai Felinto
1ce1ae3d32 Rename: RNA_property_override_status > RNA_property_static_override_status 2018-05-09 16:18:02 +02:00
c67a0580fc Modifiers: ported Triangulate DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3237
2018-05-09 16:14:22 +02:00
Dalai Felinto
828a3d89b3 Fix T55015: Crash on selection after recent BVH changes
Runtime data should always be initialized to NULL on read-time.
2018-05-09 15:53:16 +02:00
0385b33f0b Fix broken 'check/validate libs' code with indirect libs.
Readcode always set relative paths of indirectly linked libs relative to
*current* .blend file, not to the library using it.

But BKE_library_filepath_set was then setting them relative to their
parent library, breaking checking code (and saved files even :((( ).
2018-05-09 15:52:29 +02:00
ed23bd5f3c Modifiers: ported Boolean DerivedMesh → Mesh
Reviewers: sybren

Differential Revision: https://developer.blender.org/D3236
2018-05-09 15:49:55 +02:00
8b4127abda Expanded BMALLOC_TEMPLATE_FROM_ME to accept two meshes 2018-05-09 15:44:49 +02:00
03fc491048 Outliner: move filter options to popover. 2018-05-09 15:17:17 +02:00
d3b80c4734 T55014: Optionally: objects not cast shadows in workbench 2018-05-09 15:14:43 +02:00
e8d9b7c954 Merge branch 'master' into blender2.8 2018-05-09 15:08:13 +02:00
6f891e2b87 Draw manager: Implement point selection modes for particle edit mode 2018-05-09 15:00:29 +02:00
5cea8bf435 Draw manager: Initial implementation of key points visualization
Does all points all the time, ignoring the setting in viewport header.
This is to be addressed by the next commit.
2018-05-09 14:59:48 +02:00
033c2c7131 Draw manager: Start using more explicit API for particle edit mode 2018-05-09 14:59:48 +02:00
65b0d31eb8 Modifiers: ported Hook DerivedMesh → Mesh
Differential Revision: https://developer.blender.org/D3235
2018-05-09 14:45:27 +02:00
69f2305415 Fix T54992: Lattice modifier on another Lattice object does not take the
Influence vertexgroup into account
2018-05-09 14:41:25 +02:00
0353ff5d2f BKE_id_free(): avoid UI and DEG calls when tagged with LIB_TAG_NO_MAIN
This prevents threading issues & crashes from modifiers that create
temporary meshes.
2018-05-09 14:40:03 +02:00
03abe89661 Merge branch 'master' into blender2.8 2018-05-09 14:37:25 +02:00
b73c7381cc EditMesh: multi-edit merge
D3226 by @pragma37

Note: edited so first/last option only applies to active mesh
since this doesn't make much sense to apply across objects.
2018-05-09 14:34:06 +02:00
34c474e695 Fix T54997: simple typo in property description 2018-05-09 14:26:47 +02:00
e65a2cb52c Fix crash moving grease pencil frames 2018-05-09 14:09:05 +02:00
5173861766 Cleanup: unused vars 2018-05-09 14:08:56 +02:00
5de2cd8ca7 Cleanup: quiet shadow warning 2018-05-09 13:53:01 +02:00
Dalai Felinto
e42b8c32ab Multi-object edit: MESH_OT_beautify_fill by Remi van der Laan
Maniphest Tasks: T54643, T54641
Differential Revision: https://developer.blender.org/D3291
2018-05-09 13:48:01 +02:00
Dalai Felinto
df49155cfb Multi-object edit: MESH_OT_loop_multi_select by Oleg
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3245
2018-05-09 13:41:33 +02:00
c0667c2f35 T55008: Migrating RE-Collection data to Scene data
in Scene DNA is available in scene.display New DNA Struct DisplayData
Added RNA (scene.display).

We already have scene.display_settings which contains non viewpoert
specific color management settings. I did not merge those two.

Patch should be in line with the ideas that @brecht wrote in T55008.

As I am not in detail aware of the decisions that have been made for the override feature I want a short review if it is in line with the plans.

Reviewers: brecht, dfelinto

Reviewed By: brecht

Subscribers: brecht

Tags: #code_quest, #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3290
2018-05-09 13:38:06 +02:00
Dalai Felinto
56d65719b3 Multi object edit: MESH_OT_region_to_loop by Oleg
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3248
2018-05-09 13:03:44 +02:00
Dalai Felinto
dcf1210c44 Multi-Object Pose: POSE_OT_select_parent by Harsha
Differential Revision: https://developer.blender.org/D3283
2018-05-09 12:53:22 +02:00
74234688de Modifier stack: ShrinkWrap: move to mesh-based BVHTree code.
Now only subsurf still needs some DM...
2018-05-09 12:51:53 +02:00
aab5ac25f2 Remove Frame Server
This feature is limited (only byte PPM output, no multi-view),
only works with specific configurations.

This also causes some maintenance overhead
when testing changes to the render pipeline.
2018-05-09 12:50:26 +02:00
e53cf14280 Cleanup/refactor: Move get_mesh_eval_for_modifier from MOD_util to BKE_modifier.
Because some modifiers' actual code is in BKE... Also renamed to more
BKE-valid name BKE_modifier_get_evaluated_mesh_from_object.
2018-05-09 12:47:23 +02:00
1cc7d7d5ec Surface Deform mod: removed some stuff that shouldn't have been committed 2018-05-09 12:41:32 +02:00
2862b58a38 Mesh Deform modifier: also show result while editing the deformation mesh
There is still an issue with the modified mesh not being updated until you
disable and re-enable the modifier. However, after that it'll now also work
while editing the deformation mesh.
2018-05-09 12:39:52 +02:00
b586c81fbc Fix (unreported) bug in BVHTree 'free tessfaces' flag setting.
Same issue as in DM-based on, so follow up of rBf3efa9e15f58...
2018-05-09 12:36:05 +02:00
21298978f6 Merge branch 'master' into blender2.8 2018-05-09 12:35:16 +02:00
f3efa9e15f Fix (unreported) bug in BVHTree 'free tessfaces' flag setting.
Could lead to atempt to free NULL pointer, and/or memory leak.
2018-05-09 12:33:21 +02:00
632755a3b1 Modifiers: ported Surface Deform to Mesh
The modifier performed the 'bind' operation not in the bind operator,
but delayed in the mesh evaluation. This saved the result in a CoW copy
instead of in the actual modifier data. The binding operator now follows
the same approach as Mesh Deform: it forces the modifiers to run on the
real (non-CoW) data, making it possible for the modifier to store the
binding data.

This commit also ports the usage of DerivedMesh to Mesh.
2018-05-09 12:17:24 +02:00
Dalai Felinto
5e915baec4 Multi-Object-Editing: MESH_OT_separate by Nick Milios
Patch description:

- Reports "Nothing selected" only when all objects has no selection
  and it is in  Separate type(Mode)
- Tested all types (Seperate/By Material/By loose parts)
- Instead of using

```
BKE_view_layer_array_from_objects_in_edit_mode_unique_data
```

I used

```
BKE_view_layer_array_from_bases_in_edit_mode_unique_data
```

Because it needs the "Base" not the "Object" itself.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3267
2018-05-09 12:13:09 +02:00
Dalai Felinto
944054fbb6 Multi-Object-Editing: MESH_OT_vert_connect by Nick Milios
With changes: Skip loop when totvertsel is not 2

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3273
2018-05-09 11:48:39 +02:00
Fulk33
ab8dded330 EditMesh: multi object spin support by Falk David
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3279
2018-05-09 11:33:46 +02:00
0d4b165d4f Merge branch 'master' into blender2.8 2018-05-09 11:25:35 +02:00
b59b812400 MSVC: resolve near/far issue take2
Previous fix failed w/ compositor,
tested on MSVC2015, full build.
2018-05-09 11:23:32 +02:00
Dalai Felinto
1cbe3b6e03 Multi-Object-Editing : Support for Grid Fill by Falk David
With minor changes:
* Have BMOperator declaration close to its initialization.
* Move const use_prepare and const use_interp_simple outside the for loop.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3222
2018-05-09 10:53:38 +02:00
Dalai Felinto
dd93c80747 Multi-Object-Editing: MESH_OT_edges_select_sharp by Jefferson Rausseo
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3280
2018-05-09 10:39:35 +02:00
49fc1d0f54 Draw manager: Initial implementation of particle edit mode
Gets edit more from the current object and displays it as a path.
this is how both hair and particle edit modes are supposed to work.

This only covers path itself, it doesn't do anything like keys
visualization or selection. However, it's already possible to
comb and such.

Only implements particle mode. There are also some settings to
do soft body and cloth. No idea yet what that all is about.

Copy-on-write is not supported either, this is due to some
edit mode ownership problems which are to be addressed from
dependency graph side.

Shading is dead-simple: uses tangent as a color. This is where
i hope to get some help from Clément.
2018-05-09 10:34:45 +02:00
afdc5c148b Draw manager: Use utility function to get particle edit mode
Makes it more local where we have to do all the tricky checks.
2018-05-09 10:34:45 +02:00
43c6ba9eed Draw manager: Add support for cached particle edit paths
Before it was only supporting hair strand paths editing.
2018-05-09 10:34:45 +02:00
25eb6d01f5 Draw manager: Correct edit mode check for particles 2018-05-09 10:34:45 +02:00
283158ecc1 Draw manager: Ignore particles when object is in particle edit mode 2018-05-09 10:34:45 +02:00
9c1c6d89a1 Draw manager: allow creation of hair batch cache from edit mode 2018-05-09 10:34:45 +02:00
b150c497dc Draw manager: De-duplicate segment counting 2018-05-09 10:34:45 +02:00
5e1445e374 Draw manager: Completely de-duplicate strands caching for parent and particles
Will make it simple to add strands from edit mode as well.
2018-05-09 10:34:45 +02:00
17d13e4107 Draw manager: Move parent particle cache fill into an own function
Should make it fairly simple to make it re-usable by children particles.
2018-05-09 10:34:45 +02:00
81e6aa1600 Draw manager: Use single function to calculate particles UVs
Will allow us to merge two code paths more easily.
2018-05-09 10:34:45 +02:00
ca5c3f767c Draw manager: Move emit_from checks to interpolation functions
Keeps main function shorter.
2018-05-09 10:34:45 +02:00
0868ccae13 Draw manager: Move UVs interpolation of child particles to a function 2018-05-09 10:34:45 +02:00
e3eaca976a Draw manager: De-duplicate calculation of parent UVs 2018-05-09 10:34:45 +02:00
cf043d51c2 Draw manager: Make parent and child particles code to be more equal
Make parent UVs calculation for simple children to match another block.
2018-05-09 10:34:45 +02:00
94553750c7 Draw manager: More meaningful variable name 2018-05-09 10:34:45 +02:00
ecc24242bb Draw manager: Reduce indentation level in particle batch populate 2018-05-09 10:34:45 +02:00
Dalai Felinto
6539c1fc41 Multi-Object-Editing : Support for MESH_OT_rip_edge by Miguel Pozo
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3268
2018-05-09 10:30:49 +02:00
d152a326f9 Modifier stack: remove last usage of DM in WeightVGProximity . 2018-05-09 10:11:10 +02:00
Dalai Felinto
4da2aec2bb Multi-Object-Editing: select_non_manifold by Jefferson Rausseo
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3232
2018-05-09 10:04:35 +02:00
a92557f77b Merge branch 'master' into blender2.8 2018-05-09 10:02:33 +02:00
598216c36e MSVC: remove hack for near/far name collision
windows headers define these, conflicting w/ View3D.near/far.
2018-05-09 10:00:55 +02:00
80844fdfc0 Color: Combine/Separate YCbCrA node default to rec. 709
This commit is part of T54798

Differential Revision: https://developer.blender.org/D3183
2018-05-08 22:24:58 -04:00
2d2875fc15 BKE: bvhutils: Always return NULL when the BVHtree has no leafs.
BLI_bvhkdop functions were not made to work with zero-leaf trees.
Perhaps a better solution would be to modify BLI_bvhkdop to work with zero leaf trees.
But this solution of returning NULL was already used for bvhtrees of looptris.
2018-05-08 20:31:26 -03:00
d1cd872fef ED_transform: Port ED_transform_snap_object to new Mesh-based system.
Differential Revision: https://developer.blender.org/D2896
2018-05-08 20:04:32 -03:00
7fd19bcbe1 BKE: bvhutils: Port bvhtree_from_mesh_get to take a Mesh param instead of a DerivedMesh.
Differential Revision: https://developer.blender.org/D3227
2018-05-08 20:00:51 -03:00
579c01da60 Extrude Widget: with/without axis constraint 2018-05-08 20:30:29 +02:00
b7b59a72f3 Extrude Widget: tweak draw style
Use filled circle for redo
2018-05-08 20:30:29 +02:00
4f213c1495 Cleanup: naming (prefer len over num for new code) 2018-05-08 19:36:02 +02:00
305c455ffe Cleanup: mesh_runtime naming
- BKE_mesh_get_looptri_num        -> BKE_mesh_runtime_looptri_len
- BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc
- BKE_mesh_get_looptri_array      -> BKE_mesh_runtime_looptri_ensure
2018-05-08 19:26:36 +02:00
65ae4e27b0 Missed last commit 2018-05-08 19:16:33 +02:00
6e88075618 Merge branch 'master' into blender2.8 2018-05-08 19:15:58 +02:00
9a055d1abc Modifier stack: partial port of ShrinkWrap to new Mesh-based system.
Partial only, complete depends on BVHTree helper updates, and subsurf
updates.
2018-05-08 19:04:12 +02:00
f7727b5366 Modifier stack: Port Warp to new Mesh-based system. 2018-05-08 18:41:43 +02:00
8f7e4b314b Modifier stack: port Mask to new Mesh-based system. 2018-05-08 18:19:28 +02:00
e0a436fcff Cleanup: includes 2018-05-08 18:01:47 +02:00
0012082c10 Cleanup: move mesh conversion into own function 2018-05-08 17:54:25 +02:00
5f2a2e048d Modifier stack: Port Caqst to new Mesh-based system. 2018-05-08 17:52:53 +02:00
e6d11c6ce6 Collections: remove per collection and view layer engine overrides.
This will be handled by the new view layer override system which will
store data elsewhere, removing the code already for easier refactoring.
2018-05-08 17:46:20 +02:00
03dd109a84 Cleanup: consistent BKE_mesh naming 2018-05-08 17:28:43 +02:00
00127d03f1 Cleanup: use bool for BKE_mesh_new_from_object 2018-05-08 17:17:40 +02:00
7522af49a3 Cleanup: rename variables
DerivedMesh had some odd conventions, remove from BKE_mesh.
2018-05-08 17:15:23 +02:00
0e964afaa4 Cleanup: use 'nomain' when not in library data
Rename only.
2018-05-08 17:06:30 +02:00
fa69ce9e3a Cleanup: whitespace, duplicate includes 2018-05-08 16:57:07 +02:00
5b3559576d Modifier stack: Port Smooth to new Mesh-based system. 2018-05-08 16:42:01 +02:00
43be434310 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blender/modifiers/intern/MOD_uvproject.c
2018-05-08 16:06:32 +02:00
4e4a93bc45 Fix building with latest versions of ffmpeg.
Some years-old deprecated stuff has now been removed.

Correct solution is probably to use valid defines etc. in own code, but
this is more FFMEPG maintainer task (since it also may change how old
FFMPEG we do support...).
2018-05-08 16:00:52 +02:00
a48186c5d7 Orientation for 3D cursor
Currently set when setting the cursor location,
optionally used as an orientation type.

Intended for use by tools too.

See: D3208
2018-05-08 15:35:04 +02:00
43e0e8defa Fix (unreported) bloody modifiers messing with ID user count in copy.
User count of IDs is handled by higher-level, generic function,
low-level copydata functions *MUST NOT* touch them anymore, ever!
2018-05-08 15:27:10 +02:00
53a56b7b6c Merge branch 'master' into blender2.8 2018-05-08 15:20:18 +02:00
3740f7593d Cleanup: Nuke empty dummy wrappers around modifier_copyData_generic().
This also changes signature of modifier copy callback, first (source)
parameter is now a const, which is saner anyway!
2018-05-08 15:04:10 +02:00
d89f9d70c5 Eevee: Fix bug with transparent object + volume rendering.
This was because the main_fb was not bound back to be updated.
Following draw calls were drawn without depth buffer.
2018-05-08 14:31:17 +02:00
b857b8f4c4 Merge branch 'master' into blender2.8 2018-05-08 14:22:46 +02:00
49fe27ee46 Modifiers: sanitize/cleanup modifiers' copying & freeing code.
Should also fix T55000: Crash with hooks and curves in Cycles render.
2018-05-08 14:22:14 +02:00
cc8672b95e Fix T54999: error when entering edit mode in texture shading
When entering edit mode the texture coordinates is not calculated by
drawcachemesh. For now fallback to solid mode. This gives wrong
artifacts when disabling overlays when in edit mode. We should make it
possible to calculate the UVLOOP from bmesh. This will be done in a next
patch
2018-05-08 14:02:45 +02:00
e04ea9d3c3 Merge branch 'master' into blender2.8 2018-05-08 13:33:48 +02:00
5358026511 Cleanup: quiet -Warray-bounds warning 2018-05-08 13:32:52 +02:00
c51b017a1a WeightVG modifiers: Cleanup, add asserts to validate expected data status... 2018-05-08 12:58:48 +02:00
7d9f1a699a Clenup: typos. 2018-05-08 12:58:48 +02:00
002dcd2001 Modifiers: pass the ob->data to the modifier if the mesh param is NULL
This enables the modifiers to access things like vertex groups. Care should
be taken to not modifier the mesh itself in this case.
2018-05-08 12:34:06 +02:00
9a79178c2e Armature: Add back Stick bone draw type.
The actual code is a bit convoluted but allows good and "pseudo efficient"
drawing. (pseudo efficient because rendering instances with that amount of
vertices is really inneficient. We should go full procedural but need to
have bufferTexture implemented first) But drawing speed is not a bottleneck
here and it's already a million time less crappy than the old (2.79) immediate
mode method.

Instead of drawing actual wires with different width we render a triangle
fan batch (containing 3 fans: bone, head, tail) which is then oriented in
screen space to the bone direction. We then interpolate a float value
accross vertices giving us a nice blend factor to blend the colors and
gives us really smooth interpolation inside the bone.

The outside edge still being geometry will be antialiased by MSAA if enabled.
2018-05-08 12:18:35 +02:00
d8706f5407 Modifier stack: port Displace to new Mesh-based system. 2018-05-08 12:01:06 +02:00
cd5b57b4fc Fix recent Curve porting: mesh pointer may also be NULL in non-EditMode case. 2018-05-08 12:01:06 +02:00
0cd3412d4c Mod_util: Add back vcos parameter to get_texture_coords_mesh().
Now we use vcos when provided, and fall back to mesh vertices' co
otherwise.

Deform modifiers usually do not have up-to-date coordinates in Mesh
itself, only in given vcos array!
2018-05-08 12:01:06 +02:00
029d3fa8b6 Mesh normals: clear runtime dirty normal flag also when computing clnors. 2018-05-08 12:01:06 +02:00
1d95dfc97b Merge branch 'master' into blender2.8 2018-05-08 11:59:22 +02:00
59ce30f32b Tracking: Use bmain from context 2018-05-08 11:58:42 +02:00
9401021f8b Clay: Simplify matcap manipulation
No need to hard-coded handling of every individual matcap.

They are in the continuous index range anyway.
2018-05-08 11:56:58 +02:00
1fd1d061ac Clay: Don't use hardcoded constant in the string
Stringify the actual constant instead.
2018-05-08 11:56:58 +02:00
Dalai Felinto
847f028b71 Multi-Object-Editing: select random by Jefferson Rausseo with changes
Aside from identation, seed should change for each object. Otherwise to objects
with a copied mesh would get the exactly same "random" selection.

And we do so in a consistent way so it doesn't vary depending on
object order.

Seed bump using hash suggested by Campbell Barton and Sergey Sharybin.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3231
2018-05-08 11:51:21 +02:00
1c0be0e90f Ported Mesh Deform modifier
This modifier still has issues that are not related to this port:

- While editing the deformation mesh, the deformed mesh doesn't update.
  This update only happens after exiting edit mode, making editing
  cumbersome.
- Binding doesn't work yet. It works fine when binding in master and
  loading pre-bound in 2.8. This was also an issue before this port, and
  will be investigated separately.
2018-05-08 11:46:28 +02:00
abb58eec53 looptri + bvhtree support for Mesh 2018-05-08 11:36:48 +02:00
Dalai Felinto
d915aa57f8 Multi-Object-Editing: vertices smooth by Jefferson Rausseo
Changes by me:
* Identation (tabs not space)
* Moving RNA_.*_get outside for loop)

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3230
2018-05-08 11:33:27 +02:00
Dalai Felinto
9a125ca5fe Multi-Object-Editing : Extrude Repeat by Falk David
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3224
2018-05-08 11:24:41 +02:00
271624b0f6 Prevent segfault when opening file browser while a 2.79 file was loaded.
Loading a file that was written with the master branch into the 2.8 branch,
and then trying to load or save, caused a segfault.
2018-05-08 11:18:45 +02:00
Dalai Felinto
faaffc4011 Edit Mesh: multi-object rotate_uvs support by Pablo Dobarro
Changes by me: Moving RNA_.*get outside for loop and indentation fix.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3221
2018-05-08 11:15:00 +02:00
Dalai Felinto
63951bc987 Edit Mesh: multi-object reverse_uvs support by Pablo Dobarro
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3220
2018-05-08 11:09:35 +02:00
fdc967e616 Modifiers stack: port Curve to new Mesh-based system. 2018-05-08 11:05:49 +02:00
50e31136fd Rename BKE_bmesh_to_mesh to BKE_bmesh_to_mesh_nomain.
Let's be clear about functions generating datablocks outside of Main
database.
2018-05-08 11:04:20 +02:00
cf7c3462ed BKE_mesh_new → BKE_mesh_new_nomain
Including 'nomain' in the name explicitifies that the returned mesh is
NOT stored in any library.
2018-05-08 11:00:34 +02:00
86b9311926 Cleanup: quiet warning, whitespace 2018-05-08 10:58:04 +02:00
77cc265f18 Fix crash cancelling search, caused by D3207 2018-05-08 10:48:53 +02:00
66b1cd45fb Added BKE_mesh_ensure_normals()
This calls BKE_mesh_calc_normals() only if the mesh vertex normals are
marked as dirty.
2018-05-08 10:47:00 +02:00
42dfbf79c3 Added BKE_mesh_new()
This function creates a Mesh struct with a number of vertices/edges/etc.
It allocates the minimal number of CD layers needed.

Currently not yet used, but will be soon in the upcoming
BKE_new_mesh_from_curve_displist().
2018-05-08 10:47:00 +02:00
Dalai Felinto
f309c34cfe Multi-Object-Editing : Support for MESH_OT_solidify by Lucas Boutrot
Maniphest Tasks: T54641, T54643
Differential Revision: https://developer.blender.org/D3218
2018-05-08 10:40:30 +02:00
Dalai Felinto
a0a78f6da4 Multi-Object-Editing Support for MESH_OT_wireframe by Lucas Boutrot
Maniphest Tasks: T54641, T54643
Differential Revision: https://developer.blender.org/D3217
2018-05-08 10:35:51 +02:00
Dalai Felinto
9fc0c0c3de Edit Mesh: multi-object faces_shade_flat support by Pablo Dobarro
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3219
2018-05-08 10:13:44 +02:00
Dalai Felinto
853e55b043 Multi-Object Editing: subdivide edgering support by Henry @Skippi
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3215
2018-05-08 10:07:29 +02:00
Dalai Felinto
848d9cda0e Multi object editing - face dissolve support by Mateusz Grzeliński
Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3214
2018-05-08 09:51:55 +02:00
65e3af35b0 Extrude Widget: subscribe to operator settings
Needed so changing orientation refreshes.
2018-05-08 09:21:19 +02:00
b626360857 Add note about compat code in uber eval causing modifiers to be applied twice 2018-05-08 02:47:49 -04:00
6feb6235e1 WM: log message bus operations 2018-05-08 08:34:06 +02:00
6f57d12e2e Merge branch 'master' into blender2.8 2018-05-08 07:53:48 +02:00
433aaa8c2e Cleanup: remove unused wmReport struct 2018-05-08 07:52:13 +02:00
05ec0108dc WM: refresh tool on object mode switch
The tool manipulator could become disabled when set in the wrong mode.
2018-05-08 07:27:53 +02:00
469d43b1db WM: publish Object.mode changes on mode switching 2018-05-08 07:22:52 +02:00
bf593a8631 WM: quiet GCC redundant declaration warnings 2018-05-08 07:18:49 +02:00
Dalai Felinto
7f5c469716 Multi-Object-Editing : Support for Edge Dissolve by Lucas Boutrot
With minor indentation changes by me.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3211
2018-05-07 21:57:36 +02:00
Dalai Felinto
5f59a8bb11 Multi object editing - verticle dissolve support by Mateusz Grzeliński
With changes by me:
* Indentation (tabs)
* Removing RNA_boolean_get tests out of the for loop.
* Continue iterator if no selected vertice.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3210
2018-05-07 21:50:20 +02:00
eefaec4114 Extrude Widget: Add orientation to topbar
Add extrude operator that's intended to work on the current selection
and be activated as a tool.
2018-05-07 21:40:51 +02:00
170223804b Extrude Widget: orient correctly w/ rotated object 2018-05-07 21:40:51 +02:00
036eb6f2f8 Extrude Widget: don't show when moving 2018-05-07 21:40:51 +02:00
50e28092d3 Cleanup: style 2018-05-07 21:40:51 +02:00
Dalai Felinto
e4c4e8566f Multi Object Smooth shading by Ethan Brierley
With small changes by Dalai Felinto.

Differential Revision: https://developer.blender.org/D3213
2018-05-07 21:30:29 +02:00
3299b0f0dc Fix: Select all didnt' work with COW pose bones 2018-05-07 19:03:36 +02:00
da89fac348 Update Flatty Light theme with topbar and minor tweaks 2018-05-07 18:46:40 +02:00
3c79043f1b DRW: Fix incorrect blending function reset. 2018-05-07 18:29:45 +02:00
3800be695b Modifier stack: move vgroup editing modifiers to new Mesh-based system.
Some notes here:
* Proximity with non-mesh objects (like curve, see TEST_2 scene in
weightvg testfile) are not working currently. This is known TODO of COW
depsgraph project.
* Proximity modifier is slower, due to some other TODO pending on
BVHTree creation/caching for Mesh.
2018-05-07 18:18:05 +02:00
15f9ca05d1 Modifier stack: add new get_texture_coords_mesh() helper.
Will eventually fully replace get_texture_coords().
2018-05-07 18:18:05 +02:00
ac6d59db69 Fix ARMATURE_OT_layers_show_all now works with COW 2018-05-07 18:06:22 +02:00
56f7b4616a Merge branch 'master' into blender2.8 2018-05-07 18:04:16 +02:00
b49184b608 Merge branch 'master' into blender2.8 2018-05-07 18:02:48 +02:00
c09e22306a Fix (unreported) memleak when copying object with some modifiers. 2018-05-07 17:59:23 +02:00
f62b826533 Merge branch 'master' into blender2.8 2018-05-07 17:54:10 +02:00
f74d85ffc8 Cleanup: rename char/float conversion functions
- FTOCHAR       -> unit_float_to_uchar_clamp
- F3TOCHAR3     -> unit_float_to_uchar_clamp_v3 (swap args)
- F4TOCHAR4     -> unit_float_to_uchar_clamp_v4 (swap args)
- FTOUSHORT     -> unit_float_to_ushort_clamp
- USHORTTOUCHAR -> unit_ushort_to_uchar
2018-05-07 17:51:40 +02:00
905eeb0bc7 Cleanup: move unit char/short/float to functions
This caused GCC 8.1 to crash at build time,
but was also not very nice use of macros.
2018-05-07 17:50:25 +02:00
b0b2a47853 Armature: Transparent Bone: Fix envelope not being alpha blended. 2018-05-07 17:12:04 +02:00
8ab3697e21 Armature: Add new Transparent Bone overlay option.
This is half the replacement of the old wireframe mode. It's not doing any
XRay drawing at the moment.
2018-05-07 17:00:10 +02:00
2f76e95b96 DRW: Do not multiply alpha or color by alpha if not in blend more. 2018-05-07 17:00:10 +02:00
29c650c3cc DRW: Add DRW_pass_state_add and DRW_pass_state_remove 2018-05-07 17:00:10 +02:00
6c2588761c Fix: Left in debug prints 2018-05-07 16:55:13 +02:00
e7eee7764a Fixes for motion path evaluation (part of T54810 work)
This commit brings back motion path calculations working on same level
as 2.7x.  Caveats:
* You cannot actually see anything, as all the drawing code for motion
  paths was removed and not reimplmented in 2.8 draw engines yet
* This doesn't actually use a separate depsgraph instance for fast
  background calculations yet. That's a separate topic, and will require
  further investigation (probably after code quest, according to original
  planning).
* The work here *does* however pave the path forwards towards fully separate
  COW evaluation though. We only need to stub in a different depsgraph instance
  here to get things working.
2018-05-07 16:52:51 +02:00
193af4ddc8 Fix: Tag armature for copy on write when selecting bones, so active bone gets updated
see 8a2d2f1bb4 for similar

Reviewers: aligorith, sergey

Reviewed By: aligorith

Maniphest Tasks: T54812

Differential Revision: https://developer.blender.org/D3204
2018-05-07 15:58:24 +02:00
d9998f24ab Fix Movieclip editors 'graph' and 'dopesheet' view using themes region
background setting

mentioned in T54942

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3200
2018-05-07 15:03:05 +02:00
b2443f0248 Fix T54525: crash when setting number of frames to use between dupoff
frames

caused division by zero if both dupli_frames_on and dupli_frames_off are
zero. doing this doesnt seem useful, dupliframes can be disabled in
other ways.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3132
2018-05-07 15:03:05 +02:00
c4440cf783 UI: add particle mode popovers 2018-05-07 15:01:51 +02:00
9f4d92bb92 Workbench: Texture Shading mode
- draws the active texture of the material
- if the texture cannot be found it will fallback to solid/material
2018-05-07 15:00:16 +02:00
f09d3a7a40 Workbench: Texture Shading mode 2018-05-07 14:59:27 +02:00
66ec3c7e7f Fix Movieclip editors 'graph' and 'dopesheet' view using themes region
background setting

mentioned in T54942

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3200
2018-05-07 14:57:05 +02:00
1f76e6c326 Fix T54525: crash when setting number of frames to use between dupoff
frames

caused division by zero if both dupli_frames_on and dupli_frames_off are
zero. doing this doesnt seem useful, dupliframes can be disabled in
other ways.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3132
2018-05-07 14:49:09 +02:00
13aa3de697 Modifier stack: port 'normals edit' to new Mesh-based system.
Note that custom normals drawing seems to be broken, and there also are
some refresh issues in some cases... But this is same with old DM-based
code, so not related to modifiers themselves probably.
2018-05-07 14:37:56 +02:00
ca6dfa2e85 Clear dirty normals flag from Mesh at least in main BKE_mesh_calc_normals(). 2018-05-07 14:37:56 +02:00
580d10e6b6 Change mesh dirty runtime flags to signed int64_t.
Because CD_MASK_XXX are signed longlong, so when assigning to unsigned
longlong you get grumpy compiler errors!
2018-05-07 14:37:56 +02:00
77f2f23a7e Merge branch 'master' into blender2.8 2018-05-07 14:29:54 +02:00
6c243b7e40 More tweaks to strict compiler flags 2018-05-07 14:28:22 +02:00
57013c0a39 Merge branch 'master' into blender2.8 2018-05-07 14:20:47 +02:00
592c3881ba Silence compilation error around possible fall-through 2018-05-07 14:19:12 +02:00
1a3fb3e8b1 Fix wrong comparison of drop target URI on X11
Need to compare, NOT to override passed file name.
2018-05-07 14:11:33 +02:00
Julian Eisel
5003f894e7 Fix crash in debug drawing of fullscreen exit icon
Steps to recreate were:
* Go into fullscreen mode (Alt+F10)
* Open debug menu (Ctrl+Alt+D)
* Set value to 1
* Confirming should crash (at least in debug builds)
2018-05-07 13:49:52 +02:00
Julian Eisel
8bd229cadc Remove alternative action-zone drawing for collapsed regions
Was hidden behind debug values 1, 2 and 3.

Also cleaned up logic in region_azone_edge_initialize. It was using a variable
called is_hidden that actually should've been called is_visible.
2018-05-07 13:49:52 +02:00
b029cc5d74 Eevee: Hair: Fix wrong color when shader is compiling. 2018-05-07 13:08:21 +02:00
9215b41dd3 Armature: Fix BBones base face winding.
Was producing wrong outline and backface culling.
2018-05-07 13:08:21 +02:00
5c728358ec Armature: Remove big outlines for active bones & reduce axes color. 2018-05-07 13:08:21 +02:00
cd3f5983cd Fix Bevel percent mode bug 54228
Previous new adjust pass commit should have excluded percent mode.
2018-05-07 07:05:41 -04:00
8268526d22 Fix T54324: remove stencil entries from weight paint keymap
Reviewed By: mont29

Differential Revision: http://developer.blender.org/D3178
2018-05-07 12:40:06 +02:00
2496c08c39 Modifier stack: move Edge Split to new Mesh-based system. 2018-05-07 12:29:20 +02:00
4e2125e967 Modifier stack: Fix broken 'dirty normals' flag for new mesh-aware modifiers.
Since modifier stack is still primarily based on DM in blender2.8, we
need to copy over 'dirty normals' flag from temp Mesh to DM after
modifier has been evaluated.
2018-05-07 12:29:20 +02:00
9eb5aa32b8 Fix T54324: remove stencil entries from weight paint keymap
Reviewed By: mont29

Differential Revision: http://developer.blender.org/D3178
2018-05-07 12:28:15 +02:00
68c5503570 Merge branch 'master' into blender2.8 2018-05-07 12:26:06 +02:00
ea1751a038 Fix T54594: Lattice with Armature modifier not updating correctly 2018-05-07 12:05:09 +02:00
Julian Eisel
51efeb6834 UI: Hide & shrink scroll-bars based on cursor position
Scroll-bars are now hidden unless the cursor approaches them, in which case they
smoothly grow and become more & more visible. Note that since 0d309144020168e55,
scroll-bars are drawn on top of editor contents. There's no more jumping of
buttons when scroll-bars appear.

Technical notes:
* AZones are used to adjust scrollbars based on mouse movements

  We may want to support screen level AZones if we want scrollbars to also
  smoothly appear when approaching them from a different area.
  I also plan to make further changes to AZones to clean up stuff a bit.
* Had to move AZone handling to a post ARegion init stage, since we need the
  updated View2D data from there.
* View2D masks and scroller rectangles are now updated on every redraw. It's
  cheap to do that though.
2018-05-07 11:42:12 +02:00
Julian Eisel
4ec467d3b5 UI: Draw scroll-bars overlapping with editor content
Scroll-bars used to draw in a little extra space in the editor, causing
buttons to jump a bit when they appeared/disappeared. Now they draw on
top of the buttons, just small enough to avoid bigger overlaps. Followup commits
will do further adjustments.

With this we can get rid of a hack that was calling the (often Python
defined) panel definition - the panel 'draw' callback - twice.
2018-05-07 11:42:12 +02:00
Dalai Felinto
2349b9777a Multi-object edge collapse 2018-05-07 11:26:07 +02:00
83345b463e Merge branch 'master' into blender2.8 2018-05-07 11:15:31 +02:00
a3b4c3823c Fix T54966: mathutils.noise.voronoi Memory leak
C code was not correctly handling release of temp data, not technically
a memory leak, but indeed rather annoying bug! ;)
2018-05-07 11:07:11 +02:00
e3d30ffb92 Armature: Add back relationship lines. 2018-05-07 00:24:41 +02:00
17370a27a3 Object Mode: Use stipple shader for relationship lines. 2018-05-07 00:24:41 +02:00
Dalai Felinto
bcd5878aea Reset number values when entering an empty value
Note: This rely on the property having a pre-defined default.

Also, be aware that trying to multi-drag and multi-ui-edit is not working
at the moment (T54976).

With changes by Campbell Barton.

Differential Revision: https://developer.blender.org/D3207
2018-05-06 22:08:54 +02:00
Dalai Felinto
7b37beec9c RNA default: Scene start/end frames 2018-05-06 21:40:45 +02:00
77c2acdfae Fix wrong header alignment in user preferences, after recent commit. 2018-05-06 21:26:10 +02:00
b3e8bd98e8 UI: fix popover menus sometimes going off screen, after recent commit. 2018-05-06 20:43:51 +02:00
9facbcff80 UI: keep header top/bottom alignment the same when switching editor types. 2018-05-06 20:22:43 +02:00
a9ea7864ae Merge branch 'master' into blender2.8 2018-05-06 20:15:14 +02:00
c9ed78733c UI: fixes for 3D viewport popovers moving / flipping on edits.
* Ensure popover does not change direction or location.
* Open popover towards the relevant editor, like pulldown menus.
* Use a bigger maximum assumed size to deal with some corner cases.
* Do proper 3D viewport header refresh on shading mode changes.
2018-05-06 20:14:58 +02:00
16e220c959 Cleanup: deprecate area.headertype.
This was still used in a few places but not kept in sync with the actual
header position. Always get alignment from the header region now.
2018-05-06 20:14:58 +02:00
9bd2e9104a Nodes: show node labels (like image name) in material properties node view. 2018-05-06 19:28:23 +02:00
a3e74acd9e Merge branch 'master' into blender2.8 2018-05-06 18:35:39 +02:00
c769b1a553 Armature: Add a special Pass for bone axes.
In object mode, the axes are drawn like any other wire objects with
depth test and depth write. Thus enabling MSAA to work but not their xray
behaviour.

In edit armature/pose mode, draw smooth line without depth testing. This
produces wrong draw ordering problem but still gives the desired xray
behaviour. We do it outside of the MSAA pass since the xray behaviour is not
compatible with it. But we are drawing smoothed lines so no need for MSAA.
The lines are 2px thick and improve readability.
2018-05-06 18:42:23 +02:00
48ddb2b98a Armature: Fix bone axes not using bone color. 2018-05-06 18:36:47 +02:00
1c3f953565 Armature: Put passes in a struct easier to pass around. 2018-05-06 18:36:47 +02:00
2bc0c4ec59 DRW: Add DRW_STATE_WIRE_SMOOTH to draw smooth wires.
This is only useful if depth test/wire is disabled.
2018-05-06 18:36:47 +02:00
c472936074 Armature: Fix/Change bone axes display.
Now the axes are displayed correctly at the tip of the bone and with the
axes names.

I've made some modifications though:
- Axes are colored. (should not be in object mode but that's TODO)
- Axes ends are not flat arrows anymore. Replaced with a small diamond.
- Axes names are now scale by their respective axes instead of being
  affected by other axes.
- Changed axes names "font" to be a bit more sexy.
2018-05-06 18:36:47 +02:00
046904e3fc Cleanup: split rotation_from_view
Add a function that takes only a quat, instead of the 3D view.

Allows for using non-view orientations.
2018-05-06 18:32:18 +02:00
1a81ac7d9a Fix update for manipulator w/ 3D cursor change 2018-05-06 16:41:32 +02:00
2fe954f23e Cleanup: transform manipulator filename
Use matching 2d/3d suffix.
2018-05-06 16:14:10 +02:00
99190f9345 Correct extrude poll function 2018-05-06 16:14:10 +02:00
37c5145ef2 Workbench: if no material is available, use color 0.8 like default material. 2018-05-06 16:08:12 +02:00
4462c38e55 Fix use of removed Blender Internal property. 2018-05-06 16:08:12 +02:00
bb3a030306 Fix issue with hidden headers after previous commit. 2018-05-06 16:08:12 +02:00
541258bfa6 Merge branch 'master' into blender2.8 2018-05-06 16:00:27 +02:00
84474b0171 Object Snap: add object & matrix to view ray cast
Some snap functions already exposed this.
2018-05-06 15:56:09 +02:00
f28d209591 UI: region overlap now works for headers as well.
This is for the 3D viewport and image editor. A remaining issue is
that pulldown menu buttons only show text, which is not visible on
all background colors, so making the header entirely transparent
does not work well at the moment.
2018-05-06 15:43:10 +02:00
Dalai Felinto
f4c1685a16 Edit-mesh: multi-object reveal 2018-05-06 13:55:23 +02:00
Dalai Felinto
5d8937e8ba Edit-mesh: multi-object hide 2018-05-06 13:51:30 +02:00
Dalai Felinto
49be803ad6 Edit-mesh: multi-object delete edge loops 2018-05-06 13:44:11 +02:00
Dalai Felinto
4df7220874 Fix crash with select linked when nothing is under the cursor
There is no object to update anyways, and there is no valid basact when the
nified_findnearest() test fails.

How to reproduce the bug: Try to select linked (L) with selected faces but
withotu mouse hovering any mesh.

Bug introduced on: rBbfc9d426bb95 (original multi-object edit commit).
2018-05-06 13:27:46 +02:00
Dalai Felinto
b6a7fa1880 Edit-mesh: multi-object select less 2018-05-06 13:08:59 +02:00
Dalai Felinto
2309131b4d Edit-mesh: multi-object select more 2018-05-06 13:08:37 +02:00
dcc4b2cc25 Fix missing show_weight from overlay UI
Missed when moving settings out of the mesh.
2018-05-06 12:17:53 +02:00
02dbe2dcfc Show the 3D cursor by default
Was committed as part of unrelated change: D3198.
2018-05-06 11:56:26 +02:00
b7d7bbfc48 Fix extrude glitch where undo state was visible 2018-05-06 11:50:56 +02:00
466125f3d6 EditMesh: initial extrude manipulator
This manipulator is a test for mixing do/redo,
there are still some glitches that need sorting out in
transform & the undo stack.
2018-05-06 10:14:20 +02:00
47de0321bf Transform: support initial offset option
Needed to redo extrude+transform macro w/o resetting the translation.
2018-05-06 10:14:16 +02:00
f7123f0f11 WM: manipulator redo support
Support for adjusting a setting from the last executed operator.
2018-05-06 09:49:55 +02:00
4163beb818 Merge branch 'master' into blender2.8 2018-05-06 09:02:47 +02:00
632f2b5c18 WM: include macros in last-properties
Needed for 2.8 tool system storage of macro properties.
2018-05-06 08:57:53 +02:00
9e3bfd9210 IDProp API: use stored string length for IDP_repr
Also NULL check ID pointers.
2018-05-06 08:57:19 +02:00
2dd0cb4964 Fix T54801: incorrect render with zero weight transparent BSDFs. 2018-05-06 02:00:39 +02:00
Dalai Felinto
f4e9620eff Fix crash on armature drawing 2018-05-06 00:23:13 +02:00
e1e7915233 Armature: Fix object mode display.
Don't show wires if not selected.
Bone outline size match meshes outlines.
2018-05-05 22:58:46 +02:00
759ff83e88 Armature: Change Bone drawing.
This makes a few changes:
- Remove the old "overlay" wires.
- Add constraints colors to bones.
- Specify a a new "hint" color per bone. Making selection/Active state
  more obvious.
- Unify Octahedral/B-Bones/Envelope shading and colors.
- Change outline size depending on the selection/active state of the bone.

Note that thoses changes are not final and needs review.
2018-05-05 21:04:21 +02:00
817cf2a317 Armature: Rename bone shaders and add 2 colors smooth blending.
This will enable us to do more nice stuff in future commits.

This commit is a temporary commit, it will compile but will crash if
trying to display any armature. Next commit does work.
2018-05-05 21:04:21 +02:00
b2188d631a Armature: Outline: Fix outline detection in critical cases.
Outline was not generated because the normal was completely orthogonal to
the view.
2018-05-05 21:04:21 +02:00
3b075d0c8d Armature: Make bone outlines thickness variable. 2018-05-05 21:04:21 +02:00
eec3fc1273 Armature: Set outline width to 2.0.
Correspond roughly to 1px width.
2018-05-05 21:04:21 +02:00
1107223a63 Workbench: Temporary fix washed out background color.
Save our eyes until proper color management is implemented.
2018-05-05 21:04:20 +02:00
2241f14e26 Icons: add texture paint icons 2018-05-05 18:01:35 +02:00
1ddedfb2af 3D viewport: rename ambient to shadow intensity, default single color to 0.8. 2018-05-05 16:01:45 +02:00
6d980020ba UI: experiment to make popover buttons draw like enum menus.
Looks better for 3D viewport shading, but needs more tweaks to distinguish
it from other button types probably.
2018-05-05 15:54:43 +02:00
b365cc017a 3D Viewport: move overlay settings from collections to 3D viewport.
For some we may add per object overrides, but for most we plan to keep them
strictly per viewport settings. Display settings from the mesh still need to
be moved here, only collections were done to remove that code.
2018-05-05 15:54:43 +02:00
2094b45447 3D Viewport: make shading and overlay DNA match UI names.
We should use consistent naming between the internal code and UI whenever
possible, only reason not to is file compatibility.
2018-05-05 15:54:36 +02:00
1983eea98e Cleanup: remove legacy 3D view data. 2018-05-05 15:51:13 +02:00
46ee994608 Cleanup: minor code formatting tweaks for 3D view DNA. 2018-05-05 15:51:13 +02:00
cfd39887d1 Cleanup: fix compiler warnings. 2018-05-05 15:51:13 +02:00
309e9521f8 Groups: remove drawing group objects in a different color.
With the upcoming unification of groups and collections this will make
no sense anymore, as all objects will be in a collection.
2018-05-05 15:51:13 +02:00
d979f1fc62 Workbench: Fix reading and testing from depth buffer 2018-05-05 15:32:48 +02:00
29aa531e51 Merge branch 'master' into blender2.8 2018-05-05 14:42:15 +02:00
d3b3df0371 IDProp API: add native C repr function
Was using Python which wasn't very efficient (even for logging).
2018-05-05 14:41:25 +02:00
f91e9529da Merge branch 'master' into blender2.8 2018-05-05 09:57:45 +02:00
d83681807e PyAPI: add pop method to RNA struct types
This fits in with existing dict style access.
2018-05-05 09:53:30 +02:00
d2591e5c2d IDProp Py API: Add default argument to pop
Match dict.pop behavior.
2018-05-05 09:48:06 +02:00
86c2c4d513 IDProp API: Avoid redundant group replace lookup 2018-05-05 09:31:17 +02:00
3b0475bc64 Eevee: Shadows: Don't allocate more CSM layer than we need. 2018-05-04 19:24:13 +02:00
0503f31c66 Cleanup: trailing space 2018-05-04 19:22:38 +02:00
42c5c20e54 Edit Mesh: Multi object color reverse
D3173 by @la10
2018-05-04 19:17:56 +02:00
3f6fac91ff Eevee: Fix Cascaded shadow map calculation.
The first one was done correctly but the second was wrong due to the matrix
being overwritten.
2018-05-04 19:09:12 +02:00
bb063ec31e DRW: Add DRW_viewport_far/near_distance_get functions. 2018-05-04 19:09:12 +02:00
9cb397238d Fix crash selecting edit-mesh
The base and the vert/edge/face could be out of sync.
2018-05-04 19:03:32 +02:00
d9c5a35587 Fix: Fire notifiers on pose properties changed
While testing UI_OT_reset_default_button, discovered that using
Reset to Default Values on bone locations didn't work. Turns out
to be missing update on this property. So, this is probably
dependent on the property used.
2018-05-04 17:30:59 +02:00
a73c02a17b Workbench: Color selector when in single color mode 2018-05-04 17:26:10 +02:00
26d87bd577 Merge branch 'master' into blender2.8 2018-05-04 11:58:55 -03:00
b27b4743a2 BKE: bvhuils: remove member sphere_radius.
This member currently doubles the value of `ray->radius` or is not even used.
2018-05-04 11:57:01 -03:00
eccbca9e7d Depsgraph: Fix several ID blocks added multiple times to depsgraph
Ideally, we need to get rid of whole bmain iteration in depsgraph
construction, but then it's not clear which movie clips and such
to evaluate.
2018-05-04 16:37:21 +02:00
d85fd8feeb T54953: Use OCIO for display color management 2018-05-04 16:27:14 +02:00
50c5e2aa08 Workbench: Random color generation
Now the colors are determined from the name and library name of the
object. This should make more consistent random colors
2018-05-04 16:27:14 +02:00
3b25b25752 Merge branch 'master' into blender2.8 2018-05-04 11:25:40 -03:00
d0c6e2b677 Fix grid fill crash with copy on write 2018-05-04 16:23:20 +02:00
02788a9d1a Fix erroe in previous commit. 2018-05-04 11:22:50 -03:00
39050f6eee Eevee: Shadows: Compute Octahedron size from CubeMap size.
This was the otherway around before. But since we can have a different size*
for cube texture now, we can compute the correct-ish texture size.

This will give us on average the same texture appearance when we will add
support for real cubemap shadows.
2018-05-04 16:22:23 +02:00
e6ce78895d Eevee: Cap Shadow resolution to 4096px^2.
As much as I want to give freedom to the user, 1.5G of vram for a
single shadow is a big of a stability issue.

So limiting to 4096 for now, we may remove this limit in the future.
2018-05-04 16:22:23 +02:00
f48e53f562 Eevee: Shadows: Separate Cube and Cascade shadow maps into 2 texture array.
This mean we can now have different shadow resolutions for both.

However each shadow type keep the same size accross all lamps because of
future "real" Cube Shadowmaps limitation and to save texture sampler slots.

That said the cascade shadow resolution could (in the future) still be
changed to be adjustable per sun lamp.
2018-05-04 16:22:23 +02:00
d4dd872d56 Eevee: Simplify shadow test code with macros. 2018-05-04 16:22:23 +02:00
2439ac2202 Merge branch 'master' into blender2.8 2018-05-04 11:16:13 -03:00
e78ef82827 BKE: bvhutils: Unifies static functions oh bvhtrees creation. 2018-05-04 11:15:21 -03:00
501637879d Static Override: fix stupid ;istake in moving autooverride to own struct flag. 2018-05-04 15:44:19 +02:00
66be4a1136 Merge branch 'blender2.8' into tmp-static-override-insertion 2018-05-04 15:36:06 +02:00
699d5d4040 Static Override: Add overridable flag to drivers' ID pointer. 2018-05-04 15:32:22 +02:00
10fb83e3f0 Merge branch 'blender2.8' into tmp-static-override-insertion 2018-05-04 15:26:02 +02:00
554fb0e7e0 Merge branch 'master' into blender2.8 2018-05-04 15:21:42 +02:00
aa0380a6a5 Cleanup: Remove G.main from framechange_poses_clear_unkeyed() 2018-05-04 15:18:47 +02:00
844a17a3d9 Transform: use bool when local matrix is needed
Existing code checked pose/edit mode to check for transforming in an
objects local space.

This added many similar checks all over the code,
which leads to confusion.
Multi-edit caused a regression in UV transform since where UV's
had the object matrix applied by accident.

Now there is a boolean to use a local matrix,
this allows for any mode to have a 4x4 matrix
applied w/o adding mode specific checks everywhere.
2018-05-04 15:18:27 +02:00
90e61275d3 Fix mistake in boundbox center 2018-05-04 15:18:27 +02:00
0a79de526d Merge branch 'master' into blender2.8 2018-05-04 10:12:47 -03:00
78fde19e68 BKE: Smoke: Fix error with implicit declaration of function due recent changes. 2018-05-04 10:11:30 -03:00
57a5ef8c61 Depsgraph: Fix missing relations for IDs brought by drivers
This is similar to rather recent fix in nodes builder.

Fixes crash when creating static override for chicken from Dweebs.
2018-05-04 14:30:06 +02:00
02baf71409 Merge branch 'master' into blender2.8 2018-05-04 09:22:48 -03:00
aea637456e BKE: BVHtree: Replace all external references of bvhtree_from_mesh_looptri with bvhtree_from_mesh_get. 2018-05-04 09:21:42 -03:00
3f95daa31f Workbench: Shadows
Initial review of the shard shadows in the workbench engine.

Speed optimizations like transform feedback are not implemented yet. I first want this part to be reviewed and merged.

@fclem please check the note in drw_stencil_set it was holding back nequal == 0 as by default DST.stencil_mask was set to 0. questioin is should we remove the whole check or not.

Also I am still looking for a better name (or split the enum) for DRW_STATE_STENCIL_DEPTH_FAIL_INCR_DECR_WRAP

Reviewers: fclem

Reviewed By: fclem

Tags: #code_quest

Differential Revision: https://developer.blender.org/D3198
2018-05-04 14:08:40 +02:00
d8a03c77d7 Allocate/free meshes with generic library functions.
This avoids the need to use Mesh-specific functions, and makes allocation
and freeing easy oneliners.
2018-05-04 14:02:58 +02:00
3dd6912fce Mesh Remap: Face Corner Data: Do not use large epsilon values to create bvhtrees.
Use ray radius instead.
2018-05-04 09:01:56 -03:00
8c6a1d8f95 Mesh Remap: Face Data: Do not use large epsilon values to create bvhtree.
If you need the approximation, use raycast radius.
2018-05-04 08:29:00 -03:00
4880e2e75a ID management: add higher level BKE_id_new... helpers.
Those should be used in priority when you need to create either a new
datablock in Main, or a new temp one. Lower level BKE_libblock_...
should only be used when you need a very specific, uncommon behavior.
2018-05-04 12:55:36 +02:00
3248eef697 Merge branch 'master' into blender2.8 2018-05-04 12:50:40 +02:00
fa11dc6730 Depsgraph: Fix extra operations and relations created for shared armatures 2018-05-04 12:49:48 +02:00
a0f369bc13 Merge branch 'master' into blender2.8 2018-05-04 07:44:34 -03:00
b886cdf81d Mesh Remap: Change the sphere_radius parameter instead of creating a bvhtree with epsilon equal to the value of ray_radius.
This is the desirable behavior.
It also removes one more use of `bvhtree_from_mesh_looptri`.
2018-05-04 07:43:08 -03:00
3d26cf112b Constraint: Shrink Warp: Replace bvhtree_from_mesh_looptri with bvhtree_from_mesh_get.
The value of epsilon was never used to create this bvhtree because whenever we activate this constraint, a bvhtree with parameter epsilon 0.0 was created and cached.
2018-05-04 07:39:07 -03:00
82d59c6588 Mesh Lapacian: Use isect_ray_tri_watertight_v3 instead of Epsilons to prevent corners errors in raycast.
Using FLT_EPSILON can fail with large coordinate values.
This commit also avoids storing bvhtrees with different settings in BVHCache.
2018-05-04 07:33:26 -03:00
c2fe75bf26 Merge branch 'master' into blender2.8 2018-05-04 11:53:52 +02:00
d1be30f779 Fix T54935: Particle group instances don't render when hidden in viewport
Seems to be only related on linked nature of particles.

This is caused by some conflicting optimization done for viewport, which
does not do particles re-calculation if they do not depend on time
(which is crucial for big layout scene grass fields) and particle render
setting  switch which was relying on fact that render pipeline will do
particle update via time dependency.

Now we extent an old workaround for invisible objects, which now also
deals with particles in the same way as old dependency graph was dealing
with this: tag object data for update if there is particle system.

There shouldn't be any speed difference between old and new depsgraph,
since tagging was already needed and was happening.

In Blender 2.8 such things should be easier to deal with since the whole
depsgraph is to be evaluated for render engine anyway.
2018-05-04 11:40:27 +02:00
52aa1f3c6c Merge branch 'master' into blender2.8 2018-05-04 10:32:35 +02:00
bf52d20e62 Modifiers: add back dirty normal flag 2018-05-04 10:05:57 +02:00
288d7794d4 Fix T54341: Particle Instance Modifier doesn't preserve edge data 2018-05-04 09:20:57 +02:00
bdd5617c54 Cleanup: avoid local definitions for one-off args 2018-05-04 09:04:33 +02:00
14883a0945 Cleanup: avoid local definitions for one-off args 2018-05-04 08:51:04 +02:00
29fc9275c7 Modifiers: ported wire modifier to mesh 2018-05-04 08:45:43 +02:00
352aea6b0d Merge branch 'master' into blender2.8 2018-05-04 08:39:43 +02:00
75b310f489 Fix wireframe modifier w/ even offset
Was passing non-normalized axis to angle_on_axis.
2018-05-04 08:38:01 +02:00
eeab3563d7 Merge branch 'master' into blender2.8 2018-05-04 08:02:11 +02:00
c7cfee04c4 Logging: setting log level wasn't working 2018-05-04 08:00:22 +02:00
b3545ae373 Merge branch 'master' into blender2.8 2018-05-04 07:30:14 +02:00
f3c5b0394f IDProp API: expose repr utility function
Useful for logging properties passed to operators.
2018-05-04 07:29:05 +02:00
892dd3d069 Merge branch 'master' into blender2.8 2018-05-03 18:47:14 -03:00
16253285ff BKE: BVHtree: make bvhtree_from_mesh_edges a static function.
This will help us have more control over bvhtrees that are cached.
2018-05-03 18:33:16 -03:00
133dadcdee Fix Transfer Mesh Data with Edge Mapping of type Projected Edge Interpolated and Ray Radius other than 0.0.
`MREMAP_RAYCAST_APPROXIMATE_BVHEPSILON(ray_radius)` greatly increased the radius making for example that 0.1 becoming 1.5
Now the result is much more predictable.
2018-05-03 18:19:36 -03:00
Dalai Felinto
e245f7c09c Edit-Mesh: multi-object un-subdivide 2018-05-03 21:56:59 +02:00
Dalai Felinto
66ffbf9b7d Edit-Mesh: multi-object edge rotate 2018-05-03 21:44:53 +02:00
Dalai Felinto
09e14cb5bc Edit-Mesh: multi-object dissolve limited 2018-05-03 21:00:03 +02:00
32c620b0d6 Merge branch 'master' into blender2.8 2018-05-03 15:54:26 -03:00
7915cc7ddb Particle Edit: Shape Cut: Create and use bvhtree with AABB hull.
This bvhtree is only used for raycast. Currently the raycast does not benefit from general hull.
2018-05-03 15:52:09 -03:00
98ecdc4896 Dynamic Paint: Create and use bvhtree with AABB hull.
This bvhtree is only used for raycast and find_nearest which currently do not benefit from general hull.
2018-05-03 15:50:48 -03:00
5760c6b25c Merge branch 'master' into blender2.8 2018-05-03 20:24:44 +02:00
0f217de403 Fix T54927: BMesh Py error w/ select history slice 2018-05-03 20:23:32 +02:00
2cdbbfcc5a Merge branch 'master' into blender2.8 2018-05-03 19:53:19 +02:00
38b6f8e143 Cleanup: correct solidify logic
Code for side normals isn't executing at the moment,
so not essential, but better correct it.
2018-05-03 19:48:28 +02:00
5e225ddb21 Cleanup: parentheses warning 2018-05-03 19:37:20 +02:00
a9d264f5ca Merge branch 'master' into blender2.8 2018-05-03 14:33:52 -03:00
ac19483e63 BKE bvhtree: Add tree_type parameter to bvhtree_from_mesh_get.
This will allow greater control of the bvhtrees that are obtained, and helps identify problems.
It is also an additional step to unify the functions.
2018-05-03 14:26:39 -03:00
20185a8681 Cleanup "Sync Mode" (i.e. Av Sync/Framedropping) stuff
* Remove the "sync_mode" dropdown from timeline header, and move it into
  the Playback menu instead.
* Remove the confusing "Frame Dropping" and "AV Sync" entries from the
  Playback menu. These were supposed to be mutually exclusive (or else,
  the "sync_mode" menu would break).
* Turn AV Sync on by default
* Commented out the Frame Dropping and Av Sync RNA Properties too.
  THere doesn't seem to be any valid reason for these to exist?
2018-05-03 18:50:53 +02:00
8c49e6f99e Multi-Object Pose: Fix POSE_OT_flip_names 2018-05-03 18:04:29 +02:00
656d6f47b9 Fix 3D cursor being hidden on existing 2.8 files
Flip logic for the flag avoids versioning code.
2018-05-03 18:02:13 +02:00
7d61803640 Sculpt: Fix crash when using grab brush
Was wrong paint structure deducted from context.

Test plan:

With default cube, go to sculpt mode, switch to grab brush
and try to sculpt.
2018-05-03 17:42:46 +02:00
e684e0ec95 Cleanup: fix warnings, removed unused code. 2018-05-03 16:33:12 +02:00
bb92edd1c8 Depsgraph: Keep edit bones around, fixes missing edit mode with copy on write 2018-05-03 16:23:16 +02:00
Dalai Felinto
14f2a1c8e8 Fix T54805: Bones are white in edit mode 2018-05-03 16:19:55 +02:00
d8b43a8066 Depsgraph: Make sure evaluated pose channels are pointing to evaluated bones 2018-05-03 16:11:07 +02:00
a06b0d29aa Eevee: Shadows: Perf: Do not update shadows that are not inside the view. 2018-05-03 16:08:14 +02:00
ffca77814e DRW: Add plane culling test.
Usefull to see if the view frustum is totally behind a plane.
2018-05-03 16:08:14 +02:00
4d0b6652cf DRW: Silence unused function warning in release. 2018-05-03 16:08:14 +02:00
49407122ea Merge branch 'blender2.8' into tmp-static-override-insertion 2018-05-03 16:02:11 +02:00
b2b9efbe6d Merge branch 'master' into blender2.8 2018-05-03 16:01:43 +02:00
a5d0597b92 Fix tooltip for constraints' subtarget.
Thanks @aligorith for the head-up.
2018-05-03 16:00:34 +02:00
0b1c673e14 Workbench: selection method for studio lighting 2018-05-03 15:33:13 +02:00
2bf333b35d Workbench: studiolight 2018-05-03 15:31:03 +02:00
8a2d2f1bb4 Fix: Tag armature for copy on write when selecting bones, so active bone gets updated
Note: This still needs some copy-on-write magic to get the bone pointers
to get remapped properly (e.g. evaluated pose still refers to original
arm->bones, and arm->act_bone isn't getting remapped).
2018-05-03 15:18:39 +02:00
a086f61df7 Merge branch 'master' into blender2.8 2018-05-03 15:02:05 +02:00
53c43259ad Cleanup: factorize RNA constraint targets definition.
No expected changes in behavior from that commit!
2018-05-03 15:00:12 +02:00
dced0518d9 Fix crash selecting envelope bone joint 2018-05-03 14:51:29 +02:00
057e00e649 Render preview: Assign proper depsgraph for icon preview
Wondering why it only was visible when running without copy on write.
2018-05-03 14:25:29 +02:00
95b388c3df Depsgraph: Fix missing action re-map with node tree update
After copying animation data we need to re-map action, otherwise
our original DNA values will go out of symc, causing flickering
when tweaking values on animated node tree.
2018-05-03 14:16:12 +02:00
e013d2eb4b Render preview: Make it to preserve unkeyed animation
The idea is to re-use evaluated datablock from within current context.

This relies on the following factors:

- It expects scene to be fully evaluated before preview jobs starts.
- It expects datablocks to be localized.
2018-05-03 14:16:12 +02:00
181356edba Restored HQ normals in Solidify modifier 2018-05-03 14:11:22 +02:00
1677ea89c7 Metaball: Move handles shader to draw/modes/shader and reference them in draw_common.c 2018-05-03 09:11:02 -03:00
69710301cc Merge branch 'blender2.8' into tmp-static-override-insertion 2018-05-03 13:51:42 +02:00
Dalai Felinto
9c78d9ba9f Fix pose transformation helper lines
This was broken since 33bb8b785a (triple-buffer changes).
This also helps help lines as a whole.
2018-05-03 13:05:38 +02:00
ecb143fe5d Render preview: Remove dedicated depsgraph
It is not needed since render pipeline will create its own depsgraph.
2018-05-03 12:57:54 +02:00
5975d6581c Depsgraph: Tag IDs for animation update on visible update
Without this it's quite unpredictable what state of unkeyed changes
datablock will end up with.
2018-05-03 12:55:01 +02:00
ef94415060 Depsgraph: Fix threading conflict between node animation and shading update 2018-05-03 12:55:01 +02:00
98ac0188ed Depsgraph: Fix wrong debug message 2018-05-03 12:55:00 +02:00
Dalai Felinto
c4bf936d53 Fix sculpt grab cursor
This was broken since 33bb8b785a (triple-buffer changes).
We need to account to the area limits when drawing the cursor.
2018-05-03 11:48:35 +02:00
1833e8d7b0 Fix for material/node tree localization
The workaround removal was wrong, the whole id->adt of a local
copy is to be NULL.

But now instead of modifying original datablock, we tell library
manager to not copy animation data.
2018-05-03 11:25:47 +02:00
8431e0aab5 UI: Fix region_draw_azone_tab_plus missing/broken background.
This was due to the background being drawn by a batch that had its VAO
generated in the windows "UI" context.

Since we use the DRW ogl context to draw the entire area, we have to
regenerate the VAO for thoses UI batches to be drawn correctly.
2018-05-03 11:20:20 +02:00
026792ffed Workbench: Show 3D Cursor Overlay 2018-05-03 10:55:28 +02:00
Dalai Felinto
d64f12248a Initialize alpha discard for uiWidgetBaseParameters
No functional change, just playing safe and documenting how to
initialize the parameter in most of the cases.
2018-05-03 09:59:48 +02:00
31f8d05432 Merge branch 'master' into blender2.8 2018-05-03 08:31:38 +02:00
0d6ddd0a1d Cleanup: split out extrude spin/screw
Since these will have their own manipulators,
its more convenient to keep them separate.
2018-05-03 08:20:29 +02:00
e954082dda WM: warn when tool widget not found
This happens when testing adding tools, assert isn't useful.
2018-05-03 07:33:44 +02:00
d9f4ce617b Cleanup: trailing space 2018-05-03 07:22:04 +02:00
7840c593b8 Cleanup: remove axis bounds ifdef
This was added for scale-cage manipulator, but seems generally useful.
2018-05-03 07:21:06 +02:00
51aba69b89 Transform: expose 3D center/axis calculation
This is needed for other manipulator placement.
2018-05-03 07:19:33 +02:00
f5cb96704b WM: add function to access last_properties 2018-05-03 07:09:22 +02:00
e4774c0b2d Metaball: pointers used in DRW_shgroup_call_dynamic_add don't need to hold the reference. 2018-05-02 21:26:43 -03:00
36bbf80929 Armature: Envelope: Small cleanup + don't smooth the distance display.
The actual weighting calculation is not smooth as the bone display.

The bone itself can be smooth for esthetic purpose but the distance display
should match the underlying weighting formula.
2018-05-02 20:49:38 +02:00
46662a289b Armature: Envelope: Optimize outline shader. 2018-05-02 20:49:38 +02:00
0ea329d32d Armature: Envelope: Revisit envelope drawing again.
Past shader was too slow and had bad artifacts. This method is much simpler
and eficient and only exhibit some popping when the raidus of the head/tail
is changed.
2018-05-02 20:49:38 +02:00
73cb83d48f GPUShader: Remove unused envelope shaders. 2018-05-02 20:49:38 +02:00
e764d2b6ba Armature: More work and cleanup on envelope bones drawing.
- Draw tail & head sphere with point shader (no needs for another way).
- Use the same function for issuing the calls for wire and solid envelope.
2018-05-02 20:49:38 +02:00
a76d27f694 Armature: Add envelope outline shader. 2018-05-02 20:49:38 +02:00
01cec3e0c5 Armature: Envelope Bones: Change drawing method.
We now use a more pleasant and efficient way to display enveloppe bones
and their radius.

For this we use a capsule geometry that is displaced (in the vertex shader)
to a signed distance field that represents the bone shape.

The bone distance radius are now drawn in 3D using a "pseudo-fresnel" effect.
This gives a better understanding of what is inside the radius of influence.

When capsules are not needed, we switch to default raytraced points.
The capsules are not distorded by the bone's matrix (same as their actual
influence radius) and are correctly displayed even with complex scaled
parents hierarchy.
2018-05-02 20:49:38 +02:00
18071f4e0e Armature: Draw envelope on non MSAA buffer.
Appart from the performance issue, the MSAA resolve pass is not compatible
with additive passes.
2018-05-02 20:49:38 +02:00
d0d282bf2f Armature: Add multisampling to posemode. 2018-05-02 20:49:38 +02:00
6f5bf23c98 DRW: Convert DRW_cache_circle_get to use GWN_PRIM_LINE_LOOP 2018-05-02 20:49:38 +02:00
8c2a6f957a Armature: "Raytrace" bones endpoint spheres.
Here is how it works:
We render a high poly disc that we orient & scale towards the camera so that
it covers the same pixel of the sphere it's supposed to represent.

Then the pixel shader raytrace the sphere (effectively starting from
the poly disc depth) and outputs the depth to gl_FragDepth.

This approach has many benefit:
- high quality obviously: per pixel accurate depth!
- compatible with MSAA: since the sphere horizon is delimited by polygons,
  we get the coverage computed by the rasterizer. However we still gets
  aliasing if the sphere intersect directly other meshes.
- virtually no overdraw: there is no backface to shade but we still get
  overdraw because by little triangle [gpus rasterize pixel by groups of 4].
- allows early depth test: since the poly disc is set at the nearest depth
  we can output, we can use GL_ARB_conservative_depth to enable early depth
  test and discard pixels that are already behind geometry.
- can draw outline pretty easily without geometry shader.
2018-05-02 20:49:38 +02:00
a56561dcd2 DRW: Make use of new multisample resolve pass. 2018-05-02 20:49:38 +02:00
33356b7be0 DRW: Add DRW_multisamples_resolve function
This manually resolve the content of a multisample FB to a single sample FB.

It resolves color (combine the 2 framebuffers in a logical maner keeping
depth buffer occlusion etc..) instead of a plain glBlitFramebuffer copy.
2018-05-02 20:49:38 +02:00
6d8e308eae GPUShader: Optimize Multisample resolve shader.
Group all fetches together without interleived alu to let compiler optimize.

Also do the color samples only if needed.

Went from 3.86ms to [1.11-2.22]ms [min-max] for the 16samples resolve pass
on my nvidia card.
2018-05-02 20:49:38 +02:00
1fff3e02c2 DRW: Add DRW_STATE_BLEND_PREMUL blend mode. 2018-05-02 20:49:38 +02:00
12570c7373 GPUShader: Add GPU_SHADER_2D_IMAGE_MULTISAMPLE_2/4/8/16
This shader is used instead of blitting back and forth to a single sample
buffer.

This means it resolves the color and depth samples and outputs a fragment
which can be depth tested and blended on top of an existing framebuffer.

We do static shader variation with manual loop unrolling for performance
reason. In my test I get 25% more perf with intel integrated gpu and 75%
performance gain with dedicated nvidia card compared to a single shader
with a uniform for sample count.
2018-05-02 20:49:38 +02:00
2602198485 GWN: Add GWN_batch_uniform_mat4. 2018-05-02 20:49:38 +02:00
a8463284bb GPUShader: Fix simple lighting modulating alpha color 2018-05-02 20:49:38 +02:00
ad97ba3367 Object Mode: Draw non meshes before outline.
This makes the outlines occluded by the other objects. This was a problem
before the outline refactor but now there is no need for it.
2018-05-02 20:49:38 +02:00
e493a1a1ae DRW: Armature: New bone outline shader.
This fix the issue with the zfighting we were getting at bones edges.

Moreover, this enables us to render arbitrarly large outline with
varying thickness.
2018-05-02 20:49:38 +02:00
77b481fd5a DRW: Add Adjacency info for bone shapes.
Only for cube and octahedral shapes for now.
2018-05-02 20:49:38 +02:00
0c47a83fb9 GWN: Add GL_TRIANGLES_ADJACENCY to supported primitive types. 2018-05-02 20:49:38 +02:00
3f9f27e5a8 GPUTexture: Fix wrong multisample texture size. 2018-05-02 20:49:38 +02:00
7d384bcdbb Static Override: Lock 'edition' of constraints & modifiers from overridden data.
Means that you cannot move or delete constraints/modifiers coming from
the overriden linked datablock. Local inserted ones can be fully edited.
2018-05-02 18:45:22 +02:00
fd23c42faa Paint Vertex Mode: Fix shader not free. 2018-05-02 18:39:53 +02:00
1ff2646d58 Eevee: Add Lamp Specular multiplier.
It's usefull in some scenario to tweak the specular intensity of a light
without modifying the diffuse contribution.

Cycles allows it via lamps material which we currently not support in Eevee.

This is a good workaround for now.
2018-05-02 18:39:53 +02:00
Dalai Felinto
965e6ed54f Fix T54864: Assert when changing interface display scale
The asserts were introduced on rB5f6c45498c92 (top-bar).

Although the asserts are technically correct, they would fail even in master.
And the commit simply added the asserts without fixing the situation itself
(as you can see in the report, it is really simple to reproduce this issue).

I propose we remove the asserts and bring them back only when the situation
itself is fixed. It doesn't make sense to introduce asserts that would fail
with the current state of the code.
2018-05-02 18:32:44 +02:00
0fb5a39baf Static Override: add insertion for modifiers and one constraints, fix editing of inserted items in collections.
Now insertable collection items have a flag to say they are 'local' (and
hence can be freely edited).
2018-05-02 18:14:19 +02:00
d877831115 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-05-02 17:37:37 +02:00
f0d67d8f6a Workbench: Linear => srgb conversion 2018-05-02 17:37:11 +02:00
Dalai Felinto
b6b17338c2 Fix mysterious crash on tooltips
This was a hard to reproduce bug, but it happens often enough.
Basically the tooltip of the active tool was been invoked when
context had no valid ScrArea which would lead to a crash.

We now just return no tooltip in these cases.
2018-05-02 17:37:05 +02:00
3fa6b6ed4c Depsgraph: Add function to iterate over all original IDs 2018-05-02 17:09:44 +02:00
7c32ef84aa Use meaningful debug name for render depsgraph 2018-05-02 17:09:44 +02:00
6560a96232 Depsgraph: Show log message when tagging specific depsgraph ID 2018-05-02 17:09:44 +02:00
b6aa8a71fd Depsgraph: Add per-depsgraph debug name which is shown in the logs
This way we can see for which depsgraph datablock is being evaluated for.
2018-05-02 17:09:44 +02:00
651a255931 Depsgraph: Cleanup, naming conventions 2018-05-02 17:09:44 +02:00
bb75c4cbe9 Depsgraph: Make all print messages to respect per-depsgraph debug flags 2018-05-02 17:09:44 +02:00
65e6654c85 Depsgraph: Allow per-depsgraph debug flags
Currently only affects EVALUATION debug messages, rest are to be
supported on per-depsgraph level.
2018-05-02 17:09:44 +02:00
2f4dea0ef9 Depsgraph: Use utility function to print CoW update function 2018-05-02 17:09:44 +02:00
c7e0bb0b90 Depsgraph: Make bAction a part of dependency graph
There are various values which depends on context in there, for example
current driver value and original DNA value f-curve is applied for.

This partially fixes issue with not being able to tweak keyed values
when material preview is open.

The material preview is not being currently updated against non-keyed
changes since every tweak of material property does full preview scene
depsgraph evaluation.
2018-05-02 17:09:44 +02:00
98461aa5dc Workbench: Fix interface change in draw maanger 2018-05-02 17:08:42 +02:00
9cfbdff71c Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-05-02 16:59:42 +02:00
befbf7eb9b Vertex Paint: Use Linear colors for interpolation.
This matches Cycles and Eevee's behaviour.
2018-05-02 16:45:08 +02:00
a2b05accea Eevee: Fix vertex color being in srgb space.
Now they are properly converted to Linear space before interpolation.

Since the only way to get vertex color in eevee and cycles is via the
attribute node with the CD_AUTO_FROM_NAME flag, we have to know at binding
time which type of buffer will be connected to this auto input.

We store this information inside the batch cache (together with the according
uniform name) and pass it as uniform to the shader which does conversion if
needed. The same shader can then be reused to draw another mesh with
different auto layers configuration.
2018-05-02 16:45:08 +02:00
648de1be52 Modifiers: ported Skin modifier DerivedMesh → Mesh 2018-05-02 16:39:22 +02:00
3f2f27642e Renamed 1st parameter of BKE_bmesh_to_mesh from me to be
It's a BMesh, it shouldn't be called `me`
2018-05-02 16:39:22 +02:00
6a9e6b1448 Merge branch 'blender2.8' into tmp-static-override-insertion 2018-05-02 16:16:17 +02:00
ce7575c823 Static Override: Move 'auto' flag into override struct, expose it to RNA. 2018-05-02 16:15:52 +02:00
40771a0e9e Modifiers: ported Solidify modifier DerivedMesh → Mesh 2018-05-02 16:03:16 +02:00
2450b70efa Mesh: add runtime customdata dirty flags 2018-05-02 15:52:59 +02:00
9e477bdf63 Mesh: move runtime members to own struct 2018-05-02 15:48:17 +02:00
ae1ba7679c Workbench: update of 3dview 2018-05-02 15:32:59 +02:00
5659d8bc0a Merge branch 'master' into blender2.8 2018-05-02 14:40:00 +02:00
23fe6e7eab Merge branch 'master' into blender2.8 2018-05-02 14:37:32 +02:00
eaf6345d4b Lattice modifier: take comparison out of loop 2018-05-02 13:51:31 +02:00
1f8720cf05 Modifiers: ported Lattice modifier DerivedMesh → Mesh 2018-05-02 13:42:09 +02:00
d09920687c Merge branch 'master' into blender2.8 2018-05-02 12:46:14 +02:00
adc17317c5 UI: open toolbar hold buttons on drag
Allows for faster tool switching, no need to wait for it to open.
2018-05-02 12:20:11 +02:00
81175eb40d Modifiers: ported Bevel modifier DerivedMesh → Mesh
This introduces `BKE_mesh_to_bmesh_ex()`, which exposes all of the
`BMeshFromMeshParams` parameters to the caller. This is required to enable
the `calc_face_normal` flag, which is required for the Bevel modifier.

This also introduces `BKE_bmesh_to_mesh()`, which allocates a new `Mesh`,
converts the `BMesh` to it, and returns it. The returned mesh is owned by
the caller.
2018-05-02 12:15:00 +02:00
baf0547de5 Workbench: Single Color Modes
- ability to switch between Single Color, Object Color, Material Color
and Random Color
 - fixed Shading and Lighting popover
 - Renamed Solid -> Single Color
2018-05-02 12:05:40 +02:00
62ed13340b UI: don't allow disabled popovers to open w/ drag
First dragging over active menu items could be used to open a disabled
popover.
2018-05-02 12:02:50 +02:00
404758cc20 Cleanup. 2018-05-02 11:49:27 +02:00
77ac911b3c Static Override: Add proper 'apply' callback for object constraints insertion.
Seems to be working fine, still need to figure out how to make inserted
constraints fully overridable... ;)
2018-05-02 11:35:24 +02:00
43f9b6ba45 Tweak constraint copying code for static override needs.
No expected change in any existing behaviour from this commit.
2018-05-02 11:34:19 +02:00
31d5fcd2a7 UI: run redo poll check in operators context 2018-05-02 11:33:24 +02:00
85dcdb87d2 UI: fix operator redo showing empty popovers
Many operators have no options,
showing a popover button with no content isn't good.
2018-05-02 11:03:03 +02:00
2bc9396b55 UI: disable popovers when panel poll fails 2018-05-02 11:03:03 +02:00
9b21055dfb WM: utility to check if an operator will draw a UI
Checking if a redo operator will show something is needed
to avoid empty redo popover.
2018-05-02 11:03:03 +02:00
Dalai Felinto
3def6c7f8e Edit Mesh: look-cut copy-on-write support
Note: As already commented in the code, the ideal solution would
be to pass select mode as parameter to ED_view3D_backbuf_validate.

Without that we have to resort to the hack solution of writing to
evaluation data.
2018-05-02 10:13:22 +02:00
c7947b2115 Static override: Add basic two-passes system needed for apply insert op.
And a dummy placeholder for object constraints... All this is WIP of
course!
2018-05-02 09:54:42 +02:00
429c1d60a4 Static overrides: make it clear collections need specific apply callbacks. 2018-05-02 09:54:42 +02:00
9e87069c3e Static override: initial work for generating 'insertion' in collections.
Does not yet support applying those operations, only detecting
insertions and generating matching rules was already rather complicated.

Also got rid of ;ost rna_path string allocation in collection diffing
code, could help a bit with speed too.
2018-05-02 09:54:42 +02:00
c052346fbf UI: move object selector into 3D view
This matches the new convention for left-handed mode selectors,
however we're still undecided on exactly how this should work.

For now test this out as a convention for all space types.
2018-05-01 22:33:10 +02:00
e1bd883df3 Eevee: Don't enable temporal AA when using 1 sample only.
This was producing infinite rendering but wasn't noticeable.
2018-05-01 19:39:18 +02:00
20c1edf592 Eevee: Shadows: Only tag as shadow caster if a shadow is cast.
This leads to great improvement if the scene have moving objects without
shadows (shadows disabled in the material panel).
2018-05-01 19:39:18 +02:00
52f1510613 UI: move space-mode selectors before menu items
This adds a convention to have a spaces primary mode selector
positioned to at the left of the header.
2018-05-01 18:56:52 +02:00
0d61cab7ce Modifiers: Fix crash when entering edit mode on unported modifiers 2018-05-01 18:47:26 +02:00
Dalai Felinto
3eca0af19c Fix number sliders for the topbar 2018-05-01 18:35:11 +02:00
334b55fd2e Extract common modifier parameters into ModifierEvalContext struct
The contents of the ModifierEvalContext struct are constant while iterating
over the modifier stack. The struct thus should be only created once, outside
any loop over the modifiers.
2018-05-01 18:02:17 +02:00
6b9f1ffe6e Formatting 2018-05-01 18:02:17 +02:00
2d6620a100 Modifiers: Array DerivedMesh → Mesh 2018-05-01 18:02:17 +02:00
1553f6b656 Introduced CDDM_from_mesh_ex() to create a non-referencing CDDM
This allows the mesh to be freed and the CDDM kept.
2018-05-01 18:02:17 +02:00
4211d02ab5 Modifiers: Mirror DerivedMesh → Mesh 2018-05-01 18:02:17 +02:00
eb6fc05f25 Modifiers: Armature DerivedMesh → Mesh
The mesh parameter of armature_deform_verts() is now const, to indicate
that it's safe to pass ob->data to it directly.
2018-05-01 18:02:17 +02:00
7efc75c709 Modifiers: Simple Deform & Build, DerivedMesh → Mesh
This commit introduces `EditMeshData`. The fields in this struct are
extracted from `EditDerivedBMesh` into their own struct `EditMeshData`,
which can then also be used by the `Mesh` struct. This allows passing
deformed vertices efficiently to the draw routines.

The modifier code constructs a new Mesh instead of writing to ob->data;
even when ob->data is a CoW copy, it can still be used by different
objects and thus shouldn't be modified by a modifier.
2018-05-01 18:02:17 +02:00
be4df85919 Modifiers: Add wrapper functions with Mesh / DerivedMesh conversion
Makes the follow changes:

- Add new `deform*` and `apply*` function pointers to `ModifierTypeInfo` that take `Mesh`, and rename the old functions to indicate that they take `DerivedMesh`. These new functions are currently set to `NULL` for all modifiers.
- Add wrapper `modifier_deform*` and `modifier_apply*` functions in two variants: one that works with `Mesh` and the other which works with `DerivedMesh` that is named with `*_DM_depercated`. These functions check which type of data the modifier supports and converts if necessary
- Update the rest of Blender to be aware and make use of these new functions

The goal of these changes is to make it possible to port to using `Mesh` incrementally without ever needing to enter into a state where modifiers don't work. After everything has been ported over the old functions and wrappers could be removed.

Reviewers: campbellbarton, sergey, mont29

Subscribers: sybren

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3155
2018-05-01 18:02:17 +02:00
9fcb4e6406 Typo fix 2018-05-01 18:02:17 +02:00
b83d48b574 Added note about potential crash in add_orco_dm() 2018-05-01 18:02:17 +02:00
01a720fc9f Eevee: Fix crash when using visibility groups with dupli objects. 2018-05-01 17:59:40 +02:00
1bef7f9318 Eevee: Contact Shadows: Add slope based bias & fix brightening. 2018-05-01 17:59:40 +02:00
8c92a02720 Eevee: Fix raytracing.
- Fix the confusing naming in raycast()
- Fix raytrace acne caused by the rays not being correctly centered on
  the texel.
2018-05-01 17:59:40 +02:00
92fd931e53 Fix: Silence |RNA_boolean_get: WM_OT_save_as_mainfile.exit not found." warning on exit
The operator in question doesn't define this property.
I'm commenting out for now in case another operator actually still uses it.
2018-05-01 17:43:18 +02:00
f6c1762bb3 Fix previous commit, sorry about that :/ 2018-05-01 17:03:23 +02:00
691c532506 Static override: rename highly confusing var name in apply code.
We use 'reference' to designate the linked ID which is being overridden
by the local one, so using 'reference' to designate the stored local ID
in apply RNA code was... not a good idea. ;)
2018-05-01 17:02:30 +02:00
0636acc59a Icons: updated icons from @billreynish
This adds vertex paint & sculpt icons + other minor changes.
2018-05-01 16:52:12 +02:00
43452c254e Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-05-01 16:28:02 +02:00
be88f23b83 Overlay: Enabled wireframe drawing for vertex/weight paint
This is a temp hack, so that billrey can use blender 2.8 for
drawing the icons. Hack will be phased out by T54910
2018-05-01 16:26:31 +02:00
c5c3fa3eac Fix compiler warning: Uninitialised var 2018-05-01 16:22:36 +02:00
30093a6596 Add/finish rna read-only access to actual override rules.
For some reasons did not add operations themselves previously...
2018-05-01 15:18:30 +02:00
3166086c60 Static Override: fix 'search matching override operation' function.
Previous code was waaaayyyy to flacky, returning matches for things that
did not actually have much in common!
2018-05-01 15:08:38 +02:00
522bee3fc8 Refactoring: bvhutils: Use a function that gets the bvhtree through an identifier type.
Reviewed By: @campbellbarton
Differential Revision: https://developer.blender.org/D3192
2018-05-01 10:03:28 -03:00
008a5d9106 Depsgraph: Add missing relations needed for nested datablock relations 2018-05-01 13:22:55 +02:00
3f4a81232a UI: expose radial gradient as option
Was a separate tool, use option so we can extend more easily.
2018-05-01 12:48:35 +02:00
f38fbc9bed UI: add weight paint sample tools
Also use unified weight.
2018-05-01 12:20:53 +02:00
314420e193 Fix crash opening file saved in weight paint mode 2018-05-01 12:07:38 +02:00
f0982220be Nodes: Remove workaround for action copy
Actions shouldn't be copying by new library management code.
Or at least should be possible to make it to not copy actions
or do unneeded user management.

This way we avoid modification of original data which could
and does cause threading conflict with copy-on-write which
could be happening for viewport.
2018-05-01 12:07:38 +02:00
70d352d994 Tool System: add paint poll which ignores the tool
Needed for tools which ensure paint context but aren't brushes
(color sample & gradient).
2018-05-01 11:42:25 +02:00
2c9670b92d Tool System: support non-brush tools w/ paint modes
Allows select, gradient tools not to conflict with brush keymap.
2018-05-01 11:23:46 +02:00
Dalai Felinto
1e8021a58a Fix missing copy-on-write update when changing edit mode selection mode 2018-05-01 11:15:48 +02:00
0be4b0f7a5 Fix edit mesh selection with copy-on-write enabled 2018-05-01 11:02:55 +02:00
98c767244d Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-05-01 10:44:31 +02:00
aad0e52e38 Workbench: Shading popover
- Moved random object color and object outline to shading popover as
these are draw options.
2018-05-01 10:43:27 +02:00
2ce94cc24b Fix crash opening files saved in sculpt/vertex paint modes
Skip access to any evaluated data when operator is run on file load,
we don't have depsgraph evaluated yet. In this case we skip part of
sculpt session initialization, since it will be done during depsgraph
evaluation which happens after DEG_on_visible_update().

We can not skip sculpt session initialization since during normal
operation we want all the data to be initialized on mode change,
and not on initial brush stroke.
2018-05-01 10:14:20 +02:00
af508a1e39 Mark localized node trees and materials as such
Makes it easier to see where the datablock is coming from.
2018-05-01 09:17:17 +02:00
2bd2a2ac03 Depsgraph: Extra sanity checks for copy-on-write tagging 2018-05-01 09:17:17 +02:00
8cf9c58906 Depsgraph: Put original and evaluated ID node pointers to graphviz 2018-05-01 09:17:17 +02:00
04ee606383 Depsgraph: use human readable node type for graphviz debug output 2018-05-01 09:17:17 +02:00
2daab40717 Depsgraph: Cleanup, simplify operation code stringification 2018-05-01 09:17:17 +02:00
2a89ef3da7 Depsgraph: Cleanup, remove unused code 2018-05-01 09:17:17 +02:00
e52dce6408 Animation: Don't user-copunter copy-on-written action block 2018-05-01 09:17:17 +02:00
ed51b93bed Icons: write object children
Allows for sharing geometry between icons.
2018-05-01 08:40:07 +02:00
Dalai Felinto
c21ceb3317 Edit-Mesh: multi-object mark freestyle face
Freestyle face drawing is not working, but I tested it in 2.79, all good.
2018-04-30 22:38:06 +02:00
Dalai Felinto
9ce4a7e824 Edit Mesh: multi-object mark freestyle edge
Freestyle edge drawing is not working though.
2018-04-30 22:38:06 +02:00
Dalai Felinto
0ac3d5f7db Edit Mesh: multi-object mark sharp 2018-04-30 22:38:06 +02:00
Dalai Felinto
61f0608b4a Edit Mesh: multi-object mark seams
Note that I'm using bm->totedgesel instead of bm->totfacesel to skip objects.
2018-04-30 22:38:06 +02:00
2e98524b58 Add support for area lights to the Apply Transform operator
Since area lights are affected by scaling them, it only makes sense to support applying the scale to the lamp size.
Of course, applying location or rotation does not work.

If a scaling that changes the aspect ratio is applied to a square lamp, the mode is automatically changed to Rectangle.
2018-04-30 22:09:23 +02:00
b93a76fe75 Add missing tools to vertex paint 2018-04-30 21:58:35 +02:00
7770d38303 Cleanup: simplify GLSL logic in outlines drawing.
No functional changes.
2018-04-30 16:55:16 -03:00
Dalai Felinto
32c4158047 Fix Merge > To Cursor
In master this is working fine, but in 2.8 ob->imat was identity matrix.
Committing this in master to simplify merging.
2018-04-30 21:42:16 +02:00
Dalai Felinto
aaf85e29a1 Popover: tiny cleanup 2018-04-30 21:13:37 +02:00
40f27e520f Fix T54901: Crash renaming UV layer 2018-04-30 21:03:16 +02:00
a44d5b59d3 UI: order edit-mesh tools
See T54885
2018-04-30 20:40:36 +02:00
ba339379fe Fix linking brushes crashing on load
We need to link brushes for all windows that use a workspace.
2018-04-30 20:09:39 +02:00
33bb8b785a Fix T54900: radial control drawing in wrong place after recent WM changes. 2018-04-30 20:02:39 +02:00
f56b7fb863 Cleanup: de-duplicate paint access from object 2018-04-30 19:42:58 +02:00
188c4a22c9 Cleanup: de-duplicate paint access from object 2018-04-30 18:58:43 +02:00
6e67d8e3bb Cleanup: Move FOREACH_PCHAN_*_IN_OBJECT_*() macros to BKE_armature.h
This reduces the number of headers we need to import (and/or dependencies
on the order of them), as these depend on PBONE_VISIBLE(), which is already
in BKE_armature.h
2018-04-30 18:46:52 +02:00
0020a326ee Copy on write support for Bone Group operators 2018-04-30 18:38:56 +02:00
005f4748c1 Multi-Object Pose: POSE_OT_group_assign/unassign
Like the select/deselect operators, we only support doing this for the
active object for now. From the UI panels, it doesn't make sense to be
operating on bone groups which may not appear/line up with those in the panel
that we're currently dealing with.

This can be reviewed later, but for now, it's easier and makes more sense
this way.
2018-04-30 18:23:05 +02:00
de1405949a UI: show topbar brush options w/ texture paint 2018-04-30 17:06:03 +02:00
3b9554ce9d UI: share common paint panels between all modes 2018-04-30 16:59:16 +02:00
7720525873 UI: add texture paint brushes to toolbar 2018-04-30 16:43:36 +02:00
9114ebe850 Multi-Object Pose Fixes for POSE_OT_armature_apply()
This operator was only partially converted to multi-object editing,
as on one hand, it was using the new "objects in mode" iterator,
while on the other hand, it was also using the context iterator inside
that, making all selected bones across armatures get included.
2018-04-30 16:40:50 +02:00
09dcb6d60c Multi-Object Pose: Fix POSE_OT_group_select and POSE_OT_group_deselect
We only want these to operate on the "active" armature only at a time
(where the "active" one is whichever the groups from the UI came from).
The fix therefore is to make it not use the context functions
(which were changed to always take bones from all selected armatures
instead).
2018-04-30 16:40:50 +02:00
8e78282a94 Eevee: Use GPU_RG16 for velocity pass instead of GPU_RG32F. 2018-04-30 16:39:26 +02:00
0a73000dfc GPUTexture: Add support for GPU_RG16. 2018-04-30 16:39:26 +02:00
eb7188802d DRW: Remove DRWTextureFormat in favor or GPUTextureFormat.
Because:
- Less redundancy.
- Better suffixes.

Also a few modification to GPU_texture_create_* to simplify the API:
- make the format explicit to the texture creation process.
- remove the component count as it's specified in the GPUTextureFormat.
2018-04-30 16:39:26 +02:00
41431eacfa Eevee: TAA: Use safe color when outputing the final color.
This prevent any NANs pixel to spear accross the history. This does not
mean we should allow NANs at all!
2018-04-30 16:39:26 +02:00
630c24fc61 Overlay: missed in last commit 2018-04-30 16:27:34 +02:00
5dab34df50 Overlay: Integration of TexturePaint with Workbench 2018-04-30 16:16:07 +02:00
9aef2d961d UI: add weight paint brushes to toolbar 2018-04-30 16:08:15 +02:00
cbe57acddf Workbench: Integration VertexPaint and WeightPaint modes
- Disable VertexPaint and WeightPaint for OB_MATERIAL and OB_RENDER. Users want to see the final result
 - When in OB_SOLID, the active object should be rendered without any color. The lighting information is multiplied with the VertexPaint/WeightPaint color
 - Removed the use_shading flag from VertexPaint and WeightPaint
 - add method to check if render engine should draw without color (DRW_object_in_only_lighting_mode)

Reviewers: fclem

Tags: #code_quest

Maniphest Tasks: T54894

Differential Revision: https://developer.blender.org/D3191
2018-04-30 15:54:38 +02:00
Julian Eisel
e76a65e359 UV editing: Make 'Select Linked' work consistent to 3D View
Don't see a good reason for the old behavior, so better have it consistent.
2018-04-30 15:42:29 +02:00
d9f395ac39 UI: add vertex paint tools
Generalize logic to show the paintbrush as a tool so
different paint modes can use it.
2018-04-30 15:23:04 +02:00
b5f5e6ce29 Depsgraph: Fix missing node tree update when adding keyframes
Need to make sure animation data is copied from original tree to a copy,
it is NOT enough to only copy node socket values.
2018-04-30 15:16:51 +02:00
05cf7863c3 Fix: UI layout for "Pause" button on timeline header was broken (leaving a gap)
A recent change in the UI layout code probably broke how the scale_x
for layouts was getting handled. This was leaving a large gap
(and causing layouts to pop) when trying to scrub the timeline.

This commit fixes this with a manually-found value that largely seems
to get rid of the popping problem. There's still a little jumping (1-2 px)
but it's less distracting now.
2018-04-30 15:11:43 +02:00
7714d6dd65 COW Fix: Material property update callbacks need to tag depsgraph for COW updates
Otherwise, trying to change color/material properties of EEVEE materials
that have been keyframed doesn't work until a new keyframe has been inserted.

NOTE: There's still some wonkiness if you edit more than one keyframed value
before keyframing (i.e. the other unkeyed value temporarily gets reset). But
that's more of a general COW+animation issue.
2018-04-30 14:49:07 +02:00
36324f9dab ANIM_apply_keyingset() - Tag modified datablocks for copy on write update for good measure 2018-04-30 14:49:07 +02:00
5f8ad885e1 Fix some popup menus that don't support it refreshing and crashing. 2018-04-30 14:27:44 +02:00
78f13ee46c UI: use "none" icon if loading fails
Workaround for issues w/ two column layout when icons are missing.

Also fix reloading icons when some values aren't valid.
2018-04-30 13:57:47 +02:00
85221f6fa7 Fix Eevee shadows not working in certain cases, after recent WM changes. 2018-04-30 13:52:25 +02:00
005711ffef Fix sculpt ToolDef generation
With non-default sculpt brushes, tool generation could fail.
2018-04-30 13:46:01 +02:00
ea2146c3e1 Correct error in toolbar update 2018-04-30 12:46:23 +02:00
310bfe1a77 3D View: refresh on Overlay & Shading changes 2018-04-30 12:36:23 +02:00
bfe88006a3 Remove unused function
Is not needed anymore since 9577ebde79.
2018-04-30 12:27:18 +02:00
a88a8528f1 Draw manager: Fix wrong engine type used for view update
Was causing temporal sampling artifacts when scene is set to Cycles
and viewport is set to Eevee. Visually was looking like ghosting or
motion blur when moving objects.
2018-04-30 12:20:30 +02:00
f4697b392d Tool System: change internal definitions (again)
Was using classes to define tools, however this makes it awkward to
dynamically generate them (we can do it, but its not very "Pythonic").

Move to a named tuple.
2018-04-30 12:14:46 +02:00
98fe9da37d Add NULL check for transform manipulator
Removes need for empty keymap
2018-04-30 12:14:10 +02:00
Julian Eisel
5ea85d0b04 DNA: Unnecessarily big padding size in Object struct
Was added in 159806140f.
2018-04-30 11:18:54 +02:00
cb37080627 Topbar: Enable Vertex Paint tools
Discussed with Campbell just to use the .dummy for now.
2018-04-30 10:40:54 +02:00
422a325acf Fix build of Alembic test. 2018-04-30 10:04:29 +02:00
128506eeb1 BLI Color: YUV to/from rgb colorspace option
This commit does two things:

- Adds an option to do the calculation in different color spaces (BT601
or BT709).
- Changes the default caluclation from legacy BT601 to BT709.

This affects several areas:

- UI areas (mainly scopes)
- ViewLevelsNode
- Several other nodes that use `COM_ConvertOperation.h`
2018-04-29 18:00:45 -04:00
7297b1881e Fix accidentally removed code in recent commit. 2018-04-29 22:11:15 +02:00
7a9f64e665 UI: better support for dynamically sized regions in topbar.
Dynamically sized regions in the topbar were flickering due to only updating
their size after redraws. Now there is an optional layout() callback for
all regions in an area to do UI layout first, then refresh the region layout,
and then do the actual drawing for each region.

Task T54753
2018-04-29 22:11:12 +02:00
0c512a6f95 Fix missing NULL check when setting the tool 2018-04-29 19:14:51 +02:00
4218a94b1e UI: disable top-bar tool name drawing
Makes text jump about.
2018-04-29 18:03:01 +02:00
b5985831e2 UI: show add/subtract as icons
Saves space in the topbar
2018-04-29 17:38:17 +02:00
5cdeae2105 UI: show basic sculpt options in topbar 2018-04-29 17:33:08 +02:00
e84735de45 Cleanup: rename snake_hook 2018-04-29 17:08:24 +02:00
60ce3275c1 UI: use sculpt icons in the toolbar 2018-04-29 17:01:10 +02:00
7c3a028e85 UI: new sculpt icons from @billraynish 2018-04-29 17:00:46 +02:00
79638c5c30 UI: backface cull generated icons
Allows for keeping icons 3D without adding extra geometry at export.
2018-04-29 16:51:15 +02:00
695326eb8f UI: remove toolbar separator between categories
Made cursor split from selection tools, giving ugly 2 column layout.
2018-04-29 16:49:24 +02:00
65d78f4695 UI: group sculpt brushes in the toolbar
All sculpt brushes are accessible from the toolbar, grouped by type
to keep the toolbar a fixed size.
2018-04-29 16:36:31 +02:00
6f544f635b UI: fix toolbar groups w/ data_blocks 2018-04-29 16:24:40 +02:00
8c4ff84ed6 UI: hide sculpt panels from toolbar
These are already available from the topbar.
2018-04-29 16:22:40 +02:00
3b785be8f4 Cleanup: warning, use STRNCPY macro 2018-04-29 14:48:30 +02:00
76282a986d UI: initial dynamically generated sculpt tools
Lots more work needed, this just lists sculpt tools in the toolbar.
2018-04-29 14:31:00 +02:00
6e76a35f07 Tool System: support data-blocks in tools
Needed so tools can set the active brush.
2018-04-29 14:30:09 +02:00
f4ba7667dc UI: support tool generators (no visible change)
This allows toolbar definitions to dynamically generate tools,
needed for generating a tool list from brushes for eg.
2018-04-29 12:28:21 +02:00
e017876f78 3D View: add initial view.shading and view.overlay in RNA.
These are mostly empty still, many properties need to be renamed and moved there.
2018-04-29 09:55:47 +02:00
16c05161e7 Cycles: Cleanup: Remove double semicolons 2018-04-29 09:28:41 +02:00
03957b9487 3D View: move shading and overlay settings into popovers.
* This is just moving buttons to get a bit closer to the intended design,
  better naming and layout is needed.
* Popovers currently work best when the 3D view header is at the top, with
  the most important settings nearest to the mouse. Open design question is
  if we should flip (part of) the buttons if header is at the bottom.
* Another question is if selecintg a shading mode enum should immediately
  close the popover since those are changed often, unlike the other settings
  for which it seems more convenient to keep the popover open.
2018-04-29 09:22:00 +02:00
97c7db168d UI: auto open adjacent pulldown and popover buttons. 2018-04-29 09:18:54 +02:00
fc32bd729c UI: don't flip contents of popovers, avoid closing when size changes. 2018-04-29 09:18:54 +02:00
cb53c9bc7b Fix use of removed Blender Internal properties. 2018-04-29 09:18:54 +02:00
a56d6e467b UI: show popover arrow directly under the button
A visual hint but looks broken when its not pointing to the button.
2018-04-29 09:16:32 +02:00
ca7964c24b UI: fix toolbar not snapping properly with system DPI and display scale. 2018-04-28 20:50:47 +02:00
b5d3fcc9f5 Python/UI: add more convenient API for drawing based on DPI.
system.ui_scale: size multiplier to use when drawing custom UI elements.
system.ui_line_width: suggested line thickness and point size in pixels.
2018-04-28 20:49:46 +02:00
e87dd9aa00 Edit Mesh: loop-cut multi-object support 2018-04-28 18:26:44 +02:00
Dalai Felinto
922ea41395 UI: Number Slider - treat percentage as a special case
This is to address things like a percentage slider with a fixed soft mininum.

For example, the render resolution ranges from 1% to 100% and it is really
strange to have the slider showing nothing filled when the ui shows 1%.
2018-04-28 16:55:17 +02:00
Dalai Felinto
9b0ea92be7 UI: Number slider uniform filling
Now we always fill the slider with a vertical boundary. A bit hard to explain,
but very easy to see the difference.

I split the widget in three parts and used fragment shader discard to remove the
undesired bits. That means all the widget program is doing a bit extra
calculation.

Reviewers: fclem

Subscribers: billreynish

Differential Revision: https://developer.blender.org/D3186
2018-04-28 16:54:57 +02:00
Dalai Felinto
c06bfe9d09 UI: Remove hardcoded 11 uniform parameters
Using a define makes it easy to increase this later.
2018-04-28 16:33:15 +02:00
Dalai Felinto
c6fccbf842 UI: Remove deprecated drawing code 2018-04-28 16:33:15 +02:00
54aa834b7d Cleanup: fix compiler warnings on macOS / clang. 2018-04-28 16:28:19 +02:00
bf75b24818 UI: fix incorrect scaling of manipulator widgets with DPI.
U.ui_scale is the setting from the user preferences and should never be used
for drawing. UI_DPI_FAC is the final scale after DPI from the operating system
is taken into account.
2018-04-28 16:16:04 +02:00
61759f3b55 Cleanup: remove code for removed Blender Internal properties. 2018-04-28 16:15:42 +02:00
b6e66a66c2 Fix number button sides exiting continuous grab 2018-04-28 15:38:33 +02:00
d5a766a9ed Merge branch 'master' into blender2.8 2018-04-28 14:49:08 +02:00
60f4cb24da Fix vertex paint alpha brush setting color black 2018-04-28 14:47:53 +02:00
ffda096413 Cleanup: meaningful names for color blending 2018-04-28 14:45:10 +02:00
a74097dc19 UI: Add icon color saturation preference
Toolbar icon saturation can now be set from the preferences,
(use 0.4 by default).
2018-04-28 13:34:52 +02:00
69ca12c45c Revert "UI: don't highlight number button while dragging"
This reverts commit bb513b173e.

Broke click events.
2018-04-28 12:20:38 +02:00
e1417c665d UI: split toolbar layout from button creation
Having single & multi-column checks inline were becoming unmanageable.

Use a generator to define the layout,
allows for easily adding different layouts in the future.
2018-04-28 11:42:53 +02:00
a14005c070 UI: fix popover menus not refreshing when changing settings. 2018-04-28 10:42:58 +02:00
a593cc046c UI: put active tool buttons in center topbar region. 2018-04-28 10:42:58 +02:00
128b7ddd83 Fix multi-editmode memory leak
Previous commit only removed return's.
2018-04-28 09:34:48 +02:00
159a7e8b38 UI: replace transform hand icon w/ 4 arrows
The hand doesn't have a hotspot which you might want using manipulators
2018-04-28 09:14:02 +02:00
617534327a Cleanup: style, duplicate includes 2018-04-28 09:02:22 +02:00
cfa1700792 UI: add loopcut & edge offset tools
Also fix minor layout bug.
2018-04-27 23:08:25 +02:00
c42a47d177 UI: add new transform tool that enables all widgets
Also add bevel tool.
2018-04-27 22:49:52 +02:00
bb513b173e UI: don't highlight number button while dragging 2018-04-27 22:25:54 +02:00
e97ab28a03 Edit Mesh: skip unselected meshes w/ fill holes 2018-04-27 21:52:08 +02:00
69b95b45f4 Edit Mesh: multi-object support for 'Fill Holes' 2018-04-27 21:22:21 +02:00
e724238457 Tool System: use release_confirm for extrude 2018-04-27 20:43:41 +02:00
c4a24a7f5d Tool System: inset tool now completes on release 2018-04-27 20:38:29 +02:00
c0c9eb7fe2 Fix quad view region dividing lines not drawing after recent changes. 2018-04-27 20:33:58 +02:00
0adabe33bd UI: respect separators for row layout 2018-04-27 20:03:43 +02:00
970cf6f765 UI: use the layouts scale_x to scale icon width 2018-04-27 20:03:43 +02:00
Dalai Felinto
a6fb54f236 UI: Set cursor to X_MOV when editing number button middle area
Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3184
2018-04-27 19:38:18 +02:00
782240636c UI: use new extrude icon and correct keymap 2018-04-27 19:16:00 +02:00
fd68bdf7f9 UI: updated icons from @billreynish
- black outlines (better readability).
- add bone roll.
- add extrude to cursor.
2018-04-27 19:02:44 +02:00
a55016d5ef Draw Edit Curve Overlay: Fix the offset direction of the contour of selected handles 2018-04-27 14:00:22 -03:00
9cc9db87bb Fix missing action zones and emboss in the 3D viewport.
Not really happy with the fix, but it works. With the new window draw method
we are no longer storing the 3D viewport in 4 buffers, by having the GPU
viewport function directly as the 3rd buffer. This means we need to draw the
action zones into it, and so we need to keep the framebuffer bound a little
longer.
2018-04-27 18:52:19 +02:00
351d782286 UI: disable 3 column toolbars
They conflict a little with showing a narrow toolbar w/ text.
2018-04-27 18:20:48 +02:00
eb4c60124c UI: multi-column toolbar support 2018-04-27 18:02:45 +02:00
Dalai Felinto
964a2dd73f UI: Bring Embossing for the top-bar and quad-view
Note: Quad-View region overlay drawing is not working because of e01cadd657.
However I tested this patch after reverting that commit locally and this
patch's code seems fine.

Partial revert of 3d62230ed6.
2018-04-27 17:47:19 +02:00
ca66112b29 Fix missing icons in non-portable local builds.
The problem is that some local path is always returned by
bpy_resource_path. The function does not enforce a check for existence
of the path in the low level code.

Since client code may indeed not care about existence of the directory,
I leave bpy_resource_path alone and patch the python code to check for
existence. An  extra argument that enforces the check might be a better
solution, but I will be leaving this to the UI team.
2018-04-27 17:10:39 +03:00
c6d68916ed Fix multi-editmode memory leak 2018-04-27 15:38:35 +02:00
84a706a366 Minor fix, report missing instead of corrupt icon if file does not exist 2018-04-27 15:34:54 +03:00
85ea14df2f UI: support for tool settings in the top-bar
This uses the operators last used properties
to store settings to use on the next execution.
2018-04-27 14:17:12 +02:00
9504652687 UI: move tool definitions to classes
Originally it was nice to have a small list of definitions
with tools inline.

However we need to be able to define drawing functions for tools
which Python can't easily inline.

Use function for keymap definition,
support creating a function from a tuple as well
(handy for simple key-maps).
2018-04-27 13:55:04 +02:00
e01cadd657 WM: new offscreen window draw method to replace all existing methods.
For Blender 2.8 we had to be compatible with very old OpenGL versions, and
triple buffer was designed to work without offscreen rendering, by copying
the the backbuffer to a texture right before swapping. This way we could
avoid redrawing unchanged regions by copying them from this texture on the
next redraws. Triple buffer used to suffer from poor performance and driver
bugs on specific cards, so alternative draw methods remained available.

Now that we require newer OpenGL, we can have just a single draw method
that draw each region into an offscreen buffer, and then draws those to
the screen. This has some advantages:

* Poor 3D view performance when using Region Overlap should be solved now,
  since we can also cache overlapping regions in offscreen buffers.
* Page flip, anaglyph and interlace stereo drawing can be a little faster
  by avoiding a copy to an intermediate texture.
* The new 3D view drawing already writes to an offscreen buffer, which we
  can draw from directly instead of duplicating it to another buffer.
* Eventually we will be able to remove depth and stencil buffers from the
  window and save memory, though at the moment there are still some tools
  using it so it's not possible yet.
* This also fixes a bug with Eevee sampling not progressing with stereo
  drawing in the 3D viewport.

Differential Revision: https://developer.blender.org/D3061
2018-04-27 12:14:14 +02:00
868c9ac408 UI: show active tool in the topbar 2018-04-27 10:50:11 +02:00
3556838983 Fix build error after recent changes (missing FILE). 2018-04-27 10:21:56 +02:00
b756e869ee WM: Add function to access last operator props
Needed for tool-settings to control options for a tool
which has not yet been executed.
2018-04-27 10:05:03 +02:00
0908fc1190 Tool System: publish/subscribe to tool changes 2018-04-27 08:24:20 +02:00
5752e4f06f WM: message bus rna utilkity macros 2018-04-27 08:23:16 +02:00
226c757b44 UI: add darker theme color for toolbar items 2018-04-26 21:18:27 +02:00
9183592698 Animation: Make it possible to keyframe to with copy-on-write
The issue was that every object tweak was doing a full copy
of original datablock onto evaluated version, and was updating
animation. This made it impossible to tweak properties which
has keyframes.

Proposed solution is to:

- Always apply animation on frame change, and when object
  is explicitly tagged for animation update.

  This will store original DNA value of animated property
  in the f-curve.

- When applying animation in other cases, we check original
  DNA value stored in f-curve with the actual original DNA
  property. If they differ, it means user started to tweak
  animated property, and we should skip animation.

  If the value is the same, we apply animation.

This is just a first step towards proper final implementation,
but seems to be the direction we want to take.
2018-04-26 18:11:58 +02:00
c86be7345b Tool System: expose tool space-type 2018-04-26 17:58:37 +02:00
3ca20148c4 Animation: Split f-curve reading and writing functions
This way we can re-use reading part.
2018-04-26 17:24:00 +02:00
46a256b5d1 Depsgraph: Make it possible to check for ID directly tagged for animation recalc 2018-04-26 17:22:17 +02:00
67b014af48 Workspaces: active view layer now always comes from workspace, not scene.
Both the scene and workspace had an active view layer, and it was confusing
which settings were being used or displayed where. Now we always have one,
so there is no mismatch.

The "View Layers" tab in the properties editor is now "View Layer", no longer
showing a list of layers. Instead view layers can be added and removed with
the workspace view layer selector. They are also listed and selectable in the
outliner.

Single layer rendering uses the active view layer from the workspace.

This fixes bugs where the wrong active view layer was used, but more places
remain that are wrong and are now using the first view layer in the scene.
These are all marked with BKE_view_layer_context_active_PLACEHOLDER.
2018-04-26 17:06:14 +02:00
c490428bd4 UI: desaturate toolbar icons that the mouse is not over.
This does not look great with light toolbar buttons as in the default,
so consider this a work in progress.
2018-04-26 16:37:59 +02:00
5876856f7b Properties: remove redundant settings from workspaces tab.
Use render settings and active view layer will be handled elsewhere.
Also change icon to not be confusing with render layers.

Probably we should get rid of the workspace tab entirely and do it in
the user preferences, but that's for later.
2018-04-26 16:37:59 +02:00
11995c5a6e Fix reversed diff output order in view layer tests. 2018-04-26 16:37:59 +02:00
d60be68100 Fix crash with depsgraph iterator and empty scene.
This causes crashes in the view layer tests.
2018-04-26 16:37:59 +02:00
Julian Eisel
a31807ed7c Reduce size of scrollbars that don't contain scale markings
More changes will follow, this is just an initial tweak.
2018-04-26 15:34:39 +02:00
2fc5f3f378 UI: support icon reloading (F8 key) 2018-04-26 15:19:56 +02:00
29e96158b9 Icons: correct arg parsing
Use _PyArg_ParseTupleAndKeywordsFast
2018-04-26 15:18:00 +02:00
05c9ddb2d6 UI: correct icon 2018-04-26 15:02:50 +02:00
b98311f847 Cleanup: avoid direct access to private class 2018-04-26 14:55:46 +02:00
26644cd424 Merge branch 'master' into blender2.8 2018-04-26 14:36:00 +02:00
3f1df6f6fc Fix T54836: Select sharp edges doesn't flush to faces 2018-04-26 14:35:55 +02:00
57405054b2 Fix T54836: Select sharp edges doesn't flush to faces 2018-04-26 14:32:35 +02:00
Julian Eisel
35742e882f Merge branch 'master' into blender2.8 2018-04-26 14:24:41 +02:00
2ebcde701a BLF: Fix problem with drawing with fonts with multiple size.
Fix T54838 : Text display glitch w/ fonts at different sizes.

This was cause by the cache not being flushed when changing font texture.
2018-04-26 14:21:16 +02:00
df3ea82b84 Workbench: GLSL layout locations
Added layout locations
2018-04-26 14:12:39 +02:00
Julian Eisel
3c7500ca71 Cleanup: Use enums for View2D value defines
Makes the file much less cluttered and more structured.
Also made some whitespace tweaks.
2018-04-26 14:07:03 +02:00
6a0264896b UI: toolbar single column size snapping
Once a region is set to it's snapped size, zooming keeps the size.
2018-04-26 12:08:58 +02:00
e0c088f8fb GHOST: WGL: Make background rendering works on windows.
When creating an offscreen context we need wglCreatePbufferARB to create
a drawable. In non-background mode wglCreatePbufferARB would have been set
by the main window creation code. But in background mode this is not the
case so we need to create a dummy context using the screen window to init
wglew properly.
2018-04-26 11:49:47 +02:00
d37dcc4880 Fix discontinuity in default UVs for a torus
Reported in T47489 by Simon Windmill (coolpowers) who also provided the
fix, thanx.

Reviewed by Sebastian Witt (witt)
2018-04-26 11:18:59 +02:00
7fcdccbb6c Fix vertex slide regression from multi-edit
- Invalid casts.
- Leaked memory on mode switching.
2018-04-26 10:18:03 +02:00
ba9b01d3c0 Merge branch 'blender2.8-workbench' into blender2.8 2018-04-26 08:47:28 +02:00
badab5cb7d Workbench: Hair rendering 2018-04-26 08:46:58 +02:00
6c608b2f8a Workbench: Environment Light
- Changed defaults
 - Updated render panel
2018-04-26 08:31:14 +02:00
4afbbb8cf9 UI: correct toolbar w/ text display
Missed in tuple to dict refactor.
2018-04-26 08:18:41 +02:00
f7d9db5e68 Missed last commit 2018-04-26 08:10:52 +02:00
52454f1290 UI: fix toolbar naming collision bug
Active tool name needed to be unique from all other tools.
This caused problems since different modes have different tools with the
same name (Armature/Mesh click to extrude for eg).

Tool names now only need to be unique per mode.
2018-04-26 08:09:03 +02:00
27d837a6ac Workbench: Shader compilation 2018-04-26 08:06:22 +02:00
e4ee23f780 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-26 07:52:09 +02:00
3e2edb160f UI: update tool docstring
Also assert on invalid tool definitions.
2018-04-26 07:39:15 +02:00
37ca6ef7d8 UI: use dict for tool definitions
Using tuple was becoming too cryptic - new settings needed to be added
last and the purpose of each wasn't very clear.
2018-04-26 07:31:39 +02:00
db68166ed8 UI: update icons from @billreynish 2018-04-25 22:03:47 +02:00
c509922605 UI: use a wider minimum menu width
Icon only buttons with menus would be too narrow,
especially buttons for selecting tools.
2018-04-25 21:54:29 +02:00
6c1a121aef Workbench: normal packing
Normal packing. The sign is stored in the A of the color buffer.
if the A == 1.0 the normal should be inverted. before use.

The reason is that packing has more precision for frontfaces, than for
backfaces
2018-04-25 21:33:59 +02:00
8430249791 UI: shrink operator menu hold triangle a little 2018-04-25 21:24:55 +02:00
7a67bb7018 UI: workaround for text & icon alignment
Blender's icons weren't written to draw different sizes.
For now ifdef in a hack to show toolbar icons larger.
2018-04-25 21:02:50 +02:00
700012b66e UI: icon-only hold popup uses region alignment
Gives nicer tool popups for icon only buttons.
2018-04-25 20:51:49 +02:00
81f19b0c5f Fix selection with image planes 2018-04-25 19:01:41 +02:00
ce7c6e3894 Multi-Pose: Port POSE_OT_select_mirror 2018-04-25 18:35:20 +02:00
46bfdb48a1 WM: Add GHOST lazy init for background mode.
This allows for background rendering with EEVEE and other opengl render
engine.

I've only tested it on Linux for the moment so I can't say about other
platforms.

We do lazy init because we cannot assume we will need Ghost for rendering
before having parsed all arguments and we cannot know if a script will
trigger rendering. This is also because it currently does not work without
any display server (blender will crash).
2018-04-25 17:43:18 +02:00
56fbdd7908 GHOST: Fix missing glXCreatePbuffer initialisation.
For some reason this happened if no windows are created before creating an
offscreen context.
2018-04-25 17:43:18 +02:00
284dbd56df GHOST: GLX: Remove old version check. 2018-04-25 17:43:18 +02:00
5337f66e81 EEVEE: UI: Add missing separator. 2018-04-25 17:43:18 +02:00
d19dc5f891 EEVEE: UI: Merge the custom parallax checkbox with the panel title. 2018-04-25 17:43:18 +02:00
0113693129 Merge branch 'master' into blender2.8 2018-04-25 17:27:23 +02:00
f69feb4957 UI: optionally pass icon size to widget_draw_icon
No functional changes.
2018-04-25 17:26:45 +02:00
e584f3d8d2 Depsgraph: Don;t use copy actions flag
Is useless without main.
2018-04-25 17:00:41 +02:00
99c5bd0cd9 Merge branch 'master' into blender2.8 2018-04-25 17:00:19 +02:00
89bcc80c25 Library: Add assert to catch unsupported copy flags combination
Thanks Bastien for review!
2018-04-25 16:59:35 +02:00
fa43886690 Workbench: make normal packing optional 2018-04-25 16:57:18 +02:00
75e0767849 Merge branch 'master' into blender2.8 2018-04-25 16:35:11 +02:00
a153acde1d Depsgraph: Introduce flag top indicate scene is evaluating for a new frame 2018-04-25 16:34:55 +02:00
e5633114cd Depsgraph: Preserve CoW ID recalc flags
Previously they would have been replaced with flag from original
datablock, which is not what we want.
2018-04-25 16:34:55 +02:00
29631ff013 Depsgraph: Ensure we only expand scene datablock on evaluation
Previously it could have happened on every request to evaluated scene
or view layer.

This commit also removes expansion of view layer and scene from iterator.
Iterator is not to be used before depsgraph is evaluated.
2018-04-25 16:34:55 +02:00
09da47b67a Depsgraph: Avoid hash lookup for every evaluated scene query
Cache pointer to evaluated scene datablock on relations build time,
that pointer never changes after that.
2018-04-25 16:34:55 +02:00
331e97bcf3 Depsgraph: Fix missing relations in array modifier
Found by Dr. Sybren while working on modifiers port.
2018-04-25 16:34:01 +02:00
5f97331ffc Workbench: Added studio lighting to view layer 2018-04-25 15:59:15 +02:00
a9d3f9f54d Revert "UI: fix inconsistency in button rounding when zooming in."
This isn't working well when zoomed out in the properties editor,
we should be taking into account properties editor zoom level.

This reverts commit 1ba91ae2c0.
2018-04-25 15:42:41 +02:00
cc7460eaa4 Fix multi-edit mode on file load
Setting up the initial object mode would change objects which were
already moved into their mode along with the active object.
2018-04-25 15:29:20 +02:00
4b8d7a143e Merge branch 'master' into blender2.8 2018-04-25 14:54:34 +02:00
13b6867d1f CDDM: correct (disabled) logic in merge verts 2018-04-25 14:53:44 +02:00
cdfc4c0d1d Search local before system path
This works in both cases,
where system path would return a path even when it's missing.
2018-04-25 14:13:32 +02:00
c392f2448c Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-25 13:44:45 +02:00
a8f114258a Merge branch 'master' into blender2.8 2018-04-25 13:35:38 +02:00
Dalai Felinto
0357493033 Fix T54806: Editors drawing glitch when using lasso selection
We should always reset to default glBlendFunc after done drawing.
2018-04-25 13:08:34 +02:00
74b0976926 Merge branch 'blender2.8-workbench' into blender2.8
Support of hair in workbench
2018-04-25 13:08:02 +02:00
fe149da993 Edit Mesh: don't recalc all meshes w/ extrude 2018-04-25 13:06:03 +02:00
9e3e648a08 Depsgraph: Clarify python API
Follow same naming convention as for C:

- Original data is named without any extra prefix/suffix.
- Evaluated data is named with _eval suffix.
2018-04-25 13:04:14 +02:00
5345f28229 Workbench: Enabled Hair rendering 2018-04-25 13:00:18 +02:00
53dc251fd3 Remove developer exception hack
This caused too much trouble, also it's possible users run with
'release' in their CWD causing issues.

Developers can symlink "release/" to "bin/2.79".
2018-04-25 12:54:27 +02:00
d7d20b483a Revert "Fix (unreported) broken 'get system path' in some cases."
This reverts commit f1bc0aedde.
2018-04-25 12:48:51 +02:00
Dalai Felinto
1d7bdbd273 Edit Mesh: multi-object extrude_region
Technically this is the following operator:
bpy.ops.view3d.edit_mesh_extrude_move_normal

But this is a Python operator that in turns calls:
MESH_OT_extrude_region_move

Which in turns calls:
* MESH_OT_extrude_region
* TRANSFORM_OT_translate
2018-04-25 12:37:10 +02:00
7958a2b40e Docs: correct debug help message 2018-04-25 12:30:11 +02:00
26dab9c2fe Buildbot: Attempt to link against Blosc statically
Was broken by f1e6838376.
2018-04-25 12:27:35 +02:00
2de00f495d Merge branch 'master' into blender2.8 2018-04-25 12:26:26 +02:00
9a7f963a02 Cleanup: comments 2018-04-25 12:25:47 +02:00
fca3dbdba5 Fixed wrong merge 2018-04-25 12:23:44 +02:00
336abd6fac Merge branch 'blender2.8' into blender2.8-workbench 2018-04-25 12:20:45 +02:00
Dalai Felinto
791b9d821b Multi-View: Moving panel to render, and rename to Stereoscopy
Multi-View was never a per-viewlayer option. And now that we have viewlayer
it is better to name it in a more recognizable way:

"Stereoscopy" instad of plain "Views".
2018-04-25 12:12:43 +02:00
3315963f0a Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-25 12:06:03 +02:00
e236b2977c Overlay: Codestyle
removed unused code
2018-04-25 12:03:27 +02:00
c115021f8b Cleanup: unused vars 2018-04-25 11:59:52 +02:00
8f76d05fa5 Workbench: GLSL performance + code style
- store normal in vec2
 - use rgba_8 for colorBuffer
2018-04-25 11:54:02 +02:00
83528feeed Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-25 11:31:03 +02:00
f938ff1010 Workbench: Dither background color/gradient 2018-04-25 11:30:38 +02:00
9befee49a7 Fix: Silence texture stack owner_id warnings in debug mode from anim_filtering code
The Blender Internal removal (51b796ff15)
removed support for texture slots from Materials/Lamps/Worlds,
but didn't remove the relevant parts from the animation editor filtering
code that were responsible for adding the texture slots for those channels.
2018-04-25 11:18:45 +02:00
35220ccde0 Silhouette Overlap Overlay
Added Object Overlap Overlay

 - Added R32UI support to GPU_framebuffer
 - Added R32U support to draw manager
 - The overlay mode has a object data pass that will render 'needed' data to specific buffers so we can mix them together via a deferred rendering. In future will also add UV's and other data
 - Overlap is implemented as an overlay so it could be used on top of the Scene lighted Solid mode (that will be rendered by Eevee.

Reviewers: fclem, brecht

Reviewed By: fclem

Subscribers: sergey

Tags: #code_quest

Maniphest Tasks: T54726

Differential Revision: https://developer.blender.org/D3174
2018-04-25 11:09:49 +02:00
Dalai Felinto
fc8d903000 Edit Mesh: multi-object split 2018-04-25 10:58:59 +02:00
e649feea14 Merge branch 'master' into blender2.8 2018-04-25 10:39:51 +02:00
f1bc0aedde Fix (unreported) broken 'get system path' in some cases.
There were two issues here actually:
* The hack to allow running Blender directly from the source directory
would just check for a 'release' directory, without actually ensuring it
is release dir from blender source tree, and not some other random
folder.
* GHOST_getSystemDir returns nothing for portable installations, now
we'll then check directly in the blender binary dir in that case.

This fix is more critical in 2.8 branch, where that system path is used
to retrieve new '3D' icons...
2018-04-25 10:37:36 +02:00
5f8b85e253 Cleanup: use blender terminology 2018-04-25 10:17:31 +02:00
6866547517 Fix cursor switching w/ transform redo
Recent cursor changes stopped number button continuous grab.
2018-04-25 10:15:20 +02:00
3ae4aa720f Cleanup: indentation 2018-04-25 10:10:00 +02:00
f210c93945 UI: disable advanced option for redo popover 2018-04-25 10:08:04 +02:00
d63b66be82 CMake: only write edited file when changes made
Caused cmake to run after every icon update.
2018-04-25 09:58:38 +02:00
0d69dfbfc1 Cleanup: typos 2018-04-25 09:58:38 +02:00
Dalai Felinto
dfd82b18df Merge remote-tracking branch 'origin/master' into blender2.8 2018-04-25 09:31:25 +02:00
Dalai Felinto
5285de16f3 Fix string comparison in GNUMakefile for linux systems 2018-04-25 09:30:55 +02:00
2fe35914e1 CMake: generate icon list for installation
MSVC users weren't getting icons installed, since glob isn't reliable,
list all files in a section which the update script maintains.
2018-04-25 09:24:54 +02:00
4d6cdb8b89 UI: add extrude icon 2018-04-25 09:21:49 +02:00
deb98cfe5a UI: show all pain mode panels in the topbar
This shows some which need to be hidden (eventually).
2018-04-25 08:20:01 +02:00
ca49a9edce UI: move mode options to the topbar
Remove toolbar panels which have items available in menus.
2018-04-25 08:16:21 +02:00
b00d971efe UI: Apply remove redo region
This was a disabled part of the top-bar merge (code by @Severin)

The only change made is to move to redo UI into a popover.
2018-04-25 07:55:50 +02:00
e944e215bf UI: remove history & object tools
Add object shading menu.
2018-04-25 07:25:08 +02:00
021444c827 UI: mesh rip icons 2018-04-25 07:15:30 +02:00
6a9d215ad5 UI: remove mesh panel 2018-04-25 07:12:34 +02:00
64e3051ebe UI: remove shading & uv's panel 2018-04-24 21:07:05 +02:00
987fc30959 UI: disable grease pencil panel
Disable poll functions since branch replaces this code.
2018-04-24 21:05:24 +02:00
1a8b24e1b1 UI: move rigid body physics to menu 2018-04-24 20:46:18 +02:00
f3692c6ab9 UI: remove animation panel 2018-04-24 20:37:37 +02:00
Julian Eisel
2cd9a0ce5c Hide top-bar in fullscreen
Fullscreen as in the Alt+F10 fullscreen.
2018-04-24 20:16:44 +02:00
34d6b48c47 UI: remove relations panel 2018-04-24 19:54:22 +02:00
5d3f1d1f78 UI: remove transform panels 2018-04-24 19:35:11 +02:00
0c4ceda75b Fix NULL pointer check 2018-04-24 19:34:09 +02:00
d6e7ec6253 Cleanup: unused var 2018-04-24 19:28:53 +02:00
b05fd95f8a Current Frame Indicator tweaks
* Draw the frame/time number box over the scrollbar instead of above it,
  to reduce the clutter/clashes with markers.

* Draw the box centered around the line instead of off to one side,
  making it clearer that the frame shown is the one being affected.

* Make the box larger than the scrollbar + use white text to make it
  stand out from the neighbouring frame numbers (otherwise, it's easy
  to misread that it's just another one of those)
2018-04-24 19:18:31 +02:00
9511cc13d7 Bind Camera to Markers - Various tweaks to make this nicer to work with
Based on discussions here in the office, this commit introduces a number of
changes to make the "Bind Camera to Markers" feature (introduced during Sintel
to facilitate camera switching, and now an integral part of the UI for doing this)
nicer to use.

Main changes:
* "Camera Markers" are now drawn using Camera icons, making it easier to
   distinguish between them and other ("normal") markers

* "Camera Markers" will display the name of the bound marker, making it
   easier to see what camera each marker uses. This will then also stay
   in sync with the camera being used (though a manual refresh is needed
   after renaming objects to make the timeline update), fixing the problem
   where the marker's camera and the name get out of sync.

* Behaviour of Ctrl-B has been modified to make it easier to quickly add
  these markers. Now, it will directly add a new marker on the current frame,
  bound to the currently selected camera object. If there's an existing marker
  on that frame, the existing marker's camera will be replaced instead of making
  a new marker.
2018-04-24 19:18:31 +02:00
ef08e77a46 Markers: Move "Bind Camera to Marker" from 'View' Menu to the Markers menu proper
It was always weird that this tool for markers was stored in a different
menu where it was hard to find.
2018-04-24 19:18:31 +02:00
58650a7599 UI Tweak: Don't hide frame range indicators when preview range is shown
After discussing with UI team, it's better to show both ranges, to make it
clearer that we have an "overlay" with the preview range.
2018-04-24 19:18:31 +02:00
b671b1759c EEVEE: Fix TAA spreading black disease.
The SSR has a bug that creates NAN pixels values. Reported here T54795.
2018-04-24 17:54:39 +02:00
b60617ffab Error in last commit 2018-04-24 17:46:51 +02:00
bd40b2c402 Icons: only write icons from group 'Export'
Allows reference objects not to get mixed up with finished icons.
2018-04-24 17:45:19 +02:00
00d4e99955 UI: move mesh-weights from panels to menus
Also de-duplicate edit/object mode menus.
2018-04-24 17:04:43 +02:00
354dbdde01 UI: hide toolbar text when narrow 2018-04-24 16:33:38 +02:00
e4724b1c8b UI: remove create panel
Move create to the menus.
2018-04-24 16:13:03 +02:00
a59bf99f1d UI: remove toolbar header 2018-04-24 16:04:07 +02:00
9c5025d67d UI: use new icons in toolbar 2018-04-24 15:32:45 +02:00
174cb39192 UI: icons from @billreynish 2018-04-24 15:32:45 +02:00
2a9d008283 Manipulators: Fix Rotate manipulator arc drawing issue. 2018-04-24 15:06:27 +02:00
19808c347d Manipulators: Make rotate manipulator smoother. 2018-04-24 15:06:27 +02:00
adb915c1a6 Manipulators: Enable AntiAliased drawing of manipulators by default.
This exhibit some little artifacts inherent to GL_LINE/POLYHON_SMOOTH but
it's far less distracting than really bad Aliasing.
2018-04-24 15:06:27 +02:00
dd14145511 EEVEE: Fix contact shadows on flat objects/backfaces. 2018-04-24 15:06:27 +02:00
4e0a535670 EEVEE: Group Timing stats for probe rendering. 2018-04-24 15:06:27 +02:00
40199c1d10 Manipulator: Use evaluated object's matrix to get maipulator position
With the clear separation between data and a state we need to make sure
operators and other areas are readingstate from evaluated datablocks.

Code-wise it means that all evaluated values are to be read from dataglock
which is owned by dependency graph, using DEG_get_evaluated_id() or similar
helper.

Reviewers: brecht, mont29, campbellbarton, dfelinto

Differential Revision: https://developer.blender.org/D3036
2018-04-24 14:50:40 +02:00
bb92d9a946 BLI BVHTree Walk DFS: Decreases the size of the stack space used for the recursive function.
Each parameter of the function is copied into the memory stack.
This also brought an improvement in peformance of snapping functions between 5% and 12% in my tests.
2018-04-24 09:48:14 -03:00
eb521b22b2 Make View Selected to be aware of copy-on-write 2018-04-24 14:44:31 +02:00
4376bb6405 Multi-Object Pose: Apply Visual Transforms operator 2018-04-24 14:31:56 +02:00
b96f8bf7fb UI: display icons w/ OSA even when very large 2018-04-24 14:18:56 +02:00
c56bbf60d8 Outliner: reorganize collection related display modes.
* "Scenes" now shows for each scene lists of all view layers, collections and
  objects contained in it. This is the place to see all collections and objects
  in the scene even if they are not used in any view layer. Objects are nested
  according to parenting here.
* "Collections" now shows all collections in the view layer, and the objects
  in those collections. Objects are not nested by parenting, only collections
  since it would be too confusing if the children are in a different collection.
* "Groups" is unchanged.
* "View Layer" was removed, replaced by "Collections".

Part of T54790.
2018-04-24 14:01:51 +02:00
d67b120f17 UI: disable writing icon size
Causes staircasing, just use byte range
2018-04-24 13:52:25 +02:00
011c0b6113 Cleanup: correct comments 2018-04-24 13:50:31 +02:00
Stefan Werner
f1e6838376 Build: Added explicit search for Blosc in CMake files. Unix build will now disable WITH_OPENVDB_BLOSC if Blosc libraries cannot be found. 2018-04-24 13:26:54 +02:00
Stefan Werner
0ab30f9e39 Build deps: Fixed TBB build with GCC 6 and newer, turning off dead store elimination. 2018-04-24 13:23:52 +02:00
3e26b84397 Camera manipulator: Make it aware of evaluated version of object
Reviewers: brecht, dfelinto

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3159
2018-04-24 12:57:43 +02:00
15bfa175f8 EEVEE: LightProbe: Implement Visibility Group.
Works on every probe type.

The function to see is EEVEE_lightprobes_obj_visibility_cb.

Set pinfo->vis_data.cached to true makes the computation faster for multiple
views using the same group.

We could even sort the probes by group for that mater to speed things up
even more (only applies to dynamic probes like the planar reflections because
other probes are only rendered one at a time).
2018-04-24 12:48:43 +02:00
2ff8f965df DRW: Add visibility callback function.
This add a callback function that runs after frustum culling test.

This callback returns the final visibility for this object.

Be aware that it's called for EVERY drawcalls that use this callback even
if their visibility has been cached.
2018-04-24 12:48:43 +02:00
8fb9dfbec5 EEVEE: LightProbes: Add Visibility Group to DNA/RNA/UI. 2018-04-24 12:48:43 +02:00
9ff8195535 OpenGL: Remove remaining instances of GL_RGBA16F_ARB.
There is no need for it now that we use opengl 3.3. Use GL_RGBA16F instead.
2018-04-24 12:48:43 +02:00
7d859da513 Arc: Use proper lacding branch 2018-04-24 12:26:37 +02:00
Dalai Felinto
08e4808318 Fix EEVEE lamps with shadows by default but wrong UI
Reported on T54788: Actually this was what BI was doing as well.
But anyways fixed for good now.

That includes a subversion bump.
2018-04-24 12:25:41 +02:00
24bde1ca43 Add "make icons_geom" convenience target
Generates icons from the blend file in lib.
2018-04-24 12:09:31 +02:00
67f23cff53 Topbar: clarify command settings name, remove placeholder button. 2018-04-24 11:35:25 +02:00
1ba91ae2c0 UI: fix inconsistency in button rounding when zooming in.
Some widgets would have rounding relative to the button size, others
absolute. Now it's always absolute. Note changing Display Scale in the
user prefs is not zooming, the rounding still scales with that.
2018-04-24 11:10:08 +02:00
1da1288544 Check LOCAL datafiles if SYSTEM not found 2018-04-24 10:45:57 +02:00
45374b3880 Icon Generate: write icon size into the header 2018-04-24 10:32:08 +02:00
Stefan Werner
dac8b08f4c Build deps: Fixed capitalisation of CMake modules path for OpenVDB. Before, OpenVDB would always build without BLOSC and TBB support on case-sensitive file systems. 2018-04-24 10:28:38 +02:00
3581b997d4 UI: use icons for the toolbar 2018-04-24 09:19:28 +02:00
4b544e857c Merge branch 'master' into blender2.8 2018-04-24 08:01:21 +02:00
76b7142690 Merge branch 'blender2.8-workbench' of git.blender.org:blender into blender2.8-workbench 2018-04-24 07:59:18 +02:00
c1b310c32b Utility to generate geometry icons 2018-04-24 07:52:57 +02:00
Julian Eisel
10f0f4b06f Fix opening new windows would try to open global areas twice
Would cause weird & broken areas below the topbar.
2018-04-23 22:18:49 +02:00
92f36586e3 BLI_math: avoid assert with non-finite numbers 2018-04-23 21:09:01 +02:00
ab10181d57 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-23 20:45:24 +02:00
74b3947c90 Error in last commit 2018-04-23 20:44:41 +02:00
860642aba1 Error in last commit 2018-04-23 20:29:40 +02:00
1287fa3f7c UI: option to load icon from file 2018-04-23 20:24:49 +02:00
20105fc845 Static Override: initial enabling of overrides for modifiers and constraints.
Just the 'mute' button for now.
2018-04-23 18:10:06 +02:00
1fe4ade251 Merge branch 'blender2.8-workbench' of git.blender.org:blender into blender2.8-workbench 2018-04-23 17:04:13 +02:00
4498192813 Static Overrides: more performances improvements.
Moved another dynamic allocating print into (usually) static one, gives
us another average 8% speedup on Autumn rig.
2018-04-23 16:52:26 +02:00
fc9624e485 Merge branch 'master' into blender2.8 2018-04-23 16:44:09 +02:00
53d69e6d04 Depsgraph: Add relation flag to avoid flush across it
This way we can avoid re-evaluation of certain parts of datablock
when something unrelated has changed.
2018-04-23 16:42:37 +02:00
c8e1f18c5d stylecode cleanup 2018-04-23 16:13:50 +02:00
2e1ac7e2df Static Overrides: disable animated check for now.
This is actually rather slow process, commeting it out gives us another
10% speedup... On a non-animated char! Don't even want to know how much
this would have costed on a rig with hundreds of fcurves!

And checking this is not really critical for us anyway, once animated
you do not really care whether props are also statically overridden or
not.
2018-04-23 16:08:45 +02:00
a7960db471 Static Overrides: hide/deactivate all but 'REPLACE' operation.
Others remain in code for now, just not exposed to user.
2018-04-23 15:15:53 +02:00
d2f4b4962f Overlay: Object Overlap overlay
- Added UInt R support to framebuffers
- Added the overlap as an overlay so should be reusable by other engines
(Scene lighted Solid mode)

Differential Revision: https://developer.blender.org/D3175
2018-04-23 15:13:22 +02:00
054d7038cc Merge branch 'master' into blender2.8 2018-04-23 14:55:38 +02:00
86f988cede Overlay: Object Overlap overlay
- Added UInt R support to framebuffers
- Added the overlap as an overlay so should be reusable by other engines
(Scene lighted Solid mode)
2018-04-23 14:54:18 +02:00
0ca7a78f20 Depsgraph: Fix missing update with animated curve path 2018-04-23 14:53:54 +02:00
4529192157 Multi-Object Pose: Reset unkeyed works now (Clear User Transforms) 2018-04-23 14:51:24 +02:00
375f757a60 Cleanup: Remove old cruft (from 2.4) 2018-04-23 14:51:24 +02:00
Julian Eisel
6c46174662 Fix crash when opening file-browser through top-bar menus
Was probably caused by top-bar merge.
2018-04-23 14:36:42 +02:00
2183f93dbe Merge branch 'master' into blender2.8 2018-04-23 14:35:46 +02:00
41cf2d9042 Depsgraph: Cleanup, remove unused relation tag 2018-04-23 14:34:56 +02:00
89f7fb0aef Pqrtiql fix of some operators in object.py.
They were still trying to set active object of Scene.

Select hierarchy with extend option is still not zorking for some
;ysterious reasons. :/
2018-04-23 14:26:07 +02:00
d276ef7062 Fix typo in error message. 2018-04-23 14:25:42 +02:00
21c250926c Cleanup some remaining LOD stuff after BGE removal. 2018-04-23 14:12:34 +02:00
020c93360f Fix: Set defaults for converted timeline editors properly
(Summary channels for the "timeline" dopesheet wasn't collapsed as it should be)
2018-04-23 14:05:55 +02:00
3f21023f24 Fix: View All/Selected entries in new "timeline" not working
These entries were still referring to the old standalone timeline editor
2018-04-23 14:05:55 +02:00
9acf3a10cf Fix: Changing bone group color doesn't refresh/redraw viewport 2018-04-23 14:05:55 +02:00
Dalai Felinto
71eca8e82c Indentation cleanup 2018-04-23 13:53:11 +02:00
ede19477c8 Fix T54765: build error on macOS. 2018-04-23 13:42:43 +02:00
46a0e72540 Merge branch 'master' into blender2.8 2018-04-23 12:59:57 +02:00
7cb2727157 Fix git submodules branch configuration 2018-04-23 12:55:04 +02:00
b14979f91f Cleanup: style 2018-04-23 12:53:45 +02:00
d68f7c8e11 Depsgraph: Make update flags debug print more useful
Will print list of human-readable update flags, not the combined bitfield
printed as a number.
2018-04-23 12:53:43 +02:00
4df12b6ca6 DRW: Antialiased 3D cursor.
Common peeps! Why wasn't it already done?
2018-04-23 12:49:25 +02:00
100e10e4b0 WM: use last_redo operator
Was showing operators that weren't meant to display in the UI.
2018-04-23 12:36:20 +02:00
8264b772f5 Fix T54766: "Record With"-NLA "Push Down" discards Blend Mode, Extrapolation, and Influence
Applied similar fix to T54233 to get the "Record with NLA" feature working with
active action blending + influence settings. Extrapolation is explicitly ignored
though, as it shouldn't be used with this feature (i.e. it is already disabled
with the new strips and also on the animdata by default)
2018-04-23 12:35:37 +02:00
dc16f6fedc Fix T54767: Crash in versionning code for recent editors' removal.
Always check for non-Null pointers there! This versionning code is
called from many different places, with many different kind of Main's.
2018-04-23 12:31:03 +02:00
f19e8eaa4b Depsgraph: Avoid redundant copy-on-write relations
Was adding some relations twice. Harmless, but means extra stuff to do
when evaluating the scene.
2018-04-23 12:18:59 +02:00
cd289f6ea5 UI Tweak: Bring Graph Editor's mode selector left of the menus, as is now done for Dopesheet 2018-04-23 12:01:59 +02:00
fdf5834b44 Fix crash reading old userpref.blend
While window manager is supposed to exist after file was fully read
and do-versioned, we can not rely on window manager to exist while
reading file and setting up an environment.
2018-04-23 11:45:40 +02:00
63c4654135 Cleanup: uninitialized variable 2018-04-23 11:04:10 +02:00
fc1374c01b Cleanup: style 2018-04-23 11:04:10 +02:00
3aa75ba452 Merge branch 'master' into blender2.8 2018-04-23 09:35:20 +02:00
fa7e19bca4 Depsgraph: Add missing relations builder
Was possible to miss some relations from being built
when parent object is linked to the scene graph indirectly.
2018-04-23 09:33:33 +02:00
dea3ba6d81 UI: show arrow for popovers above buttons
Also don't align popover buttons with activated popovers.
2018-04-23 08:51:13 +02:00
9971eb4437 Cleanup: includes & comments 2018-04-23 08:10:03 +02:00
574c0fe38f Manipulators/Tools: always draw a cursor while interacting
Cursor can be a system one or drawn with OpenGL.
Before, dragging the transform manipulator would hide the cursor and reset it to the initial positon.
2018-04-23 00:59:01 +02:00
93adbf8195 Manipulators: tweak plane distance in move manipulator 2018-04-23 00:51:20 +02:00
ad0753218f Manipulators: removed unused structure member 2018-04-23 00:51:20 +02:00
Julian Eisel
c6144b24f9 Update default workspaces.blend fixing crashes after editor removals
* Fixes crashes in versioning code for the removed editor types (see d8c719d8d8)
* Removes 'Game Logic' workspace.

It still only contains workspaces converted from old screen-layouts, proper
defaults are on the TODO.
2018-04-23 00:18:31 +02:00
Julian Eisel
d8c719d8d8 Replace old Timelines and Logic Editors with new Dopesheet (Timeline mode)
Timelines and Logic Editors are gone. So far they were simply replaced by broken
Info Editors, now they are replaced by Dopesheets in the new Timeline mode.

We reuse ScrArea.butspacetype to temporarily store the space-type identifier of
the deprecated editor (see 9db492de6d). That way we can identify it in
versioning code and replace it nicely.
Action editor creation needs a scene to set the scrolling based on frame range.
Active screen-layouts use the active scene of the window they are displayed in.
Inactive screens simply use the first scene in the main data base.
Note that inactive editors don't need version patching, readfile.c converts them
to SPACE_EMPTY already, so users can't activate them.

Files saved since the editors were removed will still be broken.
Workspace config files saved before this will also crash (will update default
one in followup commit).
2018-04-23 00:12:26 +02:00
Julian Eisel
9db492de6d Cleanup: Get rid of ScrArea.butspacetype syncing with ScrArea.spacetype
The only real reason we need `butspacetype` is while switching areas, where we
need to delay the actual switch to the RNA _update callback since only there we
can access context.
So instead of trying to sync it with `spacetype`, only set while needed and
unset it afterwards (as in set to `SPACE_EMPTY`).

This should also allow us to re-use `butspacetype` in versioning code when
trying to read removed editors. It'll store the space type value of the removed
editor which we can then use on versioning.

For backwards compatibility, we store `butspacetype` with the value of
`spacetype`.
2018-04-22 23:23:20 +02:00
9eaf00616b UI: draw arrow for popover 2018-04-22 23:03:08 +02:00
Dalai Felinto
387bf726ac UI: Editor outline color themable
Note: Not bothering with doversion, re-using 280, 10 bump.
2018-04-22 22:55:18 +02:00
62cd5e0b7b UI: support for center popovers over buttons 2018-04-22 22:13:26 +02:00
Dalai Felinto
46375b8e03 Embossing for the areas only, with unified color
We bring back embossing however only for areas.
We use the same color for the corners.
2018-04-22 22:11:48 +02:00
20a713b7ff UI: number button arrows appear on hover, highlight clickable areas. 2018-04-22 21:48:53 +02:00
15ca90489f UI: make button roundness themeable. 2018-04-22 21:47:51 +02:00
b8404be8a8 Fix missing filter size in Eevee film panel. 2018-04-22 21:47:51 +02:00
e467916034 Cycles: rename engine to just "Cycles" instead of "Cycles Render" in the UI. 2018-04-22 21:47:51 +02:00
Dalai Felinto
3d62230ed6 UI: Remove Embossing
We are using a different visual system to tell the areas apart.
There is no longer need for embossing.
2018-04-22 20:11:36 +02:00
Dalai Felinto
342d62291b Action Zone: No need for drawing (the triangles)
Now that we can easily tell the corners apart, there is no need to
a specific action zone draw here (cursor still changes, naturally).
2018-04-22 19:54:26 +02:00
Dalai Felinto
d5af21f543 Action Zone: Enable them in the four corners 2018-04-22 19:54:26 +02:00
Dalai Felinto
8733ad4d2a UI: Draw round corners between the editors
This makes easier to distinguish between different editors
(as oppose to an editor and its regions).

Note action zones look a bit strange with this. I recommend we do next:
* Make sure all 4 corners can be used as action zones.
* Remove their drawing code (or show them only on mouse hover).
2018-04-22 19:54:26 +02:00
Dalai Felinto
90068773db UI: Move ui_draw_anti_tria to UI_interface.h
Using extern makes too easy to get a crash if the original
function definition changed.
2018-04-22 19:54:26 +02:00
Dalai Felinto
2d0c1f324c UI: Remove hard-code + add comment for aa triangles 2018-04-22 19:54:26 +02:00
43bceeedd9 Merge branch 'master' into blender2.8 2018-04-22 19:23:02 +02:00
89ab591345 Cleanup: UI naming 2018-04-22 19:22:10 +02:00
0d9c97d170 UI: moving the cursor to open other popovers
Match menu behavior
2018-04-22 18:43:59 +02:00
92404dd48d UI: popover now use menu style buttons
Also scale width with UI-scale.
2018-04-22 18:39:29 +02:00
e6d1fb87c6 UI: Initial popover support for panels
- UILayout.popover(.. panel_type ..)
  A single panel
- UILayout.popover_group(.. panel categories ..)
  Expands all panels matching args.

Currently used in the topbar for redo and paint options.
2018-04-22 17:45:14 +02:00
b8e7991811 Overlay: face orientation
- fixed the blending with solid drawtype
2018-04-22 12:58:11 +02:00
1de7a0c0dc Merge branch 'master' into blender2.8 2018-04-22 10:51:23 +02:00
420e379e99 Cleanup: de-dup popup/pie menu RNA definition
Also rename pupmenu -> popmenu
2018-04-22 10:49:45 +02:00
e597f7495a Cleanup: ui-link drawing code from logic bricks 2018-04-22 10:23:43 +02:00
5eb20bd152 Cleanup: style 2018-04-22 09:09:28 +02:00
c754ddf395 Remove unused shader
Originally added for icon drawing, no longer used.
2018-04-22 08:57:56 +02:00
02f28da187 Cleanup: trailing spaces
Applied to newly added files in 2.8
2018-04-22 08:45:52 +02:00
ba71184755 Lattice Select Random, Mirror
D3165, D3166 by @ranjian0
2018-04-21 23:52:47 +02:00
a0a8bc2719 Error in last commit 2018-04-21 23:52:16 +02:00
207b549d40 Edit Mesh: multi-object edge split support
D3161 by @JacquesLucke
2018-04-21 22:26:33 +02:00
Julian Eisel
5ddcfd2456 Fix crash when opening properties editor
Opening as in activating one in an area that didn't contain a properties editor
before.
2018-04-21 22:06:27 +02:00
25a529f440 UI: add own icon rasterizer
Use software drawing, cache to an image at the requested pixel size.
2018-04-21 21:10:09 +02:00
122d0d1504 Cleanup: style 2018-04-21 20:42:27 +02:00
46a9038f60 Cleanup: variable naming 2018-04-21 20:22:12 +02:00
112540da62 Merge branch 'master' into blender2.8 2018-04-21 20:17:41 +02:00
Julian Eisel
9a35ad752e Cleanup: Get rid of context in editor 'new' callback
Requiring context means we can't easily create new editors to replace deprecated
ones in versioning code.
Think it's reasonable to give editors access to scene and area data for their
initial setup though. They mostly need it for setting "the view", as in,
scrolling values.

Also did minor cleanup in top-bar creation function.
2018-04-21 19:47:27 +02:00
9ba84342fb Fix point density rendering in Cycles. 2018-04-21 19:43:41 +02:00
Julian Eisel
fa5aa18fdd Fix: Adding new 3D View changes custom transform orientation to gimbal
Steps to recreate were:
* Create custom transform orientation.
* Change properties editor into 3D View.
* Trigger refresh of 3D view header by mouse hovering it.

Mistake in rB7d055da327b9555f.
2018-04-21 19:05:15 +02:00
Julian Eisel
003e4e6b80 Top-bar: Don't draw horizontal region separator
That way the tabs look nicely together with the lower sub-bar.
2018-04-21 18:45:58 +02:00
1e9fb355bf BLI_bitmap: 2D triangle drawing function
Matching polygon filling but no need for allocation or qsort.
2018-04-21 18:34:34 +02:00
83cb387944 BLI math: clamped barycentric weight calculation 2018-04-21 18:34:20 +02:00
22bd1559e1 Fix active region flickering in some cases, now always update before draw. 2018-04-21 17:42:49 +02:00
c23f33ac9e View3D: Atenuate banding artifacts on background gradient.
Dithering the output color for 8bit precision framebuffer with bayer matrix.
On my tests the bayer matrux patterns are not noticeable at all.

Note that it also does that in opengl rendered mode which can be in a much
higher bitdepth. We can fix that if that's a problem in the future but I
doubt it will.
2018-04-21 16:49:38 +02:00
28a24db68a Fix feature set button misalignment. 2018-04-21 13:03:16 +02:00
0f2b4cb68a Topbar: remove info editor menus, rename topbar menus for script compatibility.
We can still rename them later, but avoid breaking stuff for now.
2018-04-21 12:43:27 +02:00
e89fefdc69 Topbar: visual tweaks
* Make bottom half of topbar a bit higher
* Make tabs higher and put them closer together
* Remove screen layouts dropdown, we'll have one layout per window
* Hide action zones from topbar
* Don't change topbar background color when activating
2018-04-21 12:41:20 +02:00
04fe5edba3 Fix: Typos in operator names were resulting in warnings being printed to the console 2018-04-21 00:34:55 +02:00
26ee70099a Fix: D3160 fixed blednerplayer stub.s for unix 2018-04-20 23:34:54 +02:00
e9d940ca2f Fix topbar UI w/ no active object 2018-04-20 23:08:08 +02:00
be648680c7 Fix frame-buffer texture creation
- disable depth buffer didn't work.
- push/pop viewport bit was needed.
2018-04-20 20:57:28 +02:00
6dc50bc25a Cleanup: warnings 2018-04-20 20:48:19 +02:00
18f239d5a8 Remove attempt at timeline editor version patching
This will never get run, because direct_link_area() already flags/resets
every space type isn't registered, meaning that we don't have any opportunity
to apply our patching.
2018-04-20 18:55:56 +02:00
5374865523 Dopesheet-Timeline: Removal of Timeline Editor!
This commit removes all references to the old timeline editor.

Unfortuantely, the removal of the Timeline spacetype defining
functions has ended up breaking the version patching code I'd
been working on earlier (as now, the editor gets marked as
"unknown/info" before we get a chance to patch it!)
2018-04-20 18:55:56 +02:00
b5b4802af6 Fix: Copy and paste error from earlier commit adding message_subscriber callbacks
All of these were previously using the timeline theme, instead of the one
for each respective editor
2018-04-20 18:54:41 +02:00
7be36661c2 Dopesheet-Timeline: Somewhat hacky version-patching code to switch old timelines to dopesheet-timelines
After a lot of failed attempts and head banging working trying to find a way to reuse
the standard editor-switching/creation code, I've just hacked in a temporary solution
here so that users can load old files and see the old timeline instances replaced
with Dopesheet-Timelines.

Note: This is not nice code, and copies a lot of the standard initialisation code,
but it works well enough for now. We can revisit this later when the other mode changes
come along.
2018-04-20 18:54:41 +02:00
60e2c60be7 Fix: Timeline's "Show Cache" options should not get reset on window size change
These were getting set in the init() callback instead of the new(). As a result,
the settings would get reset everytime you resized the window/area - not quite
something you'd really want happening everything the size changes!
2018-04-20 18:54:41 +02:00
6d0c59b011 Dopesheet-Timeline: Make sure ND_SPACE_TIMELINE notifier gets handled by dopesheet 2018-04-20 18:54:41 +02:00
b210ead73b Dopesheet-Timeline: Channels list now gets hidden automatically when switching to dopesheet-timeline 2018-04-20 18:54:41 +02:00
cafc1e1bb7 Add utility to make it easier to get editors/regions to redraw after changing visibility of regions
Previously, there was only an API method to toggle and update, but sometimes you
want to explicitly hide instead of just toggling.
2018-04-20 18:54:41 +02:00
e3ebe5c8c3 Dopesheet-Timeline: Collapse summary channel by default (so that it's more like default timeline)
TODO: Still can't figure out a way to get the channels region to hide
2018-04-20 18:54:41 +02:00
729dab4e66 Fix: Toggling preview range from timeline button didn't update animation editors
Most of these were missing the message bus stuff that now handles the update flushing.
2018-04-20 18:54:41 +02:00
af6a662798 Preview Range: Show preview range using a different color (based on ANIM_ACTIVE)
instead of using "black" curtains

With most editors now showing the start/end range by default, we need a way of
easily distinguishing when preview range is now enabled. By using a different color
(the exact color used is something we can change/adjust later), there is a more distinct
visual difference between them, making it easier to see what's happening.
2018-04-20 18:54:41 +02:00
c9fc11a314 AnimEditors: Draw start/end frame ranges on all timelines by default
This uses the global scene range, with styling matching the sequencer's start/end
frame drawing.

(The graph editor's "drivers" mode is exempt, as that doesn't really display time
in a linear way, so the start/end frames don't apply)
2018-04-20 18:54:41 +02:00
0f77060ebc Move the set start/end frame operators from Timeline to Animation module
Eventually the idea is that they'll get remapped to some more global/generic hotkey
that can get used across all animation editors (see T54728). However, to facilitate
the removal of the timeline editor, it's better we do this now.
2018-04-20 18:54:41 +02:00
91b1b35bba Dopesheet-Timeline: Ported over all (missing) notifiers/listeners/etc. from timeline to dopesheet
We already had most of these, but some of these were missing (e.g. pointcache and animplay)
as well as messagebus stuff. Hopefully I didn't miss any!
2018-04-20 18:54:41 +02:00
59a1ebabcd Cleanup: Remove the "SpaceTime->caches" and "SpaceTimeCache" stuff
These were runtime only data, used in pre 2.8 Blender to make use of GL vertex arrays
to draw these more efficiently. Maybe we might restore these sometime as an optimisation
step, but for now, they're not needing and were confusing.
2018-04-20 18:54:41 +02:00
b2eb76cd50 Dopesheet-Timeline: Ported over cache indicator drawing + settings used to control their visibility
These now live in the action editor/dopesheet related files.

Apart from these, the timeline didn't actually have other settings
of its own that were of any interest to anyone.
2018-04-20 18:54:40 +02:00
cc06e0fbe8 Dopesheet-Timeline: First steps towards making the Timeline a mode of the DopeSheet Editor
For many years, animators have been requesting the ability to edit keyframes in the
timeline. However, implementing such tools in the timeline quickly becomes a slippery
slope, where we'll eventually end up having to duplicate all the functionality from the
dopesheet editor.

Discussing with William and Pablo this morning, we realised that perhaps it might be possible
to just make the Timeline a mode of the Dopesheet Editor (and kill off the old standalone
Timeline), meaning that we essentially get all the Dopesheet Editor goodness for free!
Also, with some proposed UI updates (i.e. allowing "submodes" of editors to be part of the
the main editors selector), it might not even matter that there isn't an "actual" timeline
editor anymore.

This commit implements the following changes (which are actually sufficient for supporting
most basic workflows):
* Timeline mode in Dopesheet Editor
* Tweaks to UI code to make the Timeline header/menus show up in Dopesheet editor

TODO:
* Hide channels list when switching to timeline mode
* Port over cache-file indicators
* Add missing timeline-only settings that need a new home in the dopesheet
* Go through fixing all timeline editor operators (e.g. Bind to camera)
* Port over start/end frame shading (and adjust preview range rendering to make the
  distinction between these clear)
* Remove old timeline editor, and transfer over any leftover code
2018-04-20 18:54:40 +02:00
73d2e6f202 Eevee: TAA Reprojection: Initial implementation
This "improve" the viewport experience by reducing the noise from random
sampling effects (SSAO, Contact Shadows, SSR) when moving the viewport or
during playback.

This does not do Anti Aliasing because this would conflict with the outline
pass. We could enable AA jittering in "only render" mode though.

There are many things to improve but this is a solid basis to build upon.
2018-04-20 18:29:33 +02:00
be307d6032 Eevee: TAA Reprojection: Add layer property. 2018-04-20 18:29:33 +02:00
e2613e4051 Eevee: Add Velocity pass.
This pass create a velocity buffer which is basically a 2D motion vector
texture. This is not yet used for rendering but will be usefull for motion
blur and temporal reprojection.
2018-04-20 18:29:33 +02:00
358dfe6ac9 DRW: Cleanup: Make DRW_shgroup_uniform_mat4 uniform expect float (*)[4]
Same thing for mat3.
2018-04-20 18:29:33 +02:00
9c274b0d52 Eevee: Contact Shadows: Fix blue noise correlation. 2018-04-20 18:29:33 +02:00
Julian Eisel
5f6c45498c UI: New Global Top-Bar (WIP)
== Main Features/Changes for Users

* Add horizontal bar at top of all non-temp windows, consisting out of two horizontal sub-bars.
* Upper sub-bar contains global menus (File, Render, etc.), tabs for workspaces and scene selector.
* Lower sub-bar contains object mode selector, screen-layout and render-layer selector. Later operator and/or tool settings will be placed here.
* Individual sections of the topbar are individually scrollable.
* Workspace tabs can be double- or ctrl-clicked for renaming and contain 'x' icon for deleting.
* Top-bar should scale nicely with DPI.
* The lower half of the top-bar can be hided by dragging the lower top-bar edge up. Better hiding options are planned (e.g. hide in fullscreen modes).
* Info editors at the top of the window and using the full window width with be replaced by the top-bar.
* In fullscreen modes, no more info editor is added on top, the top-bar replaces it.

== Technical Features/Changes

* Adds initial support for global areas

  A global area is part of the window, not part of the regular screen-layout.
  I've added a macro iterator to iterate over both, global and screen-layout level areas. When iterating over areas, from now on developers should always consider if they have to include global areas.
* Adds a TOPBAR editor type

  The editor type is hidden in the UI editor type menu.
* Adds a variation of the ID template to display IDs as tab buttons (template_ID_tabs in BPY)
* Does various changes to RNA button creation code to improve their appearance in the horizontal top-bar.
* Adds support for dynamically sized regions. That is, regions that scale automatically to the layout bounds.

  The code for this is currently a big hack (it's based on drawing the UI multiple times). This should definitely be improved.
* Adds a template for displaying operator properties optimized for the top-bar. This will probably change a lot still and is in fact disabled in code.

Since the final top-bar design depends a lot on other 2.8 designs (mainly tool-system and workspaces), we decided to not show the operator or tool settings in the top-bar for now. That means most of the lower sub-bar is empty for the time being.

NOTE: Top-bar or global area data is not written to files or SDNA. They are simply added to the window when opening Blender or reading a file. This allows us doing changes to the top-bar without having to care for compatibility.

== ToDo's

It's a bit hard to predict all the ToDo's here are the known main ones:
* Add options for the new active-tool system and for operator redo to the topbar.
* Automatically hide the top-bar in fullscreen modes.
* General visual polish.
* Top-bar drag & drop support (WIP in temp-tab_drag_drop).
* Improve dynamic regions (should also fix some layout glitches).
* Make internal terminology consistent.
* Enable topbar file writing once design is more advanced.
* Address TODO's and XXX's in code :)

Thanks @brecht for the review! And @sergey for the complaining ;)

Differential Revision: D2758
2018-04-20 17:14:52 +02:00
4bfb6d21df Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-20 16:42:33 +02:00
c4e007d5f6 Workbench: Removed Clay engine draw mode
- need a draw mode in workbench engine.
- reorganized render engine retrieval in 3d view. There are 2 places
where this happenes 1. 3d view draw code and 2. draw manager.
the draw manager code is not used for external engines, currently added
an exception in for cycles. will need to have a better solution in
place.
2018-04-20 16:40:08 +02:00
57221d8e83 More debug timing info from main RNA diffing func. 2018-04-20 16:04:57 +02:00
b95df9957d UI: move manipulator to tool-system
Current manipulator now follows active tool.
2018-04-20 15:59:42 +02:00
8ec25e5dcc UI: Python API defining dynamic icons
Currently only able to define geometry icons.
2018-04-20 15:33:09 +02:00
bc11cb3daa UI: Support for runtime geometry icons 2018-04-20 15:26:06 +02:00
a1cc75f22d Fix building w/o clay 2018-04-20 15:26:06 +02:00
1f625cbfea Merge remote-tracking branch 'origin/master' into blender2.8 2018-04-20 15:13:06 +02:00
e5bb234f64 Cleanup (followup commit for D3160)
Added some spaces to keep the eInsertKeyFlags enumeration proper
2018-04-20 15:09:56 +02:00
792eab8190 Merge remote-tracking branch 'origin/master' into blender2.8 2018-04-20 15:05:22 +02:00
ff839fb6c1 Fix: D3160 Propose to use proper typedefs to avoid confusion
Differential Revision: https://developer.blender.org/D3160
2018-04-20 15:02:11 +02:00
50579da91a Workbench: Clay renderer was not accessible anymore
issue was the factoring of the workspace engine that was removed. the logic implied that the clay could not be rendered as clay will be a draw mode we placed it already there so it is accessible in any engine. Should eventually fix the clay engine by migrating it to the workbench engine.
2018-04-20 14:52:16 +02:00
c7d3eb2a7e Workbench: Draw random object colors
Basic implementation hashes the ob->id.name. In the future we should use
an golden ratio offset algorithm as it can make a better random
palettte.
2018-04-20 14:38:55 +02:00
f18213ae3a Workbench: drawtype_* => drawtype_options, drawtype_lighting
In the new design the lighting is shared across the drawtypes.
the drawtype_options will be used for viewport draw engine settings
2018-04-20 13:40:18 +02:00
b4aff90fd0 Workbench: Face orientation blending 2018-04-20 13:01:16 +02:00
6f61983da3 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-20 12:49:02 +02:00
7d38379e49 Workbench: Face orientation overlay
- Removed the depth pass as it will reuse the depth pass of the render
engine
- Used gl_FrontFacing to determine the facing
- Blender the result with the render engine result
2018-04-20 12:46:37 +02:00
89bdc208d1 Static overrides optimization: 30% quicker.
use stack instead of always allocating memory for RNA paths of checked
properties! From average 167ms to 118ms here with Autumn rig... Still a
lot to improve, but that's already much better.
2018-04-20 12:21:11 +02:00
03a916e5b5 Edit Mesh: multi-object support for 'Symmetrize' 2018-04-20 11:04:11 +02:00
3b100c5a2a Depsgraph: Add utility functions to go from evaluated to original datablock 2018-04-20 11:02:21 +02:00
bf63fee23e Merge branch 'master' into blender2.8 2018-04-20 11:01:29 +02:00
ac8f6413cc Fix usage of lib filepath in previous own commit... 2018-04-20 11:00:12 +02:00
3c524178bc Merge branch 'master' into blender2.8 2018-04-20 10:49:14 +02:00
88bbb68ad0 Add debug tool to check validity of current file *before* saving.
It is hidden behind the --debug-io flag for now.

Idea is to try to catch broken libraries state in current Main before we
actually write the file on disk, should help catching and understanding
what happens in Spring corruption cases.
2018-04-20 10:46:59 +02:00
cc0c971f84 Workbench: Added the basics for the OverlayMode
Implemented the face orientation overlay for testing.
Overlay mode is only drawn when there are overlays to be rendered.
The overlay mode is rendered before the object mode.
2018-04-20 10:45:46 +02:00
36773e35f6 Remove Armature Sketching & Retarget
While the feature is interesting, it's not much from what we can tell.

Retargeting is an important feature but needs
to fit in better with typical animation work-flows.

See: T52809
2018-04-20 10:34:48 +02:00
98422c36ab Edit Mesh: use a single report for remove doubles
Report all doubles removed instead of report per-object.

Also correct use_unselected check.
2018-04-20 10:34:48 +02:00
801270f09d Edit Mesh: Correction to previous commit
The operation is based on faces, not vertices
2018-04-20 10:22:05 +02:00
0e5a4f927a Edit Mesh: multi-object support for 'Make Planar Faces' 2018-04-20 10:16:05 +02:00
8c269d94f4 Limit updates to active view layer only
This is rather uncommon when operator will operate on a non-active view layer,
so there is no need to do full scene update.

This change solves lag first time using Extrude operator in edit mode.
2018-04-20 10:03:27 +02:00
dda7e3b695 VSE Effects: Wipe box: fix compilation errors
This is still broken I cant tell if it is the fact that the in_band
funtion does not work properally or an issue in the box algorithm, or
both.

It seems like the calculation of the size of the box while roatated
needs to be fixed also.
2018-04-19 18:44:56 -04:00
22b2bab702 Edit Mesh: multi-object support for 'Remove Doubles'
@campbellbarton: This operator works (as intended) on an object level, wich means that it won't remove doubles for vertices that are close to each other but contained in different objects - is that really helpful?
2018-04-20 00:25:57 +02:00
daff3c442f Fix mistake in previous GLSL cleanup commit. 2018-04-19 19:37:05 +02:00
Dalai Felinto
bef7d67cf5 Triangulate operator: Free memleak
The leak was introduced in the recent changes to
support multiple-object editing.
2018-04-19 19:20:48 +02:00
26207c278e Fix build error with Windows / MSVC. 2018-04-19 19:03:54 +02:00
470c25e5f1 Cleanup: removed unused GLSL shader functions. 2018-04-19 18:16:18 +02:00
c0a7fef591 Cleanup: unused functions 2018-04-19 18:14:01 +02:00
bca7563d07 Merge branch 'master' into blender2.8 2018-04-19 18:11:49 +02:00
e2678d6b7b Cleanup: make variable name English 2018-04-19 18:10:51 +02:00
307492c2db Cleanup: rename vlak -> poly 2018-04-19 18:08:55 +02:00
d03024f6b3 Cleanup: warnings 2018-04-19 18:07:06 +02:00
51b796ff15 Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!

* Point density, voxel data, ocean, environment map textures were removed,
  as these only worked within BI rendering. Note that the ocean modifier
  and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
  with BI. If we ever wanted to support this again probably it should go
  through the baking API.
* GPU shader export through the Python API was removed. This only worked
  for the old BI GLSL shaders, which no longer exists. Doing something
  similar for Eevee would be significantly more complicated because it
  uses a lot of multiplass rendering and logic outside the shader, it's
  probably impractical.
* Collada material import / export code is mostly gone, as it only worked
  for BI materials. We need to add Cycles / Eevee material support at some
  point.
* The mesh noise operator was removed since it only worked with BI
  material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
  for BI material texture slots. Could be added back with node support.

* Not all legacy viewport features are supported in the new viewport, but
  their code was removed. If we need to bring anything back we can look at
  older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
  that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
  used anywhere now. We may eventually use this to replace the texture
  nodes with Cycles / Eevee shader nodes.

* The Cycles Bake panel now includes settings for baking multires normal
  and displacement maps. The underlying code needs to be merged properly,
  and we plan to add back support for multires AO baking and add support
  to Cycles baking for features like vertex color, displacement, and other
  missing baking features.

* This commit removes DNA and the Python API for BI material, lamp, world
  and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
  are reusing some old BI properties but the names are not really correct
  anymore.
* Texture slots for materials, lamps and world were removed. They remain
  for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
  other renderers use this to find all panels to show, minus a few panels
  that they have their own replacement for.
2018-04-19 17:35:25 +02:00
785e8a636a GHOST: Fix processEvents not notifying events handled by the system if the window is hidden.
Reviewed By: @LazyDodo
Differential Revision: https://developer.blender.org/D3154
2018-04-19 11:26:33 -03:00
ffe02e17b2 GWN Immediate: use GWN_BATCH_OWNS_VBO for created with imm immBeginBatch. 2018-04-19 11:24:10 -03:00
1266a36b87 UV Editor: Fix memleak with loop_vbo and loop_batch. 2018-04-19 11:22:16 -03:00
ec86bebb87 UV Editor: Style: rename variables to match others. 2018-04-19 11:20:13 -03:00
95e39943ef UV Editor: Fix memleak from recent changes. 2018-04-19 15:47:02 +02:00
733fd3eabd Workbench: removed per collection object color
Will be part of the collection manager where per collection the
ob->col can be set. This currently depends on DepsGraph +
CollectionManager.

I removed it for now so the code won't influence development
2018-04-19 15:22:30 +02:00
8a2f0058ae Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-19 14:49:34 +02:00
a305652d87 Workbench: Diffuse studio lighting 2018-04-19 14:48:53 +02:00
723c33aba0 UV Editor: Fix overflow issue with IMM usage.
Use batch API in this case.

It's not the ideal solution (slow) but it works.
2018-04-19 14:25:59 +02:00
e2dce975bc UV Editor: Fix imm assert about program still bound. 2018-04-19 14:25:44 +02:00
9d6a175756 Merge branch 'master' into blender2.8 2018-04-19 12:53:21 +02:00
da82269c58 Cleanup: rename Icon.type -> id_type
Confusing when adding non-id icons.
2018-04-19 12:52:32 +02:00
0a679c6b68 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-19 12:47:11 +02:00
b0d5e74fcc Workbench: drawtype object color from collection to v3d
Now every 3d view can have its own solid draw color setting
2018-04-19 12:44:37 +02:00
2029697861 Fix: Armature display settings (names, axes, shapes, etc.) didn't refresh view with Copy on Write enabled
Now we need to tag the depsgraph to inform all copies that stuff changed.
2018-04-19 12:37:17 +02:00
b352d2705d Depsgraph: Fix crash with copy-on-write enabled
Was caused by ec0756af6c, once again, we can't pass view layer,
need to pass index.

The sad part is that currently we don't have quick way to look up
view layer by index. Can do similar thing as we do for bones and
bases.
2018-04-19 12:05:17 +02:00
caa7101df5 Fix edit-bone select crash w/ multi-edit
Also avoid duplicate base lookups and minor cleanup.
2018-04-19 11:30:22 +02:00
f2a3579661 Fix bug with NULL context being used in undo
Caused sculpt to crash.
2018-04-19 11:12:57 +02:00
63225d7c8b Port particle instance modifier changes from Gooseberry branch
The work is mainly from Lukas Toenne, with some modifications from myself.

Includes following obvious changes:

- Particle system selection is now name-based, with lookup menu.
- Lots of new options to control varieties.

Changes comparing to the Gooseberry branch:

- Default values and versioning code ensures same behavior as the
  old modifier.

- Custom data layers are coming from vertex color, the modifier
  does not create arbitrary layers now. The hope is to keep data
  more manageable, and maybe make it easier to select in the shader
  later on.

  This means, values are quantized to 256 values, but it should be
  enough to get varieties in practice.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D3157
2018-04-19 10:51:18 +02:00
a8db1efbcf Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-19 10:42:03 +02:00
3a4a5ed378 Workbench: added draw_scene_finish to workbench_materials 2018-04-19 10:41:24 +02:00
1802c6e4a1 Fix use of missing properties in UI after game engine removal. 2018-04-19 10:32:39 +02:00
79899373eb Finish use-after-free in workbench code.
GHash should probably not own the data itself, but that's other question
to be fixed later, at least this fixes the crash.

Solution by @fclem, thanks!
2018-04-19 10:25:52 +02:00
8a923e5295 Code cleanup 2018-04-19 09:51:22 +02:00
163b631122 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-19 09:49:44 +02:00
16fac020e0 Workbench: Option to use Object color
- added `object_color_type` where the user can set if the collection
determines the color, or the object will be used for the color.
Implemented it as an enum as later this can have a random color option.
- moved OB_LIGHTING_* to DNA_view3d_types and renamed it.
- Fixed some DRY in workbench_materials.c. Can remove more DRY's but
will need to discuss the responsibility of the workbench engine as it
might become part of the eevee renderer.
2018-04-19 09:45:52 +02:00
95a45e308d BMesh: Add back call to finish operator
Was commented in multi-edit patch, finish is needed to free memory.
2018-04-19 09:10:10 +02:00
81673f5ab7 Fix T54712: Undo w/ multi-edit failed 2018-04-19 08:58:49 +02:00
9a301978bd Merge branch 'master' into blender2.8 2018-04-19 08:18:42 +02:00
fcac9e8410 Cleanup: style 2018-04-19 08:18:16 +02:00
9f7f6d5540 Undo: add missing flag for text delete 2018-04-19 08:16:37 +02:00
1f5d51e44e Cleanup: style 2018-04-19 07:47:03 +02:00
5b45d32f3a Edit Mesh: multi-object support for 'Decimate Geometry' 2018-04-19 00:30:05 +02:00
7c415e6fd7 Edit Mesh: multi-object support for 'Vertices Only' extrusion (Alt+E) 2018-04-19 00:03:51 +02:00
07774d4860 Edit Mesh: multi-object support for 'Individual Faces' extrusion (Alt+E) 2018-04-18 23:55:27 +02:00
d8f70a26fd Edit Mesh: multi-object support for 'Edges Only' extrusion' 2018-04-18 23:53:21 +02:00
1ade071052 Edit Mesh: multi-object duplicate_move support 2018-04-18 23:18:08 +02:00
abeae5d38e Cleanup: indent face poke example 2018-04-18 23:16:34 +02:00
75133f5d7c Cleanup: Use BLI_layer / BLI_view_layer prefix
Also use doxy sections for iterators.
2018-04-18 21:18:05 +02:00
69c42ad57b Cleanup: consistent changed_multi assignment 2018-04-18 19:22:00 +02:00
Dalai Felinto
4704f2687a Edit Mesh: multi-object flip normals support 2018-04-18 19:15:01 +02:00
7560aabf71 Pose: multi-object Flip Quats 2018-04-18 19:11:11 +02:00
e0478ae92f Pose: multi-object support for clear transform 2018-04-18 18:56:27 +02:00
602f0bc2d4 Use macros for looping over pose bones 2018-04-18 18:56:27 +02:00
42b0cd1ea0 MSVC: use 'unsigned int' 2018-04-18 18:56:27 +02:00
ec0756af6c Depsgraph: Fix base flag flush for objects from set scene
Fixes view_layer_background_set regression test.

This makes Dalai happy! :)
2018-04-18 18:05:37 +02:00
3701cf785c Depsgraph; Correct assert for depsgraph scene
We can not do it from builder, since builder will pull set scenes.
2018-04-18 17:43:15 +02:00
3c7254ffb6 Depsgraph: Fix missing bases array update
view_layer_object_copy test was broken.

This is a quick fix for now, can be optimized further later.
2018-04-18 17:35:05 +02:00
4ec55350d4 Edit Mesh: improve subdivide multi-object
Don't run the operator on faces/edges without selection.
2018-04-18 17:22:51 +02:00
3a9669bfff Edit Mesh: multi-object poke support 2018-04-18 17:15:58 +02:00
Dalai Felinto
422f939f95 Fix layer unittests after scene/workspace engine changes
Note: view_layer_background_set and view_layer_object_copy still fail.
But they were failing before.
2018-04-18 17:06:57 +02:00
f9cf2e2f6c Workspaces: remove workspace engine, use 3D viewport draw mode instead.
ViewRender was removed, which means we can't get the render engine for files
saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee
and set the engine to that.

A fix included with this is that .blend thumbails now draw with Clay mode,
and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should
be very fast and not e.g. load heavy image textures.

Differential Revision: https://developer.blender.org/D3156
2018-04-18 16:35:38 +02:00
15850a8740 Workbench: don't change to workbench drawtype for files saved in 2.8.
Assume files saved in 2.8 were intended for Eevee and set them to material
viewport shading. In Eevee this is equal to rendered draw mode, in Cycles
this will draw with Eevee. This way Eevee demo files still show something
interesting when opened.
2018-04-18 16:35:38 +02:00
34dbe7ff33 UV Edit Draw: Fix assert in immBeginBatch -> vertex_count_makes_sense_for_primitive. 2018-04-18 11:34:44 -03:00
24b3b9fa21 Fix bad merge conflict resolution
Line got lost..
2018-04-18 16:12:56 +02:00
3b209a45de Fix missing initialization of depsgraph for snapping context
Was causing crashes once attempting to use snapping.

Reported by mano-wii in IRC, thanks!
2018-04-18 15:41:51 +02:00
2108142934 Workbench: use SET_UINT_IN_POINTER for hashes 2018-04-18 15:16:21 +02:00
c86975d90a Merge branch 'blender2.8' into blender2.8-workbench 2018-04-18 15:06:03 +02:00
5cc92a376b Workbench: fixed C++ style comments 2018-04-18 14:56:25 +02:00
b3e479757e Cleanup: Indentation 2018-04-18 14:46:33 +02:00
3bacd17b1c Added comment to explain MeshRenderData.orco 2018-04-18 14:13:20 +02:00
c67a2bd5ba Merge branch 'master' into blender2.8 2018-04-18 13:55:09 +02:00
f28aec17e9 Depsgraph: Fix missinf relation for particle instance modifier
Was causing lack of animation update when particle system had simulation,
2018-04-18 13:54:02 +02:00
8a71c139d8 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-18 13:53:22 +02:00
a091da7ffa Workbench: reuse similar materials
Similar materials will reuse the same shadergroup. Currently using
a custom hash function that might select too similar colors into the
same material.

Reintroduced the workbench_materials.c this file will be responsible for
material lookup/creation and shader compilation

Fixed a GPUShader mem leak
2018-04-18 13:44:33 +02:00
3811998177 Cleanup: Trailing whitespace 2018-04-18 12:31:26 +02:00
9b338e8028 Merge remote-tracking branch 'origin/master' into blender2.8
Explicitly undoing 287d1924fa here, as that was a master-only change.
2018-04-18 12:28:13 +02:00
287d1924fa Remove irrelevant print statement
This statement is only relevant in 2.8, but causes confusion in master.
I kept the 'default' label to prevent compiler warnings about unhandled
cases. The break is needed because there should be at least one statement
after 'default'.
2018-04-18 12:26:40 +02:00
ea0630ade6 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-18 12:11:59 +02:00
661226959c WORKBENCH: Solve C2016 compile errors 2018-04-18 12:11:36 +02:00
2117e46e5b Disable auto-override for all but active object in group case.
I.E. only enable auto-override for 'active' selected object when making
an override of a linked group. This will ease on auto-override creation,
and you typically do not want to auto-override most objects in the group
anyway (in proxy system, you could only proxyfy one object of the group
anyaway!).
2018-04-18 11:41:07 +02:00
10ce4719d4 Object Mode: Outlines: Make outline thinner.
This is by default. We can still enable the thicker outlines for high dpi
screens or personnal preference but it's not used atm. This also improve
the performance removing 1/3 of the outline cost.
2018-04-18 11:34:53 +02:00
3054a96981 Object Mode: Outlines: Fix sample coordinates. 2018-04-18 11:34:53 +02:00
7cdc0b76aa Make depsgraph tag for auto-override IDs it updates.
This will reduce amount of needless auto-override checks, at least when
not touching anything related to overriding IDs...
2018-04-18 11:25:31 +02:00
0afe103269 Particles: Interpolate size for interpolated children
This finally allows us to use Random factor to add variations to the
interpolated children. This feature never worked since 2007L there was
random factor slider in the interface, but it was only used by simple
children. Now it has affect on interpolated children as well.

Technically, this will break compatibility if older file had random
factor set to something else than 0 (default value is 0 though). But
we are leaving 2.7 series, so can accept such breackage in the name
of supported features.
2018-04-18 10:52:27 +02:00
05ef225272 Cleanup: rename 'static override regarding reference ID' tag.
Just 'OK' was waaayyyyyy too generic!
2018-04-18 10:45:50 +02:00
773205ada0 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-04-18 10:44:52 +02:00
ed72eedd07 Workbench: Fixed SegFault
In more complex models the object color uniform data is freed before rendered.
We should copy it to local data. but for now we redirected it to a
constant.
2018-04-18 10:43:03 +02:00
a02feaeba9 Cleanup: merge checks for same version 2018-04-18 09:20:28 +02:00
7d055da327 Move transform orientation to scene
This was stored in the workspace, selected from the view.
Move both to scene since custom orientations are closely related to your
scene data.
2018-04-18 09:16:15 +02:00
33ba170f5c Cleanup: unused var 2018-04-18 09:16:15 +02:00
d9051c46fd Merge branch 'blender2.8-workbench' into blender2.8 2018-04-18 08:25:59 +02:00
b7f50f651f Cleanup: unused var 2018-04-18 08:23:59 +02:00
ee11c85c06 CMake: make recent bad level include explicit
This isn't something we should do,
each instance should be noted and removed.
2018-04-18 08:21:24 +02:00
ccb104b9c2 Workbench: Basic Solid Studio
Currently uses static lighting. Will become HDRI lighting.
Added do_versions to set default drawtype_solid and drawtype_texture to
OB_LIGHTING_STUDIO. When View3D space is created drawtype_solid and
drawtype_texture are also set to OB_LIGHTING_STUDIO.

Current studio lighting uses a dot product to simulate static lighting.
Will need to be changed in the future with different lighting models.
2018-04-18 08:20:12 +02:00
Julian Eisel
bc9e05599d Fix makesdna not respecting C++ comments
Tab after C++ comment broke parsing and didn't remove the line at all.
Was there since 2002 at least, probably confused some peeps.

This means commented out code was actually written to SDNA.
2018-04-18 00:29:53 +02:00
b40f5be01f Eevee: Use textureGather for minmaxZbuffer downsampling.
I haven't noticed any performance improvement but it could be more important
for other hardware. At least it's not slower!
2018-04-17 22:25:59 +02:00
38399c0b10 Object Mode: Outlines: Fix precision issue on intel GPU. 2018-04-17 22:25:59 +02:00
3f762dd764 Workbench: clean up the viewport shading code
- added the drawtype_solid, drawtype_wireframe, drawtype_texture to
View3D
- enabled workbench panels for important render engines
- merged workbench_materials to solid_flat_mode. All draw modes will get
its own fast implementation in the workbench
2018-04-17 22:11:56 +02:00
dd8d55b31a Cleanup: unused vars, long lines 2018-04-17 20:02:17 +02:00
9b8e27127e UI: Perf: Improve Dopesheet performance. 2018-04-17 19:37:05 +02:00
5559abf31d GWN: IMM: Add util function to batch several immRecti/immRectf 2018-04-17 19:37:05 +02:00
Dalai Felinto
de6289e79e Remove player from buildbot part II 2018-04-17 18:46:03 +02:00
Dalai Felinto
1f24a60a3e Remove player from buildbot 2018-04-17 18:42:00 +02:00
41748b6a5e Cleanup: remove modules that were only used by the game engine. 2018-04-17 18:37:29 +02:00
f06272ab6a DRW: Perf: Early out empty passes. 2018-04-17 18:26:22 +02:00
49f7ca3b9d Add overridable control to 'edit' feature of custom props. 2018-04-17 18:07:08 +02:00
1913322402 Add generic bpy API to check if a property is overridable, and to set overridable status of custom props. 2018-04-17 18:07:08 +02:00
75f82ac722 Update/improve handling of 'overridable' status of properties.
Main new thing in this commit is ability for real IDProps (aka custom
properties) to be set as overridable or not, they are not by default.
2018-04-17 18:07:08 +02:00
Dalai Felinto
fad7c065c2 Remove Shift+F2 and other related BGE keymaps
Reported by Pablo Vazquez (venomgfx)
2018-04-17 17:56:06 +02:00
Dalai Felinto
fb24813d64 Remove game properties in image editor
The following properties were used by the Blender Game Engine and no longer
need to be around:

* Animated
* Tiles
* Clamp
* Mapping
2018-04-17 17:51:28 +02:00
Dalai Felinto
159806140f Removing Blender Game Engine from Blender 2.8
Folders removed entirely:
* //extern/recastnavigation
* //intern/decklink
* //intern/moto
* //source/blender/editors/space_logic
* //source/blenderplayer
* //source/gameengine

This includes DNA data and any reference to the BGE code in Blender itself.
We are bumping the subversion.

Pending tasks:
* Tile/clamp code in image editor draw code.
* Viewport drawing code (so much of this will go away because of BI removal
  that we can wait until then to remove this.
2018-04-17 17:51:28 +02:00
Dalai Felinto
28b996a9d2 Disable GAME ENGINE from the build options 2018-04-17 17:38:18 +02:00
Dalai Felinto
8a695efe9b Merge remote-tracking branch 'origin/master' into blender2.8 2018-04-17 17:36:39 +02:00
2b730763a3 Particles: Hair: Make hair selectable in the 3D view. 2018-04-17 17:34:22 +02:00
821722ac05 Interface: Show properties values from evaluated datablocks
This is a way to deal with animated properties in evaluated version
off datablock. Previously, running blender with copy-on-write enabled
will show original values. Now we can see proper properties, while
typing values in still goes to the original datablock.

Thanks Brecht for the review!
2018-04-17 17:22:33 +02:00
c6681f735e Object Mode: Fix wrong wire color on non-meshes objects. 2018-04-17 17:00:36 +02:00
088b6342e6 Object Mode: Cleanup uneeded texture attachment. 2018-04-17 17:00:36 +02:00
81ede70609 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-17 16:39:18 +02:00
d26b7592b8 Workbench: Switching Draw engines based on draw mode 2018-04-17 16:34:41 +02:00
d442e0ad63 UI: Fix T54691: Vector icon vs Widget base ordering.
It was making keyframe marker and bone theme color icon disappear under
their button.
2018-04-17 15:53:49 +02:00
b229c879c1 Eevee: Render: Fix assert with framebuffer not being bound before read. 2018-04-17 15:33:06 +02:00
1eea3e4d6b Eevee: Fix AA in render mode.
Was due to wrong framebuffer being read because of wrong comparisson caused
by b9ec7a9272
2018-04-17 15:33:06 +02:00
3759b2aa59 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-17 14:59:37 +02:00
fa68786692 Workbench: Draw modes 2018-04-17 14:58:48 +02:00
c991bb0baf Depsgraph: Allow querying NULL IDs for evaluated version
Saves us from extra checks for NULL pointers when using datablocks for read.
2018-04-17 13:49:31 +02:00
b52cd283d9 DRW: Fix lightprobe objects outlines. 2018-04-17 13:24:48 +02:00
60b33ea327 GPU: Add GPU_SHADER_INSTANCE_VARIYING_ID_VARIYING_SIZE.
Will be used for probe outline id drawing.
2018-04-17 13:24:48 +02:00
ad648b7693 DRW: Add DRW_UNIFORM_INT_COPY.
This allow to use int uniforms that are not references. Convenient for ids.
2018-04-17 13:24:48 +02:00
17041bd895 Depsgraph: Fix unwanted node tree copy-over
Was caused by two things from the past:

- Tagging would set id->recalc to COW update flag.
  This one is to be ignored.

- Particle tagging will use psys recalc flags on id->recalc,
  but we only need to use flags from particles. Otherwise
  it will be some collisions in bit masks.
2018-04-17 12:47:28 +02:00
Dalai Felinto
a0ef147f29 bpy consistency fix handler_add(handle)
This doesn't change the API, so it doesn't affect any script.
However it give more consistent error messages.
2018-04-17 12:29:40 +02:00
Dalai Felinto
c558d8fa7c bpy blf api example update
With changes from Campbell Barton as well.
2018-04-17 12:25:51 +02:00
2408a482c0 Merge branch 'master' into blender2.8 2018-04-17 12:12:35 +02:00
aff71a7fdc Fix (unreported) RNA sometimes trying to get named sub-props from non-Group IDProp.
Why exactly this happens remains unclear, found that in the
autumn.blenrig file of Spring production while working on static
overrides... Tons of ugly IDProps in that rig. xD
2018-04-17 11:59:14 +02:00
963b1c8e41 Pose: fix wpaint + pose mode pick & linked select 2018-04-17 11:23:58 +02:00
ad797ed39a Fix blenderplayer and collada build. 2018-04-17 11:01:52 +02:00
c9d1082a2c Pose: multi-object hide/reveal support 2018-04-17 10:22:40 +02:00
a04b551e40 BKE_object: utility functions for pose access
Pose objects may be from the active object,
or from the weight paint mesh.

Since this is such a common check move this to a function call.
2018-04-17 10:22:40 +02:00
be3392e0f9 Make particle edit mode work again
This is just to have hair rendering and editing mostly working as in
master. A better fix is probably needed, there seems to be some
missing depsgraph relations for particle edit settings, and particle
edit code doesn't rebuild caches after applying edits. But at least
you can see and interact with hair now until those things can be
sorted out.
2018-04-17 03:41:04 -04:00
1dbe9c262f View3D: Check all objects w/ view-selected 2018-04-17 08:30:29 +02:00
ae0c36f82b Object Mode: Outline: Perf: Only do outlines detection if needed. 2018-04-16 22:55:02 +02:00
f92e92b1c0 Object Mode: Outlines: Use textureGather extension if available.
This has very little impact (only had 12.5% perf improvment on Nvidia for this specific pass).
But it's an improvement nontheless!
2018-04-16 22:53:44 +02:00
af1c220d89 Fix for building w/o open-subdiv 2018-04-16 20:45:43 +02:00
c7d6aa4338 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-16 20:35:59 +02:00
34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
0c495005dd Fix multi-object edit crash
Border select assumed all objects had pose bones.
2018-04-16 19:42:24 +02:00
45f04ba48a DRW: Fix outdated code. 2018-04-16 19:38:58 +02:00
7f5d76b37f Object Mode: Rework outline drawing.
This changes quite a few things.
- Outline is now per object.
- No more outline at object intersection (fix hairs problem).
- Simplify the code quite a bit.

We use a R16UI buffer to save one id per object outline. We convert this id
to color when detecting the outline.

Added textureGatherOffsets to the code but could not test on current hardware
so leaving it commented for now.
2018-04-16 19:38:58 +02:00
c2d4ba2ff5 GPU/DRW: Add GPU_R16UI format. 2018-04-16 19:38:58 +02:00
dccda1fe43 DRW/GWN: Add callId builtin uniform.
This uniforms can be used to have a unique id for each drawcall of a shgrp.
This only works for standard shgroups and is an exception for the outline
drawing.
2018-04-16 19:38:58 +02:00
2b0b4133c8 DRW: Culling: Fix algorithm for asymmetric perspective frustum reconstruction. 2018-04-16 14:34:32 -03:00
15b841f5dc Audaspace: Change default plugin path on windows.
This was suggested by Ray Molenkamp in order to avoid problems with
thumbnail dlls.
2018-04-16 19:00:35 +02:00
8710943570 Cleanup: indentation 2018-04-16 18:24:38 +02:00
49ee1a97d2 Merge branch 'master' into blender2.8 2018-04-16 18:22:43 +02:00
eb6fe5fa94 Cleanup: indentation 2018-04-16 18:13:48 +02:00
292a2802ad Cleanup: indentation
Indent lines for multi object editing, no functional changes.

Also strip trailing space from indented regions.
2018-04-16 17:58:26 +02:00
bfc9d426bb Multi-Object Editing
This adds initial multi-object editing support.

- Selected objects are used when entering edit & pose modes.
- Selection & tools work on all objects however many tools need porting
  See: T54641 for remaining tasks.

Indentation will be done separately.

See patch: D3101
2018-04-16 17:56:50 +02:00
80bb4254c6 Fix T54491: Do not avoid the creation of inverted frustum.
Blender allows this.
The Cube in the file in the report would always disappear with the non camera view.
The clip_end was too small.
The correction here is only on the assert.
2018-04-16 12:37:14 -03:00
3b48a2a72f Cleanup: indentation 2018-04-16 17:26:55 +02:00
9a11aeb300 Merge branch 'master' into blender2.8 2018-04-16 17:24:20 +02:00
95eb9f22e6 Cleanup: indentation 2018-04-16 17:16:29 +02:00
85de548e03 Cleanup: indentation 2018-04-16 17:08:27 +02:00
3a14a03812 DRW: Culling: Reorganize frustum_boundbox_calc to match comments.
And Cleanup.
2018-04-16 11:48:58 -03:00
10f7f4ec14 Fix unreported error: Algorithm for extracting the Bounding Sphere from an Orthographic frustum was incorrect.
There was double transformation.
2018-04-16 11:42:20 -03:00
a945bcc028 Fix two more 'infinite recursions' cases in RNA pose. 2018-04-16 16:39:13 +02:00
eb3ae79c2d Merge branch 'master' into blender2.8 2018-04-16 16:22:34 +02:00
141f0f4c47 BKE_context: macro to access ID's while looping 2018-04-16 16:19:16 +02:00
cf95267456 Merge branch 'master' into blender2.8 2018-04-16 16:17:03 +02:00
047950db7c Depsgraph: Pull indirect relations via driver targets 2018-04-16 16:12:15 +02:00
295ced9baa Switch 'make static override' of group to making all objects local overrides.
Note: tried with a complex production file characters, this is currently
totally non-functionnal (crashing even in a infinite recursion loop),
IDProps and override need some love :(
2018-04-16 16:01:17 +02:00
Julian Eisel
969c4315b1 Fix warning: Passed ID pointer where screen pointer was expected 2018-04-16 15:53:34 +02:00
86abc4da10 Fix rBb31ebd8c5c55: the asymmetric furstrum algorithm was still incorrect.
Although somewhat less micro efficient, I decided to separate the `viewinv` matrix to calculate the world position separately.
This makes it easier to understand the code.
2018-04-16 10:40:46 -03:00
Julian Eisel
57c651d248 Cleanup: move some screen utility functions, from topbar branch. 2018-04-16 15:18:48 +02:00
Julian Eisel
1b6fddb968 Cleanup: split off area reading/writing functions, from topbar branch. 2018-04-16 15:18:48 +02:00
dfd9e549ee Fix build errors after recent depsgraph changes. 2018-04-16 15:18:48 +02:00
4ed21f1360 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-16 15:02:40 +02:00
410810d42f Workbench: Added Object Color to collection_properties 2018-04-16 15:01:31 +02:00
a3c80615d5 Fix stubs 2018-04-16 14:57:23 +02:00
b31ebd8c5c Fix T54609: Erros in precise BBox extraction algorithm 2018-04-16 09:22:42 -03:00
6a75a1a669 Depsgraph: Tag scene after changing cursor location
While 3d cursor is mainly an UI thing and isn't needed for scene evaluation,
it is stored in scene DNA. This means, operator is inform depsgraph that data
has changed, so all copies of that scene can copy new values.

Fixes lack of visual feedback when changing cursor location in viewport
with copy-on-write enabled.
2018-04-16 12:59:21 +02:00
cab5dd5ea0 Fix incorrect scene used for building freestyle stroke depsgraph. 2018-04-16 10:39:13 +02:00
8ad93dd009 Merge branch 'master' into blender2.8 2018-04-16 10:19:03 +02:00
6617818c7a Make ID icons safe for deletion from threads
Added a lock-free deferred queue for deletion. Now if ID icon
is requested to be freed from non-main thread, it will be added
to the deferred list. Actual deletion will happen later from main
thread.

Currently actual deletion only happens next time BKE_icon_id_delete()
is called, which might not be enough. But it's easy to enforce
deferred deletion.

Icons for preview images are not covered by deferred deletion yet.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D3146
2018-04-16 10:18:43 +02:00
5bfe6126f8 Added lock-free single linked list implementation
Only supports lock-free insertion for now, can not delete element
or traverse the list at the same time.
2018-04-16 10:18:43 +02:00
6ef5b422fc Merge remote-tracking branch 'origin' into blender2.8 2018-04-16 09:59:52 +02:00
2720667566 Disable Feature Collada: Tests do not work on unix
The tests as they are now make string comparisons. This only works
on Windows because the reference files look different for different
operating systems because of different number formatting.
The collada tests need a complete rework (wip)
2018-04-16 09:56:59 +02:00
bfb633087b Fix object/bone select buffer big-endian sorting 2018-04-16 08:51:41 +02:00
7ffc8bc25d Merge branch 'blender2.8' into blender2.8-workbench 2018-04-16 08:20:12 +02:00
9777cd2b1e Cleanup: unused function 2018-04-16 07:40:40 +02:00
c1730a03af Merge branch 'master' into blender2.8 2018-04-16 07:39:56 +02:00
b4e8d33f11 Logging: edits to build on macOS 2018-04-16 07:38:11 +02:00
55939bf219 Merge branch 'master' into blender2.8 2018-04-16 07:27:53 +02:00
61a22262d1 Eevee: Cleanup remaining shadow geometry references. 2018-04-15 22:23:51 +02:00
d8d1f637b1 Eevee: Shadows: Transition to individual face rendering.
This gets rid of the need of a geom shader and instancing.

Both are pretty slow compared to the new method.
The only moment the old method could be better is when scene is filled
with lots of objects and most of the objects in the shadow map appear
on every layer.

But even then, we could optimize the culling and minimize the overhead.
2018-04-15 22:23:51 +02:00
dd6fcd2f21 DRW: Fix culling algorithm for cascade shadow maps.
draw_frustum_boundbox_calc does not work properly it seems in this case.
2018-04-15 22:23:51 +02:00
728816dbdc DRW: Override matrices: fix const correctness. 2018-04-15 22:23:51 +02:00
80f7249d09 Cleanup: skip redundant edit-bone select lookups 2018-04-15 21:46:25 +02:00
Julian Eisel
4b080ff18f Cleanup: Make access to widget triangle defines explicit
E.g. the vertices created for each of the defines would require a
certain offset. If you don't know what to look for, finding out about
this is pretty difficult. Make them easily searchable instead.
2018-04-15 21:36:21 +02:00
Julian Eisel
7c02008e74 Fix button triangle for "hold action" not working
There is quite some mess going on in that most of the old triangle
drawing code is still there, but does almost nothing effectively.
Instead values are hardcoded in the shader, however it doesn't support
the drawing options the triangle functions expose.
E.g. the 'where' variable to set triangle direction doesn't work.
2018-04-15 21:24:24 +02:00
447622f717 Pydoc: Fix multiple bpy.type modules 2018-04-15 11:45:25 -04:00
35ff9e44ca Missed from last merge 2018-04-15 17:41:11 +02:00
ebe3361181 Merge branch 'master' into blender2.8 2018-04-15 12:48:39 +02:00
7bccd21afa Cleanup: remove redundant args from ebone picking
Make this match editmesh picking more closely
2018-04-15 12:45:39 +02:00
9e2ea6c500 Merge branch 'master' into blender2.8 2018-04-15 12:03:09 +02:00
0f2efce6c5 Cleanup: remove bad casts 2018-04-15 11:57:49 +02:00
c12d976020 Cleanup: ED_armature naming
- Wasn't clear which functions handle edit-bones.
- Mixed both ebone and edit_bone in names.
- Didn't use ED_armature_* prefix for public API.

See P655 to apply to branches.
2018-04-15 11:50:53 +02:00
f3a8f97fcf Merge branch 'master' into blender2.8 2018-04-15 10:52:14 +02:00
d0e3fbc06b Cleanup: remove undoing access, minor formatting
Access to undoing state isn't needed,
some text insert code was overly compacted.
2018-04-15 10:48:50 +02:00
fb3528d088 Fix T54593: Py text edits crash (undo regression) 2018-04-15 10:34:41 +02:00
87a9b6ac06 Fix compiler error in Windows 2018-04-15 09:55:42 +02:00
2666e77c22 Fix T54527: Misleading Tooltip on Snap Target Menu 2018-04-14 18:26:27 -04:00
73dfd3d382 Pydocs: Expand bge.contraint docs
Takes information from the manual and dumps it here.
2018-04-14 18:08:32 -04:00
3a10f8e1b1 Cleanup: style 2018-04-14 22:26:12 +02:00
94959dba1b Fix compiler error in Windows 2018-04-14 16:24:34 +02:00
36152afa76 Merge branch 'master' into blender2.8 2018-04-14 14:34:21 +02:00
5ab77ab4ee Cleanup: use const for BKE_object args 2018-04-14 14:27:38 +02:00
35785ee7cb Merge branch 'master' into blender2.8 2018-04-14 14:10:27 +02:00
66d4e9300b Logging: replace 'fwrite' w/ 'write'
We're already buffing output, so use write directly.
2018-04-14 13:59:33 +02:00
1c23b5c6ff Cleanup: rename WriteData struct members.
Relationship between tot/count/buf wasn't clear.

Also use doxy sections.
2018-04-14 13:35:20 +02:00
cbd4a79c6d Undo: refactor memfile writing
- Move static undo variable into 'WriteData',
  'memfile_chunk_add' used arguments in a confusing way,
  sometimes to set/clear static var.

- Replace checks for 'wd->current' with 'wd->use_memfile'
  move memfile vars into 'wd->mem' struct.
2018-04-14 13:03:41 +02:00
2e9b92b5cc Fix T54568: Undo memory de-duplication failed
Error in 651b8fb14e caused de-duplication to fail.
2018-04-14 12:30:14 +02:00
b107e77e46 BGL: Expose OpenGL API for FrameBuffers and RenderBuffers. 2018-04-14 02:25:18 -03:00
7bf252ddc0 Merge branch 'blender2.8' into blender2.8-workbench 2018-04-13 16:01:43 +02:00
e6998b6e62 Workbench: Silhouette shading
Currently it uses the `obj->col`. This needs to be made more intelligent
with fe collection overrides.
2018-04-13 15:49:50 +02:00
8245c4fd66 PyAPI: Gawain: Checks the member data instead vbo_id.
After recent changes in gawain, `vbo_id` is now assigned in VertBuf creation.
2018-04-13 10:47:49 -03:00
3765653b38 RNA: Fix crash with select_mode_update.
`bpy.context.tool_settings.mesh_select_mode = (True, True, True)` was crashing because `wmn->window` was not being passed.
2018-04-13 10:41:44 -03:00
ce114a307d DRW: Deferred Shader Compilation: Optimize shaders compilation.
`glFinish()` that was causing bad perf issue on `Intel(R) HD Graphics 4000`.
2018-04-13 10:38:13 -03:00
7d8f35b471 CLAY: Fix prepass shader on certain compiler.
`Intel(R) HD Graphics 4000` driver sometimes does stupid things.
2018-04-13 10:36:05 -03:00
7b9fb32591 Python API: remove preview/render resolution settings from API functions.
For correct results these must have been set already when the depsgraph was
created and evaluated, so all dependencies have appropriate resolutions too.

For particle we no longer backup and restore the viewport particles to avoid
overwriting them during render, as copy-on-write solves this for us. Even
without COW particles seem to work ok.

This also removes the particle simplification options based on camera. This
was never used much and only available in Blender Internal.

Differential Revision: https://developer.blender.org/D3148
2018-04-13 14:38:59 +02:00
a1e2415ed5 Depsgraph: don't pass evaluation context to update functions.
The depsgraph now contains all the state needed to evaluate it.

Differential Revision: https://developer.blender.org/D3147
2018-04-13 14:17:37 +02:00
eec5d3a8a8 Depsgraph: remove engine type from evaluation context.
This was only used for viewport rendering, where we can just pass the engine
type directly. There is no technical reason why we can't draw the same depsgrpah
with different render engines.

It also led to some weird things like requiring a render engine for snapping
and raycast API functions.

Differential Revision: https://developer.blender.org/D3145
2018-04-13 14:17:32 +02:00
340bfdef2e Depsgraph: store mode and time in depsgraph, add view layer / scene accessors.
Scene, view layer and mode are now set in the constructor and never changed.
Time is updated on frame changes to indicate which frame is being or has been
evaluated last.

This is a step towards making EvaluationContext obsolete.

Differential Revision: https://developer.blender.org/D3144
2018-04-13 14:17:22 +02:00
5d7952d9c7 Python API: remove object.dupli_list_create and dupli_list_clear.
Cycles is no longer using this. There are still addons using it but for
correct results with the new depsgraph this API should not be used.

Differential Revision: https://developer.blender.org/D3143
2018-04-13 14:16:59 +02:00
f0a4c631bb Fix incorrect object in editmode tests in depsgraph eval.
These cases should not depend on the view layer.
2018-04-13 13:04:19 +02:00
1c85fb95b1 Fix incomplete evaluation context in depsgraph iter. 2018-04-13 13:04:19 +02:00
07fc6c9224 Merge branch 'master' into blender2.8 2018-04-13 12:19:31 +02:00
332846b188 Remove editor type selector from File Browser when in 'Operator' mode.
Having that one when opening a file or loading some lib makes absolutely
no sense, and switching that 'temp' editor to some other type can
trigger all kind of funny bugs...

Note that using the shortcuts keys (Shift-F5 etc.) is still possible,
removing those seems a bit more involved. :/
2018-04-13 12:14:50 +02:00
199715eabc Point cache: stop using general object dupli system.
We now only look into dupli groups to find point caches to edit. This
feature is a leftover from the old proxy system, and evaluating the
full dupli list and all transforms was overkill. With static overrides
we may want to get rid of using duplis entirely, and just let users
select the objects directly.
2018-04-13 11:47:29 +02:00
d8bdd7b261 Cleanup: add utility function to find a single point cache ID. 2018-04-13 11:31:19 +02:00
b92d78553b Cleanup: don't use Blender structs in iTaSC module. 2018-04-13 11:31:19 +02:00
Julian Eisel
9599ed3ba7 UI: Activate (unused) tab button-type on press instead of release
Even if we want to support drag & drop, seems like most other apps that
support drag & drop for tabs activate the tab first anyway.
2018-04-13 10:32:52 +02:00
Julian Eisel
b5570337b6 UI: Activate workspace after appending it using the '+' menu
Could use an operator-macro if they'd support own RNA-properties. For
now added a wrapper operator.
2018-04-12 18:13:19 +02:00
bf854b2851 GPUSelect: Remove glFinish() that was causing bad perf issue.
I can see how it's slowing things down: glFinish make sure that every query
are finished but the first query may have been finished a long time ago.

This might create bubbles because of the PIL_sleep_ms.
2018-04-12 17:37:13 +02:00
a494df8e38 Fix: Follow up to 16b795cb95
It's not just the Graph Editor that needed this - the NLA also uses similar code
and thus suffers from a similar problem.

(My first commit from the Blender Institute v2.0 - Just testing that everything works)
2018-04-12 15:50:26 +02:00
31067c9757 Depsgraph: Move CoW tag to ID datablock tag
Unless there is an external action from an user, there should not
be need in re-copying original datablock to a copied one.

This brings performance up from 5fps to 11fps with Spring runcycle
(performance in master is 14fps).
2018-04-12 11:05:18 +02:00
15698f9907 Depsgraph: Avoid relations build time scene datablock expansion
Quite straightforward implementation, allows us to remove all the cherry-picking
update of specified scene/view layer/collection fields. Makes it possible to use
generic function to update scene.

The tricky part is that we need to know view layer pointer before the whole
evaluation starts. So we actually expand scene at initialization of evaluation.
context. This is still a bit of an exceptional case, but at least we still avoid
dangerous cherry-picking update.
2018-04-12 11:05:18 +02:00
18c7575f93 Depsgraph: Introduce ID recalc flag for COW component
Currently unused, but will become handy to check whether ID needs
to have COW update to be run.
2018-04-12 11:05:18 +02:00
fac1892e11 Depsgraph: Bind base by it's index
For the performance we convert object bases list to an array
during view layer evaluation. This makes it possible to have
very cheap index-based base lookup.

The goal of this change is to get rid of base used for function
binding, and avoid scene datablock expansion at the depsgraph
construction time.
2018-04-12 11:05:18 +02:00
9c406b786f Depsgraph: Bind view layer by index
Makes it a bit slower to evaluate single view layer, but this is does not
happen often, and overall number of layers is not very high.
2018-04-12 11:05:18 +02:00
ca2484e090 Depsgraph: Remove function bindings with collections
Use single function to evaluate all the collections for the given view layer.

This way we avoid need to get scene ID sub-data. Similar to pchan index, this
allows us to avoid build-time scene expansion, which also simplifies update of
the scene datablock.

Well, sort of. There is still work to be done to get rid of build-time scene
datablock expansion, which includes:

- Need to pass view layer by index.

  Annoying part would be to get actual view layer for that index. In practice
  doing list lookup might not be such a bad idea, since such lookup will not
  happen very often, and it is unlikely to have more than handful of view
  layer anyway.

  Other idea could be to use view layer from evaluation context.
  Or maybe from depsgraph, which is supposed to be in the context. Can have
  some assert statements to make sure everything is good.

- Need to get id of base binding for flags flush.

  We can replace that with index-based lookup from an array created by view
  layer evaluation.

Reviewers: dfelinto

Differential Revision: https://developer.blender.org/D3141
2018-04-12 11:05:18 +02:00
d213474070 Moved vectorblur code from render to compositor
In preparation of the removal of blender internal render we
moved the vectorblur code that was placed in the render package
(legacy) to the compositor. The compositor is only using this
code even the blender internal renderer did not use the code at
all.
2018-04-12 10:27:38 +02:00
c1680902ac Fix again 'auto override' system.
Got lost in big undo refactor.

Note that this is probably (maybe) not how we want to have it in the
end, things like EditMode undo should probably not trigger this check?
2018-04-11 15:23:54 +02:00
9ec26c415a Merge branch 'master' into blender2.8 2018-04-11 15:07:03 +02:00
8aa6e4d50b Changed assertion of '..' in file browser entries
The previous assert assumed '..' is always there, which isn't necessarily
true (for example when in the root of an Asset Engine repository).

The new code asserts that if '..' is present it should be the first entry
(rather than forcing the first entry to be '..').
2018-04-11 15:06:42 +02:00
5a3c146652 fix T54549: Vector Transform node in wrong nodeclass
the Vector Transform node was added to the "Vector" category in
nodeitems_builtins.py
but was using the "NODE_CLASS_CONVERTOR" internally (thus using e.g. the
'wrong' theme color)

thanx @dingto for review

Differential Revision: https://developer.blender.org/D3138
2018-04-11 14:14:31 +02:00
ce3adc090d Merge branch 'master' into blender2.8 2018-04-11 09:41:49 +02:00
a3a76bc0fe Explicitly specify which tag to use 2018-04-11 09:34:29 +02:00
c963488b5e Pose Mode: pass object to mode enter/exit
Also add lower level mode exit function
2018-04-11 09:21:01 +02:00
debe3011f6 Merge branch 'master' into blender2.8 2018-04-11 09:02:32 +02:00
32339a56f1 Cleanup: minor changes to pose-mode switching API
Prepare for multi-object pose mode
2018-04-11 08:53:59 +02:00
1b78f05b1c Merge branch 'master' into blender2.8 2018-04-10 20:17:56 +02:00
f55adabb3e Cleanup: remove unused flag 2018-04-10 20:13:31 +02:00
d7aa51a50c DRW: Deferred Shader Compilation: Don't recreate ogl context.
Only recreate ogl context if we cannot reuse the one of the previous thread.

Adding lots of shaders were recreating as many ogl context which was very
slow.
2018-04-10 19:30:23 +02:00
1bc8ebaa26 Formatting 2018-04-10 18:27:49 +02:00
48dc5c14d4 Fix crashing of EEVEE/Clay engines when importing an Alembic file
The dependency graph still isn't updated properly, so animated meshes don't
move in EEVEE/Clay, but at least Blender doesn't crash.
2018-04-10 18:24:24 +02:00
3dce5b2ef9 UI: Fix some drawing order issues. 2018-04-10 17:42:45 +02:00
04e363376b WM: Fix a crash (assert) when creating a new window.
This happened when creating a window with the cursor over the timeline area.
I still don't know exactly what happened but for a reason batches were not
reset in this case.
2018-04-10 17:42:45 +02:00
3cfca15b50 DRW: Hair: Use GWN_PRIM_LINE_STRIPS instead of LINES
This means fewer indices to store. That being said, it seems to be a little
slower because of the restart index. But that's in the case we would be
vertex bound, which is mostly never going to happen.
2018-04-10 17:42:45 +02:00
21a57ec29e BLF: Style: Fix bad casts.
This could have caused overflow issue.
2018-04-10 17:42:45 +02:00
8d1c21998a Merge branch 'master' into blender2.8 2018-04-10 16:15:30 +02:00
549d4a55ab Fix transform nearest axis check
Was mixing up global/local coords
2018-04-10 16:14:29 +02:00
71980945bc Draw Manager: Fix lazy compilation on certain hardware.
Before, the drawing functions sometimes froze with `AMD Radeon HD 7570M`.
2018-04-10 11:03:15 -03:00
6962119e7f Merge branch 'master' into blender2.8 2018-04-10 12:00:10 +02:00
5c3857b305 Depsgraph: Build relations for objects linked via pchan constraints
This is similar to previous fix for missing ID nodes, just the original
fix missed this part of change because it looked like it is already
happening.
2018-04-10 11:57:20 +02:00
a74e782f5b BLF: Fix broken shadows on certain hardware.
This was due to uninitialized texture space.
2018-04-10 10:26:09 +02:00
814f143acf Fix T54423: Messages from RNA_property_editable_info() were not translatable. 2018-04-10 10:24:02 +02:00
bd76c88754 Depsgraph: Flush debug prints
Makes it more reliable to see what was updating last when
crash happens.
2018-04-10 09:54:27 +02:00
c0ac908fe8 Fix crash when no object is active
Could happen when deleting the active object or opening an old file
2018-04-09 22:03:33 -04:00
16b795cb95 Fix crash in graph editor id remapping
Dopsheet pointer isn't set...?
2018-04-09 21:40:52 -04:00
Julian Eisel
77e9193c23 Fix invalid context when refreshing popups
Patch D2759 by @raa, with minor edits by me.
2018-04-09 19:31:39 +02:00
8d9a5d5062 UI: Fix widget shader on certain compiler.
There was a crash with Intel(R) HD Graphics 4000.
2018-04-09 14:07:32 -03:00
ec91948dd7 Cleanup: unused variable 2018-04-09 19:01:49 +02:00
Julian Eisel
7213553c84 UI: Clamp scrollbar offset to lower view boundaries
Fixes the "emtpy scrolling" glitch by clamping the scroller offset to
the boundary of the view when it's smaller than the previous.

Fixes T45197. Patch by @januz.

Differential Revision: D1580
2018-04-09 18:55:50 +02:00
4a656f5d16 GPU Shader: Cleanup: Remove unnecessary ";" 2018-04-09 13:45:57 -03:00
2a0dca4252 UI: Fix widget shader on certain compiler.
There was a crash with `Intel(R) HD Graphics 4000`.
Thanks to @fclem for the help and review.
2018-04-09 13:45:17 -03:00
26a283deae Use the newer version of the bullet 6dof spring constraint for rigidbody.
The new constraint is slower and not backward compatible, but should
be better, especially in the damping side. The new constraint also
has a different valid range of the damping coefficient, and a limit
implementation that bounces instead of making the object stationary.

Reviewers: sergof

Differential Revision: https://developer.blender.org/D3125
2018-04-09 19:14:35 +03:00
c1a2f973da Merge branch 'master' into blender2.8 2018-04-09 15:44:28 +02:00
7e39d151d8 Added support for the WEBM/VP9 video codec
WEBM is the codec name, and VP9 is the encoder (the older encoder "VP8"
is less efficient than VP9).

WEBM/VP9 and h.264 both have options to control the file size versus
compression time (e.g. fast but big, or slow and small, for the same
output quality). Since WEBM/VP9 only has three choices, I've chosen to
map those to 3 of the 9 possible choices of h.264:

- BEST → SLOWER
- GOOD → MEDIUM
- REALTIME → SUPERFAST

The VERYSLOW and ULTRAFAST options give very little extra benefit.

Reviewed by: @Severin
2018-04-09 15:27:11 +02:00
39116a4340 Remove commented-out code 2018-04-09 15:26:12 +02:00
d533b70b23 Fix build error with GCC, make depsgraph iterator compatible with C++. 2018-04-09 15:09:22 +02:00
f0edb853be Build: fix make deps using system webp/sndio libs. 2018-04-09 15:08:40 +02:00
Julian Eisel
867f96c234 Fix crash and invalid context when changing workspace
Caused by 1c24c04e60.
2018-04-09 13:19:19 +02:00
09ee3eb173 Merge branch 'master' into blender2.8 2018-04-09 12:44:25 +02:00
2872965652 Cleanup: avoid recalculating global center 2018-04-09 12:40:10 +02:00
3cb42e5917 GPU Codegen: Fix assert caused by GC of failled shaders. 2018-04-09 12:10:03 +02:00
020c4e19f2 BLF: Fix assert when drawing very small chars. 2018-04-09 12:10:03 +02:00
209c5cebb0 Freestyle: use depsgraph to get geometry, instead of Blender Internal.
Some of the code is simpler because we use Blender's triangulation directly
instead of dealing with quads. Also some progress printing code was removed
because the depsgraph can not tell us the number of objects ahead of time.

Differential Revision: https://developer.blender.org/D3127
2018-04-09 11:21:14 +02:00
cf4041eb05 UI: Widgets: Fix text edit cursor not drawing.
Actually it was drawn before the widget. Flushing widget cache and
everything is fine again.
2018-04-08 18:54:34 +02:00
9960feb7e3 GPU Select: Remove warnings on Intel GPU.
- Disable scissor test for fast clear. This could lead to some issues but
   I cannot think of one and could not find one either.
 - Manually wait for queries to be available instead of making the driver
   wait and issue warnings.
2018-04-08 18:31:50 +02:00
fc6b69bedc UI: Perf: Use GWN_draw_primitive for drawing viewport textures. 2018-04-08 18:31:50 +02:00
0b06e73258 UI: Perf: Use GWN_draw_primitive for drawing triple buffers texture. 2018-04-08 18:31:50 +02:00
17aad5ad97 UI: Perf: View3D: Batch view infos BLF calls together. 2018-04-08 18:31:50 +02:00
ccbc14d995 UI: Perf: Batch horizontal scrollers numbers together. 2018-04-08 18:31:50 +02:00
651ea84471 Clay: Improve loading time.
Only compile hair shader if we need it.
2018-04-08 18:31:50 +02:00
e9f048052f Merge branch 'master' into blender2.8 2018-04-08 17:54:07 +02:00
d6a1a0ebb8 Alphabetically ordered audio and video codecs 2018-04-08 17:52:30 +02:00
afbc73ab72 BLF: Perf: Use BLF_KERNING_STEP_FAST for other functions. 2018-04-08 15:57:24 +02:00
47cfdb3c0c Eevee: Reduce loading time.
Only compile the needed shadow shaders to reduce the startup time.

Theses shaders is taking forever to compile on intel (~5s each).
2018-04-08 15:57:24 +02:00
0c9bc69f42 DRW: Profiling: Batch BLF strings and add shadowing
Shadows makes it more readable and are relatively cheap now.
2018-04-08 15:57:24 +02:00
6b109da114 BLF: Fix BlenderPlayer compilation. 2018-04-08 15:57:24 +02:00
a981206fd1 Merge branch 'master' into blender2.8 2018-04-08 14:07:34 +02:00
245e01c30a Encoding panel clarifications
The encoding panel mentions "None" in a few places, which is confusing.
- "Codec: None" now reads "No Video"
- "Audio Codec: None" now reads "No Audio"
- "Output Quality: None; ..." now reads "Constant Bitrate"

When selecting "No Video" the remaining video encoding options are
hidden, making it even more explicit that there will not be video in the
output file.

The label "Codec" now reads "Video Codec" for symmetry with "Audio
Codec".
2018-04-08 13:46:29 +02:00
0b5ebb3265 BLF: Fix problem with bound texture.
Previous code was assuming that the glyph texture would remain bound to
GL_TEXTURE0 until the cache would be drawn. This is not always the case,
so better save the texture and rebind it before drawing.
2018-04-08 01:14:43 +02:00
3725d82cee BLF: Opti: More clever sampling for blured glyphs.
Reduce the number of sampled required for blurring by using filtered
texture samples.

This changes the result a bit but it is not noticable.
2018-04-08 01:00:55 +02:00
987c56c4b6 BLF: Opti: Draw only one quad per shadow/blurred glyph.
This port the Blurring of blf fonts to the final drawing shader.

We add a bit of extra padding to each glyph so that jittering the texture
coord does not sample the neighbor glyphs.
2018-04-08 00:44:35 +02:00
e0452cc5a9 Fix edit-mesh select next
Last change introduced error, return would stop looking over candidates.

D3137 by @nBurn
2018-04-07 19:54:59 +02:00
4db3b4da46 Bullet: Fix velocity calculation of new spring constraint
This is a backport of bullet commit: 86ca7dc
2018-04-07 17:37:23 +02:00
1a33707417 UI: Fix waveform widget text drawing.
Flush the text cache so that we have proper scissor test and ordering.
2018-04-07 14:03:32 +02:00
2d618974d1 UI: Perf: Port color widgets to batch.
This is more for completeness than perf.

Shader is tiny bit more complex but we get less overdraw and drawcalls.
2018-04-06 23:54:39 +02:00
3e998b8860 Fix object mode workspace check 2018-04-06 18:31:32 +02:00
4a2b64e43d Minor change to last commit 2018-04-06 18:17:18 +02:00
6b2cf4e86e Delete object crashed (missing NULL check)
Error in recent removal of workspace.object_mode
2018-04-06 18:15:51 +02:00
4e52724aa8 UI: Perf: Optimize F-curve handles drawing.
50% less time in my test when all handles are selected.
2018-04-06 15:39:09 +02:00
5441e4802a Style: Remove duplicated struct declaration. 2018-04-06 14:30:44 +02:00
39b654f4ff UI: Perf: Use widget base batching
Overall 10% more performance on general UI drawing time.

This commit can introduce ordering problem on some elements.
In this case you need to flush the widget cache to ensure the element that
is going to be drawn is drawn on top of any widget base.

To flush the cache use UI_widgetbase_draw_cache_flush.

This is already done for BLF and Icons.
2018-04-06 14:30:20 +02:00
21113ad834 UI: Perf: Add batching capability to widgets.
Similiar to how we batch Icons together. This is not enabled in this
commit.
2018-04-06 14:25:55 +02:00
fcb4aaf7a9 GPUShader: Add GPU_SHADER_2D_WIDGET_BASE_INST shader.
This will let us draw multiple widget base at once.
2018-04-06 14:22:20 +02:00
d2e1a14a57 Fix Collada: nullptr is a c++11 keyword. Changed to NULL 2018-04-06 13:06:46 +02:00
fe73c12990 Fix Collada: Import of animations for objects with multiple materials
When importing multiple materials for one object,
the imported material animation curves have all been
assigned to the first material in the object.

This fix also improves the console logging whenever the importer
finds a consistency problem with the imported animation data.
2018-04-06 12:42:38 +02:00
4de70da73a Cleanup: style, doxy headers 2018-04-06 10:47:39 +02:00
4a73127a2b UI: Perf: Improve ui_draw_dropshadow.
Replace the 12 iterations of UI_draw_roundbox_4fv with only one batch.

This mean less overdraw and less drawcalls.

I had to hack the opacity falloff curve manually to get approximatly the
same result as previous technique. I'm sure with a bit more brain power
somebody could find the perfect function.
2018-04-06 10:25:53 +02:00
80d4d71360 UI: Perf: Modify UI_draw_roundbox to use GWN_batch API.
This commit also rename and move a few thing to clean things up.

Major improvment is using one drawcall instead of 8 for UI_draw_roundbox_aa.
2018-04-06 10:25:53 +02:00
Julian Eisel
72e5082b67 UI: Add accelerator keys to quit confirmation popup 2018-04-05 19:15:37 +02:00
eb7b701137 Fix error where find-next missed None check
Thanks to @nBurn
2018-04-05 18:48:48 +02:00
ba821ad2ad Depsgraph: Avoid build-time armature expanding
With index-based pchan evaluation we don't need to go into
a mess of expanding armature at relation construction time.
2018-04-05 18:40:10 +02:00
58ba5a65bc Cleanup: use string macros to avoid duplicate args 2018-04-05 18:39:23 +02:00
3a864f5ee4 BLI_string_utf8: macros that de-duplicate sizeof arg 2018-04-05 18:37:54 +02:00
025bf11a9f Merge branch 'master' into blender2.8 2018-04-05 18:25:05 +02:00
1c24c04e60 Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
2018-04-05 18:21:14 +02:00
9b8a92b874 Depsgraph: Pull indirect dependencies via pchan constraints
Was missing ID looper for pchan constraint.
2018-04-05 18:03:36 +02:00
57329304b0 Merge branch 'master' into blender2.8 2018-04-05 16:58:41 +02:00
ea0e2f9bd3 Load metadata from video files and expose via RNA
The MovieSequence and MovieClip classes now have a metadata() function
that exposes the `IDProperty *` holding the video metadata.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:24 +02:00
6c3110a661 Write the scene render frame range to image/video files
This is useful to create a mapping from the frame range in the video to
frame index in the blend file.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:24 +02:00
6374d390d3 Write StampData metadata to video files
This is currently only supported by FFmpeg (so not frameserver, AVI RAW,
or AVI JPEG), and only seems to work when using Matroska or Ogg Theora
containers.

Only metadata that doesn't change from frame to frame is written to
video files. This distinction is visible in the UI by looking at the
stamp checkbox tooltips (they either mention "image" or "image/video").

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:23 +02:00
b0a767b85b IMB_metadata improvements
- Metadata handling is now separate from `ImBuf *`, allowing it to be
  used with a generic `IDProperty *`.
- Merged `IMB_metadata_add_field()` and `IMB_metadata_change_field()`
  into a more robust `IMB_metadata_set_field()`. This new function
  doesn't return any status (it now always succeeds, and the previously
  existing return value was never checked anyway).
- Removed `IMB_metadata_del_field()` as it was never actually used
  anywhere.
- Use `IMB_metadata_ensure()` instead of having
  `IMB_metadata_set_field()` create the containing `IDProperty` for
  you.
- Deduplicated function declarations, moved `intern/IMB_metadata.h` out
  of `intern/`. Note that this does mean that we have some extra
  `#include "IMB_metadata.h"` lines now, as the metadata functions are
  no longer declared in `IMB_imbuf.h`.
- Deduplicated function declarations, all metadata-related declarations
  are now in imbuf/IMB_metadata.h.

Part of: https://developer.blender.org/D2273

Reviewed by: @campbellbarton
2018-04-05 16:50:23 +02:00
f0f6c96a92 BLI_string: macros that de-duplicate sizeof arg 2018-04-05 16:44:48 +02:00
3eaf77fdd3 Merge branch 'master' into blender2.8 2018-04-05 16:19:43 +02:00
1c1dc39466 UI: Node Editor: Make nodelink arrow size and link width dpi dependant. 2018-04-05 16:08:46 +02:00
fb8a1a58d9 UI: Node Editor: Batch nodelinks together.
This will do only one drawcall for every 256 nodelinks.
2018-04-05 16:08:46 +02:00
72bfa849ee UI: Node Editor: Port nodelink drawing to shader based drawing.
Use the new GPU_SHADER_2D_NODELINK and GPU_SHADER_2D_NODELINK_INST to
accelerate nodelink drawing.

This commit does not include the batching functionnality. So this should
not make a lot of difference.
2018-04-05 16:08:46 +02:00
c65c4fb77b GWN: Add GWN_batch_uniform_2fv_array. 2018-04-05 16:08:46 +02:00
cadef79a52 GPUBatch: Change preset managment system.
Now use a list of preset batches with a function to add new ones to this
list.

This removes the need of new functions all over the place to reset/exit.
2018-04-05 16:08:46 +02:00
d48597eb54 GPUShader: Add 2D Nodelink shader.
Special shader to draw nodelinks for the node editor.

We only pass bezier points to the GPU and vertex position is handled inside
the vertex shader.
The arrow is also part of the batch to avoid separate drawcalls for it.

We still draw 2 pass one for shadow and one for the link color on top.

One variation to draw instances of theses links so that we only do one
drawcall.
2018-04-05 16:08:46 +02:00
ad1ea9a427 Undo: split text undo steps out of the data-block
This moves undo storage into a separate struct which is passed
in from the undo system.
2018-04-05 15:22:33 +02:00
79c3c56894 Undo System: return undo step from undo push init
Also improve logging
2018-04-05 14:11:51 +02:00
1761095abc Logging: use -1 log level to log all levels 2018-04-05 13:55:04 +02:00
cd474b913b ED_undo: use logging 2018-04-05 13:41:52 +02:00
47b6e23271 Fix crash w/ empty text undo operations 2018-04-05 10:01:12 +02:00
5fba4458e9 Fix Cycles motion blur and engine.frame_set() not working. 2018-04-04 17:59:46 +02:00
db3c3d1338 Depsgraph: Fix/workaround crash with animation and drivers and CoW
The issue was caused by component tag forcing CoW component to be run,
without actually flushing changes down the road from the CoW operation.

In a way, this is what we want: we do want CoW to run on changes, but
we don't want tiny change forcing full datablock update.

This commit makes it so order of updates is all correct, but the bigger
issue is still open: what parts of datablock CoW should be updating?

Now it's possible to open spring file and play around.
2018-04-04 17:49:08 +02:00
b561707bed Gawain: Make removing batches more thread safe
The issue was mainly visible when copy-on-write was enabled. This was forcing
lots of meshes to be freed from multiple thread, causing all sorts of race
conditions in Gawain's VAO code.

OpenGL resources seems already to be doing deferred deletion, need to do the
same for CPU side arrays.
2018-04-04 17:49:08 +02:00
160e62b88c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_object.h
2018-04-04 15:03:55 +02:00
d59c2d12b1 Fix modifier freeing code re. ID refcounting.
Free code should not handle ID refcounting at all. This has to be done
at higher level, since in some case we want to free (temp) data that
actually did not refcount at all its IDs.

This change seems to be working OK, but as usual in that area, only
lots of testing in real-case situation will say whether there are some
hidden bugs or not.
2018-04-04 14:58:52 +02:00
59562e5b25 Fix Cycles particle info node not working. 2018-04-04 13:18:06 +02:00
7db4b935e1 Depsgraph: Cleanup, reduce indentation level 2018-04-04 13:02:28 +02:00
ef22b837e8 Merge branch 'master' into blender2.8 2018-04-04 12:57:36 +02:00
0c7ec58966 Depsgraph: Make sure textures used by modifiers are in the graph 2018-04-04 12:56:04 +02:00
49f77b0d83 Proper fix for T54337
Accidentally checked the wrong variable in fa01a1738b.
2018-04-04 06:36:16 -04:00
39585e1abc Fix undefined workspace in UI script 2018-04-04 12:33:10 +02:00
3a17dab2b1 Fix Eevee crash with generated coordinates on non-objects. 2018-04-04 12:28:20 +02:00
9c7bd1fad9 Cleanup: simplify fix for T53497, this part is not strictly needed. 2018-04-04 12:28:20 +02:00
3a566687e1 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
2018-04-04 12:00:57 +02:00
677d699645 Tweak ID->tag reset on file load (no visible change expected!).
Issue was, *some* IDs (like infamous nodetrees from materials etc.)
would not go through the 'main' read_libblock() func, so their tags were
never reset.

So now, we ensure direct_link_id() always clear the tags, and move
setting them in read_libblock() after the call to direct_link_id().

Needed for depsgraph, but general healthier fix actually.
2018-04-04 11:59:16 +02:00
948f4e8c94 Depsgraph: Get pchan index from correct pose
This code should be replaced with evaluation-time ID block expansion,
but before that it will be helpful to get old design to work again.
2018-04-04 11:55:06 +02:00
a6999a869e Merge branch 'master' into blender2.8 2018-04-04 11:49:24 +02:00
c128738926 Depsgraph: Ensure root pchan is always found 2018-04-04 11:49:01 +02:00
c9ad9b260a Depsgraph: Pass CoW version of object to armature update done 2018-04-04 11:47:33 +02:00
fb5a57ab97 Fix part of T53497: Eevee stuttering on macOS for the first few seconds of usage.
The problem was that textures were assigned to different slots on different draw
calls, which caused shader specialization/patching by the driver. So the shader
would be compiled over and over until all possible assignments were used.
2018-04-04 11:30:55 +02:00
3f4df3f847 Fix missing hair in fishycat and everything else after particle recalc changes
The cache was getting reset always, due to special case of flag being 0.

Bug introduced by: 44cd24a9ce
2018-04-04 05:10:47 -04:00
e217fb439f Merge branch 'master' into blender2.8 2018-04-04 10:36:39 +02:00
909efe6be5 Depsgraph: Assert that pchan index is always valid 2018-04-04 10:35:32 +02:00
d54a058f35 Merge branch 'master' into blender2.8 2018-04-04 10:16:38 +02:00
f913e69093 Depsgraph: Add missing expansion od custom bone shapes
This was fixed in 2.8 branch but not in master.
2018-04-04 10:15:45 +02:00
eaf8608ba5 Merge branch 'master' into blender2.8 2018-04-04 09:54:50 +02:00
4674e02562 Depsgraph: Only bind ID-data and indices to depsgraph callbacks
This is a part of copy-on-write sanitization, to avoid all the checks
which were attempting to keep sub-data pointers intact.

Point is: ID pointers never change for CoW datablocks, but nested
data pointers might change when updating existing copy.

Solution: Only bind ID data pointers and index of sub-data.
This will make CoW datablock 7update function was easier in 2.8.

In master we were only using pose channel pointers in callbacks,
this is exactly what this commit addresses. A linear lookup array
is created on pose evaluation init and is thrown away afterwards.

One thing we might consider doing is to keep indexed array of
poses, similar to chanhash.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D3124
2018-04-04 09:48:41 +02:00
fa01a1738b Fix T54337: Cycles crash with simple subd object in debug build 2018-04-03 23:37:12 -04:00
8c4d28cdb9 Fix T54400: Some GCN 1 cards available to select for use with Cycles
Hainan was missing from the list of GCN 1 cards.
2018-04-03 23:15:07 -04:00
2f723a414f BMesh: remove redundant loop in select-next-active
Thanks to @nBurn for spotting
2018-04-03 18:32:55 +02:00
cd6daea7d3 Missed in last merge 2018-04-03 18:22:52 +02:00
48eaddfae0 Missed in last merge 2018-04-03 18:22:05 +02:00
e52beb3733 Merge branch 'master' into blender2.8 2018-04-03 18:12:39 +02:00
ab695c3297 Undo: make id-map use binary search to keep sorted 2018-04-03 18:07:51 +02:00
1f0f234b07 Fix own error w/ undo ID lookup
Was testing with small number of items, so this went unnoticed.
2018-04-03 17:58:37 +02:00
c713e9c472 Draw Manager: Improve description of draw_frustum_boundbox_calc variables 2018-04-03 12:18:56 -03:00
b2c9fdfe87 Cleanup: rename BMesh count_ex -> count_at_most 2018-04-03 17:06:36 +02:00
bfdb88f3f4 Cleanup: rename list count_ex -> count_at_most 2018-04-03 17:05:21 +02:00
06a62d4e06 Undo: use with_prev verisons of id-map lookups 2018-04-03 17:03:33 +02:00
5a7deab65a Undo: use general id-map for image undo lookups.
Was doing own name based lookups to keep compatible w/ global undo.
2018-04-03 17:03:33 +02:00
75de21f072 Undo System: id-map avoid duplicate add/lookup
Add versions of add/lookup that check the previous item.
2018-04-03 17:03:33 +02:00
53f068454e Fix mistake logging w/ undo 2018-04-03 17:03:33 +02:00
6744c34a26 Merge branch 'master' into blender2.8 2018-04-03 16:13:13 +02:00
96f565b380 Fix T54477: Broken utf8 strings in old .blend files
Back in the days (2.4x and before), it was rather easy to get some
invalid utf-8 strings in Blender. This is totally breaking modern code,
so this commit adds a simple 'check & fix strings' operator, available
from the main File menu.
2018-04-03 16:03:11 +02:00
601835cd31 Fix (unreported) crash when accessing some bl_rna.properties.
E.g. typing `bpy.data.bl_rna.properties[8].<tab>` in console would hard-crash
trying to dereference NULL pointer. Was a missing check in rna_Property_tags_itemf().
2018-04-03 14:32:23 +02:00
7e9a80530f Cleanup: remove unused mtexpoly array
Not needed in 2.8
2018-04-03 14:30:12 +02:00
a2c0a382cd Merge branch 'master' into blender2.8 2018-04-03 14:19:51 +02:00
feb7852e1b Fix duplicate Cycles panels in properties editor. 2018-04-03 14:04:59 +02:00
3a96cfcd26 Fix crash on startup on macOS, after recent framebuffer refactoring. 2018-04-03 09:36:31 +02:00
b3004d30f5 Undo: remove particle undo push
Was only called on copy particle system
which is already doing an undo push.
2018-04-03 08:57:01 +02:00
72ae0e1b6d Cleanup: editor BKE_main includes 2018-04-03 08:42:12 +02:00
a0eb54142f Undo: replace global access w/ ED_undo_stack_get
While I'd like to avoid using this too much since the operator
system should handle.
It's less trouble than accessing it inline each time.
2018-04-03 08:35:42 +02:00
a7a25fed2b Fix mode switching error on undo
For 2.8 there is already a utility function for this,
wrap it - avoiding an undo step.
2018-04-03 08:05:18 +02:00
751782c8df Correct own error in string lookup 2018-04-03 07:44:37 +02:00
Dalai Felinto
495b21fa0c Move to Collection: Reduce memory leakage
This is really minor but anyways, now it will only leak if you cancel the menu.
And that only if htis is the last time you called this operator before closing
Blender.
2018-04-02 18:52:22 -03:00
Dalai Felinto
89eb9c7f3e Move to Collection: Use automatic fallback name for new collections popup 2018-04-02 17:25:22 -03:00
Dalai Felinto
1f291d5814 Collections: API to get automatic name of new collection 2018-04-02 17:25:22 -03:00
Dalai Felinto
0faa065ed4 Move to Collection: Popup for naming new collection 2018-04-02 17:25:22 -03:00
Dalai Felinto
80e7a48f21 Fix blenderplayer (tm) 2018-04-02 17:24:20 -03:00
31f2a6755d PyAPI: Add PyC_Tuple_Pack_F64 utility 2018-04-02 19:48:34 +02:00
71d7d6cd8c Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.
Better fix for T54457. It seems Debian compiles OpenVDB without ABI 3
compatibility, while Arch does enable it as is the default in the OpeVDB
CMake build system.

So now there's an option that the distribution can set depending on how
they compile their OpenVDB package.
2018-04-02 19:13:04 +02:00
72c57a755e UI: Fix: Center vertical scrollbar circles. 2018-04-02 18:47:56 +02:00
e1d6e524b3 UI: Perf: Batch Trias with widgets.
This remove another portion of imm calls and reduce overall drawcall count.
2018-04-02 18:47:56 +02:00
4041385ddd Cleanup: remove redundant imbuf return values
Some functions always returned the input argument
which was never used.

This made code read as if there might be a leak.

Now return a boolean (true the imbuf is modified).
2018-04-02 17:34:52 +02:00
b49290be14 Partial fix for T54491: Use a more accurate solution to calculate the frustum boundbox 2018-04-02 12:21:09 -03:00
Milan Jaros
888a04c7e4 Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
2018-04-02 16:39:04 +02:00
692aeb6fe0 Cleanup: newlines left in messages 2018-04-02 15:46:31 +02:00
89fdd88906 Merge branch 'master' into blender2.8 2018-04-02 15:18:10 +02:00
57bbd478a5 Cleanup: remove unused view_layer argument 2018-04-02 15:11:53 +02:00
4ffa05c30b Cleanup: move undo into it's own directory
Split out undo API from ED_util.h into ED_undo.h
2018-04-02 15:07:40 +02:00
b186592b21 Cleanup: move BKE_global include under ifdef's 2018-04-02 14:19:44 +02:00
44efbef41e Undo: store active curve shape key in edit-mode 2018-04-02 13:13:57 +02:00
017c731cf3 Logging: use for Python API
Adds categories "bpy.context" & "bpy.rna"
2018-04-02 13:13:57 +02:00
21fcc723e9 imbuf: revert some of the changes of rBb6ba3c682dd6615e760905572a5bcd69bb46371f since they broke the build. 2018-04-01 15:17:17 -06:00
b29ecbfc6b Fix compiling with Alembic
Still need G.main
2018-04-01 19:50:19 +02:00
c0eab1fde5 Workaround for undo steps not storing object modes 2018-04-01 19:33:02 +02:00
557db587b7 Merge branch 'master' into blender2.8 2018-04-01 11:14:09 +02:00
b65ea517eb 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).
2018-04-01 11:03:25 +02:00
f48895f74a Correct accidental changes by C Logging addition
Error in 891c1cfc9a
2018-04-01 10:23:28 +02:00
473f17b3d5 Resolve unsigned comparison error w/ MSVC 2018-04-01 07:41:23 +02:00
b6ba3c682d Cleanup: remove global header 2018-04-01 07:24:45 +02:00
951d89b7b4 Cleanup: warning 2018-03-31 23:51:38 +02:00
d18116a297 Removed by accident in last commit 2018-03-31 23:47:05 +02:00
651b8fb14e 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
2018-03-31 20:40:37 +02:00
916c91bd08 BLF: Remove debug print
"this is not the commit you're looking for"
2018-03-31 20:33:05 +02:00
4ae7235637 BLF: Fix Vertical/Horizontal layout switch.
This was breaking the first drawcall after a simple/non-simple shader
switch.
2018-03-31 20:26:09 +02:00
c77870fc78 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.
2018-03-31 19:43:22 +02:00
4dc0c923fb 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.
2018-03-31 19:32:53 +02:00
f9691bae84 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.
2018-03-31 19:32:53 +02:00
91d0825b55 BLI_sort_utils: add pointer sorting callback
Also rename Pointer -> Ptr
2018-03-31 19:25:27 +02:00
ae3a1da1e6 Logging: fix own error with formatting 2018-03-31 15:43:47 +02:00
b237a1c2ea Use int instead of bool
Causes issues when including in some files.
2018-03-31 15:33:15 +02:00
db8e7f9780 Logging: add argument --log-show-basename
Optionally strips leading path from filenames when logging.
2018-03-31 15:29:46 +02:00
5cb440492e Cleanup: --help text output
Some arguments missed their <value>.
2018-03-31 14:53:15 +02:00
22d40fdfd8 Cleanup: blf internal struct naming
- use x/y/width/height/max as a suffix.
- replace 'num' prefix /w 'len' suffix.
2018-03-31 13:40:23 +02:00
0ef38879b3 Cleanup: BLF batch drawing naming
- batching -> batch_draw.
- ct & size -> len.
- start/end -> begin/end (follow GL convention).
2018-03-31 13:11:38 +02:00
ac4513a5b8 Logging: add ability to exclude categories. 2018-03-31 12:52:47 +02:00
5f59c22bf1 Docs: doxygen docs for clog 2018-03-31 12:27:18 +02:00
b8a66973ac Fix clog: own error allocating from static buffer 2018-03-31 11:25:49 +02:00
af11eea3fd Fix logger build w/ MSVC 2018-03-31 09:18:30 +02:00
1ebc14064b Build deps: do sndfile patch also on linux platform 2018-03-31 02:15:13 +03:00
8b74741b9e 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.
2018-03-30 23:27:45 +02:00
ddbde6d1c0 UI: Perf: Do not use implicit Attrib fill. 2018-03-30 22:51:28 +02:00
4241d6a9cc 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().
2018-03-30 22:50:17 +02:00
96d6a928ab DRW: Add BLF_batch_reset to be able to use BLF inside DRW. 2018-03-30 21:10:24 +02:00
f44d3e83cc UI: Perf: Add BLF batching for File browser and UI blocks.
This batch together most of the calls that can be batch together.
2018-03-30 21:09:24 +02:00
963e48e1df 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.
2018-03-30 20:59:45 +02:00
fb1463ff2b GPUFramebuffer: Fix assert triggering another assert. 2018-03-30 20:15:03 +02:00
ab9adf9cdc 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.
2018-03-30 20:09:26 +02:00
8568d38f1b 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.
2018-03-30 20:09:26 +02:00
891c1cfc9a 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.
2018-03-30 18:57:41 +02:00
c647c93f63 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.
2018-03-30 15:22:40 +02:00
Dalai Felinto
cc69831796 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.
2018-03-29 20:03:47 -03:00
Dalai Felinto
41a81fece4 Collections: API to select all scene collection objects 2018-03-29 20:03:47 -03:00
Dalai Felinto
534916258d 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)
2018-03-29 20:03:47 -03:00
Dalai Felinto
024395170c Fix typo in outliner Select Objects tooltip 2018-03-29 20:03:47 -03:00
Dalai Felinto
156b548208 Collections: API to get collection from index 2018-03-29 20:03:47 -03:00
Dalai Felinto
1251043636 Collections: API to check if object is in collection 2018-03-29 20:03:47 -03:00
ee2aa31982 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.
2018-03-29 18:02:04 -04:00
b882257fbd 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.
2018-03-29 21:32:26 +02:00
7144fdf285 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.
2018-03-29 21:32:26 +02:00
c48b6fae9a GWN: Add immVertex4f. 2018-03-29 21:32:26 +02:00
354dfdac88 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
2018-03-29 14:26:49 -04:00
0f6d52cd29 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
2018-03-29 14:25:13 -04:00
Julian Eisel
b3ef5a04d1 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.
2018-03-29 17:21:02 +02:00
Julian Eisel
973eeff2ea Fix Blenderplayer compile error 2018-03-29 17:15:35 +02:00
8b45fd8b61 UI: Fix out of bound read catched by asan. 2018-03-29 16:46:28 +02:00
d93e7e6430 UI: Perf: Group fill/border/emboss batches together.
This roughly halves the number of drawcalls from widgetbase_draw.
2018-03-29 16:36:01 +02:00
Dalai Felinto
26b9c502ed 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.
2018-03-29 10:36:34 -03:00
Dalai Felinto
11130970c6 Merge commit 'origin/master^' into blender2.8 2018-03-29 10:36:01 -03:00
Dalai Felinto
9f60c850f9 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.
2018-03-29 09:56:09 -03:00
f6ad538040 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.
2018-03-29 14:22:50 +02:00
ba9c2746b6 GPUShader: Add specialized widget base shader.
This vertex shader let us draw widgets with batches instead of imm calls.
2018-03-29 14:22:50 +02:00
3c48a21833 GWN: Batch: Add GWN_batch_uniform_4fv_array 2018-03-29 14:22:50 +02:00
8301b26452 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.
2018-03-29 13:43:30 +02:00
72b4d444f6 Particles: Fix missing hair dynamics
Only if all the nasty looking bugs had such a simple solution...
2018-03-29 12:43:00 +02:00
44cd24a9ce 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.
2018-03-29 12:41:11 +02:00
526719bccb Cleanup, silence compiler warning in release build 2018-03-29 12:40:23 +02:00
95b9680597 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.
2018-03-29 12:31:32 +02:00
0cbf747ffa 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.
2018-03-29 12:18:07 +02:00
3177023104 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.
2018-03-29 12:07:11 +02:00
90e1a5fd27 Draw manager: Use utility functions for dealing with state memset 2018-03-29 11:43:42 +02:00
f42c6960d2 Draw manager: Cleanup, early output
Do early output and reduce level of indentation.
2018-03-29 10:34:42 +02:00
05c76990c8 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.
2018-03-29 10:08:56 +02:00
ca5f3dd220 Fix T54457: build error with OpenVDB versions newer than 3.
Solution provided by Sven-Hendrik Haase.
2018-03-29 07:21:35 +02:00
52302757cd Fix T54455: OpenCL build error after recent changes. 2018-03-29 07:14:09 +02:00
Matt Heimlich
e3f1d98098 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
2018-03-28 23:45:15 +02:00
Dalai Felinto
6456d59b6b 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.
2018-03-28 17:15:33 -03:00
Dalai Felinto
ba90597f22 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).
2018-03-28 17:15:01 -03:00
Dalai Felinto
f167226b79 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
2018-03-28 17:14:51 -03:00
1953de335e Cleanup: Tooltip spelling 2018-03-28 13:09:00 -04:00
1b6bf5b75e build_deps: disable hdf5 lib support
we do not ship with hdf5 support for alembic on any of the platforms.
2018-03-28 10:48:52 -06:00
8afc9c1e7d 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.
2018-03-28 18:01:32 +02:00
Jeff Witthuhn
bc3a55c343 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
2018-03-28 12:13:04 +02:00
205fe8afd7 Clay: Remove warning. 2018-03-28 11:33:23 +02:00
e49d66f22c Cleanup: typo in function name 2018-03-28 11:23:38 +02:00
a970ac5d55 BLI_array: utility to check memory is zerod 2018-03-28 11:13:54 +02:00
4bd5b824b0 Fix missing confirm quit dialog on macOS, after recent changes. 2018-03-28 10:54:17 +02:00
be587d76ef Cycles: Fix bad register cast in sseb
This is currently unused code, but causes gcc-8 to fail.
2018-03-28 10:34:31 +02:00
873c23456b 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.
2018-03-28 00:05:57 +02:00
0acf655f9d UI: Perf: Group drawcalls inside ui_draw_panel_dragwidget
16 Drawcalls > 1 Drawcall

Do I need to say more?
2018-03-28 00:05:57 +02:00
637993fafe 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.
2018-03-28 00:05:51 +02:00
3bb720a7de GPUShader: Cleanup: Remove unused uniform_interface. 2018-03-27 23:51:23 +02:00
7a94d4362a DRW: Opti: Make cursor use batch instead of immediate API.
This is also much cleaner and taking 1 drawcall instead of 2.
2018-03-27 23:50:26 +02:00
2117680094 UI: Fix assert cause by vertex count being too small. 2018-03-27 17:58:05 +02:00
2cbd7cc269 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.
2018-03-27 17:03:42 +02:00
e4d82c0dcf Fix T54435: Quit prompt fails w/ fractional scale 2018-03-27 16:46:10 +02:00
90b7bcb48d Merge branch 'master' into blender2.8 2018-03-27 15:09:00 +02:00
e22b870b4a 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
2018-03-27 14:56:54 +02:00
ddecf23711 Merge branch 'master' into blender2.8 2018-03-27 07:08:58 +02:00
3bca1ef26b Cleanup: move paint curve undo into own file 2018-03-27 07:06:14 +02:00
a7aee250b8 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.
2018-03-27 01:08:30 +02:00
17a4a5a553 Eevee Shaders: Fix "No matching overloaded function"
invert -> inverse
2018-03-26 19:11:02 -03:00
dff7f55cd0 GPUFramebuffer: Fix compiler warning about return value. 2018-03-26 17:54:46 +02:00
fc348a563e Fix bad merge resolution from previous commit 2018-03-26 14:59:55 +02:00
21aca14e43 Merge branch 'master' into blender2.8 2018-03-26 14:56:00 +02:00
3c45fdd171 GHOST: Solve compilation error of test programs 2018-03-26 14:51:56 +02:00
64e5f83133 BLF: Don't use user preferences
BLF is a low level module, which might (and is) used without Blender.

Thanks Campbell for review!
2018-03-26 14:49:23 +02:00
0476f8277a BLF: Cleanup, indentation inside of preprocessor 2018-03-26 14:07:19 +02:00
13f80a152a Fix T53800: Bad data editing during DEG evaluation?
Remain convinced that it should not be possible for undo code to run in
parallel with DEG eval... But for now, this whould prevent static
override code to dive into this collection.
2018-03-26 10:41:31 +02:00
0c49d83b49 Eevee: Use named EEVEE_EffectsFlag for effects flag. 2018-03-26 10:02:53 +02:00
b9ec7a9272 Eevee: Fix feedback loop warning. 2018-03-26 10:01:46 +02:00
92b61dc16d GPUTexture: Fix compilation issue. 2018-03-26 09:59:12 +02:00
41852c8a8c DRW: Fix crash/broken Metaballs display. 2018-03-25 20:06:12 +02:00
42b5328c36 DRW: Rename DRW_shgroup_uniform_buffer into DRW_shgroup_uniform_texture_ref
This is in order to not mix it with the incomming buffer textures.
2018-03-25 20:06:12 +02:00
94dd81941f DRW: Remove mentions of DRWInterface.
Theses are no longer relevant. Better talk about shgroup directly.
2018-03-25 20:06:12 +02:00
bc15ec0896 GPUFramebuffer: Refactor (Part 2)
This refactor modernise the use of framebuffers.
It also touches a lot of files so breaking down changes we have:
 - GPUTexture: Allow textures to be attached to more than one GPUFrameBuffer.
   This allows to create and configure more FBO without the need to attach
   and detach texture at drawing time.
 - GPUFrameBuffer: The wrapper starts to mimic opengl a bit closer. This
   allows to configure the framebuffer inside a context other than the one
   that will be rendering the framebuffer. We do the actual configuration
   when binding the FBO. We also Keep track of config validity and save
   drawbuffers state in the FBO. We remove the different bind/unbind
   functions. These make little sense now that we have separate contexts.
 - DRWFrameBuffer: We replace DRW_framebuffer functions by GPU_framebuffer
   ones to avoid another layer of abstraction. We move the DRW convenience
   functions to GPUFramebuffer instead and even add new ones. The MACRO
   GPU_framebuffer_ensure_config is pretty much all you need to create and
   config a GPUFramebuffer.
 - DRWTexture: Due to the removal of DRWFrameBuffer, we needed to create
   functions to create textures for thoses framebuffers. Pool textures are
   now using default texture parameters for the texture type asked.
 - DRWManager: Make sure no framebuffer object is bound when doing cache
   filling.
 - GPUViewport: Add new color_only_fb and depth_only_fb along with FB API
   usage update. This let draw engines render to color/depth only target
   and without the need to attach/detach textures.
 - WM_window: Assert when a framebuffer is bound when changing context.
   This balance the fact we are not track ogl context inside GPUFramebuffer.
 - Eevee, Clay, Mode engines: Update to new API. This comes with a lot of
   code simplification.

This also come with some cleanups in some engine codes.
2018-03-25 20:06:12 +02:00
f937123116 GPUFramebuffer: Refactor (part 1)
Move some DRWFramebuffer functions to GPUFramebuffer.
2018-03-25 20:06:12 +02:00
e5ee1ed818 Basic Engine: Remove unneeded use of Framebuffers. 2018-03-25 20:06:12 +02:00
9c1ab47fc4 GPUOffscreen: Remove unused offscreen blit. 2018-03-25 20:06:12 +02:00
619d977e1a GPULamp: Move GPU_frambuffer_blur to GPU_lamp.c
This is a bit useless because gpu lamps are only used by the game engine
and it is planned to be "remove" in some way.

Doing this to clean gpu_framebuffer.c.
2018-03-25 20:06:12 +02:00
4c66068790 GPUFramebuffer: Make current framebuffer thread local.
This make sense since we are using multiple olg contexts and two contexts
can be active at the same time with different framebuffers.
2018-03-25 20:06:12 +02:00
a78f5accbb GPUTexture: Style: Respect 120 char per line limit. 2018-03-25 20:06:12 +02:00
37a7cd8344 GPUViewport: Small simplifications + fixes.
- Use GPU_SHADER_2D_IMAGE_ALPHA.
 - Add alpha uniform.
 - bypass reseting the scissors and depth test because we used
   another context for drawing.
2018-03-25 20:06:12 +02:00
6d6c292cf8 Clay: Fix alpha problem cause by FXAA pass. 2018-03-25 20:06:12 +02:00
f63bb98223 GPUViewport: Remove depth debug.
This is not used anymore.
Debug visualisations should be moved to the draw manager.
2018-03-25 20:06:12 +02:00
b1c025d1e8 GPUTexture: Small refactor.
This includes a few modification:
 - The biggest one is call glActiveTexture before doing any call to
   glBindTexture for rendering purpose (uniform value depends on it).
   This is also better to know what's going on when rendering UI. So if
   there is missing UI elements because of this commit look for this first.
   This allows us to have "less calls" to glActiveTexture (I did not
   measure the final count) and less checks inside GPU_texture.

 - Remove use of GL_TEXTURE0 as a uniform value in a few places.

 - Be more strict and use BLI_assert for bad usage of GPU_texture functions.

 - Disable filtering for integer and stencil textures (not supported by
   OGL specs).

 - Replace bools inside GPUTexture by a bitflag supporting more options to
   identify texture types.
2018-03-25 20:06:11 +02:00
879eabedda DRWTexture: Remove DRW_texture_update 2018-03-25 20:06:11 +02:00
b9962d0070 DRW: Remove unecessary push/pull attrib.
Since we are rendering draw manager's command in a separate context, we
don't need to save/restore the UI opengl state attributes/config.
2018-03-25 20:06:11 +02:00
e02480fd16 GPU: gpu_draw.c: Fix wrong renaming.
Renaming happened in b4d053efc7 and seems to have been a bit too
agressive.
2018-03-25 20:06:11 +02:00
31bf6edf79 Text: line break always returned cancelled
Harmless but incorrect.
2018-03-25 17:51:49 +02:00
977a4e7f5d Text: re-allocate exact lengths for undo
Undo sometimes reserved too much space in the buffer,
now assert when this happens and allocate the exact size needed.

Note prepares for moving text editor undo out of the text block (D3113)
which will split the undo buffer into a list of undo steps.
2018-03-24 14:27:31 +01:00
3f9d5ea0ec Fix text editor undo w/ 4+ byte utf8 characters 2018-03-24 14:14:19 +01:00
9d1de621e2 Cleanup: move undo opcodes out of public header 2018-03-24 12:46:25 +01:00
19f148d9d0 PyDoc: Add docutils ref for "registration"
This will be used to link to from the manual.
2018-03-23 20:25:30 -04:00
Julian Eisel
357b72e0a7 Theming: Use list-item colors for all un-embossed buttons in list-items
E.g. number buttons in the shape key list would use theme colors of text
widgets.

Addresses T50862.
2018-03-23 20:46:51 +01:00
a7e4268bee UI: restore quit confirmation when dialog disabled 2018-03-23 17:32:13 +01:00
0c753c1dc4 RNA comparison/override: better control over property processing.
This commit essentially introduces a new RNA property flag, which when
set prevents affected property from being processed at all in comparison
code (also used to automatically generate static override rules).

The idea is to use it on very low-level data in RNA, like e.g. mesh's
geometry or psys' particles collections.

For now only applied to psys' particle collections, on the main mesh of
Agent327 pigeon, it goes from 100ms to 0.5ms on a full
auto-override-generating comparison...

Also added some new RNA property helper funcs to check on comparable and
overridable status.
2018-03-23 16:35:53 +01:00
15af75d79e msvc: Fix msvc2013 new despgraph related build errors.
msvc's function.hpp does not like NULL for function pointers. disabled support for this platform.
2018-03-23 09:23:08 -06:00
21f16bb93e Merge branch 'master' into blender2.8 2018-03-23 15:25:27 +01:00
4f8e407086 Libmv: Fix compilation error on Windows 2018-03-23 15:05:08 +01:00
ab48e6355d Glog/gflags: Reduce amount of local modifications
With better directory layout and more proper include
statements we can avoid several local modifications,
such as changing config.h for Windows Glog and the
ones related on pass-through statements in logging
headers in Glog.

This commit also makes unused functions not-a-warning
for external code.
2018-03-23 14:38:02 +01:00
Julian Eisel
60712d12eb UI: 4-column layout for the editor-type selector menu
The list of editor-types is rather long by now, so better to arrange them into
sections.

Original patch by @jeske with updates by @Blendify and myself.
Design Task: T36028
Patch: D3112
2018-03-23 14:28:46 +01:00
8eb8aa4939 Merge branch 'master' into blender2.8 2018-03-23 12:05:55 +01:00
da00a50f7f Merge branch 'master' into blender2.8 2018-03-23 11:56:14 +01:00
7cc2b27099 Cleanup: stray tabs
Tabs in middle of code (mostly for no reason / by accident).
2018-03-23 11:51:19 +01:00
f2f32c81d4 Cleanup: doxy header, line length 2018-03-23 11:28:25 +01:00
72c43e0285 Cleanup: move image undo into own file 2018-03-23 09:15:23 +01:00
Julian Eisel
529c21acc2 Fix issues with confirmation prompt on Windows
* Pressing "OK" wouldn't close Blender anymore
* Using File -> Quit would use popup version, not OS native window

Cleaned up code a bit to avoid duplicated logic.
2018-03-23 02:00:14 +01:00
Julian Eisel
aeec19d2e7 Fix own mistake from 4cb4556fa5
Trying to close Blender from a second window wouldn't work, the first window
would have to be hovered first. Ouch!
2018-03-22 23:52:38 +01:00
Julian Eisel
a4ea46ffc5 Fix memory leaks when doing "Save & Quit"
Steps to reproduce were:
* Open Blender (no need for factory settings, "Promt Quit" needs to be enabled)
* Edit the file (e.g. translate some object)
* Quit Blender but don't skip quit promt
* Press "Save & Quit"
* Save the file

Not sure if Windows supports the "Save & Quit" behavior, so this may not have
applied to Windows.
2018-03-22 23:29:48 +01:00
Julian Eisel
4cb4556fa5 Fix T48027: Memory leaks when exiting Blender from menu
You only had to close Blender through File -> Quit.

Leaks happened because WM_exit() was called from within operator, UI wasn't able
to free some of it's heap data then. This data was the handler added in
uiTemplateRunningJobs() and the IDProperty group added in uiItemFullO_ptr_ex().
There was obviously a general design issue which only became visible in this
specific case.

We now delay the WM_exit call by wrapping it into a handler that gets registered
as usual. I didn't see a better way to do this, all tricks done in
ui_apply_but_funcs_after() to prevent leaks didn't work here. In fact they may
be redundant now, but am not brave enough to try ;)
2018-03-22 23:25:28 +01:00
2ee4e9761f GPUCompositing: Remove last reference to gpu_shader_fullscreen_vert.glsl
It was breaking compilation with MSVC apparently.
2018-03-22 22:39:24 +01:00
150ad2238c PyDocs: Fix link syntax 2018-03-22 16:38:53 -04:00
0080878d67 Merge branch 'master' into blender2.8 2018-03-22 19:21:36 +01:00
897a21e6a3 Glog: Restore some custom config for MSVC2015 2018-03-22 17:48:36 +01:00
4486eddfaa GLog: Tweak settings according to our config
We do have gflags.
2018-03-22 17:32:51 +01:00
c9e7e1987b Glog: Workaround mess around windows and non-windows headers
Seems we can not use include directories order trick, since
files are included form inside ".." string, which forces current
directory to be checked first.
2018-03-22 17:26:02 +01:00
9f45f1a6b7 GFlags: Fix usage of unused attribute 2018-03-22 17:19:56 +01:00
2a4c40f4b9 Glog: Attempt to fix compilation error on Windows
Ideally it should be possible without hacking into sources files
of Glog itself.
2018-03-22 17:02:16 +01:00
0bce7186f7 Glog: Restore haiko OS 2018-03-22 16:58:23 +01:00
27d9863fa5 Fix T54172: Avoid jumping panel length during playback 2018-03-22 11:42:35 -04:00
18e2a5df1a Merge branch 'master' into blender2.8 2018-03-22 16:41:37 +01:00
69b327d8dc Depsgraph: Report new depsgraph evaluation time
Timing is printed to the console when running with --debug-depsgraph-time.
2018-03-22 16:40:32 +01:00
d554b8a748 UI: skip confirmation menu on quit prompt to save 2018-03-22 16:24:14 +01:00
47acd706fd GPUCompositing: Remove entire module.
This module has no use now with the new DrawManager and DrawEngines and it
is using deprecated paths.

Moving gpu_shader_fullscreen_vert.glsl
to draw/modes/shaders/common_fullscreen_vert.glsl
2018-03-22 16:11:49 +01:00
161393805f Update Google libraries
This commit updates:

- gflags 2.2.0 -> 2.2.1
- glog 0.3.4 -> 0.3.4
- gmock 1.7.0 -> 1.8.0
- gtest 1.7.0 -> 1.8.0
2018-03-22 16:10:08 +01:00
cfe43f8d1a Fix T54360: FFMPEG bitrate not editable for all codecs
The bitrate selection was hidden when a CRF mode was chosen and then
switched to a codec that doesn't support CRF.
2018-03-22 14:47:22 +01:00
e35f964daa Cleanup: Use more python way of checking boolean 2018-03-22 09:33:15 +01:00
865fbe343a Fix T54348: Bone dissolve gives invalid hierarchy
Disconnected bones weren't handled correctly.
2018-03-22 07:50:58 +01:00
ce51066e47 Fix bone dissolve using wrong envelope radius
Also correctly copy bone tip selection when dissolving.
2018-03-22 07:50:03 +01:00
6939523a15 Fix T54203: crash changing engine w/ project-paint 2018-03-21 16:51:56 +01:00
a6914d8f33 Eevee: Fix missing camera animation with CoW 2018-03-21 16:39:00 +01:00
5c08d17423 Draw manager: Fix missing active camera triangle with CoW 2018-03-21 16:31:10 +01:00
d33d6d0e06 GHOST CONTEXTWGL: Remove unused member
No longer used from this commit: https://developer.blender.org/rB0940e89e604d85d717f792b73e30e5e96a42e7c6#change-kg3gZvqkYPB6
2018-03-21 12:30:36 -03:00
69eb452622 Merge branch 'master' into blender2.8 2018-03-21 16:27:48 +01:00
3ea8710b9d Depsgraph: Remove redundant operation nodes
Rather a mistake since previous merge.
2018-03-21 16:12:36 +01:00
5ba5254ec1 UI: Optional prompt to quit for non win32 systems
D566 by @januz

Use Blender native dialog when OS dialog's aren't supported.
2018-03-21 16:04:01 +01:00
75c6119dc9 Fix: GWN Indexbuf creation was replacing the index buff bound to the last VAO
This led to problems such as the drawing of the navigate manipulator.
More details in the code comments.
2018-03-21 11:55:38 -03:00
cac2415d82 Merge branch 'master' into blender2.8 2018-03-21 12:47:13 +01:00
23ffd4ec39 Tracking: Make object created form tracks active and selected 2018-03-21 12:33:04 +01:00
658fb7f453 Tracking: Warn when no tracks are selected when creating mesh
Makes it more clear why mesh was not created this way.

Fixes T54368: 3D markers to mesh In MovieClipEditor Not working.
2018-03-21 12:30:50 +01:00
1e43665a39 Fix T54378: Drivers fail with property from empty
Empties were missing Parameters component.
2018-03-21 12:17:51 +01:00
f3efa2526d Fix T54366: Custom manipulator acts on linked data 2018-03-21 07:26:58 +01:00
Julian Eisel
7701f9e35c Fix crash when changing workspaces
Steps to reproduce were:
* Append a workspace (via '+' icon) - make sure its from the default workspaces.blend
* Activate it
* Should crash

Was accessing data from view-layer which wasn't updated yet (and thus could be
NULL). Crash occured after rB8153f89518b4a.

@campbellbarton, you may want to check if all object-mode stuff still works as
expected, not sure what's the state of it.
2018-03-20 23:31:44 +01:00
Dalai Felinto
89aa4b1604 Link and expand overrides for collections
This code was neglected. Yet it is needed for when we support datablock
overrides so that the ID pointers are properly linked and expanded.
2018-03-20 14:48:54 -03:00
504319239a Cleanup: remove useless static override reference pointer from ID struct. 2018-03-20 18:12:45 +01:00
410410f57b Add basic read-only RNA access to static override data.
Will make investigating issues much, much easier!
2018-03-20 18:12:45 +01:00
8a94a82934 Fix broken tatic verride detection in RNA collections.
We have to check all items of a collection when we want to create
overrides as needed...
2018-03-20 18:12:45 +01:00
d03223850e Fix build error on Windows 32 bit. 2018-03-20 17:11:14 +01:00
e0388bc61a Merge branch 'master' into blender2.8 2018-03-20 16:55:16 +01:00
69e35429bf Remove debug only code from previous commit 2018-03-20 16:54:50 +01:00
a5bb918392 Memory allocator: Clarify consistency check function
Also make it to return truth when everything is good and
false otherwise.
2018-03-20 16:51:33 +01:00
ebbb55dd80 Depsgraph: Fix memory leak when datablock is not reused
It is possible that datablock will not be re-used for the new
dependency graph building. Freeing function was freeing all
the nested pointers of databnlock, but not datablock memory
itself.
2018-03-20 16:07:27 +01:00
c188ab7b67 Depsgraph: Prevent non-expandable datablocks from being freed
This avoids original image datablock destruction when using
copy on write.
2018-03-20 16:07:27 +01:00
4f97f58513 MSVC: Fix lite build.
MSVC still defines __cplusplus as 199711L until it's in full conformance with the newer c++ standards, however the things we need from the standard are fully supported, hence a check for the msvc version was needed.
2018-03-20 08:26:11 -06:00
cdf0df10a6 DRW: Fix bound_ubo_slots allocation size. 2018-03-20 15:16:10 +01:00
8a9be95cfb DRW: Fix ubo binding code. 2018-03-20 15:08:23 +01:00
09c88fed1f Fixed: cache clearing when using multiple Alembic files. 2018-03-20 12:54:48 +01:00
1782abf6e2 Fix BLI_assert for MSVC
Also use `_BLI_ASSERT` prefix for internal defines.
2018-03-20 11:56:11 +01:00
04b8b1a167 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/library_query.c
2018-03-20 11:33:59 +01:00
60ff803998 Fix missing ID pointer handling in materials in ID remapping code. 2018-03-20 11:32:16 +01:00
46a391b668 Fix missing array duplication when copying material
Texture paint slots were copied as a pointer, causing double-free.
2018-03-20 11:22:47 +01:00
1662c514c0 Cleanup: unused variables
Missed in own recent changes.
2018-03-20 08:03:58 +01:00
c8a7c4f245 Merge branch 'master' into blender2.8 2018-03-20 16:13:37 +13:00
8e5c407fc4 Fix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined functions
ERROR: blenlib/intern/math_base_inline.c:371 - '__func__' : undeclared identifier (C:\blenderdev\master2\blender\source\blender\editors\lattice\editlattice_tools.c)  [C2065]
2018-03-20 16:03:43 +13:00
Bogdan Nagirniak
b65933e7b3 Fix T54019: copying and linking bugs with custom ID pointer properties. 2018-03-19 22:14:02 +01:00
84536d1d3c GPU Bufferes: Small optimization when updating buffers
With the API recently added to gawain, it is now possible to update the vbos linked to the batch.
So the batch does not have to be destroyed.
The optimization is more sensitive when sculpt is made on low poly meshs
2018-03-19 18:09:00 -03:00
Matthias Ellerbeck
8ecf35d850 Fix T54240: automatic node link moving should take into account type.
Without this a "Clearcoat" link could be moved to "Clearcoat Normal"
for example, which doesn't make much sense.

Differential Revision: https://developer.blender.org/D3105
2018-03-19 21:52:49 +01:00
148b0fef09 Fix T54317: overlapping volume render bug after recent changes.
Increasing the samplig dimensions like this is not optimal, I'm looking
into some deeper changes to reuse the random number and change the RR
probabilities, but this should fix the bug for now.
2018-03-19 21:22:15 +01:00
fddb4dee8a Fix T54356: volume rendering bug using just color attribute. 2018-03-19 21:22:15 +01:00
254bb922e8 Cleanup: avoid passing bContext to particle API
Also add EvaluationContext to PEData
2018-03-19 19:04:50 +01:00
402486ea7b Merge branch 'master' into blender2.8 2018-03-19 18:18:49 +01:00
b8eca8e07d Cleanup: use utility header for particle looping 2018-03-19 18:18:04 +01:00
5e81d993af Merge branch 'master' into blender2.8 2018-03-19 18:14:05 +01:00
a3486e735f Cleanup: move particle undo into own file
Also avoid extern declarations which can get out of sync.
2018-03-19 17:46:49 +01:00
a5fc0ae150 Cleanup: move armature undo into own file 2018-03-19 17:45:20 +01:00
566f4e06ba Cleanup: move metaball undo into own file 2018-03-19 16:59:34 +01:00
e7ca9d3477 Cleanup: move curve undo into own file 2018-03-19 16:30:53 +01:00
b5bf3011bf GWN: Vertex Buffer: Remove the use of glMapBufferRange
We revert to the malloc/realloc and manually manage the upload.
There seems to be a performance penalty from using glMapBuffer on some
hardware, prefering way is glBufferData(NULL) with glBufferSubData.
2018-03-19 16:13:00 +01:00
c78ebf9f26 Cleanup: split lattice into own library
Was mixed with object functionality.
2018-03-19 15:45:50 +01:00
772e558e92 GWN: Perf: Use unsync glMapBufferRange to prevent sync time. 2018-03-19 14:14:32 +01:00
f2ae7796c3 GWN: Context: Use <unordered_set> instead of <forward_list>
We cannot have duplicates so unordered_set is better suited for this case.

Removing batches is now constant time on average instead of linear.
2018-03-19 14:14:32 +01:00
8859927e6f Merge branch 'master' into blender2.8 2018-03-19 11:17:52 +01:00
342a18287f Cleanup: type conversion warning 2018-03-19 09:12:48 +01:00
7729966af1 Fixed typo Python API
`mathutils.geometry.barycentric_transform` used `tri_a[1-3]` for the
target triangle, but in fact they are `tri_b[1-3]`
2018-03-19 08:19:48 +01:00
e95282e783 Merge branch 'master' into blender2.8 2018-03-18 16:05:02 +01:00
0301df40e5 Fix ugly recursive pattern in RNA PointCache data layout.
PointCache was having a collection of items of PointCache type, having a
collection of items of PointCache type, having...

Nuff said.

For now, chose the 'ugly' way to fix it, that is, the one that changes
nothing to API and scripts using it: we define another 'PointCacheItem'
RNA type for items of our point cache collection, which has exact same
interface as PointCache except for the collection.

This is doomed to be rewritten at some point anyway, not worth spending
time trying to define a really correct data layout for now.
2018-03-18 15:37:23 +01:00
368c581df1 CMake: disable boost for lite builds 2018-03-18 05:10:02 +01:00
2a9f000806 Cleanup: kdopbvh, only set parent nodes once 2018-03-18 05:08:12 +01:00
a51fdd89fd Cleanup: use MEM_SAFE_FREE 2018-03-18 05:08:12 +01:00
2aa0bde3dc mathutils: replace interp w/ blend when standalone 2018-03-18 05:08:12 +01:00
07c90f3a73 build_environment: remove msvc compiler warning from boost.
Even the boost people have given up trying to keep up with the rapid release
of new msvc versions, and have removed the warn for now see: 5ad0730630 (diff-eac863c1d46c77471e54e8818aab7534)
2018-03-17 12:47:17 -06:00
7427e3e501 MSVC: ignore warning c4828 The file contains a character that is illegal.
The only place this warning is coming from is from comments in headers of 3rd party libs. we can safely repress this warning for now.
2018-03-17 12:45:27 -06:00
4a3d94c073 Eevee: Volumetrics: Fix crash when using smoke volumes. 2018-03-17 19:08:14 +01:00
1ed287058d DRW: Fix error in texture binding / unbinding. 2018-03-17 18:48:14 +01:00
c2f36c3558 GWN: Element Buffer: Refactor / Optimisation.
- Upload the data to the GPU directly when creating the element buffer in
   GWN_indexbuf_build_in_place().

 - Convert data in place when squeezing the indices and removing the need
   for another allocation.

 - GWN_indexbuf_build_in_place() can be used with already used element
   buffers and reupload their data without changing vbo id (keeping vaos
   up to date).
2018-03-17 18:23:04 +01:00
87d88581aa GWN: Vertex Buffer refactor.
We now alloc a vbo id on creation and let OpenGL manage its memory directly.
We use glMapBuffer to get this memory location.

This enables us to reuse and modify any vertex buffer directly without
destroying it with its associated Batches.

This commit does not really improve performance but will let us implement
more optimizations in the future.

We can also resize the buffer even if this can be slow if we need to keep
the existing data.

The addition of the usage hint makes dynamic buffers not a special case
anymore, simplifying things a bit.
2018-03-17 17:02:07 +01:00
dd44248219 DRW: Move cache time to GPUViewport for profiling
This enables us to average this timer over time like the others.
2018-03-17 17:02:07 +01:00
9ed7093aa6 Merge branch 'master' into blender2.8 2018-03-17 14:24:06 +01:00
64fbd50e4c Refactor: Collada: remove param, changed order of params in Function call
* In the Collada Module parameters are typically ordered
  in a similar way. I changed this to:

    extern std::string get_joint_id(Object *ob, Bone *bone);

* The Object parameter was not used in get_joint_sid().
  I changed this to:

	extern std::string get_joint_sid(Bone *bone);
2018-03-17 14:16:19 +01:00
dc08df659e Merge branch 'master' into blender2.8 2018-03-16 17:50:07 +01:00
e15591a1d7 Fix (unreported) a broken 'RNA diff collection' case.
When a name property is defined for collection's struct, but no name is
actually set, we want to also fallback to index case. We cannot handle
empty names to address items of a collection!
2018-03-16 17:49:54 +01:00
c722fd2184 Some more minor cleanups. 2018-03-16 17:49:54 +01:00
5389964eea Add an assert to BKE_icon_changed() that we are actually dealing with ID icon.
Otherwise, ID->obj is an opaque pointer, wrong usage here could lead to
a vast amount of bad things.
2018-03-16 17:17:19 +01:00
1a71d5ae85 Fix T54310: Assert when enable Brush custom icon.
We had a mix of two issues here actually:
* First, Brush are currently using their own sauce for custom previews,
this is not great, but moving them to use common ImagePreview system of
IDs is a low-priority TODO. For now, they should totally ignore their
own ImagePreview.
* Second, BKE_icon_changed() would systematically create a PreviewImage
for ID types supporting it, which does not really makes sense, this
function is merely here to 'tag' previews as outdated. Actual creation
of previews is deferred to later, when we actually need them.
2018-03-16 17:06:43 +01:00
67e2806dcb Cleanup: naming and const parameter. 2018-03-16 16:44:23 +01:00
36e7de9eb3 Merge branch 'master' into blender2.8 2018-03-16 12:26:37 +01:00
da4efaeb87 Depsgraph: Support colored addresses in debug prints
Enabled with --debug-depsgraph-pretty, only works with ANSI terminals.

Thanks Bastien for review!
2018-03-16 12:24:51 +01:00
295d8510af Add Truecolor ANSI console constants
They are used to start and end colored output in console.
Use with care, it is up to you to check that console actually
supports Truecolor ANSII.

In thew future we can extend this to other consoles and platforms.
2018-03-16 12:16:29 +01:00
f0596bf660 Hash: Add utility function to convert address to rgb values
Some magic hashing, will become handy to make debug messages
easier to follow.
2018-03-16 12:11:55 +01:00
5baf0de6e7 Merge branch 'master' into blender2.8 2018-03-16 11:24:41 +01:00
3baf31e73a Depsgraph: Move evaluation debug prints to depsgraph
This way we can easily control format and keep it consistent.

And also possibly do other trickery, like coloring addresses!
2018-03-16 11:14:38 +01:00
5de9c8f6f0 Cleanup: move mesh mirror functions to own file 2018-03-17 00:55:11 +11:00
ee0697e50b Cleanup: doxy sections for editmesh files. 2018-03-17 00:55:11 +11:00
7e954d974a GWN: Uncomment a (now) usefull assert 2018-03-16 08:50:31 +01:00
53f8c47c49 Eevee: Add warning comment about ubo/texture persistence.
More info on bindings persistence here :
8a692da7f81d8b0798f4aeebaa4a1123693fc279
2018-03-16 08:50:31 +01:00
2cfcffb057 Clay: Small cleanup.
Use persistent binds for the texture and UBOs.
Remove use of stencil.
2018-03-16 08:50:31 +01:00
93e26cb770 DRW: Fix/refactor UBO & Texture binding.
Previous approach was not clear enough and caused problems.
UBOs were taking slots and not release them after a shading group even
if this UBO was only for this Shading Group (notably the nodetree ubo,
since we now share the same GPUShader for identical trees).

So I choose to have a better defined approach:
- Standard texture and ubo calls are assured to be valid for the shgrp
they are called from.
- (new) Persistent texture and ubo calls are assured to be valid accross
shgrps unless the shader changes.

The standards calls are still valids for the next shgrp but are not assured
to be so if this new shgrp binds a new texture.

This enables some optimisations by not adding redundant texture and ubo
binds.
2018-03-16 08:50:31 +01:00
43d0943141 Merge branch 'master' into blender2.8 2018-03-17 01:43:19 +11:00
2816694b05 Code cleanup: fix various compiler warnings on clang/macOS. 2018-03-16 05:08:56 +01:00
3692a2bcb3 Merge branch 'master' into blender2.8 2018-03-16 04:35:37 +01:00
e5327afcb7 Fix T54326: Import Alembic stuck in edit mode
Switch to object mode before doing the import.
2018-03-16 04:06:34 +01:00
Cheryl Chen
07b07e53ea Fix T53971: single layer render showing the wrong render layer in image editor.
Original patch Cheryl Chen, extra fixes by Brecht.

Differential Revision: https://developer.blender.org/D3098
2018-03-16 00:58:10 +01:00
Guillaume Chereau
e56fd59f22 Code refactor: move OIIO image buffer writing outside session, into callback.
Original patch by Guillaume, modifications by Brecht.

Differential Revision: https://developer.blender.org/D3102
2018-03-15 23:05:16 +01:00
41149ca134 GHOST: Support Unity taskbar progress API
Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3106
2018-03-15 22:49:56 +01:00
995ccf8168 BLI_assert: extract from BLI_utildefines
BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.
2018-03-16 06:03:29 +11:00
cca1e1b707 UV/Image Editor: Optimize UV Drawing
Use batchs to store the entire buffer of loops before drawing.
These batchs can be stored in the mesh draw cache later.
2018-03-15 13:36:16 -03:00
709ffd94ee Depsgraph: Fix missing shader updates with copy on write
Basically, don't do full in-place copy of node tree datablock if it's
already expanded. Current way how node tree is evaluated is fully
built around the idea that evaluation copies values from original
to copied datablocks.

Changing links is handled on another level.
2018-03-15 15:21:07 +01:00
1816d1f992 Mesh: Batch cache: Fix sculpt update issue.
Old solution was to create a new vbo and copy it to the location of
the old vbo hoping for the batches to update their vaos before drawing.

The issue is that the new VAO caching is not updating the VAOs at all
unless the shader interface changes.

So unless we expand gawain to support updating of vertex buffers (in a
better way than the current "dynamic" buffer) we need to delete every batch
linked to the vbo we want to recreate.

This solution might have performance implications.
2018-03-15 13:58:25 +01:00
a769cae241 GWN: Fix compilation error without VRAM_USAGE flag. 2018-03-15 13:58:25 +01:00
8d36629b4b Merge branch 'master' into blender2.8 2018-03-16 06:11:35 +11:00
d7a8a864ed Minor cleanup & commenting. 2018-03-15 09:44:16 +01:00
316ccc4a6e GHOST: Fix wrong usage of wglCreatePbufferARB.
Last argument must be a pointer to list of int terminated by a value of 0.
2018-03-15 01:51:46 +01:00
71139cedcb Missed last commit 2018-03-15 11:16:32 +11:00
e55c29b4ec BLI_math: don't use asserts in inline API
Requires BLI_utildefines.h to be included first,
(already noted in other inline code).

Possible alternative could be to move BLI_assert into own header.
2018-03-15 11:12:10 +11:00
6fa4001824 GWN: Batch: Perf: Comment out glBindVertexArray(0)
Even if they are for safety they are not free to use !

On my system (Mesa + AMD Vega GPU) calling:
glBindVertexArray(1);
glDrawArrays(GL_TRIANGLES, 0, 3);
glBindVertexArray(0);
in a loop, shows the same overhead as a full vao switching (which is more
or less 10 times slower than just calling glDrawArrays)

Moreover, now that we use OpenGL 3.3 binding a VAO is REQUIRED to issue a
drawcall so it is garanted to be overwritten before the next drawcall.
Problem can only happen if someone draws directly with opengl commands.
2018-03-14 22:44:27 +01:00
75de653e4d GWN: Batch: Only revert to default Vao when needed.
Drawing ranges via glDrawArrays is already supported and should not need
a manual offset in the VAO like glDrawArraysInstanced or glDrawElements.
2018-03-14 22:44:27 +01:00
4ecc8b6786 GWN: Add primitive restart in element/index buffers.
This allows to draw multiple primitive of the type
GWN_PRIM_LINE_STRIP
GWN_PRIM_LINE_LOOP
GWN_PRIM_TRI_STRIP
GWN_PRIM_TRI_FAN
GWN_PRIM_LINE_STRIP_ADJ
with only one drawcall. This should speed up some areas that are really
sensitive to drawcall counts : UV drawing, Hair drawing...
2018-03-14 22:44:27 +01:00
2c80a4d4aa Fix T54322: partial redraw not working after recent refactor. 2018-03-14 20:39:10 +01:00
9009622b54 Merge branch 'master' into blender2.8 2018-03-14 18:10:31 +01:00
b0823962e9 Style cleanup. 2018-03-14 18:05:09 +01:00
d34b1b35bf Fix (unreported) broken IDarray case in IDP_EqualsProperties_ex.
For IDProps IDarray, IDP_EqualsProperties was called for each item,
instead of IDP_EqualsProperties_ex, discarding value of `is_strict`
option.

Probably not an issue with current code, though.
2018-03-14 17:53:29 +01:00
d0055155e8 Fix T54319: Crash after double-clicking baked F-curve 2018-03-14 16:02:46 +01:00
342593f124 Cleanup: rename BLI_array_count -> len
Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.
2018-03-15 01:53:20 +11:00
9521b67ac0 Depsgraph: Fix missing updates with drivers
The issue was only visible with copy-on-write enabled, and related to the
fact, that dependency graph builder binds original FCurves.

For now use smallest patch possible to make things to work and to make
draguu happy.

Need to think of a smarter way to deal with drivers, bones and view layers.
2018-03-14 15:21:31 +01:00
5c30121b8c Clay: Add FXAA.
I tried to use real multisampling but the main problem is the outline detection that needs to have matching depth samples.

So adding FXAA instead. Always on for now, may add a parameter for it later.

One thing to note is that we need to copy the final output once again to the main color buffer because we cannot swap the dtxl textures (they can be referenced elsewhere like GPUOffscreen).

We could improve upon this and add TAA on top if viewport is still.
2018-03-14 14:55:36 +01:00
3530ee2949 GPUViewport: Fix offscreen multisample syncing. 2018-03-14 12:55:19 +01:00
b4209b138f Clay: Refactor: Port clay to a deferred pipeline.
This means that rendering clay with AO only needs 1 geometry pass.
Thus greatly improving performance of poly heavy scene.

This also fix a self shadow issue in the AO, making low sample count
way better.

We also do not need to blit the depth anymore since we
are doing a fullscreen shading pass.

The constant cost of running the a deferred shading pass is negligeable.
This include quite a bit of code cleanup inside clay_engine.c.

The deferred pipeline is only enabled if at least one material needs it.
Multisampling is not supported yet.

Small hacks when doing deferred:
- We invert the normal before encoding it for precision.
- We put the facing direction into the sign of the mat_id.
- We dither the normal to fight the low bitdepth artifacts of the normal
  buffer (which is 8bits per channel to reduce bandwidth usage).
2018-03-14 12:41:00 +01:00
e22bc559b0 DRW: Add DRW_viewport_invert_size_get for more ease of use. 2018-03-14 12:41:00 +01:00
f7f3b08977 GPUTexture: Unlock GL_R16I format. 2018-03-14 12:41:00 +01:00
Dalai Felinto
e7c3c46e89 Fix make single user crash
How to reproduce the crash:
* Factory startup
* 'u'key (make single user)

It comes with a simple unittest to reproduce the original issue.
2018-03-14 08:13:27 -03:00
59aa8d22ef Cleanup: use flags instead of collection of bools to get RNA override status. 2018-03-14 11:47:35 +01:00
c22c2ff060 Updated bpy.props getter/setter example
- The common name in computer science are 'getters' and 'setters', so by
  adding these names to the documentation (while 'get' and 'set are still
  also mentioned) we improve findability. Having 'Getters/Setters' as a
  title also makes it clearer that this example is not just about
  getting or setting the property value.
- Added a little prefix to each printed value, so that print statement,
  expected output, and real output can be matched easier.
2018-03-14 11:42:36 +01:00
b76471c1f9 Fix T54286: bpy.props operator example misses property access
The old example had two downsides:

- It promoted a blocking UI design, where the user is shown a popup
  before actually executing the operator.
- It didn't show how to actually use the property values.

The new code avoids these mistakes. The properties are also shown in the
redo panel in the 3D view.

Note that I also changed the bl_idname, as this is an example about
properties, not about dialogue boxes, and changed the class name to use
the standard operator naming convention.

I also extended the example to include a panel that sets multiple
properties of the operator, since I see questions about this relatively
frequently.
2018-03-14 11:31:14 +01:00
d430d12123 Merge branch 'master' into blender2.8 2018-03-14 18:08:37 +11:00
8803c5ca5d Cleanup: use sections for editmesh tools/select 2018-03-14 17:54:45 +11:00
7314904a77 Eevee: Fix sequencer rendering.
Sequencer rendering can use multisample render targets. Be sure to sync
thoses after rendering.

Also disable the sample loop when not needed.

Do note that currently the color correction is broken with the sequencer.
2018-03-14 03:29:10 +01:00
f5d529b8e2 GPUViewport: Fix offscreen multisample rendering.
Multisample rendering needs to have both a multisample and a regular color/depth target for engines that does not support MSAA.
2018-03-14 03:29:10 +01:00
bba3b43112 GPUTexture: Save sample count inside texture struct.
This adds a quick way to know if a texture is a multisample texture and its sample count.
2018-03-14 03:29:10 +01:00
c1694540c3 API generating script: give better version for releases builds.
Was giving '2.62.1 <sha1>' even for releases, now rather giving nicer
'2.62a <sha1>' in that case.
2018-03-13 19:49:39 +01:00
585208e0e9 Merge branch 'master' into blender2.8 2018-03-14 02:15:37 +11:00
be25a0faa7 Cleanup: pass selectmode directly
Pass instead of editmesh or toolsettings.
Needed for multi edit-mode
2018-03-14 02:08:29 +11:00
bf8f5f5142 Cleanup: doxygen comments 2018-03-14 02:08:07 +11:00
c99c45a1e3 Fix (unreported) crash when changing active shapekey in Edit mode.
Looks like someone changed the signature of some RNA update callback,
and for some reason that 'change skey' update function was not updated
(or later got merged from master)...

We'll need RNA to check for its func signatures, some day...
2018-03-13 14:08:17 +01:00
81c199af83 Fix T54302 - Wrong added scene when adding a scene strip to the Sequencer
When adding scene strips to the sequencer, the wrong scenes were
getting getting added if some were skipped. For example:
Given 4 scenes (A, B, C, D) if you're trying to add the last 3 scenes
(B, C, D) as strips to the first scene (A), it would ended up adding
"A, B, C" instead of "B, C, D" as expected.

Fix provided by Andrew (signal9).
2018-03-13 23:05:57 +13:00
e0bb5109b3 Use Action datablock's own icon (instead of Animation Data's one) for File Browser's lib icons 2018-03-13 23:05:57 +13:00
028580fd1e Merge branch 'master' into blender2.8 2018-03-13 18:39:51 +11:00
3106f18176 Cleanup: long lines, use doxy sections 2018-03-13 18:07:10 +11:00
ce08d0681b Eevee: Render: Add Info messages. 2018-03-13 04:25:50 +01:00
266cdf955e Eevee: Render: Allow cancel during probe update. 2018-03-13 03:58:27 +01:00
0f1d7a5796 Eevee: Render: Fix softlock if rendering before lazy shader compil ends.
Calling the rendering operator seems to kill any other WM_job running, leaving
uncompiled materials into a GPU_MAT_QUEUED state. This then made the probe update
looping indefinitely (all_materials_updated remaining to false).

To fix this, we resume compilation for materials that are in this state.
Cancelling Render before all material compilation could make certain material
remain uncompiled. Fortunately, this is not allowed as of now.
2018-03-13 03:58:00 +01:00
0acccda4a4 GPUMaterial: Fix non finished material status if shader has no output.
This wasn't producing any issue for now but it's better to make things clean.
2018-03-13 03:49:04 +01:00
8b399d3148 Eevee: Fix temporal sampling not resetting.
World Probe update was not resetting the TAA.

This also reset the volume sampling in cases that needs it (world/grid probe diffuse coefs update).
2018-03-13 01:35:16 +01:00
a3f4de64e5 Eevee: Fix bad Outlines after probe updates.
This was because the default matrices were not setup back after resetting the current TAA sample.
2018-03-13 01:24:51 +01:00
17793a66c6 Fix T54299: crash rendering objects with motion blur disabled, after recent changes. 2018-03-12 17:37:29 +01:00
733b9e4f99 Merge branch 'master' into blender2.8 2018-03-12 17:31:46 +01:00
44aa86b0a5 Cycles: reorganize tests in more evenly distributed groups. 2018-03-12 17:29:44 +01:00
e07dd9fd59 Cycles: add constant folding to displacement nodes. 2018-03-12 17:29:44 +01:00
629d44e049 Fix type in comment 2018-03-12 17:03:54 +01:00
a752bc148e Depsgraph: Make timing profile a command line option
This way we can add even more statistics, even one which will be print
to the console.

Would be nice if we also have verbosity level control.
2018-03-12 17:01:02 +01:00
815852e950 Fix T54296: Cycles viewport render stuck on constant re-render
Need Clear ID recalc flag on load. Otherwise it's possible to have
some IDs considered always updated by Cycles, when they were saved
in a tagged-for-update state.

Thanks Bastien for feedback and review!
2018-03-12 10:58:12 +01:00
8f4579affd Merge branch 'master' into 28 2018-03-12 16:38:41 +11:00
da62507bc8 Cleanup: remove misleading array size 2018-03-12 16:37:26 +11:00
d75456196f Cleanup: typo 2018-03-12 16:35:31 +11:00
ba01cdc770 Merge branch 'master' into blender2.8 2018-03-12 15:01:22 +11:00
25502a9bdc Cleanup: sync EDBM_uv_* functions w/ 2.8
They're nearly the same, so keep names matching to avoid conflicts.
2018-03-12 14:51:45 +11:00
1d0077649d Merge branch 'master' into blender2.8 2018-03-12 14:25:20 +11:00
1966924467 UV: internal changes to picking
Nothing user visible, only things needed for multi-object support,
making picking functions more flexible too.

- Support passing in an initialized hit-struct,
  so it's possible to do multiple nearest calls on the same hit data.
- Replace manhattan distance w/ squared distance
  so they can be compared.
- Return success to detect changes to a hit-data
  which might already be initialized (also more readable).
2018-03-12 13:57:38 +11:00
3a6f26c087 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-03-11 23:47:08 +01:00
ddae05cdca Merge remote-tracking branch 'origin' into blender2.8 2018-03-11 23:45:53 +01:00
7fed3ad32b GPUImage: Add back garbage collection for the new viewport pipeline. 2018-03-11 23:44:10 +01:00
765d7242d5 GPUMaterial: Add Material shader cache.
This is mostly to avoid re-compilation when using undo/redo operators.
This also has the benefit to reuse the same GPUShader for multiple materials using the same nodetree configuration.

The cache stores GPUPasses that already contains the shader code and a hash to test for matches.
We use refcounts to know when a GPUPass is not used anymore.

I had to move the GPUInput list from GPUPass to GPUMaterial because it's containing references to the material nodetree and cannot be reused.

A garbage collection is hardcoded to run every 60 seconds to free every unused GPUPass.
2018-03-11 23:44:10 +01:00
7194259fb1 Eevee: SSS: Fix compilation error. 2018-03-11 23:44:10 +01:00
2c9c22df26 fix Collada: wrong usage of pointer and hidden redeclaration
* Suspicious usage of pointer:

  short *type = 0; // this creates a null pointer

When this is later used for anything then blender would crash.
After following the code and check what happens i strongly believe
the author wanted to use a short and not a pointer to a short here.

* local variable where reused later in same function
While this did no harm, i still felt it was better to use a different
name here to make things more separated:

- moved variable declaraiotns into loop (for int a=0; ...)
- renamed uv_images to uv_image_set
- renamed index variable from i to j in inner loop that
  reused same index name from outer loop
2018-03-11 20:59:50 +01:00
49a7cd1ba4 Cleanup Collada: Removed duplicate variable setting 2018-03-11 20:59:50 +01:00
7952ece01b Cleanup: avoid redeclaration of iterator in same function
The iterator was redeclared 3 times. I fixed this to avoid future issues.
I commit separately because so the changes are less cluttered all over
the place.
2018-03-11 20:59:49 +01:00
a2cc85b264 Cleanup Collada: Avoid unintentional reuse of previous defined variable
The variable child was redeclared multiple times in the same function.
While this has not created any issues i still changed this to avoid
confusion and keep the usage of the variables more local.
2018-03-11 20:59:49 +01:00
ca11ef7fd3 Fix Collada: Avoid unnecessary and even wrong check on unavailable data
The function validateConstraints() potentially causes a null pointer
exception. I changed this so that the function returns a failure as soon
as the validation fails. This avoids falling into the null pointer trap.
2018-03-11 20:59:49 +01:00
2de0daa179 Cleanup Collada: Make sure index variables are not reused
The variables i and j have been declared before in the same function.
I changed the names to mi and mj to keep things clear.
2018-03-11 20:59:49 +01:00
86b1887ded Cleanup Collada: make sure float array is initialised
This is just to silence a compiler warning and keeping
the code clean. The actual code never uses uninitialised
array elements.
2018-03-11 20:59:49 +01:00
01c27faed0 Refactor Collada: combined 2 almost identical functions into one
The 2 methods add_bezt() and create_bezt() do almost the same.
I combined them both into add_bezt() and added the optional parameter
eBezTriple_Interpolation ipo
2018-03-11 20:59:48 +01:00
3eaa408cb3 Fix T54274, and rename option --window-borderless to --window-fullscreen 2018-03-11 12:26:43 +02:00
7ecc7c46af Merge branch 'master' into blender2.8 2018-03-11 16:11:56 +11:00
63483fe417 Cleanup: long lines 2018-03-11 15:50:25 +11:00
93e0e716f3 Merge branch 'master' into blender2.8 2018-03-10 19:06:28 +01:00
23ccf5767f Cycles: add roughness baking support, using squared roughness convention. 2018-03-10 18:37:33 +01:00
7613ffc944 Cycles: switch to squared roughness convention for all nodes.
This was already done for the Principled BSDF to be compatible with typical
baked roughness maps in PBR workflows.
2018-03-10 18:05:01 +01:00
d27158aae9 Merge branch 'master' into blender2.8 2018-03-10 06:55:39 +01:00
8a76f8dac3 Code cleanup: fix compiler warning. 2018-03-10 06:51:52 +01:00
1f5c5fa189 Fix T54279: viewport update bug with volume meshes.
Meshes without vertex normals were not handled correctly.
2018-03-10 06:27:19 +01:00
3f2b88d195 Code refactor: reduce number of loops over meshes. 2018-03-10 06:27:19 +01:00
07d0a87b5c Fix T54278: volume artifacts with small density and color after recent changes. 2018-03-10 06:27:19 +01:00
50dde3d01a Fix T54269: saved EXR file files unreadable some editors in Blender.
Don't write the multichannel metadata when there is only a single layer,
and don't unnecessarily consider single layer images with Blender metadata
as multi layer.
2018-03-10 06:27:19 +01:00
d526b35ce2 Code cleanup: use spaces for aligned indentation. 2018-03-10 06:27:19 +01:00
db333d9ea4 Cycles: support arbitrary number of motion blur steps for objects. 2018-03-10 06:27:19 +01:00
78c2063685 Cycles: support arbitrary number of motion blur steps for cameras. 2018-03-10 06:27:19 +01:00
267d892326 Code refactor: motion blur cleanups, preparing for next commit. 2018-03-10 04:54:05 +01:00
6c4ddfc5d9 Code refactor: don't expose UpdateObjectTransformState in header. 2018-03-10 04:54:05 +01:00
b66efbecf4 Code refactor: make Transform always affine, dropping last row.
This save a little memory and copying in the kernel by storing only a 4x3
matrix instead of a 4x4 matrix. We already did this in a few places, and
those don't need to be special exceptions anymore now.
2018-03-10 04:54:05 +01:00
623141f339 Code refactor: add DecomposedTransform.
This is in preparation of making Transform affine only, and also gives us
a little extra type safety so we don't accidentally treat it as a regular
4x4 matrix.
2018-03-10 04:54:05 +01:00
516e82a900 Code refactor: add ProjectionTransform separate from regular Transform.
This is in preparation of making Transform affine only.
2018-03-10 04:54:04 +01:00
cd15d87bfc Code refactor: avoid motion transform copy, remove unused curved code.
The purpose of the previous code refactoring is to make the code more readable,
but combined with this change benchmarks also render about 2-3% faster with an
NVIDIA Titan Xp.
2018-03-10 04:54:04 +01:00
Stefan Werner
f3010e98c3 Code refactor: use KernelShader and KernelParticle instead of float arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
fa9175ff02 Code refactor: use KernelLight instead of float4 arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
f66ff4ee86 Code refactor: use KernelOject struct instead of float4 array.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
f3161bd2ab Eevee: Planar Reflections: Fix corrupted results in downsampling step.
It only seems to happen in some drivers/gpu, the vertices gets culled if 4th component is 0.0. So lesson learned: always use 1.0 if constant.
2018-03-10 02:18:25 +01:00
92c2e2f386 Eevee: Planar Reflection: Add refraction support for reflected objects. 2018-03-10 02:18:25 +01:00
4f55ee5a3c Eevee: Add new clipping UBO.
This fixes problems with the planar reflections.
2018-03-10 02:18:25 +01:00
82957cfec8 Eevee: Make use of the new view matrix UBO. 2018-03-10 02:18:25 +01:00
41abbc271c DRW: Change UBOs binding logic.
Use the same logic than textures. Also reset bindings only on shader changes.
2018-03-10 02:18:25 +01:00
dfd8a52cd2 DRW: Change clip planes API.
The draw manager now just set the number of active clip planes. It's now up to the engine to specify the plane equations as uniform/ubo/constant.
2018-03-10 02:18:25 +01:00
1b8ba6b8b9 DRW: Add assert for uniform that needs valid data. 2018-03-10 02:18:25 +01:00
8444aaaa69 DRW: Put all view-only dependant uniform in a UBO.
This leads to less lookups to the GWNShaderInterface and less uniform upload.

We still keep a legacy path so that Builtin uniforms can still work. We might restrict this path to Builtin shader only in the future.
2018-03-10 02:18:25 +01:00
4540bd226d Eevee: Probes: Fix last planar reflections remaining after deletion. 2018-03-10 02:18:25 +01:00
13b99b7bbb Eevee: Probes: Add culling for planar probes.
Planar probes that have no influence on pixels in the view are culled.

This greatly improve performance when theses probes are offscreen.
2018-03-10 02:18:25 +01:00
7c31edb385 DRW: Culling: Expose & Add culling functions to engines.
This way engines can do preemptive culling by themselves.
2018-03-10 02:18:25 +01:00
4402633e33 BoundBox: Fix wrong max in BKE_boundbox_alloc_unit. 2018-03-10 02:18:25 +01:00
c962f7ef77 Eevee: Render: Add cancel support
You can now cancel your renders that are too long. This will still output the current status of the render. For example if you cancel at 50% rendering progress, you will have a render result with only half the render samples.
2018-03-10 02:18:25 +01:00
f043365c38 DRW: Culling: Fix precision error.
This was triggering the BLI_assert(fac >= 0.0f);.

Clamp fac to ensure correct value for release builds.
2018-03-10 02:18:25 +01:00
9cd09fee6a Eevee: Planar: Add transparent objects.
The ordering is left broken for the viewport as this can be quite heavy.
Only do it if doing a render.
2018-03-10 02:18:25 +01:00
e697c1da42 Eevee: Planar Probe: Add supersampling jitter.
This also fix a bug with the probe debug display when there was more than 2 probes. ped->probe_id was equal to 0 for all planar probes until the next frame. Resulting in all planar data debug to show probe 0.
2018-03-10 02:18:25 +01:00
Julian Eisel
41b38c5f75 Don't add "Report a Bug" button for official tracker to non-official add-ons
If no custom URL was set, add-ons would get a "Report a Bug" button opening
the default developer.blender.org bug tracker. Now we only add this default
button if the add-on is bundled and not installed by the user.
2018-03-09 21:22:24 +01:00
14e7ba0c8a Fix Pose Lib: pose is applied when selected bones don't overlap with pose
Premise: When pose bones are selected, applying a pose library should
only affect the selected bones.

This commit fixes a bug where the pose was also applied when there was
no overlap between the selected bones and the bones in the pose. For
example, applying a pose which contains only keyframes for the left
hand, while only right-hand bones are selected, would apply the pose
to the left hand anyway.

The code is now also slightly more efficient; the removed 'selcount'
counter was only used as a binary (i.e. zero or non-zero). It's now
stored as a bitflag instead.
2018-03-09 19:03:29 +01:00
c3d7be150b Cleanup: iterator macros
This line was missing in previous commit
2018-03-09 11:00:54 +01:00
d3e14c2e2f Manipulator: disable UV widget, following prefs 2018-03-09 20:44:41 +11:00
40e62f271c FFmpeg: Add regression tests
Currently only covering handful of files from reports about wrong fps detected.

It will need D3083 applied first to get tests passed, also tests themselves
are to be committed to svn.

But there are some python code which needs to be reviewed, like blendfile
passed to run_blender().

Reviewers: sybren, mont29

Reviewed By: sybren, mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D3096
2018-03-09 10:33:20 +01:00
370a2d6917 Fix T53857: Incorrect framerate for videos imported from OBS
This is an issue with which value to trust: fps vs. tbr. They both cam be
somewhat broken. Currently the idea is:

- If file was saved with FFmpeg AND we are decoding with FFmpeg we trust tbr.
- If we are decoding with Libav we use fps (there does not seem to be tbr in
  Libav, unless i'm missing something).
- All other cases we use fps.

Seems to work all good for files from T53857, T54148 and T51153. Ideally we
would need to collect some amount of regression files to make further tweaks
more scientific.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D3083
2018-03-09 10:32:17 +01:00
f47a41a3d9 Cleanup: iterator macros
- put render iterator in own scope
  (would shadow it's own variable if used multiple times).
- enforce semicolon at end of iterator macros.
- no need to typedef one-off macro structs.
2018-03-09 11:52:11 +11:00
9342f55d12 Merge branch 'master' into blender2.8 2018-03-08 17:54:52 +11:00
222a941a2b Merge branch 'master' into blender2.8 2018-03-08 17:47:02 +11:00
ecab7bef69 Cleanup: Rename view3d context set function
Use common prefix so adding related functions share the prefix.
2018-03-08 17:30:24 +11:00
28f86bf117 Cleanup: use edit/active objects from view context
Needed to implement multiple edit-objects.
2018-03-08 17:27:36 +11:00
cb8311fecf Cleanup: set the view-context once 2018-03-08 17:27:36 +11:00
5331581ea4 Cleanup: Use BKE_ prefix for all public functions exposed by the NLA module 2018-03-08 17:15:34 +13:00
7e2100e499 T54233: NLA "Push Down" discards Blend Mode, Extrapolation, and Influence
Each AnimData block has a set of Blend/Extrapolation/Influence settings
that can be used to control how the active action is blended with the
NLA stack. However, these settings were not getting copied over to the
newly created strips (as the push-down code existed long before these
settings were added).

This commit solves this in several ways:
* Active Action Blend/Extrapolation/Influence settings now get copied
  to the new strips when adding them to the NLA stack via Push Down.

  Note: This doesn't happen when there are no existing NLA tracks,
        as these settings don't get used in that case.

* Strip Influence will be copied across when inf < 1.0 (i.e. when a
  non-default value is used), to maintain the effect. To make this work,
  the influence value will get added as a keyframe to the strip's
  "Influence" Control FCurve.

  - See code comments for an alternative approach and why that was not chosen
  - Strip Time still doesn't get keyframes added automatically yet.

* To ensure the "extrapolation mode" settings don't get always overwritten,
  I've put in place a compromise: the extrapolation will only get changed
  if the chosen setting will cause problmes (i.e. hold forward & back -> hold forward
  if there are other tracks before it already).

Not safe for backporting to 2.79[x] stable releases.
2018-03-08 17:15:33 +13:00
fb70f9bf99 Fix crash if NLA strip with "Use Animated Influence" setting is enabled without the Influence Strip F-Curve existing 2018-03-08 17:15:33 +13:00
a5d63624de Cleanup: Fix invalid name prefix 2018-03-08 17:15:32 +13:00
872df463f6 Eevee: Render: Add progress. 2018-03-08 00:09:04 +01:00
70fa15d1b8 Eevee: Save and reset matrixstate for probe rendering. 2018-03-08 00:09:04 +01:00
45ec962f68 DRW: Fix culling with inverted view (planar reflections)
Just invert the frustum planes in this case.
2018-03-08 00:09:04 +01:00
8d8f7e52c1 Make sure that the WM_opengl_context_create is always called on the main thread
Avoid the error 170 ("The requested resource is in use").
2018-03-07 20:05:51 -03:00
fef1b01553 Fix wglShareLists being called with rendering contexts in use
`wglShareLists` was failing with error code 170 ("The requested resource is in use").
2018-03-07 19:40:08 -03:00
596f33f801 Fix T54206: bevel and inset operations repeat did not remember offset.
Now repeating the operator will use the previously chosen offset, either with
the modal operator or typed in. The modal operator will still start at zero.
2018-03-07 22:53:22 +01:00
Julian Eisel
8851460174 Proper fix for User Preferences window crash
Reverts rBb9ae517794765d6a1660 and fixes the issue properly. Old fix could cause
NULL to be passed to functions that expect all arguments to be non-NULL.
2018-03-07 21:18:16 +01:00
Julian Eisel
c00b42b710 Fix Blenderplayer not compiling 2018-03-07 20:41:49 +01:00
d59627d361 Merge branch 'master' into blender2.8 2018-03-08 02:03:36 +11:00
118fb9f1f7 EditMesh: pass object data to notifiers
Both were being passed in different parts of the code,
use object data for consistency.
2018-03-08 01:49:30 +11:00
f02af0407f Cleanup: use _BEGIN suffix for group iterators 2018-03-07 20:46:27 +11:00
b9ae517794 Add missing NULL check
Caused loading user-prefs to crash.
2018-03-07 16:40:02 +11:00
49baf15a35 Merge branch 'master' into blender2.8 2018-03-07 14:31:53 +11:00
737a5efff4 Cleanup: edit-mode undo API
Move function descriptions into the struct,
minor improvements to variable naming,
use convention of 'g_' prefix for static vars.
2018-03-07 14:00:02 +11:00
4f23e13001 DRW: Fix memory leak.
This prevents the creation of a new job if no job is running.
2018-03-07 01:40:40 +01:00
cfba75a21a Eevee: Fix volume rendering glitches.
The bug was due to the Halton function returning uninitialized value for 0 iteration.
2018-03-07 01:40:40 +01:00
aa07660201 Eevee: Fix garbage on the first frames when enabling volumetrics.
Was cause by newly added shader deferred compilation.
2018-03-07 01:40:40 +01:00
267e816b9a Draw Manager: Simplify the algorithm that extract the BoundingSphere of a Frustum
The idea is to separate the most common case from symmetrical frustum. And to make a simple but efficient calculation.

The new radius is usually 98% the size of the radius size of the asymmetric solution.

Thanks to @fclem for reviewing the patch on IRC
2018-03-06 19:27:43 -03:00
faf70e1e64 Eevee: Fix crash with volumetrics + default mat + alpha blend 2018-03-06 16:52:06 +01:00
d5ecadd643 Eevee: Fix Cascaded shadowmap setup.
It was getting the wrong matrice because of the point light override.
2018-03-06 16:45:23 +01:00
6b5b61eb8c DRW: Fix DRW_viewport_matrix_override_set_all function. 2018-03-06 16:45:23 +01:00
4e7d9b7a98 Eevee: Fix probes not working after a world update. 2018-03-06 16:45:23 +01:00
f8b63b564d Eevee: Update to support shader deferred compilation.
World probe is tagged to refresh when it it's shader is updated.
Probes are recomputed only after all meshes shaders have been compiled.
2018-03-06 16:45:23 +01:00
2faa809ea6 GPU: Fix typo. 2018-03-06 16:45:23 +01:00
b55077a506 DRW: Fix broken grid in ortho view. 2018-03-06 16:45:23 +01:00
aa02c099f9 Eevee: fix wrong sizeof.
Like really? wtf dude? *self face slapping*
2018-03-06 16:45:23 +01:00
94fadd00d8 DRW: Shader Deferred compilation: Use a wmJob for threading.
Also get rid of the static var and initialization.
This enables the user to see the progress on the info header.
Closing blender or reading a file also kill the job which is good.

Unfortunatly, this job cannot be interrupt by users directly. We could make it interruptible but we need a way to resume the compilation.
2018-03-06 16:45:22 +01:00
3a209c2857 DRW: Deferred compilation initial implementation. 2018-03-06 16:44:04 +01:00
f14cbc0d07 Material: Free gpumaterials before the notree.
This is because gpumaterials can contain references to the tree when doing lazy compilation.
2018-03-06 16:44:04 +01:00
162ef15da6 Eevee: Fix bad framebuffer when changing probe resolution. 2018-03-06 16:44:04 +01:00
b7414d357a Screen: Fix screen layout preview render. 2018-03-06 16:44:04 +01:00
a6e6d7e022 Eevee: More use of DRW_viewport_matrix_override_set_all 2018-03-06 16:44:04 +01:00
2af6520007 DRW: Fix occlusion culling. 2018-03-06 16:30:27 +01:00
76122bc8f0 Cycles: Fix crash when building with no shading systems 2018-03-06 13:04:28 +01:00
ec904ed327 Cycles: Cleanup, indentation 2018-03-06 13:04:28 +01:00
8d572e8764 Cleanup: unused var 2018-03-06 22:42:32 +11:00
85b68aaf7f Merge branch 'master' into blender2.8 2018-03-06 20:04:02 +11:00
a5a0dcec90 Merge branch 'master' into blender2.8 2018-03-06 19:13:41 +11:00
4d86a432da Utility to enter sculpt mode 2018-03-06 19:11:19 +11:00
dd611dd0b8 Eevee: Optimize shadows drawing
In the gpus like `AMD Radeon HD 7570M` and `Intel(R) HD Graphics 4000` this solution improves performance a hundreds or even thousands of times depending on the resolution.

Reviewed By: @brecht and @fclem

Differential Revision: https://developer.blender.org/D3095
2018-03-05 22:03:14 -03:00
b5b5260464 Fix T54234, add BLENDER_VERSION_CHAR to .plist 2018-03-06 02:36:29 +02:00
d9d3ed16a8 Fix T53206: Array modifier doesn't merge vgroups
Vertex group remapping utility function,
now shared between object join and array modifier cap-ends.

Weights which don't exist are removed.

D3092 by @Foaly
2018-03-06 09:57:41 +11:00
84a154ac68 Merge branch 'master' into blender2.8 2018-03-05 16:14:46 +01:00
df267bd4c4 Sequencer: Expose read-only FPS property for movie-type strips
Main purpose is to make it possible to cover FPS detection with regression test.
But it might also be handy for some other scripters.

Thanks Campbell for review!
2018-03-05 15:01:23 +01:00
ae9beb1cea UI: rename panel 'Workspace Add-ons'
Show/Hide is limited to menus
2018-03-06 00:59:44 +11:00
caa0b0fadf Fix T54204: Wrong selection on Clean Tracks (Motion Tracking)
A mistake in a fix for T53612.

Regression in 2.79a, candidate for 2.79b :S
2018-03-05 12:00:25 +01:00
63d8ccf9ff Fix T54225: Blur node stopped working when Map Range was fed with image
The issue was happening with fast Gaussian blur, and caused by NaN value pixels
in the input buffer.

Now made it so Map Range output does not produce NaN, by returning arbitrary
value of 0. Still better than NaN!
2018-03-05 11:44:42 +01:00
9593a62746 Cleanup: left wrong comment in 2018-03-05 17:03:18 +11:00
f3018322c0 Fix T53478, T53430: Sequencer cut edge case fails
Previous fix for T53430 caused T54200.

The edge case for soft & hard cuts weren't working,
where the strip used start/end-still & the frame was placed exactly on
the start/end of of the sequence content.

T54200 fixed the end-still case but broke hard-cuts for all other cases.

This fixes the case for soft/hard cuts with/without start/end-still.
2018-03-05 16:58:01 +11:00
327985e887 Revert "Fix T53430: Cut at the strip end fails w/ endstill"
This reverts commit 855799ecc1.

Caused T54200
2018-03-05 16:58:01 +11:00
807663742b Error passing context arg to marker menu
own mistake in 6981861fcf
2018-03-05 14:10:43 +11:00
3607b4eb52 Fix LLVM/OSL library detection on macOS to prefer own OSL libraries. 2018-03-04 07:40:21 +01:00
74f3fb746a Fix Clang compiler detection on macOS.
"AppleClang" was not properly detected here. Now make the compiler ID
test a bit less compact but consistent with other code.
2018-03-04 07:39:04 +01:00
2adece9fbb Merge branch 'master' into blender2.8 2018-03-03 14:58:14 +01:00
dab20bd41f Fix T54211: OpenGL debug error message in texture draw mode.
Quite harmless and won't be a problem in 2.8.
2018-03-03 14:57:02 +01:00
8d575899a1 WorkSpace: use existing mode data w/ scene-switch
Check if mode data exists before attempting to change the modes.
2018-03-03 16:39:57 +11:00
b8f7538348 WorkSpace: avoid redundant notifiers w/ mode sync 2018-03-03 16:24:35 +11:00
d111f33008 WorkSpace: always change modes w/ the same active object 2018-03-03 12:28:42 +11:00
94b99949eb Fix T54202: Cycles crash rendering empty mesh volume after recent optimization. 2018-03-02 23:10:27 +01:00
Dalai Felinto
3fc2d122c4 Fix texture panel for Cycles
I keep reading that texture painting is not working yet. However it is fully
working. We even have a "Full Shading" option in the viewport display panel.

Clay/EEVEE still need their UI figured out. But the context itself is doing
its part after this patch, and at least for Cycles it's working like 2.79.
2018-03-02 17:19:04 -03:00
b6fe80ca19 Fix Cycle standalone build. 2018-03-02 19:56:22 +01:00
c43d51c1c2 Eevee: Make use of culling when rendering the shadowmaps. 2018-03-02 18:35:59 +01:00
9b47ad2974 Eevee: Cleanup & fix Warnings. 2018-03-02 18:35:59 +01:00
5e730974fe DRW: Add DRWMatrixState to manage all matrices together. 2018-03-02 18:35:59 +01:00
d63829117c DRW: Refactor simple instancing.
Instead of creating a new instancing shading group without attrib, we now have instancing calls. The benefits is that they can be culled.
They can be used in conjuction with the standard and generate calls but shader must support it (which is generally not the case).
We store a pointer to the actual count so that the number can be tweaked between redraw.

This will makes multi layer rendering more efficient.
2018-03-02 18:35:59 +01:00
62390527b2 Object Mode: Make use of optimized DRW_shgroup_call_object_add 2018-03-02 18:35:59 +01:00
1c12e1a2eb Clay: Perf: Early out of SSAO if there is no need for it. 2018-03-02 18:35:59 +01:00
Dalai Felinto
2308b5e9c5 Fix build errors in Linux 2018-03-02 13:09:32 -03:00
c327cf489c Merge branch 'master' into blender2.8 2018-03-02 16:42:27 +01:00
f76d49ed95 Depsgraph: Fix dependency cycle when ID prop drives ID property
Introduced explicit ID property node for driers in depsgraph,
so it is clear what is the input for driver, and what is the
output.

This also solved relations builder throwing lots of errors
due to ID property not being found.
2018-03-02 16:27:31 +01:00
411a781491 Depsgraph: Silence obviously noisy relations build errors
Those were happening for drivers which points to invalid drivers, and those
drivers will have their own dedicated error prints.
2018-03-02 15:51:44 +01:00
0fb55310b3 Depsgraph: Cleanup, use dedicated function to ensure node exists 2018-03-02 14:35:19 +01:00
f9f559a05f WorkSpace: Simplify exiting mode after changes
It was too tricky to know ahead of time if an object would still
be visible in the new window/workspace/scene/layer combination,
especially since other windows may share some of these data-blocks.

So store the context, make the change, then check if the object is
still visible, freeing mode data of it's not.
2018-03-03 00:23:02 +11:00
cedc7676ac Depsgraph: Cleanup, function return value
Driver build result was never used, so no reason to return operation.
2018-03-02 14:12:33 +01:00
35bd1bb957 WorkSpace: move edit mode w/ sync into own func 2018-03-02 23:04:19 +11:00
437801bec1 Correct draw manager locking flag check
Error in eeae50fc1c, thanks @mano-wii for spotting
2018-03-02 22:53:01 +11:00
42d9280b8a Depsgraph: Fix cycle detector to handle closed loops
It was possible to have relations like A -> B -> C -> A (import thing is
that no other operations points into this cluster) which were not detected
or reported by dependency cycle solver.

Now this is solved by ensuring we don't leave unvisited nodes behind.
2018-03-02 12:30:58 +01:00
99bcfb825f Cleanup: Avoid double semi-colon 2018-03-02 11:26:07 +01:00
b5b34bc2c0 Tests: Avoid access globals from abstract base class
Delegate functionality to subclasses, assert when subclasses didn't do
job the are supposed to do.

Thanks Sybren for pointing to a proper solution.
2018-03-02 11:18:12 +01:00
f2a2d5492b Cycles: Fix building of OpenCL kernels after volume optimization commit
OpenCL is C based, so no support for operators.

Related commit: 7377d411b4
2018-03-02 04:53:13 -05:00
e1f1567b56 WorkSpace: ED_workspace_object_mode_in_other_window check other windows
The same workspace can have different active objects depending on the
window. So check other windows.
2018-03-02 20:01:49 +11:00
a9509a2f8a Maintain scaling ratio of non-free axes in Maintain Volume T48079 fix.
This is probably a better way to handle it: instead of totally
discarding scaling of non-free axes, keep the ratio between them.
Basically the logic of the constraint is now that it rescales the
object uniformly in the non-free axis plane in order to force the
total volume change to the desired value.
2018-03-02 11:01:49 +03:00
8153f89518 WorkSpace: object-sync when changing workspaces. 2018-03-02 19:01:38 +11:00
eee3a4d3ab Cleanup: move ED_object_mode_generic_* to object_modes.c 2018-03-02 14:55:53 +11:00
da2d0fe43a Merge branch 'master' into blender2.8 2018-03-02 14:46:21 +11:00
4913e47aa0 Merge branch 'master' into blender2.8 2018-03-02 14:09:27 +11:00
ff74357da0 Object Mode: move logic to 'object_modes.c'
Was mixed with edit-mode, centralize mode switching in a single file.

No functional changes.
2018-03-02 14:00:47 +11:00
b7016e69b3 Cleanup: remove object-mode 'reset' check
Silently fail when attempting to enter a mode that's not compatible
with the object.
2018-03-02 13:37:35 +11:00
4df2179f19 Cleanup: rename 'screen_changed_update'
Match 'workspace_change_update'.
2018-03-02 13:25:21 +11:00
a7355c3221 WorksSpace: sync object-modes when changing scene
Note that this code will likely be generalized,
currently each new case is a little different though
so it's too early to move them into general functions.
2018-03-02 13:19:52 +11:00
7e4c23e4d7 FCurve: only calculate single axis length
Was calculating all 3
2018-03-02 12:45:25 +11:00
341ab45f7b Fix building w/o Python
Also minor cleanup.
2018-03-02 11:17:57 +11:00
bc23381a26 Cleanup: remove print 2018-03-02 10:22:10 +11:00
Dalai Felinto
b941d808c1 Remove legacy code used for sequencer preview image
This (now removed code) calls gl_Vertex deprecated draws. It was doing
background drawing (color gradient, flat background) which is not used
by any engine.
2018-03-01 18:22:31 -03:00
ec76f38b09 Discard non-free axis scaling in Maintain Volume to improve 2.79 compat.
It seems the reason the old version of the constraint overcompensates
as reported in T48079 is to allow the constraint to work with uniform
scaling on all axes. However the way it did that actually _requires_
uniform scaling for the constraint to work correctly, and breaks if
only the free scaling axis is used to avoid redundant channels.

This version attempts to allow both by discarding scaling in the non-
free directions instead of applying the correction on top of it.
2018-03-01 20:46:59 +03:00
3a3dfd4e65 Python tests: Split re-usable test related functionality to a module
The idea is to avoid re-implementing this for an upcoming FFmpeg tests.
2018-03-01 17:44:35 +01:00
1178518a68 Refactor: Merge non-functional-change part of 'edit normals' 2017 GSoC.
This merges changes in internals, runtime-only of existing custom
normals code, which make sense as of themselves, and will make diff of
soc branch easier/lighter to review.

In the details, it mostly changes two things:

* Now, smooth fans (aka MLoopNorSpaceArray) can store either loop
indices, or pointers to BMLoop themselves. This makes sense since in
BMesh, it's relatively easy to get index from a BMElement, but nearly
impracticable to go the other way around.

* First change enforces another, now we cannot rely anymore on `loops`
being NULL in MLoopNorSpace to detect single-loop fans, so we instead
store that info in a new flag.

Again, these are expected to be totally non-functional changes.
2018-03-01 16:54:21 +01:00
Dalai Felinto
8f7e3600d1 More clean of macros with an _END and no _BEGIN
Follow up on 7aed2de798.
2018-03-01 12:23:25 -03:00
f242f3e75b Fix assert on exit edit-mode 2018-03-01 22:46:25 +11:00
865fdd61df 3D View: minor selection tweaks
- don't initialize the GL context when cache is used.
- don't run second pass when the first one has no hits.
2018-03-01 22:05:09 +11:00
1852e702ab Merge branch 'master' into blender2.8 2018-03-01 11:56:01 +01:00
7377d411b4 Cycles volume: fast empty space optimization by generating a tight mesh
around the volume.

We generate a tight mesh around the active voxels of the volume in order
to effectively skip empty space, and start volume ray marching as close
to interesting volume data as possible. See code comments for details on
how the mesh generation algorithm works.

This gives up to 2x speedups in some scenes.

Reviewed by: brecht, dingto

Reviewers: #cycles

Subscribers: lvxejay, jtheninja, brecht

Differential Revision: https://developer.blender.org/D3038
2018-03-01 11:54:01 +01:00
bcafdc82d8 WorkSpace: fix mode exiting w/ multi-window
Activating an object exited modes for all other objects in the layer.
Now check these objects aren't active in other windows first.
2018-03-01 21:33:06 +11:00
7aed2de798 Cleanup: macro's w/ an _END need a matching _BEGIN
Convention from 2.7x, since some looping macros don't need an '_END',
it avoids confusion to keep this.
2018-03-01 19:01:53 +11:00
1fc5eb305a Missing assignment in object mode sync
Own error in recent change (1aeb9294f4)
2018-03-01 18:37:49 +11:00
eeae50fc1c DRW: add ability to lock states from changing
Selection code relies on being able to set the depth functions
however passes have their own depth settings.

Add DRW_state_lock to ignore passes settings for particular flags.

This fixes occlusion queries cycling through objects under the cursor.
2018-03-01 17:14:35 +11:00
b5cc55c822 Merge branch 'master' into blender2.8 2018-03-01 16:48:13 +11:00
172614fb7d GPU_select: remove unused finalize function
Changed 2.8x code so this is no longer needed.
2018-03-01 16:43:45 +11:00
a459ef2827 Fix T54190: Occlusion query select failed
By default select wasn't picking the nearest object,
this could have been fixed by not clearing the depth buffer,
but calling GPU_select_(begin/end) without the binded frame-buffer
caused issues for depth-picking. So move GPU_select begin/end to a
callback.

This also has the advantage that only needs to populate the engines once
to draw two passes.

Note that cycling through objects fails with occlusion queries still,
will fix shortly.
2018-03-01 16:37:39 +11:00
68015f9d39 DRW: Initial implementation of Frustum culling.
This is very efficient and add a pretty low overhead (0.1ms of drawing time for 10K objects passing through all tests, on my i3-4100M).
The like the rest of the DRWCallState, test is "cached" until the view matrices changes.
2018-03-01 03:53:25 +01:00
dee2efb968 Clay: Make use of optimized DRW_shgroup_call_object_add. 2018-03-01 03:53:25 +01:00
5d0665d435 DRW: DRWCallState: Fix matflag being overwritten by other engines. 2018-03-01 03:53:25 +01:00
725112cce7 DRW: Codestyle: Remove DRWCallHeader and DRWCallGenerate 2018-03-01 03:53:25 +01:00
64e35f6fd2 DRW: Reuse DRWCallState for the same object.
This enables caching the matrices and reducing redraw time of the same object which is particulary important for eevee.
2018-03-01 03:53:25 +01:00
1ba96857d1 DRW: Merge calls_generate pool with calls pool & add DRWCallState pool. 2018-03-01 03:53:25 +01:00
d1da7dba47 DRW: Fix warnings in Release Build. 2018-03-01 03:53:25 +01:00
61c8ed40f5 WorkSpace: show/hode opt-out support for addons
In some cases it doesn't make sense for add-ons to be listed for hiding.
Especially for import/export which use minimal UI space.

This adds `bl_info["use_owner"]` to add-ons,
currently defaulting to True for all non Import-Export add-ons.
2018-03-01 11:22:46 +11:00
7f86afec9d Cycles: don't count volume boundaries as transparent bounces.
This is more important now that we will have tigther volume bounds that
we hit multiple times. It also avoids some noise due to RR previously
affecting these surfaces, which shouldn't have been the case and should
eventually be fixed for transparent BSDFs as well.

For non-volume scenes I found no performance impact on NVIDIA or AMD.
For volume scenes the noise decrease and fixed artifacts are worth the
little extra render time, when there is any.
2018-03-01 01:21:29 +01:00
33b6f944c6 Merge branch 'master' into blender2.8 2018-02-28 21:34:09 +01:00
03d1070378 Cycles: change principled BSDF default distribution and SSS.
* Use a subsurface color equal to the base color, and give the subsurface
  radius skin like values by default. This is how the parameter should
  typically be used.
* Use GGX by default, multiscatter GGX is still quite noisy and has some
  fireflies so let's keep it optional for now.
2018-02-28 21:31:28 +01:00
8cc7f48581 Cycles: principled absorption color now has more effect at lower values. 2018-02-28 20:11:53 +01:00
Dalai Felinto
382218beb2 Point cache: Pass EvaluationContext for all the related functions
Now the only missing bit seems to be in Cycles to pass depsgraph to
builtin_image_float_pixels().

Ideally we could get evaluation context instead of using depsgraph + settings.
But for the other rna EvaluationContext functions this is how we are doing.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3087
2018-02-28 13:55:56 -03:00
4a892adac5 merge from master (needed to fix collada headerfiles which have been modified in master and in blender2.8 slightly different) 2018-02-28 17:29:56 +01:00
4762c099d7 Fix T52685, part II: Add option to strip numbers from flipped bone names again.
While doing so with Bone_R.001, Bone_R.003, Bone_R.003 etc. is doomed to
issues, doing that on duplicates of actually correctly named bones can
be handy, and safe.

So adding back as an option (was removed in rB702bc5ba26d5).
2018-02-28 17:13:31 +01:00
e73fe77ac0 collada: EvaluationContext is now feeded into the class instances of AnimationExporter and DocumentExporter on creation. Also skipped the const qualifier for now because BKE_scene_graph_update_for_newframe() needs it to be not const 2018-02-28 17:10:57 +01:00
cee66b8cc0 Fix T52685: Flip names for bones its not working.
Flip names operator changed in rB702bc5ba26d5, to some sensible
behavior. But this breaks common workflow of 'duplicate part of the
bones, scale-mirror new ones, and flip their names'.

So now, instead of doing this in two steps, trying to guesstimate which
bones should get which name, just add option to flip names to duplicate
operator itself. Simpler, safer, and much, much more consitent behavior
and predictable results.
2018-02-28 16:59:32 +01:00
56ea42efa1 Radial control: Skip operator properties from being saved
This solves issue with tweaking brush size when interleaving particle edit
and texture paint modes. The issue was caused by texture paing setting more
operator properties then it's done for particle edit mode, which made window
manager to use saved proeprties for the "missing" ones.

Don't see any reason why we would want to save any of those properties.

This is a regression since rB83b60dac57a1.
2018-02-28 16:14:35 +01:00
a363324f7f Collada: Make EvaluationContext const as its only used for reading here 2018-02-28 16:05:29 +01:00
91c3cfbb6f collada: call from operator to Collada exporter/importer now uses structures instead of passing many parameters 2018-02-28 16:05:29 +01:00
01f732d97b Collada: Moved structure definitions for export settings to the exportSettings.h Also make typedefs for import/export structures. 2018-02-28 16:05:28 +01:00
d937d06c02 WorkSpace: UI filtering for add-ons
Allows for each workspace to have it's own add-ons on display.

Filtering for: Panels, Menus, Keymaps & Manipulators.
Automatically applies to add-ons at the moment.

Access from workspace, toggled off by default
once enabled, add-ons can be white-listed.

See D3076
2018-03-01 01:31:07 +11:00
80d1d9629e Depsgraph: Update tool settings when updating CoW scene 2018-02-28 14:57:49 +01:00
4e8bd537c3 Merge branch 'master' into blender2.8 2018-02-28 14:54:51 +01:00
8b8e16dc2c De-duplicate tool settings copy and make tool settings freeing reusable 2018-02-28 14:52:17 +01:00
bd25e73c54 Null pointer check exiting sculpt mode
Needed for 2.8x, harmless here.
2018-03-01 00:39:42 +11:00
e7aca5bd3c Null pointer check exiting sculpt mode
Needed for 2.8x, harmless here.
2018-02-28 23:23:48 +11:00
1aeb9294f4 WorkSpace: use existing objects mode on select
When selecting an object which is already visible in another window
use the mode from that workspace without performing any mode switching.
2018-02-28 23:09:33 +11:00
9e9cb9fce9 Workspace: sync object-modes to other workspaces
When changing the mode of an object, apply this to all other
workspaces that share the same active object.

Also use copy the object-mode when duplicating workspaces.
2018-02-28 20:04:21 +11:00
c0d6627dc5 Merge branch 'master' into blender2.8 2018-02-28 03:11:17 +01:00
c9a2927930 Code cleanup: fix a few harmless warnings. 2018-02-28 03:10:38 +01:00
2329cc09e6 Code cleanup: make viewport free simpler and consistent with GPU module. 2018-02-28 03:04:15 +01:00
8a7eb6c4c1 Update CUEW to latest version
Some Linux distribution have only libcuda.so.1, not libcuda.so.
2018-02-28 03:03:12 +01:00
7990105407 Code cleanup: fix a few compiler warnings. 2018-02-28 03:03:07 +01:00
be5e437bb5 DRW: Fix broken particle drawing.
Was caused by GPU_SELECT_LOAD_IF_PICKSEL_LIST not iterating at all if shgroup->instance_count == 0.
2018-02-28 02:24:21 +01:00
376e74f2aa Object Mode: Fix incorrect lightprobe wire color when in edit mode. 2018-02-28 02:10:38 +01:00
6bd53cb541 Cleanup: comment for depth picking code, const args
Note that setting `glDepthFunc` isn't important,
since 2.8 branch changes this value it might seem like an error
however it's harmless in this case - so better make note of this.
2018-02-28 11:47:54 +11:00
4d382e2564 DRW: Disable depth test when drawing statistics 2018-02-28 01:39:12 +01:00
6addaf7393 Cleanup: use 'uint' for GPU_select 2018-02-28 11:37:39 +11:00
74a22c8a8a DRW: Fix negative scale object drawing. 2018-02-28 01:29:26 +01:00
0df21e2504 DRW: Refactor & Split draw_manager.c into multiple files.
Refactor include:
- Removal of DRWInterface. (was useless)
- Split DRWCallHeader into a new struct DRWCallState that will be reused in the future.
- Use BLI_link_utils for APPEND/PREPEND.
- Creation of the new DRWManager struct type. This will enable us to create more than one manager in the future.
- Removal of some dead code.
2018-02-28 01:29:26 +01:00
d5a55b6918 BLI_link_utils: Add BLI_LINKS_APPEND(list, link) 2018-02-28 01:29:26 +01:00
11100faa5c Merge branch 'master' into blender2.8 2018-02-28 00:08:16 +01:00
bc71aa5a4c Cleanup: macros using _END, should have a _BEGIN
Also use var names not likely to be shadowed.
2018-02-28 10:05:38 +11:00
2eb94be750 Code cleanup: refactor Cycles image metadata retrieval to use a struct. 2018-02-27 23:42:30 +01:00
Dalai Felinto
000002e42d Cycles point density texture
This still does not make point density to work in Cycles, but at least it pass
the depsgraph down the line.

Note this was working fine before the depsgraph/render refactor to pass
evaluated depsgraph to the engines.
2018-02-27 18:25:54 -03:00
828f545213 Fix Cycles to mostly work with render layer / depsgraph changes.
Point density texture and motion blur are still broken, and many more changes
are needed in general to used evaluated datablocks.
2018-02-27 18:25:54 -03:00
Dalai Felinto
06420c5fe8 Refactor depsgraph/render logic to serve evaluated depsgraph to engines
User notes
----------
Compositing, rendering of multi-layers in Eevee should be fully working now.

Development notes
-----------------
Up until now we were still using the same depsgraph for rendering and viewport
evaluation. And we had to go out of our ways to be sure the depsgraphs were
updated.

Now we iterate over the (to be rendered) view layers and create a depsgraph to
each one, fully evaluated and call the render engines (Cycles, Eevee, ...) with
this viewlayer/depsgraph/evaluation context.

At this time we are not handling data persistency, Depsgraph is created from
scratch prior to rendering each frame.  So I got rid of most of the partial
update calls we had during the render pipeline.

Cycles: Brecht Van Lommel did a patch to tackle some of the required Cycles
changes but this commit mark these changes as TODOs. Basically Cycles needs to
render one layer at a time.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3073
2018-02-27 18:25:54 -03:00
Dalai Felinto
bd119ab017 Depsgraph: Expose query to get view layer to RNA 2018-02-27 18:25:54 -03:00
0f6c08c8cf Merge branch 'master' into blender2.8 2018-02-27 21:06:29 +01:00
450be3b226 Collada: Added tests for Animation export 2018-02-27 20:41:34 +01:00
1a65168c42 merge Collada changtes from master 2018-02-27 17:53:53 +01:00
Dalai Felinto
925f2280e6 Merge commit '6aadd61bd892d3908ed8151' into blender2.8 2018-02-27 13:48:26 -03:00
26fc197d49 Collada: commented out code was previously left over with an unresolved conflict in it. Deleting as its no longer needed 2018-02-27 17:14:35 +01:00
05b5958a7a Collada: Remove obsolete code 2018-02-27 17:08:40 +01:00
d1f0bdd337 fix: Collada Matrixdata Importer tried to fix rotations where nothing was to fix. The matrixdata import is now only doing a matrix decompose and then pplies the decomposed values to 3 trans-, 3 scale- and 4 rot-curves) 2018-02-27 17:02:52 +01:00
148e2ace61 Collada: removed unnecessary dup[licate matrix conversion in matrix data exporter 2018-02-27 17:02:52 +01:00
0ea110f4ea Collada exporter: Replaced numbers 0/1 by boolean values fasle/true for better reading 2018-02-27 17:02:52 +01:00
91f3cfec10 Collada Shape key export can create huge datafiles and may need some optimization. Disable export by default, user can still enable on demand 2018-02-27 17:02:52 +01:00
20c5131384 Collada enable Export of animation data by default 2018-02-27 17:02:52 +01:00
158a1de4fb DRW: Fix multithreading conflict with material previews. 2018-02-27 15:50:34 +01:00
ec0ecbe795 DRW: Refactor / Cleanup Builtin uniforms.
-Make the view and object dependant matrices calculation isolated and separated, avoiding non-needed calculation.
-Adding a per drawcall matrix cache so that we can precompute these in advance in the future.
-Replaced integer uniform location of only view dependant builtins by DRWUniforms that are only updated once per shgroup.
2018-02-27 14:50:16 +01:00
fe80d8ec3c DRW: Do not recreate the common uniform buffer every frame. 2018-02-27 14:50:16 +01:00
be284c82d4 GWN: Query builtin uniform at shader creation.
This avoids having non null entries in shaderface->builtin_uniforms and a redundant check.
2018-02-27 14:50:16 +01:00
3cc4070a30 Fix T54179: Assert changing layers in 2nd window 2018-02-28 00:08:49 +11:00
Dalai Felinto
12c8fef8c7 Eevee preview materials
Now that Eevee has support for offline rendering (F12) we can use it for
the Material previews.

Note: This makes the duplicated UI issue one panel worse. That happens when
Cycles if your scene engine, and Eevee is your workspace engine.
2018-02-27 09:31:16 -03:00
6aadd61bd8 Cleanup: remove unused duplicate code 2018-02-27 22:02:18 +11:00
3d7235fc87 MSVC 2013 Compile Fix/Workaround for "static thread_local" vars
Apparently MSVC 2013 has trouble with stuff that's been declared
"static thread_local" (and/or maybe even the "thread_local" keyword).

https://stackoverflow.com/questions/29399494/what-is-the-current-state-of-support-for-thread-local-across-platforms
2018-02-27 11:23:22 +01:00
5a1a63a858 Merge branch 'master' into blender2.8 2018-02-27 11:16:43 +01:00
26f4ce4a76 Collada: Remove unused vector of flaot[4][4] values
Was in fact causing issues on macOS, something to do with
a destructor.
2018-02-27 11:14:55 +01:00
2026179bb2 Collada: Use floating point version of abs()
Avoids implicit cast of float to int.
2018-02-27 11:14:17 +01:00
aa592cc00c Merge branch 'master' into blender2.8 2018-02-27 20:45:33 +11:00
a7ef312611 GPU_select: correction to select-pick-finalize
Would run twice, harmless at the moment but could cause issues later.
2018-02-27 20:44:12 +11:00
50d03de600 Fix error in depth picking caused by GL contexts
Depth picking needs to read the depth buffer after drawing
since GPU_select_end runs in a different OpenGL context
reading the depth buffer wasn't working.
This caused the last object to be unelectable.
2018-02-27 20:33:42 +11:00
efef0ee672 Merge branch 'master' into blender2.8 2018-02-27 20:24:02 +11:00
4de50d7572 GPU_select: utility function to finalize selection
Needed for depth picking in 2.8
2018-02-27 20:16:53 +11:00
24f759ba5a Revert "F12 offline Freestyle rendering support in Eevee"
This reverts commit 8a7c0abc2d.
2018-02-27 13:02:58 +09:00
50b95211bf Fix T54106: Save blend ignores 'check_existing' 2018-02-27 13:33:59 +11:00
8a7c0abc2d F12 offline Freestyle rendering support in Eevee
This patch adds F12 offline Freestyle rendering support to Eevee.

Most functionalities are identical with those found in Cycles.

The only major difference is that the per-view layer "use Freestyle" toggle
option is currently placed in the "Passes" panel of the "View Layers"
properties window instead of a "Layer" panel as in Cycles.  Since Freestyle
is a post-processed overlay and not a pass, the present option location is
a compromise.  To describe this fact, the per-layer "use Freestyle" option
is in a subsection labeled as "Layer".

Reviewers: fclem, brecht, campbellbarton

Reviewed By: fclem, brecht

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D3084
2018-02-27 08:53:31 +09:00
e24906759f Merge branch 'master' into blender2.8 2018-02-26 23:38:21 +01:00
b5f0e8e1a1 Collada: removed unused variables. fixed incompatible format in console output (AnimationExporter.cpp) 2018-02-26 23:37:27 +01:00
edcd30f6ab Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-02-26 22:55:15 +01:00
f228a08d02 merge from master 2018-02-26 22:49:30 +01:00
Dalai Felinto
96285e1ca4 VSE preview: Get depsgraph from EvaluationContext
Note: Sequencer preview is working only for Clay, for Eevee is still not working.
2018-02-26 18:04:18 -03:00
e94276d403 GWN: Fix glitches when closing a window. 2018-02-26 20:09:54 +01:00
c17042bc6d Eevee: Fix prev_persmat being used by multiple viewport. 2018-02-26 20:08:48 +01:00
f4cc9ba4c3 V3D: Vertex selection: Fix opengl error. 2018-02-26 20:07:39 +01:00
fa7e4cc685 WM/GPU: Clear VAO cache of batch preset when switching context.
This is needed for multiple windows to draw the batch presets.
This will not be needed once we use only one context for UI.
2018-02-26 19:49:06 +01:00
13261304a3 DRW: Add new Draw Manager OpenGL Context.
This separate context allows two things:
- It allows viewports in multi-windows configuration.
- F12 render can use this context in a separate thread and do a non-blocking render.

The downside is that the context cannot be used while rendering so a request to refresh a viewport will lock the UI. This is something that will be adressed in the future.

Under the hood what does that mean:
- Not adding more mess with VAOs management in gawain.
- Doing depth only draw for operators / selection needs to be done in an offscreen buffer.
- The 3D cursor "autodis" operator is still reading the backbuffer so we need to copy the result to it.
- All FBOs needed by the drawmanager must to be created/destroyed with its context active.
- We cannot use batches created for UI in the DRW context and vice-versa. There is a clear separation of resources that enables the use of safe multi-threading.
2018-02-26 19:41:17 +01:00
0940e89e60 GHOST: Add new interface to manage offscreen contexts.
Offscreen contexts are not attached to a window and can only be used for rendering to frambuffer objects.

CGL implementation : Brecht Van Lommel (brecht)
GLX implementation : Clément Foucault (fclem)
WGL implementation : Germano Cavalcante (mano-wii)

Other implementation are just place holder for now.
2018-02-26 19:10:15 +01:00
7dd0e36dc4 simplified collada integration in Blender. made functions mostly similar with blender2.8 2018-02-26 17:18:31 +01:00
a024da55af Adding support for Matrix Transformation export
The exporter does export matrix data (4*4 Transformation matrix) only for Skeletal animation. For object animation only exporting to trans/rot/loc is implemented.

This task implements Matrix export also for simple Object animation.

Differential Revision: https://developer.blender.org/D3082
2018-02-26 17:16:56 +01:00
5f9657316e collada: fix typo in if statement 2018-02-26 12:55:54 +01:00
57b378b046 as discussed on IRC this definition seems to be not necessary 2018-02-26 12:45:37 +01:00
8e826caf5e optimized the output of the collada test script for better reading 2018-02-26 12:09:48 +01:00
c52df4fc7c Cleanup: typos
D3081 by @rjg, with others.
2018-02-26 19:58:31 +11:00
f1bd96a9ab Revert "changing collada parameters"
This reverts commit d91f2ac37a.

This change makes scene.collada_export() meaningless
(ignoring the scene the method is being run on).
2018-02-26 19:35:45 +11:00
3fd5a4047c Presets: remove double underscore in preset names 2018-02-26 19:21:02 +11:00
d416e56e70 Fix T54029: Wrong preset name display in win32 2018-02-26 19:05:01 +11:00
b1414b7322 Cleanup: use function for clearing bmesh tags 2018-02-26 14:05:58 +11:00
Hugo Sales
5d54d6b479 Fix T50132: UV sticky mode is not respected with border/circle/lasso select.
Differential Revision: https://developer.blender.org/D3074
2018-02-25 22:28:54 +01:00
ec27281812 Fix incorrect text clipping on node link button in material properties. 2018-02-25 19:57:40 +01:00
d6df23d9d9 Object Mode: Display meshes without faces and edges in object mode. 2018-02-25 17:55:49 +01:00
b795f5eb7a Eevee: Cleanup cascaded shadowmap code. 2018-02-25 17:55:49 +01:00
241c90c92d DRW/GWN: Bypass glUseProgram.
Turns out to be the call that was destroying performance.

I get 18ms->6ms improvement of drawing time with 10 000 unique objects.

And we can still improve upon this!
2018-02-25 17:59:46 +01:00
24d51a05a9 Manipulator: rename is_visible -> poll
Rename to WM_manipulator_group_type_poll,
use convention of other poll functions.
2018-02-26 00:04:59 +11:00
15dfd866db Fix Player tm, a lifes job 2018-02-25 10:35:08 +01:00
2b158861a3 merged collada rework from master into blender 2.8 2018-02-25 00:06:41 +01:00
d91f2ac37a changing collada parameters
Differential Revision: https://developer.blender.org/D3080
2018-02-24 22:51:04 +01:00
0a1434ed86 Fix a whitespace slipped in 2018-02-24 18:07:05 +01:00
c23b77fe46 Fix Plyer tm 2018-02-24 17:30:37 +01:00
dd7b9a362d T45687: Rework the Export/Import of Animations
This started with a fix for an animated Object Hierarchy. Then i decided to cleanup and optimize a bit. But at the end this has become a more or less full rewrite of the Animation Exporter. All of this happened in a separate local branch and i have retained all my local commits to better see what i have done.

Brief description:

* I fixed a few issues with exporting keyframed animations of object hierarchies where the objects have parent inverse matrices which differ from the Identity matrix.
* I added the option to export sampled animations with a user defined sampling rate (new user interface option)
* I briefly tested Object Animations and Rig Animations.

What is still needed:

* Cleanup the code
* Optimize the user interface
* Do the Documentation

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D3070
2018-02-24 15:55:27 +01:00
94eb189752 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
2018-02-24 14:02:50 +01:00
4403ca80bd Smoke: expose empty space clipping property to the UI.
This is used to determine which voxels are to be considered empty space.

Previously it was hardcoded for converting dense grids to OpenVDB grids
to reduce disk space usage.

This value is also useful for rendering engines to know, i.e. to
optimize ray marching.
2018-02-24 13:37:58 +01:00
6d8a4c10b6 OpenVDB : use underscores instead of spaces in grid names.
Some other software cannot handle grid names with spaces in them. We still check for names with spaces so as to not break old
files.

This fixes T53802.
2018-02-24 13:37:08 +01:00
Dalai Felinto
c4abb33102 Fixup for border render changes
Although I fixed border rendering, I broke non-border rendering.

Issue introduced on:  0305fc30b3
2018-02-23 17:26:57 -03:00
38ccd1fe33 Eevee: add Principled Volume shader. 2018-02-23 19:10:24 +01:00
77062e8bbb Eevee: add blackbody shader node support.
This replaces the blackbody to RGB code with the simpler and faster one from
Cycles. It's a little different but the other placing using this is the legacy
volume drawing, so no need to stay compatible with that.
2018-02-23 19:10:24 +01:00
57609993d0 GPU: fixes for string socket types in shader nodes.
These are not passed to GLSL functions, but should be used to load e.g.
a texture or attribute.
2018-02-23 19:10:24 +01:00
af061b4dac Eeevee: add temperature grid support, make color grid unpremultiplied.
This matches similar changes done for Cycles.
2018-02-23 19:10:02 +01:00
a44b08a6c4 Merge branch 'master' into blender2.8 2018-02-23 19:02:49 +01:00
0aec2dcd3a Cycles: add Principled Volume shader.
Similar to the Principled BSDF, this should make it easier to set up volume
materials. Smoke and fire can be rendererd with just a single principled
volume node, the appropriate attributes will be used when available. The node
also works for simpler homogeneous volumes like water or mist.

Differential Revision: https://developer.blender.org/D3033
2018-02-23 18:57:58 +01:00
acd619d7c9 Cycles: change smoke color grid to not include density multiplied in.
This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.
2018-02-23 18:57:58 +01:00
a963c7d48d Code refactor: improve attribute handling for optional volume attributes.
A volume shader should be able to request attributes, and still be rendered
as homogeneous if no volume attributes are available for the object.
2018-02-23 18:57:58 +01:00
4448ed6c5e Smoke: change default flame temperatures to match OpenGL preview. 2018-02-23 18:57:58 +01:00
04896d223d Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K. 2018-02-23 18:57:58 +01:00
15fb8ad6ae Nodes: left align text for color and string sockets, same as other types. 2018-02-23 18:57:58 +01:00
Dalai Felinto
0305fc30b3 Fix border rendering for eevee + stop passing render result around
Technically the original issue is that xof/yof in render result is calculated
for drawing border render. So a simpler patch could be:

```
- rr->xof = re->disprect.xmin;
+ rr->xof = re->disprect.xmin + BLI_rcti_cent_x(&re->disprect) - (re->winx / 2);
```

However everywhere in the code we are getting border directly from re->disprect
which we may as well do here too.

Besides I'm taking this as a chance to get rid of RenderResult in the internal
loop of eevee, to help prepare the code to the upcoming rendering pipeline
changes.
2018-02-23 13:26:30 -03:00
dceb8d37c2 Fix T54137: OpenEXR files with long red/green/blue channel names not loading correctly. 2018-02-23 14:34:27 +01:00
44d45e1af4 Buildbot: Enable Volta deviced CUDA binaries 2018-02-23 14:24:59 +01:00
e24dee435e Buildbot: Remove master configuration files
Those are stored in blender-buildbot repository now, so having them in
Blender only causes extra work to keep files in sync.
2018-02-23 12:37:05 +01:00
07f05e294a Buildbot: Disable cuda hack for macOS 2018-02-23 10:55:26 +01:00
5127910749 Merge branch 'master' into blender2.8 2018-02-23 17:12:55 +11:00
6618852b7f WM: Add WM_menutype_poll function
Wraps menutype poll, no functional changes.
2018-02-23 17:02:03 +11:00
171c756f20 Merge branch 'master' into blender2.8 2018-02-23 13:10:39 +11:00
f36c803e55 WM: add WM_keymap_poll function
Wrapps keymap poll, no functional changes.
2018-02-23 12:59:55 +11:00
dd77e45151 Cleanup: header guards & style 2018-02-23 12:59:55 +11:00
Dalai Felinto
d7ba1ada82 Fix T54136: Crash when deleting an object that is in an instanced group
We were not cleaning up groups after deleting objects, leaving groups with
Bases that had no object.

It includes a unittest.

Reviewers: mont29
2018-02-22 17:16:39 -03:00
e7c4a9d1ef GWN: Fix immediate mode when closing a window. 2018-02-22 19:49:59 +01:00
8115162e98 DRW: Fix T54135 : Crash caused by wrongly iterating over ListBase. 2018-02-22 19:47:52 +01:00
d4795cc5d1 DRW: Fix use of uninitialized call->obmat. 2018-02-22 19:47:52 +01:00
03d1f08282 WM: Make sure that immediate mode is active before deactivate it 2018-02-22 13:22:28 -03:00
2694c1fc60 Merge branch 'master' into blender2.8 2018-02-22 16:31:59 +01:00
71e00252f0 Depsgraph: Fix mistake in previous refactor commit 2018-02-22 16:30:47 +01:00
2f5f392453 Merge branch 'master' into blender2.8 2018-02-22 15:45:41 +01:00
5f857378af Cleanup: Fix const pointers mess in previous commit. 2018-02-22 15:41:41 +01:00
4ee3d7e3ac Merge branch 'master' into blender2.8
Conflicts:
	source/blender/bmesh/intern/bmesh_mesh.c
2018-02-22 15:22:44 +01:00
0eee776e45 Fix (unreported) meshes changing shading when creating empty clnors data.
When you were using autosmooth to generate some custom normals, and
created empty custom loop normal data, you would go back to an 'all
smooth' shading, cancelling some sharp edges generated by the mesh's
smooth threshold.

Now we will first tag such edges as sharp, such that shading remains the
same. This is not crucial in current master, but it is for clnors
editing gsoc branch!
2018-02-22 15:20:39 +01:00
4b068c4d6f Cleanup: clnor code: more 'do not use same varname for two different things'. 2018-02-22 15:20:39 +01:00
e83b9cde1a Fix T54129: Moving keyframes on top of other keyframes, removes both keyframes
Regression caused by earlier commits to improve the automerge behaviour.
In this case, the problems only occurred when moving a selected keyframe
forwards in time to overlap an unselected keyframe.
2018-02-23 03:13:56 +13:00
00ba28e9f8 Fix: Don't ignore duplicate channels when doing border/circle/lasso select
While it is necessary to ignore duplicates when doing Deselect/Column Select
(where double-updates may result in nothing being selected), for borderselect,
not including the duplicates meant that sometimes, nothing would happen
if you were trying to borderselect keyframes originating from hidden channels.

This was first noticed in the greasepencil-object branch, but affects all
animation channel types.
2018-02-23 02:41:05 +13:00
5aff002f7b GWN: Context: Fix allocation/codestyle and crash on startup. 2018-02-22 14:31:40 +01:00
672e823578 Merge branch 'master' into blender2.8 2018-02-22 14:27:57 +01:00
86ad5cacfa Depsgraph: Remove unused argument 2018-02-22 14:27:29 +01:00
4a0d8f92f6 Remove old depsgraph from modifiers relations update context 2018-02-22 14:09:45 +01:00
539987766b Merge branch 'master' into blender2.8 2018-02-22 14:08:27 +01:00
3d1c0afe0e Depsgraph: Remove unused bmain from modifiers relations update context 2018-02-22 14:07:08 +01:00
62b3522da2 Fix compilation error with legacy depsgraph disabled 2018-02-22 13:05:38 +01:00
6e860bef28 Merge branch 'master' into blender2.8 2018-02-22 13:05:00 +01:00
df04520602 Depsgraph: Wrap all arguments foe modifiers relations update into a struct
Makes it easier to add or remove fields needed to update relations.
2018-02-22 12:54:06 +01:00
cc05b661f7 GWN: Fix use after free crash.
This is not an ideal solution but blender freeing system is already well tangled.
So tracking and clearing vao caches when destroying contexts does prevent bad behaviour.
2018-02-22 12:39:57 +01:00
a17de773fd Merge branch 'master' into blender2.8 2018-02-22 11:20:28 +01:00
93072e44d1 Depsgraph: Replace LIB_TAG_DOIT with hash lookup
This allows us to:

- Not mock around with tags stored in a global space,
    and not to iterate over all datablocks in the database
    to clear the tags.

- Properly deal with datablocks which might not be in main database.

    While it sounds crazy, it might be handy when dealing with preview,
    or some partial scene updates, such as motion paths.

- Avoids majority of places where depsgraph construction needed bmain.

    This is something what could help in blender2.8 branch.

From tests with production file here did not see any measurable slowdown.

Hopefully, there is no functional changes :)
2018-02-22 11:03:39 +01:00
76953a6ebd Depsgraph: Add utility class to keep track of handled ID datablocks
Currently unused, actual logic change will come in the next commit.
2018-02-22 10:58:33 +01:00
6bac7c35e8 Merge branch 'master' into blender2.8 2018-02-22 10:47:40 +01:00
51483bd49f Depsgraph: Use proper debug print flags check
Was printing some tagging/evaluation prints when only building
messages were requested.
2018-02-22 10:40:18 +01:00
9729726aa8 Depsgraph: Report graph construction time when run with --debug-depsgraph-build 2018-02-22 10:35:04 +01:00
632d66eb89 Depsgraph: Cleanup, reduce indentation level 2018-02-22 10:31:47 +01:00
4ab002bca3 WorkSpace: object-mode switching support
When changing workspaces, existing object-mode data is freed
the new workspaces mode is entered (if possible).
2018-02-22 18:18:44 +11:00
5b857102fa Add NULL checks to ED_object_base_activate
Passing a NULL active base is valid,
own changes to mode-switching didn't check for this case.
2018-02-22 17:09:25 +11:00
026ac65831 WorkSpace: Restore saved object-modes again
Was temporarily removed when moving object mode to workspace.

Note: there is an issue where eval_ctx->view_layer is NULL on load,
for now pass a view layer argument, we might wan't to set the value
instead.
2018-02-22 15:52:30 +11:00
648df0fcdb Revert "BKE: Changing ID freeing order."
This reverts commit 87c72a7d27.

Caused T54121 which breaks blend file saving.
For now crash on exit is preferable.
Possible solution is to free screen-manipulator batches in a separate
loop.
2018-02-22 15:10:43 +11:00
257cf86a05 Merge branch 'master' into blender2.8 2018-02-22 00:59:32 +01:00
5d5c6bb5ef Cycles: add Russian roulette termination for volume multiple scattering.
This mainly helps with dense volumes, rendering can be 30% faster with
little noise increase in such scenes.
2018-02-22 00:55:32 +01:00
2d81758aa6 Cycles: better path termination for transparency.
We now continue transparent paths after diffuse/glossy/transmission/volume
bounces are exceeded. This avoids unexpected boundaries in volumes with
transparent boundaries. It is also required for MIS to work correctly with
transparent surfaces, as we also continue through these in shadow rays.

The main visible changes is that volumes will now be lit by the background
even at volume bounces 0, same as surfaces.

Fixes T53914 and T54103.
2018-02-22 00:55:32 +01:00
84e92f9b3c Cycles: make principled BSDF node wider in the node editor by default. 2018-02-22 00:55:32 +01:00
6a48a9dc6e Code cleanup: fix incorrect socket names in hair and particle info nodes. 2018-02-22 00:55:11 +01:00
04964ff1f4 GWN: Fix compilation on windows 2018-02-21 18:58:29 -03:00
87c72a7d27 BKE: Changing ID freeing order.
Screen can contains manipulators that contains batches to be freed before the opengl contexts (in WM) are destroyed.

Also fix other GPU related free.
2018-02-21 22:51:35 +01:00
9a5be1fba9 Fix incorrect OSL raytype bits and add some comments. 2018-02-21 17:56:26 +01:00
606bc5f301 Fix T54105: random walk SSS missing in branched indirect paths.
Unify the path and branched path indirect SSS code. No performance impact
found on CUDA, for AMD split kernel the extra code was already there.
2018-02-21 17:56:26 +01:00
5cc1d5fe17 Fix T54107: bevel shader + normal map gives wrong result. 2018-02-21 17:56:26 +01:00
7be1928ea1 Gawain: VertexFormat: Cleanup
Reorganize struct elements by size, rename a constant.
2018-02-21 15:28:26 +01:00
c5eba46d7f Gawain: Refactor: VAOs caching AND use new VAOs manager.
A major bottleneck of current implementation is the call to create_bindings() for basically every drawcalls.
This is due to the VAO being tagged dirty when assigning a new shader to the Batch, defeating the purpose of the Batch (reuse it for drawing).

Since managing hundreds of batches in DrawManager and DrawCache seems not fun enough to me, I prefered rewritting the batches itself.

--- Batch changes ---
For this to happen I needed to change the Instancing to be part of the Batch rather than being another batch supplied at drawtime.
The Gwn_VertBuffers are copied from the batch to be instanciated and a new Gwn_VertBuffer is supplied for instancing attribs.
This mean a VAO can be generated and cached for this instancing case.

A Batch can be rendered with instancing, without instancing attribs and without the need for a new VAO using the GWN_batch_draw_range_ex with the force_instance parameter set to true.

--- Draw manager changes ---
The downside with this approach is that we must track the validity of the instanced batch (the original one). For this the only way (I could think of) is to set a callback for when the batch is getting free.
This means a bit of refactor in the DrawManager with the separation of batching and instancing Batches.

--- VAO cache ---
Each VAO is generated for a given ShaderInterface. This means we can keep it alive as long as the shader interface lives.
If a ShaderInterface is discarded, it needs to destroy every VAO associated to it. Otherwise, a new ShaderInterface with the same adress could be generated and reuse the same VAO with incorrect bindings.
The VAO cache itself is using a mix between a static array of VAO and a dynamic array if the is not enough space in the static.
Using this hybrid approach is a bit more performant than the dynamic array alone.
The array will not resize down but empty entries will be filled up again. It's unlikely we get a buffer overflow from this. Resizing could be done on next allocation if needed.

--- Results ---
Using Cached VAOs means that we are not querying each vertex attrib for each vbo for each drawcall, every redraw!
In a CPU limited test scene (10000 cubes in Clay engine) I get a reduction of CPU drawing time from ~20ms to 13ms.

The only area that is not caching VAOs is the instancing from particles (see comment DRW_shgroup_instance_batch).
2018-02-21 15:28:26 +01:00
1b3f9ecd0d Gawain: Add new context/vao manager.
This allows allocation of VAOs from different opengl contexts and thread as long as the drawing happens in the same context.

Allocation is thread safe as long as we abide by the "one opengl context per thread" rule.

We can still free from any thread and actual freeing will occur at new vao allocation or next context binding.
2018-02-21 15:28:26 +01:00
7de387f4b5 Cleanup: Don't perform borderselect on channels that aren't visible 2018-02-22 01:46:12 +13:00
cab608066a Fix: Return back to conventional way of averaging points for keyframe de-dup
The other approach was causing too much error in some cases (e.g. favouring
the lower-valued keyframes). This fix should make the resulting curves less
bumpy/jagged.
2018-02-22 01:46:11 +13:00
915d120c36 Fix: Forgot to recalculate handles after deleting keyframes 2018-02-22 01:46:11 +13:00
bba1120116 Fix: Don't average keyframe values if FCurve can only have int/discrete values
This is to prevent problems with integer/enum properties getting invalid
values set.
2018-02-22 01:46:10 +13:00
dd75211d83 Cleanup: Delete debugging code and the old version of the automerge code 2018-02-22 01:46:10 +13:00
f2cdb1c7cc Tweak/Fix for T54106 - Moving multiple selected keyframes on top of an unselected one would not merge the keys
This commit removes an earlier attempt at optimising the lookups
for duplicates of a particular tRetainedKeyframe once we'd already
deleted all the selected copies. The problem was that now, instead
of getting rid of the unselected keys (i.e. the basic function here),
we were only getting rid of the selected duplicates.

With this fix, unselected keyframes will now get removed (as expected)
again. However, we currently don't take their values into account
when merging keyframes, since it is assumed that we don't care so much
about their values when overriding.
2018-02-22 01:46:09 +13:00
63da3b79ed Minor Optimisation: Terminate early if we've passed the insertion point for tRetainedKeyframes 2018-02-22 01:46:08 +13:00
ac717928ad Feature Request T54106: When scaling keyframes, merge (by-averaging) selected keys
that end up on the same frame

Currently, when scaling keyframes in the Dopesheet, if multiple
selected keyframes end up on the same frame post-scaling, they
would not get removed by the "Automerge" setting that normally
removes duplicates on the same frame.

This commit changes the behaviour so that when multiple selected
keyframes end up on the same frame, instead of keeping all these
around on the same frame (e.g. resulting in a column of keyframes
on different values), we will instead merge them into a single
keyframe (by averaging the values). This should result in a
smoother F-Curve with fewer "stair-steps" that need to be carefully
cleaned out afterwards.

Requested by @hjalti
2018-02-22 01:46:07 +13:00
6b31a14ff7 bezt_add_to_cfra_elem() - Use same keyframe equality test as in other places
This shouldn't affect anything currently, as this function doesn't appear
to get used anywhere.
2018-02-22 01:46:07 +13:00
4d966aa19c Fix T54065: NLA-Strip Control Curves would get disabled when name-based-filtering is enabled
This bug took a while to track down. In the test file with this report,
the Nla-Strip Control Curve for strip time would get disabled if you
changed the NLA Editor to a second Graph Editor instance.

It turns out that because this second Graph Editor would have the
"filter fcurves by name" option enabled, this would trigger a lookup
of the referenced property's name (in order to test whether it matched
the filtering criteria). However, since that filtering code was written
before the introduction of these curves, it still assumed that the names
for these Control Curves should be handled the same as for standard FCurves.
Unfortunately, that doesn't work, as the property lookups fail if the standard
method is used - when the lookups fail, the F-Curves get tagged as being
invalid/disabled (and need to be reset using the "Revive Disabled FCurves"
operator).

Note: The changes in this patch look complicated, as I've had to shuffle
a bit of code around so that the name-filtering check can have access to
the additional info it needs. In the process, I've also removed the earlier
(hacky) approach where the control curves were getting added to a temp
buffer to get changed from normal FCurves to special ANIMTYPE_NLACURVES.
2018-02-22 01:46:06 +13:00
f7354119cc Fix more missing ID remapping in animation editor callbacks
Applying the same fixes as introduced in 98d797b67c
this time, for the Graph and NLA editors
2018-02-22 01:46:05 +13:00
2945831630 Depsgraph: Fix fake dependency cycle with chained IK solvers with tip excluded
Not sure why we need a relation from solver to a tip local transform, this
will be handled via parent relation.

Fixes remaining dependency cycles reported in T54083.
2018-02-21 12:04:28 +01:00
74ee98f642 Depsgraph: Fix dependency when constraint influence drives some other constraint
It is not possible to address transform at particular position of constraint
stack, and when constraint is being addressed is usually from driver variable.

This fixes some of dependency cycles reported in T54083.
2018-02-21 11:13:25 +01:00
d4ee0cee51 Merge branch 'master' into blender2.8 2018-02-21 10:51:58 +01:00
fe1a508e55 Depsgraph: Split debug flags
Now it's possible to have debug messages for following things:

- Graph construction
- Graph evaluation
- Graph tagging
2018-02-21 10:44:36 +01:00
2e73efa9b8 Depsgraph: Fix crash using --debug-depsgraph and --debug-depsgraph-no-threads
Was accessing past the array boundaries.

Should be safe for 2.79a.
2018-02-21 10:42:22 +01:00
bfa51b1b0c Fix subsurf modifier after error in merge commit
Merge commit that had the error: e99094035c
2018-02-21 04:38:29 -05:00
78ceb4b51e Merge branch 'master' into blender2.8 2018-02-21 10:30:50 +01:00
b1946e7f7a Depsgraph: Report overall number of cycles detected
Handy to quickly see if a fix fixed any of the cycles in a real rig,
or whether it's introduced new ones.
2018-02-21 10:11:43 +01:00
6535f668b4 VSE: skip non image/movie w/ proxy dir storage
This would use uninitialized filename variable,
looked into supporting this however generating proxies currently only
works for movies.
2018-02-21 18:33:48 +11:00
Dalai Felinto
813204838a Fix for draw manager cache not re-set between different render layers 2018-02-20 16:43:15 -03:00
Dalai Felinto
c14925bddf Proper implementation of compositor support for Draw Manager
We need to move the render result logic outside the render engine code.

It makes no sense for Eevee/Clay/... to have to re-implement the render resilt
creation logic. Beside the original implementation really got it wrong, by
ignoring the different render layers needed for the final render.

Finally, there is no need to re-create the logic for views. So this was also
fixed.

Note 1: This will break still if the depsgraph of the needed view layers is not
updated / created. We need to address this separately. For now if users want
to test this, just show each view layer in the viewport at least once.

Note 2: We are still getting depsgraph from scene and creating if needed.
`BKE_scene_get_depsgraph(scene, view_layer, true);` according to Sergey we need
to move the render depsgraph for the Render struct instead. I will do it
separately as well.
2018-02-20 11:03:26 -03:00
35f225b44c Cleanup: split normals: use different varnames for angle and its cosine.
Using same name for two different things is not the best idea ever...
2018-02-20 13:03:10 +01:00
87e37224c7 Fix T54069: Vertex groups for hair length is wrong in some cases
This is a regression in rB4f1c0a1 which only allowed cutting haior at the
second segment only, while there is nothing wrong with cutting hair at the
first segmewnt.
2018-02-20 10:47:01 +01:00
529cc364f4 Fix T54096: Subdivision Surface + Boolean Modifiers + Transform = crash
Don't use dm->get*Array for DM you don't own. This call can allocate temporary
CD layer, which is not thread safe at all.

Also removed hard-coded logic around CDDM check. new functions will do same
logic, but are mode DM-type-=independent.
2018-02-19 16:16:56 +01:00
Dalai Felinto
a16c0ebc59 Fix warning after fix for crash on renaming group collections
Warning introduced on: 73079e01fd.
2018-02-19 11:12:46 -03:00
Dalai Felinto
73079e01fd Outliner: Fix crash when renaming Group layer collection 2018-02-19 10:52:03 -03:00
Dalai Felinto
065630e717 Outliner: Update buttons editor when renaming collection
Reported by Pablo Vazquez (venomgfx) outside phabricator.
2018-02-19 10:48:07 -03:00
dc65a6f63b Fix T53032: Image sequence works bad with Displace modifier
We shouldn't mix image pool acuisition with and without user provided,
the fact that internally image.c uses last frame from Image datablock
confuses the logic.
2018-02-19 14:33:48 +01:00
Dalai Felinto
30d0194585 Fix collection object mode panels
They were broken since we moved object mode into workspace.
2018-02-19 09:53:39 -03:00
0e4829eb05 Cleanup: rename SequenceEditor instance to 'ed'
Name 'sequencer' & 'sequence' are too similar.
2018-02-19 22:32:41 +11:00
264691e563 Merge branch 'master' into blender2.8 2018-02-19 17:46:42 +11:00
860939ccc2 Cleanup: remove BMeshToMeshParams.calc_tessface
This wasn't used, tessface is being phased out.
Caller can run explicitly if needed.
2018-02-19 17:41:37 +11:00
05f3e245a8 Fix T54098: Crash existing /w dyntopo sculpt
Optionally don't remap indices for objects.

Checking all objects parent's would reference a freed pointer
while freeing all objects.

In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.

Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.
2018-02-19 17:34:30 +11:00
34e76c7162 Merge branch 'master' into blender2.8 2018-02-19 15:59:20 +11:00
7f65ab86e5 Cleanup: sync vertex-paint and sculpt from 2.8
Sync API changes from 2.8 to master.
2018-02-19 15:54:06 +11:00
569273c234 Merge branch 'master' into blender2.8 2018-02-18 19:59:27 +01:00
1beb6b43c1 Fix T54089: missing GLSL material draw update when changing object pass index. 2018-02-18 19:28:46 +01:00
2bc952fdb6 Merge branch 'master' into blender2.8 2018-02-18 22:33:05 +11:00
7ff3cd2693 Cleanup: group BLI_ghash_utils.c API in BLU_ghash.h 2018-02-18 22:12:27 +11:00
41ad08f3c3 Cleanup: split GHash helpers from implementation 2018-02-18 21:44:56 +11:00
deacb3d6b8 Cleanup: add 2d suffix to BLI files
Some of these API's can have 3D versions, explicitly name them 2D.
2018-02-18 21:27:33 +11:00
fee4b646c4 Cycles: tweak CUDA messages and avoid build errors with existing sm_2x configs. 2018-02-18 00:53:25 +01:00
1dcd7db73d Code cleanup: remove some more unused code after recent CUDA changes. 2018-02-18 00:53:03 +01:00
9e717c0495 Cycles: Remove Fermi texture code.
This should be the last Fermi removal commit, unless I missed something.
It's been a pleasure Fermi!
2018-02-17 22:56:58 +01:00
e1ef902058 Cycles: Remove fermi related defines from the code.
Did not touch Texture related defines, that comes next.
2018-02-17 22:19:54 +01:00
2eaf90b305 Cycles: Remove Fermi support from CMake and update runtime checks in device_cuda.cpp.
Fermi code in Cycles kernel and texture system are coming next.
2018-02-17 16:15:07 +01:00
75396edb31 Buildbot: Disable Cycles CUDA support on 32bit, and stop building sm_2x. 2018-02-17 15:49:37 +01:00
5d3f679013 Code cleanup: remove WM subwindows.
These no longer made much sense after regions were added, they just
duplicated state that was already in the regions.
2018-02-17 14:23:19 +01:00
cbd0e09898 Fix GL_FRAMEBUFFER_UNSUPPORTED warning in console on macOS. 2018-02-17 14:12:54 +01:00
f2453ecdcd Merge branch 'master' into blender2.8 2018-02-17 01:39:29 +01:00
09eb790f4b DRW: Fix assert with DRW_shgroup_material_instance_create. 2018-02-16 23:06:43 +01:00
85f179eb23 Fix T53399: Dopesheet keyframes and the drawing of points were not visible with some Intel cards 2018-02-16 18:02:06 -02:00
4b1904c8df GHOST: Windows: Print information on the GPU 2018-02-16 16:46:58 -02:00
5bc2c17161 fix:T50079 collada matrix and blender matrix are transposed. This was not regarded by the animation importer, so it was creating very odd results 2018-02-16 16:58:20 +01:00
e1a686e444 fix: limit precision also for animation matrixes if the limit option is set (gives nicer output for inspection) 2018-02-16 16:55:20 +01:00
c45f28ce95 New function to check if running opengl render 2018-02-16 16:52:27 +01:00
7fdf720fb1 Fix rotation issues due to matrix to quaternion ambiguities
Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D3066
2018-02-16 15:19:35 +01:00
18bb0bc569 Object Mode: exit sculpt on selection 2018-02-17 00:01:25 +11:00
ce4d52c4f3 Object Mode: exit vert/weight paint on selection
Was keeping data, since objects no longer store modes,
object mode can't be properly detected.
2018-02-17 00:01:25 +11:00
c28dea5e24 Vertex Paint: expose exist paint-mode to API 2018-02-17 00:01:25 +11:00
31f47f44de Cleanup: avoid shadowing w/ name 'base' 2018-02-17 00:01:25 +11:00
233a886ceb Code cleanup: deduplicate code for running Python scripts outside Blender. 2018-02-16 12:51:49 +01:00
3d2d58391a Tests: add OpenGL UI drawing tests.
This reuses the Cycles regression test code to also work for OpenGL UI drawing.
We launch Blender with a bunch of .blend files, take a screenshot and compare
it with a reference screenshot, and generate a HMTL report showing the failed
tests and their differences.

For Cycles we keep small reference renders to compare to in svn, but for OpenGL
developers currently have to generate the references manually. How to use:

* WITH_OPENGL_DRAW_TESTS=ON in CMake
* BLENDER_TEST_UPDATE=1 ctest -R opengl_draw
* .. make code changes ..
* ctest -R opengl_draw
* open build_dir/tests/opengl_draw/report.html

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00
0f23f618f3 Tests: split off render report test code from Cycles tests.
This renames test environment variables from CYCLESTEST_* to BLENDER_TEST_*.

Differential Revision: https://developer.blender.org/D3064
2018-02-16 12:51:49 +01:00
5fde26454c Fix bplayer (c) 2018-02-16 12:40:11 +01:00
c3ace7950d Merge branch 'master' into blender2.8 2018-02-16 11:51:41 +01:00
8dfe9ef4e3 Fix bplayer (c) 2018-02-16 10:42:43 +01:00
451d5cef0f Fix part II of T53977: Severe problem with multiple instances of a library (save and reload).
Once 'losing lib' issue is fixed (in previous commit), we have new issue
that this could lead to several copies of the same linked data-block in
.blend file. Which is not good. At all.

So had to add a GHash-based check in libraries reading code to ensure we
only load a same ID from a same lib once.
2018-02-16 10:34:00 +01:00
8165234b46 Fix part I of T53977: Severe problem with multiple instances of a library (save and reload).
The issue was that when a same lib was found several times in loaded
.blend, we'd only keep the first occurence. But since Blender expects
next data-blocks to belong to last found library, we could actually
be adding data-blocks assigned to copies of the duplicated lib to
another, totally unrelated lib.

Those data-blocks were then obviously not found when actually loading
libs content, and lost.

Note that this only fix one part of the issue, current code can
generate several copies of same linked data-block now, will fix in
another commit.
2018-02-16 10:34:00 +01:00
fa0e89b9e8 Metalball drawing: rename mball helpers to handles
and also rename some related functions
2018-02-16 02:01:09 -02:00
3ba6ff6750 Cleanup: quiet warning 2018-02-16 09:14:25 +11:00
a24be95b0f GWN: Fix ubo debug printf 2018-02-15 19:16:08 +01:00
e401e2d89c GWN: Fix attrib arrays giving incorrect name depending on the platform.
It seems that some opengl implementations are returning "[0]" after array names but some others dont.

Remove the "[0]" so everything is consistent.
2018-02-15 19:16:08 +01:00
4438325ec9 Merge branch 'master' into blender2.8 2018-02-15 18:15:00 +01:00
e03f335b1d Code cleanup: simplify switch statement, ensure we catch missing enums. 2018-02-15 18:13:07 +01:00
b1ee10aa1b Fix T54073: crash and uninitialized memory in Cycles displacement hashing. 2018-02-15 18:00:55 +01:00
ad37ccbc32 Fix crash reading deg_point_cache_transform.blend test, saved with 2.8.
In general 2.8 files may not be readable in master, but might as well fix
this case so all the lib/tests can be opened still.
2018-02-15 18:00:55 +01:00
4fd3f8db9d Cleanup: Remove debug-only code 2018-02-15 17:57:51 +01:00
b879502da4 Fix T54076: MCE in Graph mode - clip.graph_select_border does not work by header menu
While the script should be using INVOKE_PREVIEW for operators in clip view,
window manager was lacking some switch statements.

Thanks Brecht fore review!
2018-02-15 16:58:56 +01:00
ca5fdd857b Merge branch 'master' into blender2.8 2018-02-16 01:17:43 +11:00
2aef87bfae Cleanup: rename BLI_thread.h API
- Use BLI_threadpool_ prefix for (deprecated)
  thread/listbase API.
- Use BLI_thread as prefix for other functions.

See P614 to apply instead of manually resolving conflicts.
2018-02-16 01:13:46 +11:00
df1c88b652 Merge branch 'master' into blender2.8 2018-02-15 14:15:55 +01:00
ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
4da6c49613 Cleanup: Style, braces with macros
See https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Braces_with_Macros
2018-02-15 12:41:35 +01:00
c0bbc4abf5 Cleanup: Remove BLI_ prefix from listbase macro
This is kind of doesn't matter where macro itself is defined.

We should stick to the following:

- If some macro is actually more an inline function, follow regular
  function name conventions.
- If macro is a macro, type it in capitals. Use module prefix if that
  helps readability or it if helps avoiding accidents.
2018-02-15 12:38:21 +01:00
2589f55a55 Merge branch 'master' into blender2.8 2018-02-15 12:33:44 +01:00
6d4022f619 Simple hair children: Make twist affected by texture
This completes twist feature, which is now possible to also control by
texture. Since textures can not easily contain negative values as well,
same trick with 0.5 neutral as vertex groups is used.

All in all, this twist features allows to do following things.

Original hair:

{F2287535}

Hair with scientifically calculated twist value of 0.5:

{F2287540}

And we can also twist braids in opposite directions dependent on left/right
side:

{F2287548}
2018-02-15 12:24:48 +01:00
5ce6ca0536 Fix T54078: Adding subsurf prior to particle system breaks simple children vgroups and textures
cpa->num points to a face index on BASE mesh, but get_child_modifier_parameters()
expects index on a FINAL dm. So wrong index was used here.
2018-02-15 11:53:58 +01:00
67cec97387 Simple hair children: Make twist affected by vertex group
The idea is to give a control over direction of twist, and maybe amount of
twist as well. More concrete example: make braids on left and right side of
character head to be twisting opposite directions.

Now, tricky part: we need some negative values to flip direction, but weights
can not be negative. So we use same trick as displacement map and tangent normal
maps, where 0.5 is neutral, values below 0.5 are considered negative and values
above 0.5 are considered positive.
2018-02-15 11:53:58 +01:00
ffde74a878 Simple hair children: Initial implementation of twist control
It allows to have children hair to be twisted around parent curve, which is
quite an essential feature when creating hair braids.

There are currently two controls:

- Number of turns around parent children.
- Influence curve, which allows to modify "twistness" along the strand.
2018-02-15 11:53:58 +01:00
bb3efe6127 Blenlib: Assert when attempting to rotate point around vector and store result in the point
This isn't supported since there are subsequent reads to all point coordinates
after modification started.

Probably we need to create a temp copy of point, but that's like extra CPU
ticks.
2018-02-15 11:53:57 +01:00
ff82968a6c Particles: Wrap insane amount of arguments to child modifier evaluation
Use single structure. It seems we will need to pass more information soon,
so better to do it via the structure.
2018-02-15 11:53:57 +01:00
9d2a699a90 Avoid unnecessary sqrt calls 2018-02-15 21:38:24 +11:00
c1784824ff Fix crash when rendering particles with cycles
view_layer is NULL when the render engine is created, this gets passed
around and ends up in this code causing a crash. This should be reverted
after the render engine api is updated to set view_layer.
2018-02-15 03:26:59 -05:00
144a661152 Make particle edit draw mode a noop
Seems this was just a template, but that template painted everything
green. Not sure what this draw mode should do really.
2018-02-15 03:26:59 -05:00
c4a783bdf7 Fix lack of particles updates and disappearing particles
The conditionals in particle code are... some sort of madness... I'm not
even sure what the correct behavior should be from looking at it.

In this case the path cache generation was being skipped in edit mode.
2018-02-15 03:26:59 -05:00
5dba0b68f8 Tag update when using particle edit brushes 2018-02-15 03:26:59 -05:00
eb0d430b4d Fix crash with particle cut brush and other brushes
Why is bedit->data.context NULL?
2018-02-15 03:26:59 -05:00
7f38e59810 Start bringing back particle edit
Its kind of broken, but have to start somewhere
2018-02-15 03:26:59 -05:00
c98af0faaf Add versioning code to make particles with default size visible again
Due to changes in draw code particles from old files that may have had a
default draw size of 0 will not be visible. Old draw code would check
for this and adjust the size, however the unit for draw size has changed
from pixels to BU, and it no longer makes sense to have such checks.

This patch is to ensure particles from such files remain visible.
2018-02-15 03:26:59 -05:00
ca7f826c6f Merge branch 'master' into blender2.8 2018-02-15 18:05:02 +11:00
b8b8669b28 Cleanup: style, warning 2018-02-15 18:03:55 +11:00
58ba89b5be Fix T54075: Align Objects fails w/ empty mesh 2018-02-15 11:33:47 +11:00
70f1b8cc40 Cleanup: style 2018-02-15 11:13:54 +11:00
56fa48969e Fix T54072: Crash splitting edges 2018-02-15 11:05:37 +11:00
e6386ed286 Merge branch 'master' into blender2.8 2018-02-14 21:49:13 +01:00
b5fe00d1ac Cycles: restore Particle Info Index for now, keep it next to Random.
It seems to be useful still in cases where the particle are distributed in
a particular order or pattern, to colorize them along with that. This isn't
really well defined, but might as well avoid breaking backwards compatibility
for now.
2018-02-14 21:45:57 +01:00
2464dcef37 Eevee: Fix broken AO and Contact shadows on certain platform.
This was caused by ce0f70fbd6
2018-02-14 19:02:03 +01:00
0ef981f603 DRW: Refactor: Less feature duplication with Gwn.
This removes the need of custom attribs for instancing.
Instancing works fully with dynamic batches & Gwn_VertFormat now.

This is in prevision of the VAO manager patch.
2018-02-14 18:59:42 +01:00
629a874817 DRW: Add instance buffer manager.
This manager allows to distribute existing batches for instancing
attributes. This reduce the number of batches creation.
Querying a batch is done with a vertex format. This format should
be static so that it's pointer never changes (because we are using
this pointer as identifier [we don't want to check the full format
that would be too slow]).

This might make the original Instance Data manager useless but it's currently used by DRW_object_engine_data_ensure().
2018-02-14 18:59:42 +01:00
ab7e7a005b GWN: Add new dynamic type of batches and remove
Theses batches keeps their memory chuck allocated after transfer to be reused and updated very often.

NOTE: This commit break instancing in DRW. (it's fixed in the next commit)
2018-02-14 18:59:42 +01:00
1e9ef2a25e GWN: Add GWN_batch_draw_procedural
This allow to drawn large amounts of primitives without any memory footprint.
2018-02-14 18:59:42 +01:00
0f3bc636c8 GWN: Allow drawing instances without batch_instancing 2018-02-14 18:59:42 +01:00
01244df007 DRW: Refactor: Make use of the new Gawain long attrib support. 2018-02-14 18:59:42 +01:00
df86e9cab5 GWN: Extend support for multiple of 4 components in batches. 2018-02-14 18:59:42 +01:00
27a7174546 GWN: Fix style and line of code that does nothing! 2018-02-14 18:59:41 +01:00
a5afe13e1c GWN: Add support for 4x4 Matrices and instancing attributes.
Only support float matrices specifically for code simplicity.
2018-02-14 18:59:41 +01:00
3102bf2889 Merge branch 'master' into blender2.8 2018-02-14 15:16:50 +01:00
f6107af4cf Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
These are used for randomization, so it's convenient if the index is already
hashed and consistent with the Object Info node.
2018-02-14 14:55:46 +01:00
618bc6c679 GPU: use alpha blend that works for drawing to transparent buffer.
It's unlikely to ever be intentional to square the source alpha, as happens
with glBlendFunc, so this changes the blending throughout the code.
2018-02-14 14:00:57 +01:00
7028a11db9 GPU: don't use multisample for entire window, only for offscreen 3D viewport.
Now that the new 3D viewport draws to a multisample offscreen buffer, there is
no good reason anymore to create an entire multisample window and pay the
performance/memory cost for other regions that don't need it.

GL_MULTISAMPLE now only gets enabled for offscreen buffers, so we don't need
to check for it throughout the UI code anymore.

Differential Revision: https://developer.blender.org/D3062
2018-02-14 14:00:48 +01:00
8049ad21b0 Fix incorrect RNA path to view_render settings. 2018-02-14 13:31:37 +01:00
3851033a06 Code cleanup: simplify subwindow code. 2018-02-14 12:31:13 +01:00
c8e661706f Particles: Avoid multiple function declarations in multiple places
This makes it really hard to spot errors when function signature changes.
2018-02-14 11:52:58 +01:00
8003059646 Particles: Cleanup, remove trailign whitespace 2018-02-14 11:46:33 +01:00
1c34825b4f Hair child: Use clamp function to clamp curve evaluation
Avoids redundant calls to the curve evaluation.
2018-02-14 11:42:09 +01:00
c09e4ae08a Math utils: Add clamping functions 2018-02-14 11:21:27 +01:00
a966852362 CMake: Expose Cycles devices support as CMake option
Handy to disable GPU based devices when it's needed to run Valgrind.
2018-02-14 10:32:32 +01:00
c341dd0585 CMake: Fix cimpilation error when CUDA dynload is disabled but toolkit is not installed 2018-02-14 10:20:26 +01:00
88bd994a37 Merge branch 'master' into blender2.8 2018-02-14 16:04:07 +11:00
b48815a9b7 Cleanup: use prefix for tests
Allows for running all `bmesh_*` or `object_*` tests.
2018-02-14 16:02:21 +11:00
769c9a2363 Object Mode: remove Scene.obedit
This means we can support having the same scene in different windows
with different edit-objects.
2018-02-14 08:49:20 +11:00
6e040b045a GPU: add offscreen buffer drawing utility functions. 2018-02-13 20:02:31 +01:00
e9b1163162 Code cleanup: stop using rectangle textures in window draw, simplify code. 2018-02-13 20:02:31 +01:00
afb213f876 Code cleanup: fix incorrect reading of GL scissor coordinates.
These are often the same as the viewport, but not always.
2018-02-13 20:02:31 +01:00
96a2807e73 Code cleanup: remove unneeded gla* 2D drawing functions. 2018-02-13 20:02:31 +01:00
ff2d1edcd4 Fix blenderplayer build. 2018-02-13 20:02:31 +01:00
b330804ff3 Merge branch 'master' into blender2.8 2018-02-14 01:06:41 +11:00
9fb1f9c5cd Add ED_object_editmode_exit_ex
Allow exiting editmode from non-active scene.
2018-02-14 00:39:39 +11:00
37f65e9dc4 Cycles: Implement index output for hair node
This is like the only way to add variety to hair which is created
using simple children. Used here for the hair.

Maybe not ideal, but the time will show.
2018-02-13 14:20:47 +01:00
9e2ec6c86a Fix T54064: Can't create new Cycles materials
Was caused by object mode removal
2018-02-13 07:03:12 -05:00
cd517c002f Object Mode: remove Scene.obedit for RNA 2018-02-13 21:06:51 +11:00
8234f24838 Object Mode: Loop over objects for ED_editors_exit
We could loop over active objects but this ensures don't miss any
and avoids complicated context checks.
2018-02-13 21:00:26 +11:00
c8597a465f Object Mode: remove Scene.obedit
Add ED_screen_window_find, BKE_workspace_edit_object
2018-02-13 20:55:12 +11:00
754d3a2fe6 Object Mode: remove Scene.obedit for 3D View 2018-02-13 19:44:21 +11:00
d8992192e5 Object Mode: pass edit-object to outliner drawing
Also add 'OBEDIT_FROM_EVAL_CTX' macro.
2018-02-13 18:45:35 +11:00
2c6d079a90 Object Mode: pass edit-object to UV API 2018-02-13 18:29:49 +11:00
dacc6d4b02 Object Mode: remove Scene.obedit in draw manager
Part of larger change to remove this variable entirely.
2018-02-13 18:15:47 +11:00
d640ce40aa (Nodes) Display image name if any in the Cycles Image and Environment Texture node title 2018-02-13 00:58:26 +01:00
fc99eed5be Fix random walk SSS issues with different base and subsurface color.
Burley SSS uses a bit of strange thing where the albedo and closure weight are
different, which makes the subsurface color act a bit like a subsurface radius
indirectly by the way the Burley SSS profile works.

This can't work for random walk SSS though, and it's not clear to me that this
is actually a good idea since it's really the subsurface radius that is supposed
to control this. For now I'll leave Burley SSS working the same to not break
backwards compatibility.
2018-02-12 21:08:59 +01:00
b37dff9239 Fix part of T53080: don't use current scene world for icon previews.
This can be very slow if it contains a big texture, and it's not
necessarily setup in a useful way anyway, and materials can be used
in multiple scenes.
2018-02-12 20:39:40 +01:00
37ce77ba06 Buildbot: Remove usage of deprecated chroot 2018-02-12 17:56:19 +01:00
ce8b5bd90d Add boolean regression test. 2018-02-12 07:23:50 -05:00
147c24aeeb Fix T54032: Adding torus test fails
rna_LayerObjects_active_object_update used wrong viewlayer.

Regression in 345c6298e9
2018-02-12 19:39:52 +11:00
bbb2fa14c8 Merge branch 'master' into blender2.8 2018-02-12 17:57:53 +11:00
657396be08 Error in last commit, disable cycles when not enabled
Would only disable when loading old preferences.
2018-02-12 17:56:14 +11:00
2c3d4f7e65 Merge branch 'master' into blender2.8 2018-02-12 17:39:58 +11:00
53431a560e Disable cycles when WITH_CYCLES=OFF 2018-02-12 17:37:39 +11:00
fc97e120f6 BKE_addon: new/free/ensure functions 2018-02-12 17:24:18 +11:00
0bf615fc24 GHOST: Optimize and simplify the creation of a GHOST_Context on Windows
Instead of cloning the window to create dummyHWNDs and dummyHDCs to avoid calling the SetPixelFormat more than once in the same window, use the original window and HDC and do not call the SetPixelFormat again.

In addition to avoiding a lot of unnecessary calls, it simplifies the code and makes it match the others OS
2018-02-10 00:32:13 -02:00
832f7a6648 Merge branch 'master' into blender2.8 2018-02-09 20:36:59 +01:00
Dalai Felinto
5216eaec1d Eevee: Film filter default to 1.5 instead of 1.0
Cycles already uses 1.5 as default. BI original 1.0 filter doesn't look good for
Eevee. The ideal scenario would be for both Cycles AND Eevee to use the same DNA
setting.

But for now it is nice to at least have Eevee renders to look better by default.

Note: This handles doversion for 2.7x files only. Files previously created in
2.8 need to be manually corrected.
2018-02-09 17:16:36 -02:00
a6968e87f1 Cycles: add random walk subsurface scattering to Principled BSDF.
Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:42 +01:00
0df9b2c715 Cycles: random walk subsurface scattering.
It is basically brute force volume scattering within the mesh, but part
of the SSS code for faster performance. The main difference with actual
volume scattering is that we assume the boundaries are diffuse and that
all lighting is coming through this boundary from outside the volume.

This gives much more accurate results for thin features and low density.
Some challenges remain however:

* Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help
  here, but it's unclear still how much it helps in real world cases.
* Due to this being a volumetric method, geometry like eyes or mouth can
  darken the skin on the outside. We may be able to reduce this effect,
  or users can compensate for it by reducing the scattering radius in
  such areas.
* Sharp corners are quite bright. This matches actual volume rendering
  and results in some other renderers, but maybe not so much real world
  objects.

Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:33 +01:00
7978306cbb Merge branch 'master' into blender2.8 2018-02-09 17:24:23 +01:00
3ab5ef7b4f Fix (unreported) error on freeing timers which customdata pointer shall not be freed.
Looks like there was no way to avoid that so far, since
WM_event_add_timer_notifier can set mere int-in-pointer there, this can
cause issues. So added mere flags system to wmTimer to allow
controlling this.
2018-02-09 17:23:35 +01:00
7e3e542aab Merge branch 'master' into blender2.8 2018-02-09 16:26:05 +01:00
ea9099473a Fix (unreported) crash when duplicating a FileBrowser window in preview draw mode.
We did not clear preview or smoothscroll timers pointers in copy code...
2018-02-09 16:15:42 +01:00
be4ebb7fa6 Merge branch 'master' into blender2.8 2018-02-09 14:27:32 +01:00
97597ed600 Doc: attempt to document RNA's FunctionFlag.
Tired of searching through code to find which is what, and how to use it
in the C callback, everytime I need anot-so-common option...
2018-02-09 13:34:18 +01:00
908ee2e0f2 Paint Dirt: remove operator call from Python
Instead of calling an operator I just call `collection.new()`. Moving the
code into a separate function also simplifies it. In its new form there is
also no undefined behaviour when me.vertex_colors is non-empty but without
active layer.
2018-02-09 12:52:46 +01:00
5db950e860 Cleanup: use workspace for object_mode when possible 2018-02-09 22:14:39 +11:00
Dalai Felinto
25074be697 Fix collection syncing when creating new collections from the outliner
We were not passing a scene collection parent to the BKE_collection_add
function, which in turn made syncing not work.

Right now we:
* Explicitly pass the master collection in this case
* Fallback to the master collection in other cases

With unittest.
2018-02-09 09:05:27 -02:00
3c09077e3b Paint Dirt: some small fixes
- normalize → average the vector: the vector isn't normalized here, because
  it doesn't necessarily becomes unit length. Instead, the sum is converted
  to an average vector.
- angle is the acos()…: the dot product between the vertex normal and the
  average direction of the connected vertices is computed, and not the
  opposite.
- The initial `con` list was discarded immediately and replaced by a new
  list.
- File didn't end with a newline.
2018-02-09 10:35:03 +01:00
37e53ca5f3 Missed opencollada edit in recent changes 2018-02-09 20:25:32 +11:00
07ccb8b97c Fix crash with font on curve
Was a mistake from recent texspace changes.

Reported by Pablo here in the studio!
2018-02-09 10:14:08 +01:00
32287212f5 Cleanup: pass eval_ctx to sculpt_init_session
Matches vertex paint mode
2018-02-09 17:46:46 +11:00
9b9861578d Merge branch 'master' into blender2.8 2018-02-09 13:56:49 +11:00
8f9386596f CMake: include missing headers 2018-02-09 13:50:05 +11:00
8a6b83d27e Fix T53958: Sequencer zoom 1:1 fails 2018-02-09 13:39:47 +11:00
5e65791516 Fix T53347: Vertex paint crash
Vertex paint was still using sculpt mode brush (which can be NULL).
2018-02-09 12:00:26 +11:00
Dalai Felinto
518d59970d Fix blenderplayer (tm) 2018-02-08 17:44:25 -02:00
3b61d2bb68 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/ui.py
2018-02-09 03:00:20 +09:00
859379ac48 Fix for missing "Use Freestyle" toggle in the Cycles "Layer" options panel.
Reviewed By: Brecht Van Lommel (brecht), Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D3048
2018-02-09 02:48:21 +09:00
29d2ff7b31 Cycles: unify OSL BSSRDF closure into a single bssrdf() closure with method.
This is similar to the upstream unified microfacet() closure, and makes it
easier to extend in the future.
2018-02-08 16:56:11 +01:00
aabafece03 Code refactor: tweaks in SSS code to prepare for coming changes.
This also fixes a subtle bug in the split kernel branched path SSS, the
volume stack update can't be shared between multiple hit points.
2018-02-08 16:56:11 +01:00
28e2bc90dd Code refactor: remove unnecessary RNG offset in branched path code.
This is only needed for SSS which bounces to a different shading point.
2018-02-08 16:56:11 +01:00
8c8e53c12d Cycles tests: separate directory for sss tests. 2018-02-08 16:56:11 +01:00
d3248bb50b Disable fast adjust code. Add other end spec matching.
This fixes a few caess where new width adjustment code

was less than ideal.
2018-02-08 10:48:24 -05:00
74fa84f37f Remove redundant check for armature mode
Caller ensures pose-mode, this flag is only set while drawing.
2018-02-09 02:39:54 +11:00
be2bd5d722 Fix mixed weight-paint & pose mode 2018-02-09 02:34:32 +11:00
9278614115 Merge branch 'master' into blender2.8 2018-02-08 16:27:28 +01:00
e0597baed5 Remove Carve boolean
We've got quite comprehensive BMesh based implementation, which is way easier
for maintenance than abandoned Carve library.

After all the time BMesh implementation was working on the same level of
limitations about manifold meshes and touching edges than Carve. Is better
to focus on maintaining one boolean implementation now.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3050
2018-02-08 15:37:44 +01:00
bdc708762c Merge branch 'master' into blender2.8 2018-02-08 15:14:22 +01:00
9dc7dca3a2 Depsgraph: Fix missing camera animation after visibility changes
Synchronize code in on_visible_update with depsgraph building.

Need to update all cameras, since they might be hooked up to marker.
2018-02-08 15:12:38 +01:00
c3e61cab8a Merge branch 'master' into blender2.8 2018-02-08 23:48:36 +11:00
f088c6b9f6 Mesh: concave quad support
Previously quads always split along first-third vertices.
This is still the default, to avoid flickering with animated deformation
however concave quads that would create two opposing triangles now use
second-fourth split.

Reported as T53999 although this issue has been known limitation
for a long time.
2018-02-08 23:38:17 +11:00
5f2b4002f4 Dopesheet: Synchronize selection on bones when selecting everything
This is also how box selection and mouse selection is working.

Requested by Hjalti, reviewed by Joshua. Thanks!
2018-02-08 12:36:39 +01:00
022a481789 Fix error in object-mode removal
Wasn't setting transform context
2018-02-08 21:58:45 +11:00
127d515f3d Merge branch 'master' into blender2.8 2018-02-08 21:43:37 +11:00
1ddd03b793 Fail gracefully when editmode data doesn't exist
Sync changes from 2.8
2018-02-08 21:36:16 +11:00
345c6298e9 Object Mode: move to workspace struct
- Read-only access can often use EvaluationContext.object_mode
- Write access to go to WorkSpace.object_mode.
- Some TODO's remain (marked as "TODO/OBMODE")
- Add-ons will need updating
  (context.active_object.mode -> context.workspace.object_mode)
- There will be small/medium issues that still need resolving
  this does work on a basic level though.

See D3037
2018-02-08 21:14:26 +11:00
Dalai Felinto
14a19fed78 Fixing builds for 2.8 - outliner typo 2018-02-08 08:03:35 -02:00
611712fcc8 Linux: Add appdata.xml file for packagers
D3025 by @januz
2018-02-08 15:59:16 +11:00
8fa19e1950 Fix: Data-Blocks view in Outliner no longer displayed property values, making it semi-useless
Partially revert efe1af3d11

The offending commit over-zealously removed the datablocks viewer case
as well, when only the condition needed to be modified.
2018-02-08 16:15:49 +13:00
42c99ee5f5 DRW: Fix crash caused by fixing the leak (badly).
Previous commit was af425f3f7a
2018-02-08 00:41:27 +01:00
44aaffc684 Merge branch 'master' into blender2.8 2018-02-07 22:27:08 +01:00
00d2dfa93a Forgot to return actual value in previous own commit.
Sorry about the noise...
2018-02-07 22:26:37 +01:00
b8d376174c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_files_link.c
2018-02-07 22:19:11 +01:00
49745aa5ff Library linking code: proper early out in case there is nothing to link. 2018-02-07 22:09:44 +01:00
749caf4984 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_files_link.c
2018-02-07 21:54:52 +01:00
843271d0a5 Library reload code: add early out in case there is nothing to reload. 2018-02-07 21:52:38 +01:00
af425f3f7a DRW: Fix memory leak with dupli objects.
This was caused by dupli's ObjectEngineData that were not free.

This allocates the data using the instance data manager (no alloc/free between frames). Though the data should be treated as not persistent in this case.
2018-02-07 19:15:55 +01:00
8a2f93b2ab DRW: Opti: Use less bytes in DRWUniform. 2018-02-07 19:15:55 +01:00
25c8b5046f Clay: Small refactoring of matcap_colors and put ubos into sldata.
Ubos needed to be free correctly.
Also the matcap colors are statics and does not need to be uploaded each drawcall.
2018-02-07 19:15:55 +01:00
ade2aaba09 Merge branch 'master' into blender2.8 2018-02-07 17:17:24 +01:00
56f6938b5e Depsgraph: More fixes for shape keys
Made shape keys to work for meshes. Also added missing code for curves.

Curves and lattices will not have shape keys visible, since modifiers support
is still to be done for them.
2018-02-07 14:15:24 +01:00
84155ab21a Depsgraph: Fix crash with shape keys and lattices
Only crash is fixed, still need to do something about missing recalc
or something like that.
2018-02-07 12:26:30 +01:00
1dafe759ed Update CUEW to latest version
This brings separate initialization for libcuda and libnvrtc, which
fixes Cycles nvrtc compilation not working on build machines without
CUDA hardware available.

Differential Revision: https://developer.blender.org/D3045
2018-02-07 11:53:01 +01:00
5892efa883 Depsgraph: Fix crash when visible update is called after tagging for updates
It is possible to have non-NULL scene in graph which was never built yet,
this happens when ID is tagged for update for non-built graph.

Was causing crash opening deg_anim_pose_bones.

Reported by Mai in IRC, thanks!
2018-02-07 11:21:16 +01:00
60eef5c7ff Depsgraph: Fix node sockets as driver variables
Fixes empty not moving int deg_anim_material_driving_empty.

Reported by Mai in IRC, thanks!
2018-02-07 10:57:54 +01:00
da128c12b5 Fix error with Main.eval_ctx.object_mode being unset
This made vertex/weight/sculpt crash.

Add BKE_workspace_update_object_mode which sets the object mode from the
workspace.

We may want to re-visit exactly when this is set, for now call within
wm_event_do_refresh_wm_and_depsgraph.
2018-02-07 18:35:05 +11:00
17f5d7f3c5 Depsgraph: Add missing relationship between object transform and point cache reset
This fixes an issue where old cache data was used after an object has been moved.
Particles were coming from very wrong positions. Reproduction case is to move an
object while animation is running and then let the animation loop back and
play again.

Differential Revision: https://developer.blender.org/D3044
2018-02-07 01:18:04 -05:00
5b01e428a9 Move eval_ctx after object mode changes 2018-02-07 16:38:17 +11:00
e99094035c Merge branch 'master' into blender2.8 2018-02-07 15:59:16 +11:00
38d35603f2 Correct header guard in last commit 2018-02-07 15:52:34 +11:00
6981861fcf Cleanup: Python context access
Avoid access from bpy when it's already declared.
2018-02-07 15:47:54 +11:00
ce0f70fbd6 Eevee: Fix SSR & AO on Vega + Mesa.
Really strange bug. Maybe gl_FragDepth is broken on this implementation.
2018-02-07 05:44:05 +01:00
708ef19d88 GPU: Remove Mesa + Vega hack.
This is not needed anymore with linux 4.15 + Mesa 17.3.3.
2018-02-07 05:44:05 +01:00
17577c53c6 Merge branch 'master' into blender2.8 2018-02-07 11:19:01 +11:00
1e4b612d6a Cleanup: add _types.h suffix to DNA headers 2018-02-07 11:14:08 +11:00
Dalai Felinto
77b61b554c Outliner: Add object(s) to new collection
Suggested by Pablo Vazquez (venomgfx).

The idea here is that it should be easy to work in the outliner by picking a
bunch of objects and adding them to a new collection.
Where is the new collection? In the same level as the "outliner active" object.

Note, since the outliner has no pure concept of an active object, I'm using
the highlight tag for this. Hopefully it works fine.

It should work in "Collections", "View Layer", and "Groups".
Only when collections are not filtered out.
2018-02-06 18:39:14 -02:00
Dalai Felinto
107486e673 Fix poll for OUTLINER_OT_object_remove_from_collection
Outliner groups mode support no filtering.
2018-02-06 18:37:37 -02:00
Dalai Felinto
fcb430afba Rename OUTLINER_OT_collection_object_remove > _object_remove_from_collection
Better make it clear it is different than OUTLINER_OT_collection_objects_remove.
2018-02-06 13:28:37 -02:00
Dalai Felinto
9631c1ac1a Outliner: Operator to delete outliner selected elements from collection
Suggested by Pablo Vazquez (venomgfx).
2018-02-06 13:19:58 -02:00
Dalai Felinto
5633bab2d0 Fix crash when no active object
To reproduce the crash: delete the active object of the scene.

This bug was introduced on e9c40b7339.
2018-02-06 13:19:12 -02:00
66521b382b Depsgraph: Correction to previous particle fix
The reason it appeared working was due to left-over debug code to force
time dependency.

Real fix seems to include force tagging objects used by duplication,
similar to what we do for some other modifiers already.
2018-02-06 14:51:02 +01:00
1ae5dfd049 Fix T54005: Broken IDProp copying from RNA code.
When destination IDProp did not exist, new code (related ot static
overrides) would not do nothing...

IDProps and RNA are really not easy to tame, thinking more and more we
should totally bypass RNA and directly use (add) IDP code to handle
comparison and diff creation/application of IDProps.

But for now, this bandage should to the trick.
2018-02-06 14:39:39 +01:00
0eb9d2adc6 Merge branch 'master' into blender2.8 2018-02-06 23:36:12 +11:00
f9f64ca4a3 Use eObjectMode for function arguments 2018-02-06 23:34:58 +11:00
885d78150d Use eObjectMode for function arguments 2018-02-06 23:27:49 +11:00
5376c739f5 Merge branch 'master' into blender2.8 2018-02-06 23:06:23 +11:00
486e2547ee DNA: move eObjectMode into own header
Add a enum headers to DNA, to be included in other headers
so function signatures can use enums for better type safety.

Add DNA_*_enums.h matching DNA_*.types.h as needed.
2018-02-06 22:58:13 +11:00
98dcd33238 Fix Collada building after changes in API.
Seriously guys... *Full* build when you change APIs!
2018-02-06 12:11:00 +01:00
f9deea57d9 Fix bplayer (c) 2018-02-06 12:10:41 +01:00
ce0cb4de8d Object Mode: use eval_ctx for modifiers_isCorrectableDeformed
Some other minor changes from D3037 as well
2018-02-06 19:35:06 +11:00
f9da89a38d Partially revert changes from 2a184f3d2b
Ended up removing the need for eval_ctx,
but left it being initialized.
2018-02-06 19:17:28 +11:00
74f7fb084c Object Mode: use eval_ctx for get_active_constraints 2018-02-06 18:03:29 +11:00
fa588e9ef4 Object Mode: pass eval_ctx to ED_object_iter_other 2018-02-06 18:03:29 +11:00
2a184f3d2b Object Mode: use eval_ctx for paint & object 2018-02-06 18:03:29 +11:00
906ed54d28 Object Mode: ED_mesh_mirrtopo_* check edit-mode data
Replace object mode checks for edit-mode data
2018-02-06 18:03:29 +11:00
e9c40b7339 Object Mode: pass as arg to stats_string 2018-02-06 18:03:29 +11:00
5ec016169b Object Mode: use eval_ctx for context/screen code 2018-02-06 18:03:28 +11:00
269ed0a770 Object Mode: pass eval_ctx in outliner functions 2018-02-06 18:03:28 +11:00
021bf4c2fe Object Mode: use eval_ctx for keyframe & weight calculation 2018-02-06 18:03:28 +11:00
c7fecab2ef Object Mode: Use eval_ctx mode for drawing, paint & modifiers 2018-02-06 18:03:28 +11:00
ef11113399 Object Mode: use eval_ctx mode in transform code
This adds EvaluationContext into TransInfo
2018-02-06 18:03:28 +11:00
91db372b48 Object Mode: pass object mode to CTX_data_mode_enum_ex 2018-02-06 18:03:28 +11:00
28dfc47cf0 Object Mode: Add to EvaluationContext & DRWContextState 2018-02-06 18:03:28 +11:00
1c600cc643 Object Mode: use obdata when loading from editmode
Avoids having to check the objects mode in 'update_from_editmode'.
2018-02-06 18:03:28 +11:00
7b0cb7e00d Object Mode: don't check posemode in the BGE
No reason pose mode should change behavior
2018-02-06 18:03:28 +11:00
a3409d3f53 Fix T54003: Particles - Size and random size not present in "physics" tab in Advanced mode
The check to see if `use_advanced_hair` was enabled was actually in two places
(render panel `draw` function and physics panel `poll` function). As these
properties are only in one place now the check in `draw` isn't needed anymore.

Related: T53513, a6c69ca57f
2018-02-05 20:25:08 -05:00
78c6684ee9 Freestyle: Unnecessary repeats of Cycles property copying.
As a follow-up to the commit rB354f92a49458795c69f857de927c5b1531cd3618
for fixing Freestyle crash when using Cycles (thanks Brecht for the fix), this revision
applies a related bugfix addressed partly in D3040 (item #2 in the description).
2018-02-06 09:11:59 +09:00
9810f4a11c Freestyle: Additional debug info for the render engine used for stroke rendering. 2018-02-06 08:53:59 +09:00
ce3e0afe59 Fix T54001: AMD OpenCL fails with certain resolutions, after recent changes.
We should actually be using CL_DEVICE_MEM_BASE_ADDR_ALIGN for sub buffers,
previous change in this code was incorrect. Renamed the function now to
make the specific purpose of this alignment clear, it's not required for
data types in general.
2018-02-05 22:19:49 +01:00
Dalai Felinto
e75c04898f Fix duplicator visibility logic
Cycles old behaviour is to hide the duplicator on rendering at all times.

We have since a few months an option in 2.8 to control the duplicator
visibility on its own. However when the duplicator is also duplicated, things
were not working properly.

What we do now is, in addition to the duplicator visibility control, is to not
have the source collection of the duplicator object to ever influence its
visibility when the object is been duplicated.

So if the user wants to reproduce Cycles old behaviour all that is required is
to have different collections, one for the original to-be duplicated objects
that you hide in for the view layer used in the final render. And another
collection with only the first duplicator (which in turn duplicates other
duplicators).

I know this all may sound confusing, so please just give it a try, it's simpler
than it sounds.
2018-02-05 19:01:27 -02:00
bd9ed0228b Fix bevel profile=1 problems, see T39132, T38458, T40278, T51010,
T53783.

Before, profile=1 ("square outside") only worked well in a few cases
(some "pipes", cube corners). This makes it work well pretty much
everywhere.
2018-02-05 14:21:43 -05:00
354f92a494 Fix Freestyle not copying Cycles properties to stroke rendering scene. 2018-02-05 18:57:26 +01:00
a8a77609d3 Fix Cycles + Freestyle rendering crash, due to bug in RNA override code. 2018-02-05 15:08:04 +01:00
Nathan Letwory
f9fcda533b Fix typo in struct name obejct to object.
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D3041
2018-02-05 11:31:33 +02:00
a1c45a453f Merge branch 'master' into blender2.8 2018-02-05 17:58:31 +11:00
f911fb0744 Minor change to last commit
Keep mode checks simple, nest other checks in their body.
2018-02-05 17:56:09 +11:00
ceb645bc56 Fix T53986: Crash saving during sculpt stroke
Also remove unused struct member.
2018-02-05 17:54:13 +11:00
23d2f708f3 Eevee: Pixel Filter: Add parameter & rescale final LUT. 2018-02-05 01:59:14 +01:00
cc1e88b37a Eevee: AA: Add Blackmann-Harris pixel filter distribution.
This leads to a huge improvement of AntiAliasing quality.
There is no other distribution now and there is not settings displayed to the user. That's for another commit.
2018-02-05 01:59:14 +01:00
08112c2acf Eevee: Style: More Const correctness. 2018-02-05 01:59:14 +01:00
143b0ab52a Eevee: Render: Reset winmat before jittering it again. 2018-02-05 01:59:14 +01:00
c8e87edccb Eevee: Render: Fix Ao pass background contamination.
It was poluted by the additive blend mode.
2018-02-05 01:59:14 +01:00
f61bcc70e1 Eevee: Render Fix black normals on blended material in the normal pass. 2018-02-05 01:59:14 +01:00
956a7bc3ea Eevee: Render: Force normal buffer creation if needed. 2018-02-05 01:59:14 +01:00
e1d5d55b56 Eevee: Codestyle: Indent #ifdefs 2018-02-05 01:59:14 +01:00
07e1212e34 Eevee: Render: Fix black reflections in 1st sample. 2018-02-05 01:59:14 +01:00
e84e8cb497 cycles: fix black render with cycles_cubin_cc.
I have honestly no idea how this got swapped..
2018-02-04 15:12:35 -07:00
f8236e4869 cycles: fix cxx11 usage for cycles_cubin_cc 2018-02-04 15:11:08 -07:00
eeb621566a Merge branch 'master' into blender2.8 2018-02-04 10:46:34 +11:00
36c1122b96 msvc: Use source folder structure for project file.
This patch changes the huge list of projects in visual studio into a nice tree matching the source folder structure. see D2823 for details.

Differential Revision: http://developer.blender.org/D2823
2018-02-03 16:38:27 -07:00
a5052770b8 cycles: Add an nvrtc based cubin cli compiler.
nvcc is very picky regarding compiler versions, severely limiting the compiler we can use, this commit adds a nvrtc based compiler that'll allow us to build the cubins even if the host compiler is unsupported. for details see D2913.

Differential Revision: http://developer.blender.org/D2913
2018-02-03 10:59:09 -07:00
1bc0cd0071 Merge branch 'master' into blender2.8 2018-02-03 16:10:01 +01:00
db989e1f11 Fix more Cycles incorrect principled BSDF mixing due to missing initialization.
Spotted by Ha Hyung-jin, thanks!
2018-02-03 13:43:44 +01:00
7ea7ce970c Fix build error with CUDA 9.1 and compute capability 2.x. 2018-02-03 13:36:38 +01:00
bb6f1d159a Cycles: make displacement a supported feature.
Adaptive subdivision remains experimental, still needs more work.
2018-02-03 12:20:58 +01:00
f9ea097a87 Cycles: add Vector Displacement node and extend Displacement node.
This adds midlevel and object/world space for displacement, and a
vector displacement node with tangent/object/world space, midlevel
and scale.

Note that tangent space vector displacement still is not exactly
compatible with maps created by other software, this will require
changes to the tangent computation.

Differential Revision: https://developer.blender.org/D1734
2018-02-03 12:20:26 +01:00
065a84c8d0 Eevee: Fix crash when using Ogl render and subsurface. 2018-02-03 02:19:10 +01:00
226685d3a0 Eevee: Render: Fix hashed-alpha testing. 2018-02-03 02:19:10 +01:00
4820c7400f Eevee: Render: Make sure all probes are refreshed before rendering. 2018-02-03 02:19:10 +01:00
e530d0ccaa Eevee: Perf: Put transparent sorting before the render loop. 2018-02-03 02:19:10 +01:00
36b259fa88 Eevee: Render: Add ambient occlusion pass support. 2018-02-03 02:19:10 +01:00
39706a0a3d Eevee: Subsurface: Release separate albedo texture if not used. 2018-02-03 02:19:10 +01:00
269d9eb54c Eevee: Render: Fix emission shader normal output 2018-02-03 02:19:10 +01:00
Dalai Felinto
217bc17a3c Fix draw manager F12 evaluation mode
This effectively allows for ob duplicator_render/viewport to work properly
when doing final renders.
2018-02-02 18:03:04 -02:00
dcea87b58e fix: rBc4a19e988bb4 error stepped in by a merge from mmaster 2018-02-02 17:30:54 +01:00
Dalai Felinto
c7c070c2ec Collections: Operator to duplicate a collection
When duplicating a layer collection directly linked to the view layer we copy
the collection and link it.

For all the not directly linked layer collectionns, we try to sync the layer
collection flags, overrides, ...

Also we make sure the new collection is right after the original collection.

We also expose this in RNA, via collection.duplicate().
2018-02-02 12:25:05 -02:00
Dalai Felinto
a4d2b102f3 Collections: Operator to select collection objects
This is only supported by layer collections (the ones accessible
in the outliner when you see "View Layer").
2018-02-02 12:25:05 -02:00
26dff781b3 Merge branch 'master' into blender2.8 2018-02-02 12:21:24 +01:00
37beac8eb8 Fix missing group duplicated by hair in render
Was happening when viewport visibility on the particle system is disabled.
This became an issue after c45afcf, but the actual issue goes a bit deeper
and the following aspects were involved:

- Relations builder for particle system was ignoring particle system if
  it's visibility is not enabled for viewport. This is something what
  shouldn't have been done -- depsgraph relations are supposed to be the
  same no matter if it's viewport or render.

- Relation builder was only dealing with duplication set to object, but
  was ignoring group duplication.

This is technically a regression in 2.79a-RC as well, so would need to
backport this fix to the branch after extra testing is done here in the
studio.
2018-02-02 12:05:11 +01:00
c4a19e988b fix: silence warnings about unused local variable (thanks to dfelinto for the hint) 2018-02-02 11:57:10 +01:00
fe82a09f89 Fix T53980: IK influencing REST POSE with New Depsgraph 2018-02-02 10:37:06 +01:00
c3eb22e2ab Merge branch 'master' into blender2.8 2018-02-02 14:15:29 +11:00
88e69806b9 Cleanup: wrap function args 2018-02-02 14:11:14 +11:00
b2dc0e6970 Fix T53978: Bad memory access after recent fix to BSDF mixing
Added proper checks after BSDF allocation and cleaned up existing
inline checks.

Was introduced in 7261d675e6
2018-02-01 20:03:29 -05:00
7003c8a143 Eevee: Render: Fix volume sampling. 2018-02-02 01:18:25 +01:00
263083c7e6 Eevee: Render: Make sure background does not write to ssr data. 2018-02-02 00:50:18 +01:00
78a77fe622 fix: unintentionally commented out collada animation export 2018-02-02 00:49:42 +01:00
9173a6f519 Eevee: Render: Fix NaNs in Normal pass. 2018-02-02 00:48:33 +01:00
44c4d62092 Eevee: Render: Make render passes appear in compositor. 2018-02-01 21:38:16 +01:00
7049bcf76e Eevee: Render: Fix broken "non-multiview" render. 2018-02-01 21:08:05 +01:00
00f1bc1685 Eevee: Render: Add support for multiview. 2018-02-01 20:48:30 +01:00
ab5f86a04e Eevee: Render: Add Transparent Background option.
... under a new "Film" tab in the render properties panel.
2018-02-01 20:48:30 +01:00
e52c5bcdb5 Eevee: Add mist pass support.
Eevee: Render: Fix crash when not enabling mist pass.
2018-02-01 20:47:56 +01:00
12bd214b9a World: Use enum for mist falloff parameter. 2018-02-01 18:09:17 +01:00
d57741d91f Eevee: Simplify/Fix view_vecs calculation.
Now view_vecs[0][2] ALWAYS contains Near clip plane and view_vecs[1][2] = far - near.
2018-02-01 18:09:17 +01:00
c95f3a3616 Eevee: Render: Fix Normals of refraction shader. 2018-02-01 18:09:17 +01:00
253b412ace Eevee: Render: Add Subsurface Pass support. 2018-02-01 18:09:17 +01:00
7884ae6eb2 Fix T53686: VSE Render crash when zooming timeline
This is rather a workaround to avoid main thread freeing all glyph caches
at the same time as sequencer uses fonts to draw text sequences.

Ideally we need to either make cache more local, or user-counted or to make
somewhat more global locks. All this ends up in a bigger refactor which is
better for 2.8. For the meantime let's make Blender more stable with a tiny
workaround.

Downside is that keeping zooming things up and down in interface during render
will increase memory usage by unused glyph caches. It's not too bad though,
all unused caches will be freed first time at area zoom after render.

Thanks Bastien for review!
2018-02-01 16:34:30 +01:00
1a840c3e27 Fix T53951: Copy ms runtime dlls using InstallRequiredSystemLibraries.cmake
Differential Revision: https://developer.blender.org/D3032
2018-02-01 08:26:14 -07:00
Dalai Felinto
a57063a432 Merge remote-tracking branch 'origin/master' into blender2.8 2018-02-01 13:13:44 -02:00
7e928c3bbc Fix: msvc build error with bli_fileops.h
bli_fileops.h was using uint64_t without including the proper header.

issue triggered by rBb0af44fa4d7a2e134b315c49a4fbdf573f781004
2018-02-01 07:59:52 -07:00
0bf54dd66b Fix T53686: VSE Render crash when zooming timeline.
Epic fail from recent 'security' fixes (rBe04d7c49dca9). ;)

To be backported to 2.79a!
2018-02-01 15:55:38 +01:00
ff54dbd8fa Cycles: Attempt to fix 32 bit linux compilation 2018-02-01 15:13:54 +01:00
7bd86d74ba Cycles: Fix for non-vectorized version of bitscan()
It was doing bit search in an opposite direction comparing to a
vectorized version.
2018-02-01 15:11:17 +01:00
b8bb15f744 Finalize/enable new static override for linked groups.
Behavior is expected to be simillar to 'make proxy' on linked groups, it
basically allows you to select which object in the group will be to
'root' override (usually, the armature), checks which other objects
needs to be overridden as well, overrides the group itself too, and
instantiates the group and the root overridden object.

It seems to be working, though handling of armature deformation is kind
of totally broken in blender2.8 currently (modifiers...). ;)
2018-02-01 14:08:18 +01:00
73b4cb5c89 Fix some issues in new RNA diff code. 2018-02-01 14:07:51 +01:00
Dalai Felinto
781dd5edb5 Fix audaspace mess in 2.8
All these files were removed since accidental commit, revert and merge in 2.8.

ea31f0ac3b + 0a4e170c28 + 11f9a23a28 + 7b27b10fa6
2018-02-01 09:22:57 -02:00
cd317fab65 Fix wrong attempt to get depsgraph from RNA Groups ViewLayer. 2018-02-01 12:10:10 +01:00
1ce8a7f3d0 Fix incorrect message bus tag count 2018-02-01 15:56:36 +11:00
70841e58c4 Merge branch 'master' into blender2.8 2018-02-01 15:18:58 +11:00
653746f5f8 Cleanup: pass userdef to write_userdef, const args 2018-02-01 15:16:36 +11:00
4174524cb0 Error in last commit 2018-02-01 15:15:57 +11:00
6ffc6b30aa Merge branch 'master' into blender2.8 2018-02-01 14:59:14 +11:00
4d96202c9e Cleanup: Python code-style 2018-02-01 14:58:05 +11:00
e4c9cf7088 Merge branch 'master' into blender2.8 2018-02-01 14:02:33 +11:00
10fec1f153 Cleanup: Python code-style (addons, wm) 2018-02-01 13:58:44 +11:00
078e012cd9 Cleanup: rename BLI_*_empty() -> clear()
Consistent with other BLI API's
2018-02-01 13:40:53 +11:00
7b27b10fa6 Merge branch 'master' into blender2.8 2018-01-31 22:36:16 -02:00
0a4e170c28 Revert "tmp"
This reverts commit ea31f0ac3b.
2018-01-31 22:35:46 -02:00
11f9a23a28 Merge branch 'master' into blender2.8 2018-01-31 22:34:29 -02:00
42ca1fe89c gpu_shader_material: Correct incorrect glsl texture of Voronoi, Noise, and Musgrave on some Intel GPUs 2018-01-31 22:31:08 -02:00
ea31f0ac3b tmp 2018-01-31 22:11:01 -02:00
4bd72586aa Merge branch 'master' into blender2.8
Apply Fix T50198 also in blender2.8
2018-02-01 00:43:01 +01:00
22faf66c8b fix T50198: The OpenCollada error handler must return true after detecting uncritical errors. 2018-02-01 00:41:39 +01:00
4b5ac3b768 Merge branch 'master' into blender2.8 2018-01-31 17:17:43 +01:00
9d39980cfd I18n disambiguation: IRIS is both a file format and a VSE wipe effect...
At some point, we could probably think about removing IRIS file format
support, don't think there are much of those around anymore. But for
now, let's add a translation context to wipe effect. :)

Reported in T43295 by @blend-it, thanks.
2018-01-31 16:43:04 +01:00
6a6f7547e3 DRW: Finish 85d3de94c6 2018-01-31 15:00:39 +01:00
616182ea44 Eevee: SSS: Fix SSS perturbating SSR normals. 2018-01-31 14:41:26 +01:00
458dd4100f Merge branch 'master' into blender2.8 2018-01-31 14:24:38 +01:00
483b981d63 Outliner: Fix crash when invoking operators of a collection or group
The crash occurred when trying to see a tooltip or activate any of the operator's tools with the cursor outside the outliner area.
2018-01-31 11:07:25 -02:00
f309becf2d Fix possible concurency issue in mesh normals computation.
Failure in own code from last December, thanks @sergey for finding it.

To be backported to 2.79a.
2018-01-31 12:30:39 +01:00
6d55b522fe Merge branch 'master' into blender2.8 2018-01-31 19:03:45 +11:00
87608e66e1 WM: correct comment, variable name for addons 2018-01-31 19:02:43 +11:00
afaca68ea8 Eevee: Render: Fix crash when using a sun lamps with shadow. 2018-01-31 02:53:03 +01:00
55a238edd6 Eevee: Render: Add Normal pass output. 2018-01-31 02:53:02 +01:00
76135d6b72 Eevee: Fix indentation and fix output normal of emission shader. 2018-01-31 02:53:02 +01:00
251fd91064 Eevee: Fix Crash when rendering using Render Border. 2018-01-31 02:53:02 +01:00
85d3de94c6 Eevee: Fix crash when Rendering (F12) using camera mapping. 2018-01-31 02:53:02 +01:00
4801e3fd92 Eevee: Display compositing tab. 2018-01-31 02:53:02 +01:00
807713e4f2 UI: re-enable alt-key for editing selection
Fixes T53950 where changing node layers applies to all selected nodes.
2018-01-31 11:54:04 +11:00
Dalai Felinto
d8059a5f11 Make layers unittest pass after filter cleanup
Update your svn lib.

Unittests broken since 7628961391.
2018-01-30 19:06:23 -02:00
Dalai Felinto
133afc07b2 Compositor / Render Layer Node: Fix wrong layer after deleting view layers
I was calling the ntree syncing function too late. So the index of the layer
was -1 since it was no longer in the ListBase, making all RenderLayer nodes
to decrease their respective `custom1` (even going to negative sometimes).
2018-01-30 18:31:38 -02:00
7b675e0dc4 Fix blender player (tm) 2018-01-30 16:36:15 -02:00
97d225ed6f Fix Cycles incorrect principled BSDF mixing with some parameter variatons.
Spotted by Ha Hyung-jin, thanks!
2018-01-30 16:36:15 -02:00
7a868d127f Fix blender player (tm) 2018-01-30 16:11:58 +01:00
Dalai Felinto
dbed11d272 Fix FOREACH_OBJECT_RENDERABLE using stack data
Since 30a966a726 when I removed the recursion, the code was still relying
on stack data. This would crash in release often, and it should crash always.

Big thanks to Sergey Sharybin for spotting the issue.
2018-01-30 13:07:08 -02:00
7261d675e6 Fix Cycles incorrect principled BSDF mixing with some parameter variatons.
Spotted by Ha Hyung-jin, thanks!
2018-01-30 15:05:47 +01:00
0d64857c3f Merge branch 'master' into blender2.8 2018-01-30 14:32:27 +01:00
Dalai Felinto
b5cbc8bb60 Fix FOREACH_OBJECT_RENDERABLE going over the same object twice
Which is really silly because we were already tagging the ids, but simply
never checking them back.
2018-01-30 11:27:12 -02:00
b3c4a2a8da Fix T52520: Metaballs in edit mode causes infinite Cycles viewport reset
The issue was introduced by eb016eb as a fix for T41258, which added depsgraph
tagging with zero flag. The comment was saying that it's to make derived caches
to be updated, however bot sure how that could possibly work: tagging ID for
update with 0 flag only sets updated tags in bmain in old dependency graph.

In the new depsgraph, where object data is a part of depsgraph, doing such a
tag forces object to be updated, which re-triggers viewport rendering, which
is causing such an infinite viewport render rest.

Can not reproduce any crashes here, so maybe it's fine to move on with this
change.
2018-01-30 14:20:23 +01:00
Dalai Felinto
30a966a726 Fix FOREACH_OBJECT_RENDERABLE recursion going over the roof
This was leading to so much recursion that it was failing here.
How to test it: Open wanderer.blend and try to render (F12).

Note: This won't fix F12 rendering for wanderer with Eevee. Something else is
going wrong there.
2018-01-30 10:53:09 -02:00
c80b1f5410 Cleanup: warning, spelling 2018-01-30 21:02:27 +11:00
d0f63d402d Fix T53943: Weight paint crash in new scene 2018-01-30 20:33:20 +11:00
b0af44fa4d Fix T50630: Fluid fails on win32 w/ unicode paths
Allow overriding gzip open w/ elbeem.
2018-01-30 14:31:04 +11:00
e83cbf4610 Fix crash drawing light probe 2018-01-30 13:36:41 +11:00
58c92f9f0d Fix light probe callbacks
Even though this wasn't crashing here, the arg types were wrong.
2018-01-30 13:15:04 +11:00
3e8c96ae46 DRW / Render: Make render result show when using final render with eevee. 2018-01-29 22:27:22 +01:00
1fe2b4bf60 Eevee: Remove unused variable. 2018-01-29 22:00:15 +01:00
376d42304b Eevee: Add Z pass render result. 2018-01-29 22:00:15 +01:00
0f93d67617 Eevee: Display render button in render panel 2018-01-29 22:00:15 +01:00
f107af3519 Eevee: Add support for TAA/SuperSampling for final render. 2018-01-29 22:00:15 +01:00
8cce339131 Eevee: Add new "render samples" properties. 2018-01-29 22:00:15 +01:00
ba9a4dedda Eevee: Initial Final Render support.
TAA / multiple samples is not working at the moment.
2018-01-29 22:00:15 +01:00
847613c34e Render: Abort operator if there is no render_to_image() function 2018-01-29 22:00:15 +01:00
b6dbd8723c DRW / Render: Add support for render pipeline in drawmanager.
For simplicity we choose to execute the rendering of Opengl engines in the main thread and block the interface.
This might be addressed in the future at least for video rendering.

A drawmanager wrapper (DRW_render_to_image) is called by the render pipeline to set up the Opengl state and then call the specific draw_engine->render_to_image function.
2018-01-29 22:00:15 +01:00
01a62515cb DRW: Add "hardcoded" stipples for sun ray display. 2018-01-29 22:00:15 +01:00
Dalai Felinto
0f35436bcf Outliner: Moving object context menu to Python, and adding hierarchy
As suggested by Pablo Vazquez, though I think we can refine it a bit with icons.
I will wait for his feedback on it.
2018-01-29 18:01:57 -02:00
38bc973a6c uvedit_draw: Ensure first if it has any UV to draw
Otherwise an assert could be launched
2018-01-29 16:56:52 -02:00
d072022bbf Deduplicate GLSL frag code in particle drawing
Differential Revision: D2993
2018-01-29 15:51:23 -02:00
9577ebde79 Fix T53598: OpenGL Render Animation does not update shadows
General idea of the fix: skip the whole draw manager callback madness which
was used to tag object's engine specific data as dirty. Use generic recalc
flag in ObjectEngineData structure instead. This gives us the following
benefits;

- Sovles mentioned bug report.
- Avoids whole interface lookup for opened viewports for EVERY changed ID.
- Fixes missing updates when viewport is temporarily invisible.

Reviewers: dfelinto, fclem

Differential Revision: https://developer.blender.org/D3028
2018-01-29 17:54:20 +01:00
006c66b1ff Refactor object engine data storage
Main idea is to make specific engine types be a subclass of generic
ObjectEngineData structure.

This required following changes:

- Have extra size argument to engine data allocation function.

  Not sure whether there is less error-prone way of doing this.

- Add init() callback to engine data allocation function.

Additionally, added some extra checks to Eevee's engine data getters, so we do
not silently cast lamp data to lightprobe data.

Reviewers: dfelinto, fclem

Differential Revision: https://developer.blender.org/D3027
2018-01-29 17:53:51 +01:00
1eeb846e78 Fix Cycles viewport render not updating when tweaking displacement shader.
This was disabled to avoid updating the geometry every time when the
material includes displacement, because there was no way to distinguish
between surface shader and displacement updates.

As a solution, we now compute an MD5 hash of the nodes linked to the
displacement socket, and only update the mesh if that changes.

Differential Revision: https://developer.blender.org/D3018
2018-01-29 17:07:08 +01:00
fb941679bb Fix Cycles allocating too much device memory, after recent memory refactoring.
Spotted by Ha Hyung-jin, thanks!
2018-01-29 17:07:08 +01:00
282b3d0fcd Revert "Fix T53914: Volumetric scattering now goes correctly through transparent surfaces."
This reverts commit 3c852ba074. This is breaking
the regression tests, and maybe requires some deeper changes to really fix.
2018-01-29 17:07:08 +01:00
cebc7bb198 Fix nan problem in previous bevel commit.
For chains, access to g_prod[0] was undefined.
And two minor style (whitespace) changes.
2018-01-29 10:01:19 -05:00
263efb0b9a Depsgraph: Correction for previous fix
Original fix only worked when there is one custom property.
2018-01-29 15:06:44 +01:00
Dalai Felinto
d174f3bd60 Outliner: Remove Toggle options from object RMB
Task suggested by Pablo Vazquez (venomgfx).
2018-01-29 12:05:04 -02:00
68c1e3c28d Depsgraph: Fix missing update when property from proxy rig drives something 2018-01-29 14:53:27 +01:00
6eb2b57f5a Depsgraph: Disable labels on relations
This code was disable a while back and got re-enabled by some previous debug
process. Having relation names in dot file helps understanding what's going
on in one cases, but makes things spread too far away in others.
2018-01-29 14:45:45 +01:00
70286a7652 Depsgraph: Cleanup, line wraps 2018-01-29 14:43:12 +01:00
083f6af8f8 Fix more filebrowser not refreshing correctly after new message bus system.
This does not affect current blender2.8, but is mandatory for asset
engine branch.

Bottom line being, we also need to 'survey' changes in actual
SpaceFileBrowser struct, not only its FileSelectParams sub-struct.
2018-01-29 12:50:15 +01:00
c501855eb6 Fix filebrowser not refreshing correctly after new message bus system.
Generic ED_area_do_msg_notify_tag_refresh callback only tags area for
refresh, not redraw. This was not updating view e.g. when changing
ordering options in top region, until you'd mouse-over main filelisting
region...

So now, always tag area for redraw in filbrowser's refresh callback.
2018-01-29 10:24:30 +01:00
be0b2ac18b Manipulator: ignore mouse location w/ view widgets
When pressing on a button to zoom for eg,
using zoom-to-mouse-position doesn't make any sense.

There is also zoom speed scaling which increases the closer the cursor
is to the top-edge of the screen, which was noticable since the
navigation widget is currently at the top of the screen.
2018-01-29 17:40:19 +11:00
da885b922c Merge branch 'master' into blender2.8 2018-01-29 17:32:20 +11:00
45fdea48c1 Fix T53614: New Depsgraph ignores NLA strips
The new depsgraph was only considering the active action
when attaching relations from the AnimData component/operation
to the properties that are affected by the animation data.
As a result, only properties animated by the active action
were working, while those animated by NLA strips did not change
when playing back/scrubbing the timeline.

This commit fixes this introducing a recursive method to properly
visit all NLA strips, and calling DepsRelBuilder::build_animdata_curves_targets()
on each of those strips.
2018-01-29 19:01:59 +13:00
79639ccd6b 3D View: use_mouse_init for zoom & trackball orbit 2018-01-29 17:01:51 +11:00
961602f7ae Cleanup: move boolean options into flag
- Rename eViewOpsOrbit to eViewOpsFlag
  since VIEWOPS_ORBIT_DEPTH isn't just used for orbiting.
- Move use_ensure_persp & use_mouse_init into the flag.
- Remove viewops_data_create_ex.
2018-01-29 15:38:37 +11:00
64888eabfd Fix: Disable leftover debug prints from earlier work on the rna path renaming/fixing code 2018-01-29 17:22:03 +13:00
d13b943853 Fix T53909: Joining armatures did not remap names on merged action data
Technically this was not a bug, as this functionality was not meant to
work. (Drivers were already handled though, as they are part of the rig)
It was assumed that there was little value in having this functionality
available, as in most pipelines, animation production only begins after
the rig has been locked down (see bug report comments for more details).

On reflection, in most common situations, there's probably no harm in
doing these rna path fixups. This commit takes advantage of some similar
code I recently put in place in the Grease Pencil branch (for joining GP
objects and their layers).

Important Note for Animators/Riggers/TD's:
Please be aware that after joining armatures, some of the animation may
still need to be redone (due to changes in the transform hierarchies/
transform spaces that the animation is applied in). We do not attempt
to correct for these problems, and it is unlikely that we will in future.
2018-01-29 17:22:03 +13:00
5dd5286995 Apply Pose as Rest Pose: Bendy Bone support
The "Apply Pose as Rest Pose" operator now affects Bendy Bone settings
too, making it possible to use interactive posing tools (e.g. Pose Sculpting
brushes) to get the desired shape for the rest-pose shape of Bendy Bones.
When such posing tools are available, this change makes it easier to get
the desired Bendy Bone shapes, as you are no longer restricted to using
buttons to get the desired effects.
2018-01-29 17:22:02 +13:00
5b67a7a2e7 Cleanup: rename user preference flags
USER_ZBUF_ORBIT -> USER_DEPTH_NAVIGATE
The name didn't make sense since it's used for all view navigation.

Also rename USER_ZBUF_CURSOR -> USER_DEPTH_CURSOR since zbuf
is an internal detail.
2018-01-29 15:07:43 +11:00
42a8799efa Cleanup: comments & whitespace 2018-01-29 14:59:56 +11:00
ca116153fa Cleanup: ViewOpsData struct members
- Group initial/previous/current members
  Was using terms old/prev/last/orig in confusing way.
- Replace x,y variables with vectors.
- Remove unused members.
2018-01-29 14:42:50 +11:00
902198a117 3D View: internal option not to use mouse location
When accessing view-port operators from widgets
we need the ability not to use auto-depth or zoom-to-mouse.

Trackball rotation still needs to be supported.
2018-01-29 13:56:35 +11:00
5964c34f8c Cleanup: minor simplification for zoom/dolly
Make args more consistent.
2018-01-29 13:42:28 +11:00
02832c4ca1 Cleanup: de-duplicate common 3D view properties 2018-01-29 13:26:35 +11:00
561d738eaa Fix T53459, inconsistent bevel on identical edges.
The old algorithm depended on vertex order.
The new one uses a global least squares solution on chains
and cycles of edges where loop slide induces a dependency.

See https://wiki.blender.org/index.php/Dev:Source/Modeling/Bevel
in the "Consistent Widths for Even Bevels" for derivation of
the new algorithm.
2018-01-28 19:19:02 -05:00
045f3bda64 Merge branch 'master' into blender2.8 2018-01-28 17:49:58 +01:00
d099b1073b Usual i18n/UI messages fixes. 2018-01-28 17:27:53 +01:00
dfbe415372 Merge branch 'master' into blender2.8 2018-01-28 17:18:56 +11:00
bff1dae767 Cleanup: style, spelling 2018-01-28 17:00:39 +11:00
1c905046d1 Merge branch 'master' into blender2.8 2018-01-28 16:40:23 +11:00
d386d4e7c4 Cleanup: use doxy sections for view3d_view.c
Also move ..._needs_opengl functions into view3d_utils.c
2018-01-28 16:29:32 +11:00
9a5d198cd2 Use factory startup for icon generation
Avoids using local preferences.
2018-01-28 16:03:32 +11:00
87215bbae4 Merge branch 'master' into blender2.8 2018-01-28 15:58:11 +11:00
88174bd22c Merge branch 'master' into blender2.8 2018-01-28 15:18:33 +11:00
7aaede920f Cleanup: warning 2018-01-28 15:15:32 +11:00
1164a70634 Cleanup: move 3D view utilities into own file
Operators and utility functions were getting too mixed up,
the files were also quite large.
2018-01-28 15:01:35 +11:00
Stefan Werner
3c852ba074 Fix T53914: Volumetric scattering now goes correctly through transparent surfaces.
There was a check for volume bounces at every surface intersection. That could lead to a volume scattered path being terminated
when passing through a transparent surface. This check was superfluous, as the volume shader evaluation already checks the
number of volume bounces and once it passes the max, volume shaders will not return scatter events any more.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht, #cycles

Tags: #cycles

Maniphest Tasks: T53914

Differential Revision: https://developer.blender.org/D3024
2018-01-27 21:39:19 +01:00
3cc8b35699 Speed up a little drawing of UVs in the Image Editor
In my tests the previous loop was running in 200 ms. With this change it now runs in 17 ms.

The difference in the end is still not great because the `draw_uvs_lineloop_bmface` function is called for each face and has an ImmBegin and ImmEnd in the function itself
2018-01-26 20:42:30 -02:00
7b29e91711 Code refactor: make mixed small/large BSSRDF radii more robust. 2018-01-26 23:06:53 +01:00
Dalai Felinto
492145f8ac Collections: As it turned out, this is quite harmless to have accessible everwhere
I think ultimately we may move these operators from the outliner space to scene.

Partial revert of a08f687b91.
2018-01-26 19:42:42 -02:00
Dalai Felinto
6634eb3490 Make outliner new collection operator work via viewport too
Technically this revert b3bcbc9e85. This however doesn't seem to be needed
any longer.
2018-01-26 19:37:08 -02:00
Dalai Felinto
5798345c99 Outliner: If a collection is empty and you drag something inside it, it opens up.
Idea by Pablo Vazquez.
2018-01-26 17:10:31 -02:00
d611cf9233 Fix mixed BSDF + BSSRDF sampling bug in path tracing, after 095a01a73a.
Spotted by Ha Hyung-jin, thanks!
2018-01-26 18:47:21 +01:00
ce4915cddb Code refactor: store RGB BSSRDF in a single closure.
Previously we stored each color channel in a single closure, which was
convenient for sampling a closure and channel together. But this doesn't
work so well for algorithms where we want to render multiple color
channels together.
2018-01-26 18:47:21 +01:00
47a3bbcc34 IMB: Add asserts that returned fps and fps base are strictly positives.
Forgot to add that in previous commit, also related to T53003.
2018-01-26 15:14:32 +01:00
567afcca20 Related to T53003: tweak scene fps range.
Move restricted 'reasonable' range to ui_range, and allow wider values
for manual settings.
2018-01-26 15:12:18 +01:00
c528b9b777 Fix T53003: IMB: Invalid framerate handling due to short integer overflow.
FFMPEG uses int for the numerator, while Blender uses a short. So in
cases people gave weird exotic framerate values and we cannot reduce
enough the numerator, we'd get totally weird values (even negative frame
rates sometimes!)

Now we add checks for short overflow and approximate as best as possible
in that case (error should not matter unless you have shots of at least
several hundreds of hours ;) ).
2018-01-26 14:59:16 +01:00
376fc19b24 fix:T53271 now using the context scene layer as requested 2018-01-26 13:37:45 +01:00
Dalai Felinto
f71d8f6b48 Fix Collada importer (crash)
We were not tagging depsgraph to update its nodes after importing new objects.
2018-01-26 09:16:31 -02:00
Dalai Felinto
0e2bc1a4ac Make object_update comment about lack of ID even more clear 2018-01-26 09:15:56 -02:00
Dalai Felinto
ab77363619 Fix silly crash on Collada
Note: This was originally wrongly committed together with an outliner tooltip
fix, re-committing separately now. See bd7060a87f.
2018-01-26 08:45:27 -02:00
Dalai Felinto
de079abfbd Outliner tooltips: Small refactor, future proof change
In the future we may have siblings to collections (like overrides) that are not
collections. This change make sure tooltips will keep working.

Note: This was originally wrongly committed together with a Collada fix,
re-committing separately now. See bd7060a87f.
2018-01-26 08:45:20 -02:00
Dalai Felinto
13238ee991 Revert "Fix crash on Collada exporter"
This reverts commit bd7060a87f.

I mixed two commits together (a fixup for outliner tooltips and a collada fix).
Re-committing them individually.
2018-01-26 08:43:17 -02:00
Dalai Felinto
bd7060a87f Fix crash on Collada exporter 2018-01-26 08:38:46 -02:00
Dalai Felinto
16a3ae580c Outliner: Tooltips for reorder operators
I really would prefer if we were to use the dropbox API for this.
That said, we now have some tooltips that work.

I'm using the new draw callback draw API for outliner tooltips.

Reviewers: mont29

Subscribers: venomgfx, mano-wii, Severin

Differential Revision: https://developer.blender.org/D3020
2018-01-26 08:22:28 -02:00
009ce8f3f4 Fix harmlness RNA warning in image texture node drawing. 2018-01-26 08:41:20 +01:00
c4a4d20d3d Fix part of T53080: all material previews re-rendering after undo.
This reverts commit dc2617130b, which disabled
writing of previews for undo. While this uses some memory, re-rendering all
previews is very expensive, especially if for example you have lots of materials
using high-res image textures.
2018-01-26 08:41:19 +01:00
848f0c5b5b Code cleanup: simpler and faster detection of BVH refit. 2018-01-26 08:41:19 +01:00
22afe88882 Fix navmesh creation w/ multiple objects
D2976 by @dertom
2018-01-26 13:10:02 +11:00
19b1b45d71 make_quickie: replace os.system w/ subprocess.call 2018-01-26 12:53:42 +11:00
9b96dd0f61 icon update: replace os.system w/ subprocess.check_call 2018-01-26 12:46:10 +11:00
0f14c72c29 project_info: replace os.system w/ subprocess.check_call 2018-01-26 12:38:07 +11:00
7980265e7e Tests: replace os.system w/ subprocess.call
Saves on process creation and avoids
being tripped up by command line parsing.

Based on D2967 by @ldo with edits.
2018-01-26 12:23:15 +11:00
65d40b3eeb Docs: invoke_search_popup uses bl_property
Also add code example in docs.
2018-01-26 11:52:01 +11:00
Dalai Felinto
5b67f7a959 Outliner: Implement Add (Ctrl) when moving objects inside collection
Note there is no "text" explaining to users what is going on.
I will address this shortly in an upcoming commit.
2018-01-25 19:26:11 -02:00
Dalai Felinto
7e885e1e10 Layer: Update outdated code comment 2018-01-25 17:50:25 -02:00
Dalai Felinto
748adb37e5 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-25 11:31:54 -02:00
da4c3f30d9 Cycles: rename displacement methods, default to displace, tweak panel layout.
Differential Revision: https://developer.blender.org/D3019
2018-01-25 14:25:21 +01:00
176c0c96c2 Fix T53874: OpenGL render problem with OpenEXR in 2.8 with float buffers. 2018-01-25 14:25:17 +01:00
Dalai Felinto
e057d7b9eb No need to tag depsgraph id when dropping objects from the outliner
As done by c42fc19a8a - this was needed originally because notifiers were
not working so I had to force tagging.

And for the records, I should have used DEG_TAG_BASE_FLAGS_UPDATE instead of 0.
2018-01-25 11:14:13 -02:00
Dalai Felinto
6743308e59 Fix Eevee error message
That said, this should be informed to the user, not printed in the console.
2018-01-25 10:59:41 -02:00
Dalai Felinto
43b0e61408 Fix missing broken notifiers
We can't have more than one NOTE_SUBTYPE in the same notifier.
Instead of calling both subtypes the code end up not calling either.
2018-01-25 10:10:58 -02:00
Dalai Felinto
c42fc19a8a Fix crash when drag&drop invisible object from outliner to viewport
This is not the issue actually mentioned there. However it is the most serious
one.

Now if the object being dragged was not in a collection linked in the viewlayer
or invisible, we add it to the active collection (or create one if necessary).

This is related to T50967, which is now fully fixed.
2018-01-25 10:00:05 -02:00
Dalai Felinto
10f92f299e Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-25 09:55:59 -02:00
Dalai Felinto
8e341633e9 Fix T50967: When you move an icon from the outliner area object doesn't show up
We can't have more than one NOTE_SUBTYPE in the same notifier.

This is a partial revert of: cd4d5dcb46. In particular to the part concerning
"Also fixed a missing notifier of the object instancing operator".

Not only this was mixed with the original reason for the commit for no reason,
but it actually introduced a bug. Bad, bad developers ;)

Note: Although this commit is not needed for master, blender2.8 requires it for
the forementioned bug report.
2018-01-25 09:52:24 -02:00
5836293990 Merge branch 'master' into blender2.8 2018-01-25 22:20:27 +11:00
2d46ea52cd WM: comments on wmTooltipState struct 2018-01-25 21:52:40 +11:00
7d66925c73 WM: NULL check for recent tooltip change
Caused crash dragging boolean buttons.
2018-01-25 21:52:40 +11:00
fd4d7fbf13 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/library_remap.c
2018-01-25 10:15:31 +01:00
566eb60d81 Fix T53363: Blender won't update mesh's usercount when deleting object datablocks in Editmode.
Only do special handling of ob->data pointer in case we are remapping to
a valid (non-NULL) other obdata. Otherwise, handle it as any other
'remapping to NULL' case.

Hopefully not breaking anything else...
2018-01-25 10:11:12 +01:00
38dafd5f44 Merge branch 'master' into blender2.8 2018-01-25 16:32:43 +11:00
693b41eb17 UI: change tool-tips to be stored in the screen
Move timer and tip out of button code,
now the only requests a tooltip,
passing a creation callback to run.

Needed for manipulators in 2.8,
also helps de-duplicate logic - since we never want
multiple tool-tips showing at once.
2018-01-25 16:22:21 +11:00
032129ef35 Merge branch 'master' into blender2.8 2018-01-25 10:31:37 +11:00
9b32248894 Cleanup: correct ATTR_NONNULL use 2018-01-25 10:21:31 +11:00
9560c57e0b Fix T53874: more cases of OpenGL render to OpenEXR not working after recent changes. 2018-01-24 15:56:09 +01:00
bbc562fc69 Fix T53593: sculpt brush rake spacing bug after recent bugfix. 2018-01-24 15:56:09 +01:00
ca088a7b12 Fix T53115: Memleak with instanced groups and Cycles
The issue was caused by Cycles allocating ID property in a temporary object
which gets overwritten and thrown away every so often.

Now dependency graph will try to reliably check whether ID properties from
a temp object are to be freed.
2018-01-24 15:46:34 +01:00
9f713ec962 Depsgraph: Cleanup, line wrap 2018-01-24 15:34:33 +01:00
9c493ca378 Depsgraph: Add missing synchronize code to scene
The issue here is that we can not duplicate the whole datablock since we
use view layer pointers in depsgraph callbacks.

Maybe this whole chunk of code belongs to somewhere else, or maybe we
can find a smart solution to avoid need of CoW pointers passed to the
evaluation functions.

This fixes lack of viewport update when toggling collection enabled flag.
2018-01-24 15:04:46 +01:00
56a336196d Add utility function to reset ID property value to a given one
This is similar to idproperty_reset() defined in layer.c, but it does not
re-alloc property itself.

We should replace idproperty_reset() with IDP_Reset() now.
2018-01-24 15:04:46 +01:00
90768c9b68 Manipulator: icon highlight could be darker
Use color and highlight from theme.
2018-01-25 00:47:01 +11:00
992ac8f942 Fix for fix w/ GPU_batch_wire_from_poly_2d_encoded
Was missing first edge
2018-01-25 00:47:01 +11:00
c0ddbf39c4 Fix T53646: Blender 2.8 multiple crashes in auto UVs generation
Make sure scene and view_layer set for depsgraph before running editors
update. This is required since tagging might happen before we created depsgraph.
2018-01-24 14:00:49 +01:00
a47a7f2a7b Manipulator: add show_drag option for 2d buttons
Needed so 3d navigation buttons can show show drag cursor
only for buttons with modal operators.
2018-01-24 23:29:17 +11:00
d8b5b4b7b1 Fix bug in view navigation icons
Own error in GPU_batch_wire_from_poly_2d_encoded
Wasn't correctly filling in the VBO with edges.
2018-01-24 22:58:02 +11:00
6a65fc3456 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_wireframe.c
2018-01-24 12:14:59 +01:00
752fc35fa1 Depsgraph: Fix crash entering edit mode with CoW enabled
The issue was caused by some incompatibility of new API which expects ID block
to be specified explicitly, while old code is tagging object's data using
object's ID with OB_RECALC_DATA flag.

We need to switch all areas to give proper ID and everything, but for until
then we'd better stop crashing.
2018-01-24 11:46:54 +01:00
e68771fa87 Cleanup: MOD_wireframe: remove useless isDisabled callback. 2018-01-24 11:22:35 +01:00
a55a4818d6 Fix (unreported) missing feature in ccgdm pbvh generator.
Compared to usual cddm one, ccgdm one was not applying the
ob->derivedDeform deformation to the pbvh generated from the
original mesh geometry, when possible.
2018-01-24 11:22:35 +01:00
ad046efa79 Fix T53551: Weight paint crash when subsurf modifier is not first (master not 2.79).
We can only support painting from subsurf DM in a limited subset of
cases, others (like multiple subsurf, or topology-modyfying ones,
break mapping to original geometry).

This is not the most ideal fix (ideally, we should always be able to get
a mapping to original geometry from any point in modifiers stack...).
2018-01-24 11:22:35 +01:00
9112cceb5e BKE's modifier_isEnabled: add check on NULL Scene pointer.
We do not always have that one available, and even without the
isDisabled callback this func is helpful.

Note that this is a bot stupid, only modifier actually needing a valid
Scene pointer here is subsurf... :|
2018-01-24 11:22:35 +01:00
3e20ac8df3 Fix T53874: OpenGL render to OpenEXR not working after recent changes.
Multilayer EXR also failed already in 2.79 for Sequencer and OpenGL rendering.
Now we revert to single layer OpenEXR in that case.
2018-01-24 11:07:06 +01:00
fe18d9ba11 Depsgraph: Fix evaluaiton order with nested animation and copy on write
It is possible to have animation (or driver) to modify nested datablock, such
as shape key value for example (where animation is on Mesh level, but shape key
is it's own datablock). To deal with such cases we need to create relation
from nested datablock CoW to animaiton/driver operation.
2018-01-24 11:00:37 +01:00
bf8f7304e0 Fix T53878: Cycles bug rendering multiple render layers with different passes.
This was caused by recent pass refactoring from f78e963.
2018-01-24 10:57:32 +01:00
eb7d251cd7 Fix Cycles GLSL bump not matching final render after recent changes. 2018-01-24 10:57:32 +01:00
68284785e5 Cleanup: typo 2018-01-24 18:23:53 +11:00
b9dbd5e85e Manipulators: disable 3D widgets w/ animation
Workaround for T53078.
2018-01-24 18:23:49 +11:00
0ff968eaf5 Fix Cycles inserting displacement node when there is a custom node setup instead. 2018-01-24 07:15:22 +01:00
1686baa7f2 Fix "GPUTexture: texture alloc failed. Not enough Video Memory." in area resizing
`gpu_texture_try_alloc` invalidates zero-sized textures.
The message in the console is not correct in this case (because it is not due to lack of memory).
2018-01-23 22:50:05 -02:00
7389bfdeb0 Merge branch 'master' into blender2.8 2018-01-24 11:45:34 +11:00
bd5696f857 CMake: store icon names
Without this, adding/removing icons wouldn't force cmake to re-run
making builds fail.

This is the same issue with globbing source code.
2018-01-24 11:32:58 +11:00
Dalai Felinto
e6064b412a Fix object mode/edit mode panels not visible in collections
This was broken since e8c15e0ed1. When object_mode moved from
workspace to window.
2018-01-23 16:05:30 -02:00
Dalai Felinto
6249c59609 Greasepencil icons
Note this comes from the greasepencil-object branch, and are merged to help
preventing future merge conflicts.

Also, I renamed the icons for consistency sake. So when this is merged in 2.8
other areas of the code will need to change.

Icons by Matias Mendiola
2018-01-23 12:01:21 -02:00
Dalai Felinto
173f90c700 Revert "Grease-Pencil: Icons"
This reverts commits:

* f0ef360386 Grease-Pencil: Icons from the grease pencil branch
* 13bf4b3804 Grease-Pencil: Fixup for icons
* fb8c382fa1 Grease Pencil dat files fix
2018-01-23 12:01:21 -02:00
41945fcfe4 Cleanup: some ED_view3d functions used uppercase D 2018-01-23 23:37:55 +11:00
41cc2ae626 Merge branch 'master' into blender2.8 2018-01-23 13:19:32 +01:00
4a3ddd8a7a Fix Cycles assert when resizing rendererd viewport. 2018-01-23 13:07:25 +01:00
b129ea843a Cycles: change material output displacement to vector.
Previously only scalar displacement along the normal was supported,
now displacement can go in any direction. For backwards compatibility,
a Displacement node will be automatically inserted in existing files.

This will make it possible to support vector displacement maps in the
future. It's already possible to use them to some extent, but requires
a manual shader node setup. For tangent space maps the right tangent
may also not be available yet, depends on the map.

Differential Revision: https://developer.blender.org/D3015
2018-01-23 12:49:35 +01:00
4a5ee1a5a2 Cycles: add Displacement node.
This converts object space height to world space displacement, to be
linked to the new vector displacement material output.

Differential Revision: https://developer.blender.org/D3015
2018-01-23 11:12:26 +01:00
2838cf0dfe Fix T53854: branched path tracing correlation bug with transparency in split kernel. 2018-01-23 11:11:48 +01:00
4ebcdff873 Merge branch 'master' into blender2.8 2018-01-23 20:04:54 +11:00
9466f8f531 Cleanup: use doxygen groups for view3d_edit.c 2018-01-23 19:48:49 +11:00
f6dc7a7cf3 Cleanup: code comment for view3d_viewmatrix_set 2018-01-23 17:36:51 +11:00
41e930ac66 Cleanup: CMake whitespace 2018-01-23 17:25:09 +11:00
8181e4c812 Manipulator: limit UI for locked views 2018-01-23 17:11:13 +11:00
e679f472ed Cleanup: avoid passing bContext to cameracontrol 2018-01-23 15:19:53 +11:00
3a712632f5 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/screen/screen_ops.c
2018-01-23 01:00:16 -02:00
1c98fbf982 Merge branch 'master' into blender2.8 2018-01-23 12:18:46 +11:00
1443235aa4 Cleanup: sync w/ blender2.8 branch
Also make some args const
2018-01-23 12:14:26 +11:00
85ca39ec4b Fix screen split refresh issues
`Ctrl` (enable snapping) ans `TAB` (Switching direction) didn't refresh.
2018-01-22 23:07:36 -02:00
fc1fd2704a Merge branch 'master' into blender2.8 2018-01-23 11:45:39 +11:00
367e611179 Merge branch 'master' into blender2.8 2018-01-23 11:24:44 +11:00
bf7e406766 Cycles: Fix optimal BVH selection. 2018-01-22 14:52:09 -07:00
Dalai Felinto
fb8c382fa1 Grease Pencil dat files fix
The ones I previously commited were done with Inkspace 0.92.2
But apparently this renders some parts of the icons transparent.

For example, the tip of the new grease pencil pencil icon.
2018-01-22 15:33:20 -02:00
Dalai Felinto
13bf4b3804 Grease-Pencil: Fixup for icons
I tried to cleanup the .svg but I overdid it a bit
2018-01-22 15:12:12 -02:00
Dalai Felinto
f0ef360386 Grease-Pencil: Icons from the grease pencil branch 2018-01-22 14:37:50 -02:00
2f79d1c058 Cycles: Replace use_qbvh boolean flag with an enum-based property
This was we can introduce other types of BVH, for example, wider ones, without
causing too much mess around boolean flags.

Thoughs:

- Ideally device info should probably return bitflag of what BVH types it
  supports.

  It is possible to implement based on simple logic in device/ and mesh.cpp,
  rest of the changes will stay the same.

- Not happy with workarounds in util_debug and duplicated enum in kernel.
  Maybe enbum should be stores in kernel, but then it's kind of weird to include
  kernel types from utils. Soudns some cyclkic dependency.

Reviewers: brecht, maxim_d33

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3011
2018-01-22 17:19:20 +01:00
Dalai Felinto
0a622c6dd6 Collections/Layer cleanup: Remove placeholder for de/select objects
No need for placeholders bloating the source code. They can come back once
we decide to implement them.
2018-01-22 12:43:24 -02:00
Dalai Felinto
7628961391 Collections/Layer cleanup: Remove all reference to filter objects
This was not implemented yet. So it's a bit pointless to have all this
placeholder code around without any functionality coming out of it.
2018-01-22 12:43:19 -02:00
Dalai Felinto
8e5f433554 Collections/Layer cleanup: Remove TODO_LAYER_OVERRIDE from most places
This was originally a good idea. However we will need to pay special attention
to this when doing the dynamic overrides anyways. The placeholders won't be
enough to spare us that job.

That said I left the ones on layer.c because we are actually calling these
BKE_override_*_add() functions from doversion, yet they don't do anything.
2018-01-22 12:43:09 -02:00
Philippe Schmid
48fb7e9635 T53831: Fixed vertical line alignment & expand Collection and Scene buttons position.
This was fixed in master with commit 9d873fc3de. However, this fix never made it to 2.8.
(The following merge (a96008f3aa) did not import the fixes.)

Note: This fix is ment to fix the alignment problem.
I don't know if other parts of the code not merged are interesting or not.

But if they are, they should be tackled separately.

Reviewers: dfelinto

Subscribers: venomgfx, dfelinto, raa, Severin

Differential Revision: https://developer.blender.org/D3014
2018-01-22 12:08:30 -02:00
Dalai Felinto
0f69026b1c Fix windows building (log10)
Error: math_base_inline.c(402): error C2668: 'log10' : ambiguous call to
overloaded function
2018-01-22 11:37:19 -02:00
51da664fa1 Fix broken merge in fb45821, was missing changes from cc64872. 2018-01-22 14:28:43 +01:00
8a2d09eb9f Fix T53854: branched path tracing correlation bug with transparency.
This was broken in d750d18.
2018-01-22 14:02:58 +01:00
b06bd20a6b Cycles: Cleanup, remove unused argument 2018-01-22 10:59:14 +01:00
fb4582134a Fix T53850: Lock to Cursor breaks 3D manipulators 2018-01-22 20:14:12 +11:00
f7c812e199 Merge branch 'master' into blender2.8 2018-01-22 14:14:33 +11:00
c723e91ee1 WM: add mouse-move after smooth-view
When hot-spots moved under the pointer,
clicking wouldn't activate the correct item.
2018-01-22 14:09:17 +11:00
ebbed57bef Manipulator: draw all rules while dragging 2018-01-22 13:52:45 +11:00
759aaad0f3 Cleanup: commends
Avoid copy-pasting same comments.
2018-01-22 11:32:03 +11:00
d629f2a8a3 Cleanup: reuse camera frame arrays
Use GWN_vertbuf_raw_step in a loop for less verbose vbo creation.
2018-01-22 11:28:34 +11:00
809dc17254 Merge branch 'master' into blender2.8 2018-01-22 10:42:42 +11:00
9211a4acf8 Fix linking error when compiling without clay engine 2018-01-22 00:19:38 +01:00
13715adc09 DRW: Object Mode: Fix bad camera display in camera view
This fix T53485 : Ortho cameras display frame when in camera view
2018-01-22 00:14:28 +01:00
56fc812d1e Fix manual lookups (data is now lowercase) 2018-01-22 10:00:40 +11:00
d9c962a367 Fix T53843: Error opening online manual 2018-01-22 10:00:40 +11:00
a841e65b85 Cleanup: unused var 2018-01-22 10:00:40 +11:00
777e1d358a Eevee: Probes: Add support for intensity tweak.
This works for grid and cubemaps.

The intensity is baked into the map itself. Thus you need to refresh/rebake the probe to see the changes.
2018-01-21 23:16:59 +01:00
73a1bf1a80 Eevee: Fix grid lighting disappearing when adding a new cubemap probe. 2018-01-21 23:16:59 +01:00
bdfd9a11e8 Clay: Performance: Disable AO codepath if not necessary.
This optimisation only works if no material in the scene require the AO pass.
For this either set the AO distance to 0 or both Cavity and Edges factors to 0.

This double the performance of scenes with very high triangle count.
2018-01-21 23:16:59 +01:00
6700ee9855 DRW: Make the lamp widgets lines stippled. 2018-01-21 23:16:59 +01:00
b2c81c5d43 DRW: Remove unused material uniforms.
This might have some consequences but in my testing I did not found any.
2018-01-21 23:16:59 +01:00
e82616aea6 Eevee: SSR: Optimize the AO out when not enabled. 2018-01-21 23:16:59 +01:00
a507c251b2 Eevee: Put all constant uniforms in a global UBO.
This is an optimization / cleanup commit.

The use of a global ubo remove lots of uniform lookups and only transfert data when needed.

Lots of renaming for more consistent codestyle.
2018-01-21 23:16:59 +01:00
790025c01e Merge branch 'master' into blender2.8
# Conflicts:
#	intern/cycles/blender/blender_mesh.cpp
#	source/blender/editors/screen/screen_ops.c
#	source/blender/editors/space_view3d/drawobject.c
2018-01-21 18:45:47 -02:00
8d671f6f65 Update description of the screen_draw functions 2018-01-21 18:22:39 -02:00
46267fe7bf WM: Fix snapping on split area without preview
In addition to removing unnecessary variables and `tag_redraw` whenever the factor changes;
2018-01-21 18:18:38 -02:00
cc64872b88 Fix T49159: missing Cycles tangents for adaptive subdivision. 2018-01-21 15:43:59 +01:00
e767d21b74 Cleanup: BLI_kdopbvh avoid negative array access
It's harder to reason about array access with negative indices.
2018-01-21 20:17:29 +11:00
a7dc5e12ac Cleanup: style 2018-01-21 11:41:52 +11:00
e53447c137 Fix old files with changed node socket type not loading correctly.
This would lead to sock.default_value pointing to the wrong data type,
possibly causing crashes. Unfortunately, this bug will still exist for
older Blender versions that try to load newer files, which makes
changing the type of a node socket problematic.
2018-01-20 22:42:59 +01:00
99efebd2dd Merge branch 'master' into blender2.8 2018-01-21 01:47:49 +11:00
dd35048602 Cleanup: doxy groups for screen_ops.c 2018-01-21 01:41:58 +11:00
a177d64213 Merge branch 'master' into blender2.8 2018-01-21 00:55:08 +11:00
949e56dff1 Fix screen split preview refresh issues
Switching direction didn't refresh, also cursors were flipped.
2018-01-21 00:41:48 +11:00
da53eb3748 Manipulator: tweak shape drawing
Draw triangles over wire for a more subtle outline.
2018-01-20 19:41:41 +11:00
a3716f5945 GPU_batch: Add GPU_batch_wire_from_poly_2d_encoded
Draws wire around polygon shapes:
better visibility w/ any background color.
2018-01-20 18:45:27 +11:00
Dalai Felinto
e969ac6413 Fix collections names no longer unique when moved around
We were not checking for uniqueness after moving. And in some cases the new
siblings of our collection may have conflicting names.
2018-01-19 18:44:11 -02:00
Dalai Felinto
4dfccf8b7f Collections: Fix for auto-named children when parent name is MAX_NAME
Reported via IRC by Vuk Gardašević (lijenstina).
2018-01-19 17:24:35 -02:00
Dalai Felinto
244fb3ebe0 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-19 17:06:32 -02:00
Dalai Felinto
431d5772bb Fixup for integer digits commit 2018-01-19 17:04:19 -02:00
Dalai Felinto
4d0bb7de64 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-19 17:01:48 -02:00
Dalai Felinto
075def8fbd Util function to determine number of digits from an integer 2018-01-19 16:54:07 -02:00
Dalai Felinto
efe1af3d11 Outliner: Remove User Preferences
This was introduced to the outliner when we had no User Preference
window back in 2.5x. Right now it makes no sense to keep this around.

But how about addon user preferences:
* They belong in the user preference window under the addon.

How about the user preferences themselves:
* You find them in the user preference window.

And templates?
* Why are they here in the first place?

After talking to Pablo Vazquez (who in turn poked Sergey Sharybin) we found
it reasonable to get rid of this. If it turns out that we were wrong we
revert this.

As for leaving this exposed as a debug option (as suggested on IRC) I would say
no, please. This end up polluting the code and never cleaned up in the end.
(this was specific talking about templates).

Technical note: I left the functions in outliner still hanging around.
While I used UNUSED_FUNCTION for one of them, for the other one I had to use:
`#if 0` because the function was calling itself, which would fail to build if
I used UNUSED_FUNCTION.
2018-01-19 16:06:14 -02:00
fa91b43e8c Cycles: Make it more proper check on vectorization flags from DebugFlags
Mimics to checks in system_cpu_support() checks.
2018-01-19 15:48:42 +01:00
Dalai Felinto
d9858d5897 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-19 12:46:23 -02:00
Dalai Felinto
edf053ff63 Outliner Python UI cleanup: remove KEYMAPS
This was removed since 2013 (ef765b3606). It should have been removed back
then from the UI file too.
2018-01-19 12:45:57 -02:00
Dalai Felinto
7866870a9a Outliner: Fix unparenting poll (when drag'n'droping an object) 2018-01-19 12:28:16 -02:00
ccec1e7667 Cycles: Cleanup, stop using debug flags in system utilities
Debug flags are to be controlling render behavior, nothing to do with low level
system utilities.

it was simple to hack, but logically is wrong. Lets do things where they are
supposed to be done!
2018-01-19 15:22:32 +01:00
54632dc830 Cycles: Remove util_debug include from kernel code
Not sure why it was in there, all the debug flags stuff is to be handled outside
of kernel.
2018-01-19 15:21:34 +01:00
8e1dd7ed81 Cycles: Remove unneeded include statements
Also try to move them from headers to implementation files as much as possible.
2018-01-19 15:19:45 +01:00
Dalai Felinto
db9f0527e8 Outliner: Change All Scenes to Scenes and make it focus on compositing
We have different ways of explore the scene objects, namely View Layer and
Collections. This change let us focus on compositing elements only such as:

* View Layers
** Collections
** Render Passes
* Freestyle
* Grease Pencil?

Not included in this commit is an option to handle filtering of
collections passes, ... Not sure if we would like, though.
Since they are all properly nested under a "Collections" / "Passes"
parent.
2018-01-19 12:13:40 -02:00
Dalai Felinto
37913cf532 Outliner Filtering System + Cleanup
User notes:

The outliner so far was a great system to handle the object oriented workflow
we had in Blender prior to 2.8. However with the introduction of collections
the bloated ammount of data we were exposed at a given time was eventually
getting on the way of fully utilizing the outliner to manage collections and
their objects.

We hope that with this filtering system the user can put together the outliner
with whichever options he or she seem fit for a given task.

Features:
* Collection filter: In case users are only focused on objects.
* Object filter: Allow users to focus on collections only.
* (Object) content filter: Modifiers, mesh, contrainst, materials, ...
* (Object) children filter: Hide object children [1].
* Object State (visible, active, selected).
* Compact header: hide search options under a search toggle.
* Preserve scrolling position before/after filtering [2].

[1] - Note we still need to be able to tell if a children of an object is in a
      collection, or if the parent object is the only one in the collection.
      This in fact was one of the first motivations for this patch. But it is to
      be addressed separately now that we can at least hide children away.

[2] - We look at the top-most collection in the outliner, and try to find it again
      after the filtering and make sure it is in the same position as before.
      This works nice now. But to work REALLY, REALLY nice we need to also store
      the previous filter options to be sure the element we try to keep on top
      was valid for both old and new filters. I would rather do this later though
      since this smell a lot like feature creeping ;)

Remove no longer needed display options:
 * Current Scene (replaced by View Layer/Collections)
 * Visible (replaced by filter)
 * Selected (same)
 * Active (same)
 * Same Type (same-ish)

How about All Scenes? I have a patch that will come next to replace the current
behaviour and focus only on compositing. So basically stop showing the objects
and show only view layers, their passes and collections, besides freestyle.

Also, while at this I'm also reorganizing the menu to keep View Layer and
Collections on top.

Developer notes:

* Unlike the per-object filtering, for collections we need to filter at tree
creation time, to prevent duplication of objects in the outliner.

Acknowledgements:

Thanks Pablo Vazquez for helping testing, thinking some design questions
together and pushing this to its final polished state as you see here.

Thanks Sergey Sharybin and Julian Eisel for code review. Julian couldn't do a
final review pass after I addressed his concerns. So blame is on me for any
issue I may be introducing here. Sergey was the author of the "preserve
scrolling position" idea. I'm happy with how it is working, thank you.

Reviewers: sergey, Severin, venomgfx
Subscribers: lichtwerk, duarteframos

Differential Revision: https://developer.blender.org/D2992
2018-01-19 12:13:10 -02:00
76f374052c Depsgraph: Fix freeing of evaluated mesh
Was accessing wrong pointer to get original version of the mesh.
2018-01-19 14:20:22 +01:00
25739ada0b Correct view3d_draw_bgpic_test declaration
Was extern, which got out of sync, move into header.
2018-01-19 23:11:57 +11:00
08fe885d06 Merge branch 'master' into blender2.8 2018-01-19 21:47:57 +11:00
889321e22b Cleanup: reaname LINKLIST_FOREACH -> LISTBASE
LinkList's are a different API, no need to confuse things.
2018-01-19 21:39:18 +11:00
0fe41009f0 Fix T53830: Cycles OpenCL debug assert on macOS,
This was probably harmless besides some unnecessary memory usage due to
aligning allocations too much.
2018-01-19 11:35:07 +01:00
e46c49ff3d Fix T53788: Camera animation not working
Both object level and camera datablock properties animation did not work with
copy on write enabled.

The root of the issue is going to the fact, that all interface elements are
referencing original datablock. For example, View3D has pointer to camera it's
using, and all areas which does access v3d->camera should in fact query for
the evaluated version of that camera, within the current context.

Annoying part of this change is that we now need to pass depsgraph in lots
of places. Which is rather annoying.

Alternative would be to cache evaluated camera in viewport itself, but then
it makes it annoying to keep things in sync.

Not sure if there is nicer solution here.

Reviewers: dfelinto, campbellbarton, mont29

Subscribers: dragoneex

Differential Revision: https://developer.blender.org/D3007
2018-01-19 11:12:22 +01:00
5a61c1de82 Fix T53786: Proportional size from redo ignored
Changing PET size while transforming stores the size in the
tool settings, but changing in the redo panel didn't.
2018-01-19 21:09:16 +11:00
0cddc7e300 WM: operator flag to check repeat/redo execution 2018-01-19 21:07:43 +11:00
9cac97fb3c Fix sculpt error freeing NULL vertex buffer
Relates to T53806 which needs further investigation
2018-01-19 19:36:36 +11:00
5477452194 Merge branch 'master' into blender2.8 2018-01-19 18:03:43 +11:00
53e062da94 Cleanup: sync w/ blender2.8 branch
Split screen_draw.c from screen_edit.c (avoid conflicts syncing).
2018-01-19 17:57:37 +11:00
4444ea42f2 Merge branch 'master' into blender2.8 2018-01-19 17:37:01 +11:00
c850320b35 Merge branch 'master' into blender2.8 2018-01-19 17:21:15 +11:00
ebf01d44ee WM: window draw callbacks and split preview snap
This moves window overlay from hard coded flags into drawing callbacks.

It also supports snapping (holding Ctrl).
2018-01-19 17:15:45 +11:00
7a24e0d175 Cleanup: typos 2018-01-19 15:34:54 +11:00
abb3a86e10 Fix T53833: Particle Info node and Displacement Crash
The displacement shared was running before particle data was copied to the
device causing bad memory access when the particle info node was used. Fix
is simply to move particle update before mesh update so the data is
available to displacement shaders.

(Altho this fixes the crash the particle info node is still mostly useless
with displacement for now...)
2018-01-18 22:40:48 -05:00
368414efac Fix T53823: Particle weight brush crash
Entering particle edit mode w/ the weight brush enabled crashed
on non-hair particle systems.
2018-01-19 12:25:09 +11:00
2b9fb723ed Fix T53832: Particle weight paint crash
Drawing hair weights read before the hair array start.
This code could be improved since it currently copy-pastes,
from do_particle_interpolation, but this would need larger changes.

For now just correct existing logic.
2018-01-19 12:14:53 +11:00
4d3d002b65 Eevee: Fix translucency light powers. 2018-01-18 22:43:05 +01:00
59989fd4e0 Eevee: Volumetrics: Update/fix the lamp power convertion.
Include a better fit for area lights.
2018-01-18 21:52:36 +01:00
03e432bcdb Eevee: Implement Sun area lighting and few fixes/opti.
Sun is treated as a unit distant disk like in cycles.

Opti: Since computing the diffuse contribution via LTC is the same as not using the Linear Transformation, we can bypass most of the LTC code.
This replaces the sphere analytical diffuse computation as it gives a more pleasing result very close to cycles' AND cheaper.

Lights power have been retweaked to be coherent with cycles (except sun lamp with large radius where cycles has a non-uniform light distribution).
2018-01-18 21:52:36 +01:00
0cec092eca Eevee: Optimize rectangle area light.
Use the latest LTC optimisation techniques. That said, the final output is a bit more biased (and a bit further away from cycles).
2018-01-18 21:52:36 +01:00
220f1ad67e Eevee: Use inversesqrt() when possible. 2018-01-18 21:52:36 +01:00
8ed0161aa7 Eevee: Implement new LTC algorithm for Sphere Lights.
This is an improvement on the old spining quad method that was giving artifacts when the reflection ray was nearly aligned with the sphere center.
This might be a bit heavier but it's worth it.
2018-01-18 21:52:36 +01:00
Dalai Felinto
97e2b0c594 Outliner: Follow up on "Alphabetical sorting"
Technicall this works for collections modes too (View Layer and Collections) even
if only for objects. So it should be in the menu as well.
2018-01-18 18:23:19 -02:00
Dalai Felinto
60eb897fa5 Outliner: Alphabetical sorting - Fixup on "Get rid of Search Menu"
Issue introduced on 51bcf7bd5f.

Alphabetical sorting is not related to search, so it shouldn't have been
touched by the Search Menu changes.
2018-01-18 18:15:00 -02:00
Dalai Felinto
dc296542d4 Outliner: Fix parenting clear poll 2018-01-18 18:02:32 -02:00
Dalai Felinto
f1cfe67594 Outliner: Use (temporary) icons for collections
We need new icons for collections.

Yet we are using them in a few places, so we may as well be consistent and use
it everywhere.
2018-01-18 17:30:37 -02:00
Dalai Felinto
74f872df3a Outliner: Rename "Active View Layer" > "View Layer"
The original name came from a cheap conversion of the "active layer" option
to "active render layer" and then "active view layer".
2018-01-18 14:17:07 -02:00
Dalai Felinto
33ddd926b7 Outliner: View Layer: add option to add a new collection to the current view layer
This operator not only links a collection, but it creates a new one and then it
links it. Although the preferrable method for users to handle their collections
is when viewing the "Collections", let's explore this workflow for now.

Suggested by Pablo Vazquez, thank you.
2018-01-18 13:56:55 -02:00
Dalai Felinto
51bcf7bd5f Outliner: Get rid of Search Menu
Use inline options instead. This will be collapsable once we merge the upcoming
filter sytem.
2018-01-18 13:20:10 -02:00
Dalai Felinto
9398db07cc Outliner: Keep header operator-free and edit menu cleanup
Headers should not have operators as much as possible. The exception here is
for datablocks mode when you want to see the active keyset.

Edit menus on the other hand should be clearly distinct from the RMB context
menus. Edit menu options should be only the ones that apply to the entire
outliner, regardless of the selected element.

Context (rmb) menus should be related to the element you RMB on to invoke the
menu. I'm also taking this opportunity to start bringing the context menus
to Python. There is little reason not to, and it helps editing them (In this
case I'm doing it only for the Scene Collection one).
2018-01-18 13:05:45 -02:00
539e170d79 Depsgraph: Fix crahs when selecting objects
Was wasy to reproduce by hitting A-key.

Missing part of the recent orig_id pointer commit.
2018-01-18 14:14:53 +01:00
42a562496b Fix memory leak in recent curve refactor
5b25605761fb7
2018-01-18 20:54:59 +11:00
7b3e441bcf Improved docstring of mathutils.Matrix.lerp() 2018-01-18 09:58:14 +01:00
9811150952 Improve docstring for mathutils.Matrix.decompose() 2018-01-18 09:38:01 +01:00
001789d733 Fix T53808: VSE doesn't show scene strip markers 2018-01-18 14:49:09 +11:00
e8452cf0bc Merge branch 'master' into blender2.8 2018-01-18 14:11:38 +11:00
6880a549ba Fix weight particle brush versioning 2018-01-18 14:02:26 +11:00
9b04a47070 Cleanup: label scene flags more clearly
Also correct typo in enum name
2018-01-18 13:51:49 +11:00
2be8598fe7 Fix T53811: "bmesh.ops.split" crash 2018-01-18 12:36:25 +11:00
7ffe838473 WM: improved area resize snapping
Instead of 10px steps, snap to mid-point & adjacent edges.

Not yet implemented for split preview.
2018-01-18 11:33:51 +11:00
27dff3fbc1 Merge branch 'master' into blender2.8 2018-01-18 01:01:17 +01:00
e6df02861e Fix buffer overflow vulnerability in curve, font, particles code.
Solves these security issues from T52924:
CVE-2017-12102
CVE-2017-12103
CVE-2017-12104

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

Differential Revision: https://developer.blender.org/D3002
2018-01-18 00:54:07 +01:00
e04d7c49dc Fix buffer overflow vulnerabilities in mesh code.
Solves these security issues from T52924:
CVE-2017-12081
CVE-2017-12082
CVE-2017-12086
CVE-2017-12099
CVE-2017-12100
CVE-2017-12101
CVE-2017-12105

While the specific overflow issue may be fixed, loading the repro .blend
files may still crash because they are incomplete and corrupt. The way
they crash may be impossible to exploit, but this is difficult to prove.

Differential Revision: https://developer.blender.org/D3002
2018-01-18 00:54:07 +01:00
e0f2c7aff4 Fix Linux/GCC compiler warning in recent fixes. 2018-01-18 00:54:07 +01:00
235f578a0d Loop Cut: Allow mouse placement w/ numeric input
D2973 by @cyaoeu
2018-01-18 10:55:53 +11:00
07aed404cf Fix buffer overflow vulernability in thumbnail file reading.
Fixes CVE-2017-2908 from T52924.

Differential Revision: https://developer.blender.org/D3001
2018-01-17 20:25:42 +01:00
d30cc1ea0b Fix buffer overflows in TIFF, PNG, IRIS, DPX, HDR and AVI loading.
Solves these security issues from T52924:
CVE-2017-2899
CVE-2017-2900
CVE-2017-2901
CVE-2017-2902
CVE-2017-2903
CVE-2017-2904
CVE-2017-2905
CVE-2017-2906
CVE-2017-2907
CVE-2017-2918

Differential Revision: https://developer.blender.org/D2999
2018-01-17 19:59:47 +01:00
a6700362c7 Memory: add MEM_malloc_arrayN() function to protect against overflow.
Differential Revision: https://developer.blender.org/D3002
2018-01-17 19:59:47 +01:00
8400b4b566 Merge branch 'master' into blender2.8 2018-01-17 18:03:08 +01:00
46204f843b Depsgraph: Fix for fake dependency cycle being created for shape key drivers
One thing i'm not fully happy with is all this is_same_* functions. Need to
get rid of this by probably adding explicit entry/init/whatever nodes and
maybe making node criteria aware of whether key will be used as "from" or
as "to" node.
2018-01-17 18:02:51 +01:00
10e6da1f2d Merge branch 'master' into blender2.8 2018-01-17 17:47:38 +01:00
5d4ffb42a3 Delete Invalid Drivers: more lenient poll function
This function is faster and also allows for deletion of invalid drivers in
nested data blocks (for example in shape keys). Thanks @sergey!
2018-01-17 17:14:39 +01:00
a8fc44299b external_libs: Add openjpeg to the mavc lib folders for cycles standalone. 2018-01-17 07:45:05 -07:00
8e35a9e4c7 Eevee: Perf: Update noises (in utilTex) via GPU drawing.
This leads to a ~3ms improvement of CPU time during drawing.
This prevent the rendering from being stalled waiting for the texture data to be transfered.
2018-01-17 14:02:48 +01:00
54e10dbd17 DRW: Add DRW_framebuffer_create() function.
This is because certain part of the engine may require a blank framebuffer to bind textures to.
This is the case when using only array textures, unsupported by DRW_framebuffer_init().
2018-01-17 13:55:49 +01:00
c6101b09eb Merge branch 'master' into blender2.8 2018-01-17 12:38:52 +01:00
0aaae43748 Simplified GRAPH_OT_driver_delete_invalid after feedback @aligorith
By adding the ANIMFILTER_NODUPLIS flag to the filter it'll only be
processing each F-Curve once, which means we can remove while iterating.

This also solves a potential issue when a datablock has a driver and is
shared among multiple objects.
2018-01-17 12:38:14 +01:00
333d4f3447 Depsgraph: Use more const qualifiers 2018-01-17 12:27:46 +01:00
971a44fe08 Merge branch 'master' into blender2.8 2018-01-17 12:21:05 +01:00
c38ebf93e3 Added "Delete Invalid Drivers" operator
This operator is available in the graph editor in the Drivers mode, and
allows quick cleanup of drivers marked as 'invalid'.
2018-01-17 12:12:37 +01:00
ca5987c8a5 Cleanup: replace BLI_dynstr w/ BLI_string_joinN
Use in place of recently reverted 'DRW_shader_create_lib'
2018-01-17 21:42:14 +11:00
f314d9ce47 Depsgrapph: Fix/workaround for missing hair
The issue was happening because dependency graph did not inform particle
settings as modified. This is a regression caused by tagging and flushing
mechanism refactor.

The real fix would be to make particle settings to use ID level recalc flags
rather than own flags, which will also simplify relations around particle system,
and particle settings evaluation.

Reported by Mai in IRC.
2018-01-17 11:23:16 +01:00
10ce5af2dd Revert "Fix use-after free in DRW_shader_create_with_lib"
Caused an error entering edit-mode.

d60f26f37a & 2659500835
2018-01-17 20:39:42 +11:00
2094bbd033 Fix assert in mesh batch conversion 2018-01-17 19:54:13 +11:00
dfea9f43db Merge branch 'master' into blender2.8 2018-01-17 19:29:50 +11:00
8d064c5bc4 Fix use-after free in DRW_shader_create_with_lib
Limit scope to avoid future accidents
2018-01-17 19:28:15 +11:00
7935a394b7 Correct simple deform versioning from D2989 2018-01-17 19:17:49 +11:00
c02d428147 Eevee: Update lightprobes when deleting or linking a new world datablock 2018-01-17 00:23:31 +01:00
a19e3bdad8 Fix T53810: Crash removing a scene used in render
Header drawing accesses the scene too.
2018-01-17 10:03:22 +11:00
d7acabdef5 Eevee: SSS: Fix OpenGL error when enabling TRANSLUCENCY but not SSSS.
This was causing this error:
"Different sampler types for same sample texture unit in fragment shader"
2018-01-17 00:01:17 +01:00
2659500835 DRW: Codestyle refactor: Use macro to create shader libs.
This clears up the code from many DynStr usage. Easier to read.
2018-01-16 23:40:15 +01:00
96138daa2b Eevee: SSR: Fix artifacts at object/background limits.
This should have a very small perf impact but it's needed.
2018-01-16 22:18:35 +01:00
213e34a6c3 Eevee: Fix Hashed Alpha.
Now hashed alpha materials are stable when moving the camera/not using TAA.
It also converge to a noise free image when using TAA. No more numerical imprecision.

There still can be situations with multiple overlapping transparent surfaces that can lead to residual noise.
2018-01-16 19:40:17 +01:00
9fd28c7769 Eevee: AO: Removes samples and denoise options.
This comes with a lot of code simplification that leads to a small performance improvement.
2018-01-16 18:22:25 +01:00
c372113489 Eevee: Add macro to sample noise in utilTex.
Avoid future coding error.
2018-01-16 18:22:25 +01:00
5f569378d2 Eevee: SSR: Derive the brdf bias from the trace quality.
Also change the range of the trace quality so that the trace actually covers the screen most of the time.
2018-01-16 18:22:25 +01:00
9afeba330f Eevee: Fix SSRefraction noise. 2018-01-16 18:22:24 +01:00
9365e966b4 Eevee: SSR: Enhance the halfres raytrace.
This make the halfres raytrace actually converge to an antialiased image by jittering the source pixel.
2018-01-16 18:22:24 +01:00
2221cdb517 Eevee: SSR: Optimise Texture fetches and solve noise issue.
There was some remaining issue caused by neighbor re-use. Randomizing them every _prime_number_ of iterations fixes this.
2018-01-16 18:22:24 +01:00
3cb2b2956b Eevee: SSR: Remove ray count and use integer texture for hit coord.
Using GL_RG16I texture for the hit coordinates increase tremendously the precision of the hit.
The sign of the integer is used to 2 flags (has_hit and is_planar).
We do not store the depth and retrieve it from the depth buffer (increasing bandwith by +8bit/px).
The PDF is stored into another GL_R16F texture.

We remove the raycount for simplicity and to reduce compilation time (less branching in refraction shader).
2018-01-16 18:22:24 +01:00
84c91be0a4 Eevee: Fix noise correlation in the blue noise update. 2018-01-16 18:22:24 +01:00
39af6c27f5 DRW: Change framebuffer texture creation.
Instead of creating non temp textures only at framebuffer creation, we create them and bind them if their pointer is NULL.

This should simplify the framebuffers creation code.
2018-01-16 18:22:24 +01:00
9d1ae07d4f Cleanup: Avoid ifdefs in multiple places
Define a helper macro. Makes code read easier.
2018-01-16 17:14:57 +01:00
d9eb17b18e Cleanup: Remove deprecated enum flags
Those are not used anymore.
2018-01-16 17:11:47 +01:00
bf9460e3cf Cleanup: Get rid of legacy extra recalc flags
Those are not used by new dependency graph and are not needed for properly
created rigs with new granular nodes.
2018-01-16 17:11:47 +01:00
55f97d1dd9 Static override: cleanup: name consistency. 2018-01-16 17:11:03 +01:00
3cd8264505 Static override: enhance 'make override' operator.
Now when you make an override of a linked armature, code will
automatically also override objects using that armature (deformed by, or
children of), trying to replicate make_proxy results.

Also some initial code to replicate 'make_proxy' in case of instantiated
linked groups, but that is not working yet (and will also require some
work in RNA part of group's objects collection anyway).
2018-01-16 17:11:03 +01:00
72ec6dbb0b Static overrides API: add functions to create overrides from several datablocks at once.
This simplifies remapping task, since you don't have to ensure your
overrides are created in the correct dependency order.

Uses famous LIB_TAG_DOIT to mark IDs to be overridden.
2018-01-16 17:11:03 +01:00
436eea2d93 Merge branch 'master' into blender2.8 2018-01-16 16:40:05 +01:00
b55111f8f6 Cleanup: Naming of depsgraph 2018-01-16 16:38:39 +01:00
4e0673927a Alembic: don't explicitly pass NULL 2018-01-16 16:28:10 +01:00
6db0fd65ab T53711: Alembic don´t import vertex colors correctly
An index stored in Alembic wasn't used. Often this index is a no-op
(i.e. index[n] = n), in which case the result was fine. However, when it
isn't, it caused issues.
2018-01-16 16:03:21 +01:00
c810df35b2 Draw manager: Cleanup, use full name for depsgraph variable 2018-01-16 15:58:39 +01:00
1ed06a1167 Draw manager: Make depsgraph a part of draw state
Makes it more explicit and avoids hash loookup when depsgraph is needed.
2018-01-16 15:42:03 +01:00
eea3506019 Draw manager: Make update context aware of what depsgraph causes update 2018-01-16 15:38:44 +01:00
1e0283828f Depsgraph: pass depsgraph to editors update context struct
This way callbacks will know which depsgraph is being changed, and where
evaluated data is coming from.
2018-01-16 15:37:52 +01:00
263f614932 Add dedicated pointer to an original ID datablock
Before we were re-using newid pointer inside of ID structure where we were
storing pointer to an original datablock.

It seems there is no way we can avoid requirement of having pointer to an
original datablock, so let's stop obusing system which was only designed to
be a runtime only thingie. Will be more safe this way, without need to worry
about using any API which modifies newid.
2018-01-16 15:09:48 +01:00
d4ff1a1f2c Merge branch 'master' into blender2.8 2018-01-16 14:52:43 +01:00
0bdb1eab82 Sculpting: Fix uninitialized color being left for smooth meshes with hidden mask 2018-01-16 14:46:48 +01:00
7934e7ab83 Sculpting: Fix for "Hide Mask" does not work with multires 2018-01-16 14:31:52 +01:00
379a752ee7 Manipulator: fix arrow offset in perspective view
Use 3D calculations instead of projecting into 2D space.
2018-01-16 23:38:27 +11:00
7df1983bf9 Fix compilation error 2018-01-16 12:48:33 +01:00
cfe6b83134 Merge branch 'master' into blender2.8 2018-01-16 12:07:43 +01:00
67e4b1d3e9 Fix missing node tree updates when unconnected node affects output via driver
Fixes T53794: Can't control color ramp node color values with drivers
2018-01-16 12:06:22 +01:00
0b500ba147 Depsgraph: Fix fake cyclic dependencies for node tree drivers
There was a fake cyclic dependency happening when node of node tree is driving
another node of the same tree.

This is related to T53794, but more fixes is needed here.
2018-01-16 11:54:32 +01:00
45b5de9cb3 Depsgraph: Better relations name 2018-01-16 11:43:05 +01:00
1d763b5395 Depsgraph: Check for ID match when checking if operations corresponds to the same bone 2018-01-16 11:41:50 +01:00
b974d0da4d Depsgraph: Cleanup, indentation 2018-01-16 11:40:02 +01:00
b667020310 Depsgraph: Cleanup, brace placement\ 2018-01-16 11:38:44 +01:00
03223a5e7d readfile: ensure blend header follows the spec 2018-01-16 20:02:32 +11:00
2346e0850f Ruler Manipulator: dragging out of the view removes
Not ideal, but means we don't need to override Delete key.
2018-01-16 18:14:11 +11:00
fd80b83e8e Manipulator: Support tweak removing the manipulator 2018-01-16 18:03:15 +11:00
873a87c7e8 Merge branch 'master' into blender2.8 2018-01-16 14:56:03 +11:00
e428ea3e00 Cleanup: indentation 2018-01-16 11:40:43 +11:00
6f45dea6ee UI: support canceling color ramp drag
D2997 by @oktomus
2018-01-16 11:16:50 +11:00
Dalai Felinto
1e9bc60777 Fix collection visibility evaluation
Collection       A [disabled]
 -> Collection   B
   -> Collection C
     -> object

Object should be invisible, but it is not. Reported by Antonio Vazquez.

Bug introduced on: 1f5106de61
2018-01-15 20:19:12 -02:00
Dalai Felinto
59fcfaf5c3 Fix crash in outliner when moving objects around
How to reproduce it:
* Change Outliner from Active View Layer to Collections
* Create a new collection under Master Collection (Collection 2)
* Move all three objects from Collection 1 to Collection 2
* Move all three objects from Collection 2 to Collection 1
2018-01-15 19:08:45 -02:00
Dalai Felinto
ae12424298 Outliner/Collections: Fix objects disappearing when moving to collections
Bug introduced on fb4cd136a7 (multi-object drag-and-drop).

How to reproduce the bug:
* Create a new collection
* Move the Cube to the new collection
* Move the Camera to the new collection (Cube disappears)
* Move the Lamp to the new collection (Camera disappears)

Explanation of the bug:
The moved object was still selected, so we were trying to add the object to the
collection were the object was already inserted (which would fail silently) and
then remove it.
2018-01-15 18:27:50 -02:00
b810e9ffc4 Fix: Mesh Edit Mode Shader: Correct artifacts that appeared on edges of edit mode with some AMD GPUs
In case the problem appeared with the `AMD Radeon HD 7570M`
2018-01-15 16:29:41 -02:00
7183d15d97 Fix unreported: Eevee Principled Shader: Crash because Intel does not like dead code
The reason for the crash is still a bit confusing, but on Windows with Intel HD Graphics 4000 it always happens when you enable `Use Nodes` or when you try to connect the Pricipled Shader node to the output without the `Subsurface Scattering` and `Subsurface Translucency` options enabled.
2018-01-15 13:49:50 -02:00
f5e2d42092 GPU Texture: Add GL_RG16I format. 2018-01-15 15:39:03 +01:00
5e6c86cb1f GPU_batch_from_poly_2d_encoded: skip winding check
Ensure all polygons have the same winding instead.
2018-01-16 00:59:52 +11:00
7ba07b7e64 GPU_batch_from_poly_2d_encoded: optional rctf arg
Also use compiler attributes
2018-01-16 00:16:54 +11:00
5cb43b0f20 Cleanup: update comments 2018-01-16 00:16:54 +11:00
ec3248437d Merge branch 'master' into blender2.8 2018-01-15 13:55:52 +01:00
Karl Semich
75e2ae72c7 Allow for multi-gigapixel renders
This patch fixes a 32-bit overflow that occurs on 64-bit systems due to a numeric literal being treated as 32-bit.

This patch allows for the generation of images that occupy more than 4GB of RAM, which previously caused a crash.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2975
2018-01-15 12:57:12 +01:00
2c2203d82a Cycles: CLeanup, remove unused function argument 2018-01-15 11:45:16 +01:00
4d8b78b0a9 Sculpting: Sdd an option to hide mask in viewport
Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.

Studio request by Julien Kaspar
2018-01-15 11:43:59 +01:00
6cb06501c3 GPU buffers: Use bitflag to whether we want to show diffuse color
Those fine-tuning bits will be extended soon, so makes sense to start using
some more verbose flag names when calling functions.
2018-01-15 11:43:59 +01:00
72cb7e2726 Manipulator: vector icons for 3D view navigation
Use different icons for perspective/ortho state
(previous icon was place-holder).
2018-01-15 20:56:31 +11:00
6acfef6ef1 Manipulator: support for buttons as vector shapes 2018-01-15 20:40:57 +11:00
bfada6cc4a GPU_batch: Add utility to create 2D shapes
Shapes are represented by compact byte array,
encoded by 'make_shape_2d_from_blend.py' in the tools repo.
2018-01-15 20:38:06 +11:00
ae6cc4a21d GPU_batch_presets: move static vars into struct
Also use GWN raw stepping API to fill in data.
2018-01-15 16:55:40 +11:00
b1ac7571a8 Cleanup: split GPU_batch_presets into own file
Mixing other batch code in this file easily shadowed existing variables.
Keep presets separate (we may have more, 2D & 3D presets)
2018-01-15 16:24:02 +11:00
7c1286b2b7 Manipulator: add free callback 2018-01-15 16:06:56 +11:00
129196dc32 Merge branch 'master' into blender2.8 2018-01-15 15:59:59 +11:00
ec52e64a5d RNA: Add RNA_property_string_set_bytes
This is needed to set values that contain zero bytes
(where the length isn't fixed).
2018-01-15 15:59:10 +11:00
82a94d0f84 Cleanup: correct names 2018-01-14 17:54:27 +11:00
58be6d282d Merge branch 'master' into blender2.8 2018-01-14 17:29:38 +11:00
02a01b3505 Cleanup: BLI_ghash
Improve hashsizes comment too.
2018-01-14 17:28:15 +11:00
8d3efb2b90 Fix T53772: Presets don't support colons 2018-01-14 14:31:39 +11:00
e7bf77df3a Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-01-13 01:13:37 -02:00
cdc31c3e6e Merge branch 'master' into blender2.8 2018-01-13 02:05:49 +01:00
40dbf2fc00 Fix T53771: missing view pixels when rendering multiview + FSAA.
This never worked, it's not due to recent refactoring.
2018-01-12 23:57:45 +01:00
5bd9b12dc4 Cycles: adaptive subdivision support for panoramic cameras.
Adds the code to get screen size of a point in world space, which is
used for subdividing geometry to the correct level. The approximate
method of treating the point as if it were directly in front of the
camera is used, as panoramic projections can become very distorted
near the edges of an image. This should be fine for most uses.

There is also no support yet for offscreen dicing scale, though
panorama cameras are often used for rendering 360° renders anyway.

Fixes T49254.

Differential Revision: https://developer.blender.org/D2468
2018-01-12 23:57:45 +01:00
b603792fec Code refactor: adjust camera update for easier code sharing with kernel. 2018-01-12 23:57:45 +01:00
5cf032678f Code cleanup: remove test code to disable motion blur, no longer useful. 2018-01-12 23:57:14 +01:00
5a293de925 Draw Manager: Edit Mode Shader: Remove #ifdef GPU_INTEL
The problem with memory alignment on Intel GPUs does not happen anymore after the last shader changes.
2018-01-12 15:09:13 -02:00
49d51a1e62 Eevee: Fix motion blur alpha being > 1.0 2018-01-12 15:57:41 +01:00
2bbc287af1 Eevee: Fix Motion blur not working in OGL render.
Thanks to @sergey for the patch.

Also include some sexy line breaks.
2018-01-12 15:57:41 +01:00
9c76ec615a Fix T53759: Cycles / 2.8: Light position doesnt update in viewport render 2018-01-12 15:00:58 +01:00
Dalai Felinto
d931f6f785 Outliner: Harmless cleanup
There is even a chance the compilers handles this itself, but we should try to
use the internal storage as much as possible (and save 0.000001s in the process)
2018-01-12 09:07:16 -02:00
a33a5880f7 Fix bmesh.utils.face_join arg parsing 2018-01-12 14:51:15 +11:00
93d30d62e6 User Prefs: app-template option to hide the cursor 2018-01-12 12:45:56 +11:00
ff4c9d69ee User Prefs: add new flag for app-template options
For experimental options, outside the scope of typical preferences.

While templates are developed we might want to make changes
to behavior which aren't fully compatible with typical work-flows.

Instead of mixing these options in with current preferences
expose separately (we could even force disable them when templates
aren't int use)
2018-01-12 12:45:56 +11:00
322f0223d0 Cycles: option to make background visible through glass transparent.
This can be enabled in the Film panel, with an option to control the
transmisison roughness below which glass becomes transparent.

Differential Revision: https://developer.blender.org/D2904
2018-01-12 01:34:28 +01:00
cce280dd67 Cycles: add offscreen dicing scale and dicing camera.
The offscreen dicing scale helps to significantly reduce memory usage,
by reducing the dicing rate for objects the further they are outside of
the camera view.

The dicing camera can be specified now, to keep the geometry fixed and
avoid crawling artifacts in animation. It is also useful for debugging,
to see the tesselation from a different camera location.

Differential Revision: https://developer.blender.org/D2891
2018-01-12 01:34:07 +01:00
Dalai Felinto
de176b75b2 Fix T53764: vertical line glitch for collections with objects and collections
The code for vertical line was assuming that we necessarily neeeded vertical
lines for all the elements. Which is not true since we are not drawing
vertical and horizontal lines for collections.

Patch made in contribution with Philippe Schmid (@Quetzal).
2018-01-11 19:58:50 -02:00
2dbcc17897 Fix Cycles bevel normal baking having some random incorrect pixels.
The bevel and SSS code could result in NaNs in some cases, tweak the
formulas so this can't happen.
2018-01-11 22:30:31 +01:00
6b3d85fa51 Build: auto detection of libraries built by "make deps" on Linux.
Use the libraries if they exist in ../lib/linux_x86_64 or similar, so
that you can run "make deps && make full" to get a full static build.
Note that install_deps.sh is still the only officially supported way to
build Blender dependencies on Linux, but this may be useful to some.

Differential Revision: https://developer.blender.org/D2980
2018-01-11 22:30:31 +01:00
79b0bce890 Edit Mode Overlay Shaders: remove loose comment left by last commit 2018-01-11 18:28:11 -02:00
6a37f49211 Fix error weird sliding vertices appearing in edit mode with some Intel GPUs
Appear when zooming
2018-01-11 18:07:41 -02:00
8bff6f319a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/multires.c
2018-01-11 20:19:18 +01:00
6104596587 Cleanup commented out OMP command. 2018-01-11 20:17:29 +01:00
6695e390c6 Nuke OMP from multires.c: forgot that one in previous commit.
Gives same kind of speedup too, 8.7ms with old OMP code, 2.7ms with new
one, with same level-4 multires monkey head.
2018-01-11 20:14:16 +01:00
90cd856ac3 Nuke OMP usage in multires.c.
New code is over three times quicker than old one here (e.g. Suzanne
subdiv level 4, 250k tris, threaded part is now 1.4ms instead of 4.5ms
with OMP).
2018-01-11 19:39:24 +01:00
da97b6930b DRW: Fix T53583 Armature instances not drawing.
Was due to the fact that the instances don't have a "static" obmat that can be referenced to use as a uniform.
Solution : precompute the full matrix for each bone and pass it as instance data. (theses are copied into a buffer and can be discarded right away)

Note: this could be optimized further and make only one drawcall (shgroup) to draw all bone instance of one type (vs. one call per armature).
2018-01-11 19:35:56 +01:00
Dalai Felinto
31782609f4 Fix T53340: Outliner collections collapsing when UNDO
This is not the original reported issue, but it is a second issye mentioned
that, the only one reminding.
2018-01-11 16:03:08 -02:00
6c4bc79134 Fix T51576: Blender crash when change to edit mode with some Intel GPUs
Differential Revision: D2995
2018-01-11 15:58:20 -02:00
713852affb Preparation step for nuking OMP from multires code.
Remove the critical OMP sections used to protect mem allocation.

First one can be done in a separate loop before main, parallelized one.

Second one only affect 'private' data, so we only need to ensure
guardedalloc thread safety is enabled.

This is committed as separated step to ease troubleshooting in case
bisecting becomes necesary.
2018-01-11 17:56:18 +01:00
c253fe5e87 Cleanup typo in comment. 2018-01-11 17:55:58 +01:00
5ef2be5f59 Eevee: DoF: Fix most color artifacts in render.
Use full 32bit floats buffers. This increase render time but also color fidelity.
2018-01-11 16:50:55 +01:00
494e4c0977 Eevee: Fix Depth of Field.
It was using a wrong blending function.
2018-01-11 16:50:55 +01:00
0142264508 Eevee: Lamps: Optimize lamps CPU/Memory usage.
Tests on my system with ~1200 objects with 128 shadow casting lamps (current max) show a significant perf improvment (cache timing : 22ms -> 9ms)
With a baseline with no shadow casting light at 6ms this give a reduction of the overhead from 16ms to 3ms.

This remove pretty much all allocations during the cache phase. Leading to a big improvement for scene with a large number of lights & shadowcasters.
The lamps storage has been replace by a union to remove the need to free/allocate everyframe (also reducing memory fragmentation).

We replaced the linked list system used to track shadow casters by a huge bitflag.
We gather the lights shadows bounds as well as the shadow casters AABB during the cache populate phase and put them in big arrays cache friendly.

Then in the cache finish phase, it's easier to iterate over the lamps shadow SphereBounds and test for intersection.

We use a double buffer system for the shadow casters arrays to detect deleted shadow casters.
Unfortunatly, it seems that deleting an object trigger an update for all other objects (thus tagging most shadow casting lamps to update), defeating the purpose of this tracking.
This needs further investigation.
2018-01-11 16:50:54 +01:00
Dalai Felinto
a08f687b91 Fix poll and name of collection link/unlink operators
Reported via IRC by Pablo Vazquez (venomgfx).
2018-01-11 12:45:00 -02:00
656b9a46b3 Merge branch 'master' into blender2.8 2018-01-11 15:14:30 +01:00
38d480fb54 Subsurf: Allow partial threading over geometry arrays
This helps avoiding threading overhead when having lots of system threads..
2018-01-11 15:06:56 +01:00
374c4f168d Mesh evaluate: Tweak threadability criteria
Gives measurable speedup on layout scenes from Spring.

Actual value for chunk size is a subject for more scientific research.
2018-01-11 15:04:13 +01:00
cdcdae663a Mesh deform: Tweak threadability criteria
Allow threading using subset of all available threads. Makes it faster to
evaluate lower resolution mesh but with complex deform groups and such.
2018-01-11 14:51:30 +01:00
c276fef413 Subsurf: Make copyFinalLoopArray() threaded
Gives about 40% speedup of object which has simple-ish deformation applied
on top of subdivided mesh.

This might easily happen with single character animation.
2018-01-11 14:49:32 +01:00
1255f572c7 Depsgraph: Make eval initialization more friendly for threading
Helps in cases of not very complex scenes and lots of system threads available.

A bit hard to measure change on it's own, it works best with the upcoming
changes and gives measurable improvements.
2018-01-11 14:48:49 +01:00
498ffef7b0 Subsurf: Use regular mutex instead of RW one
Mutex is now local to particular CCGDM, and guarding edge hash which is only
used by a single function only. There is no need to acquire read lock after
edge hash was created.
2018-01-11 14:38:58 +01:00
c36f4a7f7f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/blender.c
	source/blender/makesdna/DNA_ID.h
2018-01-11 14:35:36 +01:00
b415ed55a7 Fix critical issue with our DNA ID tags (two totally different tags having same value).
Nice typo from rBc4046e9082f6, tssk. ;)
2018-01-11 14:26:44 +01:00
cc63c8511c Fix static override (very stupid mistakes in code!) 2018-01-11 12:29:09 +01:00
de91f2389d Further fixes to new RNA props diff code.
Unfortunately, we cannot perform set/unset checks on 'resolved'
properties (i.e. from actual IDProperties pointers, and not virtual RNA
placeholders)... IDProps in RNA are rather challenging topic. :|

This should fully fix T53715: 2.8: Removing keymap items no longer works
2018-01-11 09:41:44 +01:00
0edda8e4ce Fix T53311: transform edge/normal orientation
When the edge is aligned with it's own normals,
transform orientation wasn't aligned with the edge.
2018-01-11 19:25:27 +11:00
6dd164a188 Fix T53755: Cycles OpenCL lamp shaders have incorrect normal. 2018-01-11 08:48:32 +01:00
717090f40e UI: option not to show screen splitting widgets
Request for simplified Blender template,
this may be extended to limit access to other UI changes
that could be pressed by accident.
2018-01-11 16:10:46 +11:00
9c91c75ea6 Merge branch 'master' into blender2.8 2018-01-11 13:24:41 +11:00
9d62e6e782 UI: don't draw outline when it's not calculated
Outline drawing was running even when there were no verts to draw.
Causes an assert in 2.8.
2018-01-11 13:23:55 +11:00
Stefan Werner
25b794a39d Cycles: support animated object scale in motion blur.
This was disabled previously due to CUDA compiler bugs, see T32900.

Differential Revision: https://developer.blender.org/D2937
2018-01-11 02:58:29 +01:00
ac2ebf9c54 Fix T53455: Object disappear w/ TrackTo constraint
Regression caused by own commit 16fbb47c88,
this is really an edge case though since calling normalize twice fixes.
2018-01-11 10:57:30 +11:00
d0cc5d8948 Fix T53752: Draw curve fails w/ stylus 2018-01-11 10:23:52 +11:00
6112cde3f9 Merge branch 'master' into blender2.8 2018-01-11 10:19:00 +11:00
f330005266 Cleanup: BKE naming conventions for datablock add/localize
Conventions were already followed nearly everywhere.
2018-01-11 10:01:01 +11:00
c27cab268b Fix Windows compiler warning using WITH_CYCLES_NATIVE_ONLY. 2018-01-11 00:00:48 +01:00
d0892a6648 Fix issue with moving CUDA memory to host and multiple devices.
This is not expected to fix all issues. Also adds some more details
to error reporting to investigate failures.
2018-01-11 00:00:48 +01:00
0f4b46cee6 Fix T53692: OpenCL multi GPU rendering not using all GPUs.
Ensure each OpenCL device has a unique ID even if the hardware ID is not
unique for some reason.
2018-01-11 00:00:48 +01:00
Julian Eisel
3f16810150 Cleanup: Naming, avoid passing bContext to low-level function, etc 2018-01-10 23:02:10 +01:00
Julian Eisel
748e95ad50 Fix crash when deleting collections
With factory settings, steps to reproduce were:
* Select "Collection 1" (in "RenderLayer")
* Delete
It might crash at this point, although maybe this crash is ASAN only.

However, this was also doing some weird things that I've corrected now. It
called outliner_build_tree in an operator callback. This should only be
called in the main redraw function or so, not in regular handlers.
Instead, we manually cleanup the tree to keep it valid.
2018-01-10 22:45:44 +01:00
76bdd40bfd Subsurf: Loop array should not be called mv
mv is a mesh vertex, not loop.
2018-01-10 14:58:49 +01:00
fca202566f Subsurf: Remove increment of unused variable 2018-01-10 14:58:09 +01:00
181124ad13 Fix compilation error
Seems of new padding were added in 2.8 branch.
2018-01-10 14:15:13 +01:00
5d38c14116 Merge branch 'master' into blender2.8 2018-01-10 13:22:03 +01:00
2737837b09 Fix wrong data type used for undo memory limit 2018-01-10 13:20:36 +01:00
f21f18b572 Task scheduler: Use const qualifier in callbacks for parallel range 2018-01-10 12:53:59 +01:00
5614193745 Task scheduler: Use restrict pointer qualifier
Those pointers are never to be aliased, so let's be explicit about this and hope
compiler does save some CPU ticks.
2018-01-10 12:49:51 +01:00
518c65460e Task scheduler: Use more const qualifiers 2018-01-10 12:27:43 +01:00
f68b2fd233 RNA: Increase memory limit settings to their possible max on platform
This is quite common to have 64GB memory now, and even 128. There is no reason
to add any artificial caps on the cache and undo memory here. We can not protect
against using too much memory in one cases and allow use of full computer
potential in others.

Now 32 bit will use 2GB max (as it used to be), but 64bit will use whatever
number of megabytes fits into integer.

Reviewers: campbellbarton, mont29

Subscribers: sebastian_k

Differential Revision: https://developer.blender.org/D2972
2018-01-10 11:09:10 +01:00
f0610563ee math utils: Add size_t version of min and max functions 2018-01-10 11:06:44 +01:00
f59303bead Fix color for manipulator drawing
Was drawing black after the first draw call.
For now set the shader before each draw call,
noted as TODO to investigate a nicer way to handle.
2018-01-10 20:50:14 +11:00
2b56faebe5 Merge branch 'master' into blender2.8 2018-01-10 19:58:05 +11:00
18f53d8822 Cleanup: comment block alignment 2018-01-10 19:57:02 +11:00
bc02c5de49 Alternate fix for brush user count
This reverts change to BKE_brush_add,
callers now remove the extra user.

Note this isn't very convenient for callers but
is consistent with other ID types.

In the future we will probably remove this and have new
ID's created with zero users.
2018-01-10 19:34:34 +11:00
3f837341c8 Correction to brush user commit
RNA API was compensating for the extra user.
2018-01-10 18:31:54 +11:00
98d89cef6b Fix background_job template
Update attribute and use empty file operator
2018-01-10 17:50:41 +11:00
6e6b79de35 Fix brush user count
New brushes had 2 users on adding.
Caused assert removing them after.
2018-01-10 17:45:34 +11:00
5ff33ecdf0 Merge branch 'master' into blender2.8 2018-01-10 14:01:09 +11:00
5c3dc01f54 Draw Manager: Edit Mode: Curve: uniforms were not being setted 2018-01-10 00:40:02 -02:00
7d865bc4ab Fix T53748: uniform globalsBlock was not being added was not being added to the shaders of the curves handles 2018-01-10 00:08:51 -02:00
cacba951ea Correct typos 2018-01-10 12:43:29 +11:00
fdd3d969a6 Fix T53491: Absolute tablet motion detection fails
When using a tablet, detecting absolute motion only worked
when activating a tool with the tablet.

Pressing Enter to run a tool for e.g. would use relative motion.

Now store is_motion_absolute in the event,
set for new events based on the most recent motion events.
2018-01-10 12:41:45 +11:00
9aada45e52 fix t53701 minimal changes to get it working right 2018-01-10 01:51:04 +01:00
3c6e19b30b Curve/Surface Display: UV support 2018-01-10 10:11:32 +11:00
0f6ed7d111 Fix (unreported) potential crash.
RNA_pointer_as_string could return NULL instead of a valid string in some cases.
2018-01-09 19:51:50 +01:00
a0655ed487 Eevee: Fix AO in planar reflections. 2018-01-09 19:01:24 +01:00
8aaf7bc438 Eevee: Fix Planar probe refresh. 2018-01-09 18:59:13 +01:00
5fe87a0a8c Task scheduler: Use single thread branch when range fits into single chunk 2018-01-09 18:10:47 +01:00
4a3b303bb0 Task scheduler: Fix wrong tasks calculation when chunk size is too big 2018-01-09 18:07:34 +01:00
9135530f79 Eevee: Support for dupli lamps without shadows. 2018-01-09 18:01:56 +01:00
9f94f17ea4 Eevee: Fix crash with volumetrics. 2018-01-09 17:29:56 +01:00
6deb908a5c Merge branch 'master' into blender2.8 2018-01-09 16:15:33 +01:00
932d448ae0 Task scheduler: Use const qualifiers in parallel range 2018-01-09 16:09:33 +01:00
8cffb0a141 Task scheduler: Avoid over-allocation of tasks for parallel ranges
This seems to only cause extra rthreading overhead on systems with 10s of
threads, without actually solving anything.
2018-01-09 16:09:33 +01:00
c4e42d70a4 Task scheduler: Add minimum number of iterations per thread in parallel range
The idea is to support following: allow doing parallel for on a small range,
each iteration of which takes lots of compute power, but limit such range to
a subset of threads.

For example, on a machine with 44 threads we can occupy 4 threads to handle
range of 64 elements, 16 elements per thread, where each block of 16 elements
is very complex to compute.

The idea should be to use this setting instead of global use_threading flag,
which is only based on size of array. Proper use of the new flag will improve
threadability.

This commit only contains internal task scheduler changes, this setting is not
used yet by any areas.
2018-01-09 16:09:33 +01:00
3144f0573a Task scheduler: Simplify parallel range function
Basically, split it up and avoid extra abstraction level.
2018-01-09 16:09:33 +01:00
4c4a7e84c6 Task scheduler: Use single parallel range function with more flexible function
Now all the fine-tuning is happening using parallel range settings structure,
which avoid passing long lists of arguments, allows extend fine-tuning further,
avoid having lots of various functions which basically does the same thing.
2018-01-09 16:09:33 +01:00
d2708b0f73 Task scheduler: Get rid of extended version of parallel range callback
Wrap all arguments into TLS type of argument. Avoids some branching and also
makes it easier to extend things in the future.
2018-01-09 16:09:33 +01:00
1cab3be7a7 Significant step toward supporting IDProperties in new RNA diff code.
Still not fully working, more work TODO (IDProps are rather tedious to
handle in RNA... :/ ).

Partial fix of T53715: 2.8: Removing keymap items no longer works.
Some shortcuts can now be edited/deleted again, but some remain
mysteriously frozen!
2018-01-09 15:54:33 +01:00
2ee5e05107 DRWInstanceData: Bump the max data size. 2018-01-09 15:37:28 +01:00
35ac496dbd Gawain: Fix codestyle. 2018-01-09 15:37:00 +01:00
2bb08f0ad2 DRW & GPUViewport: Cleanup unused code. 2018-01-09 14:54:11 +01:00
377915b081 DRW: Make use of DRWInstanceData.
This modify the selection code quite a bit but it's for the better.
When using selection we use the same batching / instancing process but we draw each element at a time using a an offset to the first element we want to draw and by drawing only one element.
This result much less memory allocation and better draw time.
2018-01-09 14:54:11 +01:00
aa0097ad5e DRW: Add instance data memory manager.
This is a special memory manager that keeps memory blocks ready to send as vbo data.
Since we loose which memory block was used each DRWShadingGroup we need to redistribute them in the same order/size to avoid to realloc each frame.
This is why DRWInstanceDatas are sorted in a list for each different data size.
2018-01-09 14:54:11 +01:00
2237ee3ed7 Gawain: VBO: Add possibility to use external datablock.
Adds the possibility to specify the data buffer directly and precise ownership.
By not passing ownership to gawain the memory block can be reused.
2018-01-09 14:54:11 +01:00
b300fa4923 Gawain: Modify batch draw function to work with ranges.
This enables to draw the same vbo but only with a selected range. (useful for selection with instancing/batching)
2018-01-09 14:54:11 +01:00
f5d64b59f5 Fix T53691: Motion Tracking Object Solver Constraint doesn't work as Bone Constraint 2018-01-09 14:27:19 +01:00
bf8137994d Depsgraph: Move special handling of tracking constraints to a dedicated function 2018-01-09 14:11:23 +01:00
d32878b425 Depsgraph: Perform early check on constraint info NULL 2018-01-09 13:09:59 +01:00
83e84b2c2c Merge branch 'master' into blender2.8 2018-01-09 12:52:13 +01:00
ce0fcf1378 Correct error in last commit (versioning) 2018-01-09 15:17:00 +11:00
6554207841 Add deform axis for Simple Deform modifier
D2989 by @dmarra w/ own edits
2018-01-09 15:09:55 +11:00
375d27f230 Curve Edit Mode: Use curve handle theme colors 2018-01-09 13:30:30 +11:00
850f73638c install_deps: Fix OCIO always re-cloning its whole git repository. 2018-01-08 16:34:34 +01:00
c8a989d644 No groping in Blender's Tracker!
This a small cleanup of something which I think is just a typo anyway.

With all the recent talks of harrassment and groping, I think we better avoid
that within our source code! :)

Reviewers: sergey

Reviewed By: sergey

Tags: #motion_tracking

Differential Revision: https://developer.blender.org/D2979
2018-01-08 14:12:15 +01:00
3ee2ed3049 Fix T53612: Blender crashes on CleanTracks with 'DELETE_SEGMENTS' and a disabled marker
Simple fix, which is totally safe for 2.79a!
2018-01-08 14:10:50 +01:00
c26da06ae6 Merge branch 'master' into blender2.8 2018-01-08 09:39:32 +01:00
96e507d989 Fix T53509: Datablock ID Properties attached to bpy.types.Material are not loaded.
Stupid mistake in material reading code, thanks to Simon Wendsche (@BYOB) for the investigation and fix!

To be backported to 2.79a.
2018-01-08 09:37:56 +01:00
a7b4f98e73 Fix T53713: User remap failed w/ texface images 2018-01-08 16:58:58 +11:00
87607254d6 (Nodes) Display image name if any in the Image and Texture Image node title 2018-01-07 22:29:25 +01:00
add580beee Fix T47212: Luminance Key not working with HDR and out-of-gamut ranges.
Differential Revision: https://developer.blender.org/D2981
2018-01-06 16:41:39 +01:00
0e59f2b256 Fix T47212: incorrect luma coefficients for Luminance Key node.
Differential Revision: https://developer.blender.org/D2982
2018-01-06 16:41:33 +01:00
c6abf41f71 Fix T53650: remove hard limits on force field size and max distance.
Differential Revision: https://developer.blender.org/D2987
2018-01-06 16:15:13 +01:00
Dalai Felinto
84d4476eb1 Outliner: Rename "Master Collection Tree" to "Collections"
This is part of T53495.
2018-01-05 19:17:38 -02:00
Dalai Felinto
fb4cd136a7 Outliner: Support multiple-objects drag'n'drop into collections
We now can drag multiple objects at once in the outliner. You we restricted to
working within a single outliner. Be sure to drag from the objects name, not
from its icon (otherwise it will try to parent it).

We don't use the same drag'n'drop system as IDs here. Which although I dislike
allowed for this solution to be local, and not dependent on the entire
drag'n'drop system of Blender.

This is a feature Andy Goralczyk has requested a long time ago.
Kudos for him for his request.
2018-01-05 18:23:55 -02:00
Dalai Felinto
9d134a22c2 Cleanup: DNA comment regarding ID for collections in outliner 2018-01-05 17:32:22 -02:00
Dalai Felinto
a768aa6ec8 Fix drag and drop in outliner for scene collections
This technically reverts 176698b2eb.

Drag and drop for scene collections requires id for its poll function. However
we were passing the collection as id pointer for outliner_add_element
(which is ok since the function doesn't require a real ID).

I couldn't reproduce the original issue tackled by the forementioned commit so
I'm going ahead and bringing drag and drop back for scene collections.

Note: We already pass the ID for view layer collections as well since we brought
collections into groups.
2018-01-05 13:58:49 -02:00
Dalai Felinto
c5e01edeca Outliner: Fix for restriction columns
This is a partial revert of 1f5106de61.

First and firemost, for groups I was checking the wrong flag
(soops->flag & SO_GROUPS) instead of (soops->outlinevis == SO_GROUPS).

Second, the columns were entirely broken for things like Orphan Data.

Third, I tried to have different columns for different `outlinevis`, but we have
bones with only visible and select, modifiers with visible and render, render
passes with enable and another value ... I would rather stay away from this mess
at the moment, and stick to the more obvious bug fix.

Finally, there is a bug (not addressed here) where the whole line is selected,
regardless of the restriction column area. It should be fixed separately.
2018-01-05 11:42:10 -02:00
d73f74793e Eevee: Make Ogl render sampling more correct
Result is less noisy ogl renders.

What this patch does:
- the draw loops gets accumulated into the output buffer.
- disable TXAA persmat jittering in ogl render since ogl render already does that.
- make noise texture update correct accross all draw loops. Previously it was reset between each FSAA samples.
2018-01-05 10:25:28 +01:00
9a00d57371 DRW: Add viewport argument to DRW_draw_render_loop_offscreen
This way we can have persistent data accross different calls.
2018-01-05 10:25:28 +01:00
6eb89027c3 Fix T53696: Compositor HSV limits changed 2018-01-05 20:13:17 +11:00
9be32ac5fe Fix manipulator crash when modal operator doesn't run 2018-01-05 14:53:10 +11:00
Dalai Felinto
a9e3ac906e Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-04 15:57:48 -02:00
Dalai Felinto
95d83b9b23 Fix leak when rendering OpenGL animations
We were duplicating rectf twice :/

Patch by Clément Foucault.
2018-01-04 15:56:43 -02:00
0becc8a7dd Fix T52953: Crash removing material 2018-01-04 21:35:09 +11:00
205978a489 Eevee: Fix AO applied twice on glossy shader when using OGL render
Seems to be a compiler bug. This is really strange.
I just rephrased the whole thing and it appears to work.
2018-01-04 10:43:54 +01:00
4df11e3c70 Eevee: SSR: Fix ssr nor working in ogl render. 2018-01-04 10:43:54 +01:00
5ab2fc65c6 DRW: Fix boolean uniform lenght.
Boolean uniform needs to be 4bytes long for opengl.
Use "int" for every bool you want to pass as a uniform.
2018-01-04 10:43:54 +01:00
b4ad0151c3 Eevee: Fix issues with alpha blending
- Hashed Alpha materials were outputing their alpha values even if the final pixel has no blending and thus no transparency.
- Opacity was not clamped when using "add closure" nodes.
2018-01-04 10:43:54 +01:00
bbf810f969 DRW: Fix incorrect blending functions. 2018-01-04 10:43:54 +01:00
2b678db3fe Eevee: Make the background black when rendering without sky.
This prevent some bad blending when using transparent materials.
2018-01-04 10:43:54 +01:00
cbe9098bf9 OGL Render: Use float buffer instead of byte buffer.
We need to remove all transform to display during rendering for this to work. The float rect is then color managed when displayed.

This makes all interface colors wrongly displayed because they should be color managed when rendering.
2018-01-04 10:43:54 +01:00
c79216d77d GPU_offscreen: Add option for high bit depth.
This way we can render in HDR and read the real pixel values.
2018-01-04 10:43:54 +01:00
6b2989ae75 DRW: Fix small changes to transparent background.
Fix changes introduced e3ef782af5

Eevee is in charge of rendering so it should be its task to have it's buffer initialized
2018-01-04 10:43:54 +01:00
5a6a819b5d Merge branch 'master' into blender2.8 2018-01-04 10:36:50 +01:00
727aab5af4 Fix uninitialized stack use in rna diff override 2018-01-04 16:15:31 +11:00
457dc8d12c Fix T53586: Surfaces collapse when joined 2018-01-04 16:01:27 +11:00
9b65560934 Fix T53637: Keymap from app-template ignored
Addon's were also ignored
2018-01-04 14:19:00 +11:00
7fc1f42aae tests: limit public API in view_layer_common 2018-01-04 11:57:45 +11:00
ea55af2163 tests: replace boiler-plate with util function
This crept back in somehow!
2018-01-04 11:28:46 +11:00
Dalai Felinto
e1cbac715a Fix FOREACH_SCENE_COLLECTION/FOREACH_SCENE_OBJECT for nested collections
This fixes any function that relied on these iterators such as:
* Outliner Same Type
* Metaballs
* scene.objects

We were not considering the collections when there was collections nested
to the collections nested to the master collection.

It includes a unittest.
2018-01-03 19:33:00 -02:00
Dalai Felinto
10f0635d32 Outliner/Collections: Remove selected objects operator
This is part of T53495.
2018-01-03 18:27:42 -02:00
Dalai Felinto
eaf559d52a Outliner/Collections: Add selected objects operator
This is part of T53495.
2018-01-03 18:27:06 -02:00
Dalai Felinto
d9b4d6ee5a Outliner: Right mouse menu for collections editing 2018-01-03 12:28:01 -02:00
8a72c3baef Static assert for correct strings from context mode enum.
Adding new context modes requires adding a string in CTX_data_mode_string,
but there is no error when omitting this other than panels using
incorrect contexts. The static assert should help detect simple
missing strings at least to avoid confusing errors.
2018-01-03 13:15:33 +00:00
f20bb6c63f Merge branch 'master' into blender2.8 2018-01-04 00:09:10 +11:00
25418be97e build deps: llvm new website download locations 2018-01-03 14:52:25 +02:00
be40389165 Merge branch 'master' into blender2.8 2018-01-03 23:44:47 +11:00
Dalai Felinto
ffb2c40176 New API function to call an existing menu
Thanks Campbell Barton for the help and review.
This is for Blender 2.8, so we are not using this function yet.
2018-01-03 10:17:59 -02:00
e981a7de31 Missing from last commit 2018-01-03 22:01:40 +11:00
2f8c2572ed Fix T53632: Objects outside scene shown in popup
Only show objects in current scene when not pinned.

This commit adds a filter argument to id-template
since we may want to filter by other criteria.
2018-01-03 21:54:02 +11:00
cbc7aa80d4 Fix T53678: Smart Project UV margin ignores units 2018-01-03 16:10:41 +11:00
060fdb49d6 Fix an error on last commit
`count` here is multiplied by 4.
2018-01-02 23:44:01 -02:00
2a57a46441 Fix crash when you change the curve resolution in Edit Mode of the Blender Render engine
Same problem as previous commit, but now in `drawobject.c`.
Also added a comment to the equivalent line in `draw_cache_imp_curve.c`.
2018-01-02 23:31:28 -02:00
6c46dff50d Curve Edit Mode: Fix crash when the U-resolution of the curve is changed
`normal_len` did not follow the value of the loop that is executed to add the vertices, being different from the vbo size
2018-01-02 23:09:51 -02:00
b3c4e30a7c Fix: MSVC2013 compile problems with the "inline" keyword 2018-01-03 12:59:10 +13:00
c621832d3d Cycles: CUDA support for rendering scenes that don't fit on GPU.
In that case it can now fall back to CPU memory, at the cost of reduced
performance. For scenes that fit in GPU memory, this commit should not
cause any noticeable slowdowns.

We don't use all physical system RAM, since that can cause OS instability.
We leave at least half of system RAM or 4GB to other software, whichever
is smaller.

For image textures in host memory, performance was maybe 20-30% slower
in our tests (although this is highly hardware and scene dependent). Once
other type of data doesn't fit on the GPU, performance can be e.g. 10x
slower, and at that point it's probably better to just render on the CPU.

Differential Revision: https://developer.blender.org/D2056
2018-01-02 23:50:18 +01:00
6699454fb6 Cycles: make CUDA code a bit more robust to host/device alloc failures.
Fixes a few corner cases found while stress testing host mapped memory.
2018-01-02 23:46:19 +01:00
Dalai Felinto
07de8eff77 Layers/Collections: Fix crash when deleting collection
If the collection to be deleted has a nested collection that is directly linked
to a view layer, we were getting a crash.
2018-01-02 18:19:26 -02:00
Dalai Felinto
8300b5e539 Layers: Fix operator_context unittest
This was broken since 70cdc8412c when we changed the requirement for context
scene collection to be part of context view layer.
2018-01-02 17:42:23 -02:00
Dalai Felinto
f3566235ca Layers: Fix collection_rename unittest
This was broken since c9cb5dc3da when we supported same name for
non-sibling collections.
2018-01-02 16:59:30 -02:00
Dalai Felinto
a9fe94245b Outliner: Master Collection always expanded
This is part of T53495.

This makes sure the master collection is always expanded and you don't even get
the expand/collapse icons for it.

This is only for the Collecions (currently Master Collection Tree) option, not
for active view layer.
2018-01-02 14:40:33 -02:00
Dalai Felinto
e1238bcced Outliner: Always show the master collection on top of the tree
This reverts commit 0d0d68d39d with extra changes.

This is part of T53495.
2018-01-02 13:10:45 -02:00
Dalai Felinto
e8c737d7c2 Outliner/Collections: Don't link a collection after creation 2018-01-02 13:10:45 -02:00
e84966ac42 nstall_deps: llvm downloads new website location
Patch by Lucas Walter (@lucasw), thanks.

Reviewers: mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D2983
2018-01-02 15:23:45 +01:00
e59cf13b8c fix T53230: avoid Nullpointer problems in Collada Exporter 2018-01-01 15:02:26 +01:00
ac934efc5e Build: fix make deps TBB on Linux, older versions don't support GCC 7. 2017-12-30 00:07:33 +01:00
6a225a283e Build: fix make deps OpenSubdiv build on Linux. 2017-12-29 22:53:32 +01:00
Dalai Felinto
bbbdb27d65 Outliner/Collection: Interface for Master Collection Tree
This is part of T53495.

This adds an Edit menu and remove the buttons.
2017-12-29 13:38:28 -02:00
Dalai Felinto
4d08ef822c Outliner/Collection: Operator to delete selected collections
This is part of T53495.

This operator is actually using existing code. The only new thing about it is
that it has a shortcut.

It will be exposed in the UI soon together with the nested collection operator.
2017-12-29 13:37:27 -02:00
Dalai Felinto
8252a414d8 Outliner/Collection: Operator to create (nested) collections
This is part of T53495.

This operator is intended for the outliner when viewing Collections (at the moment, Master Collection Tree).
It has a shortcut "C", and will be added to a menu shortly.
2017-12-29 13:36:55 -02:00
Dalai Felinto
a6c69ca57f Fix T53513: Particle size showing in multiple places
Technically this was introduced in 01b547f993 when
exposing size and randomness for particles.

This "fixes" makes sure particle size and size randomness is always in the
Render panel when it affects the particle system (i.e., always unless using
advanced hair or hair that is not rendering groups/objects).
2017-12-29 13:17:55 -02:00
Dalai Felinto
f2a24afe8c Fix T53647: Outliner crashes when active object is deleted
Based on patch by Philipp Oeser (lichtwerk).
2017-12-29 09:55:13 -02:00
08b063a19f Fix T53639: text sequence strips no stamped into render.
Differential Revision: https://developer.blender.org/D2977
2017-12-29 00:25:29 +01:00
7a6967cbe6 Fix mistake in previous fix for T53600, shows we really need a smarter solution. 2017-12-29 00:07:49 +01:00
17f1ce4d4f Fix T53630: Effect strips not displaying Input data.
Fix T52977: Parent bone name disappeared in the UI in pose mode.

Regression caused by own rBc57636f060018. So instead of changing widget
type, just flag it as disabled.

Note that core of the issue is elsewhere though - there is absolutely no
reasons to have a search widget for pointers we cannot change nor
search! But fixing this is not really top priority, one of the many
glitches of our UI code, so think we can live with current code.

To be backported to 2.79a.
2017-12-28 17:57:18 +01:00
Dalai Felinto
2b7f36300e RNA cleanup: Argument names + tooltip for scene_collection.collections.remove() 2017-12-28 12:53:54 -02:00
Dalai Felinto
70cdc8412c Context: Fix scene_collection
We now allow for scene collection that is not currently linked to view layer.
2017-12-28 12:24:13 -02:00
Dalai Felinto
dfd7b0d07a RNA: scene_collection.collections.new() name optional
We already have a fallback naming system when no naming is given, we should use that.
2017-12-28 12:23:37 -02:00
Dalai Felinto
8620dd7adf Cleanup after collection rename commit
Related to c9cb5dc3da.
2017-12-28 09:23:35 -02:00
Dalai Felinto
c9cb5dc3da Collections: Allow collections from different "parents" to have the same name
This allows users to have "Support", "Rig", "Characters" collections nested to
different collections without having to resort to "House.Rig", "House.Characters"
or "Rig.001", "Characters.003" :/

This is part of T53495.
2017-12-27 19:45:37 -02:00
Julian Eisel
7dee0bbf06 Fix missing redraws when changing active view-layer or its name
Also removed unnecessary `struct` keywords.
2017-12-27 17:08:00 +01:00
Dalai Felinto
110373de6a Fix T53638: View layer renaming crashes 2/2
This fixes renaming the view layer via Python.

This bug was introduced originally in 3a95bdfc65. Although I suspect it was
around for longer, since this commit didn't touch this part of the code.

But basically we need the id of the RNA property to be the one that owns
the data (view layer).
2017-12-27 13:39:28 -02:00
Dalai Felinto
b517dc9b2d Fix T53638: View layer renaming crashes 1/2
This fixes renaming via the interface.

This bug was introduced originally in 9515737b55. We need the id of the RNA
property to be the one that owns the data (view layer).

So it can't be the window's id, but the scene one instead.
2017-12-27 13:37:38 -02:00
Dalai Felinto
bd80ace2da Depsgraph: Fix copy-on-write assert when freeing Freestyle config
We were bumping user count when duplicating viewlayer and its freestyleconfig
depending on the flag, however when freeing we were always decreasing user
count.

This fixes this and get rid of the assert when running:
`--factory-startup --enable-copy-on-write`

And closing Blender.
2017-12-26 13:31:48 -02:00
948515c21a Fix T53600: Cycles shader mixing issue with principled BSDF and zero weights.
SVM nodes need to read all data to get the right offset for the following node.
This is quite weak, a more generic solution would be good in the future.
2017-12-25 23:59:20 +01:00
e8e92dffed Fix T53607: Cycles normal map baking problem when there is no bump. 2017-12-25 23:05:45 +01:00
7e4568a939 Cleanup - Various style/typo fixes 2017-12-23 23:54:05 +13:00
Dalai Felinto
fe1e2c2f89 Collections: deletea collection move objects to master collection if users=0
The mental model is that a scene collection is a small wrap on top of the master
collection, so all objects are in the master collection at all times.

When we remove a collection there is no reason to remove an object. So if the
object was not linked to any other collection, we add link it to the master one.
2017-12-22 19:18:21 -02:00
d130c66db4 Fix scalability issue in threaded code of Mesh normals computation.
We tried to do as much as possible in a single threaded callback, which
lead to using some nasty tricks like fake atomic-based spinlocks to
perform some operations (like float addition, which has no atomic
intrinsics).

While OK with 'standard' low number of working threads (8-16), because
collision were rather rare and implied memory barrier not *that* much
overhead, this performed poorly with more powerful systems reaching the
100 of threads and beyond (like workstations or render farm hardware).

There, both memory barrier overhead and more frequent collisions would
have significant impact on performances.

This was addressed by splitting further the process, we now have three
loops, one over polys, loops and vertices, and we added an intermediate
storage for weighted loop normals. This allows to avoid completely any
atomic operation in body of threaded loops, which should fix scalability
issues. This costs us slightly higher temp memory usage (something like
50Mb per million of polygons on average), but looks like acceptable
tradeoff.

Further more, tests showed that we could gain an additional ~7% of speed
in computing normals of heavy meshes, by also parallelizing the last two
loops (might be 1 or 2% on overall mesh update at best...).

Note that further tweaking in this code should be possible once Sergey
adds the 'minimum batch size' option to threaded foreach API, since very
light loops like the one on loops (mere v3 addition) require much bigger
batches than heavier code (like the one on polys) to keep optimal
performances.
2017-12-22 22:12:23 +01:00
Julian Eisel
8ed1c61642 Correction to previous commit: Pass MakePrimitiveData to make_prim_finish 2017-12-22 18:53:26 +01:00
Julian Eisel
10390ca057 Cleanup: Encapsulate primitive creation data into struct, remove unused argument
Should make it easier to add new and modify existing parameters.
2017-12-22 18:27:25 +01:00
Julian Eisel
430070938c Fix manipulators not updating when changing workspace view-layer
There are more issues when changing view-layer (esp. with edit-mode).
2017-12-22 17:04:00 +01:00
6efd58dd3e Task scheduler: Clarify why do we need an atomic add of 0 2017-12-22 16:37:25 +01:00
Dalai Felinto
c08dac000f Collection: Name collection based on parent's name
So they are:

House
 -> House 1
 -> House 2
 -> ...

The exception is when the parent collection is the master collection. In this case we get:

Master Collection
 -> Collection 1
 -> Collection 2
 -> ...

This is part of "T53495: View layer and collection editing - Design Task"
2017-12-22 11:41:09 -02:00
870840e8b7 Subsurf: Avoid possible use of partially initialized edge hash 2017-12-22 12:51:00 +01:00
df0ecd73af Subsurf: Avoid global lock for loops and orig index layers
This is a bit annoying to have per-DM locking, but it's way better (as in, up to
4 times better) for playback speed when having lots of subsurf objects,
2017-12-22 12:50:57 +01:00
50f1c9a8af Task scheduler: Start with suspended pool to avoid threading overhead on push
The idea is to avoid any threading overhead when we start pushing tasks in a
loop. Similarly to how we do it from the new dependency graph. Gives couple of
percent of speedup here, but also improves scalability.
2017-12-22 12:25:11 +01:00
Dalai Felinto
fec3be6b54 T53610: Crash opening file with linked particles
I could done a subversion bump, but I found a safe way to avoid it.
It leads a bit of an ugly code, but once we bump the subversion
next time we can clean it up easily.
2017-12-21 23:25:27 -02:00
d2ea9c2063 Fix typo in previous commit 2017-12-21 17:19:07 +01:00
a7efdc14a1 Merge branch 'master' into blender2.8 2017-12-21 17:17:27 +01:00
c66983c5c8 Depsgraph: Sort and clam number of statistics entries
Makes log easier to read.
2017-12-21 17:16:18 +01:00
Dalai Felinto
b89f2276e5 Implement duplicator viewport/render visibility options
This allows a duplicator (as known as dupli parent) to be in a visible
collection so its duplicated objects are visible, however while being
invisible for the final render.

An object that is a particle emitter is also considered a duplicator.

Many thanks for the reviewers for the extense feedback.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2966
2017-12-21 13:43:24 -02:00
103dd66057 Merge branch 'master' into blender2.8 2017-12-21 16:36:02 +01:00
885bb5b137 Depsgraph: Bring timing statistics to the new dependency graph
This statistics is only collected when debug_value is different from 0.

Stored in depsgraph node itself, so we can always have access to average data
and other stats which requires persistent storage. This way we also don't waste
time trying to find stats from a separately stored hash map.
2017-12-21 16:33:22 +01:00
d988eae6f9 Depsgraph: Make it more clear that we dump relations into graphviz
We might implement other things to dump into graphviz, so better to
start having explicit names.
2017-12-21 16:33:22 +01:00
b7121639e9 Depsgraph: Simplify some functions in evaluaiton 2017-12-21 16:33:22 +01:00
f0a5dc63ff Depsgraph: Simplify evaluation function 2017-12-21 16:33:22 +01:00
bf1dc39679 Fix T53567: Negative pixel values causing artifacts with denoising
Now negative color values are clamped to zero before the actual denoising.
2017-12-21 14:24:23 +01:00
b38c083259 Merge branch 'master' into blender2.8 2017-12-21 12:17:48 +01:00
41b29c69c0 Depsgraph: Fix mistake in previous commit 2017-12-21 12:16:12 +01:00
00062e08ee Merge branch 'master' into blender2.8 2017-12-21 12:00:06 +01:00
6e47680077 Depsgraph: Remove confusing declaration of node method
it is only to be implemented for operation node.
2017-12-21 11:58:48 +01:00
681a102800 Depsgraph: Remove one of temporary tags in the node
No real reason to have that, better to free up space for something much more
awesome!
2017-12-21 11:47:34 +01:00
5df4950073 Depsgraph: Cleanup, move implementation away from header 2017-12-21 11:35:10 +01:00
9f0d067c2e Merge branch 'master' into blender2.8 2017-12-21 11:17:34 +01:00
f6b2fbb029 Depsgraph: Remove evaluation priority completely 2017-12-21 11:15:21 +01:00
f906f5cc58 Depsgraph: Remove eval priority from debugger
This needs to be redone anyway, to correspond to possibly new priorities
calculated for evaluaiton.
2017-12-21 11:14:39 +01:00
0ed3a72012 Depsgraph: Remove unused component context functions 2017-12-21 10:37:00 +01:00
Dalai Felinto
e3ef782af5 Fix for T53599: OpenGL render with transparent background
I had to make Eevee draw its scene in the scene pass (before it was doing it
in the background pass). This is not ideal since reference images require
a separation between scene and background.

But it's the best way to solve it now. Clay is working fine.
2017-12-20 16:05:47 -02:00
93b2871cf5 Depsgraph: Remove node class stored in both type info and node
This is something deliver form node type, there is no reason to try cache it
anywhere, especially since it's not used in any performance critical code.

Lighter weight dependency graph is what we want.
2017-12-20 17:54:52 +01:00
5650fe77e4 Cycles: Cleanup, indentation 2017-12-20 17:42:50 +01:00
03a589125f Merge branch 'master' into blender2.8 2017-12-20 16:46:28 +01:00
e5b92cd63e Depsgraph: Remove unused incldues 2017-12-20 16:45:10 +01:00
9eb46fc22b Fix compilaiton error in debug mode
The structure was just calloc-ed, no need to check for anything. It's all zeroes!
2017-12-20 16:41:51 +01:00
a52452c043 Merge branch 'master' into blender2.8 2017-12-20 16:40:49 +01:00
3474db4b37 Depsgraph: Move ID node to own file 2017-12-20 16:35:48 +01:00
f87c157f22 Depsgraph: Move time source node to own file 2017-12-20 16:29:13 +01:00
b2ef042793 Depsgraph: Print some statistics about transitive reduction 2017-12-20 16:19:40 +01:00
f2aacfc943 Depsgraph: Make transitive reduction to work 2017-12-20 16:16:28 +01:00
5b1404f066 Depsgraph: Add utility function to unlink relation from graph 2017-12-20 16:15:55 +01:00
1e236deab3 Depsgraph: Remove unused priority calculator
While it sounds useful, in practice it was rather causing
extra overhead and was slowing things down.
2017-12-20 15:53:39 +01:00
65128d296c Depsgraph: Remove remaining parts of old removed debugger 2017-12-20 15:50:22 +01:00
b1a036861d Fix T53572: Alembic imports UV maps incorrectly
Since in Alembic the loop order seems to be reversed when exporting and
importing, and this was the only place where it was not, I was thinking
to match this to the convention of reversing the loop order as well.

Reviewers: sybren, kevindietrich

Tags: #alembic

Differential Revision: https://developer.blender.org/D2968
2017-12-20 10:55:02 +01:00
94a3ee56c7 Fix MSVSC2017 error
The last compiler version needs this include
2017-12-20 10:23:12 +01:00
d0ac5d3810 Cleanup: remove unnecessary tooltip line limit
Also add TODO for possible future changes.
2017-12-20 17:20:33 +11:00
f6766c31cf Manipulator: clear tooltip for click actions too 2017-12-20 17:13:54 +11:00
5b364dd780 Manipulator: tooltip support
Currently operators and properties are used.
2017-12-20 16:40:53 +11:00
3143b2f942 Merge branch 'master' into blender2.8 2017-12-20 15:06:22 +11:00
51f0c3fadf UI: move tooltip API to public header 2017-12-20 14:58:06 +11:00
Julian Eisel
b0d61ea770 Fix crash in RNA when accessing empty property_tags list
E.g. running `bpy.context.active_object.cycles.bl_rna.property` in the
console would crash.

Thanks @lijenstina for reporting!
2017-12-19 20:56:14 +01:00
Dalai Felinto
b3bcbc9e85 Fix T53442: Outliner refresh issues when adding new collection
Notifier is getting through, yet tree wasn't rebuilding until
we force redraw by resizing the outliner.

Thanks to Danrae Pray (@spockTheGray) for looking at this issue.
2017-12-19 14:33:27 -02:00
433c74d9f7 bpy_extras: add missing colorband keymap to keyconfig_utils.py
fixes failing ctest script_load_keymap
2017-12-19 08:04:17 -07:00
7e8525663c Font objects: Support proper auto-space
Annoyingly, need to convert vfont to nurbs, do minmax and toss nurbs away.
This is likely to be fine, since this function is not intended to be used
a lot, and this is the only way to get more meaningful result.

However, it's not very clear what to do with font on curve.

This fixes rendering of font object with auto texture space in Cycles
introduced in c34f3c7.

It is probably possible to introduce new mode to vfont_to_curve which
will do boundbox without extra allocations, but that's more like an
optimization.

Reviewers: campbellbarton, mano-wii

Reviewed By: campbellbarton

Subscribers: zeauro

Differential Revision: https://developer.blender.org/D2971
2017-12-19 15:55:56 +01:00
ab1af38c74 Cycles: Fix crash opening user preferences after adding extra GPU
We can not store pointers to elements of collection property in the
case we modify that collection. This is like storing pointers to
elements of array before calling realloc().
2017-12-19 15:51:28 +01:00
Dalai Felinto
672c9a9a6d Fix T53583: Crash when instancing a group with an armature
There is still a crash that you get because the draw manager needs to
handle duplis differently.

But the initial assert caused by this particular file is now fixed.
2017-12-19 10:46:37 -02:00
2bbfce631d Merge branch 'master' into blender2.8 2017-12-19 13:42:01 +01:00
b6b9351371 Tracking: Add missing animation path fix after renaming tracks 2017-12-19 13:39:37 +01:00
e1921ed871 Tracking: Add utility function to get RNA path prefix for given track
Some code could be de-duplicated with the full path case, but that's
for another rainy day i guess.
2017-12-19 13:09:39 +01:00
9fa021cdaf Tracking: Disable animation of auto-keyframe option 2017-12-19 12:59:52 +01:00
61c218fe7d Tracking: Add missing animation fix when deleting plane track 2017-12-19 12:58:42 +01:00
883e342bdb Tracking: Fix possible numerical overflow 2017-12-19 12:52:20 +01:00
28970b6ed2 Fix T53523: Keyframes for Marker weight stay, even if the track itself is deleted
Was using wrong prefix for the RNA path fix.
2017-12-19 12:51:45 +01:00
92197c24f0 Tracking: Use new RNA path utility functions 2017-12-19 12:48:53 +01:00
cf90b11d68 Tracking: Add utility function to get RNA path for given track 2017-12-19 12:45:23 +01:00
f62de28972 Depsgraph: Fix nexted node trees being tagged with wrong flag 2017-12-19 12:37:57 +01:00
43dcf804bd Tracking: Remove duplicated functions 2017-12-19 12:22:34 +01:00
1818aa3b24 Tracking: Add plane tracks equivalents to previous commit 2017-12-19 12:18:52 +01:00
e598e55edd Tracking: Add utility function to get tracks list for given track 2017-12-19 12:14:26 +01:00
adaeb14b3e Tracking: Add utility function to find tracking object from a given track 2017-12-19 12:13:57 +01:00
71c93624e2 Cleanup: Don't use camel case for variable names 2017-12-19 11:53:11 +01:00
6cbdde1ba1 Fix T53400: DEG tagging is freeing Irradiance Grid when selecting objects
Ignore selection related recalc in Eevee ID update callback.
2017-12-19 11:46:53 +01:00
4045a51a11 Depsgraph: Rework tagging and flushing routines
The goal is: have id->recalc flags set to components which got changed.
To make it possible for render engines to check on a more granular basis
what changed in the object. For example, is it a transform which changed
or is it just some ID property changed which has nothing to do with rendering.

The tricky part is: we don't want duplicated logic in tagging and flushing.
In order to avoid this duplication, we store ID recalc flag in the component
node type information. That type information could easily be accessed by both
tagging and flushing routines.

Remaining part of the changes are related on changing the way how tagging
works. The new idea here is to have utility function which maps update tag to
a component. This way we can easily set ID recalc flags right away. Without
any duplication of ID recalc flags set in multiple flag handler functions.

With all this being said, there should be no user measurable difference for
now, it's a gigantic basement for some upcoming work and fixes.
2017-12-19 11:37:22 +01:00
e4849ad3a6 Depsgraph: Preliminary work to make components to ID recalc flags 2017-12-19 11:37:14 +01:00
3500274d9c Add more granular ID recalc bits
Only bits for now, unused. Just to keep upcoming patches smaller.
2017-12-19 11:36:58 +01:00
0ebf69287a Merge branch 'master' into blender2.8 2017-12-19 10:05:04 +01:00
c34f3c777f Fix T53559: Auto texture space for text and font is wrong in Cycles
The issue actually goes a bit deeper, converting curve to mesh will
change texture space just because font and bezier curves are using CV
to calculate texture space.

So now when those objects are converted to mesh, we disable auto
texture space and copy evaluated space over.
2017-12-19 10:01:00 +01:00
a130c82f0a Cycles tests: Enable texture space tests 2017-12-19 09:54:23 +01:00
9d69b3d48b Merge branch 'master' into blender2.8 2017-12-19 19:42:11 +11:00
77c62c7793 UI: split out button checks from tooltip creation
Allows to make tooltips from other kinds of data.
2017-12-19 19:34:16 +11:00
e288afe110 Merge branch 'master' into blender2.8 2017-12-19 08:57:34 +01:00
a0fa404deb Fix T53547 for real now
Original fix was assuming that particle init operation is updated on every
frame, which is wrong behavior and that was fixed in previous commit to the
original bugfix.
2017-12-19 08:56:11 +01:00
891a3762ce Manipulator: ui-scale support for navigate widget 2017-12-19 17:14:52 +11:00
01850f0928 Manipulator: 3D view navigation improvements
- Highlight's were too intense/distracting
  use more subtle alpha (consistent with the rest of our UI).
- Don't fill center cube (only draw edges).
- Draw widget while interacting since this is helpful in some cases.

Thanks to @jbakker for suggestions.

Also change axis hotspots so the nearest is always selected
for quicker axis picking (relies on dragging any axis to orbit).
2017-12-19 15:28:01 +11:00
f03660bb84 Correct axis mapping logic 2017-12-19 14:36:22 +11:00
cfd1b48492 Merge branch 'master' into blender2.8 2017-12-19 14:15:19 +11:00
e418c858ab 3D View: use shortest angle between quaternions
Gave incorrect smoothview speed changing between some axis and
axis locking.
2017-12-19 14:05:54 +11:00
7a58ff928c Math Lib: signed versions of quaternion angle
There was no simple way to get the shortest quaternion angle.
2017-12-19 14:03:29 +11:00
5df597171b Manipulator: Support click only manipulator's
Makes the 3D view navigation widget easier to use: dragging anywhere
in the rotation region now rotates without having to avoid the XYZ axis
hotspots which only activate on a single click.

Logic for drag detection is complicated by manipulators reliance
on keeping the modal operator running.
Currently this is wrapped in an ifdef,
we may want to implement it differently later.
2017-12-19 12:49:02 +11:00
12bc63a0fe Manipulaor: de-duplicate finish call 2017-12-19 12:46:36 +11:00
02abb17ae2 Forgotten on last commit 2017-12-18 23:24:12 -02:00
24ca903f6d Draw Manager: draw_cache_imp_displist, always return IndexBuf even when there is no index
This prevents possible errors with materials and a crash with low resolution metaball.
Also a small cleanup was done in the code.
2017-12-18 23:17:55 -02:00
bb30ce0f0b Fix T53474, bevel glitchy with big objects.
A comparison should have not just have been against an epsilon,
but relative to the edge length involved.
Thanks to mano-wii for patch on which this is based.
2017-12-18 12:24:42 -05:00
57f2cc918b Depsgraph: Cleanup, line length 2017-12-18 16:55:04 +01:00
e57fe5cd95 Depsgraph: Use named typedef for tag 2017-12-18 16:53:12 +01:00
94d34ae205 Depsgraph: Cleanup, typo in comment 2017-12-18 16:52:46 +01:00
90021402e2 Merge branch 'master' into blender2.8 2017-12-18 16:51:05 +01:00
443789d7c6 Depsgraph: Add facilities to store what ID recalc flag component corresponds to
The idea is to de-duplicate logic in DEG_id_tag_update() and flushing where we
need to translate depsgraph tag or component type to ID level recalc flag.

Currently unused, but is required for Blender 2.8.
2017-12-18 16:46:32 +01:00
9e424faec6 Add dedicated named constant for no ID recalc flag 2017-12-18 16:40:18 +01:00
fbfb35741c Merge branch 'master' into blender2.8 2017-12-18 16:36:23 +01:00
342226a670 Depsgraph: Synchronize flushing with 2.8 branch
Not only this helps merges form master to the branch, but also:

- Allows us to production-check changes as soon as possible.
- Avoids some unnecessary editors update about ID changes.
- Adds small optimization on queue size by always keeping one of the pointers
  outside of the queue.
2017-12-18 16:33:12 +01:00
c46a9d8117 Merge branch 'master' into blender2.8 2017-12-18 16:19:12 +01:00
344eff9c48 Depsgraph: Add query API to traverse all dependent IDs of the given ID 2017-12-18 16:15:47 +01:00
c5d9eb88e2 Depsgraph: Replace iteration over ghash with iteration over flat array 2017-12-18 16:14:50 +01:00
8fe556a337 Depsgraph: Introduce flat list of ID nodes
The idea is to allow iterating over ID nodes in exact order of their
construction, and in order which will not change dependent on memory
pointers or anything.
2017-12-18 16:10:22 +01:00
1fb43dcd5a Fix bad merge happened at some point 2017-12-18 16:04:06 +01:00
a41fe949d8 Fix T53398: Surface deform modifier says that convex polygons are concave for big faces
Dot-product for angle check need either to be divided by vectors magnitude or be
calculated for normalized vectors.
2017-12-18 15:16:22 +01:00
5566a88873 Static Override: better handling in ID template.
Now we stick to a single button, when data is directly linked, clicking
on it will make a local copy, while shift-clicking on it will make a
static override.

When data is a static override, icon is the DATA_OVERRIDE one, and clicking
on the button will make it a fully borring local data-block.
2017-12-18 12:29:08 +01:00
ec6e490bb8 Add override icon to such data-blocks in OUtliner. 2017-12-18 12:02:23 +01:00
4c9f303eba Add macros to check whether an ID is a static override or has a template for it. 2017-12-18 12:01:50 +01:00
98aa51ffa1 blender_icons_update script: run Blender in factory startup.
Can avoid some stupid issues with custom addons etc.
2017-12-18 10:47:02 +01:00
9052db809f Add basic 'override' icon.
This is just the 'linked' icon with top-down arrow instead of left-right
one, if any graphist feels more inspired... ;)

Note that this is 'new inkscape' version of the svg file, hope
everything is alright (it does change all icons whe re-exporting :/ ).
2017-12-18 10:44:20 +01:00
7ab8c90686 Serious cleanup/refactor/fixing of new RNA comparison code.
Code also handling auto-generation of static overrides.

Aside from some naming consistency cleanup, this commit:

* Is the first step addressing the 'operator' issue with static
overrides, by implementing a first version of the 'restore from
reference' behavior.

* Fixes several issues that were discovered on the way in enhanced
RNA comparision code, like the 'zero-length dynamic array' case, or some
infinite looping caused by some non-ID pointers (that for some
mysterious reasons did not show up previously...).

* Factorizes a bit said RNA comparison code (auto-static override
generation and comparison/check were essentially doing the same thing).
2017-12-18 10:13:43 +01:00
994648a674 RNA: add new property falg for pointers (and collection), 'NO_OWNERSHIP'.
This flag means that the pointer does not 'own' the data it references.
This is the case of nearly all ID RNA pointers (NodeTrees will probably
again be some nasty exception here :( ), but also several other cases.

That kind of information is mandatory for complex processing over whole
data-blocks done in RNA, like some static override tasks (advanced
comparison...).
2017-12-18 10:08:22 +01:00
076616898b Fix T53577: Rake sculpt/paint wrong on first step 2017-12-18 14:35:15 +11:00
c2ad5e805a Fix triangles indexbuf of Curve Displists was being discarded incorrectly
They were discarded when shaded surfaces were requested thus bringing glitches to the outline of the selected Displists Objects
2017-12-16 22:22:21 -02:00
3713de163e Fix triangles of the Displists were being drawn in the opposite direction 2017-12-16 21:58:16 -02:00
342a322a93 CMake: bump minimum version to 3.5 2017-12-17 01:04:05 +11:00
45434c75a0 Manipulator: change cursor for navigation axis
Wasn't easy to see
2017-12-16 19:28:39 +11:00
625d72ed48 Manipulator: draw 2d manipulators over view border
Needed so passepartout doesn't cover 2d manipulators.
2017-12-16 19:05:27 +11:00
d855fc4dad App Template: use manipulator flag
So templates can enable manipulators.
Also remove invalid enum set.
2017-12-16 18:36:49 +11:00
468ac90317 Manipulator: view3d navigation buttons
Added for Blender101 template.
Disabled by default, enable as a preference.

Exposes rotate, pan, zoom, persp-ortho & camera toggle.
2017-12-16 04:21:30 +11:00
c2cc42742d Manipulator: support single press button actions
While not the main purpose of manipulators, it's handy to be able
to use operators without modal callbacks sometimes.
2017-12-16 04:08:37 +11:00
68ffb2a267 Merge branch 'master' into blender2.8 2017-12-15 17:55:23 +01:00
50ef25d73f Depsgraph: Cleanup, remove unused function 2017-12-15 17:47:15 +01:00
da570fcbb4 Depsgraph: Cleanup, make naming more understandable 2017-12-15 17:46:30 +01:00
3d72b94196 Depsgraph: Use array instead of set for node factory
Avoids extra time spent on hashing and such.

Old comment is kind of weird, because types we can totally make a sequent
integer values.
2017-12-15 17:43:07 +01:00
4ce38abfcd Depsgraph: Add named constant with number of node types 2017-12-15 17:39:01 +01:00
68a7f5e594 Depsgraph: Don't use negative enum value
Not sure why it sohuld be negative, we shouldn't be using any explicit value
comparison.
2017-12-15 17:38:12 +01:00
Julian Eisel
5cb70a89e1 Fix failing assert when reading workspace list from workspaces.blend 2017-12-15 17:26:23 +01:00
114013de0d Merge branch 'master' into blender2.8 2017-12-15 17:24:28 +01:00
c795309c03 Depsgraph Cleanup, spelling 2017-12-15 17:23:57 +01:00
6609be0520 Depsgraph: Simplify logic around special case for node tree update 2017-12-15 17:23:57 +01:00
1797923f32 Depsgraph: Cleanup, extra whitespace 2017-12-15 17:23:57 +01:00
76a1046478 Depsgraph: Cleanup, use names for particle system tag flags 2017-12-15 17:23:57 +01:00
f88ce5bf27 Depsgraph: Remove special exception logic from ID node tagging
This is something what we should be limiting as much as possible, it is
enough already to have special mapping cases in depsgreaph_depsgraph_tag.
2017-12-15 17:23:57 +01:00
5e28b71457 math utils: Add utilities to scan bit and clear it 2017-12-15 16:54:28 +01:00
de9e5a0926 Math utils: Go away form naive code for highest_order_bit_uint 2017-12-15 16:54:28 +01:00
412de222f8 Math utils: Add bit scan operations 2017-12-15 16:54:28 +01:00
02ec0b53df Math utils: Make it more clear what the functions are returning 2017-12-15 16:54:28 +01:00
2aa0f8a41b Math utils: Cleanup, use _uint suffix for function which operates on uint 2017-12-15 16:54:28 +01:00
Julian Eisel
9515737b55 Fix missing refresh of editors when changing workspace view-layer
Needs to use new messaging system.
2017-12-15 16:09:12 +01:00
2b25d8ea30 Depsgraph: Fix assignment to wrong flags 2017-12-15 14:42:42 +01:00
ff0d3c520f Tracking: Cleanup, fix typo in variable name 2017-12-15 13:53:44 +01:00
6b62f1dcb9 Tracking: Pass all markers to autotrack at once
This solves delay before tracking actually starts.

The issue is reported by Sebastian over IRC, thanks!
2017-12-15 12:51:53 +01:00
4895bd6ace Libmv: Add C-API function to set all markers within AutoTrack structure 2017-12-15 12:51:17 +01:00
e50442418a Tracking: Cleanup, make autotrack context creation code more granular 2017-12-15 12:37:23 +01:00
4cc0f09881 Tracking: Cleanup, use more const qualifiers when appropriate 2017-12-15 12:23:53 +01:00
Dalai Felinto
0b5616aef1 Depsgraph: cleanup DEGOIterObjectData > DEGObjectIterData 2017-12-15 08:59:05 -02:00
Dalai Felinto
90b7917687 Depsgraph: Make DEG_OBJECT_ITER more granular
It is not nice to assume we always want visible or directly linked objects.
So we make it as granular as we can.
2017-12-15 08:59:04 -02:00
Dalai Felinto
3a47fb764c Depsgraph / Render / Collection: Tag groups for rendering
We need to tag groups before and after rendering, so the group collections
viewport and render visibility are taken into account.

Note: This is a workaround, that will be removed once the render engine have
its own depsgraph, instead of re-using the viewport depsgraph.
2017-12-15 08:59:04 -02:00
Dalai Felinto
1f5106de61 Group collection viewport/render options and remove collection visibility
Users can change the group collection visibility in the outliner
when looking at groups.

Regular collections on the other hand don't have any special visibility control,
if you need a collection to be invisible during render, either don't link it
into the view layer used for F12, or disable it.

This includes:
* Updated unittests - update your lib/tests/layers folder.
* Subversion bump - branches be aware of that.

Note:
Although we are using eval_ctx to determine the visibility of a group collection
when rendering, the depsgraph is still using the same depsgraph for the viewport
and the render engine, so at the moment the render visibility is ignored.

Following next is a workaround for this separately to tag the groups before and
after rendering to tackle that.
2017-12-15 08:56:48 -02:00
7402b8ec74 Draw manager: Cleanup, unused variable 2017-12-15 10:54:00 +01:00
f4140f2c81 Merge branch 'master' into blender2.8 2017-12-15 10:45:20 +01:00
Dalai Felinto
2ddee0ba5a Fix dupli-frames (and other duplis)
Even non-group dupli objects need to get the overrides from somewhere.
Getting them from dupli_parent.
2017-12-15 07:14:25 -02:00
c4046e9082 Move ID recalc flags into dedicated field in ID
Currently this is a no-visible-changes change, but the idea is to use this
dedicated flag to tell which exact components of ID changed, make it more
granular than just OBJECT and OBJECT_DATA. Allow setting this field based
on what components new dependency graph flushed on evaluation.
2017-12-15 09:43:18 +01:00
Dalai Felinto
569e29c49c Fix RNA crash for objects without collection properties
This would happen if you tried to access the collection property for an object
that has not being evaluated by the depsgraph.
2017-12-14 20:17:27 -02:00
100e9aa15f Draw Manager: Texture space support for Curve and Metaball objects 2017-12-14 17:53:27 -02:00
c027be3189 Fix broken collada from recent merge rBb83b6afe5572ae29b4ad105dd8001c3343e2205b.
Please make minimal checks on what you do when merging!
2017-12-14 20:25:26 +01:00
aa1054acf8 Draw Manager: Edit Curve Mode: Fix "Not freed memory blocks"
`e_data.overlay_vert_sh` was not being freed when quitting blender.
2017-12-14 15:16:09 -02:00
06def089d3 Draw Manager: Recalculate batch of Curves, Surfaces and Texts when a property is changed 2017-12-14 14:44:20 -02:00
6b794565aa Fix crash with DispLists without vertices
Wee must return VertBuffers even when its size is zero
2017-12-14 14:31:08 -02:00
400d59be9b DNA: Add dedicated recalc flag to ID
Currently unused, but this is where LIB_TAG_ID_RECALC* flags will go.

Also modified other DNA to make pointer property being followed by pointer.
Makes it easier to keep track of alignment and extend nested structures without
ruining anything.
2017-12-14 15:25:51 +01:00
14ac709455 Eevee: Support for objects of type Curve, Surface and Text 2017-12-14 12:22:55 -02:00
5b5de35604 Support for Batchs split by material for objects of type Curve, Surface, and Text
**ToDo:**
- add vertbuff for UV (what can be adapted from `dl_surf_to_renderdata`)
2017-12-14 12:21:38 -02:00
bb9d068ccc Depsgraph: Cleanup, use more explicit way to fill in a structure
The possible issue with just listing arguments is that it might not be clear
what particular value is used for. For example, is it a scene itself, or is
it a parent scene?

Not as if it's not very clear now, but better be explicit for the future,
and me reading code in 10 years.
2017-12-14 11:09:18 +01:00
b83b6afe55 Merge branch 'master' into blender2.8 2017-12-14 12:51:26 +11:00
99b7dc60be Fix missing update for particles w/ fluids
D2955 by @GonVas
2017-12-14 12:06:36 +11:00
1f95347882 Fix T53322: Collada export crash w/ shape keys
D2958 by @cmbasnett
2017-12-14 10:59:41 +11:00
Dalai Felinto
f59728b3ea Object selection: Fixing cases where old selection flag was used
Basically these operators (select grouped object hooks and object select mode/less)
were not working in 2.8.
2017-12-13 16:26:46 -02:00
Dalai Felinto
53ea46d36c Outliner: Fix selection drawing
Outliner was using the old selection flag to show selected objects.
So if you selected an object in the outliner it would keep "selected"
(drawn in yellow) even after you selected another object.
2017-12-13 16:26:46 -02:00
3a3587f4b2 Depsgraph: it is still possible to have non-object to use OB_RECALC_DATA tag
Those flags are to be redone...
2017-12-13 16:39:03 +01:00
09838ed24c Comment out and tag unused bit as unused 2017-12-13 16:34:13 +01:00
33c97351fb Depsgraph: Move data update tag to object->data itself 2017-12-13 16:32:08 +01:00
f97d036468 Depsgraph / Object update: Query data update flag from data itself 2017-12-13 16:27:05 +01:00
ac3d477481 RNA: Query is_updated flag from object data ID's rather than from object itself 2017-12-13 16:27:01 +01:00
84c5ccca74 Masks: Remove unused function
It was used by old dependency graph. New one does things differently.
2017-12-13 16:14:08 +01:00
405becec70 Comment out and tag unused bit as unused 2017-12-13 16:05:20 +01:00
92067f7cda Depsgraph / Du[plication: Remove workaround flag from ID
Animation does no longer tag IDs as updated, so flag is not
needed anymore.
2017-12-13 15:56:18 +01:00
118178d176 Depsgraph / Animation: Rmove direct ID tagging from animation code
New dependency graph is supposed to have relation from animation node to
the node which corresponds to a property which is modified by that curve.
This means it is up to dependency graph to flush recalc flags, and no
manual control is needed in the animation code.
2017-12-13 15:53:04 +01:00
ec3d25803e Merge branch 'master' into blender2.8 2017-12-13 15:07:42 +01:00
a621850224 Fix T53550: E hotkey not working after the color-band picker commit
Related to D2886, the color-band picker was lacking a poll function.
2017-12-13 07:00:16 -07:00
81f135677b Depsgraph: Cleanup, use less explicit checks of LIB_TAG_ID_RECALC_DATA
This is a part of ongoing work in Blender 2.8, where we need to replace

  `object->id.tag & LIB_TAG_ID_RECALC_DATA`

with

  `object->data->id.tag & LIB_TAG_ID_RECALC`

Should be no user measurable difference.
2017-12-13 14:43:32 +01:00
3d6cc77cbd Merge branch 'master' into blender2.8 2017-12-13 14:24:44 +01:00
Danrae Pray
32f85c8322 Fix T51461: Outliner: Problems removing multiple collections in sequence
We now select the LayerCollection at index 0 for the active ViewLayer after a
collection deletion operation.

Added some functions to query outliner tree data & get LayerCollection
by index using a similar approach as we do for SceneCollection indexing.

With warning and style cleanups by Dalai Felinto.

Reviewers: dfelinto

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2942
2017-12-13 10:01:16 -02:00
João Seixas
4838512e7d Fix T53404 - Python API documentation: UI Layout Emboss description wording
Changed the suggested word

Reviewers: #documentation, #python, sergey

Reviewed By: #documentation, sergey

Tags: #documentation, #python

Differential Revision: https://developer.blender.org/D2952
2017-12-13 12:56:38 +01:00
1b371d199e Depsgraph: Ensure dependency graph is allocated for evaluation context
This is something what we would need to ensure anyway, so doesn't seem
to make sense to NOT allocate depsgraph and then worry about this externally.

Steps to reproduce: add cube, change it's size in redo panel.

Found by Campbell during code review session.
2017-12-13 12:55:39 +01:00
ae80835d10 RNA override: Cleanup & small refactor.
Remove unused func from public API.

Make parameters & variables naming more consistent accross the code.

Move RNAproperty validation/'conversion' (for IDProps case) to upper
level in code, this will avoid some useless re-processing.
2017-12-13 12:46:25 +01:00
2ac33b47dc Fix T53547: Metaballs as dupli objects are not updated with the new Depsgraph
Follow relations from old dependency graph.
2017-12-13 10:50:28 +01:00
2c64615438 Fix T53552: Unneeded particle cache reset on frame change
There shouldn't be a time dependency to cache reset operation.
2017-12-13 10:47:59 +01:00
cd845ae509 T53471: Fix crash with blender_icons_update.py
Default DPI of new inkscape caused incorrect image size.
2017-12-13 16:55:51 +11:00
be54868ec3 Fix T53529: Rip crashes w/ wire edge 2017-12-13 16:14:37 +11:00
611752ce33 UI: color-band eyedropper now combines samples
Resulting color-band was too noisy (especially with photos),
use gauss filter to take surrounding samples into account.
2017-12-13 15:38:11 +11:00
52d33d6ab9 Merge branch 'master' into blender2.8 2017-12-12 18:00:36 +01:00
ef8bbc8cba Fix bplayer (c). 2017-12-12 14:23:19 +01:00
56f00db6c9 Correct error in recent merge 2017-12-12 23:19:41 +11:00
99069c8ae2 Revert "Node selection: Stop operator when mouse selection selected a node"
While re-route operator got fixed, node resize became broken.

This reverts commit 43f33ea300.
2017-12-12 10:34:38 +01:00
edd39f6da7 Merge branch 'master' into blender2.8 2017-12-12 16:13:06 +11:00
b3c147a04f Cleanup: split eyedropper into separate files
Each handles separate data-types and didn't share much logic,
better put each in it's own file.
2017-12-12 15:44:59 +11:00
41fc0a0624 Merge branch 'master' into blender2.8 2017-12-12 13:55:09 +11:00
58aa31a9ec Cleanup: minor edits to last commit 2017-12-12 13:37:21 +11:00
f7a1a1a700 UI: rewrite color-ramp re-sampling
Instead of picking evenly spaced pixels color-ramp simplification
now works by removing elements with the lowest cost.
2017-12-12 13:20:56 +11:00
7ae4c3a019 Add eyedropper to color-ramp widget
D2886 by @LazyDodo with edit's by @campbellbarton

The line drawn with the eyedropper is used to fill the color-ramp.
2017-12-12 13:11:38 +11:00
43f33ea300 Node selection: Stop operator when mouse selection selected a node
Previously, hitting Shift-LMB will first invoke selection operator, which
then later on is transformed to mouse tweak used for reroute operator.

This was causing problems extending selection with Shift-LMB when clicking
fast or from a tablet.
2017-12-11 17:38:47 +01:00
Dalai Felinto
1b2ac71f45 Fix workspace ui panel after workspace API change
This was broken since e8c15e0ed1. We can no longer get view_layer
from worspace, we should get it from window instead, now.
2017-12-11 13:18:14 -02:00
7719f7d27a Fix T53528: Empty thumbnails in filebrowser
Bug in recent refactor.
2017-12-11 15:47:52 +01:00
54f7bb4582 Fix for inset when accessed from spacebar search 2017-12-12 01:38:33 +11:00
14655418d1 Add 'Add static override' to outliner's menus. 2017-12-11 12:07:13 +01:00
75fbd60b06 Walk all the overriding chain to try to find a template.
When one creates a new local static override from another linked
data-block already overriding a third one etc., walk the whole
inheritance chain up to the original ancestor to try to find an
overriding template, instead of only checking the immediate reference...
2017-12-11 12:07:13 +01:00
48fe46943e Add a new button in ID template to generate an override, and new icon placeholder.
Note that due to mess with inkscape (see T53516), I cannot generate a new icon
currently. :(

Commit related to T53501.
2017-12-11 12:07:13 +01:00
6475f163ec Manipulator: make grab-cursor a manipulator flag
As with operators, allow manipulators to grab the cursor.
Previously this was enabled for all 3D manipulators.
2017-12-11 21:38:55 +11:00
1218b3fceb Cleanup: whitespace 2017-12-11 19:28:40 +11:00
4737b95b65 Merge branch 'master' into blender2.8 2017-12-11 19:24:37 +11:00
dd4e0cd3e3 DNA/RNA: add 'py_instance' for ID types
Avoid creating new Python instances
every time a scene, object, mesh .. etc are accessed.

Also resolves crashes T28724, T53530
although it's only valid for ID types, not modifiers vertices etc.

Back-ported from blender2.8 branch.
2017-12-11 18:37:54 +11:00
a2f2231014 Fix grab3d manipulator in a 2D group
Was taking scale into account twice.
2017-12-11 17:07:40 +11:00
53394c6018 PyAPI: Correct manipulator template 2017-12-11 16:01:07 +11:00
2e685136c4 WM: update splash size for templates 2017-12-11 12:53:28 +11:00
c568985118 MSVC: Fix compiling with some system languages
Report from @cyaoeu that compiling failed for Japanese system language.
2017-12-10 15:19:50 +11:00
Dalai Felinto
9454359a16 Workspace: Clarifying library remap workaround
WorkSpaceLayout->screen will be made public soon, but meanwhile this makes it
clear why we are not passing layout->screen to CALLBACK_INVOKE in this case.
2017-12-08 13:35:31 -02:00
392c23bdb9 Library remap: Fix issue remapping pointer of object coming from group[s base
We can not store pointer to an object ion temporary variable here, since then
pointer will not be updated in the base itself.

This fixes missing modifiers on objects coming from dupli-group.
2017-12-08 16:07:25 +01:00
34522017de Cleanup, indentation 2017-12-08 16:07:20 +01:00
36e09b5ada Depsgraph: Groups are now covered by dependency graph 2017-12-08 16:07:20 +01:00
7aa022b7a8 Depsgraph: We need to add ID node before getting CoW pointer
Need to split runtime get-cow-pointer with a builder one, and add some asserts
to catch mis-use.
2017-12-08 16:07:20 +01:00
f57317c6e7 Merge branch 'master' into blender2.8 2017-12-08 12:43:52 -02:00
e6838ecc26 Fix T53512: Vertices with index 0 were not being selected
Bug introduced on rB9f5bf197a0c3.
The offset for selection of vertices (`bm_vertoffs`) starts where the offset o edges ends (`bm_wireoffs`).
However, the `bm_wireoffs` depends on the offset of face selection (`bm_solidoffs`).

Before the commit that introduced the bug, the drawn of edges (in backbuff) was always computed along with the `bm_wireoffs`:
```
bm_wireoffs = bm_solidoffs + em->bm->totedge;
```

Now that the edges are not always drawn in backbuff, `bm_wireoffs` has to start from `bm_solidoffs`.
2017-12-08 12:42:00 -02:00
8817faa02d Cleanup, indentation 2017-12-08 15:05:38 +01:00
82c0a54168 Depsgraph: Use dedicated function for group evaluation
It is still based on generic collection evaluation, but the idea is to avoid
having view_layer pointer passed from group to it's evaluation function.

This is essential for copy-on-write, where we need to pass view_layer pointer
from a copied datablock, but that copy is not yet available at construction
time. Also, this is NOT the case where we want to expand datablock at a
construction time, just to keep our life easier.
2017-12-08 15:05:38 +01:00
Dalai Felinto
af47ae0702 Fix group duplication bug
View Layer was not duplicated between destination and source.

This would lead to a crash if you duplicated the group and assigned
the new group to any object.
2017-12-08 12:04:05 -02:00
Dalai Felinto
0d4ab09da7 Code cleanup
Thanks for Sergey Sharybin for spotting this.
2017-12-08 12:04:05 -02:00
6e85c59250 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/interface/interface_templates.c
2017-12-08 14:54:59 +01:00
f39a97fac5 Cleanup: moar busting of nasty C++ keywords-as-varnames. 2017-12-08 14:50:45 +01:00
087997f9eb Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/interface/interface_templates.c
2017-12-08 14:39:17 +01:00
c7ee64b2d9 Cleanup: avoid using C++ keywords as variables, even in pure C code.
This tends to make some IDE unhappy (like QTCreator)...
2017-12-08 14:36:07 +01:00
d46305f741 Merge branch 'master' into blender2.8 2017-12-08 12:44:32 +01:00
2e8914549b Cycles: Fix difference in image Clip extension method between CPU and GPU
Our own implementation was behaving different comparing to OSL and GPU,
namely on the border pixels OSL and CUDA was doing interpolation with
black, but we were clamping coordinate.

This partially fixes issue reported in T53452.

Similar change should also be done for 3D interpolation perhaps, but this
is to be investigated separately.
2017-12-08 12:03:11 +01:00
0467ddc674 Eevee: Fix default shader SSR id. 2017-12-08 11:58:04 +01:00
9aaf75da3d Eevee: Fix SSR ans SSAO for intel GPU.
On my intel GPU there is some issue when rendering to depth only format.
This workaround the issue.
2017-12-08 11:58:04 +01:00
7f48923986 Eevee: Remove unecessary defines. 2017-12-08 11:58:04 +01:00
f31fb4a014 Cycles: Cleanup, split 2D interpolation function 2017-12-08 11:22:04 +01:00
82c779462d Merge branch 'master' into blender2.8 2017-12-08 12:59:51 +11:00
4a734325f7 bl_app_override: support empty UI layout items
Returning None from ui_ignore functions creates empty labels,
allows removing items without breaking layout in some cases.
2017-12-08 12:57:25 +11:00
Dalai Felinto
dc848e9a8b Merge remote-tracking branch 'origin/master' into blender2.8 2017-12-07 15:00:03 -02:00
Dalai Felinto
237df2f860 Fix Collada building
Bug introduced in cc811d1fd6.
2017-12-07 11:51:46 -02:00
00067afa10 Fix T53419: Masking "Add" menu is not present in Image editor, but shortcut is 2017-12-07 14:46:07 +01:00
70957565dd DPX/Cineon: Report orientation when running with --debug 2017-12-07 14:38:20 +01:00
1c0905be0f Merge branch 'master' into blender2.8 2017-12-08 00:21:54 +11:00
efdd8f12a0 CMake: GREATER_EQUAL is from v3.7, use GREATER 2017-12-08 00:20:48 +11:00
bfbcc5e581 Fix T53499: Cannot load DPX files
The issue was caused by unspecified color transfer. New behavior gives same
result as other viewers here, so likely is fine :)
2017-12-07 14:07:57 +01:00
9ea7d0bf44 DPX: Fix wrong flag being checked for debug 2017-12-07 14:04:27 +01:00
1c7cfa025c Merge branch 'master' into blender2.8 2017-12-07 23:53:03 +11:00
2e2e6e3bdb Cleanup: Use BKE_colorband prefix 2017-12-07 15:52:59 +11:00
cc811d1fd6 Cleanup: extract BKE_colorband from BKE_texture 2017-12-07 15:40:11 +11:00
6d31eb015c Array Modifier: option to offset UV's
D2912 by @Zuorion
2017-12-07 04:33:52 +11:00
Daniel Silva
2dfd795bd2 Proposed fix for T53263 -- Blender crashes when rendering with Stabilizer 2D node without movie selected
The program won't crash anymore, but a warning won't be displayed. Anyway, this gives the user the chance to save the project.

https://developer.blender.org/T53263

Reviewers: lukastoenne

Differential Revision: https://developer.blender.org/D2934
2017-12-06 14:54:51 +01:00
46f518e927 Merge branch 'master' into blender2.8 2017-12-06 14:06:49 +01:00
13e9291650 Library: Add flag top keep ID library pointer around
This only applies to ID being copied outside of bmain. Handy for cases when it
is important to check if the copy corresponds to a data block coming from
library.

Example of that is proxy evaluation with copy on write.

Thanks Bastien for review!
2017-12-06 13:00:08 +01:00
6c49b4154b Merge branch 'master' into blender2.8 2017-12-06 12:27:44 +01:00
3ae6a8512d Depsgraph: Cleanup, use less geenric data type 2017-12-06 12:26:10 +01:00
7e344a9531 Depsgraph: Proxy pose bones should be coming from CoW object
This should solve crash on files having proxies, but there will still be
assert failure because proxy_from is expected to come from library, which
is no longer truth for objects which got copied.
2017-12-06 12:13:10 +01:00
8cd4de7c25 Merge branch 'master' into blender2.8 2017-12-06 11:58:13 +01:00
b5be65dc0e Depsgraph: Forgot this in previous commit 2017-12-06 11:57:57 +01:00
e9bbc10578 Merge branch 'master' into blender2.8 2017-12-06 11:55:30 +01:00
5ad3cc4e03 Depsgraph: Ignore text datablocks from nodes
Those are not part of dependency graph, but still could be referenced from
the tree.
2017-12-06 11:54:52 +01:00
674e1d4194 Depsgraph: Owner ID must always be original ID
Missed that in the review.
2017-12-06 11:38:58 +01:00
5389ca1859 Merge branch 'master' into blender2.8 2017-12-06 10:38:34 +01:00
16b9e91bf1 Eevee: Fix sampling direction calculation.
It was causing problems with the visibility filtering on Intel GPU.
2017-12-06 10:47:44 +01:00
1027ddfa2d Depsgraph: Add missing bone properties to proxy rigs 2017-12-06 10:21:33 +01:00
99b9e23ce1 Depsgraph: Add missing NULL pointer check 2017-12-06 10:21:33 +01:00
4c5736a77f Depsgraph: Cleanup, remove unused function 2017-12-06 10:21:33 +01:00
1915c30a42 Depsgraph: Remove workaround of parameters animation in node tree 2017-12-06 10:21:33 +01:00
630ed82ff2 Depsgraph: Remove workaround of parameters animation in lamp 2017-12-06 10:21:33 +01:00
8acca0e9e1 Depsgraph: Remove workaround of parameters animation in camera
This is something what should be done by build_animation().
2017-12-06 10:21:33 +01:00
21ef8e7d29 Depsgraph: Remove workaround for animated geometry component 2017-12-06 10:21:33 +01:00
b552e03716 Depsgraph: Remove workaround for animated modifiers 2017-12-06 10:21:33 +01:00
f348b7924c Depsgraph: Leave armature animation relation to build_animation()
Needs some optimization trick to hook pose init function to animation
instead of a bone. This is how flush will work anyway.
2017-12-06 10:21:33 +01:00
cbb42fcd96 Depsgraph: Use default argument value for relations builder
Follows other function definitions.
2017-12-06 10:21:33 +01:00
18ca793ca0 Depsgraph: Cleanup, line wrapping 2017-12-06 10:21:33 +01:00
abc55bf84a Depsgraph: Use build_animation() to build relations to animated properties
Before that it was up to lots of other places to keep track on whether
something is to be dependent on time or not. Was annoying, and unreliable,
and fragile.

This commit avoids hacks in object builder. Other areas will be adopted
soon.
2017-12-06 10:21:33 +01:00
4a99cc5850 Depsgraph: Add ability to check whether relation exists before adding it
Currently not used, but this is aimed to be used when adding relations from
FCurve to property which is being animated.
2017-12-06 10:21:33 +01:00
8b3aa8ef45 Depsgraph: Cleanup, line wrapping 2017-12-06 10:21:33 +01:00
7de3c8ace7 Depsgraph: Move implementation part of relations header to own file 2017-12-06 10:21:33 +01:00
335343fe93 Fix T53408: Updating Cycles Nodes via Drivers in Material View
This is something what should be supported by the new dependency graph.

Fixed by making it so, build_animation() adds relation between Animation
component and whatever-is-being-animated. In fact, for now, only relations to
ID properties are added. Rest of the relations are kind of hacked in all over
the code and needs to be removed and verified with specific .blend files.
2017-12-06 10:21:33 +01:00
f1ad6b43b3 Depsgraph: Cleanup, split build_animation 2017-12-06 10:21:33 +01:00
9f9b666d9a Depsgraph: Correct fallback for the parameters calculation
We can't use a single component here, sine it might consist of multiple
operations. So, for example, having driver operation will confuse targets
of another driver.
2017-12-06 10:21:33 +01:00
b5a8d0acaf Depsgraph: Cleanup, split driver builder function 2017-12-06 10:21:33 +01:00
3e9cd53687 Depsgraph: Cleanup, deduplicate as much as possible in build_driver 2017-12-06 10:21:33 +01:00
8c4363e3b1 Depsgraph: Remove old comments which are likely outdated 2017-12-06 10:21:33 +01:00
8912e4faef Depsgraph: Replace last obvious part of driver builder with generic RNA code 2017-12-06 10:21:33 +01:00
b26992fe6e Depsgraph: Add criteria for RNA_Key 2017-12-06 10:21:33 +01:00
fe5e8593b7 Depsgraph: Remove confusing ID node criteria
it sometimes overrides all possible other criteria, even tho we might want to
be very specific about what component we are looking for here.
2017-12-06 10:21:33 +01:00
35364e2fb2 Depsgraph: Use generic function for shape key driver target
There was a second place for shape keys.
2017-12-06 10:21:33 +01:00
070c735b13 Depsgraph: Fix wrong relations built for drivers
When target was changed from bone to regular object, new dependency graph was
still trying to build relations as if driver was using bone.
2017-12-06 10:21:33 +01:00
f8fd8b0744 Depsgraph: Use generic function for shape key driver target 2017-12-06 10:21:33 +01:00
235a68d8f3 Depsgraph: Use generic function for modifiers driver target 2017-12-06 10:21:32 +01:00
7586266343 Depsgraph: Use existing utility function to get driver target node
Only done for pose bone for now, but the idea is to go case bu case in
build_driver and move all custom logic from there to find_node_from_pointer().
2017-12-06 10:21:32 +01:00
3795e37c62 Depsgraph: Cleanup, split build_driver function up 2017-12-06 10:21:32 +01:00
52e81de9f7 Depsgraph: Don't see reason to have special case for bone's RNA path 2017-12-06 10:21:32 +01:00
97e92d6f3e Depsgraph: SImplify chjecks in directly address bone 2017-12-06 10:21:32 +01:00
284f106c91 Depsgraph: begin use of RNAPathKey instead of re-implemented checks in driver variables 2017-12-06 10:21:32 +01:00
0cd2303e67 Depsgraph: Cleanup, don't use static qualifier inside of anonymous namespace 2017-12-06 10:21:32 +01:00
aed1320b24 Add utility function to compare PointerRNA with NULL
Thanks Campbell for review!
2017-12-06 10:21:32 +01:00
a68e10be5e Depsgraph: Correct RNA pointer criteria to deal with bone custom properties 2017-12-06 10:21:32 +01:00
7ca8af4cc8 Merge branch 'master' into blender2.8 2017-12-06 16:51:37 +11:00
e6404274a1 Fix T53441: Inset doesn't start at zero 2017-12-06 16:45:51 +11:00
9ab430e9cb Cleanup: line length 2017-12-06 16:42:34 +11:00
2480a190de CMake: remove git found message 2017-12-06 16:37:50 +11:00
2069102c56 Cycles: Fix constness for load_kernels in device_cpu.cpp 2017-12-06 00:00:18 +01:00
858b38f12c Merge branch 'master' into blender2.8 2017-12-05 22:38:13 +01:00
ee120d6293 Fix T53476: File Browser: Selection Issue with 'fill' option.
Fill-selection would only go upward in list of items to find an already
selected one and fill-select all items in-between. Now, in case upward
search fails, it will also intent to go downward, effectiviely allowing
to 'fill-select' from bottom to top.

Note that top-to-bottom keeps priority (i.e. if a top-to-bottom
fill-selection is possible, it will always happen, even if a
bottom-to-top one is also possible).
2017-12-05 22:34:49 +01:00
272973804e Merge branch 'master' into blender2.8 2017-12-05 19:04:34 +01:00
855799ecc1 Fix T53430: Cut at the strip end fails w/ endstill 2017-12-06 04:52:38 +11:00
a580565086 CMake: avoid checking each MSVC minor revision 2017-12-06 03:38:44 +11:00
a65695759c Fix MSVS2017 compiler version
After last update to Visual Studio 2017 15.5.0 the compiler version changed
2017-12-05 17:16:02 +01:00
3959ce0540 Types are to have explicit forward declaration 2017-12-05 16:54:39 +01:00
702c0a01b2 Cleanup: build warning 2017-12-06 02:25:10 +11:00
6734bb1faf Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/mesh/editmesh_select.c
2017-12-05 11:19:47 -02:00
70c2d8a1a2 Fix T53469: Make sure that edges are drawn in the backbuff whenever you are looking for the nearest edge
Caused by rB9f5bf19
2017-12-05 11:13:53 -02:00
4f2dd5ad26 Fix for typo in previous commit 2017-12-06 01:14:20 +13:00
52dde11796 Simplify UI-names for B-Bone Ease In/Out settings
For more consistency with the other settings, and increased readability
when the UI is cramped (and it isn't possible to see the whole names).
2017-12-06 00:58:10 +13:00
5d96bc9c5a Version patching fixes for F-Curves (as required for fixes for T48988 and T52009)
* For the T48988 fix (i.e. separate Ease In/Out properties for Bendy Bones
  in Edit vs Pose modes), old animation data needed to be patched to use
  the new property names. This is needed to partially fix some of the
  issues in T53356 (though the Rigify code itself still needs to be patched).

* For the T52009 fix, old files needed to have the frame_start and frame_end
  properties on the FModifier (base-class) updated to match that of the
  FMod_Stepped type-specific class. This wasn't done in the earlier commit
  since it wasn't worth going through all animation data just for the sake
  of updating these relatively-rare settings, but since we're doing it anyway
  now, it makes sense to include this here.
2017-12-06 00:54:39 +13:00
deaeee8e4d Merge branch 'master' into blender2.8 2017-12-05 11:48:37 +01:00
6ebf244ace Added BKE_fcurves_main_cb(), a wrapper around BKE_animdata_main_cb to make it easier to apply fixes to all F-Curves in a file 2017-12-05 17:16:05 +13:00
41b4b8ded6 Cleanup/Style Tweaks to fit rest of code 2017-12-05 17:14:55 +13:00
7d50f16869 drawobject: use float instead of int in glLineWidth 2017-12-04 16:00:21 -02:00
1802d14394 Fix T53463: Rotation numerical input shows instable behaviour.
Inverting a number in radians when user is in degrees gives rather
unexpected results. ;)
2017-12-04 18:40:33 +01:00
3d473d1632 Edit Mesh Selection: Make sure that the line width is 1 pixel 2017-12-04 15:30:56 -02:00
f340f4a2f4 Eevee: CodeStyle: Separate Shader initialization. 2017-12-04 17:21:37 +01:00
5bd008f4dd Eevee: Irradiance Grid: Allocate needed resources instead of a static chunck.
This commit makes the irradiance pool and render target sizes depend on the number of irradiance sample in the whole ViewLayer.
2017-12-04 17:21:37 +01:00
c370fffc9b Resolve MSVC C2229
Code works as expected, but MSVC disallows
2017-12-05 03:05:15 +11:00
40822ae4e9 Depsgraph: Cleanup, indentation 2017-12-04 15:50:38 +01:00
bdc15061fc Better bevel profile at extreme values of profile.
Patch from Richard Erhardt, with some additions & modifications.
Changes bevel profile shape parameter so that can get arbitrarily
near square profile as parameter -> 1.
Adds code to make profile=0 case work, at least for cube corners,
so changed hard min of profile parameter to 0 from 0.15.
2017-12-04 09:36:14 -05:00
d37d6b5a4d Edit Mesh Selection: Fix wrong glPointSize position 2017-12-04 12:32:45 -02:00
3533e082a0 RNA: Use const qualifier for an utility function 2017-12-04 15:26:43 +01:00
aee3560cce Followup to previous merge conflict resolution 2017-12-04 15:26:17 +01:00
bd062f36c0 WM: disable property update messages for fcurves 2017-12-05 01:31:12 +11:00
3b3e612752 Merge branch 'master' into blender2.8 2017-12-04 15:15:23 +01:00
0f8228a890 Depsgraph: Add parameters nodes for bone custom properties
Currently shouldn't make any difference, but this is something what needs to be
done to sanitize drivers relations )with the idea to re-use some generic code
to get operations for driver variables.
2017-12-04 15:10:14 +01:00
9f5bf197a0 Edit Mesh Selection: Draw the backbuff of edge selection only when requested
And make sure the width is 1
2017-12-04 12:05:06 -02:00
d974d25497 Depsgraph: Cleanup, move RNA key constructor to it's file 2017-12-04 14:17:17 +01:00
d5e491c9a7 Depsgraph: Cleanup, don't use bracers in relations names
Those don't bring any information.
2017-12-04 14:17:17 +01:00
5f86d6e6eb Depsgraph: Cleanup, node from RNA pointer search 2017-12-04 14:17:17 +01:00
6b72d87def Depsgraph: Remove unused property based update tags
Those are unused, and not clear whether we will ever support this.

Seems to be better having more like "component" tags, would be less magic
involved to guess what exactly is to be tagged.
2017-12-04 14:17:17 +01:00
6a6aeaac7d Fix bplayer (c). 2017-12-04 14:14:42 +01:00
47fa3e7b27 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/BLO_readfile.h
	source/blender/blenloader/intern/readfile.c
	source/blender/windowmanager/intern/wm_files_link.c
2017-12-04 14:07:39 +01:00
0868a2b610 Cleanup: link/append: get rid of booleans in func parameters.
One or two are OK, but more make it rather unreadable, and future work
is likely to require more toggle specific behavior here. So switched to
bitflags, switching from short to int and using 16 upper bits for
'internal' ones defined in BLO_readfile.h, combined with 'public' ones
from user interaction, defined in DNA_space_types.h
2017-12-04 13:09:13 +01:00
Danrae Pray
a1df65c9dd Small cleanup from previous commit by Danrae Pray (@spockTheGray)
I (Dalai) messed up the git author from previous commit (68fdcf07a1).
So this is a follow up on that, properly credited.
2017-12-04 07:53:27 -02:00
Dalai Felinto
68fdcf07a1 Fix T53415: Outliner: Crash when deleting collections
Updated collection_delete_exec() so we don't try to delete elements as we search
the outliner tree anymore.

Now we search the whole tree first for the selected nodes that need to be
deleted and delete them afterward.

Reviewers: dfelinto

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2936
Differential Revision: https://developer.blender.org/D2940
2017-12-04 07:40:23 -02:00
7a8ac1b09b WM: message bus replacement for property notifiers
Use dynamically generated message publish/subscribe
so buttons and manipulators update properly.

This resolves common glitches where manipulators weren't updating
as well as the UI when add-ons exposed properties which
hard coded listeners weren't checking for.

Python can also publish/scribe changes via `bpy.msgbus`.

See D2917
2017-12-04 20:42:34 +11:00
5b6cfa705c Eevee: Irradiance Visibility: Initial Implementation
This augment the existing irradiance grid with a new visibility precomputation.
We store a small shadowmap for each grid sample so that light does not leak through walls and such.

The visibility parameter are similar to the one used by the Variance Shadow Map for point lights.

Technical details:

We store the visibility in the same texture (array) as the irradiance itself (in order to reduce the number of sampler).
But the irradiance and the visibility are not the same data so we must encode them in order to use the same texture format.
We use RGBA8 normalized texture and encode irradiance as RGBE (shared exponent).
Using RGBE encoding instead of R11_G11_B10 may lead to some lighting changes, but quality seems to be nearly the same in my test cases.
Using full RGBA16/32F maybe a future option but that will require much more memory and reduce the perf significantly.

Visibility moments (VSM) are encoded as 16bits fixed point precision using a special range. This seems to retain enough precision for the needs.
Also interpolation does not seems to be big problem (even though it's incorrect).
2017-12-04 10:10:27 +01:00
847f568bf5 Eevee: Irradiance Visibility: Add RNA / Engine properties 2017-12-04 10:10:27 +01:00
d439e87064 Eevee: Irradiance Grid: Fix problem with bounce update.
Before this patch, if one of the grid was updated (moved) only the subsequents evaluated grids had their level reset and had all their bounces recomputed.
2017-12-04 10:10:27 +01:00
eb605c2c2b Eevee: Irradiance Grid: Fix Multibounce baking.
The baking was only recording one bounce because the double buffer setup was buggy.
2017-12-04 10:10:27 +01:00
9dfbd98339 Cleanup: whitespace 2017-12-04 17:20:26 +11:00
1b2f8b2754 Merge branch 'master' into blender2.8 2017-12-04 16:51:07 +11:00
5c27523808 Cleanup: wrap long function args in seqeffects 2017-12-04 16:49:30 +11:00
d47d263b4b Cleanup: style 2017-12-04 16:37:31 +11:00
705d214349 Fix crash w/ template search & invalid property 2017-12-04 16:19:01 +11:00
09cade6ca4 Fix MSVC compilation, there is no 'Designated initializers' in C++!
Looks like gcc is at the very least missing a warning here!
2017-12-02 18:25:09 +01:00
e1eb1fbfca BLI_ghash: Description of GHash, GSet
Also some re-indenting.
2017-12-03 03:35:45 +11:00
9f12eb087f Cleanup: minor change to API use 2017-12-02 22:42:14 +11:00
c2d795ebf8 Cleanup: indentation 2017-12-02 22:35:09 +11:00
d64d8b5be5 Fix Cycles standalone crash when saving output, after recent refactoring. 2017-12-02 05:45:09 +01:00
0c37824bfa Draw Maganer: Cleanup: Remove unnecessary lines of code in draw_cache_impl_metaball.c 2017-12-01 18:25:46 -02:00
Dalai Felinto
aa0c9867b2 unittests: Update (fix) unittests after workspace API change
Tests were broken since e8c15e0ed1.

We now get view_layer from window, not workspace, since the same workspace can
have a different view_layer depending on the window scene.
2017-12-01 16:08:52 -02:00
Dalai Felinto
e9cf3fae8e Fixup for workspace view_layer fix
We do not assume subversion bump until we actually change the subversion.

For example, a branch may have bumped its subversion to 3, yet still require
the new doversion code introduced on 108c4bd502.
2017-12-01 15:28:29 -02:00
Julian Eisel
108c4bd502 Fix crash reading 2.8 files with workspace.view_layer set
Stupid error from e8c15e0ed1.

Also removed WorkSpace.view_layer usage and marked as deprecated.
2017-12-01 18:14:24 +01:00
d10578df46 Depsgraph: Call editors update after everything was flushed
This way we can inform editors about all edits at once. Currently this is not
used, but in the next commits we will inform editors about what exactly has
changed.
2017-12-01 17:59:47 +01:00
bbb86a85fc Cleanup: Proper silencing of unused vars( for now). 2017-12-01 17:58:15 +01:00
3d50722cf5 Fix warnings in release builds. 2017-12-01 17:42:13 +01:00
a5454e8711 Cleanup: forgot to rename RNA prop flag to override_static... 2017-12-01 17:42:13 +01:00
6365ddcab5 Depsgraph: Separate loop for ID node flags clear
This ends up in less number of memory writes, which should have positive effect
on performance.
2017-12-01 17:32:00 +01:00
Dalai Felinto
59e8b72881 Fix update of non-scene owned layer collections
We are using NC_SCENE | ND_LAYER_CONTENT for the shader, however this does not work for groups
unless we manually handle the notifiers.

Otherwise the group id is passed, and the listener never gets the notification since a scene id
is expected, or no id at all.
2017-12-01 14:15:54 -02:00
Dalai Felinto
f91e057786 Groups and collection: editing group collections
Allow users to edit either the object group active collection or view layer one

We can't support users selecting the group collections from the outliner group
because that would be imply having an active group for the scene or workspace.

But the way it is now allows to see and edit the collection values after the
group is instanced.
2017-12-01 14:15:54 -02:00
Dalai Felinto
aeaf87bbeb Groups and collection: create group from collection
You could still create groups as before, with Ctl + G. This will create a group
with a single visible collection.

However you can also create a group from an existing collection. Just go to
the menu you get in the outliner when clicking in a collection and pick
"Create Group".

Remember to instance the group afterwards, or link it into a new scene or file.

The group and the collection are not kept in sync afterwards. You need to manually
edit the group for further changes.
2017-12-01 14:15:54 -02:00
Dalai Felinto
be9e469ead Groups and collection: initial integration
Since we are ditching layers from Blender (2.8) we need a replacement to
control groups visibility. This commit introduces collections as the building
blocks for groups, allowing users to control visibility as well as overrides
for groups.

Features
========

* Groups now have collections
    This way you can change the visibility of a collection inside a group, and add
    overrides which are part of the group and are prioritized over other overrides.

* Outliner
    Groups can inspect their collections, change visibility, and add/remove members.

    To change an override of a group collection, you need to select an instance of
    the group, and then you can choose "group" in the collection properties editor
    to edit this group active collection instead of the view layer one.

* Dupli groups overrides
    We can now have multiple instances of the same group with an original "override"
    and different overrides depending on the collection the instanced object is part
    of.

Technical
=========

* Layers
    We use the same api for groups and scene as much as possible.

Reviewers: sergey (depsgraph), mont29 (read/write and user count)
Differential Revision: https://developer.blender.org/D2892
2017-12-01 14:15:54 -02:00
Julian Eisel
e8c15e0ed1 Workspaces: Store an active view-layer per scene
Instead of storing a single active view-layer in the workspace, one is
stored for each scene the workspace showed before.
With this, some things become possible:
* Multiple windows in the same workspace but showing different scenes.
* Toggling back and forth scene keeps same active view-layer for each scene.
* Activating workspace which didn't show current scene before, the current view-layer is kept.

A necessary evil for this is that accessing view-layer and object mode
from .py can't be done via workspace directly anymore. It has to be done
through the window, so RNA can use the correct scene.
So instead of `workspace.view_layer`, it's `window.view_layer` now (same
with mode) even though it's still workspace data.

Fixes T53432.
2017-12-01 16:15:30 +01:00
983b1a3478 Depsgraph: Cleanup, simplify evaluation flush function
Also avoid once queue push for cases when current operation has multiple
outgoing relations.
2017-12-01 16:05:17 +01:00
Dalai Felinto
a9101b332e Silence warning from object_relations.c 2017-12-01 12:39:55 -02:00
92ff0d562c Depsgraph: Remove legacy recalc flag from DNA 2017-12-01 12:26:32 +01:00
3b706723ac Depsgraph: Remove clear of legacy unused flag 2017-12-01 12:18:19 +01:00
a96e97a83f Depsgraph: Move away from setting old deprecated object recalc flags
Those shouldn't be used anywhere for real now.
2017-12-01 12:17:23 +01:00
9bbffd4e02 Depsgraph: Don't use legacy flags in versioning code
Wondering whether files from 2.37 are still working fine.
Don't have that version of Blender running here, so can't test :(
2017-12-01 12:16:29 +01:00
b2952023b6 Depsgraph: Use per-ID flags to see whether update is needed
This is actually functions which needs bigger reconsideration, but for now let's
try to keep them working as much as possible.
2017-12-01 12:11:38 +01:00
146f2e1d02 Depsgraph: Use new per-ID tags to see whether object in a group needs an update
This wouldn't be less precise than object level flag in theory, and we need to
move away from such a duplicating flags.
2017-12-01 12:09:26 +01:00
ecbdc3f1d4 Transform: Avoid attempt to bypass dependency graph update
It's not possible to bypass new depsgraph, but also flush to other CoW copies
might be needed here.
2017-12-01 12:07:41 +01:00
2ae709d282 Transform: Use new DEG query API to see what's being affected by a changing object
This avoids us from directly calling object update, and doing other type of
update flushing.

Prepares us to get rid of Object->recalc flags.
2017-12-01 11:40:50 +01:00
0591fb17e9 Depsgraph: Add query API to traverse all dependent IDs of the given ID 2017-12-01 11:40:50 +01:00
7270e8cc8f Depsgraph: Move iterator to own implementation file 2017-12-01 11:40:50 +01:00
59d3a17e3a Depsgraph: Cleanup, use enum value rather than a define 2017-12-01 11:40:50 +01:00
27a1bd445b Depsgraph: Cleanup, naming
It makes more sense to stick to DEG_iterator_object order in name, since we can
have functions to iterate over different entities and we want all of them to
have common prefix.
2017-12-01 11:40:50 +01:00
2838a7646b _gawain python module: Add methods "program_use_begin" and "program_use_end"
Required to updade uniforms
2017-12-01 04:25:47 -02:00
605ce90c54 RNA: Fix unreported: Some callbacks called when updating properties were incorrect 2017-11-30 16:53:15 -02:00
1d33843ea6 Removing OMP: legacy ccgsubsurf.
Performances gain is rather low this time, about 5% on average (in whole
affected functions).
2017-11-30 19:48:23 +01:00
Dalai Felinto
58c743f7cc Depsgraph: Add assert to make sure the view layer is part of the scene
Which is not in some cases since workspace is still partly implemented.
2017-11-30 13:44:34 -02:00
f3de312b83 Transform: Fix recent merge conflict resolution fiasco
Why is it called legacy when this is a legit flags which are still to be checked
at a runtime???
2017-11-30 16:36:24 +01:00
a989913dd4 Merge branch 'master' into blender2.8 2017-11-30 15:11:06 +01:00
c241d79dc8 Transform: Use single flag with more meaningful name to prevent snapping to a dependent object
The idea of this flag was to prevent snapping onto an object which depends on
currently modifying ones. Using single flag makes more sense here, and also
makes it possible to replace some ob->recalc based magic with depsgraph query
to set those flags.
2017-11-30 15:03:48 +01:00
47a4a7c8b7 Transform: Remove some legacy code about snapping in particle edit mode
It looks stupid to first force some flag being set and then have workaround
to ignore that flag in snapping code. Let's just not set the flag in the first
place.

The only useful situation where such snapping was usable is to move roots of
disconnected hair, which still works just fine. However, there might be some
other hidden corner case where this workaround was needed.
2017-11-30 14:52:34 +01:00
Dalai Felinto
79bbbf7e20 Fix memory leak when single_obdata_users() fails to copy datablock 2017-11-30 11:08:48 -02:00
Dalai Felinto
ba17d53e59 Fix lightprobe single user not working 2017-11-30 11:08:48 -02:00
edef559808 Depsgraph: Fix crash on playback of animated objects when CoW is enabled
We should keep base_flags after CoW object datablock was updated. Not entirely
happy with current solution, but it fixes crash and allows us to run tests
again.

More proper solution would be to make CoW operation a per-component thingie,
which will only update corresponding parts.
2017-11-30 13:42:56 +01:00
Dalai Felinto
33d2535189 Layer: Copy layer collection properties when doing a full copy of scene 2017-11-30 10:08:26 -02:00
69a7ece389 Depsgraph: Fix wrong remapping of compositor node tree when CoW is enabled 2017-11-30 12:36:37 +01:00
c601ef7d7d Depsgraph: Fix missing objects in viewport when CoW is enabled
Remapping of pointers did not work properly, since it had no pointers yet to
remap base->object to a CoW object.
2017-11-30 12:36:37 +01:00
1c5c3748b5 Depsgraph: Make sure we pass proper base to object builder 2017-11-30 12:36:37 +01:00
60d6cc8fae Depsgraph: Make a note about why is it OK to pass original base in relations builder 2017-11-30 12:36:37 +01:00
83cc73083f Depsgraph: Properly pass flags when COW is not used 2017-11-30 12:36:37 +01:00
d0ed6dff82 Depsgraph: Cleanup spelling 2017-11-30 12:36:37 +01:00
Dalai Felinto
2296b9776a Depsgraph: Tag all id_types on_visible_update
We need all id nodes to be evaluated at least once when opening a file.
This is particuarly required for the upcoming group collection patch.
2017-11-30 09:23:10 -02:00
ced2f3f30e Merge branch 'master' into blender2.8 2017-11-30 11:59:28 +01:00
059b878240 Depsgraph: More full explanation for previous commit 2017-11-30 11:57:21 +01:00
Dalai Felinto
4b9b9dbf93 Depsgraph: Fix DEG_id_type_tag comment 2017-11-30 08:53:11 -02:00
03a5eccc94 Merge branch 'master' into blender2.8 2017-11-30 18:30:41 +11:00
28d2148b09 Haiku OS Support
D2860 by @miqlas

Even though Haiku is a niche OS, only minor changes are needed.
2017-11-30 18:05:21 +11:00
fa3d50af95 Cycles: Improve denoising speed on GPUs with small tile sizes
Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.

Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.

The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.

To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.
2017-11-30 07:37:08 +01:00
df7b9fa2ee Fix T53410: 3D Text always recalculated 2017-11-30 17:08:37 +11:00
099a99dbc9 Select similar for bones by group index
D2931 by @col-one
2017-11-30 14:42:18 +11:00
9f1048481c Fix T53420: Vertex Groups: The "-" button gets a hidden function
Guess 'remove all unlocked' is new-ish feature...

To be backported to 2.79a (I think).
2017-11-29 20:19:07 +01:00
José Luis Oliveira Cunha
5ec8a9ac27 Fix T53116: default texture coordinates for volume materials are blank.
Differential Revision: https://developer.blender.org/D2935
2017-11-29 19:21:51 +01:00
84d39ab97b Merge branch 'master' into blender2.8 2017-11-29 18:13:06 +01:00
e4b54f44c1 Cycles: add object level holdout property.
This works the same as the holdout shader and Z mask layer. Combined with
overrides in 2.8 this is intended to replace the Z mask layer bits.
2017-11-29 18:11:40 +01:00
Maxym Dmytrychenko
7e349f2745 Cycles: improve triangle intersection performance.
Reduces render time by about 1-2% in benchmark scenes.

Differential Revision: https://developer.blender.org/D2911
2017-11-29 18:11:40 +01:00
Maikon Araujo
4b4702ab8a Sequencer: add many more color blend modes, and a new color mix strip.
Differential Revision: https://developer.blender.org/D2872
2017-11-29 18:11:36 +01:00
4f7280da40 Fix paint float color blending bugs with alpha 1.0 and vivid light.
For some blend modes there would be no effect with factor 1.0, even if factor
0.999 would give a very different image. Now the result should have no
discontinuity.

Differential Revision: https://developer.blender.org/D2925
2017-11-29 18:01:36 +01:00
baaf81e13e Merge branch 'master' into blender2.8 2017-11-29 17:59:04 +01:00
5b5939c6e6 Depsgraph: Cleanup, use explicit NULL pointer checks 2017-11-29 17:55:28 +01:00
75eb219a2e ID static override: add basic support for overriding animation.
This is very bold right now - you simply can replace (or add) an action
to an override data-block. Actions themselves are not 'customizable'
through override at all currently (we may at least add
'add/remove/replace fcurves' feature in future), and nothing else in
animdata is overridable currently.
2017-11-29 17:23:25 +01:00
20ae4f928c Make basic object & bones transformations overridable.
You can now override loc/rot/scale of objects and posebones.

Also added a basic operator to make an override of active linked object,
but this is very limited/wip/testing feature (you have to manually override
object and its armature, and relink to proper local overrides
yourself...). Final 'make proxy killer' will be much more automated of
course.
2017-11-29 17:23:25 +01:00
bde39e5110 ID static override: Make most Image properties overridable.
First real 'usable' commit, will be needed by the 'virtual data-block'
asset feature (i.e. to be able to link a mere image file as if it was a
linked datablock, and generate automatically an override of it to make
it editable).
2017-11-29 17:23:25 +01:00
c1401a0d49 ID static override: automatically detect new overrides as part of undo step.
We could do that in several different way, e.g. adding some tag during
DEG evaluation, etc. But this is not a critical process (it's main
purpose is user feedback), so current solution seems to work well enough
- and it's dead simple! ;)
2017-11-29 17:23:25 +01:00
0007873645 ID Static Override: add basic generic UI tools to control override of properties. 2017-11-29 17:23:25 +01:00
e36b5f004d ID Static Override: add basic UI feedback.
For now, using a new color for overridden properties (similar to
animated/driven status), UI team will need to work on a better solution
maybe...
2017-11-29 17:23:25 +01:00
638afb9bd4 ID Static Override, part II: RNA changes.
This is essentially a huge refactor/extension of our existing RNA
compare & copy code, since static override needs more advanced handling here.

Note that not all new features are implemented yet, advanced things like
collections insertion/deletion are still TODO (medium priority).

This completes the ground work for overrides, remaining commits will be
about UI and some basic/testing activation of overrides for a limited
set of data-blocks & properties.

For details see https://developer.blender.org/D2417
2017-11-29 17:23:25 +01:00
6d003ef812 Define RNA_STACK_ARRAY (usable everywhere in RNA), and make PYRNA_STACK_ARRAY use it. 2017-11-29 17:23:25 +01:00
39b8a33068 Merge ID static override, part I: core changes in DNA, BKE and .blend read/write.
See https://developer.blender.org/D2417 for details.

Note that since static overrides rely heavily on RNA, this commit is
essentially invisible from user PoV, more in next commits.
2017-11-29 17:23:25 +01:00
a36a47fe15 Preparing merge of id_override_static: add BKE_id_swap().
This function swaps the memory content of two data-blocks (of same type
obviously), while preserving most of the ID 'header' itself.

It is intended to be used to quickly and easily replace the data of an
existing ID by another one, presumably a temporary 'working' one,
without having to suffer from things like name changes,
registering/removing from Main database, etc.
2017-11-29 17:23:25 +01:00
0439733cf8 Merge branch 'master' into blender2.8 2017-11-29 16:32:50 +01:00
1136dee232 Cleanup: De-duplicate code in object update routines 2017-11-29 16:26:16 +01:00
86847bf5ba Cleanup: Split depsgraph uber transform function callback 2017-11-29 16:22:59 +01:00
0af91d7fe6 Cleanup: Remove unused argument 2017-11-29 16:15:52 +01:00
dbde3c78f8 Cleanup: Make object_handle_update easier to follow 2017-11-29 16:12:39 +01:00
aa2ecbf35b Merge branch 'master' into blender2.8 2017-11-29 16:01:07 +01:00
1f9387ef91 Cleanup: Remove unused function 2017-11-29 15:59:51 +01:00
aad711d064 Merge branch 'master' into blender2.8 2017-11-29 15:47:00 +01:00
a02cbb3c3a Eevee: Fix default shader. 2017-11-29 16:02:51 +01:00
60703e45f3 Transform: Avoid use of ob->recalc in snapping code
Do a direct update of object transform instead, without involving
manual trickery of recalc flag.

Shouldn't be functional changes as far as artists are concerned,
but will allow us to get rid of recalc flags in 2.8.

Thanks Bastien for review!
2017-11-29 15:37:09 +01:00
2e47d1a14c Merge branch 'master' into blender2.8 2017-11-29 14:59:48 +01:00
c8b1a83a8c Depsgraph: Fix assert failure 2017-11-29 14:58:37 +01:00
04715b4a76 Draw manager: Cleanup, use lower case prefix for private functions 2017-11-29 12:49:15 +01:00
28a5e2437c External engine: Cleanup, use lower case prefix for private functions 2017-11-29 12:30:55 +01:00
5fb2f92dcf Eevee engine: Cleanup, use lower case prefix for private functions 2017-11-29 12:28:40 +01:00
5a814e83e8 Clay engine: Cleanup, use lower case prefix for private functions 2017-11-29 12:26:59 +01:00
cdaa56ba0d Basic engine: Cleanup, use lower case prefix for private functions 2017-11-29 12:24:36 +01:00
ffbc3a0f2a Eevee: Cleanup, avoid unneeded goto
Ideally this also should be split into smaller functions, but will leave that
for later a bit.
2017-11-29 12:19:57 +01:00
f6afdd576e Eevee: Cleanup, split long probe refresh function
There is no reason to have such a long function, it is really easy to break it
down into a smaller ones, and call them from where needed. Makes them smaller
and easier to follow. Also avoids use of confusing goto's.
2017-11-29 12:15:22 +01:00
e168e0f46f Eevee: Cleanup, avoid too much nested indentation
Just do early `continue`, makes code easier to follow than fewzillion of nested
checks and loops and everything.
2017-11-29 12:00:03 +01:00
28048f75ce Merge branch 'master' into blender2.8 2017-11-29 21:32:16 +11:00
e32cfb0743 Cleanup: rename bpy_util -> bpy_capi_utils
This is for internal CAPI use only, avoid confusion w/ bpy.utils module.
2017-11-29 21:11:29 +11:00
69d33ecdec Eevee: Stop depsgraph update callback form allocating unneeded memory 2017-11-29 11:07:52 +01:00
dc4c9de91a Draw manager: Cleanup, naming
Similar to previous commit in Eevee.
2017-11-29 11:01:08 +01:00
6b9999e3fc Eevee: Cleanup, naming
For functions which will allocate requested data if it does not exist yet
"_ensure" is to be used instead of "_get". "_get" functions should return
NULL in cases when requested data does not exist yet.
2017-11-29 11:01:08 +01:00
73aac1b919 Draw manager: Cleanup, indentation in preprocessor 2017-11-29 11:01:08 +01:00
3478d66b28 Depsgraph: Remove object-specific flag which was storing update tag
There were following issues:

- This was used in a similar way of DEG's ID update callback. No reason to have
  yet-another-way of informing editors/engines about changes. Better to keep
  regular update mechanism usable and fast for those needs.
- It wasn't granular at all, and granularity in flags is something what we
  need to support anyway, even for existing ID update.
- There is no reason to have it per-object. Depsgraph operates on IDs.
- It wasn't clear when and who clears the flag, and was possible to run into
  conflicts.
2017-11-29 11:01:08 +01:00
a6b6689c0a Draw manager: Listen to depsgraph's ID update callbacks
This replaces dedicated flag which wasn't clean who sets it and who clears it,
and which was also trying to re-implement existing functionality in a way.

Flushing is not currently very efficient but there are ways to speed this up
a lot, but needs more investigation.
2017-11-29 11:01:08 +01:00
6208ce2e0a Eevee: Set engine data needs update to false when everything is up to date
Currently this shouldn't cause any differences, but is required for the upcoming
changes in informing draw engines about changes.
2017-11-29 11:01:08 +01:00
3cb19a3d89 Merge branch 'master' into blender2.8 2017-11-29 18:06:24 +11:00
ad7fb1c028 Cleanup: Python imports
Split over lines to diff more easily.
2017-11-29 18:05:41 +11:00
639d49b01f Merge branch 'master' into blender2.8 2017-11-29 16:15:21 +11:00
c17c6557b4 PyAPI: add function to check any mathutils type
Also add CheckExact versions of type checking macros.
2017-11-29 16:13:26 +11:00
ddc7e72fe1 RNA: remove paranoid NULL check
Was added as part of D2666.
2017-11-29 14:29:47 +11:00
0c8265c0a9 Merge branch 'master' into blender2.8 2017-11-29 14:21:03 +11:00
26a64ba23a RNA: sync API changes from 2.8 2017-11-29 14:13:34 +11:00
Julian Eisel
ad625acda8 RNA: Allow structs to define tags for their properties
Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.
2017-11-29 13:53:34 +11:00
f89563a806 Merge branch 'master' into blender2.8 2017-11-29 13:44:59 +11:00
0b325ba201 PyAPI: PyC_Err_PrintWithFunc utility function
Move function error printing utility into py_capi_utils.
2017-11-29 13:41:10 +11:00
Dalai Felinto
2f80fbbac3 Depsgraph: Fix Camera object showing when not in view layer
If the Scene->camera was not in the active view layer we would still see it in the viewport.
2017-11-28 17:47:22 -02:00
e559a99a04 Eevee: Fix T53413: Crash when using displacement bump relink.
ntree_shader_relink_displacement is creating a transient node that does not have a correct original to point to.
In this case we revert to constant uniform.
2017-11-28 17:22:37 +01:00
701ebb0a64 Draw manager: Pass explicit context to DEG scene update callback
This way it is more clear what is needed to be passed and what is available
in the callback itself.

Thanks Dalai for review and tips about engine type!
2017-11-28 16:47:03 +01:00
e183372f90 Merge branch 'master' into blender2.8 2017-11-28 16:34:43 +01:00
0c7fbc435f Cleanup (remove commented OMP directive). 2017-11-28 16:31:11 +01:00
08e7b5d348 Cleanup: naming 2017-11-28 15:08:43 +01:00
178ea1f798 Cleanup, naming of engine type variable 2017-11-28 15:06:32 +01:00
e5a74f3ad3 Audaspace: Fix -Wreorder warning
Makes building less noisy, helps catching real introduced warnings/errors.

@xeXyon, mind having a look here and possibly apply to upstream? :)
2017-11-28 14:24:56 +01:00
9d6bd665e3 Depsgraph: Wrap context used for editors update callback into a structure
This way we can extend it much easier.
2017-11-28 14:24:56 +01:00
db2a603f6e Depsgraph: Remove workaround for Blender Internal in viewport
This commit effectively reverts fix T45702 done in 067fe2719a.

Reasoning:

- Blender Internal is being replaced with Eevee, and will be removed entirely
  rather soon.

- All render engines are planned to have own depsgraph, so such threading
  conflicts should no longer be an issue.

- We don't want to spend time on porting workarounds for EOL things to a new
  design. Less code -- faster the work :)

- If such notifications will end up needed for some other cases, we would
  need to re-implement this a more proper depsgraph tagging/flushing and make
  it to work with all copy-on-write datablocks and everything.
2017-11-28 14:24:56 +01:00
86bfce6794 Depsgraph: Don't call DEG ID update functions directly
There might be much more logic involved there, also we might not know proper
evaluated CoW pointer there yet. So we leave this to dependency graph to
decide what exactly to do here.
2017-11-28 14:24:56 +01:00
bf5b931d64 Removing OMP: BKE's tracking_stabilize.
Again, 2 times quicker with BLI than with OMP (from about 5ms to 2.5ms
per frame for the parallelized loop, on a rather small video...).
2017-11-28 12:38:10 +01:00
604de7cbe8 Merge branch 'master' into blender2.8 2017-11-28 20:35:24 +11:00
7c64e33b01 makesdna/makesrna: silence output by default
No need to print status for basic & reliable operations,
build systems can output operations they run if needed,
or debug output changed in the source if developers are debugging.

Nice for ninja, so any printed text hints at a problem to fix.
2017-11-28 20:27:40 +11:00
Dalai Felinto
91034646c7 Fix T53291: Deleting objects do not delete them from the blend file
User count was wrong for newly created files. We increase/decrease user count
when we link/delete objects from a SceneCollection.

So we don't want to leave user count of 1 after calling BKE_libblock_alloc in
BKE_object_add_only_object().
2017-11-27 14:52:21 -02:00
Dalai Felinto
14c3ef8253 Fixing alembic unittest after render layer purge 2017-11-27 14:52:21 -02:00
2bf3825711 Fix T53145: bevel tool does not start with amount at zero. 2017-11-27 16:57:14 +01:00
29044cfb12 Depsgraph: Parameters component does exist in objects 2017-11-27 16:34:44 +01:00
f046af4d5d Merge branch 'master' into blender2.8 2017-11-27 16:23:32 +01:00
63bf489734 Cleanup: indentation 2017-11-27 16:22:09 +01:00
9e658b5ebc Remove workaround for loopcut and DM stability
Neither me nor Campbell could redo the issue, lets get rid of this workaround
and fix it properly if still needed.
2017-11-27 15:52:02 +01:00
5191104776 Depsgraph: Sanitize placement of component types in switch statement
Makes it more clear why and what is being ignored.
2017-11-27 15:34:36 +01:00
488b6fa669 Merge branch 'master' into blender2.8 2017-11-27 14:52:31 +01:00
e3f2b1676c Depsgraph: Make sure unexpected configuration does not happen 2017-11-27 14:51:49 +01:00
f54e076ae6 Merge branch 'master' into blender2.8 2017-11-27 14:32:19 +01:00
ef439a1f7e Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled 2017-11-27 14:24:16 +01:00
408515810e Merge branch 'master' into blender2.8 2017-11-27 14:08:35 +01:00
9b42b3e114 Sequencer: Add option to render OpenGL preview with DoF
The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!
2017-11-27 12:21:21 +01:00
37fc23dd9e Refactor view3d offscreen drawing to avoid having multiple boolean arguments
This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable
meaning.
2017-11-27 12:11:56 +01:00
ff9cf06645 Tracking: Cleanup. make code friendly for multi-column editing 2017-11-27 08:50:01 +01:00
3bd6c8bfa2 WM: don't change selection on workspace append 2017-11-27 18:40:09 +11:00
d4161845b2 Tool System: show manipulators at startup
Support duplicating, switching workspaces too.
2017-11-27 18:36:54 +11:00
ee99d1453a Fix crash duplicating workspace 2017-11-27 17:24:26 +11:00
885e73d387 Manipulator: ignore depth-buffer for scale cage 2017-11-27 15:51:18 +11:00
7b8e89f297 Cleanup: incorrect comment 2017-11-27 15:15:56 +11:00
46d9c5de84 WM: handle widgets before tool keymaps
Allows adjusting on-screen widgets even when a tool is selected.
2017-11-27 15:10:33 +11:00
de09366d57 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/mask/mask_draw.c
2017-11-26 20:29:56 +01:00
440aa2bf70 Cleanup: ImageEditor's mask drawing code was re-implementing BKE_maskrasterize_buffer!
So this deduplicates and simplifies code, yeah.

Also, as an odd bonus, new code seems slighly quicker than previous one
(about 5 to 10% quicker).
2017-11-26 19:18:12 +01:00
06e64058dd Removing OMP: BKE's mask_rasterize.c
Once again nothing much to say here, except that whole mask rendering
process from VSE is about 25% quicker now. ;)
2017-11-26 19:06:26 +01:00
440a49a24c Removing OMP: autotrack BKE code.
Pretty straightforward this time, we already have a single struct
pointer containing all needed data (or nearly).

And we gain about 10-15% speed on tracking! :)
2017-11-26 17:25:41 +01:00
f1ce279903 Removing OMP: bmesh_operators.c
Two more 'not really useful' cases (OMP only shows some noticeable
speedup with above 1M elements, and since this is quick operation anyway
compared to even ather basic operators, gain is in the 1% area of total
processing time in best case).

So not worth parallelizing here, we'll gain much more on tackling heavy
operations. ;)

And BMesh is free from OMP now!
2017-11-26 16:03:29 +01:00
2b6f345558 Removing OMP: bmesh_interp.c
Performances tests on this one are quite surprising actually...
Parallelized loop itself is at least 10 times quicker with new BLI_task
code than it was with OMP. And subdividing e.g. a heavy mesh with 3
levels of multires (whole process) takes 8 seconds with new code, while
10 seconds with OMP one. And cherry on top, BLI_task code only uses
about 50% of CPU load, while OMP one was at nearly 100%!

In fact, I suspect OMP code was not properly declaring outside vars,
generating a lot of uneeded locks.

Also, raised the minimum level of subdiv to enable parallelization,
tests here showed that we only start to get significant gain with subdiv
levels of 4, below single threaded one is quicker.
2017-11-26 16:03:29 +01:00
099bda8875 Removing OMP: nuke last usages in bmesh_mesh.c
Those three ones were actually giving no significant benefits, in fact
even slowing things down in one case compared to no parallelization at
all (in `BM_mesh_elem_table_ensure()`).

Point being, once more, parallelizing *very* small tasks (like index or
flag setting, etc.) is nearly never worth it.

Also note that we could not easlily use per-item parallel looping in
those three cases, since they are heavily relying on valid
loop-generated index (or are doing non-threadable things like allocation
from a mempool)...
2017-11-26 16:03:29 +01:00
Mathieu Menuet
83e80db56e Fix T53349: AO bounces not working correct with OpenCL. 2017-11-26 15:53:00 +01:00
311da4cd16 Cleanup: rename edge -> edges 2017-11-26 20:13:18 +11:00
23252eece6 Minor improvement to last commit
Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.
2017-11-26 18:38:45 +11:00
329bf8e1bf BMesh: improve edge rotate when edges share faces
Previously outcome depended on order of edges,
now the longest boundary edges are rotated first,
then the faces connected edges.

This gives more predictable results, allowing regions containing
a vertex fan to be rotated onto the next vertex.
2017-11-26 17:51:22 +11:00
5b225c59bb Cleanup: move edge-rotate into own file 2017-11-26 13:42:25 +11:00
941deaca7a Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB 2017-11-26 13:06:16 +13:00
3c1f3c02c6 Fix for Fix (c): broken atomic lock in own bmesh code.
That was a nasty one, Debug build would never have any issue (even tried
with 64 threads!), but Release build would deadlock nearly immediately,
even with only 2 threads!

What happened here (I think) is that gcc optimizer would generate a
specific path endlessly looping when initial value of virtual_lock was
FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas
completely. Which would have been correct, should v_no[0] not have been
shared (and modified) by multiple threads. ;)

Idea of that (broken) for loop was to avoid completely calling the
atomic cas as long as v_no[0] was locked by some other thread, but...
Guess the avoided/missing memory barrier was the root of the issue here.

Lesson of the evening: Remember kids, do not trust your compiler to
understand all possible threading-related side effects, and be explicit
rather than elegant when using atomic ops!

Side-effect lesson: do check both release and debug builds when messing
with said atomic ops...
2017-11-25 23:14:54 +01:00
dd6c918b2c Fix broken atomic_cas lock in own recent commit in bmesh.
Using atomic cas correctly is really hairy... ;)

In this case, the returned value from cas needs to validate *two*
conditions, it must not be FLT_MAX (which is our 'locked' value and
would mean another thread has already locked it), but it also must be
equal to previously stored value...

This means we need two steps per loop here, hence using a 'for' loop
instead of a 'while' one now.

Note that collisions are (as expected) very rare, less than 1 for 10k
typically, so did not catch the issue initially (also because I was
mostly working with release build to check on performances...).
2017-11-25 20:28:12 +01:00
9aece5e1e7 Eevee: Fix Defered AO defines 2017-11-25 17:47:52 +01:00
0c4740735c Eevee: Fix SSS mixing with transparent bsdf 2017-11-25 17:47:52 +01:00
5dfeecf47b Eevee: Add SSS support in probes
Previously the lighting of SSS material was not present in reflection probe or irradiance grid.

This does not compute the SSS correctly but at least output the corresponding irradiance power to the correct output.
2017-11-25 17:47:52 +01:00
Julian Eisel
974ffaa39d Get workspace mode from the workspace view-layer
While this probably isn't the final solution we'll go with, it's nicer
as current one, which was basically broken. So consider this as
temporary solution.

It also allows testing how changing workspace changes mode & active
object, but only by having the workspaces use different view-layers.

Decided to remove WorkSpace.mode for now. If we need to bring it back,
we'll have to version patch it anyway.
2017-11-25 03:42:49 +01:00
7cbc7dd904 Eevee: SSS: Add separated Albedo option.
This option prevent from automatically blurring the albedo color applied to the SSS.

While this is great for preserving details it can bleed more light onto the nearby objects since the blurring will be done on pure "white" irradiance.
This issue is to be tackled in a separate commit.
2017-11-24 22:29:28 +01:00
8d4aa6bf44 GPUFramebuffer: Bump the framebuffer attachement limit to 5 color textures 2017-11-24 22:29:28 +01:00
f591060856 Backgroudn set tests: Correct evaluation order
All depsgraphs are sharing same object state for now, which means doing set
scene evaluation after main scene evaluation will override all modifications
done by the main scene.
2017-11-24 16:55:41 +01:00
8a1a053250 Depsgraph: Tag background scene for base flags update
When setting background object, it might pull new objects in and those objects
will not have proper flags unless on_visible_update() was called afterwards.
2017-11-24 16:55:33 +01:00
6130524d8c Revert "Depsgraph: Remove legacy re-scheduling code"
This reverts commit 90ff88646d.

Can not do this yet, if object is not part of graph yet it will not have entry
taq. Need some more generic solution here.
2017-11-24 16:44:54 +01:00
d211c36c83 Depsgraph: Allow tagging whole scene for base flags flush 2017-11-24 16:34:06 +01:00
20c8c9a3c7 Depsgraph: make it more obvious who's view layer is being updated 2017-11-24 16:33:21 +01:00
a1500fe865 Depsgraph: Do log from newly base flag flush function 2017-11-24 16:07:38 +01:00
90ff88646d Depsgraph: Remove legacy re-scheduling code 2017-11-24 15:46:25 +01:00
3023eb384a Depsgraph: Fix crash when deleting object which is linked both directly and indirectly 2017-11-24 15:46:25 +01:00
71febcbae0 Depsgraph: Make code a bit more robust against tagging indirectly linked objects 2017-11-24 15:46:25 +01:00
a365f1dd65 Depsgraph: Re-schedule pending tags after relations update
It is possible to have situation when we need to both update relations and do
some updates on random IDs. This was only done before for objects using their
recalc field. This means, every update tag which did not fit into there would
have been lost after updating relations.

Now we do some smarter re-scheduling of operations after relations are updated.
2017-11-24 15:46:25 +01:00
dde05cbcc2 Depsgraph: Directly linked objects should be priority for base flags over set scenes 2017-11-24 15:46:25 +01:00
ad288c9c34 Depsgraph: Fix race condition when object is coming from both scene and set 2017-11-24 15:46:25 +01:00
33b8a3f9e8 Depsgraph: Pass base in relations builder 2017-11-24 15:46:25 +01:00
272da2790b Depsgraph: Correct wrong base_flags for objects coming from set scene 2017-11-24 15:46:25 +01:00
81324dbfbf Depsgraph: Use proper link flag for indirectly linked parent object 2017-11-24 15:46:25 +01:00
56367cfeb3 Merge branch 'master' into blender2.8 2017-11-24 15:46:10 +01:00
1caa267ee6 Depsgraph: Cleanup, indentation 2017-11-24 15:45:41 +01:00
c546fb9e85 Merge branch 'master' into blender2.8 2017-11-24 15:40:53 +01:00
5f7981243e Depsgraph: Allow finding operations after construction is done 2017-11-24 15:38:20 +01:00
a8b97b2e41 Depsgraph: Deduplicate operation node finding logic 2017-11-24 15:35:42 +01:00
d232363290 Depsgraph: Use proper return type for find_node method 2017-11-24 15:34:53 +01:00
d80c1e1e11 Depsgraph: Use get_ prefix for function which expect operation to exists 2017-11-24 15:32:29 +01:00
d8f33fc818 Depsgraph: Make has_ prefixed function to return boolean 2017-11-24 15:26:54 +01:00
93e8a045df Depsgraph: Introduce explicit method which finds operation or returns NULL 2017-11-24 15:24:33 +01:00
68654c0be5 Depsgraph: Make more clear what find_operation() is doing for component 2017-11-24 15:21:50 +01:00
Dalai Felinto
dc2ae8fdf2 Unittest: Update background set test to test for proper flag
This test will fail until depsgraph is fixed.
But introduced on 87c821ff26.
2017-11-24 11:42:28 -02:00
Dalai Felinto
4493d0d085 Object RNA: expose base_flag settings:
object.is_from_set
object.is_from_duplicator

We need them for the unittests, and users can benefit from it as well.
Note, this only makes sense when reading objects from depsgraph:

`bpy.context.depsgraph.objects`
2017-11-24 11:41:49 -02:00
Dalai Felinto
1971dd2976 Layers Unittest: Background set
This is an incomplete test since we cannot check for the
depsgraph selection value with the current API, nor can we
see if the relationship lines are being drawn.
2017-11-24 10:54:13 -02:00
121b44698a Depsgraph: Re-build relations when changing set scene
Set scene is a part of dependency graph, so need to tag relations for update
after changing set scene/
2017-11-24 13:02:19 +01:00
6b4a243377 Merge branch 'master' into blender2.8 2017-11-24 10:58:28 +01:00
543945b9e5 Correct sensor fit use 2017-11-24 21:01:04 +11:00
8db63c6a1c Cleanup leftover timing debug prints from own recent commits.
Sorry about that...
2017-11-24 10:43:29 +01:00
87c821ff26 Depsgraph: Flush flags from base to object as an evaluation step
Previously it was done during depsgraph iteration, which is not good at all,
since after evaluation nobody should really modify how object was evaluated.
2017-11-24 10:19:48 +01:00
93f6a9d652 Depsgraph: Add special cases to deal with multiple objects selection update
The idea then is to avoid doing depsgraph tag for each of the object which
selection is changed (which could be tricky to do anyway due to lots of areas
of selection code where this could happen), and simply tag scene's with
selection update tag.

This will involve synchronization of flags from base to objects, which is
rather cheap anyway.
2017-11-24 10:19:48 +01:00
d2679b3e42 Depsgraph: Add base flag flush operation definition 2017-11-24 10:19:48 +01:00
1949ed558b Depsgraph: Pass base to build_object() 2017-11-24 10:19:48 +01:00
c1f690428c Depsgraph: Create CoW copy of scene early on
Originally this only needed for view collections, but it will be needed for
bases really soon as well.
2017-11-24 10:19:48 +01:00
a5d763a11e Depsgraph: Use depsgraph to handle edit mode selection
This is crucial bit since batch cache is stored in the evaluated object,
meaning we can't tag it's hatch cache dirty from the notifier system.
Not easily at least. Better to leave this job to depsgraph, it knows
all the copies of data.
2017-11-24 10:19:48 +01:00
0f5ef668da Manipulator: fix camera lens update glitch
Property range setup initially used values that can change.
2017-11-24 20:28:13 +11:00
cda22ce0e2 Eevee: Fix SSR adding too much light.
Basically the probes were rendered twice.
2017-11-24 06:37:37 +01:00
2302ba2245 Eevee: Refactor of lit_surface_frag.glsl
This cleanup removes the need of gigantic code duplication for each closure.

This also make some preformance improvement since it removes some branches and duplicated loops.

It also fix some mismatch (between cycles and eevee) with the principled shader.
2017-11-24 06:37:37 +01:00
16a2802149 Eevee: SSS: Principled Shader: Add a workaround the lack of scale input
This is a hack to make the user control the SSS radius even though the profile is baked with the default radius values.

This is completly against UI principles since you cannot edit the profile radiuses while there is something plugged into the radius socket.
Better solution will be to either have a dedicated node value for RGB radiuses and a SSS scale socket only for eevee.
2017-11-24 06:37:37 +01:00
f3b384862d Merge branch 'master' into blender2.8 2017-11-24 14:30:36 +11:00
c62e3a05b0 Cleanup: -Wnonnull-compare GCC warning 2017-11-24 14:29:17 +11:00
f8fc77ec84 Cycles: add object level holdout property, to replace Z mask layer. 2017-11-24 00:12:48 +01:00
d992240bfa Fix unneeded legacy OpenGL call in Cycles viewport drawing. 2017-11-24 00:12:48 +01:00
b63442e0b6 Minor cleanup for own recent commits. 2017-11-23 22:43:11 +01:00
a786baa193 Merge branch 'master' into blender2.8 2017-11-23 21:36:27 +01:00
43ddf0e9a7 Getting rid of OMP: first usage of new parallel BMesh items iteration instead.
`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D2930
2017-11-23 21:21:32 +01:00
bc3f0cfd14 BMesh: add limited support for parallelization over some basic iterators.
This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are
supported.
2017-11-23 21:19:54 +01:00
cf6e8edda5 atomic_ops: add atomic_cas_float helper. 2017-11-23 21:17:16 +01:00
efb86b712d Add a new parallel looper for MemPool items to BLI_task.
It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.
2017-11-23 21:14:43 +01:00
b84e6dfee4 Add ability to use more than one mempool iterator simultaneously.
This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).
2017-11-23 21:12:00 +01:00
c947788830 Merge branch 'master' into blender2.8 2017-11-23 20:34:03 +01:00
ff9eab7926 atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.
Checking for type sizes is much nicer with a static assert!
2017-11-23 20:25:55 +01:00
d423e66d34 Add non-gcc variant of static assert macro.
Adapted from http://www.pixelbeat.org/programming/gcc/static_assert.html.

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.
2017-11-23 20:25:55 +01:00
5e13097dc3 Fix T53145: bevel tool fails when used a second time.
Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.
2017-11-23 20:17:31 +01:00
4f8bffa7bf Merge branch 'master' into blender2.8 2017-11-23 19:16:11 +01:00
debd9f6ea1 Fix T53171: lamp specials strength tweak fails with renamed emission nodes. 2017-11-23 19:13:31 +01:00
56da112ae0 Fix T53360: crash with GLSL bump mapping and missing group output node. 2017-11-23 18:12:32 +01:00
Dalai Felinto
b79b8478ee Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer 2017-11-23 14:58:01 -02:00
f218e6d4da Fix T53276: encoding output quality UI clarification. 2017-11-23 17:55:25 +01:00
6be95f8778 Fix T53357: harmless assert after recent addition of render time pass. 2017-11-23 17:14:35 +01:00
dd04f54e84 Fix inaccuracy when storing material ID pass in half float multilayer EXR.
These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.
2017-11-23 17:14:04 +01:00
e50ed90e4d Fix T53348: Cycles difference between gradient texture on CPU and GPU. 2017-11-23 17:14:04 +01:00
2f9df08aa8 Merge branch 'master' into blender2.8 2017-11-23 17:09:29 +01:00
e704d8a616 Moar attempt to fix bloody MSVC intrinsic mess... 2017-11-23 16:58:20 +01:00
df06f1c816 Attempt to fix bloody MSVC atomic intrinsic mess... 2017-11-23 16:53:03 +01:00
Dalai Felinto
e314aa1e47 Fix specific 2.8 broken files
Short of checking for types (SceneLayer) this is the only reliable
way of getting all 2.80 files to date.
2017-11-23 13:33:58 -02:00
5330e7fd29 Merge branch 'master' into blender2.8 2017-11-23 16:29:00 +01:00
580b34e52b atomic_ops: add char versions of uint8_t atomic primitives. 2017-11-23 16:24:34 +01:00
497e2b3dfa Cleanup: use signed atomic ops when needed. 2017-11-23 16:24:34 +01:00
105b95835f atomic_ops: add signed versions of primitives.
Reason is motsly that dealing with type conversion in calling code is
not great, makes it less readable, and can generate hidden bugs in case
original type changes and atomic primitive calls are not updated
accordingly...
2017-11-23 16:24:33 +01:00
35e8138c95 Merge branch 'master' into blender2.8 2017-11-23 15:26:53 +01:00
75a87abdc9 Depsgraph: Cleanup, deduplicate code around component registration 2017-11-23 15:23:19 +01:00
f7af770446 Depsgraph: Cleanup, don't use view layer name
Dependency graph is only built per-view-layer now, so no need to store names.
Will speed up operation lookup as well,.
2017-11-23 14:44:14 +01:00
Julian Eisel
641d870b37 Tag properties of transform operators as 'advanced'
Sets the 'advanced' tag for some properties of following transform operators:
* Create Orientation
* Translate
* Resize
* Skin Resize
* Trackball
* Rotate
* Tilt
* Bend
* Shear
* Push/Pull
* Shrink/Flatten
* To Sphere
* Edge Slide
* Vertex Slide
* Edge Crease
* Edge Bevel Weight
* Sequence Slide
* Transform
2017-11-23 14:21:40 +01:00
Julian Eisel
3cdd99767e Tag properties of some mesh editing operators as 'advanced'
Sets the 'advanced' tag for some properties of following mesh edit operators:
* Loop Cut
* Subdivide
* Mark Seam
* Smooth Vertex
* Laplacian Smooth Vertex
* Merge
2017-11-23 14:14:34 +01:00
Julian Eisel
60cbdb0152 Support tagging operator properties as 'advanced'
This will later be used to show advanced operator properties separate from
basic (as in non-advanced) ones in the UI.

Tagging a single operator property in C should be done via
`WM_operatortype_prop_tag()`. It does additional checks for type safety
that `RNA_def_property_tags()` doesn't do.

To avoid having to tag each advanced property individually, multiple
ones can be tagged by wrapping them into
`WM_operatortype_props_advanced_bein()` and
`WM_operatortype_props_advanced_end()` calls. It's also possible to only
call `_begin()`, all properties added after this will get tagged then.
In most cases this last approach should be sufficient.

Example of Python usage:
`my_float = bpy.props.FloatProperty(name="Some Float", tags={'ADVANCED'})`
2017-11-23 13:58:05 +01:00
Julian Eisel
23d148ecaf RNA: Allow structs to define tags for their properties
Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.

Actual usage of this will be added in a follow-up commit.
2017-11-23 13:54:11 +01:00
545f671b80 Merge branch 'master' into blender2.8 2017-11-23 12:04:57 +01:00
f2842ac65e Depsgraph: Cleanup, split build_object() a bit 2017-11-23 12:01:31 +01:00
7ba1babc90 Merge branch 'master' into blender2.8 2017-11-23 11:47:47 +01:00
f3fa5c1258 Depsgraph: Cleanup, always call full object 2017-11-23 11:39:28 +01:00
Dalai Felinto
99f5180435 New view layers should be named "View Layer" (not Render Layer) 2017-11-23 08:31:15 -02:00
Dalai Felinto
3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
fb7d23bdb2 Merge branch 'master' into blender2.8 2017-11-23 16:28:05 +11:00
434ed96dd2 Revert "BLI_utildefines: Support SWAP macro with two args"
This reverts commit d749320e3b.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.
2017-11-23 15:21:50 +11:00
3bec70ca60 Use custom SWAP macro for swapping userdef data
Avoids complicating the common case
2017-11-23 15:18:22 +11:00
100ffd3c0f Eevee : Fix error with volumetrics. 2017-11-22 19:04:52 +01:00
Dalai Felinto
94d40aca0c Fix doversion crash with 2.8 files that had freestyle 2.8
Crash introduced on: 3a95bdfc65
We can't decrease user count of freestyle linestyle IDs before linking.

Moving doversion for after linking.
And for the records we are simply removing the freestyle data altogether.
This is only for files created with 2.8, so it should be fine.
2017-11-22 15:42:18 -02:00
73c4ba18d5 Merge branch 'master' into blender2.8 2017-11-23 03:26:00 +11:00
326efb4319 Fix T53274: Saving template prefs overwrites default prefs 2017-11-23 03:12:00 +11:00
d749320e3b BLI_utildefines: Support SWAP macro with two args 2017-11-23 03:11:48 +11:00
Dalai Felinto
15a0ad6027 Fix multi layer/multi pass render
But introduced on the SceneRenderLayer > RenderLayer commit:
3a95bdfc65

Reported by Sergey Sharybin (over irc).
2017-11-22 10:34:19 -02:00
5d2b3a966e Merge branch 'master' into blender2.8 2017-11-22 12:50:17 +01:00
4e6f86942c Depsgraph: Remove debug only code 2017-11-22 12:08:02 +01:00
Dalai Felinto
66c0f041a9 Fixup for last commit: flipped logic for disabling SceneLayer render 2017-11-22 08:53:46 -02:00
Dalai Felinto
5265cfdef5 Layers doversion: Don't set the Viewport created layer as renderable 2017-11-22 08:50:15 -02:00
Dalai Felinto
ed1278b0bc Fix SceneRenderLayer memory leak for files created with 2.8 2017-11-22 08:41:14 -02:00
Dalai Felinto
3a95bdfc65 SceneRenderLayer Removal/Refactor
This patch moves all the functionality previously in SceneRenderLayer to SceneLayer.
If we want to rename some of these structs now would be a good time to do it, before they are in SceneLayer.

Everything should be working, though I will test things further tomorrow. Once this is committed depsgraph can get
rid of the workaround added in rna_Main_meshes_new_from_object and finish whatever this patch was preventing from being finished.

This patch also adds a few placeholders for the overrides (samples, ...). These are obviously not working, so some unittests that rely on 'lay', and 'zmask' will fail.

This patch does not addressed the change of moving samples to ViewRender (I have this as a separate patch and needs some separate discussion).

Following next is the individual note of the individual parts that were committed.

Note 1: It is up to Cycles to still get rid of exclude_layer internally.
Note 2: Cycles still need to handle its own doversion for the use_layer_samples cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.

Note 3: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).

Note 4: There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead of taking things from it bit by bit.

Reviewers: sergey, campbellbarton, brecht

Differential Revision: https://developer.blender.org/D2919
2017-11-22 07:13:33 -02:00
Dalai Felinto
8ba6103e66 SceneRenderLayer > SceneLayer: Convert Lay
There are parts of the old (Blender Internal) rendering pipeline that is still
using lay, e.g., in shi->lay.

Honestly it will be easier to purge the entire Blender Internal code away instead
of taking things from it bit by bit.
2017-11-22 07:13:33 -02:00
Dalai Felinto
0a6df6b173 Doversion: We should always add the old RenderLayer
We cannot assume a render layer does not have a setting that was needed for
compositing. Even if:

```
(scene->lay & render_layer->lay) != (scene_lay) &&
(render_layer->lay | render_layer->lay_exclude) == 0))
```

Which would mean use the scene layers just as they are.
2017-11-22 07:13:33 -02:00
Dalai Felinto
cb67be3f22 Bitflag tests simplification 2017-11-22 07:13:33 -02:00
Dalai Felinto
d276e45ee6 SceneRenderLayer > SceneLayer: Convert Z-Mask
Note: Cycles still need to implement the per-object holdout
(similar to how we do shadow catcher).
2017-11-22 07:13:33 -02:00
Dalai Felinto
e22ca0fb86 SceneRenderLayer > SceneLayer: Convert samples_override
Note: Cycles still need to handle its own doversion for theses cases and

(1) Remove the override as it is
(2) Add a new override (scene.cycles.samples) if scene.cycles.use_layer_samples != IGNORE

Respecting the expected behaviour when scene.cycles.use_layer_samples == BOUNDED.
2017-11-22 07:13:33 -02:00
Dalai Felinto
05306d9766 SceneRenderLayer > SceneLayer: Convert material_override 2017-11-22 07:13:33 -02:00
Dalai Felinto
f15c63b0c2 SceneRenderLayer > SceneLayer: Remove light_override 2017-11-22 07:13:33 -02:00
Dalai Felinto
9ce2370ce4 SceneRenderLayer > SceneLayer: Remove exclude_layer
Note: It is up to Cycles to still get rid of exclude_layer internally:
RenderLayerInfo.exclude_layer
2017-11-22 07:13:33 -02:00
69b5165902 WM: minor correction to user-pref writing
When saving templates had wrong return value.
2017-11-22 17:11:03 +11:00
846cdf5318 Eevee : SSS : Add Translucency support.
This adds the possibility to simulate things like red ears with strong backlight or material with high scattering distances.

To enable it you need to turn on the "Subsurface Translucency" option in the "Options" tab of the Material Panel (and of course to have "regular" SSS enabled in both render settings and material options).
Since the effect is adding another overhead I prefer to make it optional. But this is open to discussion.

Be aware that the effect only works for direct lights (so no indirect/world lighting) that have shadowmaps, and is affected by the "softness" of the shadowmap and resolution.

Technical notes:

This is inspired by http://www.iryoku.com/translucency/ but goes a bit beyond that.
We do not use a sum of gaussian to apply in regards to the object thickness but we precompute a 1D kernel texture.
This texture stores the light transmited to a point at the back of an infinite slab of material of variying thickness.
We make the assumption that the slab is perpendicular to the light so that no fresnel or diffusion term is taken into account.
The light is considered constant.
If the setup is similar to the one assume during the profile baking, the realtime render matches cycles reference.
Due to these assumptions the computed transmitted light is in most cases too bright for curvy objects.

Finally we jitter the shadow map sample per pixel so we can simulate dispersion inside the medium.
Radius of the dispersion is in world space and derived by from the "soft" shadowmap parameter.
Idea for this come from this presentation http://www.iryoku.com/stare-into-the-future (slide 164).
2017-11-22 04:51:21 +01:00
d77f1d6538 Fix T53313: bevel shader with transmission render artifacts. 2017-11-22 01:59:21 +01:00
5f4058ddbc Removing OMP: get rid of usages in /bmesh/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.
2017-11-21 22:25:22 +01:00
7770c2ef87 Removing OMP: get rid of last bit in /editors/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.
2017-11-21 22:25:22 +01:00
6c372530b4 Cleanup: We do not use camel case in Blender code
At least not for variables.
2017-11-21 17:34:44 +01:00
6785a2bd66 Fix T53371: Keying Node fails with values above 1
This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over
exposured.

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.
2017-11-21 17:31:45 +01:00
Dalai Felinto
ff810f08d8 Shows all Cycles panels based on scene, not context engine
This is tricky since we may want granular polling depending on the setting.
Or an option to pick whether we want the context or the scene to drive the
panels to prevent too many panels when mixing Eevee and Cycles for example.
2017-11-21 13:19:36 -02:00
a80b74ab0d Depsgraph: Fix warning with Empty objects 2017-11-21 15:47:47 +01:00
83b3e3fe00 Depsgraph: Use evaluation context to get time from
This way we don't modify scene to get current frame from. Will also let us to
hopefully get rid of Scene stored in ModifierData.

Only did for Wave modifier for now, maybe someone is around to check on another
modifiers? :)
2017-11-21 15:40:24 +01:00
99ffd7b35d Depsgraph: Fix/workaround crash when toggling edit mode 2017-11-21 15:34:13 +01:00
6ee7a02558 Depsgraph: Tag evaluated mesh as such
Helps troubleshooting.
2017-11-21 15:33:48 +01:00
0debe33617 Depsgraph: Report pointer from object evaluation functions 2017-11-21 14:46:02 +01:00
2b1a354d64 Depsgraph: Fix crash removing object when CoW is enabled
Not sure why that check was even done there. Maybe some residue of debug.
2017-11-21 14:23:58 +01:00
528841ba90 Depsgraph: Remove workarounds used for cyclic dependencies
This was dangerous to do such calculations, and now it is solvable by making
dependency graph more granular in this case. Removing the workaround also saves
us a hassle of passing lots of extra arguments down the evaluation routines.

In theory, we can also remove EvaluationCOntext from constraints evaluation as
well now. But probably better to wait with such removal for now.

This commit effectively reverts 1130c53. Will do a proper fix in dependency
graph itself.
2017-11-21 14:23:57 +01:00
Stefan Werner
58a15b2bfe Cycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit. 2017-11-21 10:43:40 +01:00
d8f80fbe72 Cycles: Fix OSL brick node after recent fix 2017-11-21 04:30:12 -05:00
Stefan Werner
1febc85855 Cycles: Workaround for performance loss with the CUDA 9.0 SDK.
CUDA 9.0.176 apparently caused some slow down on high-end Pascal cards that can be mitigated by increasing the number of registers. See https://developer.blender.org/F1142667 for a detailed comparison.
2017-11-21 10:29:11 +01:00
9325b9bf15 Fix T53365: OpenCL has wrong shading of brick texture
Looks like some weird compiler difference with signed vs unsigned ints.
2017-11-21 00:42:55 -05:00
175e8fdc1e Disable adding scene sequence strips into themselves
D2923 by @spockTheGray w/ edits, see T52586 for details
2017-11-21 16:46:27 +11:00
d3fc5919f8 Eevee: SSS: Fix error in profile computation. 2017-11-21 06:28:38 +01:00
a591bd203e Cleanup: redundant ELEM use 2017-11-21 16:15:19 +11:00
96415cb52a Code cleanup: fix harmless compiler warning. 2017-11-20 23:32:06 +01:00
d089875c4c Fix build with OSL 1.9.x, automatically aligns to 16 bytes now. 2017-11-20 23:24:24 +01:00
0b413e406d Avoid passing context to motion path calculation 2017-11-20 22:33:16 +11:00
51e2844387 Cycles: Fix wrong behavior of sharpness in Cubic SSS
Was giving difference when using sharpness of 1.0 and 0.999 even though the
result was expected to be really close to each other.

This SSS profile will probably be removed in the future in favor of more
physically bases Burley, but for the time being don't see anything wrong
fixing an existing code.
2017-11-20 11:40:55 +01:00
a8777f9058 Merge branch 'master' into blender2.8 2017-11-20 20:45:03 +11:00
f34e03d34d Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.
2017-11-20 10:16:50 +01:00
65af15ad88 UV Cube Project: improve default behavior
- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.
2017-11-20 19:51:19 +11:00
ed3b7a5cd4 Fix T53342: Outliner 'select hierarchy' broken
Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.
2017-11-20 16:02:37 +11:00
c0c696b014 Fix crash accessing line-style 2017-11-20 14:38:22 +11:00
8ba6236c48 Fix crash w/ NULL freestyle config 2017-11-20 14:35:41 +11:00
14e5711d69 Cleanup: line length, right shift 2017-11-20 14:29:50 +11:00
8af3f531b1 Cleanup: BLI headers first
Also move descriptions into doxy header
2017-11-20 14:29:50 +11:00
784614655f Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.
2017-11-19 20:43:59 +01:00
0a69e3b307 Option not to select with un-hide
D1518 from @mba105 w/ edits
2017-11-20 02:28:07 +11:00
92ea281017 Cleanup: remove BKE_utildefines
This was meant to be used for less general macros but was never used.

Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST
2017-11-20 01:47:31 +11:00
d2b03d2364 Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button 2017-11-20 03:06:13 +13:00
2317fa6dcc Cleanup - Style 2017-11-20 02:56:40 +13:00
6f578740ef Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail 2017-11-20 02:55:17 +13:00
e2585c2342 Fix compiler warning
--> render_result.c:832 - formal parameter 6 different from declaration
2017-11-20 02:08:55 +13:00
cc1253a5d9 Fix: "Lock Markers" option was not being obeyed by the "Sync Markers (when transforming)" option 2017-11-20 01:57:22 +13:00
fc77676f33 Bake Action operator: Added missing Bendy Bones support 2017-11-20 01:57:21 +13:00
c5f59f5854 Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)
This commit introduces the following changes:
* Modified the poll callback on the "Update Paths" operator for bones
  so that it only checks if there are bones that have motion paths
  (instead of checking whether the active bone has paths).

  This makes it easier to update paths without having to first select one
  that has them - useful when the paths are all on hidden/hard-to-select bones.

* Add a readonly property, "has_motion_paths" to the animviz.motion_path
  RNA struct, providing easier access to the internal flag used above.
  This makes it possible for the UI to display the "Update" button without
  having to check various bones for motion paths.


Notes:
* The flag being used in these changes already existed, and was only really
  intended for internal use. However, since it was already used in many places
  for determining if auto-update of all bone paths was needed (e.g. after certain
  editing ops), it should be safe to use here too.

* The update_paths operator currently bakes all paths when activated, so there's
  currently no loss of functionality with changing to not checking if the active
  bone has any paths (e.g. we couldn't only update the active bone only either).
  That is still listed as a todo in the code.
2017-11-20 01:57:21 +13:00
c01ffefb68 Pasting poses now updates motion paths 2017-11-20 01:57:20 +13:00
cda05639df Fix T53229: "Sample Keyframes" errors with multiple pairs of keyframes selected
There were 2 issues here (first was the one reported):
1) Curve shape changes if multiple consecutive pairs of keyframes
   are selected. The problem is that after the first pair is handled,
   subsequent pairs get sampled on the basis of the modified curve.

2) With multiple separate "islands" selected, unselected points in between
   would get ignored, causing the entire curve to get sampled.
2017-11-20 01:57:20 +13:00
Julian Eisel
7f96323cd0 Merge branch 'master' into blender2.8 2017-11-19 13:16:14 +01:00
Julian Eisel
3133d2d58c Swap priority of system path overrides for dev builds
Suggested by Campbell, thanks!

Also moved the exception into own function and improved comments.

Fixes T53008.
2017-11-19 13:13:37 +01:00
10a112093f Vertex Paint: missed removing settings from UI 2017-11-19 17:00:56 +11:00
a151b46627 Fix T53347: Vertex paint crash on undo/exit 2017-11-19 16:45:27 +11:00
4de142e0b7 Eevee : Fix bug with SSS and SSR active node selection
The bug was affecting the ability to correctly edit the expected SSS profile.
2017-11-18 22:15:08 +01:00
abd5841441 CMake: remove solaris path 2017-11-19 03:46:50 +11:00
83e4e65074 Cleanup: outdated comment 2017-11-19 03:25:52 +11:00
40c8a18229 Cleanup: style 2017-11-18 17:22:54 +11:00
8f56cebe72 Fix BGE sound actuator property access 2017-11-18 17:16:25 +11:00
cd1d9950ab Add select similar custom bone shape
D2820 by @col-one w/ edits
2017-11-18 13:56:35 +11:00
119846a6bb Mikktspace: Speed up the merging of identical vertices
Previously, Mikktspace just bucketed the vertices based on one spatial coordinate and then ran full pairwise comparisons inside each bucket.
However, since models are three-dimensional, the bucketing has a massive false-positive rate, and since pairwise comparison is O(n^2), the merging process is very slow.

But, since we only care about exactly identical vertices, there is a much more efficient approach - we can just hash all values belonging to each vertex and form buckets based on the hash.
Since the hash has 32 bits and considers all values, false-positives are very unlikely - and since both hashing and the radixsort that's used for bucketing are O(n), both asymptotical and
real-world performance (as well as code complexity) are significantly improved.
2017-11-17 18:34:53 +01:00
a96134d794 Depsgraph: Fix assert/crash when transforming from redo system
Redo system will set depsgraph to NULL, so need to ensure it exists.

Reported by Julian in IRC, thanks!
2017-11-17 16:54:06 +01:00
40f528a7da Cycles: Add per-tile render time debug pass
Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D2920
2017-11-17 16:40:24 +01:00
a0c02e4d1b Cycles: Add Volume Direct and Volume Indirect passes for volume-scattered light
No color pass because it's hard to define what to use as color in a volume.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D2903
2017-11-17 16:39:45 +01:00
f78e963858 Cycles: Refactor PassType from bitflag to index in order to allow for more passes 2017-11-17 16:34:19 +01:00
44183a3535 Merge branch 'master' into blender2.8 2017-11-17 15:28:36 +01:00
9c0a38ee33 Depsgraph: Add missing checks from previous commit 2017-11-17 15:27:02 +01:00
2d89b43fd2 Merge branch 'master' into blender2.8 2017-11-17 15:00:55 +01:00
c45afcfa81 Depsgraph: Don't make non-dynamic hair dependent on time
This way hair system used for static forest does not make playblack slow.

A bit dangerous, but let's see how far we can go!
2017-11-17 14:57:57 +01:00
759b50b20b Fix UV Projection Center Calculation
UV project mixed up global/local space,
3D cursor offset didn't take object scale into account.

Minor improvements:

- Match Cube Project 'center' behavior w/ sphere & cylinder.
- Add active-element center.
- Wrap UV's in Cube Project based on center instead of first vertex.
2017-11-17 22:30:28 +11:00
ec2c0c5534 Cleanup: warnings 2017-11-17 19:02:45 +11:00
f60563dd91 Fix error when compiling with msvc
'function': incompatible types - from 'int *' to 'short *'
2017-11-17 00:30:07 -02:00
936ddde35c Eevee: SSS: Add cubic profile for the sake of completeness.
It wasnt really hard except from the wierd sharpness 0.5 multiplication.
2017-11-17 02:00:48 +01:00
fcbb8e71c5 Eevee: SSS: Add SSS to the principled shader. 2017-11-16 21:30:15 +01:00
57c3fbd324 Eevee: SSS: Add Christensen-Burley diffusion profile.
This seems to be a correct implementation of the same diffusion profile as Cycles uses by default.

There are a few bias though:
- We consider _A_ the albedo to be 1 when evaluating _s_.
- We use a factor of 0.6 when computing _d_ to match more or less cycles results.

Note that doing per pixel jittering does bias the result even further (loss of energy).
2017-11-16 21:30:15 +01:00
88c88c4610 Fix T51210: Draw Manager: Support for Metaball Drawing
Differential Revision: D2914
2017-11-16 15:12:32 -02:00
562da211c2 Merge branch 'master' into blender2.8 2017-11-16 12:50:53 +01:00
d697e3d46e BLI listbase: add bytes finding helpers.
Quite similar to string ones actually, except more generic. Used in
id_override_static branch currently.
2017-11-16 12:49:31 +01:00
470b4cb62f Cycles: Fix crash with split branched path tracing
ShaderData memory was getting clobbered in the branched path code paths.

Was caused by 087331c495
2017-11-16 04:59:31 -05:00
ae8130e287 Merge branch 'master' into blender2.8 2017-11-15 23:17:25 +11:00
9c7b89241d BLI_utildefines: sync w/ 2.8 2017-11-15 23:06:34 +11:00
474362b363 Cleanup: use 'uint' 2017-11-15 22:58:39 +11:00
Dalai Felinto
26a72f0852 Cycles: Fix after recent merge from master
random_id() crashes when there is no current dupli object.

We could also throw a Python error when doing it via RNA, but as far as
Cycles is concerned we need to check if instanced.
2017-11-15 09:53:16 -02:00
9cbf374814 GSet: utils to access data stored outside the set 2017-11-15 22:45:37 +11:00
2a7f8d3cb3 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenlib/BLI_math_matrix.h
	source/blender/blenlib/intern/math_matrix.c
	source/blender/blenlib/intern/rand.c
	source/blender/editors/animation/anim_channels_edit.c
	source/blender/makesrna/intern/rna_mask.c
2017-11-15 10:46:19 +01:00
Dalai Felinto
44517c5f21 Merge commit '212a8d9e5ae7' into blender2.8
Considerable non-trivial merge conflict fixes.
2017-11-15 07:40:27 -02:00
Dalai Felinto
258292abc0 Merge commit '212a8d9e5ae7^' into blender2.8 2017-11-15 07:07:27 -02:00
556b13f03e Fix T53309: Remove default 'Clear loc/rot/scale delta transform' shortcuts.
The loc one (shift-alt-G) was same as 'remove selected from active group'
action... Clear delta transform is not a common operation, so we can
live without a default shortcut for it.

Note that using same key (G) in same space for two completely different
kind of operations is probably a rather bad thing, nice topic for future
keymap work. ;)

Probably nice to have in 2.79a.
2017-11-14 22:51:44 +01:00
Dalai Felinto
7549b10212 Cleanup: order from a-z structs in BKE_collection.h and BKE_layer.h 2017-11-14 18:41:20 -02:00
3546636870 Eevee: SSS: Fix SSS with Add Shader node. 2017-11-14 21:34:20 +01:00
e70c563aa3 Eevee: Add SSS objects to probe rendering.
This does NOT do the SSS diffusion when rendering probe but at least you can see your object without SSS in reflections / bounce light.
2017-11-14 21:13:38 +01:00
bc648af4e1 Fix Opengl Error with glBlitFramebuffer
This was caused by 93936b8643

From GL spec :
GL_INVALID_OPERATION is generated if mask contains GL_DEPTH_BUFFER_BIT or GL_STENCIL_BUFFER_BIT and the source and destination depth and stencil formats do not match.

So blitting framebuffer with depth or stencil require the SAME FORMAT.
2017-11-14 20:49:33 +01:00
67ddc28055 Smoke: Pass non-trivial arguments by const reference 2017-11-14 17:11:48 +01:00
2868dcbe2b Fix compilation error with clang-5 2017-11-14 17:11:48 +01:00
6f15554af3 Alembic: Fix mismatch in forward declaration with definition 2017-11-14 17:11:48 +01:00
0a3fa9c25c Fix missing SpinLock typedef on macOS 2017-11-14 16:51:34 +02:00
f23a595228 Add stdlib include for utildefines
Ideally we could just declare abort, but this has attributes
based on the platform, so include stdlib instead.
2017-11-14 23:38:53 +11:00
55696b56d9 Fix T53068: AMD Threadripper not working well with Blender
The issue was caused by SpinLock implementation in old pthreads we ar eusing on
Windows. Using newer one (2.10-rc) demonstrates same exact behavior. But likely
using own atomics and memory barrier based implementation solves the issue.

A bit annoying that we need to change such a core part of Blender just to make
specific CPU happy, but it's better to have artists happy on all computers.

There is no expected downsides of this change, but it is so called "works for
me" category. Let's see how it all goes.
2017-11-14 12:21:15 +01:00
7adc698eed Cleanup: order BLI before BKE headers
This was done nearly everywhere already
2017-11-14 17:23:40 +11:00
b5eeec715e Cleanup: remove BLI_blenlib from ghash header
This causes source files to depend on ghash header
for BLI_string/rect/listbase.

Also quiet warnings.
2017-11-14 17:08:34 +11:00
40ad1cf0b1 BLI: sync changes from 2.8 2017-11-14 16:10:48 +11:00
212a8d9e5a Cycles: Make per-object random value output also work for Lamps 2017-11-14 04:17:54 +01:00
d8066fb0f1 Cycles: Refactor closure roughness detection to fix a potential bug with Denoising of specular shaders 2017-11-14 04:17:54 +01:00
289f9f42ff Eevee: SSS: Add Quality settings.
Samples : pretty self explanatory.
Jitter Threshold : Reduce cache misses and improve performance (greatly) by lowering this value. This settings let user decide how many samples should be jittered (rotated) to reduce banding artifacts.
2017-11-14 02:17:34 +01:00
f8b1430566 Eevee: Initial Separable Subsurface Scattering implementation.
How to use:
- Enable subsurface scattering in the render options.
- Add Subsurface BSDF to your shader.
- Check "Screen Space Subsurface Scattering" in the material panel options.

This initial implementation has a few limitations:
- only supports gaussian SSS.
- Does not support principled shader.
- The radius parameters is baked down to a number of samples and then put into an UBO. This means the radius input socket cannot be used. You need to tweak the default vector directly.
- The "texture blur" is considered as always set to 1
2017-11-14 00:49:54 +01:00
89e9f6ea79 DRW: Better stencil support.
A stencil mask is now assigned to each shading group and the stencil test is defined like the depth test via the DRW_STATE_* defines.
2017-11-13 23:33:06 +01:00
93936b8643 GPUTexture: Add for stencil to default depth buffers.
Theses will be used by eevee SSS.

TODO: only allocate stencil if needed.
2017-11-13 23:25:46 +01:00
ab013224ad GPUMaterial : Add sss_data to Closure struct. 2017-11-13 22:09:12 +01:00
Dalai Felinto
f4beb64020 Fix quick smoke getting view_render from the wrong place 2017-11-13 14:15:36 -02:00
Dalai Felinto
f402638211 Cleanup on depsgraph logic 2017-11-13 12:17:14 -02:00
Dalai Felinto
1cb6cea71c Merge remote-tracking branch 'origin/master' into blender2.8 2017-11-13 11:48:48 -02:00
8a03e4d409 Depsgraph: Fix relations for metaballs
Initially spotted and investigated by Dalai and Germano.
2017-11-13 14:43:08 +01:00
d1a761c4d4 Cycles: Fix compilation error of standalone application 2017-11-13 10:49:05 +01:00
42dff6cc2e Cycles: Fix compilation error with OIIO compiled against system PugiXML 2017-11-13 10:42:29 +01:00
e568c1a975 Fix T53289: CUDA missing textures not showing pink, after recent changes. 2017-11-12 20:45:47 +01:00
ebcb880375 Fix T53273: render bake settings properties not showing correct Python path. 2017-11-12 20:30:28 +01:00
5b3c15e336 Fix T53294: bpy.ops.image.open crash 2017-11-12 16:05:28 +11:00
aae8e21100 BMesh Py API: Expose color alpha 2017-11-12 15:48:24 +11:00
f30a2a7862 GPUFramebuffer: Add possibility to blit stencil buffer. 2017-11-11 16:23:55 +01:00
e389ae9dca Cycles: Set error if a split kernel fails to load
To help catch cases where adding a new kernel is missed for one of the
device implementations.
2017-11-11 01:01:14 -05:00
0260fad9ba Manipulator: ruler tool
Add the 3D view ruler as a tool,
the modal operator remains for now
however it may be removed if we use the tool-system for 2.8.

Note that this does copy code from the operator,
its different enough not to attempt to de-duplicate.
2017-11-11 03:27:21 +11:00
63830cd6a9 Manipulator: public highlight utility function
Also utility to find group from a manipulator map.
2017-11-11 03:19:51 +11:00
1bd8a82960 Fix assert failure when trying to draw empty string 2017-11-10 16:29:57 +01:00
8f5e7c3fa9 Merge branch 'master' into blender2.8 2017-11-10 13:02:49 -02:00
Dalai Felinto
58a3057099 Layers Unittest: Hidden flag to quckly update diffs
This is not the commit you are looking for ...

This is not to be used lightly. But sometimes we change the name of the collections,
the initial value they have, ... and this helps to quickly update the tests.
2017-11-10 13:01:05 -02:00
d95eabf0a9 mball_tessellate: Simplify face creation
Faces that have the last two indices equal are considered triangles, and not those that the last index is 0
Improvement of 7% in performance of the `polygonize` function
2017-11-10 12:58:34 -02:00
Dalai Felinto
1122a401b0 Unittest: Layers - include is_disabled for LayerCollection
And remove is_folder since it is not being used.
2017-11-10 12:39:43 -02:00
Dalai Felinto
34c99ee85b Fixup for doversion/layers: disable collections for scene layers 2017-11-10 11:27:30 -02:00
Dalai Felinto
2ec01cc7c5 Layers doversion: Handle hide and hide_render objects
We now created nested collections for the original Collection 1, 2 ...
collections for the "hide" and "hide_render" objects.

Also, remove logic for rename single-collection files, it's now kept as
it was originally (Collection 1, Collection 5, ...).

Thanks Sergey Sharybin and Pablo Vazquez for patch review and suggestions.
2017-11-10 10:37:23 -02:00
7922b62519 Workaround crash rendering font objects
Needs a proper scene layer and dependency graph, which we do not have
yet during render pipeline.
2017-11-10 11:09:10 +01:00
1737887938 Merge branch 'master' into blender2.8 2017-11-10 10:36:46 +01:00
7a6ad2901c Merge branch 'master' into blender2.8 2017-11-10 10:13:19 +01:00
db7a78a2be Cycles: Fix compilation error with latest OIIO
There was some changes about namespaces, which causes ambiguities.

Replaces using namespace with an explicit symbols we need. Is good idea to NOT
pull in the whole namespace anyway!
2017-11-10 10:04:33 +01:00
a466d7ae24 Cycles: better distance sampling for chromatic volume extinction.
Previously we picked one of the RGB channels with equal probability, but this
works poorly in a dense volume after many bounces. Now we take into account
the throughput and single scattering albedo.

This makes it a little more practical to do brute force SSS with volumes, but
is still very inefficient because we do direct light sampling at every volume
bounce even when inside an opaque mesh. In theory there could be a light inside
the mesh so we can't automatically disable direct lighting.
2017-11-10 01:37:10 +01:00
21a535840d Fix T53270: crash with multiscatter GGX after recent refactoring.
In fact this was an existing issue when exceeding the number of available
closure, but it's more common now that we set the number to 0 for shadows
and emission
2017-11-09 20:28:00 +01:00
1ffa01b6f8 Fix (harmless) valgrind warning. 2017-11-09 20:28:00 +01:00
bd4bea3e98 Cycles: avoid reallocating tile denoising memory many times during render. 2017-11-09 20:28:00 +01:00
Dalai Felinto
7defb27f08 Farewell BaseLegacy
Finally, bases are all using the latest, newest SceneLayer bases.
2017-11-09 15:45:19 -02:00
Dalai Felinto
06a7db85bc BGE cleanup: remove Base from KX_Light.h 2017-11-09 15:45:19 -02:00
3dde21f97e Depsgraph: Fix broken copy-on-write draw after ownership changes
Need to build layer collections callbacks using proper CoW pointer.
2017-11-09 16:42:54 +01:00
Dalai Felinto
cec7f1215a Rename Scene macros back to their original _NEW less names 2017-11-09 13:35:46 -02:00
Dalai Felinto
c35f1d05ea Farewell Scene->basact 2017-11-09 13:23:41 -02:00
09d26cab0b Cleanup: Use full name for scene_layer in alembic 2017-11-09 15:45:21 +01:00
a956e7399a Cleanup: Use full name for scene_layer in blenloader 2017-11-09 15:45:21 +01:00
a6951df836 Cleanup: Use full name for scene_layer in depsgraph 2017-11-09 15:45:21 +01:00
240b8b9679 Cleanup: Use full name for scene_layer in draw 2017-11-09 15:45:21 +01:00
acd811278e Cleanup: Use full name for scene_layer in gpu 2017-11-09 15:45:21 +01:00
2466afd089 Cleanup: Use full name for scene_layer in makesrna 2017-11-09 15:45:21 +01:00
859417c657 Cleanup: Use full name for scene_layer in nodes 2017-11-09 15:45:21 +01:00
f7398bc0f3 Cleanup: Use full name for scene_layer in python 2017-11-09 15:45:21 +01:00
e5081a0dae Cleanup: Use full name for scene_layer in render 2017-11-09 15:45:21 +01:00
bd6ab7dd6c Cleanup: Use full name for scene_layer in windowmanager 2017-11-09 15:45:21 +01:00
Julian Eisel
98fc7f6b53 Remove unused screen-name storage in window
Checked in really old revisions, seems like this was never used. So
doesn't matter for compatibility either (tested opening files saved with
this in 2.49).
2017-11-09 15:11:57 +01:00
Julian Eisel
fadbb2fde8 Fix crash using pre 2.5 file as startup.blend 2017-11-09 15:11:57 +01:00
Julian Eisel
5839c73a54 Cleanup: Refactor window matching after file read for readability
Code should hopefully be much clearer now.

Also removing code that's been commented out for a while, and was never
executed in master.
2017-11-09 15:11:57 +01:00
Stefan Werner
df886b178c Moved alignment attributes from my last commit to BLI_compiler_attrs.h for future use. 2017-11-09 14:59:31 +01:00
Dalai Felinto
f8a0754439 Object.layers no longer around, removing from ui 2017-11-09 11:53:18 -02:00
Stefan Werner
83d9f8e379 Compositor: Ensured 16 byte alignment for variables accessed by SSE instructions.
Before this patch, the XBlur/YBlur compositor nodes would crash for me when run in a MSVC 2015 debug build (test scene: BMW27_cpu). I added the compiler instructions to explicitly align the local variables that the SSE instructions are accessing.
2017-11-09 14:38:17 +01:00
92020077e6 Depsgraph: Pass CoW pointer to ID datablocks evaluation functions
The only remaining part is the particle stuff, which needs a pointer to exact
particle system which does not exist yet. Leaving it for later a bit for until
it's more clear what do we do with particles.

Unless i'm mistaken, we've got all proper CoW pointers bound now.
2017-11-09 13:56:43 +01:00
ec0e35f178 Depsgraph: Cleanup, make it more clear what layer is 2017-11-09 11:52:13 +01:00
e30972deae Depsgraph: Cleanup 2017-11-09 11:43:41 +01:00
0ad54b5ba3 Depsgraph: Only build collections for current graph scene layer 2017-11-09 11:43:41 +01:00
Dalai Felinto
08a023d7ca Cycles: Silence warning when building without OSL 2017-11-09 08:39:30 -02:00
Dalai Felinto
f30086b5b6 Merge branch 'master' into blender2.8 2017-11-09 08:32:20 -02:00
Dalai Felinto
ee49ee24c3 Fix: unselectable objects can be selected via the NLA editor
This is not reported anywhere, but it's easy to reproduce. I ran into this
while updating this code for the blender2.8 branch.
2017-11-09 08:27:38 -02:00
f2b4a59be6 Depsgraph: Cleanup, no explicit usage of std in code
Code is supposed to be pure-C-ish with some C++-ism. All specifics are to be
handled in header files.
2017-11-09 11:24:51 +01:00
d325e6f0e8 Depsgraph: Make dependency graph to be built from scene layer
This is a final step of having proper ownership. Now selecting different
layers in the "top bar" will actually do what this is expected to do.

Surely, there are still things to be done under the hood, that will happen
in a less intrusive way.
2017-11-09 11:20:17 +01:00
Dalai Felinto
92b342d30d Fix logic for pinning textures users from context
This was wrong since it's concenption in 28ee0f9218.
The if statement was returning true when pinid was NULL, and false otherwise.

However when scene is pinned we also want to run this code.
Code snippet by Brecht Van Lommel.
2017-11-09 08:19:52 -02:00
c99481b632 Merge branch 'master' into blender2.8 2017-11-09 10:59:15 +01:00
8d7ec519df Depsgraph: Add missing handlers of node IDs
Worst thing was that point density did not pull object into dependency graph,
which could lead to wrong render results.
2017-11-09 10:33:44 +01:00
5e38ee996c Depsgraph: Remove chains of scene being passed all over in relations builder 2017-11-09 10:33:44 +01:00
f424d5b5c9 Depsgraph: Cleanup, remove scene being passed all over
Use the state one instead.
2017-11-09 10:33:44 +01:00
ad986ae29e Depsgraph: Remove bmain from internal builder API
Use the one from state.
2017-11-09 10:33:44 +01:00
887c2e5c0d Depsgraph: Make bmain part of builder state and remove bmain from public API 2017-11-09 10:33:44 +01:00
70e34ac186 Depsgraph: Cleanup, use google style for private members 2017-11-09 10:33:44 +01:00
9f0842bbe8 Depsgraph: Synchronize nodes and relations builders 2017-11-09 10:33:44 +01:00
1018683def Depsgraph: Fix wrong ID type being compared 2017-11-09 10:33:44 +01:00
98425563ed Depsgraph: Cleanup, reduce indentation level 2017-11-09 10:33:43 +01:00
449687d50a Depsgraph: Assert when node uses unhandled ID type 2017-11-09 10:33:43 +01:00
087331c495 Cycles: Replace __MAX_CLOSURE__ build option with runtime integrator variable
Goal is to reduce OpenCL kernel recompilations.

Currently viewport renders are still set to use 64 closures as this seems to
be faster and we don't want to cause a performance regression there. Needs
to be investigated.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2775
2017-11-09 01:04:06 -05:00
Julian Eisel
ffe76ae9f4 Fix crash when loading pre 2.5 files.
Versioning code involving WM wouldn't run then (WM was just introduced
in 2.5).
2017-11-08 23:54:36 +01:00
Dalai Felinto
206c94fea9 Farewell Scene->base
While getting rid of Scene->base we got the following fixes:

* Fix "Convert To" operator
* Fix "NLA allowing to selected objects that are not selectable
* Fix scene.objects (readonly, no option to link/unlink)

Note: Collada needs to use the context SceneLayer for adding objects
however I added a placeholder, so Collada maintainers can fix this
properly.
2017-11-08 18:39:01 -02:00
Dalai Felinto
670e6cab43 Revert "Depsgraph: Fix crash with copy on write when scene has legacy bases"
This reverts commit 00ddbd5848.
2017-11-08 18:36:01 -02:00
Dalai Felinto
3ceb3512f8 Merge remote-tracking branch 'origin/master' into blender2.8 2017-11-08 18:35:31 -02:00
Dalai Felinto
6febe6e725 Silence warning from Collada 2017-11-08 18:33:17 -02:00
2a1e828711 Depsgraph: Use iterator over flat array for depsgraph_query
This way iteration order is much more predictable. This also solves issue with
randomly failing Cycles regression tests.
2017-11-08 15:07:31 +01:00
19c14f0c8a Subject: [PATCH 2/3] Depsgraph: Replace iteration over ghash with iteration over flat array 2017-11-08 15:02:19 +01:00
10f076da2d Depsgraph: Introduce flat list of ID nodes
The idea is to allow iterating over ID nodes in exact order of their
construction, and in order which will not change dependent on memory
pointers or anything.
2017-11-08 15:02:19 +01:00
5c66bbc56f Depsgraph: Remove traces of old single-per-scene dependency graph 2017-11-08 15:02:19 +01:00
20988ed5dc Depsgraph: Move storage from single per-scene depsgraph to a hash storage
Depsgraph itself is still created fer the whole scene rather than for a
single layer, this is to be addressed next.

The storage for those dependency graphs is in scene, but now it is a hash
indexed by layer. In the future we can extend hash key to include extra
information (workspace? window?).
2017-11-08 15:02:19 +01:00
Dalai Felinto
3750dfaa0a Partial Fix T53269: Dupli-verts/dupli-faces not working
This fixes the issue for the Draw Manager, but for Cycles this is still not
working. The iterator bpy.context.depsgraph.duplis seems to be correct though.
2017-11-08 10:49:39 -02:00
5fc1faa737 I18n: add Hausa languages, since we now have a few messages translated. ;) 2017-11-08 10:11:37 +01:00
da4bfb8770 Merge branch 'master' into blender2.8 2017-11-08 01:11:43 +01:00
3f614cda12 Fix blender player build. 2017-11-08 01:11:17 +01:00
7b1d707481 Merge branch 'master' into blender2.8 2017-11-08 00:20:59 +01:00
a0478ebe37 Fix incorrect bevel shader in GLSL (should work as if there is no bevel node). 2017-11-08 00:19:24 +01:00
05b08a3b6d Fix T53092: errors reading EXR files with different data/display window.
Multilayer/multiview OpenEXRs did not read the full data window like single
layer, now it should be consistent.
2017-11-07 23:20:22 +01:00
2a097527f2 Fix various issues with (multiview) OpenEXR file save/load.
* Fix saving a multiview render from the image editor giving invalid files.
* Fix failure to load multiview images with a single view per part.
* Fix loss of multiview metadata when saving/loading a single view.
* Fix Z-Buffer writing option for single layer EXR not being respected.

Multiview EXRs are now always handled as multilayer internally, significantly
reducing the amount of code.

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D2887
2017-11-07 23:20:22 +01:00
ed7260071b Fix EXR multilayer compositing result saving issues.
* It was saved as Combined.Combined instead of Composite.Combined.
* It was written even if no compositing was enabled.
2017-11-07 22:35:12 +01:00
e0936e74ab Fix image editor showing pass name when there is only a combined pass. 2017-11-07 22:35:12 +01:00
3dec1de275 Fix incorrect color management when saving JPG previews for EXR. 2017-11-07 22:35:12 +01:00
26f39e6359 Cycles: add bevel shader, for raytrace based rounded edges.
The algorithm averages normals from nearby surfaces. It uses the same
sampling strategy as BSSRDFs, casting rays along the normal and two
orthogonal axes, and combining the samples with MIS.

The main concern here is that we are introducing raytracing inside
shader evaluation, which could be quite bad for GPU performance and
stack memory usage. In practice it doesn't seem so bad though.

Note that using this feature can easily slow down renders 20%, and
that if you care about performance then it's better to use a bevel
modifier. Mainly this is useful for baking, and for cases where the
mesh topology makes it difficult for the bevel modifier to work well.

Differential Revision: https://developer.blender.org/D2803
2017-11-07 22:35:12 +01:00
f79f386731 Code refactor: rename subsurface to local traversal, for reuse. 2017-11-07 22:35:12 +01:00
d0af56fe3b Cycles: antialias normal baking if the mesh has a bump map. 2017-11-07 22:35:12 +01:00
ff34e48911 Cycles: add an extra CUDA synchronize before rendering.
It should not be needed as far as I know, but just in case it fixes any
of the recent issues like T52572.
2017-11-07 22:35:12 +01:00
e74b229342 Fix incorrect MIS weights in Cycles with multiple lights.
This causes some difference in the classroom scene, where ray visibility
tricks are used and break the MIS balance. Otherwise there doesn't seem
to be much effect, but better to use the right formulas. Problem originally
identified by Lukas.
2017-11-07 22:35:12 +01:00
Dalai Felinto
1b18e15802 Sanitize use of BLI_iterator
We now initialize iter.valid as true as part of the main iterator (and manually
when using via Python). And we don't even bother setting iter->current to NULL
if it's invalid. Let's stick to using iter->valid only.
2017-11-07 14:08:34 -02:00
fc789803ca Depsgraph: Remove old unused function which is no longer to be used 2017-11-07 16:54:56 +01:00
16fcf9dfbf Depsgraph: Get away from legacy API used in event loop
A bit tricky for now, needs some clear design about when to do
on_visible_changed().
2017-11-07 16:51:47 +01:00
52e529b82d Depsgraph: initialize scene to NULL 2017-11-07 16:42:40 +01:00
ba1197fe5e Depsgraph: Simplify some workarounds and make API closer to final 2017-11-07 16:36:25 +01:00
5f2be40658 Windows: Add additional crash diagnostic information.
To help diagnose issues like T53259, it is useful to know the module causing the issue (is it us, or some opengl icd, or python module?) and while we cannot do stackdumps on release builds on windows, it is possible to display the faulting module. This commit changes the exception handler to output the following information:

Error   : EXCEPTION_ACCESS_VIOLATION (Type of exception , this we had before)
Address : 0x0000000140193726 (Address of the exception, new)
Module  : k:\BlenderGit\build_windows_Full_noge_x64_vc15_Release\bin\Release\blender.exe (module of the exception, new)
2017-11-07 07:57:59 -07:00
Dalai Felinto
f16199d479 Fix jumps-dependent-on-uninitialized-variable for iterators
We cannot have iter->valid unitialized, but we need to be sure it is set to true on begin.
Bug found by Sergey Sharybin.
2017-11-07 12:50:42 -02:00
98ed20aafd Fix bplayer (c). 2017-11-07 15:35:36 +01:00
3cfbdc2bb4 Merge branch 'master' into blender2.8 2017-11-07 13:57:16 +01:00
1a1fb5a47c Cycles: Cleanup, style 2017-11-07 13:55:58 +01:00
Dalai Felinto
c83b171794 Depsgraph Iterator: Refactor skip logic
This was leading to crashes on Cycles as well as misleading
len(bpy.context.depsgraph.objects)

I can even move the iter->skip as part of DEGObjectsIteratorData instead of
BLI_Iterator, but if I do it will be a separate commit.

Thanks Sergey Sharibyn for the well done sample file and patch suggestion.
2017-11-07 10:05:42 -02:00
c0d01adc44 Depsgraph: Remove forced dependencies update/evaluation from file open
This was originally done as a fix for T37713, but now this workaround becomes
tricky since we don't know which layers to update scene for. Even more, render
engine is supposed to have own dependency graphs amd those ones do not exist
yet at the file open time.

Keep an eye on T37713, since that's where the original workaround is coming
from.
2017-11-07 11:37:45 +01:00
383a763203 Depsgraph: Fix/workaround command line rendering of sequencer
Really hacky, but allows to run regression tests and see if the new design
is working as expected.
2017-11-07 11:37:45 +01:00
60bf1c05e5 Depsgraph: Fix/workaround crash when rendering from command line
Need to ensure Render has proper dependency graph.

While this is a subject of re-design (render pipeline should manage all
dependency graphs it needs, and not demand external users to provide
depsgraph), this is good to have something working, so we can run regression
tests and such.
2017-11-07 11:37:45 +01:00
2440415bd3 Merge branch 'master' into blender2.8 2017-11-07 03:08:24 +01:00
0e3fd70d7a Fix T53129: Cycles missing update when changing image auto refresh.
Previously auto refresh worked, but only if it was already enabled before
starting the viewport render.
2017-11-07 03:05:42 +01:00
Dalai Felinto
83de7c4094 Fix break on duplicated instances since IDNodes depsgraph iterator 2017-11-06 21:18:58 -02:00
956ee5e265 macOS: remove old OpenMP lib stuff from cmake 2017-11-06 23:54:35 +02:00
Dalai Felinto
535adcdaa3 Depsgraph: Iterates over ID Nodes instead of Bases
Although this works by itself, it should actually happen after:

"Reshuffle collections base flags evaluation, make it so object is gathering
its base flags from collections."

Meanwhile we have one single hacky function (deg_flush_base_flags_and_settings)
to be removed once the task above is tackled.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2899
2017-11-06 17:51:16 -02:00
facdc15fdd DRW: Fix compilation error. 2017-11-06 18:41:00 +01:00
91af8f2ae2 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/device/device.cpp
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/material.c
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/space_outliner/outliner_edit.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/util/ed_util.c
	source/blender/windowmanager/intern/wm_files_link.c
2017-11-06 18:02:46 +01:00
9d77b5d591 Eevee: Remove uses of DRW_shgroup_call_dynamic_add_empty in shadows and probe rendering.
This was adding an unecessary high number of DRWCall per objects.
2017-11-06 17:43:14 +01:00
ed555750eb DRW: Use pseudo persistent memory pool for the rendering data structure.
This gets rid of the bottleneck of allocation / free of thousands of elements every frame.

Cache time (Eevee) (test scene is default file with cube duplicated 3241 times)
pre-patch: 23ms
post-patch: 14ms
2017-11-06 17:43:14 +01:00
66a6d160fe Rename ID_IS_LINKED_DATABLOCK to ID_IS_LINKED.
This makes code closer to id_override/assent-engine ones, which
introduce a new type of linked data, and hence reserve
ID_IS_LINKED_DATABLOCK to real linked datablocks.
2017-11-06 17:17:10 +01:00
5d70e847dd Fix T51604: Support Auto-Smooth in Edit-Mesh
and allocate loop_normals in MeshRenderData instead of CustomData

Differential Revision: D2907
2017-11-06 14:14:07 -02:00
b28da9dbf8 Fix T53250: Crash when linking/appending a scene to a blend when another linked scene in this blend is currently open/active.
Inner DAG code would not check against NULL pointer, and in case of an
active linked scene, scene pointer will be NULL here, so we have to
check it ourself. ;)
2017-11-06 15:16:40 +01:00
7082bd1f4c Depsgraph: Cleanup, remove obsolete unused function 2017-11-06 09:24:24 +01:00
f5964e6429 epsgraph: Use explicit graph API for sequencer 2017-11-06 09:24:24 +01:00
ad557da78a Depsgraph: Use explicit graph API for point cache 2017-11-06 09:24:24 +01:00
90738e1441 Depsgraph: Use explicit graph API for audio bake 2017-11-06 09:24:24 +01:00
d0e9352d32 Depsgraph: Use explicit graph API for OpenGL render 2017-11-06 09:24:24 +01:00
bb3024ef12 Depsgraph: Use new API for alembic C-API 2017-11-06 09:24:24 +01:00
45773c1a0a Update comment, reference new API function 2017-11-06 09:24:24 +01:00
031f4ce8a6 Depsgraph: Use new scene update API in preview render 2017-11-06 09:24:23 +01:00
5af1c89269 Depsgraph: Make graph to be per-scene-layer for RNA
New access is C.scene.render_layers.active.depsgraph. This will give depsgraph
for a given layer. In the future there will need to be some extra context to be
passed.
2017-11-06 09:24:23 +01:00
dd79cd189b Depsgraph: Cleanup, remove depgraph_legacy from evaluation routines 2017-11-06 09:24:23 +01:00
1b40243316 Depsgraph: Cleanup, remove depsgraph_legacy from building routines 2017-11-06 09:24:23 +01:00
3330e518dc Depsgraph: Cleanup, remove unused function 2017-11-06 09:24:23 +01:00
17395b6b08 Depsgraph: Cleanup, remove depsgraph_legacy from depsgraph_tag.cc 2017-11-06 09:24:23 +01:00
f867a560d9 Depsgraph: Avoid non-requested allocation of depsgraph 2017-11-06 09:24:23 +01:00
8a72be7697 Cycles: reduce closure memory usage for emission/shadow shader data.
With a Titan Xp, reduces path trace local memory from 1092MB to 840MB.
Benchmark performance was within 1% with both RX 480 and Titan Xp.

Original patch was implemented by Sergey.

Differential Revision: https://developer.blender.org/D2249
2017-11-05 20:48:33 +01:00
c571be4e05 Code refactor: sum transparent and absorption weights outside closures. 2017-11-05 18:13:44 +01:00
2c02a04c46 Code refactor: remove emission and background closures, sum directly. 2017-11-05 18:13:44 +01:00
cac3d4d166 Cycles: fix inefficient attribute map storage, saves 615MB in victor scene. 2017-11-05 18:00:48 +01:00
5801ef71e4 Code refactor: device memory cleanups, preparing for mapped host memory. 2017-11-05 15:22:04 +01:00
5475314f49 Cycles: reserve CUDA local memory ahead of time.
This way we can log the amount of memory used, and it will be important
for host mapped memory support.
2017-11-05 15:22:04 +01:00
58dc114615 Merge branch 'master' into blender2.8 2017-11-06 00:12:28 +11:00
18d7fbe4f5 Cleanup: order buffer length after the buffer 2017-11-06 00:04:46 +11:00
2837a7e198 Cleanup: remove paranoid NULL check 2017-11-05 23:34:40 +11:00
914e3b1645 Cleanup: indentation, line wrapping 2017-11-05 14:50:15 +11:00
43f3cfd584 Cleanup: spelling 2017-11-05 14:33:18 +11:00
d2ea1b2dcd Fix broken macOS build with libsndfile, name is different than in master. 2017-11-04 17:50:09 +01:00
642c1cabe5 Tool System: Don't add duplicate keymap items 2017-11-05 01:38:51 +11:00
fbfda21fe4 UI: show tool-tips for each tools shortcuts 2017-11-05 01:29:52 +11:00
d4fe083b35 Merge branch 'master' into blender2.8 2017-11-04 21:45:52 +11:00
01a3c95609 UI: tool-tip refactor, don't hard code field types
Allow other kinds of tips be created w/o exceeding hard limits.
2017-11-04 21:15:18 +11:00
25f56d7a7b UI: correct flag re-use
Adding ability to show a button as pressed w/o UI_SELECT set caused
other flags to be cleared that shouldn't have been.
2017-11-04 14:13:04 +11:00
33b5e8daff Code refactor: replace CUDA array with linear memory for 1D and 2D textures.
This is a prequisite for getting host memory allocation to work. There appears
to be no support for 3D textures using host memory. The original version of
this code was written by Stefan Werner for D2056.
2017-11-04 02:23:00 +01:00
6ec599c682 Fix T53247: mixed CPU + GPU render wrong texture limits. 2017-11-03 20:32:29 +01:00
10024603ee Scene API: Switch to explicit scene graph update API
This is part of lets-get-rid-of-scene->legacy_depsgraph work
2017-11-03 16:35:12 +01:00
c4501ccb17 Merge branch 'master' into blender2.8 2017-11-03 16:31:53 +01:00
6664ee209e Scene RNA API: More global mains goes away 2017-11-03 16:28:37 +01:00
0c4f69a2bf Merge branch 'master' into blender2.8 2017-11-03 16:17:01 +01:00
f1c78ecc63 Scene RNA API: Main from globals goes away
Bye bye..
2017-11-03 16:15:49 +01:00
f24103d50a Depsgraph: Use explicit depsgraph in object add 2017-11-03 15:46:12 +01:00
0ba0993f18 Depsgraph: Port more areas to direct depsgraph API
This is a lots of changes, but they are boiling down to a simple API
changes where we are no longer relying on implicit usage of scene's
depsgraph and pass depsgraph explicitly.

There should be no user measurable difference, render_layer* tests
are also passing.
2017-11-03 14:36:49 +01:00
95ccaed9e6 Depsgraph: Use explicit graph API in transform code 2017-11-03 14:05:49 +01:00
57ec215677 Depsgraph: Add utility function to tag ID for update within a specific graph 2017-11-03 12:10:04 +01:00
e72dfee66f Depsgraph: Use explicit depsgraph in alembic module 2017-11-03 12:02:39 +01:00
3a7a7ed03b Merge branch 'master' into blender2.8 2017-11-03 21:22:27 +11:00
cd4f925f56 Merge branch 'master' into blender2.8 2017-11-03 20:59:15 +11:00
2a87bd8995 Cleanup: split interface_regions.c
Each region type is quite separate and file was getting too big.
2017-11-03 20:57:09 +11:00
d19d094ca9 Fix incorrect allocation size 2017-11-03 20:52:04 +11:00
4c53f2000f Cleanup: move tool-bar checks into functions
Also support separator in tool-bar sub-menus
2017-11-03 16:30:51 +11:00
fbb9b70484 Fix Blenderplayer (tm) 2017-11-03 00:39:50 +01:00
1555cf758f Freestyle: Fix access freed memory when freeing fresstyle bmain
Some of the uninitializaiton code was leaving bases pointing freed memory.
2017-11-02 17:58:59 +01:00
e0a6582b40 Fix iterator usage from C++ code
Old code was not supported by GCC, see some details and progress

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606
2017-11-02 17:58:59 +01:00
d967a83f49 Freestyle: Keep lines on manageable complexity
Two level;s of casts in a single line, c'mon.
2017-11-02 17:58:59 +01:00
50c129760d Fix Cycles showing empty tiles while they are being denoised. 2017-11-02 15:23:55 +01:00
c1da6c9d7d Merge branch 'master' into blender2.8 2017-11-03 01:16:10 +11:00
25f2abf314 Cleanup: minor comment correction 2017-11-03 01:10:03 +11:00
9ece0ee5fe UI: add UI_SELECT_DRAW flag
Allow to draw as pressed w/o interfering with behavior.

Resolves issue where buttons raised on mouse-over.
2017-11-03 00:47:51 +11:00
f7d59fbc46 Merge branch 'master' into blender2.8
# Conflicts:
#	tests/gtests/alembic/abc_export_test.cc
2017-11-02 14:37:10 +01:00
8a3728800c Alembic: not using global in unit test.
Thanks @sergey for pointing out this fix.
2017-11-02 14:33:21 +01:00
7eb4ef6cac Merge branch 'master' into blender2.8 2017-11-03 00:31:47 +11:00
ff97dcebf3 Fix T53182: cancelling save buffers + denoising render clears image. 2017-11-02 14:31:05 +01:00
6355d98267 UI: free up bit in uiBut.flag 2017-11-03 00:27:29 +11:00
90788adb66 UI: workaround glitch refreshing the toolbar 2017-11-02 23:52:03 +11:00
75490adaff UI: draw operator menus below buttons
Following the down arrow on the buttons
2017-11-02 23:43:51 +11:00
920d09696e UI: store tool index of non-active tools 2017-11-02 23:30:01 +11:00
5cb8730689 Cycles: Add another limit to OpenCL memory usage
Some drivers may report very large allocation sizes, which could cause
unnecessary memory usage. This is now limited to 2gb which should
still be enough to get the needed performance benefits without waste.
2017-11-02 08:14:21 -04:00
1ca3e1a91d UI: support nested tools in toolbar 2017-11-02 23:05:13 +11:00
be5123a0a9 Space clip: Make it more clear that filter track does not use any settings from tool shelf 2017-11-02 12:33:39 +01:00
08141260ff Merge branch 'master' into blender2.8 2017-11-02 18:25:47 +11:00
e32c1bd5d0 UI: use button_operator in operator_menu_hold
Move draw calls into UI_menutype_draw
2017-11-02 18:21:59 +11:00
d2e39edae8 UI: draw active tool pushed in 2017-11-02 15:52:16 +11:00
4a85089abe Merge branch 'master' into blender2.8 2017-11-02 15:45:19 +11:00
765e28948e Cleanup: code style 2017-11-02 15:09:11 +11:00
8bdc391c54 Implement a new automatic handle algorithm to produce smooth F-Curves.
The legacy algorithm only considers two adjacent points when computing
the bezier handles, which cannot produce satisfactory results. Animators
are often forced to manually adjust all curves.

The new approach instead solves a system of equations to trace a cubic spline
with continuous second derivative through the whole segment of auto points,
delimited at ends by keyframes with handles set by other requirements.

This algorithm also adjusts Vector handles that face ordinary bezier keyframes
to achieve zero acceleration at the Vector keyframe, instead of simply pointing
it at the adjacent point.

Original idea and implementation by Benoit Bolsee <benoit.bolsee@online.be>;
code mostly rewritten to improve code clarity and extensibility.

Reviewers: aligorith

Differential Revision: https://developer.blender.org/D2884
2017-11-01 21:57:39 +03:00
88356a2442 Cleanup: use term shape-preset in widget code 2017-11-02 05:48:59 +11:00
a6e1f7560f UI: Option to draw button pressed
Needed to show the active tool
2017-11-02 05:02:56 +11:00
3ec4d0b51b UI: Add UILayout.operator_menu_hold
This is an operator button that opens a menu when the button is held.
2017-11-02 05:01:10 +11:00
cf6e45b522 Eevee: Fix Black volumetrics.
Was caused by a division by 0.
2017-11-01 18:48:55 +01:00
07dbff7dc1 Fix T53217: GLSL principled BSDF black with zero clearcoat roughness. 2017-11-01 17:14:06 +01:00
cd7e43f29f Eevee: Fix crash when using only 1 viewport sample + volumetrics 2017-11-01 16:50:06 +01:00
a62e79022a Eevee: Fix refraction & alpha blend object disapearing 2017-11-01 16:36:05 +01:00
b7d1621477 Eevee: Remove unecessary planar_minmaxz 2017-11-01 16:19:07 +01:00
40adf486d7 Eevee: Do not allocate minz buffer.
It's not needed for now.
2017-11-01 16:17:33 +01:00
71f46bc367 Cycles: Add utility function to distinguish between scatter and absorption volume ID 2017-11-01 11:10:51 +01:00
5d7138c08a Cycles: Cleanup, make it more obvious what preprocessor belongs to 2017-11-01 11:10:10 +01:00
7f45acee80 Cycles: Cleanup, delete trailing whitespace 2017-11-01 11:06:55 +01:00
a819ef65c0 Fix for T48988 - Enabling bbone easing for posemode
This fix enables the usage of bbones easing parameters for edit and pose mode seperately. This allows animators to take advantage of the functionality and may eliminate confusion as the parameters now behave similar to other bbone parameters.

Note that splitting the parameters between the modes effectively creates a new parameter set. Blend files of previous versions do not contain this information and will have the values set to 0 on load. As it broke backwards compatibility for pose mode values anyway, I also took the liberty to rename the easing parameters in some places for consistency (which breaks edit mode values).

Reviewers: aligorith

Subscribers: aligorith

Tags: #animation

Differential Revision: https://developer.blender.org/D2796
2017-11-01 14:42:08 +13:00
2ae6a93f05 Cleanup: style 2017-11-01 11:56:56 +11:00
2fbbc8c643 Eevee: SSR: Use max lod on planar reflections. 2017-11-01 01:17:35 +01:00
a5e8618f48 Eevee: Fix Bad AO on opaque refractive geometry. 2017-11-01 01:17:35 +01:00
345ffe3e4d Eevee: Effects: Split each effect in it's own file.
This also:
- make sure to only compile the shader needed by the active effects.
- same thing for the shading groups.
- disable TAA if motion blur is active (avoid infinite refresh).
2017-11-01 01:17:35 +01:00
d836adb275 Draw Manager: Fix crash when trying to order an empty shading group.
This fix crash when using only the volume output with an alpha blend material
2017-11-01 01:17:35 +01:00
0518577f5d Eevee: Fix Exponent default in versioning code 2017-11-01 01:17:35 +01:00
98cbd4c925 Eevee: Silence warning 2017-11-01 01:17:35 +01:00
59f238ba09 Mesh Auto-Smooth Split Normal Support
From D2906 with few changes
2017-10-31 15:15:14 -02:00
c8de666cbe Merge branch 'master' into blender2.8 2017-10-31 17:38:53 +01:00
4e33d07565 Fix bplayer (c)
Like seriously guys... twice within a few hours, compile full blender please
when you change APIs!
2017-10-31 17:15:16 +01:00
Dalai Felinto
3a72f02d80 Layers: unittest update after workspace > engine changes
All tests working again now.
Remember to update the svn lib/tests/layers folder.
2017-10-31 12:45:41 -02:00
941484ff81 Merge branch 'master' into blender2.8 2017-11-01 01:27:03 +11:00
Dalai Felinto
0dd98af255 Prevent users to be able to override context engine
We expose engine as a string, yet context is dealing with Pointers. To prevent a crash
we may as well just forbid users to override it.
2017-10-31 12:09:06 -02:00
5296c2e099 Experiment with adding output file meta data from render engine
The idea is to make it possible to report extra meta data from
render engine to the file writing. This way we can provide
additional information such as number of samples rendered by
resumable Cycles rendering so we can easily combine files back.

Currently only report number of samples from Cycles when rendering
a single render-layer scene. This is something what was required
here at the studio. We can easily extend that further.

Ideally we would also need to support non-string metadata, but
that's for later.

Reviewers: mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Subscribers: sybren, candreacchio

Differential Revision: https://developer.blender.org/D2502
2017-10-31 15:05:53 +01:00
022fd32126 Add ability for render engines to report extra meta data to pipeline 2017-10-31 15:05:53 +01:00
040ea95517 Add ability to specify custom fields to be saved from render result 2017-10-31 15:05:53 +01:00
a6d2fd0215 Stamp info: Use dedicated function to free up memory
This way it's more flexible to extend StampData structure
with additional stuff which might require memory free.
2017-10-31 15:05:53 +01:00
Dalai Felinto
bbb4fa7e47 Workspace cleanup: engine_id is in ViewRender 2017-10-31 12:02:38 -02:00
7fb393f9ba Fix bplayer (c) 2017-10-31 14:52:52 +01:00
Dalai Felinto
7553523af7 Collections: Bring back simple visibility behaviour
If an object is in any visible collection, the object will be visible.
This behaviour has changed in 9ad2c0b615.

If it will change again, it will be for:
https://developer.blender.org/D2878
2017-10-31 11:39:17 -02:00
f1c7243376 Tracking: Create mesh from selected tracks only
Patch by Sebastian Koenig. thanks!
2017-10-31 14:02:32 +01:00
46963f359d Cycles: Bump version number to 1.9.0
This matches Blender Release 2.79.
2017-10-31 13:34:34 +01:00
39671ac504 Fix crash of standalone app after recent refactor 2017-10-31 13:34:23 +01:00
076abf6cd8 MacOS: Use correct Cocoa protocol on any compiler 2017-10-31 11:30:55 +02:00
98052162e1 UI: replace UI_ITEM_O_RETURN_PROPS /w return arg
Means we can have a version of this function that returns the button
and avoids returning a struct that often isn't used.
2017-10-31 17:04:55 +11:00
fe3571b362 UI: avoid double operator type lookup 2017-10-31 12:44:41 +11:00
Dalai Felinto
16f06e9dc9 Introduce "skip" in BLI_Iterator struct
This helps iterators prevent recursion.
2017-10-30 19:34:46 -02:00
Dalai Felinto
7aabe3f66c Fix renderlayers UI removing the wrong renderlayer
Bug introduced on 1c4c288727 (well technically in b48694639a).
We should not remove the renderlayer from the context, but instead the one that
is active from scene.

That said, the UI should make a distinction between the scene active render layer
and the one that is active in the UI (and that should be the one used when
removing it).

But for now this is at least more consistent for the users.
2017-10-30 19:12:27 -02:00
ca006deafe Fix T53191: Python API Reference link wrong in splash screen.
Forgot to update splashscreen links when we switched API doc naming
scheme...
2017-10-30 13:00:32 +01:00
80465ba35a Curve Decimate: new tool to simplify bezier curves
Access from the curve clean-up menu
2017-10-30 22:36:51 +11:00
b7e45b515c Merge branch 'master' into blender2.8 2017-10-30 18:48:39 +11:00
619600a53f CMake: cleanup 2017-10-30 18:48:27 +11:00
8277bee748 Draw Manager: re-enable edit-mesh text overlay 2017-10-30 17:50:47 +11:00
689ad9ade4 Fix manipulator drawing before their refresh callback
Caused glitch with Scale-Cage tool.
2017-10-30 14:26:57 +11:00
ca495381c5 Missing NULL pointer check in poly-build tool 2017-10-30 14:26:57 +11:00
e8daf2e3ea CMake: cleanup 2017-10-30 12:59:36 +11:00
bed3cbdf3d Merge branch 'master' into blender2.8
# Conflicts:
#	build_files/cmake/macros.cmake
#	build_files/cmake/platform/platform_win32.cmake
2017-10-29 18:20:24 -02:00
475ec5269a CMake: use only absolute linker paths for msvc.
cmake's link_directories will supply forward slashes for the search paths, the msvc linker has some issues with that, while it will search for the needed libs just fine, the incremental linker gets fed forward slashes for some libs, while the previous binary has backward slashes in it's metadata, the linker assumes obj files got added and performs a full link instead of an incremental link. This change brings down the link time with newer msvc versions for a trivial edit down from a few minutes to a few seconds.
2017-10-29 13:16:22 -06:00
34859b285a Merge branch 'master' into blender2.8 2017-10-29 17:31:55 +01:00
6099b2620d Alembic: added frame offset property
The offset is subtracted, so that it's intuitive (dragging slider pushes
the animation further that way on the timeline).
2017-10-29 17:23:50 +01:00
bbc7eb8ae5 Cycles: restore SOBOL_SKIP hack, for some cases where it helps still. 2017-10-29 16:44:20 +01:00
405980b1fa Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
#	source/blender/alembic/intern/abc_exporter.h
#	source/blender/alembic/intern/alembic_capi.cc
#	tests/gtests/alembic/abc_export_test.cc
2017-10-29 15:38:55 +01:00
89eb05a890 Alembic: exporting MetaBalls as mesh
- Only basis balls are exported, as they represent the resulting mesh.
  As a result the mesh is written to Alembic using the name of the basis
  ball.
- MetaBalls are converted to a mesh on every frame, then an
  AbcMeshWriter is used to write that mesh to Alembic.
2017-10-29 15:21:36 +01:00
7530c54c3c Merge branch 'master' into blender2.8 2017-10-29 15:14:04 +01:00
d9000495e1 Include file for DNA_DEPRECATED macro 2017-10-29 14:36:10 +01:00
0012d54a70 Alembic import: fixed mesh corruption when changing topology
When the mesh changed topology but kept the vertex count the same, it would
result in a corrupt mesh. By checking the face & loop counts too, this has
become less likely.

I've checked IPolyMeshSchema::isConstant(), but it returns true even when
we see that the mesh changed topology.
2017-10-29 14:36:10 +01:00
ab2d1f61a8 BMesh: use heap update for dissolve-decimate 2017-10-30 00:39:00 +11:00
512b879241 BLI_heap: add validation check, improve tests
Also minor readability changes, avoid running both heap_up/down
gives minor speedup too.
2017-10-29 18:23:33 +11:00
560fa6db17 Curve Fitting: heap reinsertion optimization 2017-10-29 16:33:44 +11:00
bd0d41059f Cleanup: move docs out of header 2017-10-29 16:08:10 +11:00
4518c0f3e8 Cleanup: const args 2017-10-29 15:47:10 +11:00
3425732926 BLI_heap: minor changes to the API
Recent addition of 'reinsert' didn't match logic for ghash API.

Rename to BLI_heap_node_value_update,
also add BLI_heap_insert_or_update since it's a common operation.
2017-10-29 15:47:06 +11:00
336885beba Use BLI_heap_reinsert for decimate and beautify
Improves performance for high poly meshes,
~70% faster for decimate, only ~10% for beautify.
2017-10-29 05:28:00 +11:00
4af1af70ad BLI_hash: add BLI_heap_reinsert
Allows avoiding remove/insert calls.
2017-10-29 04:42:58 +11:00
b84e3dc7f3 GTest: initial BLI_heap test 2017-10-29 00:56:56 +11:00
1e07f366e6 Fix T53185: After rendering an animation (Ctrl-F12), pressing F12 no longer renders single frames only 2017-10-29 02:09:57 +13:00
fdae9e1e03 BLI_array_store: correct hashing single bytes
The single byte version of hash_data was casting from unsigned char
instead of signed.

This didn't cause any errors since the result of each aren't compared.
Even so, better keep them matching.
2017-10-28 18:28:55 +11:00
8ac69ff9dc Cleanup: use uint type in BLI 2017-10-28 17:48:45 +11:00
1186dec916 Eevee: Volumetric: Fix Sun lamps not working. 2017-10-27 23:28:17 +02:00
6e0ec8868d Eevee: Unlock volumetric shader nodes. 2017-10-27 22:49:15 +02:00
acdf76668a Eevee: Make Smoke sim panel visible with EEVEE 2017-10-27 22:49:15 +02:00
b4a96d366c Eevee: Volumetrics: Fix "Tile Size" tooltip 2017-10-27 22:49:15 +02:00
bc7c0335dc Eevee: Volumetrics: Support Smoke simulation textures.
It should behave like cycles.

Even if not efficient at all, we still do the same create - draw - free process that was done in the old viewport to save vram (maybe not really the case now) and not care about simulation's GPU texture state sync.
2017-10-27 22:49:15 +02:00
4f7665c844 Eevee: Volumetrics: Add Volume object support.
This is quite basic as it only support boundbing boxes.
But the material can refine the volume shape in anyway the user like.

To overcome this limitation, a voxelisation should be done on the mesh (generating a SDF maybe?) and tested against every volumetric cell.
2017-10-27 22:49:15 +02:00
18ba7e26ad GPUMaterial: Add a domain property.
This let us know efficiently if a material has a dedicated nodetree for each of it's output node input.

Only works for Eevee at this moment.
2017-10-27 22:49:15 +02:00
23f51a4e43 Eevee: Volumetrics: Request aditional frames when no TAA is enabled. 2017-10-27 22:49:15 +02:00
310f1db7bf Eevee: Volumetrics: Add volumetric support to alpha blended meshes. 2017-10-27 22:49:15 +02:00
66d8f82b83 Eevee: Overhaul the volumetric system.
The system now uses several 3D textures in order to decouple every steps of the volumetric rendering.

See https://www.ea.com/frostbite/news/physically-based-unified-volumetric-rendering-in-frostbite for more details.

On the technical side, instead of using a compute shader to populate the 3D textures we use layered rendering with a geometry shader to render 1 fullscreen triangle per 3D texture slice.
2017-10-27 22:49:15 +02:00
1c0c63ce5b DRW: Add 3D texture support. 2017-10-27 22:49:15 +02:00
660eea8cf4 BLI_rand : add BLI_halton_3D 2017-10-27 22:49:15 +02:00
Dalai Felinto
4de8e12ada Showing Clay collection settings when clay is the workspace not the scene engine 2017-10-27 11:25:58 -02:00
1d409defbf Docs: clarify return value for BVH API 2017-10-27 16:14:24 +11:00
9ab67fd31b Hide transform widget when tool widget is used 2017-10-27 15:54:17 +11:00
de7544202a Fix camera lens/ortho manipulator
Update issues remain, require listening to notifiers.
2017-10-27 15:05:33 +11:00
7ffd3490a8 Merge branch 'master' into blender2.8 2017-10-27 13:24:16 +11:00
282af08fe2 Fix T53131: Incorrect vert-edge angle calculation
Vertex w/ a single edge wasn't detected
2017-10-27 13:10:36 +11:00
Julian Eisel
a3313315ba Merge branch 'master' into blender2.8 2017-10-26 22:57:47 +02:00
Julian Eisel
d245d36074 Remove SCREEN_OT_header_flip, use SCREEN_OT_region_flip instead
Basically reverts rB65c4149f203610 and fixes the issue in a better way.

Keymaps using the removed operator will be affected. Switching header
from top to bottom now has the shortcut F5, just like switching other
regions.
2017-10-26 22:40:24 +02:00
1effab7809 Fix T52984. Trackpad rotation to natural direction 2017-10-26 23:11:25 +03:00
Dalai Felinto
6e1fa2b063 Fix small Python/typo on "Outliner Collection Operation" 2017-10-26 11:54:42 -02:00
f9b2a7879b Skip loading tool keymaps in background mode 2017-10-26 22:04:48 +11:00
ef96f36ee9 Move background images into the camera
This moves background images out of the 3D viewport,
to be used only as camera reference images.

For 3D viewport references,
background images can be used, see: D2827

Some work is still needed
(background option isn't working at the moment).
2017-10-26 22:02:40 +11:00
654ee398ff Merge branch 'master' into blender2.8 2017-10-26 12:49:57 +02:00
03a582ceeb Using gtest fixtures in Alembic export tests 2017-10-26 12:43:59 +02:00
d78bbe38bc Cleanup: Remove unused argument from ED_update_for_newframe
This funciton will be extended, so better to get rid of unused arguments before
adding new ones.
2017-10-26 10:18:15 +02:00
f23c966e24 Fix / workaround T53164: Crashes with background scenes
Simple workaround in on_visible_update(). There might be more missing updates or tags.
2017-10-26 09:48:50 +02:00
cd3c31b2c0 Tool System: experimental low-poly construction
Tool for creating polygons, exact usage may change based on feedback.

LMB to add faces at boundaries (tris from edges, quads from verts).
- Ctrl splits edges
- Alt to dissolve edges/verts.

Works well with vertex snap & auto-merge.

This uses selection hover but isn't intended to introduce more widely
pre-selection highlighting, at least it will be restricted to this tool.
2017-10-26 18:40:27 +11:00
4063c7062a Merge branch 'master' into blender2.8 2017-10-26 16:20:34 +11:00
3d904d7650 Manipulator: Use object bound-box for scale cage
Without this, scaling single objects wasn't working usefully.
2017-10-26 16:15:54 +11:00
81f2e68e20 Event System: check_click was left set
Caused by own change 137586a13c
2017-10-26 16:08:45 +11:00
Julian Eisel
f074a6dd2e Merge branch 'master' into blender2.8 2017-10-25 22:04:01 +02:00
171c4e982f Cycles: use AO factor to let user adjust intensity of AO bounces.
We are already using the AO distance, so might as well offer this extra
control over the intensity. Useful when an interior scene is supposed to
be significantly darker than the background shader.
2017-10-25 21:46:23 +02:00
Dalai Felinto
86899c1adf Fix freestyle UI after workspace > engine changes 2017-10-25 12:25:43 -02:00
b90e2607a0 Depsgraph: Remove workaround for infinite recursion in scene update
Was needed for legacy lamp/material drivers.
2017-10-25 15:49:59 +02:00
54ebbe1534 Depsgraph: Cleanup, remove legacy material/lamp driver update functions 2017-10-25 15:49:59 +02:00
025f4a046f Depsgraph: Remove driver evaluation from object update
With new dependency graph this direct call to driver/animation update should
not be needed,
2017-10-25 15:49:59 +02:00
fb896182b1 Depsgraph; Introduce new scene update routines which gets an explicit graph
They are still modifying global state, such as ID recalc tags stored in bmain,
need some solution for this.
2017-10-25 15:49:59 +02:00
Dalai Felinto
6b739bc2dc Fix T53156: VSE not working since Workspace > engine change
This would break if using preview in VSE. We now use the scene engine
not the workspace engine.

That said we could have the preview engine defined as part of the sequence strip
as we had for draw modes in the past. But this is a separated topic for a
separated patch.

This issue in particular was introduced in e4f2b2be26.

Note: VSE preview is still broken in two cases:
* If you have Eevee as the engine in the Scene of the Scene strip.
* If you use Clay, save the file, and re-open.
2017-10-25 11:16:08 -02:00
4353307607 Depsgraph: Make validation to take explicit graph to be checked 2017-10-25 14:51:02 +02:00
db83f41baf Merge branch 'master' into blender2.8 2017-10-25 14:42:49 +02:00
8988f383c1 Depsgraph: Cleanup, remove redundant calls to add_component 2017-10-25 14:40:38 +02:00
40b3d951bc Depsgraph: Don't touch set scenes when evaluating scene
Objects from set scene gets flattened out to the active scene depsgraph, so it
is a big question why do we need to build dependency graph for set scenes.
2017-10-25 14:37:03 +02:00
a08f633aeb Depsgraph: Remove direct call to VSE animation update
This is supposed to be handled by dependency graph now.
2017-10-25 14:30:56 +02:00
8e4b3e916e Merge branch 'master' into blender2.8 2017-10-25 14:22:24 +02:00
50d30cc5fd Depsgraph: Need to tag relations for update after new clip was added 2017-10-25 14:20:20 +02:00
e2e5c9a1ee Depsgraph: Mark TODO as solved
New dependency graph takes care of all datablocks already.
2017-10-25 14:02:51 +02:00
c4991c0971 Depsgraph: Remove bmain from graph
It really should not care about bmain.
2017-10-25 13:28:40 +02:00
4deddfca89 Depsgraph: Pass explicit bmain to graph build finalization 2017-10-25 13:28:40 +02:00
86761a2cd7 Depsgraph: Cleanup, remove unused function 2017-10-25 13:28:40 +02:00
db04cc0f00 Depsgraph: Remove direct relations rebuild from set_background
We wouldn't really know which context we want there.
2017-10-25 13:28:40 +02:00
da78338da0 Depsgraph: Add function to update relations within a given graph 2017-10-25 13:28:39 +02:00
Dalai Felinto
005cb90113 Fix T52392: Node materials (Materials and World) not updated in viewport
Depsgraph was not updated after you used "Use Nodes" to create the nodetree.
2017-10-25 09:24:28 -02:00
220fbddc8b Merge branch 'master' into blender2.8 2017-10-25 12:21:08 +02:00
ea5cf3ff7a Depsgraph: Rework debug relations update function
Make it a tag for relations update function instead, since we will not be able
to easily rebuild relations, and we wouldn't be able to iterate all scenes.

This is a part of mowing depsgraph to be per-workspace/layer in 2.8 branch.
2017-10-25 12:11:49 +02:00
0bbf2f9554 Depsgraph: Add missing forward struct declarations 2017-10-25 12:11:12 +02:00
b4ba1068c1 Depsgraph: Cleanup, trailing whitespace and braces 2017-10-25 12:07:51 +02:00
3fe534eebb Depsgraph: Make depsgraph.debug_stats to return a string
This way we can see result in the python console.
2017-10-25 12:06:56 +02:00
d8da33d21c Merge branch 'master' into blender2.8 2017-10-25 11:48:20 +02:00
6ec8344243 Depsgraph: Add missing movie clip dopesheet invalidation 2017-10-25 11:45:31 +02:00
eb090d0609 Depsgraph: Use explicit opcode for shape key 2017-10-25 11:37:24 +02:00
a2e22c79cb Depsgraph: Cleanup, use explicit cloth modifier opcode
Avoids use of placeholder operation which also was involving some string
comparisons.
2017-10-25 11:34:41 +02:00
3997a157e9 Depsgraph: Cleanup, don't call explicit add_id()
This is redundant, adding components will check for ID to exist.
2017-10-25 11:31:22 +02:00
7771e0b474 Merge branch 'master' into blender2.8 2017-10-25 11:26:53 +02:00
1bdc687e7a Depsgraph: Use explicit parameters eval operation code
This replaces usage of generic PLACEHOLDEWR with string lookup with more
explicit opcode. This should make it faster to build dependency graph by
avoiding string comparisons when it's not needed.

There should be no user measurable different.
2017-10-25 11:25:10 +02:00
11d7445905 Depsgraph: Cleanup, use proper style for macro loop 2017-10-25 11:25:10 +02:00
45329ce319 Depsgraph: Remove unsued node flag 2017-10-25 11:25:10 +02:00
ea29e4c997 Depsgraph: Make operation codes more obvious
This synchronizes al lrelated changes from blender2.8 branch.
2017-10-25 11:25:10 +02:00
f29ff14d6e Depsgraph: Remove bunch of debug code
Was never actually used and implementation seems to be slow: we shouldn't be
doing per-node evaluation hash lookups, adds too much overhead. We can instead
store statistics in the node itself, and maybe even group them somehow.

Ideally such a statistics should be user-friendly so riggers and animators
can see exactly what's happening.
2017-10-25 11:25:10 +02:00
2103194f79 Fix T53004: XWayland ignores cursor-warp calls
There is currently a limitation in XWayland,
the cursor needs to be hidden during warp calls.
2017-10-25 20:12:12 +11:00
1e107fa514 Merge branch 'master' into blender2.8 2017-10-25 10:13:35 +02:00
8dab90915f Eevee: Fix T53095: Black cube on start and no material updates
This was caused by a not bound unused texture. Removing the texture usage fixes the problem.
2017-10-25 10:31:58 +02:00
83877632a3 Fix one more assert being triggered due to recent changes. 2017-10-25 01:22:16 +02:00
34fe3f9c06 Code refactor: remove MEM_WRITE_ONLY, always use MEM_READ_WRITE.
It's unlikely the driver can do useful optimizations with this, and if
we sum multiple samples we are reading from the memory anyway.
2017-10-24 23:53:09 +02:00
Dalai Felinto
0e7113df21 Silence warning in outliner_id_remap_exec 2017-10-24 16:00:26 -02:00
Julian Eisel
03f1b94e02 Fix crash changing settings of operator executed in different scene
Steps to reproduce were:
* Open Blender, create a new scene
* Go back to initial scene, transform object
* Switch back to newly created scene, change operator settings there
* Should cause a crash (at least with asan)

Should behave like 2.7 now, that is, switch scene back to where
operator was executed.
2017-10-24 18:22:42 +02:00
fe253389e0 Fix Cycles gtests build on macOS. 2017-10-24 17:52:20 +02:00
ec49503a33 Fix T53146: incomplete multi GPU and CPU + GPU memory statistics.
Part due to recent changes, part old bug.
2017-10-24 17:40:43 +02:00
3936ba9725 Depsgraph: Avoid explicit relations rebuild calls
We wouldn't know which dependency graphs needs/safe for reconstruction,
so rather use API which tells that relations are out of date. This way
graph evaluation will take care of the rest.

Committing to 2.8 only since it's where we can't reliably know the graph
and is probably not that safe to apply this in master.
2017-10-24 16:47:34 +02:00
d012c9d0f4 Depsgraph: Remove residue of motion path optimization
This needs to be re-implemented in a new fashion, without touching global list
of bases and become compatible with the new dependency graph.

The idea to go here would be to create new dependency graph for motion path
evaluation, bring a single object in there (which will pull all dependencies
at a construction) and use that.

Needs working copy-on-write first tho.
2017-10-24 16:39:26 +02:00
b6560d9fc1 Depsgraph: Remove bunch of debug code
Was never actually used and implementation seems to be slow: we shouldn't be
doing per-node evaluation hash lookups, adds too much overhead. We can instead
store statistics in the node itself, and maybe even group them somehow.

Ideally such a statistics should be user-friendly so riggers and animators
can see exactly what's happening.
2017-10-24 16:04:11 +02:00
86faf8ac84 Depsgraph: Remove shortcut of freeing scene's depsgraph
It will not be possible to do that after depsgraph becomes more context
oriented. Which means, all code will need to explicitly tell which graph
to free,
2017-10-24 16:04:11 +02:00
97b2483a7a Depsgraph: Remove scene from refresh API
Scene is already stored in the graph.
2017-10-24 16:04:11 +02:00
11d8c939cd Depsgraph: Cleanup, remove unused function declaration 2017-10-24 16:04:11 +02:00
1829084da1 Depsgraph: Switch to explicit graph specification for tag flush 2017-10-24 16:04:11 +02:00
72b61763da Depsgraph: Begin bringing API to pass explicit graph
This is a first step towards an updated API where we pass explicit graph rather
than a scene. This is because we can no longer deduct which graph to use since
it will depend on a context.

Will happen in several steps, so bisecting will not be such a pain.
2017-10-24 16:04:11 +02:00
4dbfb130db Depsgraph: Cleanup, remove unused function
It's unlikely we will ever want to flush tags on all possible scenes or
dependency graphs. It wouldn't be thread safe at a best.
2017-10-24 16:04:11 +02:00
56006d9808 Depsgraph: Cleanup, unused function declaration 2017-10-24 16:04:11 +02:00
Dalai Felinto
7484c6c5ee Fix non-instanced groups in no-collection file creating collections
This is a corner-case, but one that is too easy to reproduce:

* Unlink all the collections of active view layer.
* Link a group without "Instancing" it.
2017-10-24 10:28:01 -02:00
Dalai Felinto
bac740085c rna_layer.c cleanup: remove uneeded includes
I have cleaned up the ones before "#ifdef RNA_RUNTIME", and forgot about the ones after.
2017-10-24 10:23:29 -02:00
d92bca186f Depsgraph: Initialize depsgraph as need for update
This way we can delay graph allocation and relations update.
2017-10-24 13:54:12 +02:00
7ea7fd45d0 Merge branch 'master' into blender2.8 2017-10-24 12:19:48 +02:00
e03df90bf3 Cycles: Fix compilation in debug mode
Please check compilation before committing refactor changes!
2017-10-24 12:09:02 +02:00
eccd18a91f Cycles: Fix compilation error without C++11 2017-10-24 11:14:01 +02:00
d0f48d33f4 Cycles: Fix memory leak in test and simplify code 2017-10-24 11:12:28 +02:00
1dd33b2f23 Cycles: Fix test compilation failure after recent refactor
The test will leak CPU devices, but is all passing other than that.
Leak will be fixed shortly.

P.S. Committing code refactor without running regression tests, tsk ;)
2017-10-24 10:48:16 +02:00
136f33b09f Fix T53143: Knife Crash after Grid Fill
BM_ELEM_INTERNAL_TAG flag wasn't ensured to be cleared.
2017-10-24 17:21:25 +11:00
8661ab12a6 Fix BMesh PyAPI internal flag clearing logic
Would leave the flag set on raising an exception.
2017-10-24 16:52:54 +11:00
c93cfcbb61 Fix edge-split bmesh operator giving empty result 2017-10-24 16:31:35 +11:00
c71f2f1404 Fix T53130: NLA Tweak (moved) Tracks + Alt+RMB Select does not work in Graph Editor 2017-10-24 16:27:56 +13:00
a1aad1f8d1 Fix T53134: denoising with CPU + GPU render leaves some tiles noisy. 2017-10-24 04:09:48 +02:00
f5456df095 Merge branch 'master' into blender2.8 2017-10-24 02:05:41 +02:00
070a668d04 Code refactor: move more memory allocation logic into device API.
* Remove tex_* and pixels_* functions, replace by mem_*.
* Add MEM_TEXTURE and MEM_PIXELS as memory types recognized by devices.
* No longer create device_memory and call mem_* directly, always go
  through device_only_memory, device_vector and device_pixels.
2017-10-24 01:25:19 +02:00
aa8b4c5d81 Code refactor: use device_only_memory and device_vector in more places. 2017-10-24 01:25:13 +02:00
7ad9333fad Code refactor: store device/interp/extension/type in each device_memory. 2017-10-24 01:03:59 +02:00
ae41f38f78 Code refactor: pass device to scene, check OSL with device info. 2017-10-24 01:03:59 +02:00
Julian Eisel
254daf8f8c Fix T53141: Assert when using transformation in new 3D View editor
Was actually possible to invoke this assert failure in two ways:
* Transforming in newly created 3D View (like described in the report).
* Transforming in newly appended workspace from default workspaces.blend. Issue was that default workspaces.blend was saved in 2.8.1, but in a branch state that didn't include the transform-orientation changes. So versioning code wouldn't run when needed.

Note that files saved with this bug will still cause the assert to
fail. Can be ignored then.

This is not related to manipulators (as suggested in the report).
2017-10-24 00:38:20 +02:00
Dalai Felinto
23a5726ec2 Refactor: Move rna_scene.c layer/collection to rna_layer.c
rna_scene.c was getting way too big with data that was related to
DNA_layer_types.h.

I tried doing it earlier, but failed. But now with the new changes I think it's
better to do this sooner than later.
2017-10-23 18:18:05 -02:00
4db67aab06 Fix OpenGL extension report in system info operator. 2017-10-23 22:22:22 +03:00
cc96cdd9d4 VSE: draw grid lines at every second
Was hard-coded to 25 frames.

D2893 by @jooert
2017-10-23 22:29:49 +11:00
1aa5b63661 Docs: improve bmesh exception message
Suggested in T53131
2017-10-23 21:57:32 +11:00
c8edac617f Merge branch 'master' into blender2.8 2017-10-23 14:38:22 +11:00
af067f2305 Correct gtest error in recent beautify change 2017-10-23 14:20:35 +11:00
Julian Eisel
7dcf8bebe6 Cleanup: Remove unused function declaration 2017-10-23 02:11:45 +02:00
Julian Eisel
147f9585db Merge branch 'master' into blender2.8 2017-10-23 00:04:20 +02:00
6dfe4cbc6b Polyfill Beautify: half-edge optimization
Was using an edge hash for triangle -> edge lookups,
updating triangle indices for each edge-rotation.

Replace this with half-edge which can rotate edges much more simply,
writing triangles back once the solution has been calculated.

Gives ~33% speedup in own tests.
2017-10-23 01:40:03 +11:00
57a0cb797d Code refactor: avoid some unnecessary device memory copying. 2017-10-21 20:58:28 +02:00
92ec4863c2 Code refactor: simplify image device memory allocation. 2017-10-21 20:58:28 +02:00
0836795a0d Fix issue with resumable rendering in recent changes. 2017-10-21 20:57:52 +02:00
6199a606a6 Cycles: disable progressive refine if denoising or save buffers is used.
Progressive refine undoes memory saving from save buffers, so enabling
both does not make much sense. Previously enabling progressive refine
would disable denoising, but it should be the other way around since
denoise actually affects the render result.

Includes some code refactor for progressive refine render buffers, and
avoids recomputing tiles for each progressive sample.
2017-10-21 20:29:21 +02:00
dc9eb8234f Cycles: combined CPU + GPU rendering support.
CPU rendering will be restricted to a BVH2, which is not ideal for raytracing
performance but can be shared with the GPU. Decoupled volume shading will be
disabled to match GPU volume sampling.

The number of CPU rendering threads is reduced to leave one core dedicated to
each GPU. Viewport rendering will also only use GPU rendering still. So along
with the BVH2 usage, perfect scaling should not be expected.

Go to User Preferences > System to enable the CPU to render alongside the GPU.

Differential Revision: https://developer.blender.org/D2873
2017-10-21 20:13:44 +02:00
Julian Eisel
efd70ab78f Move & rename uiLayoutOperatorButs to interface_templates.c 2017-10-21 16:48:42 +02:00
bf26509855 Manipulator: name remove func's 'unlink_delayed'
Name wasn't right since this only unlinks from manipulator maps.
2017-10-22 00:17:47 +11:00
d3fafa3002 Manipulator: move 'Scale Cage' to its own tool
Was activated with the regular scale manipulator,
move to own tool since they are different ways to access scale.
2017-10-21 23:01:19 +11:00
e1e7b6db2e WM: Initial Tool System
The tool-system it's self is primitive and may be changed.

Adding to 2.8 to develop operators and manipulators as tools.

Currently this is exposed in the toolbar, collapsed by default.
Work-flow remains unchanged if you don't change the active tool.

Placing the 3D cursor is now a Click instead of a Press event,
this allows tweak events to be mapped to tools such as border select,
keeping click for 3D cursor placement when selection tools are set.
2017-10-21 16:39:35 +11:00
b66728d63d Merge branch 'master' into blender2.8 2017-10-21 12:43:17 +11:00
ebb29200d3 Cleanup: use relative imports in bl_ui 2017-10-21 12:41:42 +11:00
Dalai Felinto
a8553c9fa2 Silence warning on subsurf modifier 2017-10-20 18:16:34 -02:00
1beebcb10c Depsgraph: Reduce number of depsgraph_legacy usages outside of depsgraph 2017-10-20 17:01:35 +02:00
4f3d9a09fe Depsgraph: Make depsgraph a part of evaluation context
This way evaluation routines will know which exact depsgraph evaluation
is happening for.

Mainly needed to get evaluation flags associated with ID nodes.
2017-10-20 16:50:58 +02:00
cdd1e86499 Fix/workaround wrong dependency graph being constructed after creating a proxy 2017-10-20 16:15:30 +02:00
3df2e6d76b Fix T53109: denoising variance debug passes not working after recent changes. 2017-10-20 14:41:24 +02:00
c74c72101e Fix compositor node links getting lost on file load for custom render passes. 2017-10-20 14:41:24 +02:00
0fdc0f8bbd Depsgraph: Introduce hash of dependency graphs in the scene level
The idea is following: we do need to have multiple dependency graphs to denote
different scene layers (depsgraph should only contain objects from a specific
scene layer), and we also want to support same scene layer to be evaluated to
a different state in different windows. In order to achieve that we do need to
have a list or hash (for faster lookup presumably) somewhere. To keep things
easier for now, it will be a scene which owns that hash. This seems to make
sense anyway, since dependency graph only points to data which is owned by
scene.

This commit only introduces some basic API and hash itself stored in DNA, there
is no changes in behavior. See this as a first step towards getting rid of
scene-global dependency graph.
2017-10-20 12:28:25 +02:00
86d75d5d98 Depsgraph: Remove redundant call of depsgraph free 2017-10-20 12:10:29 +02:00
e665c3a3f6 Remove unused dependency graph flags from scene 2017-10-20 11:30:39 +02:00
3beea71b07 Remove some residue of old legacy dependency graph 2017-10-20 11:26:00 +02:00
ae72a9206e Fix T46163: NLA properties with drivers aren't displayed as having drivers
While such drivers will generally get evaluated too late to be of much
use during animations, it can still be useful to allow using drivers to
control a whole bunch of NLA strip properties (i.e. syncing NLA strip
timings via a single property/control).

Keyframe insertion however is still not allowed on these properties
(and an error message will now be displayed when trying to do so,
instead of silently failing), as it is useless.
2017-10-20 17:05:50 +13:00
c45b8a65b4 Merge branch 'master' into blender2.8 2017-10-20 14:14:44 +11:00
959a58da9e Cleanup: redundant casts 2017-10-20 14:03:22 +11:00
aa7e76b2e3 Merge branch 'master' into blender2.8 2017-10-20 09:40:08 +11:00
cb957fd8e0 Cleanup: replace gpencil tri vars w/ array 2017-10-20 09:28:12 +11:00
Dalai Felinto
fc10484f7c Fix/properly implement: "make group proxy"
This was never correctly implemented. It now works as expected (ala 2.79 behaviour).
The proxy object is added to all the collections of the original empty.

Before not only this wasn't the case, but it would crash Blender.
2017-10-19 18:04:14 -02:00
4d2416b99c Merge branch 'master' into blender2.8 2017-10-20 00:29:04 +11:00
465b6333cc Correct last commit, use WM_exit
Without this temp directory isn't removed.
2017-10-20 00:19:58 +11:00
9ee8319cd5 Exit with invalid command line arguments
Loading blender with an unknown name would interpret it as a blend file.

This meant passing `--arg` arguments would end up creating new
blend files which could be confusing if you made a typo on a command
line argument.

Now check the string has a blend file extension,
exiting if it doesn't.
2017-10-20 00:10:40 +11:00
0f8a57de68 Merge branch 'master' into blender2.8 2017-10-19 13:58:01 +02:00
335e454db6 Depsgraph: Use new ID copy API to copy scenes
Avoids temporary main and datablock memory from being allocated.
2017-10-19 13:57:49 +02:00
1cddab18de Allow non-initialized memory to be passed to BKE_id_copy_ex
This only applies when LIB_ID_CREATE_NO_ALLOCATE flag is used and guarantees
that non-memset-zero memory can be used (or, that same memory chunk might be
used over and over again without need to clean it from the calleer).
2017-10-19 13:55:08 +02:00
8f495326bf Fix operators adding manipulators multiple times
Running spin or bisect twice in a row added widget groups each time.
2017-10-19 22:44:51 +11:00
529d365b4d Add note about handling of root nodetree in ID copydata.
OUr beloved root nodetrees... Had to check again the code to undersand
why we copy them with bmain even though they are not in bmain, so this
is worth a comment. ;)
2017-10-19 12:33:14 +02:00
910dd7fb1b Cycles: Add extra logging in CUDA device detection code 2017-10-19 11:26:10 +02:00
42dbae5d28 Merge branch 'master' into blender2.8 2017-10-19 17:05:38 +11:00
947bc017aa Merge branch 'master' into blender2.8 2017-10-19 17:03:47 +11:00
2cf1bc3615 Merge branch 'master' into blender2.8 2017-10-19 16:58:30 +11:00
fe9f5fd557 Merge branch 'master' into blender2.8 2017-10-19 16:55:08 +11:00
27ab054bad Merge branch 'master' into blender2.8 2017-10-19 16:30:20 +11:00
7bf7b8af39 Cleanup: redundant comments
Class names are readable, no need for explanations of each one.
2017-10-19 16:19:07 +11:00
351222c26f UI: 3D View, object menu
Changes from D2876 by @meta-androcto /w own edits

- Move "Relations" into own menu.
2017-10-19 16:12:35 +11:00
0aa6d44a79 UI: 3D View, undo menu reorganization
Changes from D2876 by @meta-androcto /w own edits

Move 3x undo items into Undo menu,
these are such common operations they're typically accessed by keys.

Also add to menus which didn't have undo
(seemed random which modes had undo, undo history in their menus).
2017-10-19 15:41:57 +11:00
a8fb08b19c UI: 3D View, minor menu reorganization
Changes from D2876 by @meta-androcto

- Move "Delete" to the first menu item in most toplevel menus.
- Add separators.
- Consistent order of Undo/Redo
2017-10-19 15:10:41 +11:00
b82b55a313 UI: 3D View Mesh "Select" menu reorganization
Changes from D2876 by @meta-androcto /w own edits

- Move "Select Linked" into own menu.
- Move "Select Loop" into own menu.
2017-10-19 14:45:56 +11:00
a6fdec305a UI: 3D View "View" menu reorganization
Changes from D2876 by @meta-androcto /w own edits

- Move view axis & camera selection into "Viewpoint" menu.
- Move render border and clipping into border menu.
- Move Camera operators into own menu.
- View Selected was located in two menus,
  Only expose the "use_all_regions" version when quad-view is used.
2017-10-19 14:07:39 +11:00
c64e515f90 Cleanup: pep8/line length 2017-10-19 11:31:28 +11:00
3859f5ec28 Docs: correct descriptions 2017-10-19 11:09:27 +11:00
d85a0a722e Fix part of T53038: principled BSDF clearcoat weight has no effect with 0 roughness. 2017-10-18 23:35:54 +02:00
32145c4a88 Depsgraph: Use new ID management API to copy ID pointers
This solves issue with user counter on materials, objects and such,
additionally avoids having too much overhead of temporary lock and
datablock allocation.

Still need to do similar thing for scene copy, and look into nested
ID datablocks somehow.
2017-10-18 17:18:12 +02:00
a2f846aa2d Merge branch 'master' into blender2.8 2017-10-18 17:13:37 +02:00
a2b541bd22 Fix mistake in new ID copy code in 'no allocate' case.
Spotted by @sergey, thanks.
2017-10-18 17:11:29 +02:00
264837cb46 Fix wrong comment (leftover from dev time). 2017-10-18 16:55:33 +02:00
651f76b384 Depsgrpah: Fix crash when removing object 2017-10-18 16:43:40 +02:00
47bcd4abad Depsgraph: Make code correct
Was a residue from some debug.
2017-10-18 16:01:08 +02:00
6a17d52f06 Merge branch 'master' into blender2.8 2017-10-18 14:39:22 +02:00
3e8abc0535 Depsgraph: Make Copy-on-Write a command line option
Before it was a compile time option which was not very easy to use or test. Now
the project is getting more mature, so very soon we will be able to call for a
public tests of limited features.

The copy-on-write (which includes animation, modifiers) is enabled using
--enable-copy-on-write command line argument.
2017-10-18 14:35:34 +02:00
46f0b97d20 Depsgraph: Remove declaration of legace removed functions 2017-10-18 12:49:28 +02:00
01a0649354 Cycles: Fix wrong shading when some mesh triangle has non-finite coordinate
This is fully unpredictable for artists when one damaged object makes the whole
scene to render incorrectly. This involves two main changes:

- It is not enough to check triangle bounds to be valid when building BVH.
  This is because triangle might have some finite vertices and some non-finite.

- We shouldn't add non-finite triangle area to the overall area for MIS.
2017-10-18 12:19:53 +02:00
ecf20e7a56 Fix crash accessing enums without a context 2017-10-18 19:46:39 +11:00
ec2bbc90e7 Merge branch 'master' into blender2.8 2017-10-18 17:09:41 +11:00
54f9a6e5da Merge branch 'master' into blender2.8 2017-10-18 16:40:31 +11:00
ab7ebf2b10 Cleanup: Use const for RNA EnumPropertyItem args
Practically all access to enum data is read-only.
2017-10-18 16:04:07 +11:00
92611dada6 Fix T53098, T53079: OpenCL world texture errors after recent changes. 2017-10-18 03:13:25 +02:00
Dalai Felinto
0bcb61b2fe Follow up to engine in workspaces, using clay as default
It would be too slow to use Eevee for files that were not prepared for it.
And at the moment since this is not set, it was falling back to BI.
2017-10-17 20:34:17 -02:00
Dalai Felinto
5aff67fb5e Fix crash when Making Duplicates Real for groups 2017-10-17 20:14:06 -02:00
Dalai Felinto
028a558116 Layers: Fix selected lamp and dupli count for info stats 2017-10-17 19:55:40 -02:00
1cb884be35 Make auto handle placement aware of cyclic extrapolation.
Cyclic extrapolation is implemented as an f-curve modifier, so this
technically violates abstraction separation and is something of a hack.
However without such behavior achieving smooth looping with cyclic
extrapolation is extremely cumbersome.

The new behavior is applied when the first modifier is Cyclic
extrapolation in Repeat or Repeat with Offset mode without
using influence, repeat count or range restrictions.

This change in behavior means that curve handles have to be updated
when the modifier is added, removed or its options change. Due to the
way code is structured, it seems it requires a helper link to the
containing curve from the modifier object.

Reviewers: aligorith

Differential Revision: https://developer.blender.org/D2783
2017-10-17 19:39:10 +03:00
7d3723a54d Fix T52959: Local view looses clip range on exit 2017-10-18 01:41:19 +11:00
0a435d49ba Fix T53074: Use the pybuffer->itemsize to get the corresponding GLtype
It seems that `typestr` does not always define the final size of the element. And it varies by operating system.

Then use the `typestr` only to know the itemtype is `float` type or not.
2017-10-17 12:06:52 -02:00
06ff970f27 Fix T53007: OpenSubdiv + transparency = artefact/crashes 2017-10-17 12:12:15 +02:00
9598bad59c GPU: Report number of compressed texture formats to help nailing crahs down in the future 2017-10-17 11:53:15 +02:00
b65fecd9a0 GPU: Fix memory corruption in GPU_debug on GTX1080
Number of texture formats is 51, which is greater than allowed size of 32.
2017-10-17 11:52:31 +02:00
b53918be39 Added alpha channel check to Alembic unit test
It was broken due to 823bcf1689, which added
alpha information and thus changed tuple size from 3 to 4 items.
2017-10-17 10:59:02 +02:00
bb4c16ef94 Merge branch 'master' into blender2.8 2017-10-17 15:18:12 +11:00
a297e1bb93 WM: move gesture operator callbacks into own file
`wm_operators.c` is near 5k LOC with lots of mixed functionality,
extract gesture callbacks since they aren't closely related.
2017-10-17 15:16:02 +11:00
0ffa64a45f Merge branch 'master' into blender2.8 2017-10-17 14:06:49 +11:00
99520e3f92 Cleanup: use 'e' prefix for enum typedefs
Convention was only followed loosely,
apply to DNA where changes aren't likely to conflict.

(Skipped ModifierType for eg).
2017-10-17 13:49:20 +11:00
dd91d7d09d Merge branch 'master' into blender2.8 2017-10-17 12:42:51 +11:00
57ec19e0e5 WM: immediate line-gesture activation on tweak
Matches border-gesture behavior,
needed for binding bisect to tweak event.
2017-10-17 12:39:42 +11:00
8ffb761387 GPUFramebuffer: Fix recursive downsample exiting early.
I should really proof read my commits a bit more.
2017-10-17 03:06:04 +02:00
d0f4d0df2a Knife Tool: add wait_for_event option 2017-10-17 11:50:59 +11:00
7d71007cfb GPU Extension: Fix AMD Vega + open source driver detection. 2017-10-17 00:53:14 +02:00
Julian Eisel
3b6d7b5152 Docs: Add comments on workspace removal functions 2017-10-16 23:19:15 +02:00
Julian Eisel
d2fc4deb09 Fix warnings for notifier listeners 2017-10-16 22:53:58 +02:00
Dalai Felinto
314542ffd4 Fix for objects trailing in viewport when using BI in scene+Eevee in workspace
Thanks for Clément Foucault for finding where to tackle.
2017-10-16 18:37:40 -02:00
Dalai Felinto
73ca54283c Fixup for recent workspace changes: Python files
I wrongly changed some of these files via sed, and apparently overdid
it in some false positives.
2017-10-16 17:59:13 -02:00
Dalai Felinto
d3e7a737de Silence warning 2017-10-16 17:53:57 -02:00
Dalai Felinto
eae622d2dd Workspace: Call BKE_viewrender_free from the right place
We should call it when we free the workspace, not when removing it.
Patch by Julian Eisel.
2017-10-16 17:52:49 -02:00
Dalai Felinto
e4f2b2be26 Workspace: Move engines to workspace and Properties Editor cleanup
Engine is not stored in WorkSpaces. That defines the "context" engine, which
is used for the entire UI.

The engine used for the poll of nodes (add node menu, new nodes when "Use Nodes")
is obtained from context.

Introduce a ViewRender struct for viewport settings that are defined for
workspaces and scene. This struct will be populated with the hand-picked
settings that can be defined per workspace as per the 2.8 design.

* use_scene_settings
* properties editor: workshop + organize context path

Use Scene Settings
==================
For viewport drawing, Workspaces have an option to use the Scene render
settings (F12) instead of the viewport settings.

This way users can quickly preview the final render settings, engine and
View Layer. This will affect all the editors in that workspace, and it will be
clearly indicated in the top-bar.

Properties Editor: Add Workspace and organize context path
==========================================================

We now have the properties of:

Scene, Scene > Layer, Scene > World, Workspace

[Scene | Workspace] > Render Layer > Object
[Scene | Workspace] > Render Layer > Object > Data
(...)

Reviewers: Campbell Barton, Julian Eisel
Differential Revision: https://developer.blender.org/D2842
2017-10-16 17:29:04 -02:00
Dalai Felinto
e8962f90de Fix compatibility flag for nodetree
NODE_NEWER_SHADING was introduced in e868b459bb however it should have been
added as a bitflag.

BKE_scene_uses_blender_eevee() was used in gpu_shader_output() as a workaround
for compatibility being poorly used.

Anyways this fixes this situation. This is necessary for an upcoming patch, even
though this is considered temporary - since the other NODE_*_SHADING values are
legacy from Blender Internal drawing.
2017-10-16 16:36:45 -02:00
67e0a44e61 Replace freeing checks with MEM_SAFE_FREE 2017-10-17 00:45:14 +13:00
a2758152e2 Merge branch 'master' into blender2.8 2017-10-16 22:28:24 +11:00
870b4b6735 WM: refactor gestures for use as tools
Border and circle select wait for input by default.
This commit uses bool properties on the operators instead of
magic number (called "gesture_mode").

Keymaps that define 'deselect' for border/circle select
begin immediately, exiting when on button release.
2017-10-16 22:21:46 +11:00
6d8f63a834 Fix T53054: Parentless bone + IK crashes 2017-10-16 22:21:45 +11:00
8550c2b922 Cleanup: modal operator border callback names
Use same convention as all others.
Remove 'select' since these are used for zoom as well.
2017-10-16 17:03:08 +11:00
83b60dac57 WM: store modal operator last-properties
Avoids modal operators needing to explicitly store them.
2017-10-16 16:38:02 +11:00
946a4fe85a WM: Don't save mouse-paths to operator history
In preparation for modal operators storing their properties,
no need to keep mouse-paths around.

Also use generic function for lasso properties.
2017-10-16 16:14:07 +11:00
8bda35d2f4 WM: remove hard-coded circle radius memory
Replace with operator type 'last_properties'.

Also use generic function for circle gesture properties.
2017-10-16 15:32:09 +11:00
14af3e485f Merge branch 'master' into blender2.8 2017-10-16 14:31:19 +11:00
137586a13c Event System: Prevent mouse motion in click events
Don't convert mouse button events to click if they include dragging.
Double-click events already checked for this.
2017-10-16 14:27:10 +11:00
201b02f2a7 Cleanup: simplify lasso reallocation
Remove unneeded define, double allocations when increasing.
2017-10-16 14:27:10 +11:00
cae9770954 Cleanup: rename gesture mode to is_active
Wasn't obvious what this did at a glance.
2017-10-16 14:27:10 +11:00
811dbf5525 Code cleanup: deduplicate primitive refit code. 2017-10-15 21:53:58 +02:00
383df45af9 Fix bad 'poll' prop callback API doc.
This was added to all prop types, when it is only available for Pointer ones.
2017-10-15 20:38:29 +02:00
2e50add164 Fix OpenCL performance regression after cubic interpolation.
Reorganize code to reduce register pressure.
2017-10-15 17:46:50 +02:00
a1bb2ae0d7 Merge branch 'master' into blender2.8 2017-10-14 19:29:11 +11:00
49f4ac17bf Edit Mesh/Curve: Median center for click extrude
Was using bound-box center which depends on rotation.
2017-10-14 19:27:21 +11:00
f4b5d0ba3a Add some basic 4K render presets.
This difinition is becomming rather common now, time to add it to our
collection imho (requested in T53064).
2017-10-14 10:08:48 +02:00
8fb2e46193 Edit Mesh: click extrude, ensure inverse matrix
Relied on this being set elsewhere which isn't assured.
2017-10-14 19:05:12 +11:00
0e35c900d8 Merge branch 'master' into blender2.8 2017-10-14 17:58:29 +11:00
8bac5ea0c5 Correct bezier curve assert
Bezier curves should have v-points zero'd.
2017-10-14 17:54:43 +11:00
b0fa10f880 Merge branch 'master' into blender2.8 2017-10-14 17:38:06 +11:00
7cd9926fd8 Cleanup: use const for events 2017-10-14 17:30:15 +11:00
Julian Eisel
61fe8e8aca Hide "Confirm on Release" button from transfor redo options
Hide-flag wasn't set so option shows up in keymap editor. But seems like
that flag is ignored there by now anyway.
2017-10-14 01:12:30 +02:00
a09b8c08fc Eevee: Contact Shadows: Fix remaining artifacts.
There was noise correlation between the rotation random number and the radius random number used in the contact shadow algo.
Hacking a new distribution from the old distribution (may not be ideal because it's discrepency may be high)
Also distribute samples evenly on the shadow disc. (add sqrt)

Fix the "bias floating shadows", was cause by the discarding of backfacing geom which makes no sense in this case.
2017-10-12 17:36:24 +02:00
e416f417e0 Fix scene deletion code to match master's behavior.
Previous code, while more correct than old master one, could still lead
to invalid state in some corner cases (like linked scenes...).
2017-10-12 16:50:53 +02:00
557dc7d343 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/screen/screen_edit.c
2017-10-12 16:40:35 +02:00
a51688d0b0 Fix T53052: ID decrement error when deleting a scene, either python or GUI.
User count of scenes was inconsistant, screens only have 'user_one' kind
of owning over scenes, which means they shall never increment or
decrement their real user count. And usually, scenes have no real user
at all.
2017-10-12 15:54:43 +02:00
3b4f6996a8 Fix T52999: floating (popup) panels/menus could jump around screen in some cases.
Would happen during panel's refresh drawing, if drawing code had to adjust
final panel position compared to the initial one computed based on the
mouse coordinates, and user had dragged the floating panel around.

Issue fixed by adjusting stored mouse coordinates once final panel
position is known, such that they would directly generate those
coordinates. that way, the basic offset applied to those stored mouse
coordinates during panel dragging is valid, and recreating panel based
on those won't make it jump in screen.

Note that panel will still jump in case user dragged it partially out of
view - we could prevent that, but imho it's better to keep that
behavior, since redraw can generate a popup of different size, which
could end up with a totally out-of-view one...

Hopefully this fix does not break anything else!
2017-10-12 14:50:18 +02:00
b29e37ed81 Docs: add note for bmesh face_split_edgenet 2017-10-12 23:36:42 +11:00
5f025a7e5e Object Mode: Grid: Add a non-hard depth test.
This adds a custom depth test that have the benefits to glitch less and be more visually pleasing.
Downside is that it let the grid pass trough the objects a little.

This effect is done in NDC space so that it counteract the logarithmic depth distribution imprecision (read as it's less visible near the camera but more present far away).

This patch also includes some cleanups.
2017-10-12 04:03:42 +02:00
5ea729845d Fix T53048: OSL Volume is broken in Blender 2.79
Was a mistake in optimization commit which was disconnecting closures and nodes
which does not make sense for volume output.

OSL script we can't ignore and can't currently know in advance if it's a proper
volume shader or not. So we never disconnect OSL nodes from volume output.

This is a good candidate for corrective release.
2017-10-11 15:22:40 +05:00
4fce3c7ac0 Cycles: Speedup up tangent space calculation
This patch goes away form using C++ RNA during tangent space calculation which
avoids quite a bit of overhead. Now all calculation is done using data which
already exists in ccl::Mesh. This means, tangent space is now calculated from
triangles, which doesn't seem to be any different (at least as far as regression
tests are concerned).

One of the positive sides is that this change makes it possible to move tangent
space calculation from blender/ to render/ so we will have Cycles standalone
supporting tangent space.

Reviewers: brecht, lukasstockner97, campbellbarton

Differential Revision: https://developer.blender.org/D2810
2017-10-11 13:19:15 +05:00
a421607569 Cycles: Add utility function to calculate triangle's normal 2017-10-11 13:18:59 +05:00
552d15c976 Cycles: Add utility function to remove given attribute 2017-10-11 13:18:59 +05:00
dc95c79971 Merge branch 'master' into blender2.8 2017-10-11 13:14:16 +05:00
4782000fd5 Cycles: Fix possible race condition when initializing devices list 2017-10-11 12:48:19 +05:00
d83bcf7071 Cycles tests: Don't proint braces for empty status 2017-10-11 12:36:18 +05:00
ef1918d312 Gawain: Fix instancing messing next draw.
Everything was fine if one batch is always used with instancing. But problem arise if the next drawcall for this batch is not using instancing as the attrib divisor stays set to 1 in th VAO.

As instancing is less used than normal drawing I prefer to reset the divisor after drawing as it is reset before drawing instances.
2017-10-11 02:15:42 +02:00
d46842108d Eevee: Probe: Add Cubemap Resolution option. 2017-10-11 02:15:42 +02:00
31386afaa1 Eevee: Fix light grid being rendered after delete. 2017-10-11 02:15:42 +02:00
9f3c7c75b7 Eevee: Fix TAA color drifting.
This was caused by small float precision being insuficient. The blue component of R11F_G11F_B10F has lower precision than the other 2 components. This resulted in colors drifting towards a yellowish tone.

Using RGBA16F for the concerned buffer. This double the memory usage of the framebuffers and add subsequent bandwidth usage.
2017-10-11 02:15:42 +02:00
12fa6750f5 Eevee : Add a workaround for bug with AMD RX VEGA Linux + Mesa Driver
This bug (explained here https://github.com/dfelinto/opengl-sandbox/blob/downsample/README.md) is breaking eevee beyond the point it's workable.

This patch workaround the issue by making sure every fbo have mipmaps that are strictly greater than 16px. This break the bloom visuals a bit but only for this setup.
2017-10-11 02:15:42 +02:00
eb734746a8 Eevee: Fix hashed and alpha clip transparency. 2017-10-11 02:15:42 +02:00
5e6329b2f8 Eevee : SSR : Fix incorrect framebuffer issue.
It was cause by a texture without mipmap levels.
2017-10-11 02:15:42 +02:00
99eb13d3f7 Fix T53040: Vertex paint, texure & symmetry fail
Removed old logic for brush texture which was being applied twice.
2017-10-10 23:31:07 +11:00
d2326e888a Vertex Paint: add back missing VertProjHandle free
Also avoid passing large struct as value.
2017-10-10 22:32:30 +11:00
0592ac09ff Correct logic for vertex paint smear
Swapping gave values from the state before the last.
Thanks to @angavrilov for spotting.
2017-10-10 20:38:52 +11:00
582fbda18f Fix Sculpt 2D falloff, missing brush caused crash 2017-10-10 19:52:11 +11:00
8d73ba58b6 Cycles: Fix compilation of sm_20 and sm_21 kernels
Was broken since the bicubic commit for GPU support.
2017-10-10 12:26:02 +05:00
c90ec276b8 Manipulator: add cage3d scale widget
For now only show this when scale manipulator is active.
2017-10-10 03:08:53 +11:00
caba67c2fa Recent check for navigation missed NULL check 2017-10-10 02:43:56 +11:00
Dalai Felinto
fdeb125c7a Fix T53014: Cycles material preview not working
This was introduced on 9ad2c0b615 and partly mended on 8a1d787b89.
2017-10-09 11:41:57 -03:00
6ec43a765b Merge branch 'master' into blender2.8 2017-10-10 01:36:36 +11:00
e9d06f0866 UI: VSE strip menu reorganization
Add Inputs and Transform submenus.
2017-10-09 13:59:49 +11:00
e360d003ea Cycles: schedule more work for non-display and compute preemption CUDA cards.
This change affects CUDA GPUs not connected to a display or connected to a
display but supporting compute preemption so that the display does not
freeze. I couldn't find an official list, but compute preemption seems to be
only supported with GTX 1070+ and Linux (not GTX 1060- or Windows).

This helps improve small tile rendering performance further if there are
sufficient samples x number of pixels in a single tile to keep the GPU busy.
2017-10-08 21:12:16 +02:00
Mathieu Menuet
5aa08eb3cc Fix T53017: Cycles not detecting AMD GPU when there is an NVidia GPU too.
Best guess is that cuInit() somehow interferes with the AMD graphics driver
on Windows, and switching the initialization order to do OpenCL first seems
to solve the issue.
2017-10-08 18:36:02 +02:00
abcda06934 Eevee: Fix bad defines for volumetric shadowing 2017-10-08 18:23:45 +02:00
9ea2a7c02d Fix potential string buffer overruns.
Note that our library path handling is still rather dodgy on this
regards, shall take some time at some point to seriously sanitize it...
2017-10-08 16:08:00 +02:00
f7db1a4366 Gawain: Make common uniforms become builtins
This improves eevee's cache performance by 13% in my test.
2017-10-08 15:49:25 +02:00
cdb0b3b1dc Code refactor: use DeviceInfo to enable QBVH and decoupled volume shading. 2017-10-08 13:17:33 +02:00
4b3e6cb728 Cleanup: --help text
Sync with manual
2017-10-08 18:49:58 +11:00
c3d3483223 CMake: Re-order PYTHON_VERSION check
Missing paths would error first.
2017-10-08 14:05:22 +11:00
f61c340bc1 Cycles: OpenCL bicubic and tricubic texture interpolation support. 2017-10-08 02:55:44 +02:00
c040dedc12 Fix incorrect MIS with principled BSDF and specular roughness 0. 2017-10-07 22:10:02 +02:00
c921c3bcd0 [cmake] Add minimum python version check to cmake to prevent later build errors. 2017-10-07 07:58:54 -06:00
d7eabc6765 Code cleanup: simplify cmake kernel install. 2017-10-07 15:32:20 +02:00
2d92988f6b Cycles: CUDA bicubic and tricubic texture interpolation support.
While cubic interpolation is quite expensive on the CPU compared to linear
interpolation, the difference on the GPU is quite small.
2017-10-07 15:30:57 +02:00
23098cda99 Code refactor: make texture code more consistent between devices.
* Use common TextureInfo struct for all devices, except CUDA fermi.
* Move image sampling code to kernels/*/kernel_*_image.h files.
* Use arrays for data textures on Fermi too, so device_vector<Struct> works.
2017-10-07 14:53:14 +02:00
d013b56dde Actually force accumulate mode for the Smear brush in weight/vertex paint.
Just removing the checkbox from UI isn't enough for proper behavior.
2017-10-07 13:53:54 +03:00
6b8abefcc6 Make weight paint blur thread safe, and fix smear ignoring mirror.
Instead of trying to be clever with swaps and lazy updating the weight
data, simply recalculate one single array. To improve performance, use
threading for that.
2017-10-07 12:45:21 +03:00
adfbf276a1 Cleanup: style, duplicate includes 2017-10-07 15:57:14 +11:00
37b457221e Cleanup: remove Py3.5 compatible code 2017-10-07 15:14:36 +11:00
Dalai Felinto
8a1d787b89 Initial fix for T53014: Cycles material preview no light
This was introduced on 9ad2c0b615.

Although this still doesn't fix the issue, it updates the preview
system to use COLLECTION_DISABLED as intended.

What is missing now is for the flushing to work effectively.
2017-10-06 18:55:48 -03:00
dfcdec914c Eevee: Shadows: Add Contact Shadows
This add the possibility to add screen space raytraced shadows to fix light leaking cause by shadows maps.

Theses inherit of the same artifacts as other screenspace methods.
2017-10-06 23:44:22 +02:00
9ab18d14f6 Eevee: Modify the raycast function to be more flexible.
Make quality a parameter, and modify the ray end to be premultiplied so that the raytrace is done on a range.

This is in order to add contact shadows.
2017-10-06 23:44:22 +02:00
Dalai Felinto
321f773ca6 Merge remote-tracking branch 'origin/master' into blender2.8 2017-10-06 13:09:24 -03:00
83ce02879f Cycles: Fix possible race condition when generating Beckmann table
Two issues here:

- Checking table size to be non-zero is not a proper way to go here. This is
  because we first resize the table and then fill it in. So it was possible that
  non-initialized table was used.

  Trickery with using temporary memory and then doing table.swap() might work,
  but we can not guarantee that table size will be set after the data pointer.

- Mutex guard was useless, because every thread was using own mutex. Need to
  make mutex guard static so all threads are using same mutex.
2017-10-06 21:06:15 +05:00
Julian Eisel
b0ecd2eaaa Fix crash when deleting workspace active in multiple windows 2017-10-06 18:02:15 +02:00
Dalai Felinto
5ec270c20c Merge remote-tracking branch 'origin/master' into blender2.8 2017-10-06 12:21:57 -03:00
837383ac78 Cycles: Cleanup, indendation 2017-10-06 19:33:59 +05:00
a4a5637d7a Gawain: Reduce shader interface bucket size
Tried 101 but it gives colisions.
I think 257 is enough now that we dont have thousands of uniforms.
This gives some noticeable performance improvement.
Could be refined further.
2017-10-06 16:25:50 +02:00
f94f141f24 Gawain: Add UBOs to shader interface. 2017-10-06 16:25:50 +02:00
a950af8e24 Fix T53012: Shadow catcher creates artifacts on contact area
The issue was caused by light sample being evaluated to nan at some point.
This is root of the cause which is to be fixed, but is very hard to trace down
especially via ssh (the issue only happens on AVX2 release build). Will give it
a closer look when back to my AVX2 machine.

For until then this is a good check to have anyway, it corresponds to what's
happening in regular radiance sum.
2017-10-06 17:27:34 +05:00
0d3c8d0701 Cycles: Cleanup, indentation and wrapping 2017-10-06 16:54:37 +05:00
ea606a7847 Merge branch 'master' into blender28 2017-10-06 21:25:33 +11:00
3df139c530 Cleanup: Math lib naming (use v3 suffix) 2017-10-06 21:06:38 +11:00
70aa33f069 Sequencer: Cleanup, use more BLI utilities where possible 2017-10-06 15:00:22 +05:00
00eac066f3 Sequencer: Use BLI math functions where possible 2017-10-06 14:36:41 +05:00
d56f835bff Sequencer: Avoid re-calculation index offset multiple times 2017-10-06 14:36:41 +05:00
5bbe818aeb Sequencer: Use funciton instead of macr oto avoid argument re-evaluation 2017-10-06 14:36:41 +05:00
c756787694 Fix T52940: VSE Glow Effect Strip on transparent images has no blur 2017-10-06 14:36:41 +05:00
55b7adb9e5 Error in falloff_angle range in last commit 2017-10-06 20:20:15 +11:00
471be7e7f5 Vertex Paint: move normal falloff into the brush
All related settings are already in the brush,
so it's inconvenient to switch panels to change this one option.
2017-10-06 20:15:28 +11:00
6c43490616 Vertex Paint: use view normal w/ 2D falloff
When projecting to the view, cull faces pointing
away from the view normal.
2017-10-06 19:10:33 +11:00
8ef757df3d Vertex Paint: use brush front-face setting
Follow sculpt mode more closely by using the brush front-face option.
2017-10-06 18:57:37 +11:00
082987ec74 Sculpt: use tube falloff when calculating normals
Also apply 2D clamping for other tools when the option is set.
2017-10-06 18:34:05 +11:00
3282218983 Sculpt: clamp normal to plane w/ projected falloff
Allows for editing outlines w/o pushing geometry towards/away from
the view.
2017-10-06 17:38:56 +11:00
327bb6e543 Fix ruler access from search pop-up
D2831 by @1xundoredo
2017-10-06 17:13:44 +11:00
c454d816a9 Cleanup: style 2017-10-06 16:56:41 +11:00
d7d32ad452 Gawain: Simplify / optimize the shader interface.
This changes quite a few things:
- Drops the allocation of inputs as a chunk.
- Merge the linked list system into the Gwn_ShaderInput.
- Put name buffer into another memory block, easily resizable.
- Use offset instead of char* to direct to input name.
- Add only requested uniforms dynamicaly to the Shader Interface.

This drops some minor optimisation and use a bit more memory for small shaders (which are fixed count).
But this saves a lot of memory when using UBOs because the names and the Gwn_ShaderInput were alloc'ed for every UBO variable.
This also reduce the Shader Interface initial generation.
The lookup time is left unchanged.
2017-10-06 01:50:51 +02:00
9ab3db11c7 Revert "Gawain: Optimize out extra level on top of ShaderInput"
This reverts commit 5514d2df1c.
2017-10-06 01:50:16 +02:00
c82efd3276 Fix T52514: don't clear filename when dropping directory path in file browser. 2017-10-06 00:18:57 +02:00
64f8cc3e7d Fix T52998: disabled menu entries responding to key shortcuts. 2017-10-05 19:12:05 +02:00
63482a5f2e Fix T53002: Batch-Generate Previews generate empty or none image for large objects.
Camera clipping was left to default values, which won't work well for
very large (or small) objects. Now recompute valid clipping start/end
based on boundingbox of rendered data, and final location of camera.
2017-10-05 18:13:30 +02:00
4537e85584 Fix T53001: more workarounds for crash in AMD compiler with recent drivers. 2017-10-05 17:57:58 +02:00
fb99ea79f8 Code refactor: split displace/background into separate kernels, remove luma. 2017-10-05 17:57:58 +02:00
d8509b349d Sculpt Mode: 2D falloff option
This makes brush influence into a tube instead of a sphere.
It can be used along the outline of a mesh to adjust it's silhouette.

Note that all this takes advantage of changes from vertex paint,
from testing this seems useful so exposing from the brush options.
2017-10-06 01:20:31 +11:00
5514d2df1c Gawain: Optimize out extra level on top of ShaderInput
This is an internal structure, and we don't put it to a list for anything else
that hash collision resolution. No need to have dedicated entry here, saves us
from extra allocation and pointer dereference.
2017-10-05 18:38:23 +05:00
e1e452c062 Draw manager: Avoid unneeded memory malloc/free when attempting to create missing uniform 2017-10-05 17:16:37 +05:00
0b5bdc4265 Gawain: Make builtin uniform lookup to be O(1) 2017-10-05 16:19:14 +05:00
bb9b8b13e5 Gawain: Lookup uniforms and attributes from buckets
This way we reduce number of loops from look-over-all-inputs to
loop-over-collision, which is expected to be much less CPU ticks.

There is still possible optimization: use memory pool of some sort
to manage memory needed for hash entries, but that will only speedup
shader interface construction / deconstruction time.

There are also some trickery happening to speed up process even more
in the case there is no hash collisions detected when constructing
shader interface.
2017-10-05 15:46:15 +05:00
bda3e14f05 Gawain: Force hashing function to be inlined
Makes sure we don't waste CPU ticks on function call in such a time critical
area.
2017-10-05 15:46:15 +05:00
56a07ba706 Vertex Paint: apply when cursor isn't over faces
This behavior makes more sense for sculpt, less so for painting.
Restores non PBVH behavior, adding `BKE_pbvh_find_nearest_to_ray` -
similar to ray-cast except it finds the closest point on the surface.
2017-10-05 21:21:01 +11:00
0badb6c804 Cleanup: rename dist -> depth
Prepare to add code that stores distance to the ray, avoid confusion.
2017-10-05 21:09:12 +11:00
21d91de8e7 Cleanup: remove unused struct member
Merged with soc-2016-pbvh-painting, no longer needed.
2017-10-05 17:52:05 +11:00
82d6a30015 Disable cursor drawing while navigating
Was performing ray-casts in sculpt mode on every update.
2017-10-05 17:35:46 +11:00
775c773cf4 Fix sculpt secondary color missing some brushes
D2841 by @uvwxyz w/ edits
2017-10-05 12:59:22 +11:00
3c67efbbc5 Cleanup: use bool for brush checks 2017-10-05 12:59:18 +11:00
974053f7e9 Fix brush reset (missing notifier)
D2843 by @uvwxyz
2017-10-05 12:32:24 +11:00
57a93b4678 CMake: use restrict w/ gcc, not clang 2017-10-05 12:10:34 +11:00
96477be3b6 PyAPI: fast keyword parsing for bpy modules
No functional changes.
2017-10-05 10:52:18 +11:00
7cc952ac5d CMake: add -Wrestrict for GCC 2017-10-05 10:50:51 +11:00
d27ca066e7 Fix passing the same argument twice to BLI_strncpy 2017-10-05 10:50:51 +11:00
ffb190244c Fix setting the operator name in Py operator API 2017-10-05 10:50:51 +11:00
49199963bf Fix incorrect CUDA remaining time estimate after previous commit. 2017-10-04 23:25:51 +02:00
6da6f8d33f Cycles: CUDA faster rendering of small tiles, using multiple samples like OpenCL.
The work size is still very conservative, and this doesn't help for progressive
refine. For that we will need to render multiple tiles at the same time. But this
should already help for denoising renders that require too much memory with big
tiles, and just generally soften the performance dropoff with small tiles.

Differential Revision: https://developer.blender.org/D2856
2017-10-04 21:58:47 +02:00
31820d0109 Eevee : Fix T52991 2017-10-04 21:31:47 +02:00
77f300e2a9 Fix use of uninitialized memory in Cycles normal baking. 2017-10-04 21:11:14 +02:00
5bb677e592 Code refactor: zero render buffers outside of kernel.
This was originally done with the first sample in the kernel for better
performance, but it doesn't work anymore with atomics. Any benefit was
very minor anyway, too small to measure it seems.
2017-10-04 21:11:14 +02:00
12f4538205 Code refactor: use split variance calculation for mega kernels too.
There is no significant difference in denoised benchmark scenes and
denoising ctests, so might as well make it all consistent.
2017-10-04 21:11:14 +02:00
e3e16cecc4 Code refactor: remove rng_state buffer and compute hash on the fly.
A little faster on some benchmark scenes, a little slower on others, seems
about performance neutral on average and saves a little memory.
2017-10-04 21:11:14 +02:00
5b7d6ea54b Code refactor: add WorkTile struct for passing work to kernel.
This makes sharing some code between mega/split in following commits a bit
easier, and also paves the way for rendering multiple tiles later.
2017-10-04 21:11:14 +02:00
660e8e59e7 Fix T52645, T52645: AMD OpenCL compiler crash with recent drivers.
Work around the bug by reshuffling code.
2017-10-04 21:00:46 +02:00
754f5d39c5 installdeps: Fix building numpy with newer py system...
Many thanks to Jens Verwiebe for investigating and finding this fix.
2017-10-04 20:16:39 +02:00
57d7e5b6ee Fix T42489 and T52936: Loading blend with minimized window results in crash or empty screen on windows.
Reviewed By: @brecht , @sergey

Differential Revision: http://developer.blender.org/D2866
2017-10-04 11:44:22 -06:00
63c472b4f9 Merge branch 'master' into blender2.8 2017-10-04 22:18:05 +05:00
296757804c Fix error copying smoke modifier uv layer 2017-10-05 02:44:02 +11:00
9609828000 Tssst, we use USA english, not Oxford one... :P 2017-10-04 12:42:33 +02:00
a22af1a84b Fix i18n messages extraction script, and a few more UI messages... 2017-10-04 12:39:06 +02:00
b22b2c783d Fix T52982: Join operator with context override crashes Blender 2.79 2017-10-04 15:00:05 +05:00
d1dfed206b Fix T52923: Circle diameter is in fact radius 2017-10-04 18:01:53 +11:00
08f728a3e9 Cleanup: redundant casts 2017-10-04 16:52:55 +11:00
d3f0fa1277 Docs: remove outdated PyAPI guide 2017-10-04 15:57:43 +11:00
92272f56e6 PyAPI: fast keyword parsing for __import__
No functional changes.
2017-10-04 15:54:41 +11:00
728cffa9ce PyAPI: fast keyword parsing for bpy.props
No functional changes.
2017-10-04 15:13:52 +11:00
ad22d29dac Some UI/messages fixes. 2017-10-03 21:32:46 +02:00
9422db7796 Eevee: Some changes to the Render / Render layers settings panel.
- Separate the Post Processes settings into sub panel.
- Rename "Viewport Anti-Aliasing" to sampling & super-sampling as it also reduce the noise of other effects.
- Remove Temporal Anti-Aliasing toggle and make it always active unless the number of samples is 1.
2017-10-03 18:30:56 +02:00
57c323b5d3 Object Mode : Fix probe paralax display. 2017-10-03 18:30:56 +02:00
f40fa55b58 DRW: Fix Feedbackloop warning. 2017-10-03 18:30:56 +02:00
239b38cd64 CMake: avoid naming collision 2017-10-04 01:35:24 +11:00
cbe07d980c Python: bump minimum version to 3.6 2017-10-03 23:50:34 +11:00
7ae02c2ddb Cleanup: remove unused vpaint projection handle 2017-10-03 23:43:30 +11:00
a4721c0504 Weight Paint: blend smear tool 2017-10-03 23:35:30 +11:00
6a7dc3348a Vertex Paint: fix feedback loop w/ smear tool
Was reading and writing from same array,
this also makes smear thread-safe.
2017-10-03 23:07:13 +11:00
314d93838e Fix bplayer (c) 2017-10-03 12:31:51 +02:00
61d5c5a64f Fix T52981: 2D Curve shapes do not render untill extruded
Regression since 9298c53.
2017-10-03 15:29:39 +05:00
Alexander Gavrilov
7c2d5eaacb Change weigth paint accumulate mechanics to fix problems with mirroring.
Restoring weights is problematic when the stroke overlaps its mirror.
It's better to simply compute the new weight based on the saved data
rather than restoring things, and check that the change is monotonic.

This way is also closer to how things worked before the merge.
2017-10-03 12:41:37 +03:00
975ed05edb Vertex Paint: smear got wrong last-location 2017-10-03 20:19:59 +11:00
7640d5e92a Error in last commit, weight must be set for non-accumulate 2017-10-03 19:24:02 +11:00
f4b1f9b925 Vertex Paint: remove accumulate (soc-2017-vertex_paint)
This secondary accumulation option accumulated brush falloff.
The same option in image painting accumulates color
as vertex paiht 'Spray' does.

Giving this option different behavior for vertex paint seems strange.
Also this is basically increasing falloff over time.

Remove the new code, expose existing 'Spray' as 'Accumulate'
to match other paint modes.
2017-10-03 19:09:28 +11:00
2bfa061a15 Merge branch 'master' into blender2.8
Notes:

- Changes in paint_vertex.c were simple to merge, mainly related on passing
  evaluation context.

- Conflicts in EditDM and drawmesh.c are solved using code from blender2.8
  branch. Those areas are deprecated and not to be used in final release.

  However, it's possible that some reference code from master is lost, so
  keep attention when adding alpha support for vertex painting.
2017-10-03 12:59:06 +05:00
515e69999e Weight Paint: don't set weight w/ average brush
Also use 'const' for brush.
2017-10-03 18:43:18 +11:00
2b3ff61d80 Correct int division in last commit 2017-10-03 17:36:55 +11:00
6092ded127 Weight Paint: add some color blending modes
While these mostly make sense for color,
there is no harm in supporting.
2017-10-03 17:24:29 +11:00
2136942916 Eevee : Fix grid black fill. 2017-10-02 22:17:20 +02:00
2bd36338d3 Gawain : Add workaround to fix bad sync of the program_in_use flag. 2017-10-02 22:16:50 +02:00
c548c76804 Eevee : Fix ghosting from probe data when toggling "only render". 2017-10-02 20:02:21 +02:00
5f7192018e Eevee : SSR : Make sure to not apply Specular Occlusion to SSR.
This makes the metals shine more.

Previous behaviour was not correct.
2017-10-02 19:44:44 +02:00
04e4a0db0d Eevee : Probe Grid : Fix Update tagging. 2017-10-02 18:42:18 +02:00
73ab572c0a Eevee : Probe Cubemap : Fix Broken Display data. 2017-10-02 18:42:18 +02:00
21ec254ae2 Eevee : Light Grid : Init grid to black instead of world color.
This was a mistake to use world color because it introduce light bleeding on indoor environement.
2017-10-02 18:42:18 +02:00
dc327e2793 Eevee : Lamps : Change ESM default exponent.
Users are thinking that ESM are not soft because of the default value.
2017-10-02 18:42:18 +02:00
9f8bb5813b Buildbot: Re-enable cuda binaries, those should work 2017-10-02 20:24:58 +05:00
Alexander Gavrilov
88dd45e1e1 Disable multithreaded weight paint when mirroring is enabled.
Mirroring writes to the mirror vertex within the direct vertex
draw function, which violates assumptions required for processing
vertices in parallel.
2017-10-02 17:33:51 +03:00
64afba0244 Remove brush versioning (again!)
Causes crash, see c133927bb

Merging soc-2017-vertex_paint brought this back by accident.
2017-10-03 00:56:45 +11:00
8b1b7e8d10 Depsgraph: Fix/workarounf when tagging light probe for data update 2017-10-02 18:49:49 +05:00
64c1a48c50 Fix T52927: Compositor wrong scale when scale size input is connected to complex node
The issue here is that we can not read scale from socket when determining
dependent area of interest. This area will depend on current pixel. Now fall
back to more stupid but reliable thing: if scale size input is connected to some
nodes, we use the whole frame as area of interest.
2017-10-02 15:55:52 +05:00
b2a10fa615 Vertex Paint: projection options
This makes vertex paint match image painting more closely.

- Add falloff shape option sphere/circle
  where sphere uses a 3D radius around the cursor and
  circle uses a 2D radius (projected), like previous releases.
- Add normal angle option so you can control the falloff.
- Add Cull option, to paint onto faces pointing away.

Disabling normals, culling and using circle falloff
allows you to paint through the mesh.
2017-10-02 22:07:58 +11:00
9d34ae6048 Sculpt: calculate plane instead of point,normal
No functional changes.
2017-10-02 22:07:57 +11:00
1cfee60419 Cleanup: add 'sphere' to sculpt test function name 2017-10-02 22:07:57 +11:00
2a744a9f2e Cleanup: indentation, whitespace 2017-10-02 22:07:57 +11:00
deb16defd5 Math Lib: distance to AABB
Original code by @mano-wii, modified for general use.
2017-10-02 22:07:39 +11:00
ff0938870f Compositor: Fix strict compilation warnings when debug is enabled 2017-10-02 15:18:10 +05:00
f06a60c25d Compositor: Fix compilation error with debug enabled 2017-10-02 15:12:04 +05:00
04704297d2 Fix T52920: Saving Tiff Files type Blender crashes
Was only happening for 3 and 1 channel sources.
2017-10-02 13:44:13 +05:00
864a53e276 Fix gradient tool crash with recent changes
Having gesture automatic free memory isn't practical if this
has it's own allocations.

Add option not to free userdata.
2017-10-02 01:34:51 +11:00
9a6aba2a94 Vertex Paint: use squared distance test
Avoids sqrt for verts that are later ignored
2017-10-02 00:44:04 +11:00
ba67d94258 Compile fixes for MSVC:
* missing include for uint typedef
* macro syntax error

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D2863
2017-10-01 15:34:12 +02:00
f1e7891588 Vertex Paint: respect 'normal' option
Recent changes ignored this option.
2017-10-01 23:53:24 +11:00
f55735e533 CMake: support CUDA 9 toolkit, and automatically disable sm_2x binaries.
Fermi cards (GTX 4xx and 5xx) are no longer supported with this version, so
we can keep supporting both CUDA 8 and 9 for a while.
2017-10-01 14:14:53 +02:00
22ecea9e38 Weight Paint: restore non-spray functionality
When painting with spray disabled - we need to re-apply
on top of the original each time.

Applying the soc-2016-pbvh-painting branch removed this.
While I'd added back a simple previous weight array,
this won't work when multiple groups are painted at once.
2017-10-01 21:21:24 +11:00
9139532dc8 Buildbot: Use latest master config from buildbot 2017-10-01 10:34:04 +02:00
29ed5f301d Buildbot: Extra tweaks to packing rules 2017-10-01 10:01:45 +02:00
ca3f7021de Buildbot: Tweaks to current macOS config
Also disable CUDA binaries for now, those would need some extra work.
2017-10-01 10:00:42 +02:00
88a08ef8ad Fix weight paint Blur, Smear and Average breakage in multi-paint mode.
This is most pronounced in Auto-Normalize + Multi-Paint. Unlike
vertex paint, the weights being painted on in weight paint mode
don't necessarily correspond to the weight actually stored in
any one vertex group, and may instead be a computed aggregate.

This restores original code behavior lost in rB4f616c93f7cb.
2017-10-01 10:00:34 +03:00
3349f25502 Eevee : Add a setting for the number of indirect light bounce.
This is used to tweak the overall spread of the lighting. It is a per renderlayer setting.
2017-10-01 02:19:10 +02:00
b03aa6afce LightProbe : Fix UI : display panels. 2017-10-01 01:23:48 +02:00
e249dfd0f6 Cleanup: Remove some old pre 2.5 IPO code 2017-09-30 16:38:53 -04:00
cc772e4bca Eevee: LightGrid: Fix progressive rendering. 2017-09-30 19:37:40 +02:00
1054f65a29 Object Mode : Add probes data outlines and selectability
This required some small changes to the data display shaders so that they match the way the object mode renders them.
Strangely enough, I had to remove the normal attribute from the display code because it was being not bound as soon as I created another rendering call in object mode. The problem may be deeper but I did not have time for this so I derive the normal from the sphere pos.
2017-09-30 19:37:40 +02:00
8249e1ce5e DRWCache: Add a new regular Quad buffer. 2017-09-30 19:37:40 +02:00
49c81e234a Fix vertex paint w/ subsurf drawing
Only use alpha blending when in vertex paint mode.
2017-09-30 19:24:45 +10:00
18965905d0 Merge branch 'master' into blender2.8 2017-09-30 11:00:29 +10:00
e3546a5097 Vertex Paint minor improvement w/ smear
Note that this tool seems like it might need to be rewritten
since results are quite strange.

Projecting on the view vector gives a small improvement though.
2017-09-30 02:58:37 +10:00
a270e61b82 Fix vertex paint smear tool
Checking surrounding verts wasn't working properly.
2017-09-30 02:56:31 +10:00
41e2dbaea9 Weight Paint: accumulate support
- Clamp accumulate so it doesn't exceed brush strength.
- Was multiplying by brush strength twice.
2017-09-30 01:36:41 +10:00
d4f8e4e30c Cleanup: de-duplicate copied code w/ vertex paint 2017-09-29 23:28:54 +10:00
9298c53e4c Fix T52943: don't export curves objects with no faces to Cycles.
Also skip any objects with zero ray visibility and meshes with
zero faces.
2017-09-29 14:54:34 +02:00
d2bbd41b4e Fix Cycles OpenCL compiler error after recent changes. 2017-09-29 14:54:10 +02:00
5553037be7 Cleanup: split out tools & utils from vertex paint
paint_vertex.c was getting too big, move all code unrelated to
mode switching and modal painting into their own files.

Also replace vertex-color operators region redraw tag /w notifiers.
2017-09-29 22:26:11 +10:00
e3fe8128e4 Merge branch 'master' into blender2.8 2017-09-29 19:55:00 +10:00
5a1954a5cb Drop platform support for Solaris & AIX
These platforms didn't see maintenance in years.
This commit just removes ifdef's & cmake check.
2017-09-29 19:16:34 +10:00
04e8a09662 GNUmakefile: add back 'git pull'
Seems this was removed by accident.
2017-09-29 19:02:20 +10:00
9cba119051 Collada: export vertex-color alpha 2017-09-29 18:12:14 +10:00
823bcf1689 RNA: expose mesh vertex alpha
Note that some import/export scripts will need updating
2017-09-29 18:10:25 +10:00
288b2d0aa6 Vertex Paint: Alpha Support
GSOC 2017 by Darshan Kadu, see: D2859.

This is a partial merge of some of the features from
the soc-2017-vertex_paint branch.

- Alpha painting & drawing.
- 10 new color blending modes.
- Support for vertex select in vertex paint mode.
2017-09-29 18:06:52 +10:00
97eefc1fd9 Code cleanup: remove unnecessary buildbot code after macOS library upgrade. 2017-09-28 23:37:57 +02:00
31be6fccf8 Eevee: Probe Grid: Clear Grid buffers with world diffuse coefs.
This make sure the values displayed by the "show data" sphere are initialized.

Also this make the bounce lighting progress more apparent.
2017-09-28 21:17:57 +02:00
12f650623e Eevee: Probe Grid: Add "progressive rendering"
This gives the user a more rapid preview of what the final result will be.

The grid cells are renderer in a series of powers of two offsets.
2017-09-28 21:16:02 +02:00
c10ac1bb5c macOS: officially upgrade to 10.9 libraries from lib/darwin.
This removes a bunch of code that is no longer needed, and running
"make update" will now automatically download the new libraries.

Differential Revision: https://developer.blender.org/D2861
2017-09-28 20:53:06 +02:00
Kim Christensen
2a36ee16c1 Fix T52574: make Cycles rendered tile counter more clear.
Differential Revision: https://developer.blender.org/D2853
2017-09-28 15:18:53 +02:00
400e6f37b8 Cycles: reduce subsurface stack memory usage.
This is done by storing only a subset of PathRadiance, and by storing
direct light immediately in the main PathRadiance. Saves about 10% of
CUDA stack memory, and simplifies subsurface indirect ray code.
2017-09-28 15:18:43 +02:00
9ddee885ae Fix T52086: Graph editor "normalize" drag errors for integers 2017-09-28 17:08:43 +05:00
f6e71fe727 Merge branch 'master' into blender2.8 2017-09-28 16:19:23 +05:00
3801f76b7b Fix T52932: Driver with target of custom property from scene fails to update
Note that this is only supported in new depsgraph.
2017-09-28 16:13:28 +05:00
7fdb9e168d Merge branch 'master' into blender2.8 2017-09-28 16:13:09 +05:00
75e8e3779b Curves: Fix wrong bitset being checked against CYCLIC bit flag
Based on report from Talos Security Advisory.
2017-09-28 14:33:59 +05:00
0ae1a1ed48 CMake: move MSVC warnings to central location 2017-09-28 13:41:54 +10:00
1f18523edf Cleanup: switch fall-through warning 2017-09-28 13:41:54 +10:00
c133927bb8 Adding paint brushes crashes w/ linked libs
While we could skip this for linked files,
convention so far is to only update startup.
2017-09-28 13:41:53 +10:00
64de8c8f0d Missed in last merge from master
Local changes built, but merge-commit needed amending.
2017-09-28 07:35:06 +10:00
fcdc7acd8b Eevee : TAA : Fix conflict with outlines.
The previous view was incorrectly considered valid even if the persp matrix was different. So the history depth was mismatching.
2017-09-27 21:21:39 +02:00
b24ba9b174 Object Mode Engine: Small cleanup 2017-09-27 21:21:39 +02:00
40f5ac4977 Eevee : TAA : Change post process chain to allow more flexibility
This basically do not use hardware blending and do the blending in the shader.
This will allow neighborhood clamping if we ever implement that.
2017-09-27 21:21:39 +02:00
88a3323a47 Eevee: Use fmod instead of floor. 2017-09-27 21:21:39 +02:00
5c6e3ff497 bgl module: extend gl_buffer_type_from_py_format_char function to work with more string formats
Only basic types of character codes were being used
2017-09-27 16:07:06 -03:00
cc8c064f11 Merge branch 'master' into blender2.8 2017-09-28 03:05:46 +10:00
5d23448290 [build_deps.cmd] Turn down logging verbosity to normal. 2017-09-27 10:54:27 -06:00
58f3f9c246 [msvc] treat C4133 as error instead of a warning to mimic gcc's -Werror=incompatible-pointer-types
as requested by @campbellbarton and @mano-wii
2017-09-27 10:11:00 -06:00
6c98859b77 Cleanup: warning 2017-09-28 02:04:58 +10:00
Dalai Felinto
16edfc516e --debug-gpu-shader: Dump GLSL shaders to disk
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.

It writes the shaders to the temporary blender session folder.
2017-09-27 18:03:00 +02:00
4f616c93f7 Vertex/Weight Paint: Use PBVH for painting
2016 GSOC project by @nathanvollmer, see D2150

- Mirrored painting and radial symmetry, like in sculpt mode.
- Volume based splash prevention,
  which avoids painting vertices far away from the 3D brush location.
- Normal based splash prevention,
  which avoids painting vertices with normals opposite the normal
  at the 3D brush location.
- Blur mode now uses a nearest neighbor average.
- Average mode, which averages the color/weight
  of the vertices within the brush
- Smudge mode, which pulls the colors/weights
  along the direction of the brush
- RGB^2 color blending, which gives a more accurate
  blend between two colors
- multithreading support. (PBVH leaves are painted in parallel.)
- Foreground/background color picker in vertex paint
2017-09-28 01:47:37 +10:00
2de5e14f53 bgl module: Interpret a buffer as a bgl.Buffer
Differential Revision: https://developer.blender.org/D2857
2017-09-27 11:20:00 -03:00
88520dd5b6 Code refactor: simplify CUDA context push/pop.
Makes it possible to call a function like mem_alloc() when the context is
already active. Also fixes some missing pops in case of errors.
2017-09-27 13:43:21 +02:00
32e453b495 D2830 - 2.8: Fix crash when creating new action
Patch by: Marcelo Mutzbauer (1xundoredo)
2017-09-27 14:16:27 +13:00
9bd40cbce1 Merge branch 'master' into blender2.8 2017-09-27 11:18:23 +10:00
43b4913051 Math Lib: Add non-clamped round_* functions
Replace iroundf with round_fl_to_int, add other types
2017-09-27 11:13:03 +10:00
a24dd6eaba Eevee: Fix bug with cubemap shadows. 2017-09-26 22:30:48 +02:00
540ef7ee8e Eevee: Fix broken World probe. 2017-09-26 21:43:14 +02:00
c1aca25c3b Eevee: TAA: Remove 32 sample limit. 2017-09-26 21:39:25 +02:00
b96c70f9b2 BLI_rand : Make use of BLI_halton and BLI_hammersley 2017-09-26 21:38:23 +02:00
47e6d53c8a BLI_rand : Add new low-discrepency sequences generator 2017-09-26 20:54:27 +02:00
5c45fe2937 Eevee : Fix regression : Refraction not working 2017-09-26 16:48:07 +02:00
772944a6b4 Merge branch 'master' into blender2.8 2017-09-27 00:24:10 +10:00
870dfb1b5a Cleanup: indentation 2017-09-27 00:17:28 +10:00
51c87bbad0 Cleanup: indentation 2017-09-27 00:05:06 +10:00
7593ac2aff Transform: add manipulator aligned bounds
ifdef'd out for now
2017-09-26 23:16:20 +10:00
d6800c1a81 Merge branch 'master' into blender2.8 2017-09-26 22:45:42 +10:00
482b665e02 Cleanup: remove bounds runtime data from scene 2017-09-26 22:33:25 +10:00
30f9cd710b GPUFramebuffer: Enable multisample when binding a Multisample FBO
For some reason it was not working on intel but was working on Nvidia.
2017-09-26 14:01:50 +02:00
496a354d7f DRW : Fix Compiler Warning 2017-09-26 13:59:31 +02:00
f853e724de Eevee : Fix compilation warning on intel. 2017-09-26 13:58:59 +02:00
1eb49f8a2f GPU_immediate_util: add cube drawing function 2017-09-26 17:51:47 +10:00
63dfb5bb97 Cleanup: naming (GPU immediate util) 2017-09-26 15:21:01 +10:00
86b81d25ea Missed from merge commit 2017-09-26 14:57:14 +10:00
24b083c8f3 Merge branch 'master' into blender2.8 2017-09-26 14:52:21 +10:00
aba2f8ea67 Beauty fill was skipping small faces 2017-09-26 12:59:23 +10:00
e40e29cd38 Fix T52871: beauty fill error
Only lock tri's facing different directions.
Needed because scanfill creates zero area faces.
2017-09-26 12:14:46 +10:00
293dc4e084 Revert "Fix T52871: BLI_polyfill_beautify_quad_rotate_calc_ex was mistakenly considering the state as degenerated"
This reverts commit a8f11f5422.

Result is no longer symmetrical, will investigate a different fix.
2017-09-26 12:14:04 +10:00
262ddbfda0 Add missing header 2017-09-26 12:14:04 +10:00
96e84d002a Fix T52901: New Depsgraph - Driver using "self" needs reloading file to work 2017-09-26 13:29:48 +13:00
b0ccf2322b Fix: When transforming GP strokes in "Local" mode, the strokes would get obscured
by the transform constraint lines

Ported over e7395c75d5 from the
greasepencil-object branch. I should've fixed this ages ago, but
couldn't figure out why at the time.
2017-09-26 13:00:38 +13:00
e8a0812a3b deps libs: fix xiph library support on sndfile on macOS 2017-09-26 02:17:39 +03:00
3ae0be45f1 Eevee: Implement Temporal Anti Aliasing / Super Sampling
This adds TAA to eevee. The only thing important to note is that we need to keep the unjittered depth buffer so that the other engines are composited correctly.
2017-09-25 20:14:42 +02:00
198c7d3687 DRW : Add new view_update mechanism.
This makes updates for the viewport cleaner and also add the possibility to add a new callback called when the scene is updated.
2017-09-25 20:14:42 +02:00
98dd2a518b Eevee: Fix SSR in orthographic view.
The problem was that orthographic views can have hit position that are negative. Thus we cannot encode the hit in the sign of the Z component.

The workaround is to store the hit position in screenspace. But since we are using floating point render target, we are loosing quite a bit of precision.
TODO: use RGBA16 instead of RGBA16F. But that means encoding the pdf value somehow.
2017-09-25 20:14:42 +02:00
00955d8d7a DRW : Add AA to non meshes objects.
You can change the amount of samples in the user preferences. You do not need to restart blender to see the effect in the new viewport.

This adds another Multisample Framebuffer and textures (so even more memory required).

It works by blitting the default_fb to the multisample_fb each time the renderer need to render one or more "wire" pass.
It it then blit back to the default_fb so that the rest of pipeline is working as expected.

We COULD lower the GPU memory / bandwidth usage to render everything to the same multisample fbo and change the logic depending on if MSAA is enabled or not, but I think it's a bit too much work for now.
2017-09-25 20:14:42 +02:00
709315a0d7 GPUTexture : Fix Bind/Unbind function so it works with multisample textures. 2017-09-25 20:14:42 +02:00
2a7b747f18 GPUFramebuffer: Fix Blit function so that it works with multisample textures. 2017-09-25 20:14:42 +02:00
e615724221 Fix compilation error after recent merge 2017-09-25 19:02:30 +05:00
98ba302f70 Merge branch 'master' into blender2.8 2017-09-25 18:57:43 +05:00
675cef0a16 Fix T52835: When driven IK influence change, ik animation have 1 frame delay 2017-09-25 18:48:55 +05:00
ce54d25fa9 Fix T52865: Improve wording of error message when saving packed images fails
Make it clear that the packed file could not be saved back out to disk
at the specified path (e.g. destination directory doesn't exist).
2017-09-26 01:25:18 +13:00
0d4e519b74 OpenVDB: Fix compilation error against OpenVDB 4
One crucial thing here: OpenVDB shoudl be compiled WITHOUT
OPENVDB_ENABLE_3_ABI_COMPATIBLE flag. This is how OpenVDB's Makefile is
configured and it's not really possible to detect this for a compiled library.

If we ever want to support that option, we need to add extra CMake argument and
use old version 3 API everywhere.
2017-09-25 14:44:17 +05:00
1d8aebaa09 Add an 'atomic cas' wrapper for pointers.
Avoids having to repeat obfuscating castings everywhere...
2017-09-25 10:40:50 +02:00
01a3c6b204 Tweak to fix for thread concurency in looptri generation.
Even if pointer assignment may be atomic, it does not prevent reordering
and other nifty compiler tricks, we need a memory barrier to ensure not
only that transferring pointer from wip array to final one is atomic,
but also that all previous writing to memory are “flushed” to
(visible by) all CPUs...

Thanks @sergey for finding the potential (though quite unlikely) issue.
2017-09-25 09:56:02 +02:00
cb6f07f59e Cycles: Cleanup, indentation 2017-09-25 11:15:54 +05:00
1c5f5fb95f Mirror Modifier: option to offset UV's
Useful for baking, so UV's can be moved outside the image
and not used to bake pixels (but still used for display).

D2801 by @Zuorion
2017-09-25 14:11:27 +10:00
4e15eddb52 Fix T52890: Crash unlinking sequencer sound 2017-09-25 10:28:17 +10:00
a8f11f5422 Fix T52871: BLI_polyfill_beautify_quad_rotate_calc_ex was mistakenly considering the state as degenerated 2017-09-23 12:59:02 -03:00
Julian Eisel
76444a13c3 Splash: Increase contrast of build info text
Now uses "Text Selected" theme color of "Menu Back" widget colors. Also
repositioned text slightly to have same margin on top and right (measured
by eye ;) ).
Tested with all bundled themes (contrib and no-contrib) and worked fine.

Considering that different splashes may need different colors for
overlaid text, using theme color may not be the best solution. I would
like to try how this works before adding an ugly way to force a certain
text color though.
Also tried different approaches, but this one I find the least ugly :S

As far as longer term plans go, we wanted to get a redesigned multi-page
splash screen anyway. At this point we can rethink how splash colors work
in general (i.e. auto-contrast, own splash theme colors, etc).
2017-09-23 16:02:25 +02:00
c0480bc972 Cycles: Fix compilation error of OpenCL megakernel on Apple 2017-09-23 17:07:19 +05:00
b460b8fb4a Cycles: Fix compilation error of megakernel on NVidia device
It is more readable to explicitly compare to NULL anyway.
2017-09-23 17:03:02 +05:00
874062b6ab Tracking: Followup to previous fix, need to remap frame number for sequence tracking 2017-09-23 16:18:27 +05:00
92aff05a7c Tracking: Cleanup, reuse existing variable 2017-09-23 16:16:22 +05:00
d430c462a3 Fix T52851: Per-frame traking is broken when sequence doesn't start at frame 1 2017-09-23 16:13:23 +05:00
840cce840e Tracking: Fix crash when tracking failed
Was a dangling pointer to a freed memory left behind.
2017-09-23 16:07:32 +05:00
dc86b7a4b5 Remove remaining qtcodecdata
This fixes a mistake in rBefd5e3c25401b43cbd7f909418835bb570db1ab3
2017-09-22 17:13:46 -04:00
efd5e3c254 Remove quicktime support
It has been deprecated since at least macOS 10.9 and fully removed in 10.12.

I am unsure if we should remove it only in 2.8. But you cannot build blender with it supported when using a modern xcode version anyway so I would tend towards just removing it also for 2.79 if that ever happens.

Reviewers: mont29, dfelinto, juicyfruit, brecht

Reviewed By: mont29, brecht

Subscribers: Blendify, brecht

Maniphest Tasks: T52807

Differential Revision: https://developer.blender.org/D2333
2017-09-22 16:40:05 -04:00
0e802fabb4 [cmake/deps_builder] update openjpeg to 1.5.2 to match the version in master/extern , add support for openjpeg in oiio. Mark webp as an optional component. 2017-09-22 13:57:21 -06:00
925f2c8b9d Fix T52875: install_deps.sh - numpy-1.13.1.tar.gz - 404 Not Found. 2017-09-22 18:56:37 +02:00
f2ea8e217b Object Mode : Add Outline FXAA
Adds a FXAA for smoothing out the extracted outlines.
The Post Process Anti Aliasing is only done on the Alpha channel of the outlines.
Because of that we need to add bleed the outline color out of the silouhette so the AA'd alpha can blend the right color and not pick black when the alpha is smoothed out of the silhouette.

Also because of the AA needs to have clear contrast to work with, I decided to ditch the "bluring" or the occluded outlines.

The FXAA adds an overhead of 0.17ms but we gain back 0.22ms * 4 = 0.88ms by removing the blur.

The FXAA Implementation is from Corey Richardson (cmr) (D2717). I had to modify it a bit to only filter the alpha channel.
2017-09-22 17:31:40 +02:00
128c7c3ba1 Merge branch 'master' into blender2.8 2017-09-22 13:26:49 +05:00
f320d0e0a8 Fix T52840: New Depsgraph - Mask editor not working correctly 2017-09-22 13:23:21 +05:00
225e52eaf8 Edit Mesh Mode : Fix GLSL compilation errors 2017-09-22 03:44:06 +02:00
56fd75c856 Edit Mesh Mode: Put AntiAliasing #define into shader include header. 2017-09-22 02:44:40 +02:00
1a4a1447b7 Edit Mesh Mode: Add a facing falloff effect
This let the user keep track of the shape by fading the center of the object.
An Opacity parameter is yet to be added.
2017-09-22 02:44:40 +02:00
406427bd4e Object Mode: Fix outline getting darker during expand steps. 2017-09-22 02:44:40 +02:00
02cd48a087 Edit Mode : Bias Face dot position 2017-09-22 02:44:40 +02:00
4bfa3f4f9b Edit Mesh Mode : Make line smoother.
This introduce some little artifacts on the border of edges because some pixel with very low opacity does not get discarded and then occlude the face rendered behind if it has not been drawn yet.
To fix this. I added an offset in the geometry shader for the edge fixup. This make the artifact only visible on the border of the object if there is a very dense wire region. It's only visible in edge select mode since vertex and face center also hides the artifacts.

We can enable this only if AA is enabled but for now it's always enabled.
2017-09-22 02:44:39 +02:00
b3b3c6d8ae build deps: add support for multiple xcode installs 2017-09-21 23:54:17 +03:00
07ec0effb6 Code cleanup: simplify kernel side work stealing code. 2017-09-21 22:29:18 +02:00
01dfaac77b [cmake_deps/msvc] Move llvm/clang harvest to their individual cmake files. 2017-09-21 13:10:55 -06:00
78345a46c1 deps build: add openjpeg to OIIO 2017-09-21 22:09:52 +03:00
e4f05df206 First development splash screen for Blender 2.8
Introducing a new header using the Blender socket logo,
commit of the source file will follow soon.

Splash committee: Ton Roosendaal, Dalai Felinto, Pablo Vazquez.

Artwork is a screenshot of 'Wanderer', an Eevee sample file
by Daniel Bystedt, available on blender.org (license: CC-BY-SA)
2017-09-21 20:30:28 +02:00
73e1435ab1 DRW: Fix regression
Textures were bound once. But since it was not unbound it's bind_num would not change and considered still bound next time a shader needed it.

Fix T52866
Fix T52855
2017-09-21 19:54:43 +02:00
d97f52f015 Revert "Fix T52855: Eevee: viewport artifacts"
This reverts commit 803c757c2b.
2017-09-21 19:43:53 +02:00
9775c4d68b [cmake_deps/msvc] Move boost harvest to boost.cmake 2017-09-21 11:16:52 -06:00
15ab0e6ddc [cmake/builddeps] update for site-packages on windows to support the new requests version. 2017-09-21 10:16:40 -06:00
Dalai Felinto
803c757c2b Fix T52855: Eevee: viewport artifacts
Partial revert of 9068c0743e.
This commit tried to do two things:

(1) Fix UBO binding logic [good]
(2) "Improve" texture binding logic [bad]

Don't ever mix different fixes and refactors in the same commit.
2017-09-21 17:41:39 +02:00
4808c488c5 CMake: Add extra requests dependencies
Apparently, we already had some code to deal with this. So for now just
added some extra dependencies needed for latest requests.
2017-09-21 18:53:02 +05:00
0c82a6fec8 Cleanup: unused define 2017-09-22 07:23:03 +10:00
Dalai Felinto
a99c64b12f Eevee: Fix wrong MEM_callocN allocation size 2017-09-21 15:52:51 +02:00
Dalai Felinto
9ad2c0b615 Depsgraph and collection enable/visibility
Iterate over invisible objects too, so lamps can still lit the scene.
Also, now you can use a collection to set an object to invisible, not
only to visible.

For example:
Scene > Master collection > bedroom > furniture
Scene > View Layer > bedroom    (visible)
                   > furniture  (invisible)

The View Layer has two linked collections, bedroom and furniture.
This setup will make the furniture collection invisible.

Note: Unlike what was suggested on D2849, this does not make collection
visibility influence camera visibility. I will keep this as a separate
patch.

Reviewers: sergey

Subscribers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D2849
2017-09-21 14:45:08 +02:00
77377f0ea8 Depsgraph: Fix bug introduced by wrong merge conflict resolution 2017-09-21 16:09:49 +05:00
f5aa50853c 3D Text: Make Ctrl Backspace/Del delete words
Matches text-editor, console & text-button.
2017-09-21 20:43:49 +10:00
806bc55a34 Fix T52860: 3D Text crashes w/ Ctrl Backspace 2017-09-21 19:14:04 +10:00
50b9d1d019 Install_deps: Raise python and numpy versions (to 3.6.2 and 1.13.1 respectively). 2017-09-21 09:59:07 +02:00
e0f68e5d22 deps build: use pip to install requests 2.18.4 and it's deps 2017-09-21 09:33:00 +03:00
0c019a3ffc Fix T50450: Breakdowner doesn't work in Tweak Mode on translated NLA Strips 2017-09-21 17:38:30 +12:00
fde45132de Fix T52861: Keymap editor filter doesn't show shortcuts using "+" 2017-09-21 16:35:47 +12:00
26f98446b1 fix T52831 removed enforcement of matrix decomposition when animations are exported 2017-09-21 00:06:11 +02:00
a3b8f98913 revert commit c0a7e9b631 because it did not work as expected 2017-09-21 00:04:10 +02:00
c0a7e9b631 D2777: allow blank lines and lines with spaces/tabs in cut/paste 2017-09-20 22:48:38 +02:00
78c2242db5 Revert "Fix T52792: Typo in UI label of a HairInfo node socket."
This reverts commit 8ad479a322.
2017-09-20 22:06:23 +02:00
Stefan Werner
549c4bec9d Added extra "const" to satisfy the strict clang version in Xcode 9 2017-09-20 21:50:30 +02:00
Stefan Werner
ee30a4381f Added extra "const" to satisfy the strict clang version in Xcode 9 2017-09-20 21:47:45 +02:00
8ad479a322 Fix T52792: Typo in UI label of a HairInfo node socket. 2017-09-20 21:06:33 +02:00
692631551f [cmake/msvc] Update python to 3.6 + numpy to 1.13.1 2017-09-20 12:51:36 -06:00
25f28d348f Fix T52852: Assert in looptri calculation after recent changes.
Wrong condition in asserts...
2017-09-20 20:46:51 +02:00
c5491ba874 [cmake/depsbuilder/msvc] Update to python 3.6 / numpy 1.13.1
-No more hardcoded python35/36 tokens in the scripts
-disabled python module for boost, was not used
-Updated patches for python to support building with msvc2013
2017-09-20 12:31:40 -06:00
98d797b67c Fix missing ID remapping in Action editor callback.
Spotted by Joshua Leung (@aligorith), thanks!

Should probably be backported to 2.79a should we do it.
2017-09-20 20:26:40 +02:00
18a353dd24 Fix T52368: Cycles OSL trace() failing on Windows 32 bit. 2017-09-20 19:38:08 +02:00
14223357e5 Fix T52853: harmless Cycles test failure in debug mode. 2017-09-20 19:38:08 +02:00
90d4b823d7 Cycles: use defensive sampling for picking BSDFs and BSSRDFs.
For the first bounce we now give each BSDF or BSSRDF a minimum sample weight,
which helps reduce noise for a typical case where you have a glossy BSDF with
a small weight due to Fresnel, but not necessarily small contribution relative
to a diffuse or transmission BSDF below.

We can probably find a better heuristic that also enables this on further
bounces, for example when looking through a perfect mirror, but I wasn't able
to find a robust one so far.
2017-09-20 19:38:08 +02:00
095a01a73a Cycles: slightly improve BSDF sample stratification for path tracing.
Similar to what we did for area lights previously, this should help
preserve stratification when using multiple BSDFs in theory. Improvements
are not easily noticeable in practice though, because the number of BSDFs
is usually low. Still nice to eliminate one sampling dimension.
2017-09-20 19:38:08 +02:00
b3afc8917c Code cleanup: refactor BSSRDF closure sampling, for next commit. 2017-09-20 19:38:08 +02:00
d029399e6b Code cleanup: remove SOBOL_SKIP hack, seems no longer needed. 2017-09-20 19:38:08 +02:00
d750d182e5 Code cleanup: remove hack to avoid seeing transparent objects in noise.
Previously the Sobol pattern suffered from some correlation issues that
made the outline of objects like a smoke domain visible. This helps
simplify the code and also makes some other optimizations possible.
2017-09-20 19:38:08 +02:00
8289b47e3a Fix Cycles test report not closing files properly. 2017-09-20 19:12:26 +02:00
f54f680a26 Fix T52842: Incorrect description for bpy.types.MeshTextureFace.uv
Tweak rna_info module to generate valid info also for multi-dimensional arrays.
2017-09-20 16:40:11 +02:00
942c5997c1 Expose multi-dimensional array data in properties' introspection data.
Required to generate valid doc for such arrays!
2017-09-20 16:40:11 +02:00
c4bbf1e4b0 Fix rna_info.py module, broken by recent changes in bpy.types presumably.
Hope fix is OK, seems to work with API generation script at least.
2017-09-20 16:40:11 +02:00
adb647fb92 UI: fullstop at end of tooltips
Allows for multiple sentences not to look strange.
Convention not to include in RNA remains.
2017-09-20 23:59:26 +10:00
Dalai Felinto
f2db6cefa0 Layer collection enable flag
Right now this is exposed in the outliner, though all this
(visible/selectable/enable) should be moved to a new panel soon.

This removes objects from the depsgraph when the collection is disabled.

It allows you to "hide" lamps but still having them lighting the scene.
Same for light probes and other support objects.

Pending tasks:

* Have depsgraph to include invisible objects in the DEG_OBJECTS_ITER, and
then have Eevee and other engines to make a distinction between an
invisible and a visible object.

(for example, we probably want invisible objects to not show in the
viewport, but cast shadows and show up in light probes).

* Change how we evaluate collection settings so that an invisible
collection can force an object to be invisible.

Reviewers: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2848
2017-09-20 14:15:35 +02:00
99c9f17098 deps build: correct sndfile fix 2017-09-20 13:20:23 +03:00
42c174d1a5 Manipulator: fix visibility check w/ 2-axis planes 2017-09-20 18:33:43 +10:00
31fc75ef93 Cleanup: move 3d manipulators into an array 2017-09-20 17:47:34 +10:00
851228766e Merge branch 'master' into blender2.8 2017-09-20 16:10:40 +10:00
a2d246c5c0 BLI_polyfill2d_test: script to generate test data 2017-09-20 13:40:30 +10:00
77dccbf481 deps build: fix sndfile building on macOS 2017-09-20 00:08:32 +03:00
46300a541d macOS: use python version 3.6 when building blender 2017-09-20 00:07:56 +03:00
c87c1ec1da deps build: bump Python to 3.6.2 and Numpy to 1.13.1 2017-09-20 00:04:23 +03:00
f680e42a4c Correct test ifdef in polyfill 2017-09-20 04:57:48 +10:00
16355d545b Fix T52834: Polyfill2D fails with co-linear edges 2017-09-20 04:29:04 +10:00
c4235356c9 BLI_polyfill2d_test: add test for T52834
Commented since it currently fails.
2017-09-20 03:40:13 +10:00
e00bb4d22c BLI_polyfill2d_test: Try flipped x/y axis
In T52834 this makes a difference.
2017-09-20 03:35:06 +10:00
869f0a840f Merge branch 'master' into blender2.8 2017-09-19 13:59:37 -03:00
98ea79cfde transform_snap_object: simplify IGNORE_BEHIND_RAY
`depth_get` is called in most of the time. So not worth going through so many conditions
2017-09-19 13:57:59 -03:00
e2e8f4b9e1 Audaspace: removing old device backend names. 2017-09-19 18:08:42 +02:00
af170839af Merge branch 'master' into blender2.8 2017-09-19 21:08:14 +05:00
b31faac17e Depsgraph: Fix wrong flag being assigned 2017-09-19 20:55:15 +05:00
96ce50449c Fix T52733 Percent mode for Bevel sometimes had nans.
Forgot some initialization.
2017-09-19 09:39:11 -04:00
3241905f40 Fix T52818: Tangent space calculation is really slow for high-density mesh with degenerated topology
Now we replace O(N^2) computational complexity with O(N) extra memory penalty.
Memory is much cheaper than CPU time. Keep in mind, memory penalty is like
4 megabytes per 1M vertices.
2017-09-19 17:50:09 +05:00
2dab6f499c Mikkspace: Cleanup, reduce indentation level 2017-09-19 17:50:09 +05:00
9591b5f618 Fix T52816: regression can't open file in 2.79 (crash).
Tentative fix, since I cannot reproduce thenissue for some reason here
on linux.

Core of the problem is pretty clear though, thanks to Germano Cavalcante
(@mano-wii): another thread could try to use looptris data after worker
one had allocated it, but before it had actually computed looptris.

So now, we use a temp 'wip' pointer to store looptris being computed
(since this is protected by a mutex, other threads will have to wait on
it, no possibility for them to double-compute the looptris here).

This should probably be backported to 2.79a if done.
2017-09-19 14:00:49 +02:00
1a4442b3db Fix T52823: New Depsgraph - Shrinkwrap crashes blender
The issue was caused by threading conflict around looptris: it was possible
that DM will return non-NULL but non-initialized array of looptris.

Thanks Campbell for second pair of eyes!
2017-09-19 16:12:05 +05:00
495d3c8dd7 CMake: update for renamed headers 2017-09-19 20:26:07 +10:00
7b95243240 BLI_utildefines_iter: Use for iteration helpers 2017-09-19 20:22:24 +10:00
60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
215651af1b Boolean Modifier: add debug options
Only show & use when running in debug mode.
2017-09-19 18:29:52 +10:00
7177e0ac3e Fix T52811: At any framerate selected, video exported with 1000fps 2017-09-19 11:31:03 +05:00
36f5972ed0 Avoid bias when calculating quad split direction
Some error checks weren't being done in both directions
when calculating the best split direction for a quad.
2017-09-19 15:10:52 +10:00
9a2f7dd77b Correct recent error in boolean quad split check 2017-09-19 14:25:37 +10:00
2cdc2f2a25 Fix compiler warning 2017-09-19 16:20:51 +12:00
bb4a12914f Add some security checks against future bad float UIprecision values.
This commit and previous one should be backported to 2.79a should we
release it.
2017-09-18 20:04:27 +02:00
785e96a11d Fix (irc-reported by @sergey) invalid precision value in a float RNA property.
Maximum allowed UI float precision value is 6 (which means 7 digits).

Will change code checking on that in next commit.
2017-09-18 20:04:27 +02:00
d486b17088 [cmake/dependencies] Update libsndfile to 1.0.28 2017-09-18 10:54:37 -06:00
Dalai Felinto
f84448d4a0 Fix T52813: Audaspace: Leak when loading factory settings
Patch by Joerg Mueller (neXyon) with some touchups by me.
2017-09-18 16:16:03 +02:00
533ec46efb Merge branch 'master' into blender2.8 2017-09-18 23:56:19 +10:00
d0344d7b7d Cleanup: use clamped rounding functions 2017-09-18 23:55:41 +10:00
c4fc9c4a8e Math Lib: clamped rounding utility functions 2017-09-18 23:55:41 +10:00
ad80bfdab9 Merge branch 'master' into blender2.8 2017-09-18 18:10:39 +05:00
a6b156bf57 Color management: When look is applied, we can not consider spaces to match
This should fix T52812 after merge to blender2.8.
2017-09-18 18:09:53 +05:00
e6d5b94e83 Correct error in cage2d draw style enum 2017-09-18 23:02:27 +10:00
Dalai Felinto
d370e6c3ea Merge remote-tracking branch 'origin/master' into blender2.8 2017-09-18 14:44:44 +02:00
d0d9360a66 Fix T52800: fix UI flickering with Mesa on Linux.
Use triple buffer by default now on all platforms, remaing ones where:
* Mesa: seems to have been working well for a long time now, and not using
  it gives issues with the latest Mesa 17.2.0.
* Windows software OpenGL: no longer supported since OpenGL 2.1 requirement
  was introduced.
* OS X with thousands of colors: this option was removed in OS X 10.6, and
  that's our minimum requirement.
2017-09-18 13:19:48 +02:00
4c1ee47707 Merge branch 'master' into blender2.8 2017-09-18 15:54:56 +05:00
ab9079f459 Fix Cycles adaptive compile without volumes broken after recent changes.
Differential Revision: https://developer.blender.org/D2847
2017-09-18 12:52:32 +02:00
6bf3dfbcdb Fix T52801: reload scripts causes Cycles viewport render crash. 2017-09-18 12:52:32 +02:00
c622533fa0 Fix T52432: Blender crashes while using Ghost (new depsgraph) 2017-09-18 15:50:27 +05:00
a0e7dbc66d BMesh: move bridge tools stepping logic into macro
Also use floor division since regular division was giving a bias
on negative error values.
2017-09-18 13:18:54 +10:00
990515a5a7 Math Lib: add divide_floor_i
Integer division that floors on negative output (like Python's).
2017-09-18 13:18:50 +10:00
9134529b9e UI: avoid int cast before clamping number input
Values outside int range would overflow.
2017-09-17 18:00:13 +10:00
d7204aed95 Cleanup: SGI format, remove unused struct members 2017-09-17 18:00:08 +10:00
829916f4e5 Fix SGI foramt reader CVE-2017-2901
Integer Overflow Code Execution Vulnerability.

Reader no longer crashes on corrupt images (from own fuzz testing).
2017-09-17 16:30:34 +10:00
b884188f8a Cleanup: SGI format, avoid overflow
Harmless but causes warnings
2017-09-17 16:30:34 +10:00
a72e609204 Cleanup: SGI format, use uint/short/char types 2017-09-17 16:30:34 +10:00
Hristo Gueorguiev
6798a061b7 Cycles: Fix compilation error with OpenCL split kernel 2017-09-16 12:33:03 +02:00
a850d74312 Fix T51074: Boolean modifier inverts operation
Support for negative scaled objects.
2017-09-16 18:12:24 +10:00
d09c429e30 Fix writing Iris images w/ invalid header
Regression in e142ae77ca
2017-09-16 16:09:02 +10:00
9068c0743e DRW: Fix Ubo binding logic and improve Texture binding logic
Ubo needs to be rebound every times the shader changes.
This simplify the logic a bit.

Also modify texture binding logic to potentially reuse more already bound textures.
2017-09-16 02:16:55 +02:00
7c8e87fc52 Fix T52384: Bridge pair result depends on other loops
When 2x loops have different number of vertices,
the distribution for vertices fan-fill depended on the loop order
and was often lop-sided.

This caused noticeable inconstancies depending on the input
since edge-loops are flipped to match each others winding order.
2017-09-16 05:15:09 +10:00
f565d8c4ae Eevee: Fix T52738: Probes are black.
This fix the crappy binding logic.

Note the current method is doing a lot of useless binding. We should somewhat order the texture so that reused textures are already bound most of the time.
2017-09-15 20:09:09 +02:00
208d6f28c8 Merge branch 'master' into blender2.8 2017-09-15 14:19:22 -03:00
14eadf55fd RNA: expose RegionView3D clip planes 2017-09-15 13:55:52 -03:00
4fae536f60 Merge branch 'master' into blender2.8 2017-09-15 22:44:07 +10:00
378b74f025 Docs: only show versions in changelog side-bar 2017-09-15 22:20:14 +10:00
ec784b06ee Docs: update API changelog to 2.79 2017-09-15 22:06:23 +10:00
1a9217e222 Fix T52763: Boolean problem with vertex group 2017-09-15 16:33:52 +05:00
0c5ff0e558 GPUCodegen: Fix for loop overflow.
Fix asan error.
2017-09-15 11:42:53 +02:00
d120780fed BMesh: use less involved check for edge rotation
Was using function for edge rotation which was doing unnecessary checks
Use the face normal and BLI_polyfill_beautify_quad_rotate_calc directly.
2017-09-15 18:19:04 +10:00
c594087488 Polyfill Beautify: option to rotate out of degenerate state
Needed for 3D iterative edge-rotation to avoid flipping when projected
from different angles,
but could keep zero area faces in 2D polygons.
2017-09-15 18:14:17 +10:00
fdb8e17936 Fix error in recent boolean changes w/ quad split 2017-09-15 18:08:24 +10:00
028c5592cd Merge branch 'master' into blender2.8 2017-09-15 12:35:20 +05:00
8b3ad25862 Transform: Enable recursion dependency check for new depsgraph 2017-09-15 12:25:57 +05:00
95a8e73d40 Fix copy-paste error in recent particles fix
Was intersecting same triangle twice.
2017-09-15 11:35:24 +05:00
2aa2bec43a Fix T52442: bl_app_templates_system not working
Portable builds LOCAL files need to be
treated as system instead of using as a fallback to USER templates.
2017-09-15 05:57:37 +10:00
909da553e3 Fix bpy.utils.resource_path('SYSTEM') output
Would return the test path for developer builds:
{blender-dirname/release}

Now return an empty string when no path is found.
2017-09-15 05:47:23 +10:00
c75bd25cd8 Fix T52732: Particle system volume grid particles out of volume
Use more watertight and robust intersection test.

It uses now ray to triangle intersection, but it's all fine because segment was
covering the whole bounding box anyway.
2017-09-14 19:50:02 +05:00
3c1c3b64c5 Fix T52729: Decimals not showing over 100m or 100 feet
Use same 5 digits precision as we already use for e.g. Object's
location, for Object's dimensions too.

To be backported to 2.79a, should we do it.
2017-09-14 16:35:28 +02:00
a22590a62c Fix T52537: Dyntopo "detail flood fill" doesn't work in some cases
Mainly when object origin is not at the geometry bounding box center.

Seems to be straightforward to fix, hopefully it doesn't break some obscure case
where this was a desired behavior.
2017-09-14 18:56:16 +05:00
fc7ac0bc49 Correct error in last commit 2017-09-14 23:04:01 +10:00
8c21003248 Fix T52748: Select shortest face path fails 2017-09-14 23:01:07 +10:00
7aafa32c09 Fix T51416: Blender Crashes while moving Sliders
The issue here was that removing datablock from main database will poke editors
update, which includes buttons context to free users of texture. Since Cycles
will free datablocks from job thread, it might crash Blender since main thread
might be in the middle of drawing.

Solved by exposing extra arguments to bpy.data.foo.remove() which indicates
whether we want to perform ID user count and interface updates. While scripts
shouldn't be using those normally, this is the only way to allow Cycles to skip
interface update when removing datablock.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2840
2017-09-14 17:03:40 +05:00
ff79406404 Fix T52653: Render output of linked scenes conflicts with other scenes with the same name
The issue was caused by render result identifier only consist of scene name,
which could indeed cause conflicts.

On the one hand, there are quite some areas in Blender where we need identifier
to be unique to properly address things. Usually this is required for sub-data
of IDs, like bones. On another hand, it's not that hard to support this
particular case and avoid possible frustration.

The idea is, we add library name to render identifier for linked scenes. We use
library name and not pointer so we preserve render results through undo stack.

Reviewers: campbellbarton, mont29, brecht

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D2836
2017-09-14 16:50:19 +05:00
4bd014e951 Depsgraph: Fix crash in masking, related on T52749 2017-09-14 16:23:16 +05:00
75f36266df Merge branch 'master' into blender2.8 2017-09-14 16:17:22 +05:00
09c6c6c486 Fix T52749: New Depsgraph - Render View Mask is not initialized correctly 2017-09-14 16:12:01 +05:00
3573f49bfd Masks: Split layer evaluation into separate function
This way we can easily re-use bits of code for new dependency graph.

Currently should be no functional changes.
2017-09-14 16:09:06 +05:00
8140b51aa4 Fix T52739: Crash loading corrupted video files
Affects both "normal" open as a video file and thumbnail generation.
2017-09-14 14:56:25 +05:00
c57636f060 Fix failure in our UI code that could allow search button without search callbacks, leading to crash.
Related to (exposed by) T52735, fixes the reported crash but not the
underlying issue.

To be backported to 2.79a should we do one.
2017-09-14 10:58:47 +02:00
d827186c17 Fix T52723: Reset UV layers failed 2017-09-14 17:46:03 +10:00
f7163a7d0a Fix T52741: Follow track with depth object crashes Blender with new depsgraph 2017-09-14 12:31:54 +05:00
bd1f946413 Recent action-bake used Py3.6 syntax 2017-09-14 17:04:41 +10:00
892d304ded Fix T52291: Boolean fails w/ co-linear edged ngons
This means boolean tessellation wont match viewport tessellation
however it's needed to avoid zero area triangles causing problems.
2017-09-14 16:08:03 +10:00
5ae63f03d9 DRW: Fix texture binding logic. 2017-09-14 01:03:19 +02:00
3b080c3f66 GPUCodegen: Add New GPU_SOURCE_STRUCT to be used for Closure Sockets
This way we dont rely on the static array of chars that was causing T52385.

That fixes T52385.
2017-09-14 01:03:19 +02:00
a01fbc6689 Manipulator: use box style for render border 2017-09-14 05:05:28 +10:00
c9be499c31 Manipulator: cage2d expand hotspot
With new style drawing hotspot should be in the middle of the border,
not inside it.
2017-09-14 04:38:48 +10:00
c1ff05e66f Manipulator: disable hover for camera border 2017-09-14 04:10:33 +10:00
3bf36fa33b Manipulator: alternate cage2d draw style
Doesn't rely on hovering, more consistent with 2D drawing tools.
2017-09-14 03:54:32 +10:00
55fb6e7096 GPU_immediate_util: Add x,y radius to circle draw
A version of circle drawing for non 1:1 aspects
2017-09-14 03:54:32 +10:00
d5478e20cc Eevee: Fix AO disappearing when updating Probe Grids. 2017-09-13 19:40:53 +02:00
2d261685a9 Eevee: Fix T52357 : SSRefraction broken after adding probe
I forgot the reset the toggle after rendering the probes...
2017-09-13 19:31:48 +02:00
1fca11d5cb DRW: Fix incorrect Ubo Bind 2017-09-13 17:44:36 +02:00
4088c9fa68 Eevee: Get rid of glitchy black SSR.
Add sanitizer. I wanted to stay away from this because I think we should fix what causes NaNs in the first place. But there can be too much different factor causing NaNs and it can be because of user inputs.
2017-09-13 17:44:36 +02:00
6d359e4498 Cleanup: use explicit 2d suffix for imm utils
Avoid ambiguity between 2d/3d (which were already named).
2017-09-14 01:24:50 +10:00
2a01fb61f8 Cleanup: use safe free macro & comments 2017-09-14 01:24:47 +10:00
e9d8b780ae DRW: Fix leak (2nd attempt) cause by texture "state" tracking
This should get rid of the leak once for all.
2017-09-13 16:55:58 +02:00
2b2277ecbc DRW: Fix memleak in release mode. 2017-09-13 15:42:48 +02:00
37d8d4787c Merge branch 'master' into blender2.8 2017-09-13 23:44:13 +10:00
6f633dec5d Fix T52299: X resolution of 4 causes nodes to collapse
Was caused by numeric overflow when calculating preview dimensions.
Now we try to avoid really insance preview resolutions by fitting
aspect into square.
2017-09-13 18:31:36 +05:00
9abacf38fd Eevee: SSR: Making ray count a define rather than an uniform.
The branching introduced by the uniform caused problems on mesa + AMD in the resolve stage.
This patch create one shader per sample count without branching.
This improves performance of a single ray per pixel case (3.0ms against 3.6ms in my testing)
2017-09-13 15:29:38 +02:00
32449e1b21 Code cleanup: store branch factor in PathState. 2017-09-13 15:24:14 +02:00
9e258fc641 Code cleanup: avoid used of uninitialized value in case of precision issue. 2017-09-13 15:24:14 +02:00
37d9e65ddf Code cleanup: abstract shadow catcher logic more into accumulation code. 2017-09-13 15:24:14 +02:00
f77cdd1d59 Code cleanup: deduplicate some branched and split kernel code.
Benchmarks peformance on GTX 1080 and RX 480 on Linux is the same for
bmw27, classroom, pabellon, and about 2% faster on fishy_cat and koro.
2017-09-13 15:24:14 +02:00
c4c450045d Code cleanup: tweak inlining for 2% better CUDA performance with hair. 2017-09-13 15:24:14 +02:00
76e7c039ec Fix T52140: Align objects centers using origin for text
The issue was caused by operator redo which frees all object's evaluated data,
including bounding box. This bounding box can not be reconstructed properly
without full curve evaluation (need to at least convert font to nurbs, which is
not cheap already).
2017-09-13 17:40:11 +05:00
43858c4197 Cleanup: avoid right-shifted args in RNA register 2017-09-13 21:52:57 +10:00
29a7ad8b1a Node UI: scale cross by pixelsize
Draws a little smaller to fit with 2.8x manipulator.
2017-09-13 21:48:51 +10:00
71c1bd1bd8 Manipulator: cage2d option to grab w/ a center handle 2017-09-13 21:42:13 +10:00
04800ed434 Fix T52113: Compositor doesnt mix unrendered render layers well
Compositor was always defaulting to all-zero s output for missing passes.

This was broken in 4cf7fc3.
2017-09-13 15:46:19 +05:00
f472aea922 Compositor: Cleanup, get rid of nested ternary operators
Having single switch statement is much more readable.
2017-09-13 15:46:19 +05:00
17a117c7a0 Compositor: Cleanup, de-duplicate some code 2017-09-13 15:46:19 +05:00
4fde0910d5 Compositor: Cleanup, reduce indentation level in render layer node
There is absolute no reason to have such an indentation level, it only causes
readability and maintainability issues. It is really simple to make code more
"streamlined".
2017-09-13 15:46:19 +05:00
77eaf5cd7a Manipulator: Only allow negative scale w/ flag set
In most cases we don't want this by default
2017-09-13 18:20:37 +10:00
a5c9f15a0e Manipulator: use solid regions for select drawing
Needed for 3D view selection
2017-09-13 18:06:26 +10:00
0bf8d16d1c Manipulator: cage2d - uniform handle size 2017-09-13 15:46:28 +10:00
86c73ea8d7 Manipulator: fix cage2d scaling 2017-09-13 15:46:18 +10:00
8a5af5202c Eevee: Fix T52713: SSR not working in AMD
This was cause by a fairly funky unitialize buffer (last frame) that was causing NANs during the SSR resolve stage.
They were then propagated to the whole image during the next swap.

Bypassing the SSR completly if no valid history exists fixes the problem. Also disabling SSR data output in this case so we can have correct reflection in the 1st history buffer.
2017-09-12 18:32:29 +02:00
79a1d74c78 Eevee: Fix T52510: assert with volume defines.
This assert was not making sense at all. Removing
2017-09-12 17:50:21 +02:00
07e6e5edfb Eevee: Fix extinction of Light parallel to views.
This was a problem with orthographic views and lights without rotations. This introduce a small bias that should fix most cases.
2017-09-12 16:18:18 +02:00
Mathieu Menuet
659ba012b0 Cycles: change AO bounces approximation to do more glossy and transmission.
Rather than treating all ray types equally, we now always render 1 glossy
bounce and unlimited transmission bounces. This makes it possible to get
good looking results with low AO bounces settings, making it useful to
speed up interior renders for example.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2818
2017-09-12 15:37:35 +02:00
fc42063d1e Eevee: Fix wrong shadow Orco mapping. 2017-09-12 15:06:07 +02:00
1e1d34654b Eevee / DRW : Codestyle 2017-09-12 15:03:34 +02:00
d2202117fe T50354: Action length calculation added unnecessary padding if some F-Curves
only contained a single key (on the last real frame of the action).
2017-09-13 00:53:50 +12:00
a704a66914 Adding some verbose documentation
I thought this was already clear enough, but apparently not.
2017-09-13 00:53:46 +12:00
f2b3e1f712 Eevee: Fix T52480: Can't reproduce Metallic transparency with Principled + Mix Shader
You can now use a transparent shader as a completly transparent bsdf. And use whatever alpha mask in a mix shader between a transparent bsdf and another bsdf.
2017-09-12 14:25:04 +02:00
7a6f9ab587 Eevee: Fix T52546 : 129th light crashes Blender 2017-09-12 14:25:04 +02:00
fadc079740 Fix T52573: Cycles baking artifacts
Synchronize condition for faces split between Cycles itself and baking API.
2017-09-12 16:33:42 +05:00
e7b5bbae6a Cycles tests: Add baking features tests 2017-09-12 16:22:02 +05:00
4aee701f00 Fix T52679: Hole in bake normal
In fact, any type of baking might have caused holes in mesh.

The issue was caused by zspan_scanconvert() attempting to get order of traversal
'a-priori', which might have failed if check happens at the "tip" of span where
`zspan->span1[sn1] == zspan->span2[sn1]`.

Didn't see anything bad on making it a check when iterating over scanlines and
pick minimal span based on current scanline. It's slower, but unlikely to cause
measurable difference. Quality should stay the same unless i'm missing something.

Reviewers: brecht, dfelinto

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2837
2017-09-12 16:20:41 +05:00
de6ecc82ed Fix rare firefly in volume equiangular sampling when sampling short distance. 2017-09-12 12:50:44 +02:00
28532f1867 Cycles tests: add environment variable to update references renders.
This will copy new renders over references renders:
CYCLESTEST_UPDATE=1 ctest -R cycles
2017-09-12 12:50:44 +02:00
cd6c9e9e5f Cycles: improve sample stratification on area lights for path tracing.
Previously we used a 1D sequence to select a light, and another 2D sequence
to sample a point on the light. For multiple lights this meant each light
would get a random subset of a 2D stratified sequence, which is not
guaranteed to be stratified anymore.

Now we use only a 2D sequence, split into segments along the X axis, one for
each light. The samples that fall within a segment then each are a stratified
sequence, at least in the limit. So for example for two lights, we split up
the unit square into two segments [0,0.5[ x [0,1[ and [0.5,1[ x [0,1[.

This doesn't make much difference in most scenes, mainly helps if you have a
few large area lights or some types of HDR backgrounds.
2017-09-12 12:45:29 +02:00
d454a44e96 Fix Cycles bug in RR termination, probability should never be > 1.0.
This causes render differences in some scenes, for example fishy_cat
and pabellon scenes render brighter in a few spots. This is an old
bug, not due to recent RR changes.
2017-09-12 12:43:26 +02:00
467d92b8f1 Cycles: Tweaks to avoid compilation error of megakernel
Also moved code out of deep-inside ifdef block, otherwise it was quite confusing.
2017-09-12 13:33:46 +05:00
74eed8e30e Fix T52705: Lamps shadows are not refreshed when tweaking lamps parameters
Lamp and camera datablocks updates should flush some updates to corresponding
objects. Currently it's done as Parameters -> Parameters relations.
2017-09-12 11:58:30 +05:00
b07ee4e3a5 Update tgz script, remove deprecated GZIP use 2017-09-12 16:25:19 +10:00
f875e396ce Eevee: Fix T52593
Use a placeholder texture to remove problems with sampler with no texture bound to it.
2017-09-11 23:17:33 +02:00
d126ffbea4 DRW: Use static list (array) of texture/ubo to track bound textures/ubos.
This is in order to use the same texture on multiple sampler.
Also texture counter is reset after each shading group. This mimics the previous behaviour.
2017-09-11 23:15:29 +02:00
4757404eef Eevee: Fix performance issue on intel.
I did not checked if it makes a diff on other GPU. This might be change to be intel only.
2017-09-11 14:32:44 +02:00
92ace808db Eevee: Fix shadow copy shader error.
filter() is a reserved function.
2017-09-11 14:09:12 +02:00
35ee9ff7a0 Fix T52682: When hair number=faces number, particles/face = 1 , actually some hair is overlap.
Just using same code for distribution for face/volume as the one
changed/used for vertices since some months.

Note that this change is breacking compatibility, in that distribution
of particles over faces/volume may not be exactly the same as
previously.
2017-09-11 12:38:17 +02:00
7d7741d25f Merge branch 'master' into blender2.8 2017-09-11 16:52:53 +10:00
f56fea3d6b Fix T52701: Mesh shortest path fails at boundaries 2017-09-11 16:45:19 +10:00
7e56879772 Fix T52696: Sculpt - Brush spacing pressure artifacts
Was caused by divide-by-zero in paint_stroke_integrate_overlap()
in paint_stroke.c, as identified by Bob Smith (uvwxyz).

Thanks for the report!
2017-09-11 18:24:39 +12:00
49ba9d02d8 Eevee: Fix shadow bleeding after farclip for cubemaps.
NOTE: We should not check for radial distance. But this is faster.
2017-09-11 01:13:55 +02:00
6d2cd1719b Bake Action: operate on selected objects
Previously only the active object was used.

Use coroutines to support baking frames for multiple objects at once,
without having to playback the animation multiple times.
2017-09-10 17:16:47 +10:00
a4a59d578c PyAPI: Add object argument to bake_action
Avoids having to set the scene's active object first.
2017-09-10 14:30:03 +10:00
d97a5484af Eevee: Shadows: Update cascaded shadowmaps when rendering probes.
This is really resource intensive but there is no other way to correctly handle it.
2017-09-10 03:09:45 +02:00
351f10cd79 Eevee: Shadow: Fix, improve cascade shadow map UI. 2017-09-10 03:09:45 +02:00
90efcd6df7 Eevee: Shadows: Add cubemap filtering and adaptive sample count.
Filter size is constant in world space and not dependant of shadow resolution.
The filter size is limited to the number of precomputed samples.
2017-09-10 03:09:45 +02:00
314739bced Eevee: Shadow: Fix Incorrect shadowing after sun lamp far clip plane.
Reject cascade sample if not in shadowmap volume.
2017-09-10 03:09:45 +02:00
9fdf094b85 Eevee: Shadows: Filtering improvement.
- Replace poisson by concentric samples: Less variance. They are sorted by radius then by angle.
- Separate filtering into 2 blur. First blur is 3x3 box blur. Second is user dependant.
- Group fetches by group of 4.
2017-09-10 03:09:45 +02:00
adeaf37e77 Eevee: Add Cascaded Shadow Map options. 2017-09-10 03:09:45 +02:00
cc6e97d426 Lamps: Remove uper limit of the buffer bias parameter. 2017-09-10 03:09:45 +02:00
716f7859a8 Eevee: Add Cascaded Shadow Map support with filtering.
This brings some data structure changes.
Shared shadow data are stored in ShadowData (in glsl) (aka EEVEE_Shadow in C).
This structure contains the array indices of the first shadow element of this shadow "object".
It also contains how many shadow to evaluate (to be used for Multiple shadow maps).

The filtering is noisy and needs improvement.
2017-09-10 03:09:45 +02:00
6c17348e91 Eevee: Shadow: Add high bitdepth option.
This option is here for reducing the memory usage of shadow maps.

Also lower bitdepth are quicker to process.
2017-09-10 03:09:45 +02:00
f46b908cc5 Eevee: Expose Shadow filter size. 2017-09-10 03:09:45 +02:00
32e96448b9 Eevee: Add Variance Shadow Mapping
This is an alternative to ESM. It does not suffer the same bleeding artifacts.
2017-09-10 03:09:45 +02:00
e2603a6e82 Eevee: Shadows: Add UI buttons for size and method
Only one method is available right now. VSM and PCF are comming.
2017-09-10 03:09:45 +02:00
8b7a83a868 Eevee: Refactor Shadow System
- Use only one 2d texture array to store all shadowmaps.
- Allow to change shadow maps resolution.
- Do not output radial distance when rendering shadowmaps. This will allow fast rendering of shadowmaps when we will drop the use of geometry shaders.
2017-09-10 03:09:45 +02:00
11a9434c2d Resolve T52687: Add node label shows as 'Unknown'
Add type access method, need to extend to other types
for now just get node UI working properly again.
2017-09-09 22:56:58 +10:00
3c3d0898b0 PyAPI: Fix mathutils freeze allowing owned data 2017-09-09 11:08:38 +10:00
30d8829780 Docs: mathutils docstrings 2017-09-09 11:02:26 +10:00
90eb93791f Cleanup: mathutils vector comments
Use doxy markup & correct outdated info.
2017-09-09 10:50:40 +10:00
3930e46e37 Correct last commit 2017-09-09 10:15:16 +10:00
002cc6aef3 Cleanup: Simplify SWIZZLE macro
- Use indices instead of character args.
- Use numbered macros instead of variadic args.

Parsing using rtags used over 11gb of memory. While this should be
resolved upstream (report as #1053), the extra complexity didn't give
any real advantage.
2017-09-09 10:10:05 +10:00
4265d85f8b [msvc/make.bat] mention the msvc-2017 option in the make.bat help text. 2017-09-08 14:24:02 -06:00
ae41a08288 Cycles: Attempt to work around compilation of sm_20 and sm_21
Disabled forceinline for those architectures, which seems to be compiling
successfully more often.

There might be ~3% slowdown based on quick tests, but better be rendering
something rather than failing to compile kernels again and again.

Those architectures will be doomed for abandon once we'll switch to toolkit 9.
2017-09-08 18:37:54 +02:00
5d1a5001f4 Fix T52628: own error in string duplication
Error in 636baa598a
2017-09-09 02:08:58 +10:00
ce1f2e271d Cycles: disable fast math flags, only use a subset.
Empty BVH nodes are set to NaN which must be preserved all the way to the
tnear <= tfar test which can then give false for empty nodes. This needs
strict semantices and careful argument ordering for min() and max(), so
the second argument is used if either of the arguments is NaN.

Fixes T52635: crash in BVH traversal with SSE4.1.

Differential Revision: https://developer.blender.org/D2828
2017-09-08 15:12:37 +02:00
b02ab2e7d9 Fix: Grease Pencil pie menu keymaps were broken after the menus got renamed 2017-09-09 01:03:15 +12:00
c9afc41cfd Fix T52650:Grease pencil selection its not automatically updating in Clip Editor 2017-09-08 11:21:49 +02:00
2a3a747ca2 Fix T52678: Crash editing gpencil w/ frame-lock 2017-09-08 18:51:47 +10:00
5b026486e4 Fix leak caused by wrong ownership flag 2017-09-08 04:22:19 +10:00
a2989b89c3 Fix leak w/ ocio glsl draw 2017-09-08 04:20:58 +10:00
df58d6bf76 Fix T52046: View transform applied twice w/ GL render
Patch from @sergey w/ minor edit.
2017-09-08 03:57:07 +10:00
a133b74709 Merge branch 'master' into blender2.8 2017-09-08 03:18:39 +10:00
60020f57d7 Correct function name in argument parsing 2017-09-08 00:59:27 +10:00
daf7aed849 PyAPI: use bl_rna_get_subclass for node API
Returns a default value instead of an error when the type isn't defined.
2017-09-08 00:03:01 +10:00
e44bf43f6c PyAPI: add function to get an RNA subclass
This is inconvenient in regular Python, add a class-method
to perform the operation, eg:

bpy.types.Node.bl_rna_find_subclass("CustomNodeType")
2017-09-08 00:02:09 +10:00
accc94dd73 Cleanup: remove goto's 2017-09-07 22:53:46 +10:00
f4d46916fa UI: fix memory leak when copy-to-selected failed 2017-09-07 22:15:12 +10:00
1601089ece Merge branch 'master' into blender2.8
This discards node drawing changes which need to be written as shaders.
2017-09-07 14:53:06 +10:00
f1021ee929 Merge branch 'master' into blender2.8 2017-09-07 14:33:59 +10:00
3f8aaec6bd Weight Smooth: remove source option
Use current selection mode instead of an operator option.
2017-09-07 14:14:42 +10:00
5f7de54243 Fix T52639: Weight paint smooth tool crash 2017-09-07 13:20:39 +10:00
c3322603eb Cleanup: custom nodes template
- Use conventional (pep8) prop names
- Simplify class registration
2017-09-07 05:20:29 +10:00
5d65aee07a Workaround node types not being exposed
We might want to have a utility function for this,
for now just keep it working.
2017-09-07 05:17:02 +10:00
8172e8e528 Node UI: Add square and diamond socked draw styles
Currently not used by Blender's node trees

D2814 by @charlie
2017-09-07 04:45:38 +10:00
c10ea88420 Fix T52660: CUDA volume texture rendering not working on Fermi GPUs. 2017-09-06 18:12:45 +02:00
fb2e0592bc Fix crash using arrow manipulator 2017-09-07 01:56:42 +10:00
e2f42ff907 Merge branch 'master' into blender2.8 2017-09-06 17:23:47 +02:00
82ede9de48 Fix mistake in previous fix for T52640. 2017-09-06 17:22:38 +02:00
16fbb47c88 Use normalized project functions 2017-09-07 01:20:59 +10:00
4d8980a690 Fix T52640: crash when opening image file browser in some cases.
There was some invalid state in the screen here, some areas had
sa->full set even though no screen was maximized, which then caused
a restore from the wrong (empty) area, which then led to spacedata
being empty and a crash.

This fix properly clears the sa->full after restore, and also fixes
existing .blend files in such an invalid state.
2017-09-06 16:17:18 +02:00
584523e0ad Screw Modifier: remove doubles option
Vertices on the axis can be optionally merged,
nice for creating objects which close at the end-points.
2017-09-07 00:12:43 +10:00
6e0fd239e3 Math Lib: normalized vector project functions 2017-09-07 00:12:43 +10:00
2d407fc288 Fix T52661: mesh light shader using backfacing not working, after new sampling. 2017-09-06 13:51:48 +02:00
dd8016f708 Fix T52652: Cycles image box mapping has flipped textures.
This breaks backwards compatibility some in that 3 sides will be mapped
differently now, but difficult to avoid and can be considered a bugfix.
2017-09-06 13:51:45 +02:00
56ff14ea63 View3D Remap: skip defmaterial
This isn't library data.
2017-09-06 20:57:25 +10:00
e54caf76cb Fix T52663: Remap used invalid local-view data
Only the camera from View3D.localvd is used,
other pointers may be invalid.

Longer term we should probably clear these to ensure no accidents.
For now just follow the rest of Blender's code and don't access.
2017-09-06 20:52:49 +10:00
b41d34040b Merge branch 'master' into blender2.8 2017-09-06 16:50:59 +10:00
47b7f06d0e Fix error in high bit-depth image tile drawing
From @1xundoredo in D2824
2017-09-06 16:11:19 +10:00
0fd31c53ee Rigidbody: Fix regression introduced in ee3fadd
Baking rigid body cache was broken if some cached frames already
existed.

This is just a band aid for release, the logic need to be looked into
further.
2017-09-05 19:59:46 +02:00
4ad5df8858 Fix T52374: Changes of rigid body related settings during simulation will break the simulation
Revert 9cd6b03, 3edc8c1, b87d10d and do a better fix for T50230.
2017-09-05 19:59:46 +02:00
6c66e1bc83 Fix T52251: Knife cur displaces surface 2017-09-06 01:50:36 +10:00
750e38a526 Cycles: Fix compilation error with CUDA after recent changes 2017-09-05 16:52:45 +02:00
Dalai Felinto
518e768579 Fix T52441: Principle BSDF clearcoat
Since the change to prevent shader recompilation at every update, we got
a regression when clearcoat was used.

Basically at the shader build time we would determine if the shader
needed clear coat, and if it didin't, it would build a different GLSL
program.

However if later the user updated the clearcoat value so that it would
then require the full clearcoat shader, the user wouldn't get it until
manually forcing the shader to recompile, or reopening the file.

We now handle the optimization in the GLSL code. That adds a minimum
overhead due to branching. But the overall performance seems unchanged
(tested on linux in AMD and NVidia).

Reviewers: pascal, brecht, fclem

Differential Revision: https://developer.blender.org/D2822
2017-09-05 16:40:27 +02:00
bffa57e6d8 Manipulator: Fix arrow2d drawing outside hotspot 2017-09-06 00:40:20 +10:00
704f6a5184 Buildbot: Fix paths to sndfile and flac
Need this in 2.79 branch as well, since build rules are based on this files.
2017-09-05 16:17:48 +02:00
16e5b932b7 Manipulator: cage2d initial rotation support 2017-09-06 00:06:53 +10:00
0a1a7323e5 Manipulator: missing exit() call 2017-09-06 00:06:53 +10:00
f01e43fac3 Fix T52433: Volume Absorption color tint
Need to exit the volume stack when shadow ray laves the medium.

Thanks Brecht for review and help in troubleshooting!
2017-09-05 15:48:34 +02:00
572b1a644f Merge branch 'master' into blender2.8 2017-09-05 22:56:03 +10:00
4d85396fe4 Cleanup: use const
Also use assert w/ rotate_m4.
2017-09-05 22:45:44 +10:00
b0bbb5f34f Cycles: Cleanup, style 2017-09-05 12:43:02 +02:00
6859695055 Fix T52649: missing custom (split) normals from FBX exporter.
Own mistake in recent rB25c5928b2b6 (this DOES NOT affect 2.79 release).
2017-09-04 21:04:19 +02:00
4a744727be Fix T52531: Blender 2D stabilisation node issue when autoscale is selected
Threading conflict, should be safe for 2.79.
2017-09-04 16:41:28 +02:00
b07e983b61 PyAPI: Add bpy.utils.register_classes_factory
Avoids having boiler plate register/unregister functions.
2017-09-05 00:24:29 +10:00
71f0c32dad Fix T52522: VSE renders with alpha transparent PNG image incorrectly
Need some extra checks and should be probably end up in 2.79 since that's a regression.
2017-09-04 14:46:17 +02:00
885c0a5f90 Cycles: Fix compilation warning 2017-09-04 13:28:15 +02:00
33249f6987 Fix T52533: Blender shuts down when rendering duplicated smoke domain 2017-09-04 13:14:54 +02:00
3789ab4166 PyAPI: fix rna_info for changes in type access 2017-09-04 16:39:13 +10:00
30d7fbd7a0 PyDoc: update context_type_map 2017-09-04 16:19:27 +10:00
f4fb329808 RNA/PyAPI: Expose Py classes in bpy.types
Operators and their properties are two different types

Previously both operators and their properties are added
causing C operators to access the properties, Python the classes.

Favor consistency in this case so only Python classes are added.
2017-09-04 14:49:27 +10:00
85d53620aa Cleanup: avoid confusing assignment 2017-09-04 14:35:35 +10:00
718af8e8b3 T52534: Compositor artifacts when scaling
Increased the maxx and maxy area of interest when scaling in this case.
2017-09-03 16:47:39 +02:00
4d148471b6 Fix T52634: EditMesh Remove doubles could hang
A single diagonal axis was used for sorting coordinates,
the algorithm relied on users not having vertices axis aligned.

Use BLI_kdtree to remove doubles instead.

Overall speed varies, it's more predictable than the previous method.
Some typical tests gave speedup of ~1.4x - 1.7x.
2017-09-03 23:52:10 +10:00
459d76ec51 BLI_kdtree: utility function to remove doubles 2017-09-03 23:43:14 +10:00
9c1cc35be2 CMake: use Blender's glew by default
Use since it's always bundled to avoid any issues caused
by version mis-match.
2017-09-03 16:36:17 +10:00
b227a3388d Fix: Deleting GPencil keyframes in DopeSheet didn't redraw the view 2017-09-03 12:49:17 +12:00
4f6196a041 Fix: Border select for GPencil keyframes was including those in the "datablock" channels even though those weren't visible
This meant that it was easy to accidentally select too many keyframes
2017-09-03 12:49:16 +12:00
c671973092 Fix: GPencil Sequence Interpolation for thickness/strength was inverted
For example, if you have two keyframes:
  k1 = 1px, k2 = 10px

it was doing:
  1px, 9px, 8px, ..., 3px, 2px, 10px
instead of:
  1px, 2px, 3px, ..., 8px, 9px, 10px
2017-09-03 12:49:15 +12:00
53ec0e5166 Fix T52227: Time Slide tool doesn't take NLA mapping into account
To be backported to 2.79
2017-09-03 12:49:15 +12:00
fcd7ac1451 [deps/msvc] Debug flags for optimized debug libs were inverted for cxx. 2017-09-02 17:14:42 -06:00
32e36a1782 Correct own error simplifying matrix checks 2017-09-03 00:05:11 +10:00
7dfcbe01b0 Merge branch 'master' into blender2.8 2017-09-02 20:08:02 +10:00
3750389ce3 Cleanup: use title caps for labels
Also consistent quoting (single quotes for enums, text uses double).
2017-09-02 16:13:33 +10:00
39f8b245d4 Fixes to cage2d scaling in the node editor 2017-09-02 03:55:45 +10:00
2ca1f29748 BMesh: use predictable order for remove-doubles
Each qsort implementation may give different results when values match.

Now fallback to sorting by index.
2017-09-02 03:30:09 +10:00
ce112cf0df Revert "Manipulator: remove unused event hack"
This reverts commit 134e927965.

Writing into const event is very bad,
but this change broke compositor manipulators.

Will look into better solution eventually.
2017-09-02 00:55:29 +10:00
8d207cdc3b Fix T52472: VSE Audio Volume not set immediately
Audio mixing is done with volume interpolation. A new handle started at
volume 1, now starting at volume 0 for a smooth fade in.
2017-09-01 12:27:21 +02:00
a5cb23c441 Merge branch 'master' into blender2.8 2017-09-01 19:17:14 +10:00
94b7bf3ec2 RNA: demote non-strict class naming to warning
This stops a lot of add-ons from registering,
while this must be resolved but there no need to force error just now.
2017-09-01 17:06:14 +10:00
18b7f05480 Cycles: follow strict class naming convention 2017-09-01 16:08:25 +10:00
c843e84892 Merge branch 'master' into blender2.8 2017-09-01 02:30:48 +10:00
0bbae3f3f6 RNA: strict naming for types in bpy.types
Blender scripts already do this, some addons will need updating.
2017-09-01 01:00:57 +10:00
217fddcb8e Cleanup: strict naming conventions 2017-09-01 01:00:56 +10:00
Dalai Felinto
44e10a5c66 Increase max/min frame range to over a million
For some specific pipelines (e.g., holographic rendering) you can easily
need over a million frames (1k * 1k view angles).

It seems a corner case, but there is no real reason not to allow users
doing that.

That said we do loose subframe precision in the highest frame range. Which can
affect motionblur. The current maximum sub-frame precision we have is 16.
While the previous limit of 500k frames has a precision of 32.

Thanks to Campbell Barton for the help here.

To be backported to 2.79
2017-08-31 16:13:04 +02:00
636baa598a RNA: Limit which classes struct-map contains
Only add subclasses of: Menu, Panel, Header, UIList, Operator

This helps avoid unnecessary naming collisions,

See T52599 for details
2017-08-31 23:49:50 +10:00
018137f762 Cycles: Cleanup, indentation and trailing whitespace 2017-08-31 14:47:49 +02:00
323a7ab944 Merge branch 'master' into blender2.8 2017-08-31 21:57:38 +10:00
8b9e1707a1 Cycles: Fix typo in comment 2017-08-31 13:24:32 +02:00
a35aae9e49 Correct last commit 2017-08-31 19:12:55 +10:00
732f70a151 RNA: existing type check used wrong identifier
Own error in recent type checks, in many cases the 'idname'
is used for the struct identifier, not the 'identifier'
which is the Python class name in this context.
2017-08-31 18:45:00 +10:00
480def9c55 Fix T52591: OpenColorIO not working correct with OpenGL core profile on macOS.
Also remove textureSize() replacement code, is always supported now.
2017-08-30 19:59:07 +02:00
17f26e181f OCIO: use modern GLSL texture functions
small part of ongoing OpenGL upgrade
2017-08-30 13:33:37 -04:00
cc830e2586 Manipulator: correct pivot w/ non 1:1 aspect 2017-08-31 03:07:05 +10:00
eafe96a718 Manipulator: empty image manipulator, use aspect 2017-08-31 02:38:16 +10:00
00ba48a699 Manipulator: replace old cage2d manipulator
Mostly internal changes, keeping both manipulators
could have worked but there was no point long term.

There are still some glitches to resolve, will work on those next.
2017-08-31 02:00:16 +10:00
b448b025c7 Manipulator: rename callback type 2017-08-31 02:00:16 +10:00
4f1b510d75 Cycles: Add tangent attribute tests 2017-08-30 17:42:00 +02:00
29b2a47a8a Fix T52588: Shape key value driver variables of duplicated object sets refer to old objects.
Regression since 2.78, to be backported to 2.79.
2017-08-30 17:24:06 +02:00
Dalai Felinto
698bae05aa Eevee: Fix conditional statement depending on unitialized value
Basically since g_data was malloc'ed (instead of calloc'ed)
g_data->minzbuffer was never initialized.

So when running DRW_framebuffer_init after EEVEE_effects_init, the test
to *g_data->minzbuffer would lead to unpredictable results.

This was caught by valgrind, reported by Sergey Sharybin.
2017-08-30 17:00:00 +02:00
25c5928b2b Refactor 'split faces' mesh code.
Previous version was trying to do a quick and simple process in the case
we were only considering smooth/flat status of faces.

Thing is, even then, the algorithm was not actually working in all
possible situations, e.g. two smooth faces having a single vertex in
common, but no common edges, would not have split that vertex, leading
to incorrect shading etc.

So now, tweaked slightly our split normals code to be able to generate
lnor spaces even when autosmooth is disabled, and we always go that way
when splitting faces.

Using smooth fans from clnor spaces is not only the only way to get 100%
correct results, it also makes face split code simpler.
2017-08-30 16:52:47 +02:00
Dalai Felinto
510651ed72 Attempt to fix OpenColorIO issues on Mac
We cannot have version130 there (should use version 330 instead).
Patch suggested by Brecht Van Lommel
2017-08-30 15:45:11 +02:00
Stefan Werner
68dfa0f1b7 Fixing T52477 - switching from custom ray/triangle intersection code to the one from util_intersection.h. This fixes the bug and makes the code more readable and maintainable. 2017-08-30 11:48:49 +02:00
fbcf05f443 Depsgraph: Copy-on-write component does not depend on itself 2017-08-30 11:15:58 +02:00
998947360b Manipulator: remove inline matrix calculation 2017-08-30 18:13:25 +10:00
8b23549d47 Manipulator: run callback when calculating the final matrix 2017-08-30 18:04:42 +10:00
124ffb45a6 Cycles: Fix build with networking enabled 2017-08-30 00:19:44 -04:00
1457e5ea73 Fix Cycles Windows render errors with BVH2 CPU rendering.
One problem is that it was always using __mm_blendv_ps emulation even if the
instruction was supported. The other that the emulation function was wrong.

Thanks a lot to Ray Molenkamp for tracking this one down.
2017-08-29 22:55:35 +02:00
d34dac1070 Depsgraph: Fix crash when ungrouping node group
We shouldn't tag both COW and shading parameters ocmponents for update at
the same time.
2017-08-29 17:12:43 +02:00
9deccce07d Depsgraph: Fix missing material update when driving property in a group 2017-08-29 17:03:07 +02:00
696f4dc85f Alembic: Fix T52579: crash when replacing slightly different alembic files
Apparently with Maya in a certain configuration, it's possible to have an
Alembic object without schema in the Alembic file. This is now handled
properly, instead of crashing on a null pointer.
2017-08-29 16:58:13 +02:00
852d702da0 Fix possibly missing flushes back to copy-on-write operation
Could have happened if multiple tags per object happens.
2017-08-29 16:28:06 +02:00
Alexander Gavrilov
735e287271 Fix T48079: Maintain Volume constraint overcompensates.
The coefficient has been wrong since introduction for some reason.

Not backwards compatible, should not be merged to 2.7*.
2017-08-29 15:23:47 +03:00
01bdb0c76e Support Copy To Selected and Alt-Click for F-Curves in the curve editor.
This affects the curve display color setting, but is really intended
for future per-curve options.

The id_data reference in the created rna pointers refers to the object
even if the curve is actually owned by its action, which is somewhat
inconsistent, but the same problem can be found in existing code.
Fixing it requires changes in animdata filter API.
2017-08-29 14:30:44 +03:00
f846846941 Depsgraph: Fix missing updates when tweaking node tree parameters
The is following: split copy on write update for node trees, and if we are only
tagging for uniform buffer update we skip whole datablock copy and only invoke
copy default_values form original nodetree to a copied one.

Thing which i'm not sure is: whether we need to use different branches in graph
itself to control such a conditional behavior, or whether we need to store tag
somewhere in the dependency graph. There are obviously cons and pros in both
approaches, and need to think about this. Maybe with more examples it becomes
more obvious which way is better.

This only fixes manual tweaks for now, animation support is coming.
2017-08-29 12:58:55 +02:00
c1582667ca Add utility function to copy default values from one tree to another
The trees should match in nodes layout completely.
2017-08-29 12:55:03 +02:00
9ca03ba410 Manipulator: use cage2d_rotate in UV view
Use when selection bounds isn't a single point.
2017-08-29 20:04:31 +10:00
369cd8521b Manipulator: new cage2d manipulator
Adding alongside the existing one for now,
but it should eventually replace it.

Uses a matrix instead of (position + scale),
written so rotation can be done more easily.

Currently has a primitive handle for rotation, supports corner scaling.
2017-08-29 20:04:31 +10:00
c7f106cbe2 View2D: function to get view to region matrix 2017-08-29 19:36:40 +10:00
83ea224a7f Depsgraph: Fix missing updates when changing node tree topology
There were two issues here:

1. material_update did not do anything, because DEG_id_tag_update was storing
   update tags in original IDs, which had nothing evaluated. Even more, material
   update should have been called with evaluated version of material, Solved
   this by copying update tag from original ID to a copied one.

   However, perhaps DEG_id_tag_update should tag both original and copied ID,
   so updates are never gets lots if some depsgraph is not visible.

2. Tagging material for update should ensure it's copied version of node tree is
   up to date, otherwise material will still use old node tree.

This solves missing material updates when changing topology. Tweaking values is
still broken, because of GPUMaterial using pointer to original node's socket
value, which gets broken after copy-on-write of the node tree (pointers of nodes
are changing).
2017-08-29 11:32:25 +02:00
6b8132a153 Merge branch 'master' into blender2.8 2017-08-29 19:38:01 +10:00
3d56bfbc82 Merge branch 'master' into blender2.8 2017-08-29 16:06:26 +10:00
1c92ffa149 Transform: scale center override by aspect
Needed for image space.
2017-08-29 16:01:16 +10:00
db1ffe11b6 Cleanup: naming (RECT -> CAGE2D)
Make cage2d 'part' defines public (needed to assign operator actions).
2017-08-29 12:53:57 +10:00
156c0ab255 Depsgraph: Don't case ID_Type to short 2017-08-28 11:51:53 +02:00
52dd5c5fcf Merge branch 'master' into blender2.8 2017-08-28 11:44:39 +02:00
b4b1397ad9 Depsgraph: Don't cast ID_Type to short 2017-08-28 11:43:36 +02:00
f9f4e20871 Merge branch 'master' into blender2.8 2017-08-28 11:27:50 +02:00
2e71927622 Make GS macro return proper IDType type
Previously it was returning short, which was really easy to (a) compare against
non-ID type value (b) forget to handle some specific value in switch statement.

Both issues happened in the nearest past, so it's time to tighten some nuts
here.

Most of the change related on silencing strict compiler warning now, but there
is also one tricky aspect: ID_NLA is not in the IDType enum. So there is still
cast to short to handle that switch. If someone has better ideas how to deal
with this please go ahead :)
2017-08-28 11:21:55 +02:00
f4b3678646 Atomics: Use system headers directly, without bad level dependency to BLI
This will make it easier to re-use library as-is in other projects,
such as Cycles standalone repo for example.
2017-08-28 11:06:15 +02:00
49e7b77b19 Depsgraph: Pass copy-on-write pointer to material update
Unfortunately, there is something else wrong going on here, which makes objects
black after tweaking material settings.
2017-08-28 11:00:42 +02:00
6b5d8c29e6 Merge branch 'master' into blender2.8 2017-08-28 10:33:29 +02:00
b11b5b273e Buildbot: Tweak nightly schedule of builds
Basically, schedule linux 64 earlier on, so builds are ready for nightly benchmarks.
2017-08-28 09:12:53 +02:00
7114b5681f Missing from last commit (missed manually resolving) 2017-08-28 16:29:13 +10:00
8cd2b6ca8e Merge branch 'master' into blender2.8 2017-08-28 16:04:42 +10:00
a520e7c85c Transform: center override
Hidden option to override transform center.
Needed for manipulators that define their own center.
2017-08-28 16:00:28 +10:00
af108a2f26 Merge branch 'master' into blender2.8 2017-08-28 14:25:10 +10:00
c8627b9067 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 14:25:00 +10:00
2f8c8ec8fb Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 14:25:00 +10:00
0f1fc5f50d Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 14:25:00 +10:00
c16a98bb06 Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-28 14:25:00 +10:00
1261a29fc0 EditMesh: set edge-rin subdiv minimum to 1
This only made sense for bridge tool.

D2785 by @mbjorkegren
2017-08-28 13:01:11 +10:00
cb7f1f8160 Docs: BMesh.from_mesh behavior w/ multiple calls 2017-08-28 12:40:36 +10:00
0b5cabdca5 Fix T51400: Pasting hex code fails
The # prefix is supported,
the button didn't give enough space to paste it.

D2812 by @candreacchio
2017-08-28 12:18:39 +10:00
Julian Eisel
e0ce01c3b1 Fix blenderplayer compilation 2017-08-28 02:08:47 +02:00
ddff9d0ea6 Manipulator: support operator per-part
A single manipulator could only assign a single operator to each part.
Now each part can have it's own.

Also modify 2D selection callback, 2D started at 1, 3D at 0.
Now use -1 for unset value, start both at 0.
2017-08-28 00:56:08 +10:00
dcebad773f Fix T52498: Deleting force field doesn't remove "Surface" from modifier stack.
Logic in `ED_object_check_force_modifiers` was inconsistent between add
and remove modifier cases.

Should be safe enough for 2.79.
2017-08-27 12:20:21 +02:00
ca9801bd42 Merge branch 'master' into blender2.8 2017-08-27 16:35:51 +10:00
c90452e111 BLI_rect: Function to calculate a matrix from 2 rctf's 2017-08-27 16:19:34 +10:00
b1f2b69884 Missing from last commit 2017-08-27 15:24:41 +10:00
6178cf8353 Cleanup: use stubs for eigen gtest 2017-08-27 15:21:09 +10:00
2ff7ba2c6c Correct matrix stack assert 2017-08-27 11:22:31 +10:00
b07dcb8fb0 Missed last commit 2017-08-27 03:51:25 +10:00
b6b27b0671 Fix T52515: Crash on BMesh.to_mesh() 2017-08-27 02:44:15 +10:00
79111f9246 Merge branch 'master' into blender2.8 2017-08-27 00:51:54 +10:00
7e43210edb WM: move theme check out of ED_view3d_draw_select_loop
In 2.8x this needs to be in view3d_opengl_select,
so simplest to make in master too.
2017-08-27 00:48:52 +10:00
fa365d5f2f Fix minor Mesh -> BMesh conversion issues
- Vertex only meshes never restored their selection history.
- Select history was cleared on the source instead of the target.

Simple Optimizations:
- Avoid O(n^2) linked list looping that checked the entire list before
  adding elements (NULL values in the source array to prevent dupes).
- Re-use vert & edge lookup tables instead of allocating new ones.
2017-08-26 23:14:18 +10:00
fe71c86888 Fix T52478: Error report "Shrinkwrap: out of memory" on invisible target.
Shrinkwrap must check it does have valid target data.

Safe for 2.79 release.
2017-08-26 14:48:00 +02:00
5c4fc93f67 Fix T52538: Outliner crash when displaying groups and using Show Active on editmode bone not in any groups
There's no guaranty that given ID is found in current outliner tree...

Safe for 2.79, though not a regression.
2017-08-26 12:28:21 +02:00
58d92cefbd [cycles/ctest] fix failing tests when output folder doesn't exist yet. 2017-08-25 17:17:49 -06:00
5121dacf9d Fix for fix (tm): Residue of the debug code 2017-08-25 21:33:44 +02:00
90110d3732 Fix mistake in previous tangent space optimization 2017-08-25 21:30:20 +02:00
12f627cd9f Cycles: Cleanup, naming of variable
Always use b_ prefix for C++ RNA data.
2017-08-25 21:30:20 +02:00
ee61a97632 Cycles: Add assert to catch possibly wrong logic 2017-08-25 21:30:20 +02:00
f9a3d01452 Cycles: Mark pixels with negative values as outliers
If a pixel has negative components, something already went wrong, so the best option is to just ignore it.

Should be good for 2.79.
2017-08-25 17:46:15 +02:00
e2ffad7823 Fix T52481: After making all local, local proxies of linked data get broken after file save and reload.
Issue was nasty hidden one, the dual status (mix of local and linked)
of proxies striking again.

Here, remapping process was considering obdata pointer of proxies as
indirect usage, hence clearing the 'LIB_TAG_EXTERN' of obdata pointer.
That would make savetoblend code not store any 'lib placeholder' for
obdata data-block, which was hence lost on next file read.

Another (probably better) solution here would be to actually consider
obdata of proxies are fully indirect usage, and simply reassign proxies
from their linked object's obdata on file read...

However, that change shall be safer for now, probably good for 2.79 too.
2017-08-25 16:16:32 +02:00
Dalai Felinto
ae04e27bfa Revert "material Glsl: Fix tangent with new orco."
This reverts commit 3888227a7b.

This "Fix" was made while ORCO was broken. Now that orco itself is fixed
this is no longer required, otherwise Tangent node produces different
results in Cycles and Eevee.
2017-08-25 15:40:40 +02:00
d79fa8dc4d Another optimization of tangent space calculation
Don't use quick sort for small arrays, bubble sort works way faster for small
arrays due to cache coherency. This is what qsort() from libc is doing actually.
We can also experiment unrolling some extra small arrays, for example 3 and 4
element arrays.

This reduces tangent space calculation for dragon from 3.1sec to 2.9sec.
2017-08-25 14:54:44 +02:00
52778ce625 Cleanup: missing break (harmless for now) 2017-08-25 22:53:37 +10:00
49717d4971 Optimize tangent space calculation by inlining functions
Brings tangent space calculation from 4.6sec to 3.1sec for dragon model in BI.
Cycles is also somewhat faster, but it has other bottlenecks.

Funny thing, using simple `static inline` already gives a lot of speedup here.
That's just answering question whether it's OK to leave decision on what to
inline up to a compiler..
2017-08-25 14:50:04 +02:00
90299e4216 Cycles: Add utility function to query current value of scoped timer 2017-08-25 14:27:34 +02:00
12d527f327 Cycles: Correct logging of sued CPU intrisics 2017-08-25 14:27:34 +02:00
dfae3de6bd Cycles: Fix stack overflow during traversal caused by floating overflow
Would be nice to be able to catch this with assert as well, will see what would
be the best way to do this/.\

Need to verify with Mai that this solves crash for her and maybe consider
porting this to 2.79.
2017-08-25 14:27:34 +02:00
Dalai Felinto
0feeef89f0 Fix T52528: generated texture mismatch between Cycles and Eevee
Finally orco should be working 100% on Eevee now. Thanks for Sergey
Sharybin for reporting this.
2017-08-25 14:22:21 +02:00
Dalai Felinto
99b1f9f4f4 Revert "Eevee: Fix generated coordinates when no texture coordinates connected"
This reverts commit 0e29a97813.
2017-08-25 14:22:21 +02:00
Dalai Felinto
4e975b6b44 Fix ORCO never used for draw manager (Eevee)
Related to T52528.
2017-08-25 14:22:21 +02:00
8e6c18a98f Merge branch 'master' into blender2.8 2017-08-25 22:22:58 +10:00
de669c3b60 WM: ensure 3D view theme is used in select-loop
Yet another case where theme could be used uninitialized.
2017-08-25 22:10:27 +10:00
f8f6f8f26e Merge branch 'master' into blender2.8 2017-08-25 20:45:16 +10:00
16377abda8 WM: initialize WM and deps before handling events
This avoids obscure bugs where operators could run from
events that happen before the UI and depsgraph have been initialized.

See: D2809 for details.
2017-08-25 20:26:52 +10:00
Dalai Felinto
0e29a97813 Eevee: Fix generated coordinates when no texture coordinates connected
Orco should behave the same if it comes from unconnected vec inputs, or
from the Texture Coordinate -> Generated node output.

Fixup for 11e7e0769a.

This is related to T52528. The coordinates are still different between
Eevee and Cycles, but at least it behaves consistent within itself.

In fact the shader should now be correct, but the orco attributes we are
passing the shader seems to be where the problem is. But it's to be
tackled separately.
2017-08-25 11:47:38 +02:00
2d5935a9c0 This copyright text (copied to binary distros) had a confusing statement about
scripts being "Artwork" which is your sole property and free to license.

I've removed the reference to scripts in this text.

This was from 2002! With our Python scripts becoming part of how Blender runs,
such scripts now are officially required to be compliant with GNU GPL.

For more information; check the FAQ or consult foundation@blender.org
https://www.blender.org/support/faq/
2017-08-25 11:11:19 +02:00
9e762693db Fix manipulator remove tag, it cleared all groups 2017-08-25 15:19:30 +10:00
3f4b3fdfba Manipulator: zero grab offset w/o target property
Some manipulators are used like on-screen buttons,
in this case it doesn't make sense to keep track of their state,
so zero the offset when its unused.

Needed for lamp-target manipulator.
2017-08-25 15:13:11 +10:00
738d942d29 Correct error in recent use of PyC_Long_*
Regression in 46cf33bf0
2017-08-25 02:09:23 +10:00
1b5a690c72 Fix crash handling manipulator events before drawing 2017-08-25 00:20:14 +10:00
33f9b6d016 Depsgraph: Fix crash editing mesh in edit mode 2017-08-24 16:01:08 +02:00
97fadb7b59 Depsgraph: Cleanup typo 2017-08-24 15:52:52 +02:00
9662803833 Fix error using wrong theme settings w/ depth draw
Clicks events before first draw would assert,
unlikely to cause user visible errors but
would assert in UI_ThemeGetColorPtr.
2017-08-24 23:22:55 +10:00
a679457263 Fix T51907: New Depsgraph - Camera constraint is not evaluated properly
This is more a workaround for until we've got proper visibility flush, which
will likely happen in blender2.8 branch.
2017-08-24 14:35:48 +02:00
436d1b4e90 Cycles: FIx issue with -0 being considered a non-finite value 2017-08-24 14:32:56 +02:00
Dalai Felinto
552656611b Merge remote-tracking branch 'origin/master' into blender2.8 2017-08-24 10:41:59 +02:00
Dalai Felinto
1fb2637006 Cycles Bake: Fix overflow when using hundreds of images
We have a hardcored limit of 1000 images to be baked.
However anything anove 100 would be leading to overflow in the code.

Caught by warning from builder bot (my compiler doesn't even complain
about this, but it should).
2017-08-24 10:34:56 +02:00
e20c825b05 Manipulator: modal callback can now cancel & pass events
Re-use operator return flags for manipulator modal & invoke,
this means manipulators can allow navigation or other events to be
handled as they run - see T52499
2017-08-24 17:04:28 +10:00
134e927965 Manipulator: remove unused event hack 2017-08-24 12:02:08 +10:00
76b74a93a8 Fix Cycles CUDA transparent shadow error after recent fix in c22b52c.
Fishy cat benchmark was rendering with wrong shadows. Cause is unclear,
adding printf or rearranging code seems to avoid this issue, possibly a
compiler bug. This reverts the fix and solves the OSL bug elsewhere.
2017-08-24 03:43:02 +02:00
b85d36d811 Code cleanup: remove shader context.
This was needed when we accessed OSL closure memory after shader evaluation,
which could get overwritten by another shader evaluation. But all closures
are immediatley converted to ShaderClosure now, so no longer needed.
2017-08-24 03:43:02 +02:00
e476298084 Docs: rename var and comment how it's used
switch_from_camera wasn't right since it was used for auto-perspective.
2017-08-24 02:11:31 +10:00
Dalai Felinto
efd07aaada Fix blenderplayer (tm) 2017-08-23 17:55:50 +02:00
0671814e3b Merge branch 'master' into blender2.8 2017-08-24 01:07:09 +10:00
0b5b464e82 Correction to last fix 2017-08-24 01:05:20 +10:00
76d695f761 Fix T52490: NDOF orbit doesn't lock in ortho view
Regression in af3f7db caused by own fix for T51324
2017-08-24 00:51:25 +10:00
520ea73ad0 Fix bplayer (c) 2017-08-23 16:43:10 +02:00
3277bd4031 Fix T52396: Crash loading template w/o config dir 2017-08-23 22:06:42 +10:00
579edb1510 Cycles: Add maximum depth stat to bvh builder 2017-08-23 06:54:26 -04:00
2540741dee Fix implementation of atomic update max and move to a central location
While unlikely to have had any serious effects because of limited use, the
previous implementation was not actually atomic due to a data race and
incorrectly coded CAS loop. We also had duplicates of this code in a few
places, it's now been moved to a single location with all other atomic
operations.
2017-08-23 06:54:25 -04:00
5c60721c9e Fix T51805: Overlapping volumes renders incorrect on AMD GPU
We need to make sure we can store all volume closures for all objects in volume
stack. This is a bit tricky to detect what would be the "nestness" level of
volumes so for now use maximum possible stack depth. Might cause some slowdown,
but better to give reliable render output than to fail quickly.

Should be safe for 2.79 after extra eyes.
2017-08-23 12:35:23 +02:00
cb4884f50b Merge branch 'master' into blender2.8 2017-08-23 20:16:47 +10:00
b9513706cb Cleanup: mark VA_NARGS_COUNT as public
Was already used in two other headers, remove underscore prefix.
2017-08-23 20:16:17 +10:00
37cfa44222 Cleanup: move variadic defines to their own header
So we can use in headers without pulling in many other defines.
2017-08-23 20:16:17 +10:00
1a76bc7aeb Fix T52218: Missing update when reconnecting node
If node was connected to output, we tag tree for update no matter where
the node was re-plugged to.

Should be safe for 2.79.
2017-08-23 11:49:20 +02:00
54507234b7 RNA: use string join functions as with operators 2017-08-23 19:40:48 +10:00
917d069cdb Merge branch 'master' into blender2.8 2017-08-23 19:21:52 +10:00
cf8d35edc8 RNA: use string-join to simplify operator register
Also sanity check macro-operator ID's.
2017-08-23 19:18:22 +10:00
81c0e643a0 BLI_string_utils: string joining utility functions
Includes a version that takes a separator and macros for convenience.
2017-08-23 19:17:27 +10:00
55861cb234 PyAPI: avoid instantiating args twice in macro
Would cause problems if args included function calls.
2017-08-23 18:48:32 +10:00
9d6d413c7c RNA: check for duplicate manipulator names 2017-08-23 16:22:48 +10:00
58a4c767a1 Merge branch 'master' into blender2.8 2017-08-23 16:10:45 +10:00
b8d77c44f1 Cleanup: remove space from filenames 2017-08-23 15:50:44 +10:00
46b9f89f5e Tests: fix incorrect check for hidden dir
Copy-pasted mistake in tests and tools.
2017-08-23 15:36:39 +10:00
1e60ac3394 RNA: report error on struct naming collision
Fixes T52463, error instead of crash.
2017-08-23 15:02:21 +10:00
4761dea573 RNA: keep structs_map valid w/ ID duplicate & free 2017-08-23 14:14:55 +10:00
8899ac1550 GHash: BLI_ghash_reinsert_key utility function
Useful when ghash keys are reallocated.
2017-08-23 13:03:35 +10:00
980a8646d8 Fix T52466: Silence search for button_context menu type.
We were showing "search for unknown menutype WM_MT_button_context" messages in terminal which were not helpful for users, so now they are disabled.

To be backported to 2.79
2017-08-22 21:35:09 +02:00
f09dee5aed Fix error in PointerProperty argument list
Regression in a7b3047
2017-08-23 02:14:33 +10:00
4d8e3b649b Fix T52483: Fill is incorrect for interpolated strokes
The recalc flag must be enabled for new interpolated strokes.
2017-08-22 17:43:20 +02:00
9cfb72ff81 Merge branch 'master' into blender2.8 2017-08-22 16:31:33 +02:00
9f40153094 Fix T52209: New Depsgraph - animated follow curve constraint sometimes freaks out when the curve has a parent 2017-08-22 16:27:33 +02:00
f3e02eb32e Depsgraph: Cleanup, make code friendlier to be edited in columns 2017-08-22 16:24:58 +02:00
c80ab62aee Depsgraph: Remove placeholder for path evaluation
Wasn't used in years, if it really needs to be dedicated operation it needs to
be revisited anyway.
2017-08-22 16:12:01 +02:00
4699799288 Fix threading conflict when doing Cycles background render
It is possible to have same image used multiple times at different frames,
which means we can not free it's buffers without any guard. From quick tests
this seems to be doing what it is supposed to.

Need more testing and port this to 2.79.
2017-08-22 15:50:05 +02:00
831e86d539 GPUTexture: Remove Warning. 2017-08-22 14:41:36 +02:00
Dalai Felinto
d7b3e33af4 GL_TEXTURE_2D_ARRAY wasn't handled in GPU_texture_update
Although the problem was exposed in 9457715d9a, the problem was in the
original code that was copied over. To have:

```
} else { /* EXPECTED_VALUE */
```

Without an BLI_assert(value == EXPECTED_VALUE); is asking for troubles.
Yet another reason to favour switch statements with:

```
default:
    BLI_assert(!"value not implemented or supported");
```

Instead of chained if/else if/else /* expected_value */.
2017-08-22 14:37:28 +02:00
5f4066c87d add GPU_glew header 2017-08-22 22:22:21 +10:00
7e6b702e65 Fix T52053: Sculpt missing update w/ clay engine
Leaving sculpt mode wasn't updating the mesh because the update
flushed from the depsgraph ignored edits to vertex location.
2017-08-22 22:10:13 +10:00
2f19559258 Cleanup: naming for mesh dirty flags
- NOCHECK -> ALL
- ALL -> MAYBE_ALL

Where 'MAYBE_ALL' checks to see if the mesh has changed.
This is clearer that `BKE_MESH_BATCH_DIRTY_ALL` is dirty and
going to be updated without any guess-work.
2017-08-22 22:07:25 +10:00
1155fc94fd Fix T52454: Crash in DEG_graph_on_visible_update when activating scene layer
Most likely needs in 2.79 final release.
2017-08-22 12:53:34 +02:00
Dalai Felinto
9457715d9a GPU Texture: Use switch instead of if/else 2017-08-22 12:30:03 +02:00
cc5e90f75d Manipulator: template for Python manipulator
This is an example of a manipulator that defines it's own geometry.
2017-08-22 20:16:22 +10:00
f4fe405da9 Manipulator: Add API target_get/set/range wrappers
Allows Python manipulators access the values of target properties
needed for Python to make use of the general target property interface.
2017-08-22 18:57:38 +10:00
bd935b5aed Merge branch 'master' into blender2.8 2017-08-22 18:21:05 +10:00
ccff7c3c82 PyAPI: Minor gawain corrections 2017-08-22 18:13:19 +10:00
417581636f Eevee: Fix T52486
For that introduce an update function for textures.
2017-08-22 10:22:11 +02:00
691ed21842 PyAPI: replace PyC_FromArray with typed functions
This was meant to be generic but introduced possible type errors
and unnecessary complication.
Replace with typed PyC_Tuple_PackArray_* functions.

Also add PyC_Tuple_Pack_* macro which replaces some uses of
Py_BuildValue, with the advantage of not having to parse a string.
2017-08-22 18:10:57 +10:00
049932c4c3 Fix panorama render crash with split kernel, due to incorrect buffer pointer.
Also some refactoring to clarify variable usage scope.
2017-08-22 00:41:07 +02:00
296d74c4b1 Cycles: reorganize Performance panel layout, move viewport BVH type to debug. 2017-08-21 19:05:17 +02:00
81a76469ca Fix for recent fix in fc890cd, cstdint is c++11 only so don't use it yet. 2017-08-21 19:05:17 +02:00
7e87849257 Cleanup: rename manipulator API functions
- WM_manipulatorgrouptype_remove- > free
- WM_manipulator_group -> WM_manipulator_group_type

Naming here is still a bit confusing,
now at least free/remove are differentiated.
2017-08-22 02:06:46 +10:00
be89b95e98 Fix crash re-registering manipulators
Duplicating strings caused problems using strings in
both struct hash and manipulator group types own hash.
2017-08-22 01:55:11 +10:00
37a5fe2d4d Fix T52479: Regression: Motion Tracking no longer works 2017-08-21 17:23:42 +02:00
3e555d3d78 Merge branch 'master' into blender2.8 2017-08-21 15:41:03 +10:00
0033f0e161 Cleanup: uneven/double indentation 2017-08-21 15:38:11 +10:00
592dd9dea6 Modify menu from last commit
Also correct tool-tip.
2017-08-21 15:24:40 +10:00
361c7cbbc5 Fix T52434: Restore mesh center of mass calculation
The new method while improved for solid objects
doesn't work for non-manifold meshes, keep both.
2017-08-21 15:19:08 +10:00
d007828ae7 Eevee: Offset the for each AA sample.
This means we have less overall noise for rendered image.
SSR, AO, and Refraction are affected by this change.

SSR still exhibit artifacts because the reconstruction pattern needs to change every frame (TODO).
2017-08-21 01:39:23 +02:00
43a6cf1504 Cycles: attempt to recover from crashing CUDA/OpenCL drivers on Windows.
I don't know if this will actually work, needs testing. Ref T52064.
2017-08-20 23:18:25 +02:00
fc890cdae2 Fix Windows build error after recent Python changes in a10a7f42. 2017-08-20 23:15:43 +02:00
47d1f67eab Fix T52473: blender internal Fresnel and Layer Weight only work with linked normal.
Please backport this to 2.79.
2017-08-21 00:09:16 +02:00
41e6068c76 Revert "Cycles: remove square samples option."
This reverts commit 757c24b6bc.

We'll revisit this when doing deeper sampling changes.
2017-08-20 23:46:05 +02:00
1d1ddd48db Fix T52470: cycles OpenCL hair rendering not working after recent changes. 2017-08-20 23:32:20 +02:00
1b79d323d9 Cleanup: move gawain header out of GPU_matrix
Avoids requiring glew headers in Python API.
2017-08-21 01:41:20 +10:00
ce0fce2207 Code cleanup: deduplicate some bsdf node methods. 2017-08-20 17:37:22 +02:00
146b0c6b04 Fix T52439: Crash after adjusting lenght of hair particles.
Regression from rBfed853ea78221, calling this inside thread worker was
not really good idea anyway, and we already have all the code we need in
pre-threading init function, was just disabled for vertex particles
before.

To be backported to 2.79.
2017-08-20 17:18:48 +02:00
4f881e0d97 CMake version bump: 3.5 2017-08-20 17:01:27 +02:00
b5f8063fb9 Cycles: support baking normals plugged into BSDFs, averaged with closure weight. 2017-08-20 16:51:53 +02:00
a7362eb219 Manipulator: helper API for drawing custom shapes
This exposes 2 methods for manipulators:
- new_custom_shape
- draw_custom_shape

This can be used for script authors to create and re-use shapes
without dealing with lower level API's.
2017-08-21 00:11:16 +10:00
adabc315e9 PyAPI: add gpu.select (initial module)
This only exposes load_id, it's needed for Python manipulator drawing.
2017-08-20 23:13:42 +10:00
59e10bae3c Manipulator: add read-only matrix_world 2017-08-20 22:44:22 +10:00
0b07c2c8a2 Code cleanup: remove copy of shader graph for bump, no longer needed. 2017-08-20 14:27:51 +02:00
2530ae6c74 Merge branch 'master' into blender2.8 2017-08-20 21:22:00 +10:00
e27a59d411 Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python
Recent inclusion caused build error with the BGE.
2017-08-20 21:14:33 +10:00
cb03cc6600 PyAPI: gpu.matrix.push_pop context manager
Avoid un-balanced push/pop usage (which can interfere with Blender's
internal state) using a context manager.
2017-08-20 19:42:31 +10:00
f6825d333b Fix bpy library load: invalid function signature 2017-08-20 19:04:16 +10:00
8037f3602f PyAPI: Add exceptions to stack push/pop
Raise exception when stack limits are reached.
2017-08-20 17:26:51 +10:00
33b265c4fb PyAPI: use PyC_Long_As... for gawain
Avoids inline overflow checks.
2017-08-20 15:58:37 +10:00
7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
46cf33bf01 PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.

Some inline exceptions are kept because they show useful details.
2017-08-20 15:49:10 +10:00
a10a7f42de PyAPI: Integer conversion functions
Python's C-API doesn't provide functions to get
int's at specific integer sizes.

Leaving the caller to check for overflow,
which ended up being ignored in practice.

Add API functions that convert int/uint 8/16/32/64, also bool.
Raising overflow exception for unsupported ranges.
2017-08-20 15:39:08 +10:00
2ff9c8a3bc PyAPI: avoid redundant PyLong_AsLong call
Assigning to an RNA array converted from Python to C twice.
2017-08-20 15:30:14 +10:00
64c7cf2036 PyAPI: correct int range checking 2017-08-20 10:34:21 +10:00
07ca9860e2 [windows/make.bat] add option to automatically download libs.
The thing that most often still goes wrong for new users building blender on windows is checking out the libraries, some skip over the wiki, some check out to the wrong folder, in an effort to reduce the time i spend on this, I added detection of svn and misisng libs to make.bat .

When the user has svn installed, and the libdir is missing he'll be asked if he wants to download them

if svn is not installed, or the user chooses 'no' the current error message is shown.

Reviewers: Blendify, sergey, juicyfruit

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D2782
2017-08-19 12:00:45 -06:00
c22b52cd36 Fix T52452: OSL trace broken after shadow catcher recent changes.
We should only early out with any hit in BVH traversal if the only visibility
bits used are opaque shadow. Not when opaque shadow is one of multiple bits.
2017-08-19 18:14:16 +02:00
4218b9367e Cycles tests: pass Blender custom arguments from CYCLESTEST_ARGS.
This is useful for testing with different devices, split kernel, OSL,
impact of integrator settings, etc.
2017-08-19 18:14:16 +02:00
cfa8b762e2 Code cleanup: move rng into path state.
Also pass by value and don't write back now that it is just a hash for seeding
and no longer an LCG state. Together this makes CUDA a tiny bit faster in my
tests, but mainly simplifies code.
2017-08-19 18:14:16 +02:00
4e4e872478 PyAPI: Add gpu.matrix API 2017-08-20 00:01:19 +10:00
2332051419 Merge branch 'master' into blender2.8 2017-08-19 21:54:05 +10:00
1cc4033df8 PyAPI: expose matrix parsing function 2017-08-19 21:36:50 +10:00
4437ccf476 Correct error in gawain wrapper for non-gcc compilers 2017-08-19 20:22:15 +10:00
08094e8f23 Audaspace: cmake fixes, lowering to 3.0 minimum required. 2017-08-19 11:46:21 +02:00
9a262ed47e Cleanup: remove unneeded include
Complicated using GPU_matrix from PyAPI.
2017-08-19 17:16:24 +10:00
5720890cf8 Eevee: Bloom: Add Bloom Color
Moar artistic control yay!
2017-08-19 02:40:02 +02:00
63f70ef14d Eevee: Bloom: Add Clamp setting
It's purpose is to limit the amount of light that spread across the screen.

Not entierly sure if it's very usefull, but it sure help to avoid to drown the screen in bloom.
2017-08-19 02:39:16 +02:00
2abc21ace5 Eevee: Fix problem with GPU_texture_generate_mipmap
This function was called to recreate the lower mip level of the probe texture. But this is not it's usage and it introduced a stall.

This patch add cubemap mipmap level regeneration in eevee_effects.c
2017-08-19 01:20:09 +02:00
4d428d14af Fix T52443: Cycles OpenCL build error after recent mesh lights changes. 2017-08-19 01:02:55 +02:00
a702ff4c03 CMake: Boost no longer needed for Audaspace references either 2017-08-18 19:07:39 +02:00
d282dc04ef Cycles tests: add light type tests. 2017-08-18 17:09:12 +02:00
5cf36c0f05 Cycles tests: make page less wide, use relative URLs for serving through http. 2017-08-18 17:09:08 +02:00
Dalai Felinto
036f43f3cd Eevee: Convert metallic nodes into princinpled nodes
And wipe metallic out of the map.
2017-08-18 17:08:23 +02:00
Dalai Felinto
e8f0ee157b Swap Eevee material output with (Cycles) Material Output
Since we started supporting the (Cycles) Material Output old files
stopped working. There is no reason to keep the original Eevee material
otuput anymore.

It includes doversion for old files.
2017-08-18 17:00:45 +02:00
Dalai Felinto
8ab6e8aad6 Expose Transparency BSDF for Eevee UI 2017-08-18 16:59:13 +02:00
Dalai Felinto
2dad2aa9b7 Uniform Buffer Objects: More complete padding solution
Move floats around when needed to accomodate vec3 arrays efficiently.

With this we use slightly less memory when possible. Basically vec3s are not
treated as vec4 unless we have no float to use for padding).

Reviewers: fclem, sergey

Differential Revision: https://developer.blender.org/D2800
2017-08-18 16:42:58 +02:00
659be38760 Eevee: Rework GTAO
This includes big improvement:
- The horizon search is decoupled from the BSDF evaluation. This means using multiple BSDF nodes have a much lower impact when enbaling AO.
- The horizon search is optimized by splitting the search into 4 corners searching similar directions to help which GPU cache coherence.
- The AO options are now uniforms and do not trigger shader recompilation (aka. freeze UI).
- Include a quality slider similar to the SSR one.
- Add a switch for disabling bounce light approximation.
- Fix problem with Bent Normals when occlusion get very dark.
- Add a denoise option to that takes the neighbors pixel values via glsl derivatives. This reduces noise but exhibit 2x2 blocky artifacts.

The downside : Separating the horizon search uses more memory (~3MB for each samples on HD viewport). We could lower the bit depth to 4bit per horizon but it produce noticeable banding (might be fixed with some dithering).
2017-08-18 15:09:43 +02:00
25789f24f2 Eevee: Add some utils functions 2017-08-18 15:07:17 +02:00
2018df9939 Eevee: MinmaxZ: Avoid unecessary conversions. 2017-08-18 15:07:17 +02:00
91ab64f38f GPU_texture : Add RG8 format. 2017-08-18 15:07:17 +02:00
95b1b7756d Eevee: Fix some problem with Glass & Diffuse BSDF with SSR
Diffuse was not outputing the right normal. (this is not a problem with SSR actually)

Glass did not have proper ssr_id and was receiving environment lighting twice.
Also it did not have proper fresnel on lamps.
2017-08-18 15:07:17 +02:00
Dalai Felinto
f4bd416b34 Fix ubo vec3 alignment issue
This fixes the Principled shader in Eevee, among other nodes.

Basically before we were treating all the vec3 as vec4 as far as memory
goes. We now only do it when required (aka, when the vec3 is not
followed by a float).

We can be even smarter about that and move the floats around to provide
padding for the vec3s. However this is for a separate patch.

That said, there seems to be some strong consensus in corners of the
internet against using vec3 at all [1]. Basically even if we get all the
padding correct, we may still suffer from poor driver implementations in
some consumer graphic cards.

It's not hard to move to vec4, but I think we can avoid doing it as much
as possible. By the time 2.8 is out hopefully most drivers will be
implementing things correctly.

[1] - https://stackoverflow.com/questions/38172696
2017-08-18 12:21:02 +02:00
6fe38bf1cc PyAPI: Gawain checks for range
Raise error on vert-buffer data overflow.
Also exception on attempting to fill data thats already on the GPU.
2017-08-18 18:58:52 +10:00
4e468ceb71 PyAPI: Fix memory leak w/ empty, allocated enums 2017-08-18 18:29:27 +10:00
aae0737f57 CMake: Boost no longer needed for Audaspace 2017-08-18 18:17:29 +10:00
0c57d85941 Fix building w/o Audaspace 2017-08-18 18:16:13 +10:00
986267300b Audaspace: Moving audaspace 1.3 into extern.
Deleting the old internal audaspace.

Major changes from there are:
- The whole library was refactored to use C++11.
- Many stability and performance improvements.
- Major Python API refactor:
 - Most requested: Play self generated sounds using numpy arrays.
 - For games: Sound list, random sounds and dynamic music.
 - Writing sounds to files.
 - Sequencing API.
 - Opening sound devices, eg. Jack.
- Ability to choose different OpenAL devices in the user settings.
2017-08-18 08:24:12 +02:00
d0dad02604 Cleanup: use lowercase prefix for local API's
Also some minor corrections.
2017-08-18 08:58:26 +10:00
cb67873ac5 PyAPI: Iniital gawain API for Python
Wraps vertex-format, vertex-buffer and batch's (enough for drawing).

Doesn't yet expose index-buffers or shaders.
2017-08-18 08:45:41 +10:00
73df38a879 RNA: don't register manipulator properties by name
Matching behavior for operators.
2017-08-18 07:50:31 +10:00
ac28a4fba7 Fix leak in Python BGE filter & image types 2017-08-18 00:55:16 +10:00
Stefan Werner
7a4696197d Cycles: Fix for a division by zero that could happen with solid angle triangle light sampling 2017-08-17 15:07:59 +02:00
743bacaa6f Fix T52401: "Export Keying Set" operator generated incorrect ID's for shapekeys
To be backported.
2017-08-18 01:03:28 +12:00
Stefan Werner
8141eac2f8 Improved triangle sampling for mesh lights
This implements Arvo's "Stratified sampling of spherical triangles". Similar to how we sample rectangular area lights, this is sampling triangles over their solid angle. It does significantly improve sampling close to the triangle, but doesn't do much for more distant triangles. So I added a simple heuristic to switch between the two methods. Unfortunately, I expect this to add render time in any case, even when it does not make any difference whatsoever. It'll take some benchmarking with various scenes and hardware to estimate how severe the impact is and if it is worth the change.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: Vega-core, brecht, SteffenD

Tags: #cycles

Differential Revision: https://developer.blender.org/D2730
2017-08-17 12:44:32 +02:00
4d93323b8a Gawain: name struct's
Needed to reference without first including headers.
2017-08-17 20:37:37 +10:00
Dalai Felinto
8644fce3b7 Fix blenderplayer 2017-08-17 11:56:24 +02:00
5492d2cb67 Cycles: Calculate correct remaining time when using a larger pixel size 2017-08-17 02:00:44 +02:00
264d0cc6a0 Merge branch 'master' into blender2.8 2017-08-16 19:10:18 -03:00
9b1e0f5af6 Remove unnecessary #include "ED_transform.h" 2017-08-16 19:08:52 -03:00
85169de54d Transform: remove unused function 2017-08-16 18:55:55 -03:00
4b6c482d69 DwM: use batch select for vertex paint mode 2017-08-17 07:13:02 +10:00
7c96f613e4 DwM: Use Batch's for drawing selection
Use mesh batch cache for mesh selection.
Note that we could create the batches and free immediately
so they don't take up memory.

This resolves a problem where selection was limited
to immediate-mode buffer size.
2017-08-17 06:34:02 +10:00
916b9b311f Transform: Move enum SnapSelect to ED_transform_snap_object_context 2017-08-16 14:16:30 -03:00
a773ac4bda Support MSVSC 2017 15.3.0 (compiler 19.11)
The compiler version has changed in the last VS2017 update to 1911 and the old 1910 version is not working anymore.
2017-08-16 09:45:08 -06:00
Dalai Felinto
a4068d0083 Fix zombie manipulators when deleting collection from outliner
ND_LAYER and ND_LAYER_CONTENT both need to trigger manipulators updates.
2017-08-16 12:50:00 +02:00
90aa02290a Cleanup: rename GPU gawain functions
Were using Batch_ prefix still
2017-08-16 20:32:42 +10:00
Dalai Felinto
6bca0dcf7b Fix T52415: Copy/Pasting a mesh immediately crashes blender
Since the paste object is pasted in the active collection, and not on
its original one, we need to flush/calculate the new collection base
settings (visibility, selectability, ...).

DEG_id_tag_update() for the scene now. Though it may be better to tag
only the object specific IDs in the future.
2017-08-16 12:14:31 +02:00
Dalai Felinto
2b95617b15 Update code comments from DAG_id_tag_update to DEG_id_tag_update 2017-08-16 12:00:45 +02:00
846c11c8cf Gawain: remove GWN_batch_discard_all
Use ownership flags instead.
2017-08-16 19:51:46 +10:00
1f3724f7f4 Fix T52414: Blender 2.79 crash on object duplication via menu.
Caused by own recent changes in handling of verts/edges/etc. arrays storage
for raycasting (rBe324172d9ca6690e8).

Issue was actually even weirder - there is absolutely no reason at all to
release DM here, those finaldm are stored in Object or EditMesh structs and
handled by general update system, other code shall never try to release them!
2017-08-16 10:52:49 +02:00
Dalai Felinto
18ce2bfac6 Depsgraph/Layers: Keep original visibility when doing full scene copy
Originally we were not respecting the original visibility flags of the
collections. However this is required for Copy-on-write (CoW).

Remember to update the svn lib tests folder. I had to update some of the
json files there.

Also adding a new unittest for this particular issue:
Test render_layer_scene_copy_f
2017-08-16 10:35:26 +02:00
dbd300ab20 DwM: use gawain ownership flags for mesh drawing 2017-08-16 17:47:58 +10:00
4f97be617c Gawain: add ownership flag to Gwn_Batch
Flag ownership for each index array & vbo's
so we don't have to manually keep track of this and use the right free call.

Instead this can be passed on creation.

See D2676
2017-08-16 17:42:05 +10:00
1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
b68b26c265 Attempt to fix GLSL errors on Blender startup.
I couldn't reproduce either, but calling min() with different argument
data types and indexing vectors with an index not known at compile time
seem likely to cause problems.

Ref T52404, T52404.
2017-08-15 18:52:25 +02:00
84d33023ab Merge branch 'master' into blender2.8 2017-08-15 18:51:25 +02:00
535e83687d macOS build: simplify python install for new 10.9 libraries.
We stop using the .zip file and just have all files now in
lib/darwin/python/lib, along with numpy, numpy headers and requests.
This makes it consistent with Linux and simplifies code.

For old libraries the .zip stays, code for that gets removed when we
fully switch to new libraries.
2017-08-15 17:40:27 +02:00
477ee3a9de Fix Cycles presets after recent removal of some settings. 2017-08-15 17:40:27 +02:00
d56fb5b09d Fix missing clear of Object->drawdata listbase in new copying code. 2017-08-15 17:13:09 +02:00
5426d7134d Fix remaining issues with new Scene copying.
Some idprops were not correctly merged from source into destination.
2017-08-15 17:09:31 +02:00
c8b3f13c9e Bring new IDP_MergeGroup() on par with other copying logic.
We now have to support more complex copying types, which are controlled
by flags, so all copying logic will need to take those at some point (at
least, all potentially dealing with IDs).
2017-08-15 16:42:20 +02:00
cf2f6a986c Fix building with OCIO after recent gawain files renamings. 2017-08-15 16:35:46 +02:00
42374984f1 Fix scene_collection_copy always afecting IDs usercount.
_copy_data() functions shall not do that at all anymore. Kept as option
for now even though that helper is only called from here...

Also moar varnames renaming to standard _src/_dst sufixes.
2017-08-15 16:23:53 +02:00
b6308d79e5 Cleanup: use 'gwn' prefix for gawain filenames
Looking up names project wide or setting breakpoints wasn't so.
Names like common.h or element.h are also too generic.
2017-08-16 00:25:47 +10:00
d9e253abce Correct last commit 2017-08-16 00:25:47 +10:00
119cbf8cf5 Cleanup: rename vars with proper _src/_dst postfixes in new Scene ID data copy func. 2017-08-15 16:05:07 +02:00
77497175fa Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice
to get fully rid of it, but at the very least let's not add more of them
in new code. :)
2017-08-15 15:59:38 +02:00
90d80ddaa2 Fix new Scene ID copying code.
Missed depsgraph_legacy new pointer to nullify when merged/adapted new
ID copying code to blender2.8.
2017-08-15 15:26:22 +02:00
3bca9f5fed Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/makesrna/intern/rna_render.c
2017-08-15 13:02:45 +02:00
3311505fd0 Manipulator: border editable only w/ selected camera
While this isn't really needed, active border was annoying.
2017-08-15 20:55:13 +10:00
f20d7bed14 Alembic import: report object name in face color index out of bounds error 2017-08-15 12:43:17 +02:00
ac88a3942e Alembic import: fix crash when face color index is out of bounds.
This can happen with Alembic files exported from Maya. I'm unsure as to the
root cause, but at least this fixes the crash itself.

Thanks to @looch for reporting this with a test file. The test file has to
remain confidential, though, so it's on my workstation only.
2017-08-15 12:35:33 +02:00
caefe4943b [deps_build/macOS] Fix FFMPEG & VPX configure command
FFMPEG & VPX don't handle target with --build parameter, so we need to make sure use of plain configure command

Reviewed by: Brecht Van Lommel
Differential Revision: http://developer.blender.org/D2791
2017-08-15 12:26:33 +03:00
Dalai Felinto
dd5e674a86 Fix blenderplayer 2017-08-15 10:18:38 +02:00
ed3c3992ad Error in last commit
Get/set mismatch, reading from pchan, writing to bone.
2017-08-15 17:42:59 +10:00
d3ba86de07 Manipulator: Add b-bone spline editing
This needs some improvements since
matching handles *exactly* is a bit involved.
2017-08-15 17:39:41 +10:00
ecfc0370e0 Manipulator: grab3d use own vars to store offset
Was complicating general use case, also support for transforming with matrix_space set.
Add matrix_space support for manipulator_window_project_2d too.
2017-08-15 17:13:32 +10:00
dfb890947d Manipulator: store initial-final matrix for reuse
Also take matrix_space into account when calculating final pixel size.
2017-08-15 13:46:09 +10:00
66c1b23aa1 Cycles/BI: Add a pixel size option for speeding up viewport rendering
This patch adds "Pixel Size" to the performance options, which allows to render
in a smaller resolution, which is especially useful for displays with high DPI.

Reviewers: Severin, dingto, sergey, brecht

Reviewed By: brecht

Subscribers: Severin, venomgfx, eyecandy, brecht

Differential Revision: https://developer.blender.org/D1619
2017-08-15 01:22:40 +02:00
a8eaaa21e0 [build_deps/Windows] Add numpy headers to the python include folder on windows, required for D2716 2017-08-14 15:21:36 -06:00
e79db3b2f8 [depsbuilder] fix outdated python patch on windows. 2017-08-14 15:11:44 -06:00
30e0100813 [depsbuilder] Fix broken osl flags on windows. 2017-08-14 15:11:05 -06:00
Stefan Werner
86eb8980d3 Cycles: Fixed broken camera motion blur when motion was not set to center on frame
Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2787
2017-08-14 20:24:30 +02:00
3ab46f4204 Merge branch 'master' into blender2.8 2017-08-14 17:07:30 +02:00
595cfd2a81 Fix T52331: Motion blur shutter length not keyable
The only reason shutter time was marked as non-animatable is because Blender
Internal render does not support such animation. But this is something what
users are keeping asking for and now Blender Internal is on it's way out.

Enabled animation of this property, but noted in tooltip that Blender Internal
does not support animation of this property.
2017-08-14 16:38:50 +02:00
3cd51c0379 Fix T52391: Crash on duplicating material.
Bug in new ID copying code, thanks once again to stupid nodetrees, we
ended up wrongly remapping MA node->id pointers to NodeTree when copying
materials using node trees...
2017-08-14 15:40:54 +02:00
03a02cd109 Cleanup: confusing naming in BKE_node_tree_copy_data(). 2017-08-14 15:40:11 +02:00
04f034abad New ID Copying code: fix node_tree_copy_data still potentially increasing usercount of its gpencil pointer.
_copy_data() functions of datablocks shall never handle that, it's done
by generic calling code in library.c.
2017-08-14 15:17:23 +02:00
4e6324dd59 Cycles: Guard memcpy to potentially re-allocating memory with lock
Basically, make re-alloc and memcpy from the same lock, otherwise one
thread might be re-allocating thread while another one is trying to
copy data there.

Reported by Mohamed Sakr in IRC, thanks!
2017-08-14 14:55:47 +02:00
f0c2f4fa91 Tracking: Fix missing checks in operator poll functions
Reported by Vuk Gardašević (lijenstina) in IRC, thanks!
2017-08-14 11:46:00 +02:00
a850235a44 Fix T51850: Motion tracking - poor performance with keyframe matching on large video
Enabled cache for frame accessor and tweaked policy so we guarantee keyframed
images to be always in the cache. The logic might fail in some real corner case
(for example, when doing multiple tracks at once on a system where we can not
fit 2 clip frames in cache) but things are much better now for regular use.
2017-08-14 11:43:19 +02:00
ba84eb0f19 Tracking: Make frame accessor cache safe for threading 2017-08-14 11:43:19 +02:00
d36579bb96 Tracking: Cleanup, newlines and comments 2017-08-14 11:43:19 +02:00
ae561855cc Tracking: Cleanup, de-duplicate code 2017-08-14 11:43:19 +02:00
725a577327 Trackign: Add some basic logging about caching in frame accessor 2017-08-14 11:43:19 +02:00
4ac019cc07 Tracking: Make frame access cache aware of region
Cache is still kept disabled, need to think of a policy for cache cleanup.
2017-08-14 11:43:19 +02:00
7dfc1ad6c1 Tracking: Correct comparison in cache keys
This code wasn't uses, but the key comparison was totally wrong.
2017-08-14 11:43:19 +02:00
87e05c152a Tracking: Cleanup and some comments 2017-08-14 11:43:19 +02:00
51643056b0 Move back master to BCon1 (aka alpha) status.
Forgot to do that the other week, master is no more 2.79 RC!
2017-08-14 10:44:19 +02:00
230be97284 Merge branch 'master' into blender2.8 2017-08-14 12:13:55 +10:00
a8fbe991cd [build_deps/Windows] Prevent writing of any files into the source tree. 2017-08-13 13:02:15 -06:00
eccaa6da26 GPU_framebuffer: Fix incorrect last level. 2017-08-13 15:21:47 +02:00
e3468d7ec2 Eevee: Optimize and improve GTAO Horizon search
This fix a bug when occluder are on the edge of the screen and occludes more than they should.

Grouped the texture fetches together and clamp the ray at the border of the screen.

Also add a few util functions.
2017-08-13 14:30:47 +02:00
82e0419cc0 Eevee: Fix the AO problem around object edges.
This was due to missing GL_TEXTURE_MAG_FILTER.
2017-08-13 14:30:47 +02:00
2087158d5b DRW: Make Cache timing global and not per object.
This is to fix some performance bottleneck.
2017-08-13 14:30:47 +02:00
dc7fcebb33 Code cleanup: make L_transparent part of PathRadiance. 2017-08-13 01:19:07 +02:00
7542282c06 Code cleanup: make DebugData part of PathRadiance. 2017-08-13 01:19:07 +02:00
fce405059f Code cleanup: make it easier to test only Sobol, CMJ or Pseudorandom. 2017-08-13 01:19:07 +02:00
8f97108353 Cycles: optimize CPU split kernel data init. 2017-08-12 20:43:34 +02:00
601f94a3c2 Code cleanup: remove unused Cycles random number code. 2017-08-12 20:40:38 +02:00
6919393a51 Fix T52372: CUDA build error after recent changes. 2017-08-12 20:37:06 +02:00
22872857d4 Merge branch 'master' into blender2.8 2017-08-13 01:14:55 +10:00
b500f42700 WM: load UI for new file, even when pref disabled
Loading startup file always loads the UI now.
2017-08-13 01:09:48 +10:00
57f1475b18 GPU_framebuffer: Fix performance issue on intel.
This should fixes the error message that a stall occured because of busy mipmap.

This happened on the minmax buffer generation and introduced a random 0.2ms latency.
I'm not sure of what was happening though.
2017-08-12 16:16:43 +02:00
b858b44f2e Eevee: Fix and opimize MinMaxZ generation. 2017-08-12 16:16:43 +02:00
d7639d57dc Fix T52368: OSL trace() crash after recent changes. 2017-08-12 14:32:52 +02:00
76d0ab9750 Code cleanup: fix various compiler warnings. 2017-08-12 14:08:03 +02:00
f1a14740ba Merge branch 'master' into blender2.8 2017-08-12 14:01:54 +02:00
60ab0b8418 Fix T52298: hidden lamps still compute shadow buffers in viewport. 2017-08-12 13:22:26 +02:00
85ad248c36 Code cleanup: fix warning and improve terminology. 2017-08-12 13:18:05 +02:00
673c9dce08 Merge branch 'master' into blender2.8 2017-08-12 19:08:49 +10:00
a4bcdf5fb1 Fix T52329: Boolean with aligned shapes failed
Creating ngons with multiple axis aligned shapes in the middle of a
single face would fail in some cases.

This exposed multiple problems in BM_face_split_edgenet_connect_islands

- Islands needed to be sorted on Y axis when X was aligned.
- Checking edge intersections needed increased endpoint bias.
- BVH epsilon needed to be increased.
2017-08-12 18:35:47 +10:00
091ae0ea71 Math Lib: add isect_seg_seg_v2_point_ex
This exposes end-point bias argument, needed in rare cases.
2017-08-12 18:35:47 +10:00
b5cd89bab9 Fix width estimation for buttons with short labels in pie menus
Differential Revision: https://developer.blender.org/D2781

To be backported to 2.79 branch
2017-08-12 11:00:19 +03:00
ac17f29b2f Cleanup: quiet warnings 2017-08-12 14:07:26 +10:00
a60727080f Merge branch 'master' into blender2.8 2017-08-12 14:06:29 +10:00
ccb8e78d6c Cleanup: whitespace 2017-08-12 13:43:40 +10:00
4a1762f769 iFix T52050: Empty VSE preview for scene strips with OpenGL preview + Rendered settings.
'OpenGL Preview' checkbox was redundant now, just use seq_prev_type
value only.

Might be OK for 2.79, but should be double-checked first...
2017-08-11 18:02:54 +02:00
00cb352790 Fix T52149: LoopTriArray computation was not correctly protected against concurrency.
Note: this commit seems to work as expected (also with transform
snapping etc.). However, it is rather unsafe - not enough for 2.79 at
least, unless we get much more testing on it. It also depends on three
previous ones.

Note that using a global lock here is far from ideal, we should rather
have a lock per DM, but that will do for now, whole DM thing is doomed
to oblivion anyway in 2.8.

Also, we may need a `DM_DIRTY_LOOPTRIS` dirty flag at some point. Looks
like we can survive without it for now though... Probably because cached
looptris are never copied accross DM's?
2017-08-11 17:08:41 +02:00
c034193821 Cleanup: remove useless DM_ensure_looptri().
That one was doing exactly same thing as `dm->getLoopTriArray()`, no
point in having twice the same code here...
2017-08-11 17:08:41 +02:00
e324172d9c Fix transform snap code using 'allocated' flags to get verts/edges/etc. arrays again from DM.
This was... horribly wrong, CDDM will often *not* need to allocate
anything to return arrays of mesh items! Just check whether array
pointer is NULL.

Also, remove `DM_get_looptri_array`, that one is useless currently,
`dm->getLoopTriArray` will always return cached array (computing it if
needed).
2017-08-11 17:08:41 +02:00
e9cbc700ef Cleanup: deduplicate DM's getLoopTriArray() callback.
All three functions were doing exactly the same thing, simpler to only
have one in that case!
2017-08-11 17:08:41 +02:00
9567529b8f Merge branch 'master' into blender2.8 2017-08-12 00:23:49 +10:00
e6da7bb75c Fix T52346: Alt-I (Delete Keyframes) on a NlaStrip's Extrapolate property would crash 2017-08-12 01:52:51 +12:00
b6fda7fa43 Fix T52327: Entering/Exiting NLA Tweakmode disables Scene -> Only Keyframes from Selected Channels
The tweakmode flag and the selected-channels flag accidentally
used the same value, due to confusion over where these flags were
supposed to be set. The selected-channels flag has now been moved
to use a different value, so that there shouldn't be any further
conflicts.

To be ported to 2.79.
2017-08-12 01:41:22 +12:00
b2392afc50 Fix bevel clamping bugs T51247 and T50819.
Old bevel 'Clamp overlap' code was very naive: just limit amount
to half edge length. This uses more accurate (but not perfect)
calculations for the max amount before (many) geometry collisions
happen. This is not a backward compatible change - meshes that
have modifiers with 'Clamp overlap' will likely have larger allowed
bevel widths now. But that can be fixed by turning off clamp overlap
and setting the amount to the desired value.
2017-08-11 09:13:27 -04:00
30e83d58ff Object Apply Transform: option to apply properties
In some cases users may want to disable this option
to avoid changing other properties besides vertex locations.
2017-08-11 22:32:07 +10:00
31be0a6e52 Fix T52344: Softbody on Text.
Own previous fix (rBd5d626df236b) was not valid, curves are actually
supported by SoftBodies. It was rather a mere UI bug, which was not
including Surfaces and Font obect types in those valid for softbody UI.

Thanks to @brecht for the head up!

Also, fix safe for 2.79, btw.
2017-08-11 14:27:34 +02:00
d9323a537f Tweak maximum sizes of vertices/handle vertices
* 255 maximum seems excessive for F-Curve handle vertices; now reduced to 100

* Vertex Size is no longer restricted to the old 10px maximum size limit
  (used because Windows limited the maximum vertex size drivers needed to
  support)
2017-08-12 00:06:00 +12:00
8d42a26891 Fix: Muted strips in NLA draw with dotted borders again
It's more important that there is some form of feedback that the strips
are muted (i.e. dotted borders) than the fact that those dotted borders
may have slightly rounded corners. So, just use a regular sharp-cornered
rect when the strips need to be muted.
2017-08-12 00:05:59 +12:00
043b156c83 Code Cleanup: Use utility function here
There's no reason to manually iterate over items in a DLRBT_Tree,
as the structure is designed to be able to be safely casted down
to a ListBase and ListBase-like nodes..
2017-08-12 00:05:58 +12:00
fc016dca41 Revert C99 "cleanups" from rB09bfc378895f 2017-08-12 00:05:58 +12:00
329cd762c3 Nla Drawing: Fix strip outlines being drawn too thick 2017-08-12 00:05:57 +12:00
12c2be8c02 GraphEdit Drawing: Make active F-Curve slightly thicker 2017-08-12 00:05:56 +12:00
572745cc89 GraphEdit Keyframe Drawing: Tweak styling of handles
* Reduce interior fill opacity - These should *not* be shaded
* Adjust thickness of lines to match the old chunkiness more
2017-08-12 00:05:56 +12:00
2e25754ecd Cycles: Clarify new argument in PathRadiance 2017-08-11 13:49:50 +02:00
596ee4b505 Cycles tests: Draw images on top of checkerboard
This way it's easier to see alpha-channel only images, such as shadow catcher
images on transparent film.
2017-08-11 13:49:50 +02:00
bd069a89aa Fix T52229: Shadow Catcher artifacts when under transparency
Added some extra tirckery to avoid background being tinted dark with transparent
surface. Maybe a bit hacky, but seems to work fine.
2017-08-11 13:49:50 +02:00
00d10977c8 Eevee: SSR: Change clamp default. 2017-08-11 12:59:32 +02:00
d9f2e4c4c5 Eevee: Refraction: Fix low roughness artifact. 2017-08-11 12:53:17 +02:00
59a52fef6c Pie menu's sub-rows ignore 'EXPAND' flag
Regression, to be backported in 2.79.
2017-08-11 13:18:30 +03:00
daa834bc11 RNA: Operators were excluded from struct map
Recent changes meant structs that were registered without a name
wouldn't get added to the map.
Now assigning identifiers manages the struct-map.
2017-08-11 20:11:01 +10:00
58ee738310 GHash: note that 'deprecated' is used for private 2017-08-11 19:10:19 +10:00
bc88ee3292 Error in last commit, problems with unregister
We can't free the identifier before its used when
removing from the ghash.
2017-08-11 19:10:19 +10:00
d5d626df23 Fix T52344: Softbody on Text.
For some reasons (c) softbody modifier was marked as compatible with
curves... Would need much more work though, so for now just removing
that flag!
2017-08-11 10:24:57 +02:00
91d882a8c9 RNA: Use hash lookups for structs
Adding structs was checking for duplicates
causing approx 75k string comparisons on startup.

While overall speedup is minimal,
Python access to `bpy.types` will now use a hash lookup
instead of a full linked list search.

See D2774
2017-08-11 18:11:25 +10:00
317b8d9669 Transform: Snap used multiple eval contexts
Changes for 2.8x to use EvaluationContext caused some confusion

- Would use scene layer passed from snap context.
- Would generate duplis from Main eval context.
- Would take context argument and use it to create another eval context.

Adding context args all over and filling in a new eval-context
for every ray-cast test isn't ideal either.

Remove the context argument since the purpose of
SnapObjectContext is to avoid this kind of confusion.
Store the EvaluationContext once and re-use.
2017-08-11 11:23:39 +10:00
d1328feeb1 Merge branch 'master' into blender2.8 2017-08-11 10:33:39 +10:00
0398ee10a1 WM: don't load preferences on 'File -> New'
User preferences are now only loaded on...

- Initial startup.
- Factory-settings.
- Setting app-templates.
2017-08-11 09:40:28 +10:00
c4201e57f3 Eevee: Re: Fix NaN
This should be faster and apparently more stable.
2017-08-11 01:26:05 +02:00
aa575a3152 Eevee: SSR Clamp color when blurring buffers.
This effectivly reduce firefly bleeding all over the place.
We still need the clamp in the resolve pass because the level 0 has not been clamped.
NOTE: I did not clamped each sample individually for performance BUT I did not profile it to know how much it cost.
2017-08-11 01:26:05 +02:00
0665f58a57 Eevee: Fix NaN
This was surely cause by float overflow. Limit roughness in this case to limit the brdf intensity.
Also compute VH faster.

Add a sanitizer to the SSR pass for investigating where NANs come from. Play with the roughness until you see where the black pixel is / comes from.
2017-08-11 01:26:05 +02:00
757c24b6bc Cycles: remove square samples option.
It doesn't seem that useful in practice, was mostly added to match some
other renderers but also seems to be causing user confusing and accidental
long render times. So let's just keep the UI simple and remove this.

Differential Revision: https://developer.blender.org/D2768
2017-08-11 01:10:56 +02:00
8a7c207f0b Cycles: change defaults for filter glossy, clamp and branched path AA.
We're adding some bias by default, which now I think is the right thing
to do from a usability point of view since you really need to use those
options anyway to get clean renders in a practical time.

Differential Revision: https://developer.blender.org/D2769
2017-08-11 01:10:50 +02:00
977e7b68cb Cycles: add denoising tests, keep new image even if no reference exists. 2017-08-11 01:09:35 +02:00
267e75158a Fix T52322: denoiser broken on Windows after recent changes.
It's not clear why this only happened on Windows, but the code
was wrong and should do a bitcast here instead of conversion.
2017-08-11 01:09:35 +02:00
c31e221d4f Fix crash checking for Blender version 10+
PyAPI could trigger this, for now just truncate.
2017-08-11 09:00:00 +10:00
535a6cde64 Cleanup: redundant 'static' variable
Also use BLI_snprintf.
2017-08-11 08:49:09 +10:00
3d677d9190 Fix OSX duplicate path in Python's sys.path
The '..' in the path caused simple comparisons to fail.

D2780 by @akitula
2017-08-11 08:42:27 +10:00
e5604a2fa4 Cleanup: whitespace 2017-08-11 08:32:05 +10:00
3895c1e57e CMake: only build msgfmt if international is used
Changes to BLI would always rebuild msgfmt.
2017-08-11 08:14:04 +10:00
a8e1a7ba6d Fix MSVSC error
The array must have any initialization value
2017-08-10 17:41:47 +02:00
48a0fd6de8 Fix after last merge. 2017-08-10 16:04:01 +02:00
4a4c6da0f8 Merge branch 'master' into blender2.8 2017-08-10 15:57:59 +02:00
aa1b35bb60 Fix install_deps usage of patches.
Who in Hell did rename those files and did not update accordingly
install_deps.sh script???
2017-08-10 15:56:13 +02:00
017b7ee273 DPI: add back option to control line width, tweak default width.
Adds thin/default/thick modes to add -1/0/1 to the auto detected line width,
while leaving the overall UI scale unchanged.

Also tweaks the default line width threshold, so thicker lines start from
slightly high UI scales.

Differential Revision: https://developer.blender.org/D2778
2017-08-10 15:54:22 +02:00
e786ea6419 Fix T52334: images with non-color data should not change color space on save. 2017-08-10 15:49:17 +02:00
6e2f17ea02 Eevee: Refraction: Add "thickness" parameter.
This enables to fake a second refraction event. This is great to simulate thin planar objects such as glass panels.
2017-08-10 15:43:48 +02:00
896154d15d Eevee: Fix multiply blend mode. 2017-08-10 15:43:48 +02:00
2ba11d72a2 Object Mode Engine: Optimize outline passes.
Group texture fetches to hide latency. 3.2ms -> 2.2ms (constant time improvement, not depending on scene complexity)

Could optimize further with textureGather (require OpenGL 4.0).
2017-08-10 15:43:48 +02:00
7641f92710 Eevee: Refraction: Make it available for opaque materials.
Theses Materials are rendered after the SSR pass.
The only difference with previous method is that they have a depth prepass (less overdraw) and are not sorted.
2017-08-10 15:43:48 +02:00
7ef8a49ad5 DRW: Indent profiler timings. 2017-08-10 15:43:48 +02:00
723778b162 Eevee: Fix AO not working. 2017-08-10 15:43:48 +02:00
d16342e5fd Eevee: Add Screen Space Refraction.
For the moment the only way to enable this is to:
- enable Screen Space REFLECTIONS.
- enable Screen Space Refraction in the SSR parameters.
- enable Screen Space Refraction in the material tab.
2017-08-10 15:43:48 +02:00
98a7f1b335 Eevee: Refraction: Fix border artifacts. 2017-08-10 15:43:48 +02:00
f53fa8d148 Eevee: SSR: Fix cone footprint estimation. 2017-08-10 15:43:48 +02:00
0ab8b93fdd Eevee: SSR: Blur Mipmaps more.
Cost is negligeable (Only 0.02 ms more) and it improve stability.
2017-08-10 15:43:48 +02:00
99f37bf2a2 Eevee: SSR: Refine Raytrace Algorithm.
We track the previous ray position offseted by the thickness. If the sampled depth is between this value and the current ray position then we have a hit.
This fixes rays that are almost colinear with the view vector. Thickness is now only important for rays that are comming back to the camera.

As a consequence, this simplify a lot of things.

Also include some refactor.
2017-08-10 15:43:48 +02:00
292f5ab758 Eevee: Correct Mipmap texel alignment.
Since we are working with non power of 2 textures, the mipmap level UV does not line up perfectly.
This resulted in skewed filtering and bad sampling of the min/max depth buffer.
2017-08-10 15:43:47 +02:00
e0078cd953 Eevee: Add Refraction via probes. 2017-08-10 15:43:47 +02:00
aaa469a403 Eevee: Small code codestyle and fixes.
Rename get_specular_dominant_dir to get_specular_reflection_dominant_dir.
Add Zero length N check everywhere.
2017-08-10 15:43:47 +02:00
8e36089e41 Eevee: LUT generation.
We generate a 3D lut to precompute the btdf intensity.
I decided to use a 64*64*16 (N dot V, ior, roughness) because the btdf varies less with roughness than with IOR.
We also remap the ior to better use the space in the LUT.
2017-08-10 15:43:47 +02:00
4ec58659ad Eevee: Add precomputed BTDF LUT. 2017-08-10 15:43:47 +02:00
33ab011ae4 Tweak and extend POV syntax hilghting.
*Changed categories of some keywords
*reordered some longer keywords that didn't appear
*Activated another color (reserved builtins) by Leonid
*added some HGPOV and UberPOV missing keywords

Patch by Maurice Raybaud (@mauriceraybaud). Thanks to Leonid for additions, feedback and Linux testing.
Related diffs: D2754 and D2755.

While not a regression, this is new feature and would be nice to have it
backported to final 2.79.
2017-08-10 15:31:47 +02:00
64a87ee843 Cleanup: make seq dupli scene operands' names match global copying convention.
Followup to rB1037b90cb831b, forgot to save that file :(
2017-08-10 15:06:53 +02:00
05be2a8c45 Cleanup: de-duplicate makefile OS checks 2017-08-10 22:37:35 +10:00
ba4ffe90cd Manipulator: add compositor corner-pin widgets 2017-08-10 21:07:06 +10:00
1037b90cb8 Cleanup: make seq dupli scene operands' names match global copying convention. 2017-08-10 13:00:01 +02:00
ca3f601f93 Fix T52332: crash when duplicating sequencer strips.
Bug introduced in recent ID copying refactor.

This commit basically sanitizes seq strip copying behavior, by making
destination scene pointer mandatory (and source one a const one).
Nothing then prevents you from using same pointer as source and
destination!
2017-08-10 12:56:32 +02:00
5b6ead05bd Fix T52324: Metaball disappears when deleting first metaball object.
Lost specific MBall 'need update' case here in last year's refactor.

While technically not a regression, nice to have in 2.79.
2017-08-10 12:32:50 +02:00
8c4ccab5fe Merge branch 'master' into blender2.8 2017-08-10 11:14:36 +02:00
cf7a2c93e3 Cleanup & fix potential NULL pointer dereferencing. 2017-08-10 10:28:13 +02:00
a152743ba3 Fix T52314: New ID copy code (rBrB9da7dfa1586d) Breaks node previews in compositor.
"Just" forgot to copy data block's name in 'NO_MAIN' case... *sigh*
2017-08-10 10:28:13 +02:00
422fddab87 Cycles: Fix instanced shadow catcher objects influencing each other 2017-08-10 09:22:33 +02:00
5a618ab737 Cycles: De-duplicate trace-time object visibility calculation
We already have enough files to worry about in BVH builders. no need to add yet
another copy-paste code which is tempting to be running out of sync.
2017-08-10 09:21:02 +02:00
464c045b31 Manipulator: grab3d option to align to view
Use for lamp-target, makes it easier to click on.
2017-08-10 16:35:45 +10:00
8520cb4af0 Manipulator: cage2d translate in 3D view support
Needed for moving image-empties.
2017-08-10 14:30:02 +10:00
5406109fbf Manipulator: add image-empty manipulator 2017-08-10 14:08:38 +10:00
d5289f9d80 Manipulator: apply cage2d scale before offset
Needed when offset takes factor into account.
2017-08-10 14:03:37 +10:00
535d917870 Manipulator: expose use_draw_offset_scale to RNA 2017-08-10 09:59:17 +10:00
1d6b99b157 Cleanup: don't abbreviate color w/ manipulator API 2017-08-10 09:59:12 +10:00
7cb65cc038 Manipulator: rename grab enum
We'll want some 3D shapes, so name existing shapes 2D
2017-08-10 09:44:42 +10:00
de3c165713 Forgot to change magicnumber of OIIO built lib in previous commit... 2017-08-09 18:21:35 +02:00
6e7e081e3e install_deps: disable PTex in our OIIO building for now, broken on newest systems. 2017-08-09 18:16:21 +02:00
5fac99ca7a Manipulator: use offset-scale for lamp target 2017-08-09 23:49:27 +10:00
2f20b5242c Manipulator: disable cursor grabbing for 2D groups
We could make this a manipulator type flag,
for now disable for all 2D manipulators since its annoying for cage2d.
2017-08-09 23:39:08 +10:00
b4d44b98e8 Alembic: Adjusted unit test for Blender 2.8 to use scene layers. 2017-08-09 15:08:19 +02:00
6883f10f14 Merge branch 'master' into blender2.8 2017-08-09 15:08:06 +02:00
ed500ac8c7 Fix for previous commit
Accidentally got semicolon removed just before commit.
2017-08-09 15:00:47 +02:00
e00364c88e Fix strict compiler flags on 32bit Linux 2017-08-09 14:58:49 +02:00
2ec865035c Error in last commit 2017-08-09 22:55:18 +10:00
cb02f5250d Fix typo in new ID copying code. 2017-08-09 14:38:24 +02:00
8403ec5160 Manipulator: Add function to calculate matrix
Each manipulator was doing this slightly differently,
use shared function which can optionally override each matrix.
2017-08-09 22:34:08 +10:00
176ad9ecdd Cycles: Remove ulong usage
This is a bit confusing, especially when one mixes OpenCL code where ulong equals
to uint64_t with CPU side code where ulong is expected to be something else from
the naming.

This commit makes it so we use explicit name, common on all platforms.
2017-08-09 14:08:58 +02:00
45d7513f84 Fix T52240: Alembic Not Transferring Materials Per Frame
When a mesh changes its number of vertices during the animation,
Blender rebuilds the DerivedMesh, after which the materials weren't
applied any more (causing the default to the first material slot).
2017-08-09 13:59:58 +02:00
cdfeebd139 Alembic: Renamed variable assigned_name → assigned_mat
The variable is a pointer to a Material, not to a name/string.
2017-08-09 13:59:58 +02:00
422dc1ea1f Typo fix 2017-08-09 13:59:58 +02:00
8cfb9b9535 Fixed Alembic unit test
Commit b6d7cdd3ce changed how the mesh data
is deformed, which wasn't taken into account yet in this unit test.

Instead of directly reading the mesh vertices (which aren't animated any
more), we convert the modified mesh to a new one, and inspect those
vertices instead.
2017-08-09 13:59:58 +02:00
b5e6a21f1d Cleanup: Quiet warning 2017-08-09 20:24:51 +10:00
8c488cb97f Fix T52315: Crash on duplicating Scene without world.
Regression from rBa7b3047cefcbf, to be backported to 2.79.

Like... seriously... :|
2017-08-09 10:55:30 +02:00
55d28e604e Cycles: Proper fix for recent OpenCL image crash
Problem was that some code checks to see if device_pointer is null or
not and the new allocator wasn't even setting the pointer to anything
as it tracks memory location separately. Setting the pointer to non
null keeps all users of device_pointer happy.
2017-08-09 04:27:39 -04:00
06bf34227b Revert "Cycles: Fix crash changing image after recent OpenCL changes"
This reverts commit f2809ae0a6.
2017-08-09 04:24:03 -04:00
3f644682b0 Manipulator: add sun-beam node manipulator 2017-08-09 18:08:10 +10:00
d186ab6560 Manipulator: grab3d - support for 2d views
Also internal changes so arrow3d matches grab3d's behavior.

Needed to add WM_MANIPULATOR_DRAW_OFFSET_SCALE flag so
we can optionally apply offset in worldspace or screen scaled values.
2017-08-09 18:07:55 +10:00
f0d4420cc0 Fix spin rotate axis
Also disable lamp-target for cameras (might enable later).
2017-08-09 18:02:10 +10:00
00f22403ac Manipulator: replace hard coded color w/ theme 2017-08-09 18:02:10 +10:00
2190c0c7e5 Modules test: Don't print backtrace for files which are ignored
This could make output really polluted, where it'll be hard to see actual
issues.

It is still possible to have all backtraces printed using BLENDER_VERBOSE
environment variable.
2017-08-09 09:42:03 +02:00
fdb1c81117 Merge branch 'master' into blender2.8 2017-08-09 09:12:16 +02:00
f2728939df Fix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79
As part of the fix for T51587, I removed the Depth output for non-Multilayer
images since it seemed weird that PNGs etc. that don't have a Z pass still get
a socket for it.
However, I forgot about non-multilayer EXRs, which are a special case that can
actually have a Z pass.

Therefore, this commit brings back the Depth output for non-multilayer images
just like it was in 2.78.
2017-08-09 00:29:23 +02:00
99c13519a1 Cycles: More fixes for Windows 32 bit
- Apparently MSVC does not support compound literals
  in C++ (at least by the looks of it).

- Not sure how opencl_device_assert was managing to
  set protected property of the Device class.
2017-08-08 22:32:51 +02:00
c961737d0f Cycles: Fix compilation error of filter kernels on 32 bit Windows
We don't enable global SSE optimizations in regular kernel, and we
keep those disabled on Linux 32bit.

One possible workaround would be to pass arguments by ccl_ref, but
that is quite a few of code which better be done accurately.
2017-08-08 22:01:17 +02:00
8563494823 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_meshsequencecache.c
2017-08-08 19:16:25 +02:00
b6d7cdd3ce Fix T51701: Alembic cache screws up mesh.
Use same trick as in DataTransfer modifier e.g. to avoid modifying
existing mesh's data.
2017-08-08 18:22:24 +02:00
f2809ae0a6 Cycles: Fix crash changing image after recent OpenCL changes
Steps to reproduce:
- Create shader Image texture -> Diffuse BSDF -> Output. Do NOT select image yet!
- Start viewport render.
- Select image from the ID browser of Image Texture node.

Thing is: with the memory manager we always need to inform device that memory
was freed.
2017-08-08 17:17:04 +02:00
0e57282999 Cycles: Fix compilation error without C++11
Common folks, nobody considered master a C++11 only branch. Such decision is to
be done officially and will involve changes in quite a few infrastructure related
areas.
2017-08-08 17:02:26 +02:00
e8b6bcd65c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/object/object_add.c
	source/blender/python/intern/bpy_app_handlers.c
2017-08-08 16:43:25 +02:00
4fe1bf85af Fix fixed width box layouts
Regression, to be backported in 2.79.
2017-08-08 17:37:51 +03:00
ddfd57c0d2 Cleanup: mostly namings in make_object_duplilist_real code. 2017-08-08 16:09:01 +02:00
a78b596272 Fix T52260: Blender 2.79 Objects made duplicates real still refer armature proxy.
New code was handling correctly ID's internal references to self, but
not references between 'made real' different objects...

Regression, to be backported in 2.79.
2017-08-08 16:09:01 +02:00
90b3dba515 Fix T52255: New Depsgraph - Constraint and Drivers not working together when the driver references itself 2017-08-08 15:27:25 +02:00
126830b56c Depsgraph: Cleanup, make it easier to debug on laptop 2017-08-08 15:27:25 +02:00
19d19add1e Cycles: Cleanup, de-duplicate function parameter list
Was only needed to sue const reference on CPU. Now it is done using ccl_ref.
2017-08-08 15:27:25 +02:00
fd397a7d28 Cycles: Add utility macro ccl_ref
It is defined to & for CPU side compilation, and defined to an empty for any GPU
platform. The idea here is to use this macro instead of #ifdef block with bunch
of duplicated lines just to make it so CPU code is efficient.

Eventually we might switch to references on CUDA as well, but that would require
some intensive testing.
2017-08-08 15:27:25 +02:00
01ee88563b Fix T46329: scene_update_{pre,post} doc needs clarification
The documentation for the bpy.app.handlers.scene_update_{pre,post}
handlers states that they're called "on updating the scenes data".
However, they're called even when the data hasn't changed. Of course
such handlers are useful, but the documentation should reflect the
current behaviour.

Reviewers: mont29, sergey

Subscribers: Blendify

Maniphest Tasks: T46329

Differential Revision: https://developer.blender.org/D1535
2017-08-08 15:16:51 +02:00
ed4707be47 Fix width estimation for empty layouts in pie menus 2017-08-08 15:52:14 +03:00
d85af2aa3f Update CUEW to latest version
Previous update pulled too much of system-wide typedefs.
2017-08-08 14:27:28 +02:00
c8a8589d4f Fix T52263: Crash When Splitting and Merging Areas with Header Text Set.
Not a regression, but safe enough to be included in 2.79.
2017-08-08 14:07:34 +02:00
12834fe0f0 Update CUDA wrangler to latest version
Brings new declarations from toolkit version 8.0, also fixes some
pointers used in function declarations.
2017-08-08 13:58:42 +02:00
ec8ae4d5e9 Cycles: Pack kernel textures into buffers for OpenCL
Image textures were being packed into a single buffer for OpenCL, which
limited the amount of memory available for images to the size of one
buffer (usually 4gb on AMD hardware). By packing textures into multiple
buffers that limit is removed, while simultaneously reducing the number
of buffers that need to be passed to each kernel.

Benchmarks were within 2%.

Fixes T51554.

Differential Revision: https://developer.blender.org/D2745
2017-08-08 07:12:04 -04:00
b53e35c655 Fix compilation error when building without Blender
Simply disabled python tests, they can't be run anyway (since blender target is
not enabled) and we don't have any player-related tests in that folder.
2017-08-08 11:32:33 +02:00
6af7d7e05e Cleanup: remove incorrect comment
enum values aren't saved in files.
2017-08-08 11:28:47 +10:00
8f6b5f1f3c Fix CMake dependencies builder issues on Linux with TBB and Python packages. 2017-08-08 02:33:37 +02:00
cf8add42b8 Merge branch 'master' into blender2.8
Stupid git handles merges terribly when there are conflicts and branch
is modified buring merge process... :((((
2017-08-07 21:09:10 +02:00
451ccf7396 Cycles: Cleanup, move curve intersection functions to own file
This way curve file becomes much shorter and it's also easier to write a
benchmark application to check performance before/after future changes.
2017-08-07 20:53:30 +02:00
77a7a7f455 Cycles: Cleanup, trailign whitespace 2017-08-07 20:53:30 +02:00
95fe9b2617 Cycles: Cleanup, remove bvh prefix from curve functions
Those are nothing to do with BVH, and can be used separately.
2017-08-07 20:53:30 +02:00
a4bbce8949 Cycles: Fix compilation error on NVidia OpenCL after recent refactor
Still need to verify this is proper thing to do for AMD OpenCL. At least now
i can compile OpenCL kernel on my laptop with sm21 card.
2017-08-07 20:52:24 +02:00
e673c9dc93 Merge again... 2017-08-07 20:48:22 +02:00
41830cc432 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 20:34:36 +02:00
947040cf2b Fix compilation error when rigid body is disabled 2017-08-07 20:11:19 +02:00
3c14f02eac Build: add scripts to build dependencies for Windows and macOS.
Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D2753
2017-08-07 17:54:26 +02:00
fc38276d74 Fix Cycles shadow catcher objects influencing each other.
Since all the shadow catchers are already assumed to be in the footage,
the shadows they cast on each other are already in the footage too. So
don't just let shadow catchers skip self, but all shadow catchers.

Another justification is that it should not matter if the shadow catcher
is modeled as one object or multiple separate objects, the resulting
render should be the same.

Differential Revision: https://developer.blender.org/D2763
2017-08-07 17:54:26 +02:00
dc4d850d10 Fix Windows build errors with recent Cycles SIMD refactoring. 2017-08-07 17:54:26 +02:00
25b8eb4631 Merge branch 'master' into blender2.8 2017-08-07 17:48:14 +02:00
e7c6b244c9 Build: add scripts to build dependencies for Windows and macOS.
Note these are intended for platform maintainers, we do not intend to
support users making their own builds with these. For that precompiled
libraries from lib/ should be used.

Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D2753
2017-08-07 17:46:06 +02:00
8b73c9a437 Fix Cycles shadow catcher objects influencing each other.
Since all the shadow catchers are already assumed to be in the footage,
the shadows they cast on each other are already in the footage too. So
don't just let shadow catchers skip self, but all shadow catchers.

Another justification is that it should not matter if the shadow catcher
is modeled as one object or multiple separate objects, the resulting
render should be the same.

Differential Revision: https://developer.blender.org/D2763
2017-08-07 17:44:15 +02:00
dc213ca066 Fix Windows build errors with recent Cycles SIMD refactoring. 2017-08-07 17:44:15 +02:00
9da7dfa158 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
b282716c3a Merge branch 'master' into blender2.8 2017-08-07 16:16:43 +02:00
580741b317 Cycles: Cleanup, space after keyword 2017-08-07 14:47:51 +02:00
771e6120c8 Cycles tests: CMake side changes to support recent files split in the SVN repo 2017-08-07 14:33:47 +02:00
0f3f093d3b Cycles: add HTML report to inspect failed test images.
Shows new, reference and diff renders, with mouse hover to flip between
new and ref for easy comparison. This generates a report.html in
build_dir/tests/cycles, stored along with the new and diff images.

Differential Revision: https://developer.blender.org/D2770
2017-08-07 14:01:24 +02:00
ee77c1e917 Code refactor: use float4 instead of intrinsics for CPU denoise filtering.
Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
a24fbf3323 Code refactor: add, remove, optimize various SSE functions.
* Remove some unnecessary SSE emulation defines.
* Use full precision float division so we can enable it.
* Add sqrt(), sqr(), fabs(), shuffle variations, mask().
* Optimize reduce_add(), select().

Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
a8cc0d707e Code refactor: split defines into separate header, changes to SSE type headers.
I need to use some macros defined in util_simd.h for float3/float4, to emulate
SSE4 instructions on SSE2. But due to issues with order of header includes this
was not possible, this does some refactoring to make it work.

Differential Revision: https://developer.blender.org/D2764
2017-08-07 14:01:24 +02:00
5e4bad2c00 Cycles: remove option to disable transparent shadows globally.
We already detect this automatically based on shading nodes and per shader
settings, and performance of this option is ok now all devices.

Differential Revision: https://developer.blender.org/D2767
2017-08-07 14:01:24 +02:00
d1752167a9 Fix T52278: 'Default' application template fails
Own error in 7398b3b7
2017-08-07 21:20:57 +10:00
2a74f36dac Fix Cycles CUDA adaptive megakernel build error. 2017-08-07 00:27:08 +02:00
f5f6f9c9ac Fix broken API doc generation: Partially revert rBa372638a76e0
Making those arrays static remove them from exported symbols, which
breaks API doc generation script.

To be backported to 2.79 branch.
2017-08-06 17:35:41 +02:00
459365443f Manipulator: experimental lamp positioning tool
- New manipulator tracks lamps to position under cursor.
- Works with multiple lamps, keeping relative offsets.
- Holding Ctrl moves the lamp.
- Access via manipulator or Shift-T.

Code could be improved, but like to get feedback from users.
2017-08-06 19:50:09 +10:00
45dcd20ca9 Cycles: CUDA split performance tweaks, still far from megakernel.
On Pabellon, 25.8s mega, 35.4s split before, 32.7s split after.
2017-08-05 14:32:59 +02:00
48adef4444 Merge branch 'master' into blender2.8 2017-08-05 07:53:07 +10:00
fa05718f27 View3D: expose normal from depth publicly 2017-08-05 07:30:28 +10:00
cd023b6cec Cycles: remove min bounces, modify RR to terminate less.
Differential Revision: https://developer.blender.org/D2766
2017-08-04 23:11:03 +02:00
1210b47a85 Tracking: Undefine temporary define
Missed this in previous commit.
2017-08-04 21:12:11 +02:00
796437247f Manipulator: fix cage2d cancel not resetting 2017-08-04 20:33:26 +10:00
a65a64cbca Manipulator: fix 2d overlay w/ Blender Render 2017-08-04 19:18:55 +10:00
e6daa161dd Tracking: Remove limit of 50 points of the track history
Was quite stupid reason for this: static size of array.

Now we allocate needed amount of points in heap if requested path length is
getting too big.
2017-08-04 09:11:26 +02:00
d7905dab6a Manipulator: add compositor crop manipulator 2017-08-04 16:45:33 +10:00
0db4dab0c3 Tracking: Cleanup of transform code 2017-08-04 08:13:38 +02:00
54cea98046 Manipulator: add manipulator space matrix
Render-border & crop-node 2d-cage manipulators where unreasonably
complicated to implement because there was no good way to define
the sub-region the manipulator was transforming in
(render border within the camera's frame for example).

Add matrix-space variable,
remove scale property from cage2d manipulator, use matrix instead.
2017-08-04 15:34:01 +10:00
0c48a091f9 Tracking: Cleanup, use boolean instead of integer 2017-08-04 07:21:01 +02:00
0a3295953c Manipulator: fix check for custom function 2017-08-04 15:17:21 +10:00
2952798cd6 BLI_math: use const args for mul_m#_series 2017-08-04 15:05:02 +10:00
b156b968ae Manipulator: modal was drawing in wrong draw-step 2017-08-04 09:41:45 +10:00
7821bac08d Manipulator: remove unused draw step 2017-08-04 09:35:07 +10:00
caf1a5fc44 Manipulator: correct center-pivot clamping 2017-08-04 09:23:50 +10:00
e16e96433f Merge branch 'master' into blender2.8 2017-08-04 08:26:05 +10:00
696599edac CMake: test build configuration support
D2765 by @akitula
2017-08-04 08:11:42 +10:00
3b57504c09 error in last commit 2017-08-03 20:05:43 +10:00
c3eac16eb7 Manipulator: disallow negative scale when resizing 2017-08-03 20:04:22 +10:00
c8d02fce93 Manipulator: use matrix to convert view coords
Was doing this with property get/set but this made view operations
require refreshing manipulator properties.
Simplify by operating on properties in their own space.

Also disable clamping for now since it assumes pixel-space.
2017-08-03 19:45:56 +10:00
e92cf80a5c Fix for last commit
Missed check for non-camera view frame
2017-08-03 18:09:11 +10:00
fe8fcb4343 Manipulator: render border widget
Note there are issues clamping & updating,
will resolve as part of changes to cage2d widget.
2017-08-03 17:57:00 +10:00
c27446b5a0 Depsgraph: Fix wrong data type used for armature tag
Spotted by Ray aka LazyDodo, thanks!
2017-08-03 08:19:13 +02:00
0d01cf4488 Cycles: Extra tweaks to performance of header expansion
Two main things here:

1. Replace all unsafe for #line directive characters into a single loop,
   avoiding multiple iterations and multiple temporary strings created.

2. Don't merge token char by char but calculate start and end point and
   then copy all substring at once.

This gives about 15% speedup of source processing time. At this point
(with all previous commits from today) we've shrinked down compiled
sources size from 108 MB down to ~5.5 MB and lowered processing time
from 4.5 sec down to 0.047 sec on my laptop running Linux (this was a
constant time which Blender will always spent first time loading kernel,
even if we've got compiled clbin).
2017-08-03 08:07:06 +02:00
4fada2e10f Manipulator: Use 2D manipulators in the 3D view
Also split update flag into draw-steps,
since drawing 3D manipulators was tagging 2D as being refreshed.
2017-08-03 15:12:47 +10:00
fc9da74942 Manipulator: use default for cage2d dimensions
Also minor cleanuup, assign new vars for manipulator group.
2017-08-03 11:28:26 +10:00
acde5bb669 Cleanup: split 3D view manipulators by type 2017-08-03 08:30:58 +10:00
be7de5f239 Cleanup: warnings 2017-08-03 08:08:47 +10:00
cd2bb7831d Cleanup: rename selectionbase -> select_id 2017-08-03 08:01:09 +10:00
ca67cdb73c Merge branch 'master' into blender2.8 2017-08-03 07:14:02 +10:00
c6c49d90dc Remove volatile, causing issues w/ GCC/ubsan
Was Cygwin workaround, no longer needed.
2017-08-03 07:10:20 +10:00
ba98f06acc mikktspace: minor optimization
Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).
2017-08-03 07:03:59 +10:00
f879cac032 Cycles: Avoid some expensive operations in header expansions
Basically gather lines as-is during traversal, avoiding allocating
memory for all the lines in headers.

Brings additional performance improvement abut 20%.
2017-08-02 20:59:19 +02:00
a280697e77 Cycles: Support "precompiled" headers in include expansion algorithm
The idea here is that it is possible to mark certain include statements
as "precompiled" which means all subsequent includes of that file will
be replaced with an empty string.

This is a way to deal with tricky include pattern happening in single
program OpenCL split kernel which was including bunch of headers about
10 times.

This brings preprocessing time from ~1sec to ~0.1sec on my laptop.
2017-08-02 20:59:19 +02:00
4ad39964fd Cycles: Speed up #include expansion algorithm
The idea is to re-use files which were already processed. Gives about 4x speedup
of processing time (~4.5sec vs 1.0sec) on my laptop for the whole OpenCL kernel.

For users it will mean lower delay before OpenCL rendering might start.
2017-08-02 20:59:19 +02:00
8ff2c14015 Fix T52250: Glitch in UI in the addon panel regression 2017-08-02 17:46:04 +03:00
3e6f5f3643 GraphEdit Handle Drawing: Fix handle-vertex size regression (2.7 -> 2.8)
Keyframe handle vertices (the circles on the ends of the handles)
should always be larger than the central vertex. This brings back the
"outer" radius value from the old gluDisk(), and doubles it to get the
necessary diameter, to scale it properly.

TODO's:
- Get rid of all fills inside these circles
- Make the central vertex square-shaped again
2017-08-03 01:52:07 +12:00
440bce242d Keyframe Drawing: Fix 2.7 -> 2.8 regressions
* Outlines of keyframes were too thick and ugly

* Size differences between keyframe types was being swallowed
  by the pixel-fudge factor, leaving colour as the only distinguishing
  factor (bad!)
2017-08-03 01:25:55 +12:00
b569151ffb Manipulator: add area lamp manipulator 2017-08-02 19:22:35 +10:00
dc4ded855a Manipulator: Make cage2d usable in the 3D view 2017-08-02 19:22:29 +10:00
1b51c34e8b Manipulator: correct cage-2d scale update 2017-08-02 08:34:59 +10:00
4afc94080c Cleanup: prefer tuples over lists 2017-08-02 07:55:15 +10:00
f934f54b84 2.79 release: new splash, yeah! 2017-08-01 19:23:19 +02:00
ebd51a022a 2.79 release: update version numbers & readfile versionning code. 2017-08-01 19:22:31 +02:00
c42c129393 Render: make Cycles and Evee support each other's output material nodes.
This changes the Cycles exporting and Cycles/Eevee UI code to support both
output material nodes, giving priority to the renderer native one. Still
missing is Eevee code to prefer the Eevee output node.
2017-08-01 19:13:41 +02:00
13d324f26b Tweak multi-units tests to match new precision handling in conversion from raw value to prety-printed one.
Note that new code allows to enable again the '1 million miles' tests.
2017-08-01 16:43:40 +02:00
636289b755 Fix multi-units drawing re precision handling.
This is still far from prefect, but yet much better than what we had so
far (more consistent with inheritent precision available in floats).

Note that this fixes some (currently commented out) units unittests, and
requires adjusting some others, will be done in next commit.
2017-08-01 16:42:35 +02:00
c1e177ad29 BLI_math: add simple helper to get amount of 'integer' digits in a float number. 2017-08-01 16:34:02 +02:00
110d6832a8 Fix typo in 2d-cage manipulator 2017-08-01 21:22:17 +10:00
6341380fbf Cleanup: warnings 2017-08-01 17:24:30 +10:00
5709021f52 Correct previous commit, instance should be cleared
Clear instance in case creating creating new instance fails.

In practice this shouldn't happen,
but better not cause further errors if it does.
2017-08-01 17:17:38 +10:00
5ac9e587d4 PyRNA: Ensure changed types creates a new instance
Changing lamp type for eg needs to create a new instance.
2017-08-01 17:14:09 +10:00
a108d81af9 Merge branch 'master' into blender2.8 2017-08-01 15:00:49 +10:00
4c38d84e73 Cleanup: double promotion 2017-08-01 13:35:26 +10:00
702e9c556f Cleanup: warnings from last commit 2017-08-01 12:31:19 +10:00
8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10:00
a372638a76 Cleanup: use static vars where appropriate 2017-08-01 09:06:34 +10:00
2b7edb77c9 Fix fcurve color assignment 2017-08-01 08:27:35 +10:00
b425e94381 Correct accidental variable declaration 2017-08-01 07:55:01 +10:00
becb413f29 Fix T52224: auto IK not respecting length, after recent bugfix. 2017-07-31 19:22:03 +02:00
66110c6b98 Code cleanup: fix warning with clang. 2017-07-31 19:07:29 +02:00
f815aa01eb Fix T52232: Crash in RNA_enum_from_value while inspecting compositor image node properties in outliner.
Bug was in RNA nodes code actually, itemf functions shall never, ever
return NULL!

Note that there were other itemf functions there that were potentially
buggy. Also harmonized a bit their code.
2017-07-31 16:51:43 +02:00
b6cb7b2c92 Fix two issues with recent changes to number display while editing them.
* Numbers with units (especially, angles) where not handled correctly
regarding number of significant digits (spotted by @brecht in T52222
comment, thanks).
* Zero value has no valid log, need to take that into account!
2017-07-31 15:43:14 +02:00
b71366801e Eevee: SSR: Change clamp to a real clamp and add Max Roughness.
Clamp will now works as in Cycles.

Max roughness limit ssr to a certain roughness level: for noise / performance tweaking.
2017-07-31 15:18:38 +02:00
1be1600c32 Eevee: Draw background after depth prepass.
Reduce overdraw. 0.4ms goes to 0.01ms if background is completely occluded.
2017-07-31 15:18:38 +02:00
683e31fd80 Eevee: SSR: Rewrote the raytracing algorithm.
It now uses a quality slider instead of stride.
Lower quality takes larger strides between samples and use lower mips when tracing rough rays.

Now raytracing is done entierly in homogeneous coordinate space. This run much faster.
Should be fairly optimized. We are still Bandwidth bound.

Add a line-line intersection refine.
Add a ray jitter between the multiple ray per pixel to fill some undersampling in mirror reflections.

The tracing now stops if it goes behind an object. This needs some work to allow it to continue even if behind objects.
2017-07-31 15:18:38 +02:00
39e1518d41 Fix glitch updating manipulator after undo
Running undo would notify manipulators to refresh,
but this still allowed for events in the queue to be handled,
where manipulators could be drawn for selection before
their refresh callback runs.

This made Python manipulators raise exceptions
about referencing invalid data (or crash).

Now tag manipulator update on file load (including undo)
and ensure the refresh callback runs
before drawing manipulator selection.

Also split manipulator map refresh flag in two since selection doesn't
perform the same operations as regular drawing.
2017-07-31 14:35:10 +10:00
3b15ff3fb4 Cleanup: use enum typedef for manipulator drawstep 2017-07-31 13:15:02 +10:00
538b191a03 Correct last commit, for-loop included NULL check 2017-07-31 11:39:17 +10:00
ac2b1663ef Cleanup: remove next/prev from manipulator map 2017-07-31 11:26:03 +10:00
18773f3f15 Fix manipulator Python API crash w/ undo
Split up manipulator free & unlink, so freeing window data doesn't
run callbacks that might use freed data.
2017-07-31 06:45:05 +10:00
0467443930 Fix manipulator keymap initialization
Update flag was cleared before being checked
when registering after load.
2017-07-31 04:47:24 +10:00
c90a3af879 Manipulator: Check we don't add multiple times 2017-07-30 15:47:57 +10:00
49c0ad1188 Revert "Fix manipulator handles getting added each refresh"
This reverts commit 122706db9c.

Would loose manipulators, will check for duplicates instead.
2017-07-30 15:38:32 +10:00
367ec386d1 BLI_memiter: minor cleanup 2017-07-30 14:23:08 +10:00
be97238308 DwM: use BLI_memiter for draw storage & iteration
This will only be noticeable for drawing many instances.

In contrived use-case with many instances, and `USE_PROFILE` disabled
this can close to double playback FPS.

The option to disable this is left in the code in case we want to
debug memory use.

See D2756 for details.
2017-07-30 02:26:36 +10:00
71388b094f DwM: add ability to disable the timer
This interferes with benchmarking draw times,
so this makes it easy to turn off.
2017-07-30 01:31:36 +10:00
913d8ec608 BLI_memiter: Small API for many small allocations
- Each allocation can be a different size
  (but should be smaller than the chunk size).
- Result can be looped over in order of allocation.
- Allocations are aligned to pointer size to avoid unaligned reads.
2017-07-30 00:08:17 +10:00
09eac0159d Property path generation fixes 2017-07-29 15:23:01 +03:00
277dc47eea Remove volatile, causing issues w/ GCC/ubsan
Should remove from master since its workaround for Cygwin
but too close to release.
2017-07-29 08:58:11 +10:00
1ee11b5085 Merge branch 'master' into blender2.8 2017-07-29 08:49:34 +10:00
fb1cd7648f Cleanup: quiet picky ubsan warnings 2017-07-29 08:42:32 +10:00
361acb6991 Cleanup: multistatement-macros warning 2017-07-29 08:21:01 +10:00
393ba0cf16 Cleanup: multistatement-macros warning 2017-07-29 08:18:20 +10:00
0e26707bce Merge branch 'master' into blender2.8 2017-07-29 06:44:04 +10:00
214bbd4c02 Replace magic numbers with deprecated names
The names aren't meaningful but means it wont
accidentally use valid names.

Also remove textured-font setting
2017-07-29 06:27:40 +10:00
f3782c0a9e Fix T52195: Sculpt from Python fails
When calling sculpt from Python,
setting 3D 'location' but not 2D 'mouse' stopped working in 2.78.

Now check if the operator is running non-interactively and
skip the mouse-over check.
2017-07-29 06:05:43 +10:00
e2a7e1e494 WM: OP_IS_INVOKE was being incorrectly set
Calling an operator with EXEC_* context would still set the invoke flag.
2017-07-29 05:44:58 +10:00
87d5e34453 Fix T52213: Enum drivers no longer work
Regression in D1812: PyDriver variables as Objects

Taking the Python representation is nice in general
but for enums it would convert them into strings,
breaking some existing drivers.
2017-07-29 02:39:16 +10:00
c558763ef5 Merge branch 'master' into blender2.8 2017-07-29 01:46:27 +10:00
e038830650 Resolve T45301 by adding option for old behavior
Some users really liked previous behavior,
so making it an option.

Cursor Lock Adjustment can be disabled to give something close to
2.4x behavior of cursor locking.

When lock-adjustment is disabled placing the cursor the view.
This avoids the issue reported in T40353
where the cursor could get *lost*.
2017-07-29 01:37:51 +10:00
2eb2655181 Cleanup: clear deprecated UI flags
Also adds cursor-lock flag, to be used in next commit.
2017-07-29 01:28:58 +10:00
9b22dbcc0d Fix T52156: Hair dynamics broken with density texture
Even strands that were excluded by the density texture were being added
to the DM passed to cloth, but these ended up having some invalid data,
because they were not fully constructed.

This simply excludes `UNEXISTED` particles from the DM generation, as
would be expected.
2017-07-28 15:30:26 +02:00
e39dc48bd5 Fix crash when duplicating object
This fixes null pointer check fiasco.
2017-07-28 13:02:20 +02:00
05f377805b Fix T52148: Point Density Texture ID User decrement error related to the Object field.
Note that fix is not perfect, systematically make refcounting of all IDs
assigned to node's id pointer, which breaks the 'do not refcount
scene/object/text datablocks' principle...

But besides that principle being far from ideal in general, it becomes
pretty much impossible to apply when using //generic// ID pointer,
unless we add some kind of type data to that pointer somehow.

So for now, better to live with that, than having broken usercount.
2017-07-28 12:43:06 +02:00
50cc0aa0d1 Depsgraph: Re-use evaluated mesh across frames and remove time dependency from all CoW components
This commit is a work forward having less updates during playback, which speeds
things up a lot here. The idea is simple: stop update all copy-on-write
datablocks (which implies full re-evaluation actually) on frame change and
re-use existing evaluated meshes as much as possible.

This brings playback speed to 24 fps on the dino test scene here. Performance
drops down a lot when armature is animated tho, but that's because of need of
tangent space calculation which we can't do much about from just a dependency
graph.

Hopefully this doesn't make copy-on-write too unstable, quick tests here are
surviving fine.
2017-07-28 12:27:34 +02:00
d41acacc61 Fix T52212: Vgroups doesn't work after Carve Boolean 2017-07-28 11:55:58 +02:00
38eabcb858 Fix potential 'divide-by-zero' in our UI fitting code.
Reported by coverity, better fix even if highly unlikely to happen...
2017-07-28 10:56:41 +02:00
304e5541cb Fix T52208: Using UI_BUT_REDALERT flag for UI_BTYPE_KEY_EVENT buttons crashes Blender.
but pointer was not assigned in that case...
2017-07-28 10:38:47 +02:00
c694f6e3fa Cleanup: Remove gitignore for api images 2017-07-27 16:04:42 -04:00
9323182e73 Prevent crash when duplicating object which doesn't have evaluated base properties yet
This mainly happens when copy on write is enabled.
2017-07-27 16:29:45 +02:00
03d258d613 Copy on write: Prevent crash when duplicating object with particle system
Transform system was using global main, which might have been pointing to a
freed scene layer.
2017-07-27 16:28:16 +02:00
1bd9531fda Fix UI messages... 2017-07-27 15:20:44 +02:00
549f43e928 Depsgraph: Attempt to keep evaluated mesh when possible
Currently wouldn't make any difference, but required for upcoming work of
getting rid of time dependency for copy-on-write component.
2017-07-27 15:19:37 +02:00
6ef34525a1 Depsgraph: Cleanup, variable name 2017-07-27 15:19:37 +02:00
e90468e5a3 Depsgraph: Cleanup, use some utility functions to shorten construction code
Still some cleanup is possible.
2017-07-27 15:19:36 +02:00
cf38371155 Depsgraph: Create ID nodes on build-time expansion using node builder
This will allow us to do some builder-specific trickery when ID nodes are
requested to be created from build-time expansion.
2017-07-27 15:19:36 +02:00
55527d83e2 Depsgraph: Allow stealing copy-on-written pointer
This will become handy when we'll be re-using evaluated meshes for
objects after relations are updated.
2017-07-27 15:19:36 +02:00
3441af49bd Depsgraph: Fix possibly missing lamp update when lamp data changes 2017-07-27 15:19:36 +02:00
41a3aafd48 Depsgraph: Make it possible to use given pre-allocated ID as a copy 2017-07-27 15:19:36 +02:00
4c5537ed42 Copy on write: Make sure freeing evaluated mesh does not cause crash when re-evaluating the object 2017-07-27 15:19:36 +02:00
7d014bca91 DRW: Fix vertex buffer too large. 2017-07-27 14:51:44 +02:00
88b911aa9e Eevee: Fix probes interfeering with SSR. 2017-07-27 14:51:44 +02:00
05d73ec06f Eevee: Planar Reflection: only support mirror reflection if not using SSR. 2017-07-27 14:51:44 +02:00
c6a74edcf8 Eevee: Fix bloom once and for all.
... Hopefully ...
2017-07-27 14:51:44 +02:00
ec6170061e DRW: Add stats group to eevee and object mode. 2017-07-27 14:51:44 +02:00
5bfa3cf6e9 DRW: Revamp the performance debugging tool.
Old performance debug was doing queries for every frame even if not debugging perf.
Also, it did not record when a pass was draw multiple time, leading to incorect measurement.

New module also allows to group the timers to limit infos displayed.

Also fix the background CPU draw timer.
2017-07-27 14:51:44 +02:00
4003409430 Fix factory setup using user scripts path still 2017-07-27 22:22:26 +10:00
2b8f50e1d4 Depsgraph: Fix crash happening in copy-on-write of images
Was a threading conflict or so in the cache limiter, and in fact
we don't even want images to be copied.
2017-07-27 13:26:21 +02:00
f1d6bad4b6 Fix T51776: Make sure button icons are updated on Ctrl-ScrollWheel 2017-07-27 12:55:17 +02:00
Julian Eisel
980efaf4fd Fix button text overlapping with shortcut text in popups
The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.
2017-07-27 12:28:16 +02:00
Julian Eisel
492b5d0bc3 Minor code style corrections 2017-07-27 12:28:16 +02:00
c72eb6288e Fix Label colors in popups 2017-07-27 12:28:16 +02:00
72e228a155 Fix: use click style if a pie was spawned by release or click event 2017-07-27 12:28:16 +02:00
f8bd6adee2 Depsgraph: Skip iterating over all ntree users on node tree parameter update
Also make sure drivers on node tree properties will work correctly for viewport.
2017-07-27 11:50:14 +02:00
Julian Eisel
920bff5224 Fix button text overlapping with shortcut text in popups
The purpose of the keymap strings is probably for un-embossed menu items
like seen in most pulldowns. I can't see a reason for also adding that
string for regularly drawn buttons within popups, we don't add it
anywhere else in the UI either. So this commit makes sure shortcut
strings are only added to buttons that are drawn like pulldown-menu
items.
2017-07-27 11:49:41 +02:00
Julian Eisel
129c3ac7b3 Minor code style corrections 2017-07-27 11:44:51 +02:00
ec22809025 Fix Label colors in popups 2017-07-27 10:27:29 +03:00
3e8b2288f5 Fix: use click style if a pie was spawned by release or click event 2017-07-27 10:13:40 +03:00
b01d38ef7d Manipulator: remove names
They weren't used anywhere,
both C & Py manipulators better assign to vars (no lookup needed).
2017-07-27 07:43:15 +10:00
1f15c61ce1 stub update 2017-07-27 07:41:24 +10:00
11e95fcdd2 Merge branch 'master' into blender2.8 2017-07-27 07:35:44 +10:00
5c963128ea Cleanup: remove check for old GCC&PPC 2017-07-27 07:29:16 +10:00
17230ec11f Cleanup: Py3.7x warning 2017-07-27 07:29:16 +10:00
320fc70cf2 Minor template code patch. (objectHitList =/= hitObjectList)
The Blender text editor's built in python template "Gamelogic" has a reference near the bottom to "objectHitList" as an alleged attribute to the KX_TouchSensor. This name is incorrect, it's correct name is "hitObjectList."

Attempting to access the suggested objectHitList returns error...
```
AttributeError: 'KX_TouchSensor' object has no attribute 'objectHitList'
```

The provided diff corrects this minor error.

Reviewers: kupoman, moguri, campbellbarton, Blendify

Reviewed By: Blendify

Tags: #game_engine, #game_python

Differential Revision: https://developer.blender.org/D2748
2017-07-26 16:05:54 -04:00
48e8a1a167 Fix crash in recent changes to instancing
Registrable classes already handled their own instancing,
changes to enable instancing everywhere conflicted.
2017-07-27 03:27:14 +10:00
6fe2a48d3e Last commit broke WITH_PYTHON_SAFETY
Re-enable BPY_id_release call with thats enabled.
2017-07-27 02:12:40 +10:00
0b5f056119 BPY_id_release was a nop, use RNA invalidate directly 2017-07-27 02:07:04 +10:00
723f2b292f Fix T52186: Crash on bevel
bContext is not always available in transform, so need to use explicit
scene and scene layer to create evaluation context from.
2017-07-26 16:33:44 +02:00
22342a7647 CLeanup: Use utility function in BKE 2017-07-26 16:33:44 +02:00
a01c1849e9 Depsgraph: Add utility function to initialize evaluation context from scene and layer 2017-07-26 16:33:44 +02:00
e99350aeaa Cleanup, line wraps 2017-07-26 16:33:44 +02:00
776c765400 Initialize time for evaluation context when creating from bContext 2017-07-26 16:33:44 +02:00
66e28a2827 Fix T52176: Bevel doesn't correctly work with default empty Vgroup.
`defvert_array_find_weight_safe()` was confusing 'invalid vgroup' and
'valid but totally empty vgroup' cases.

Note that this also affected at least ShrinkWrap and SimpleDeform
modifiers.
2017-07-26 16:23:24 +02:00
3ed5c9a610 PyAPI: Store PyInstances for ID's
This means once an ID is created,
it will keep using the same PyObject instance.

This has some advantages:
- Avoids unnecessary re-creation of instances on UI poll / redraw.
- Accessing free'd ID's gives an exception instead of crashing.
  (long standing annoyance!, though this only applies to ID's
   and not yet other data that uses the ID's - vertices for eg).
- Allows using instance comparison (a little faster).

Note that the instances won't be kept between undo.
2017-07-26 23:49:20 +10:00
40a45e393e PyAPI: Fix for instancing (Blender owns a reference)
Also set newly created values to the instance pointer.
2017-07-26 23:05:00 +10:00
80befca6e5 Manipulator: only check for highlight once
Was doing 2x lookups which is OK for click-select
but this runs on mouse-move and can become slow.

May enable this again if highlighting logic changes.

Also scale hotspot by pixelsize.
2017-07-26 20:54:37 +10:00
245a67386b blenderplayer stub update 2017-07-26 18:18:32 +10:00
2e83897f91 Cleanup: typedef enums
Manipulator enum types are easy to confuse, use typedefs.
2017-07-26 18:00:26 +10:00
54bc49e6f9 Manipulator: refactor/fix selection logic
- Cleanup array access, move into functions.
- Store allocated size to avoid realloc's on every add/remove.
- Make select editable from Python.
- Rename select callback to select_refresh
  (collided with select boolean).
- Call select_refresh when de-selecting as well as selection.
2017-07-26 08:34:09 +10:00
dee19b8cb7 FaceMaps: add select flag
For use by manipulators since they don't have their own persistent data
in the blend file.
2017-07-26 08:34:09 +10:00
3b84a0b3d2 Eevee: Fix post process with Ugly color.
This was cause by some post process not always sampling the highest mipmap.
But if there is no need for mipmapping (i.e. no SSR) these levels will be undefined.
So forcing all Post FX shader to sample level 0 fix this.
2017-07-25 22:07:35 +02:00
4fd70c99a5 Eevee: SSR: Add support for planar probes.
This add the possibility to use planar probe informations to create SSR.
This has 2 advantages:
- Tracing is less expensive since the hit is found much quicker.
- We have much less artifact due to missing information.

There is still area for improvement.
2017-07-25 22:07:35 +02:00
8c3ecc9651 Workaround for crash drawing face-maps after undo 2017-07-26 05:10:20 +10:00
2b1cd24c6e Fix T52190: Depth picking fails 2017-07-26 02:35:27 +10:00
80e03e7709 Depsgraph: Support changing scene's render engine 2017-07-25 15:11:51 +02:00
f7636f0ef2 Depsgraph: Make sure armature mode is properly changed in all copied versions 2017-07-25 14:53:19 +02:00
6a7d7586e5 Depsgraph: Initial support of pose mode for copy-on-write armature
Some basic code, makes it possible to pose existing armature.

Probably still lots of corner cases to cover, but need to start somewhere.
2017-07-25 14:38:10 +02:00
247ddb6237 Depsgraph: Fix relations update when transform is done and there was no temporary constraints created 2017-07-25 14:38:10 +02:00
f848374e49 Cleanup: rename active to modal
This matches operators naming and should avoid confusion in future if we
want to use active as term for last-selected.
2017-07-25 22:39:58 +10:00
762fa7bee3 Depsgraph: Remove unsued node flag 2017-07-25 14:06:36 +02:00
5d327eda98 Manipulator: option to draw all while interacting 2017-07-25 22:02:16 +10:00
0612011b91 Manipulator: support select-drag to tweak 2017-07-25 21:34:20 +10:00
b97bf844b3 Merge branch 'master' into blender2.8 2017-07-25 20:53:10 +10:00
edc6bec9d6 PyAPI: Skip user scripts w/ factory-startup
Adds bpy.app.factory_startup,
used to check if user scripts should be loaded.
2017-07-25 20:52:08 +10:00
8a2fdb3749 Manipulator: break after an event is handled
Now works the same as other event handling functions.
2017-07-25 20:17:54 +10:00
50e88740c4 Fix PyManipulators having keymaps registered twice
Manipulators which are registered before UI initialized would have their
keymaps initalized twice (duplicate keymap items).
2017-07-25 20:06:49 +10:00
35d9f68121 Python module test: Don't cfail the test when import failure happens in preset 2017-07-25 11:39:10 +02:00
9bdd12d884 Merge branch 'master' into blender2.8 2017-07-25 17:36:49 +10:00
d1dc5e0a53 PyAPI: utility for creating register, unregister
This simplifies creation of register, unregister functions that
simply forward calls submodules.
2017-07-25 17:34:34 +10:00
e93804318f Fix T51450: viewport render time keeps increasing after render is done.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2747
2017-07-25 01:47:04 +02:00
Matheus de Sousa Faria
b7fb00f512 Fix compositor Glare node with Simpler Star resulting in uneven rays.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1867
2017-07-25 00:48:34 +02:00
d99532e1d8 Fix crahs when doing preview from a scene withotu world 2017-07-24 17:42:55 +02:00
ff6e8b0b50 Depsgraph: Avoid assert failure in some harmless cases 2017-07-24 17:41:29 +02:00
7260a693e1 Cleanup: trailing space 2017-07-25 01:28:15 +10:00
c75f6d9245 Cleanup: remove scons config 2017-07-25 01:28:15 +10:00
7fbd529fb5 Revert "ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces"
This reverts commit 7f09b55d01.
2017-07-24 12:08:23 -03:00
34b248b746 Depsgraph: Synchronize collection visibility after copy
BKE_scene_copy explicitly ignores visibility of "source" collections make all
collections visible. This is also tested by regression tests.

While it seems more logical to simply preserve all possible visibility flags
and overrides, don't feel like submitting to a behavior-changes without talking
to author of those guards first.

This commit fixes cycles material preview.
2017-07-24 17:03:53 +02:00
35d044e40d Fix compilation error of alembic test after recent eval_ctx changes 2017-07-24 16:50:47 +02:00
34c2628f32 Eevee: Silence printfs. 2017-07-24 16:36:57 +02:00
b3466921b8 Depsgraph: Fix typo in comment 2017-07-24 16:32:07 +02:00
b11926487f Depsgraph: Fix crash when trying to create full copy of scene 2017-07-24 16:24:41 +02:00
1ddb3c953d Depsgraph: Textures and images are actually covered by depsgraph
Might be missing relation links tho.
2017-07-24 16:24:41 +02:00
deecfb5476 Depsgraph: Avoid creating ID nodes for objects which are coming from collections and not layers
If object is only listed in collection but not added to any of layers we shouldn't create
placeholder for it, because otherwise we'll leave lots of placeholder ID nodes.

Question: can we make this exception to be more reliable?
2017-07-24 16:24:41 +02:00
7b420e1908 Depsgraph: Be consistent about id type variable name 2017-07-24 16:24:41 +02:00
7721f8a269 Depsgraph: Cleanup, use utility function to clear lists 2017-07-24 16:24:41 +02:00
4719dbafdf Depsgraph: Ignore palettes from copy-on-write routines
They are not covered by dependency graph.
2017-07-24 16:24:41 +02:00
c21dd69060 Eevee: Fix crash when saving file with motion blur. 2017-07-24 16:21:43 +02:00
7f09b55d01 ransform: fix unreported bug: geometry hidden by clipping border (alt + b) is not bypassed in snap to faces
The geometry behind the farther clip_plane is not bypassed
2017-07-24 11:13:33 -03:00
8dd0ce6b78 Eevee: Fix double buffer issue. 2017-07-24 15:55:21 +02:00
27dd82a951 Eevee: SSR: Refactor multiple rays. Plus other changes...
-Allow a maximum of 4 rays per trace pixel.
-Removes parameter Normalize: use normalization all the time now.
-Add firefly clamp slider.
2017-07-24 15:36:37 +02:00
7585c82722 Eevee: Make MinmaxZ compatible with textureArray 2017-07-24 15:36:37 +02:00
85f1b7358a Eevee: Planar Reflection: Remove distance approximation.
This commit separate the depth texture into another texture array.
This remove the need to output radial depth into alpha.
Unfortunatly it's difficult to recover position from the non linear depth buffer when applying reflection without adding a bunch of stuff.
This is in preparation of SSR planar reflections.
2017-07-24 15:36:37 +02:00
1d99d08d50 Eevee: SSR: Add two hit option.
This option add another raytrace per pixel, clearing some noise.
But multiplying the raytrace cost.
2017-07-24 15:36:37 +02:00
76bf4f2cd3 Eevee: SSR: Fix Opengl Render.
Add a constant number of 4 drawing loop to accumulate 4 "bounce" of light in SSRs.
2017-07-24 15:36:36 +02:00
56ba01a561 Eevee: SSR: Fixed problem with un-initialized texture.
Also add another debug buffer and cleanup in effect_ssr_frag.glsl
2017-07-24 15:36:36 +02:00
c5f4342692 Eevee: SSR: Small fixes
- Encode normals for other opaque bsdf so they are not rejected by the normal facing test.
- Early out non reflective surfaces.
- Add small offset to raytrace to avoid self intersection.
- Fix fallback probes not appearing.
2017-07-24 15:36:22 +02:00
f6c60ffcad Eevee: SSR: Add Weight Normalization option. 2017-07-24 15:28:27 +02:00
e5dae98999 Eevee: SSR: Add View Facing fadeout.
Also make hit boolean depends on hit coord not on pdf.
2017-07-24 15:28:27 +02:00
d2462e3d26 Eevee: SSR: Add fullscreen raytrace option and Screen border factor. 2017-07-24 15:28:27 +02:00
9906ef06b1 Eevee: SSR: Use noise to dither the stride banding. 2017-07-24 15:28:27 +02:00
a3732412ad Eevee: SSR: Add stride and thickness parameters.
Also polished the raytracing algorithm.
2017-07-24 15:28:27 +02:00
18aa6cf1cc Eevee: SSR: Add fullscreen raytrace. 2017-07-24 15:28:27 +02:00
e0c1323737 Eevee: HiZ buffer: Split into two 24bit depth buffer
This way we don't have float precision issue we had before and we save some bandwidth.
2017-07-24 15:28:27 +02:00
a2932078ec Eevee: SSR: Add firefly filter and refine noise reduction.
Push to 9 resolve sample.
Add an normalization as an option since it gives harsh limits.
2017-07-24 15:28:27 +02:00
b576d06050 Eevee: Codestyle. 2017-07-24 15:28:27 +02:00
e8912dd844 Eevee: SSR: Do the SSR pass only for probes if there is no valid double buffer.
This prevent black reflection when initializing SSR.
2017-07-24 15:28:27 +02:00
f1bf9d6bfb Eevee: SSR: Add mipmap filtering and bias to reduce noise.
Also fix the roughness factors.
2017-07-24 15:28:27 +02:00
09413fad12 Eevee: Fix glossy node roughness. 2017-07-24 15:28:27 +02:00
babef873fc Eevee: SSR: Don't block the ray if tracing behind object.
This requires to check for backface after a hit.
2017-07-24 15:28:27 +02:00
72a4778391 Eevee: SSR: Add per pixel resolve of multiple rays. 2017-07-24 15:28:27 +02:00
b1a8803c24 Eevee: SSR: Add roughness random rays. 2017-07-24 15:28:27 +02:00
7938848b63 Eevee: SSR: Add double buffer so we can read previous frame color.
Also add simple reprojection and screen fade to the SSR resolve pass.
2017-07-24 15:28:27 +02:00
14bedf80cd Eevee: SSR: Make raymarch step bigger. 2017-07-24 15:28:27 +02:00
ebc2833ca1 Eevee: Fix Shader compilation. 2017-07-24 15:28:27 +02:00
3be8ab881e Eevee: SSR: Add simple raytracing.
Still imprecise.
2017-07-24 15:28:27 +02:00
19323a0ff5 Eevee: Fix clip/hashed alpha prepass/shadow crash. 2017-07-24 15:28:27 +02:00
1d00a66f5d Eevee: SSR: Encode Normal in buffer and add cubemap fallback.
Normals can point away from the camera so we cannot just put XY in the buffer and reconstruct Z later as we would not know the sign of Z.
2017-07-24 15:28:27 +02:00
2a84331f02 Eevee: SSR: Output ssr datas to buffers.
Output in 2 buffers Normals, Specular Color and roughness.
This way we can raytrace in a defered fashion and blend the exact contribution of the specular lobe on top of the opaque pass.
2017-07-24 15:28:27 +02:00
04f8e1b21c Eevee: Ssr: Add ssr id to glossy nodes.
An id is given to each glossy node in order to determine which specular lobe is using ssr.
2017-07-24 15:28:27 +02:00
b379f02f20 Fix T50039: texture paint soften strength not working with float images. 2017-07-24 15:02:39 +02:00
b7fbe6ae5d Initialize scene layer for evaluation context used by preview renderer
Ideally need to clean and sane and impossible-to-break way of making sure
evaluation context is fully initialized, but that would need some thoughts
and experimentation.
2017-07-24 15:00:44 +02:00
bbb1c0a077 Render preview: Always make sure all ID datablocks references by objects are in bmain
Otherwise we'll have confused dependency graph builder, which wouldn't be able to
build proper graph.

Didn't find a way to avoid world copy here, we can probably escape with some shallow
copy here, but that will currently complicate code a lot.

Ideas to consider here:

- Use shallow copy of existing world after new ID management API is in place.

  Downside would be thread safety, kind of nice to have everything local.

- Switch depsgraph away from ID_TAG and do hash lookup or so.

  This will slow down depsgraph builder, but will make code more reliable.
2017-07-24 14:50:26 +02:00
James Fulop
c3c0495b30 Fix T51948: pen pressure not detected with some Wacom tablets.
Generalizes current conditions, QT implements it the same way.
2017-07-24 13:54:36 +02:00
f65a8bbdb7 Correct invalid assert use 2017-07-24 17:32:28 +10:00
4fd3582b32 Manipulator: view-selected support
Only applies to selected manipulators
(currently not used for regular manipulators).
2017-07-24 17:26:02 +10:00
d53028b450 Manipulator: Expose Context.manipulator_group
Needed for operators run by the manipulator keymap
so they can access their selected manipulators.
2017-07-24 17:21:09 +10:00
c7bc2f5e87 Manipulator: handle keymaps for selected items
Was only handling keymap items when the cursor
was hovering over a manipulator.
2017-07-24 17:19:36 +10:00
9e929c911e Fix Cycles multi scatter GGX different render results with Clang and GCC.
The order of evaluation of function arguments is undefined, and the order
was reversed between these compilers. This was causing regressions tests
to give different results between Linux and macOS.
2017-07-23 23:25:12 +02:00
392b6a303e Manipulator: setup_keymap callback
Also remove manipulator_group argument, the info's in the class.
2017-07-24 03:27:57 +10:00
e982ebd6d4 Fix T52152: allow zero roughness for Cycles principled BSDF, don't clamp. 2017-07-22 23:58:51 +02:00
ec831ee7d1 Fix Cycles denoising NaNs with a 1 sample renders.
This was causing different render results with different compilers. We
can't do much useful with 1 sample, but better for debugging.
2017-07-22 23:58:51 +02:00
b4528d8897 Fix use of uninitialized value in Cycles, probably did not cause a bug. 2017-07-22 21:29:10 +02:00
9a5d06cdd5 Manipulator: use select keymap when enabled 2017-07-23 02:45:41 +10:00
661a05de23 Fix error in previous merge 2017-07-21 18:32:27 -04:00
3aeabe3afa Merge branch 'master' into blender2.8 2017-07-21 18:28:32 -04:00
a27b6ae4a9 Transform: remove unused argument 2017-07-21 18:04:05 -03:00
70eac432b7 UI: Add Open Image button to Mask Stencil Image panel
In the future we should make these two buttons on one line
However because we need `gen_context = 'PAINT_STENCIL'`
this is a little hard and we need to find a proper solution.
One might be using `context_pointer_set`

Patch by @craig_jones with edits by @blendify

Differential Revision: https://developer.blender.org/D2710
2017-07-21 16:52:41 -04:00
9e40977c27 UI: Add Open Image button to Mask Stencil Image panel
In the future we should make these two buttons on one line
However because we need `gen_context = 'PAINT_STENCIL'`
this is a little hard and we need to find a proper solution.
One might be using `context_pointer_set`

Patch by @craig_jones with edits by @blendify

Differential Revision: https://developer.blender.org/D2710
2017-07-21 16:46:35 -04:00
64fd45b1df Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-21 14:20:24 -03:00
34f0250f32 Another solution to bug T38358 and related
Moving the ray_start_local to the new position does not lose as much precision as moving the ray_org_local to the corresponding position.

The problem of inaccuracy is within the functions: `bvhtree_ray_cast_data_precalc` and` fast_ray_nearest_hit`. And not directly in the values of the rays.
2017-07-21 14:02:16 -03:00
122706db9c Fix manipulator handles getting added each refresh
The same manipulator map handler would accumulate,
slowing down interactions.
2017-07-22 01:57:23 +10:00
ac0da72a60 Fix compilation error with Collada enabled 2017-07-21 17:44:11 +02:00
911f239d09 Merge branch 'master' into blender2.8 2017-07-21 16:08:31 +02:00
11204fce4e Fix strict compiler warning in BGE when linking directly to SDL 2017-07-21 16:07:59 +02:00
5605c26fcd Fix function declaration of some modifiers
Those functions did not use evaluation context.

Also fixed lots of unused variables warnings caused by commented out code which
needs to be ported away from DerivedMesh and to evaluation context.
2017-07-21 15:54:42 +02:00
cd301bf654 Depsgraph: Cleanup, remove unused function argument 2017-07-21 15:37:51 +02:00
9c2f55baa1 Fix compilation error with smoke and rigid body disabled 2017-07-21 15:36:59 +02:00
1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
9edb7e49d7 Depsgraph: Fix missing material update when changing links in node tree 2017-07-21 14:20:30 +02:00
4e28d88ece Fix T51724: Blender 2.80 EEVEE, Cycles, Clay Black Wall Graphical Glitch 2017-07-21 12:08:25 +02:00
9fbef5d5d5 Merge branch 'master' into blender2.8 2017-07-21 11:18:02 +02:00
4d67034076 Fix T52134: New depsgraph crashes when evaluating several psys on from object 2017-07-21 11:12:34 +02:00
2200e5a280 Fix strict compiler error after recent UI changes 2017-07-21 10:52:36 +02:00
8b17ec0c00 Fix T52136: Blender segfault (stack overflow most certainly) when converting to mesh.
Stupid mistake in own recent refactor.
2017-07-21 10:24:20 +02:00
dc6fcb8ecf UI/floats: Reduce our UI_PRECISION_FLOAT_MAX by one to avoid most rounding issues.
The way we use it, UI_PRECISION_FLOAT_MAX is actually + 1 to get total
number of digits, and float only has 7 meaningful digits, so that define
shall be at 6.
2017-07-21 10:12:35 +02:00
c425653f16 Set face-map to active when selecting
It was annoying have to use select operator to know which facemap
applies to the active face. This behavior follows materials.
2017-07-21 15:50:58 +10:00
db8bc1d982 Fix a few harmless maybe uninitialized warnings with GCC 5.4.
GCC seems to detect uninitialized into function calls now, but then isn't
always smart enough to see that it is actually initialized. Disabling this
warning entirely seems a bit too much, so initialize a bit more now.
2017-07-21 00:54:58 +02:00
0d4fd7528f Fix T46560: 2D paint smear and soften brushes not working with alpha.
Interpolate rather than do alpha over mix, matching projection paint.
2017-07-21 00:47:43 +02:00
2b132fc3f7 Fix T52135: Cycles should not keep generated/packed images in memory after render. 2017-07-20 23:47:05 +02:00
a4cd7b7297 Fix potential memory leak in Cycles loading of packed/generated images. 2017-07-20 23:46:58 +02:00
3ededb19d8 Depsgraph: Fix crash when updating materials with copy on write enabled
The code was freeing GPU materials from non-main thread.
2017-07-20 17:48:36 +02:00
dfcb568c16 Fix T51925: Eevee: Animated Eevee values slowdown
Move material update from RNA callback to dependency graph.
2017-07-20 17:48:36 +02:00
177a8f6dab Manipulator: add access to manipulator's group 2017-07-21 00:51:03 +10:00
6b0d4302be PyAPI: use instancing when supported
This means when a new data-type is returned it will use the same
instance as the previously created one (if it exists).
2017-07-21 00:50:18 +10:00
57ee488404 Partially revert previous commit, some unwanted changes sneaked in 2017-07-20 16:15:13 +02:00
21f27692da Depsgraph: Use explicit material update operation code
Avoids string comparison on key matching.
2017-07-20 16:03:04 +02:00
83b0bf9166 Depsgraph: Solve TODO about more granular particle settings update tagging 2017-07-20 15:38:48 +02:00
905366ca7e Fix/workaround T52127: Combed hair from 2.78 not showing when appending
Quick solution to prevent particle components from being tagged for complete
re-evaluaiton.
2017-07-20 15:16:57 +02:00
3b12a71972 Fix T52125: principled BSDF missing with macOS OpenCL. 2017-07-20 15:15:43 +02:00
84a87bf45a Depsgraph: Fix crashes when OCIO configuration is missing
We were creating copy on write version of scene prior to validating color management
settings for the original scene.
2017-07-20 15:00:09 +02:00
b7d0cfaa60 Depsgraph: Fix missing UV layers with copy on write enabled 2017-07-20 14:29:13 +02:00
Stefan Werner
c1ca3c8038 Cycles: fixed the SM_2x CUDA kernel build that I broke in my previous commit 2017-07-20 13:28:34 +02:00
00ddbd5848 Depsgraph: Fix crash with copy on write when scene has legacy bases
The remapping code was creating plkaceholders for objects coming from legacy
bases, but since those objects were never created by dependency graph (since
they are supposed to be ignored) the copy on write relations creation was
confused.

Now we do some special trickery to clear legacy bases on copy on write.
2017-07-20 13:27:34 +02:00
f42bb9d278 Depsgraph: Ignore groups from copy on write expansion
Groups will not have IDs in the dependency graph, so we shouldn't
create them for CoW as well.
2017-07-20 13:27:34 +02:00
f5f34a9aa6 RNA: face-map access
Currently RNA doesn't give us a good way of accessing singleton layers,
for now expose as a layer list (skin & paint-pask do this too).

Noted in T47811 that this should be changed.
2017-07-20 19:52:26 +10:00
819f3b37da BMesh face map layer access 2017-07-20 19:52:26 +10:00
Dalai Felinto
eee4755c74 Fix active object doesn't show on templateID
Before that if you went to the object panel tab in the Properties Editor
the active object wouldn't show in the first panel.
2017-07-20 10:37:53 +02:00
Stefan Werner
4bc6faf9c8 Fix T52107: Color management difference when using multiple and different GPUs together
This commit unifies the flattened texture slot names for bindless and regular CUDA textures. Texture indices are now identical across all CUDA architectures, where before Fermi used different indices, which lead to problems when rendering on multi-GPU setups mixing Fermi with newer hardware.
2017-07-20 10:03:27 +02:00
0e2f8ed8a6 Depsgraph: Move strict checks under ifdef blocks
Those checks are not always helpful, since id remapping doesn't want to
worry about which components to tag for update. Perhaps in the future we
will introduce special flag which would mean "tag everything possible"/
2017-07-20 09:44:09 +02:00
Julian Eisel
827dc700ba Fix T51969: Filebrowser "Open File" button disappear when double-click thumbnail
This reverts commit 82ba89b042 (which caused T51969) and adds an
alternative fix (don't unset area stored in modal handler for fileselect
handlers).
2017-07-19 21:46:30 +02:00
adc43ff43f Merge branch 'master' into blender2.8 2017-07-20 03:53:44 +10:00
6e90294e08 Fix topology mirror ignoring center verts
Caused select-mirror to fail with edges & faces.
2017-07-20 03:52:53 +10:00
7fd4ad448c Clay Engine: Fix blue noise warning when compiling without clay. 2017-07-19 18:17:56 +02:00
02e318e8b9 Eevee: Fix crash when using lamps in dupli groups. 2017-07-19 18:17:56 +02:00
Dalai Felinto
2382f979e2 Doversion: Set Clay when opening "Blender Render" engine scenes
We get already enough reports of people complaining about crashes on
edit mode unaware that they are in the non-supported Blender Render
engine.

Blender Render is going away, no reason to keep it around. Once we have
a nice fallback on Eevee and fast file loading we can default to Eevee
instead.
2017-07-19 18:14:50 +02:00
9f9244b6ae Depsgraph: Remove redundant argument from add_id_node() 2017-07-19 17:31:32 +02:00
e29c54674c Depsgraph: Fix strict compiler error with copy on write disabled 2017-07-19 16:26:22 +02:00
53c1d15675 Depsgraph: Fix particle system freeing accessing freed particle settings
Need to ensure CoW IDs are freed in the right order.
2017-07-19 16:21:12 +02:00
496d18614f Depsgraph: Fix heap use after free when freeing scene with compositor
This is the fake ID nature of compositor again. Need to discard such
pointers before freeing datablock even for scenes (before it was done
for objects only).
2017-07-19 15:20:07 +02:00
6bb7a4cdf2 Depsgraph: Fix assert failure on Cycles render
Was happening when there was material in bmain but not used by any object.
2017-07-19 15:20:07 +02:00
17dcdbcf16 Depsgraph: Fix remapping of node trees when they reference self material 2017-07-19 15:20:07 +02:00
e49aa6beac Depsgraph: Add missing expansion od custom bone shapes 2017-07-19 15:20:07 +02:00
5d9a1b440b Depsgraph: Fix wrong ID remapping when armature object is constructed prior to it's targets
Previously it was possible to run into situation when armature is constructed prior to
objects which are used for it's constraints. This was causing wrong scene evaluation.

Now we create placeholders for objects used by armature in case they don't have ID node
yet, which ensures we have proper mapping from original to copy-on-write ID pointer.
2017-07-19 15:20:07 +02:00
a532fe561e Depsgraph: Ensure scene camera object is always built 2017-07-19 15:20:07 +02:00
b2ca2bb591 Depsgraph: Add code which helps catching cases when requested ID node is not ready yet
This shows the bug when IK solver doesn't update reliably when targeted an external
object and when that object is handled by build_object() after the armature.
2017-07-19 15:20:06 +02:00
49e496118b ID: Add run-time flag indicating that ID is coming from copy-on-write 2017-07-19 15:20:06 +02:00
44c6d45c2e Depsgraph: Fix compilation error in previous commit 2017-07-19 15:20:06 +02:00
c2ffea7f12 Depsgraph: Remove hacky workaround for copy-on-write tagging flushing updates to everything
Wasn't working reliably,m and it's somewhat dangerous anyway. Seed something smarter.
2017-07-19 15:20:06 +02:00
3212e72cfe Depsgraph: Fix crash opening file with IK solver with copy on write enabled
The issue was caused by id_copy_no_main() changing pointers of constraints used
in pose to a newly allocated ID. This is correct, but caused confusion too our
copy on write remapping, because we are mimicing inplace duplication by copying
memory over from a temporarily duplicated ID to a proper placeholder. This was
causing dangling pointers in pose to a temporarily allocated ID.

Now we add special code to remapping callback which replaces temporary ID with
a proper one.
2017-07-19 15:20:06 +02:00
ac136babb5 Depsgraph: Restore ID datablock tag when Object is tagged with OB_RECALC_DATA
Was lost in one of the previous commits.
2017-07-19 15:20:06 +02:00
3efde4a03c Depsgraph: Restore workaround for CoW objects not being fully expanded 2017-07-19 15:20:06 +02:00
17cd9f8df4 Depsgraph: Prevent wrong particles state when canceling playback 2017-07-19 15:20:06 +02:00
c3f64ea009 Depsgraph: Fixes to make particle system behave more correct
Couple of main things here:

- Properly handle PSYS_UPDATE_* flags from DEG_id_tag_update.

  There are still some possible issues here related on the fact
  that we don't differentiate different PSYS_UPDATE_* flags here
  and handle the mall the same.

  Other possibility here is that object level particle settings
  evaluation might be forced when particle system evaluation is
  tagged for update. Didn't see actual issue here yet, but need
  a closer look.

- Don't tag non-object datablocks on visibility changes.

  Those don't depend on visibility anyway. This prevents particle
  settings IDs from flushing updates to all objects, causing all
  cached particles to be lsot.

- Only update translation and geometry components on visibility
  changes.

  Once again, this prevents particle cache from being invalidated.

  We might need to tag material components here still tho.
2017-07-19 15:20:06 +02:00
a31233f5d2 Depsgraph: Stop tagging all IDs for update on depsgraph rebuild
This code needs to be changed. For the time being CoW might become less stable,
but need to stop doing such tag for other work.
2017-07-19 15:20:06 +02:00
414cc821d8 Depsgraph: Initial implementation of more granular tagging
This commit makes it so that only ID components which correspond to the tag
flag are tagged for update (previously the whole ID would have been updated
in the most of cases).

This allows us to have more granular tag flags and prevent tagging of things
we don't want to be tagged.
2017-07-19 15:20:06 +02:00
50f5f0957c Depsgraph: Cleanup, de-duplicate couple of utility functions 2017-07-19 15:20:06 +02:00
5eddc183b0 Depsgraph: Cleanup, remove unused untested functions 2017-07-19 15:20:06 +02:00
5727e8706f Depsgraph: Use dependency graph flush routines to update particle settings
Previously tagging particle settings for update will iterate over all objects and
all their particle system to see whether something needs an update or not. Now we
put ParticleSettings as an ID to the dependency graph, so tagging it for update
will nicely flush updates to all dependent particle systems.

Current downside of this is that due to limitation of flush routines it will cause
some extra particle system re-evaluation when it technically not needed, and what's
more annoying currently it will discard point caches more often.

However, this is a good and simple demonstration case to improve tagging/flushing
system to accommodate for such cases (similar issues happens with CoW and shading
components). So let's try to find some generic solution to the problem!
2017-07-19 15:20:06 +02:00
2fe5cf4807 Depsgraph: Use explicit parameters eval operation code
This replaces usage of generic PLACEHOLDEWR with string lookup with more
explicit opcode. This should make it faster to build dependency graph by
avoiding string comparisons when it's not needed.

There should be no user measurable different.
2017-07-19 15:20:06 +02:00
917bff4f44 Depsgraph: Add generic parameters evaluation operation code
Currently unused, but the idea is to use this code instead of placeholder
operation code followed by string comparison.
2017-07-19 15:20:06 +02:00
9356119765 Depsgraph: Use more explicit naming for operation codes
This way it's better indication what group of operation codes things belongs to.
2017-07-19 15:20:06 +02:00
ec2bca26e8 Despgraph: cleanup, make separation of opcodes strings more clear 2017-07-19 15:20:06 +02:00
62de80166e Depsgraph: Use more explicit name for particle system evaluation opcode 2017-07-19 15:20:06 +02:00
73adf3e27d Fix (unreported) seldom crash when using previews in filebrowser.
Hopefully fix it actually, at least could not reproduce it anymore with
that changen, but Was already quite hard to trigger before.
We need a memory barrier at this allocation, otherwise it might happen
after preview gets added to done queue, so preview could end up being
freed twice, leading to crash.
2017-07-19 12:55:05 +02:00
abe0527e0f Manipulators: use nearest manipulator
Add utility function to get the nearest hit
2017-07-19 20:12:24 +10:00
5376b3eeca Fix T52116: Blender internal BVH build crash in degenerate cases. 2017-07-19 11:06:20 +02:00
dd64cedd0b Merge branch 'master' into blender2.8 2017-07-19 14:38:22 +10:00
3daa641d7f Fix T52092: Crash un-grouping nodes 2017-07-19 14:32:31 +10:00
Dalai Felinto
231d688219 Outliner: Use scene_layer from context 2017-07-18 17:14:43 +02:00
8b2785bda5 Fix T49498: continuous grab issues on macOS, particularly with gaming mouses.
Change the implementation so it no longer takes over the mouse cursor motion
from the OS, instead only move it when warping, similar to Windows and X11.
Probably the reason it was not done this way originally is that you then get
a 500ms delay after warping, but we can use a trick to avoid that and get much
smoother mouse motion than before.
2017-07-18 16:11:33 +02:00
3cfb248bb6 Fix T52109: Folder search won't work when selecting animation output folder.
Text search would not run in case there was no 'type' enabled in filter
buttons. Now instead consider that no types enabled == all types
enabled.
2017-07-18 16:01:28 +02:00
Dalai Felinto
c226488a27 Layer cleanup: get rid of one of the placeholder functions 2017-07-18 11:16:14 +02:00
Dalai Felinto
f3039c7e78 Context/Workspace: Get scene layer from workspace 2017-07-18 11:16:14 +02:00
ecb5b55d7f Fix bad loss of precision when manually editing values in numbuttons.
While drawing nice 'rounded' values is OK also for 'low precision'
editing like dragging and such, it's quite an issue when you type in a
precise value, validate, edit again the value, and find a rounded
version of it instead of what you typed in!

So now, *only when entering textedit of num buttons*, we always get the highest
reasonable precision for floats (and use exponential notation when
values are too low or too high, to avoid tremendous amounts of zero's).
2017-07-18 10:41:00 +02:00
2174a2118b Cleanup: use WM_event prefix for modal_tweak_exit 2017-07-18 18:09:26 +10:00
7784cf30eb WM: move WM_event_is_last_mousemove to the WM API 2017-07-18 18:07:49 +10:00
3534c3e0df Eevee: Avoid crash when using dupli objects.
This is waiting a for a better solution.
2017-07-18 10:05:16 +02:00
fe8fc79cee Eevee: Fix transparency not drawing after volumetrics.
Fix T52089, Fix T52091
2017-07-18 10:05:16 +02:00
0926b896b6 Eevee: Fix crash with transparency. 2017-07-18 10:05:16 +02:00
876cc5b7c0 Merge branch 'master' into blender2.8 2017-07-18 18:10:19 +10:00
5f35682f3a Fix T52021: Shadow catcher renders wrong when catcher object is behind transparent object
Tweaked the path radiance summing and alpha to accommodate for possible contribution of
light by transparent surface bounces happening prior to shadow catcher intersection.

This commit will change the way how shadow catcher results looks when was behind semi
transparent object, but the old result seemed to be fully wrong: there were big artifacts
when alpha-overing the result on some actual footage.
2017-07-18 09:46:21 +02:00
d8906f30d3 Cycles: Remove meaningless camera ray check
In branched path tracing main loop is always a camera ray, with varying
number of transparent bounces.
2017-07-18 09:27:36 +02:00
2475dbdc94 Merge branch 'master' into blender2.8 2017-07-18 13:09:36 +10:00
66383ea206 Cleanup: quiet picky warnings 2017-07-18 12:14:18 +10:00
16fc2ad28e Transform: avoid possible uninitialized var 2017-07-18 12:13:41 +10:00
Dalai Felinto
f04c06498b Fix layers unittest - we cannot use nestted get_pointer calls
Remember to update your //lib/tests folder as well.

Patch by Bastien Montagne(mont29)
2017-07-17 18:46:00 +02:00
9bbb197d14 Work around small DPI resulting in blurry fonts, clamping auto DPI to minimum 96.
Since we added auto DPI on Linux, on some systems the UI draws smaller than before
due to the monitor reporting DPI values like 88. Blender font drawing gives quite
blurry results for such slightly smaller DPI, apparently because the builtin font
isn't really designed for such small font sizes. As a workaround this clamps the
auto DPI to minimum 96, since the main case we are interested in supporting is
high DPI displays anyway.

Differential Revision: https://developer.blender.org/D2740
2017-07-17 18:31:19 +02:00
d268cad06a Fix T52090: clarify meaning of EnumProperty number when using ENUM_FLAG. 2017-07-17 18:31:19 +02:00
f05f2f0336 Fix T51971: IK non-uniform scale regression.
This is a different fix for the issue from D2088, preserving backwards compatibility
for IK stretching. The main problem with this patch is that this new behavior has
been there for a year, so it may break rigs created since then which rely on the new
IK stretch behavior.

Test file for various cases:
https://developer.blender.org/diffusion/BL/browse/trunk/lib/tests/animation/IK.blend

Reviewers: campbellbarton

Subscribers: maverick, pkrime

Differential Revision: https://developer.blender.org/D2743
2017-07-17 18:31:19 +02:00
Dalai Felinto
0e49d5376c Revert "Unittests: Workaround for basact->object.id.name written as DATA"
This reverts commit aa578fba53.
2017-07-17 18:06:49 +02:00
9feeb14e91 fix T52065: Joint ID was generated wrong for bone animation exports 2017-07-17 16:39:47 +02:00
Dalai Felinto
aa578fba53 Unittests: Workaround for basact->object.id.name written as DATA
This was introduced on e7fb013a60. Although I would love to investigate the
issue I'm mostly concerned with gettings the tests working again.
2017-07-17 16:22:42 +02:00
Dalai Felinto
a258c5d325 Unittests: Make sure layer tests pass with or without workspace 2017-07-17 16:22:07 +02:00
Dalai Felinto
36977a962b Removing unused layer TODO placeholders 2017-07-17 14:40:12 +02:00
Dalai Felinto
8dadeab47f Fix shadow geometry shader 2017-07-17 14:28:17 +02:00
06505c5264 Fix T39925: Set Origin to Geometry on a new text object moves the origin away from the object
No need to take into account font size here...
2017-07-17 12:56:12 +02:00
d4246476d0 Py API doc generation: remove reference to "Blender/Python Add-on Tutorial"
That one has been moved to wiki!
2017-07-17 11:36:27 +02:00
4c835b9168 Eevee: Fix double promotion. 2017-07-17 11:01:31 +02:00
d0aa620912 Buildbot: Switch to GCC-7 for Linux build slaves
This is GCC version was used for Testbuild1 and Testbuild2.
2017-07-17 09:32:19 +02:00
Dalai Felinto
728d64c5dc Fix blenderplayer 2017-07-17 09:30:39 +02:00
f942511fd2 Manipulator: allow ID-writing for most callbacks 2017-07-17 17:20:54 +10:00
ab5be294ce Manipulator: split alpha out of color property
Gives more convenient access from Python: `mathutils.Color`

Also correct some copy-paste error w/ property subtypes.
2017-07-17 15:06:18 +10:00
02257ace22 Fix crash re-registering the same manipulator type
Wasn't unlinking from the group instance.
2017-07-17 14:36:20 +10:00
d221a999cb Manipulator: add snap flag 2017-07-17 14:16:23 +10:00
193d7d6333 Merge branch 'master' into blender2.8 2017-07-17 13:21:05 +10:00
bc8a9c47c6 PyDoc: minor change to recent workaround
- Isolate workaround in single string and link to issue.
- Quiet unused file warning (since it's an include).
2017-07-17 13:18:58 +10:00
3d1e5bca88 PyAPI: don't use deprecated PyModule_GetFilename
Allows compiling with newer Python versions.
Also add missing decref when compiling as a py-module.
2017-07-17 12:53:55 +10:00
a11808a248 Manipulator: allow py manipulators w/o properties
These could be used for manipulators that run operators.
2017-07-17 12:29:37 +10:00
4e22e24689 BPY API: Fix broken ref link 2017-07-16 18:11:58 -04:00
2d0c9542fe BPY API: Fix usless links leading to compile errors
See https://github.com/sphinx-doc/sphinx/issues/3866 for more information
2017-07-16 17:11:05 -04:00
7021aa245d Fix T52058: Jumping to keyframe causes Blender to freeze indefinitely
Revise the logic here to be more robust when keyframes with
similar-but-different frame numbers (e.g. 70.000000 vs 70.000008)
would cause the search to go into an infinite loop, as the same
keyframe was repeatedly found (and skipped).
2017-07-17 02:26:49 +12:00
5c30bc285c Fix T52034: cell noise renders different.
Tweak the bias from the previous fix a bit to be more backwards compatible in
some scene. In the end which way we round is quite arbitrary, but keeping the
case where the texture coordinate is exactly zero the same seems better.
2017-07-16 01:27:55 +02:00
49c29dc82f Fix T52066: Grid Mesh UV's aren't correct 2017-07-16 00:03:52 +10:00
a3d9ef2ea5 Merge branch 'master' into blender2.8 2017-07-14 17:26:46 -03:00
8009564503 Snap System: Fixed index of objects used to make snap to volume
*note: make a complete test scene
2017-07-14 17:25:16 -03:00
37242f0a47 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-14 16:56:36 -03:00
08b59ab7b9 Snap System: Use function that does the interactor instead of Macro
Macro makes debugging difficult. And in that case I was escaping from the style used in Blender
2017-07-14 16:52:31 -03:00
ebc22b4490 Fix MSVSC compiler warning
A void function cannot return a value
2017-07-14 20:59:26 +02:00
0736d567f0 Snap System: minor issues
rename obj -> ob_iter
2017-07-14 14:46:07 -03:00
Dalai Felinto
2a489273d7 Implement Uniformbuffer objects for nodetree parameters
For users that means you can tweak shaders in the nodetree and things
are way faster. This is a huge improvement, particularly in
systems that have no shader cache.

From the code perspective it means we are no longer re-compiling the
shader every time a value is tweaked in the UI. We are using uniforms
for those values.

It would be slow to add that many uniforms for all the shaders. So
instead we are using UBO (Uniform Buffer Objects).

This fixes the main issue of T51467. However GWN_shaderinterface_create() still
needs to be improvedi. When opening a .blend all shaders are compiled once, so
optimizing it will bring a measurable impact.

========================================================================
NOTE: This breaks update of Cycles material upon nodetree nodes
tweaking. It will be fixed separately by depsgraph, once tackling T51925
(Animated Eevee values slowdown).

The idea is to make Depsgraph update more granular. The XXX TODO in
rna_nodetree.c will be tackled at that time as well.
========================================================================

Reviewers: sergey, brecht, fclem

Differential Revision: https://developer.blender.org/D2739
2017-07-14 17:46:10 +02:00
73b1425297 DwM: don't use context to apply color-management
Would give different results for off-screen rendering.
2017-07-15 00:50:13 +10:00
51442b64d6 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-14 11:24:43 -03:00
5fb5b74890 Snap System: missing change 2017-07-14 11:20:28 -03:00
8f14b96f7b Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-14 10:42:59 -03:00
c6ddef7359 Snap System: fix rename ob to obj
This would bring problems with dupli objects
2017-07-14 10:41:47 -03:00
92f3b4ac64 Depsgraph: Initial support of armatures for copy-on-write
This commit makes simple cases to work, for example:

- IK solver to an external object
- Object with Armature modifier, "parented" to the deforming armature
  (via animation).

More complicated setups (like agent rig) are crashing still.
2017-07-14 15:06:50 +02:00
Dalai Felinto
0ea4bb51df Another fix for snapping after merge in 2.8 2017-07-14 15:06:17 +02:00
Dalai Felinto
4467efe971 Fix snap in 2.8 after poor merge from master
If you merge from master to blender2.8 after a commit, remember to test in 2.8, otherwise what is the point?
Specially if it's a non-essential commit such as c9817c67fc.

Bug introduced on: f4155d3778 (the merge
that included the above commit).
2017-07-14 14:43:54 +02:00
Dalai Felinto
9d318acfa7 Merge remote-tracking branch 'origin/master' into blender2.8 2017-07-14 14:34:46 +02:00
Dalai Felinto
78e2238fe4 Revert "Fix T51794: Crash on hair file when opening with no UI"
This reverts commit 0095f4f834.
2017-07-14 11:44:26 +02:00
Dalai Felinto
b48694639a Workspace: Fix crash on preview, and sanitize placeholder functions
This commit effectively makes workspace switching useless as far as the
active scene layer goes.

The functions from the scene layer API to get the correct scene layer
from "context" were a placeholder to be addressed by the workspace
commit.

When workspace was merged, however G.main was used as a replacement to pass the
correct argument for the functions. As it turned out (surprise!) this
leads to crash on render preview.

We need to get rid of:
* BKE_scene_layer_context_active_ex_PLACEHOLDER
* BKE_scene_layer_context_active_PLACEHOLDER

And either use SceneLayer explicitly or replace it by:
* BKE_scene_layer_from_workspace_get
2017-07-14 11:42:31 +02:00
0f793ee606 Fix unit test error on Windows 2017-07-14 09:53:27 +02:00
018df5a49a Cleanup: use 'r_' prefix for return args 2017-07-14 17:05:22 +10:00
d31276abd0 Cleanup: long lines 2017-07-14 16:56:02 +10:00
661f5a24d1 DwM: Show face-mask overlay even with full-shading
Without this face selection would be used but invisible,
display this over fully shaded surface.
2017-07-14 16:45:47 +10:00
25dba156be Fix T51945: LMB select swaps manipulator buttons 2017-07-14 16:14:19 +10:00
886ea37572 Fix T51979: Eevee: Bloom artifacts w/ zero area faces 2017-07-14 15:27:08 +10:00
6f66498c10 Revert "Eevee: Fix the NaN pixel issue."
This reverts commit d02711ed88.
2017-07-14 14:45:18 +10:00
f4155d3778 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-13 20:12:17 -03:00
c9817c67fc Snap System: Replace creation and destruction of the object list by a Macro
The macro got a little strange, but it's better than using the MEM_mallocN inside a loop, or repeat the lines
2017-07-13 19:39:17 -03:00
ad7f782e17 Merge branch 'master' into blender2.8 2017-07-13 18:05:20 +02:00
7daae642d8 Cleanup: Fix MSVC warning message
The const key is required by compiler to avoid warning
2017-07-13 17:54:24 +02:00
31ad03dbde Merge branch 'master' into blender2.8 2017-07-13 17:36:52 +02:00
f8f90e1312 Fix compilation error in Freestyle 2017-07-13 17:24:12 +02:00
474454be39 Cleanup/rename etc. dashed line shaders.
Goal is to make them more modular, to allow more variants (variable
single-color, thickness, ...) to be added without having to
copy-and-change-one-line of whole chain of shaders.
2017-07-13 16:47:58 +02:00
a651f5da66 Sequence editor: Renamed "Override" to "Overwrite" in "Set Selected Strip Proxies"
The option has always (un)set the "Overwrite" flag on all strips. Calling
it "Override" seems misleading, since even when unchecking it, it overrides
whatever was set on the selected strips. It really just (un)sets the
"Overwrite" flag, and now it is also labeled as such.
2017-07-13 16:26:19 +02:00
c9aef27326 Depsgraph: Begin work on making depsgraph per-scene-layer
This is a first step towards proper depsgraph "ownership", where
we would allow scene to be in multiple states dependent on active
workspace or scene layer.

This commit introduces a basic API to get proper dependency graph
for a given scene layer. It also renames scene->depsgraph to
depsgraph_legacy, so it's easier to search0-n-replace in the future.
2017-07-13 15:43:36 +02:00
065cd6e4e4 Remove unused function
It wasn't really correct from the copy-on-write point of view anyway,
so better not to have potentially really dangerous function.
2017-07-13 15:23:37 +02:00
38cfd7b9e7 Depsgraph: Fix crash with copy-on-write enabled after recent changes
The issue was caused by original datablock being returned where we
were expecting copy-on-written one to be returned.
2017-07-13 15:23:37 +02:00
07c6011b57 Depsgraph: Add extra information to debug logging 2017-07-13 15:23:37 +02:00
84c6ce6b04 Merge branch 'master' into blender2.8 2017-07-13 21:24:02 +10:00
ab05108acb Depsgraph: Make it more explicit in naming what version of data getetrs returns 2017-07-13 12:57:19 +02:00
5fe2423ed5 Use explicit scene_layer variable name for public API 2017-07-13 12:51:35 +02:00
248bba81e7 Fix texture paint crash when painting onto stencil 2017-07-13 20:50:02 +10:00
Dalai Felinto
8c17b5fe42 Eevee small cleanups 2017-07-13 12:04:49 +02:00
Dalai Felinto
445963f299 Eevee: Fix crash on eevee lamps and shadows 2017-07-13 12:04:49 +02:00
eb759730b1 Correct error from texface removal
Missed stencil layer
2017-07-13 19:30:00 +10:00
a3240df269 Always using full shading for eevee + sculpt mode
Also disable for dyntopo & multires since its currently not supported.
2017-07-13 19:09:40 +10:00
86b7698a3e Merge branch 'master' into blender2.8 2017-07-13 17:21:11 +10:00
e656dcd365 Revert T44320: UV island overlap considered linked
In the reported example it seemed reasonable to apply this change.
But it causes a much more common case (selecting projections)
to be split into 2x islands.

Resolves T50970
2017-07-13 14:32:04 +10:00
d3f7b04f04 Fix T51100: Vertex pick fails after extrude 2017-07-13 14:13:59 +10:00
ffea77253e Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-12 20:45:02 -03:00
2771f602e6 Snap System: remove unused function 2017-07-12 20:43:28 -03:00
b4988d01cb DwM: Option to use final material over mode shading
Support using full material shading in sculpt & paint modes mode.

Access 'Full Shading' from the display panel when in paint modes.
2017-07-13 01:59:44 +10:00
95a7a0a06e Gawain: add GWN_vertbuf_clear
Needed to clear the buffer without freeing.
2017-07-13 01:48:52 +10:00
5ee5c595ba Merge branch 'master' into blender2.8 2017-07-12 23:18:11 +10:00
457596d4df BMesh: move safe loop-normal-calc to own function
This makes sense when we want to avoid float precision error
for near co-linear edges. OTOH, this is an arbitrary decision,
so keep functions separate.
2017-07-12 23:13:04 +10:00
59b93123e9 Merge branch 'master' into blender2.8 2017-07-12 11:49:43 +02:00
e5ee6cb448 Depsgraph: Remove meaningless comment
We are already on the new depsgraph only for quite some time now.
2017-07-12 11:08:51 +02:00
87164114a3 Cycles: Enable SSS from Principled BSDF only when actually in use
This gives speed up for the split kernel in scenes using the principled BSDF
but without subsurface scattering.
2017-07-12 04:40:24 -04:00
0837d19126 Merge branch 'master' into blender2.8 2017-07-12 13:59:13 +10:00
8603424d0a Cleanup: unused vars 2017-07-12 13:58:48 +10:00
1f933c94a7 Cycles: Fix comparison in principled BSDF
Could have lead to black pixels.
2017-07-11 23:41:22 -04:00
29ec0b1162 Fix T52027: OSL getattribute() crash, when optimizer calls it before rendering. 2017-07-11 22:39:51 +02:00
ac76a3caba Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-11 17:06:43 -03:00
3f39719b5d Fix [T51595]: Snap to edge does not work with high zoom level
That problem occurs because of the imprecision of `short int` (16 bits).
The 3d coordinates are converted to 2d, and when they are off the screen, their values can exceed 32767! (max short int value)

One quick solution is to use float instead of short

The snap code is actually a little tricky. I want to make some arithmetic simplifications in it
2017-07-11 17:03:49 -03:00
1b91b443e0 Eevee: Transparency: Fix crash when using transparent shadows.
Fixes T52024
2017-07-11 21:52:30 +02:00
593b80143b Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-11 14:24:32 -03:00
b3f62b68a9 Style (remove characters that caused "a binary file") 2017-07-11 14:22:07 -03:00
538475dec7 Merge branch 'master' of git@git.blender.org:blender.git into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-11 13:54:08 -03:00
dd1edb0954 Snap System: Separate raycast functions from nearest2d functions
The only similarity between these functions is that both serve to snap.
However their codes are totally different from one another.
So by separating these functions, it:
- removes the need to put several conditions;
- simplifies and
- optimizes the code
2017-07-11 13:47:28 -03:00
11ee5aa4f9 Avoid any possibility of using scene from different main in CTX_data_scene_layer
While these functions might be considered a temporary solution, please still be
very accurate about data ownership and where data is coming from.
2017-07-11 16:40:18 +02:00
ded2b30ebc Alembic: Adjusted unittest for Blender 2.8 2017-07-11 16:28:52 +02:00
4233ccfb6c Merge branch 'master' into blender2.8 2017-07-11 16:18:17 +02:00
32edfd53d9 Fix T52022 Alembic Inherits transform not taken into account
Alembic's "inherits transform" flag wasn't taken into account when
constructing the parent object relations.
2017-07-11 16:17:27 +02:00
Dalai Felinto
e5d74954bf RNA/UI: Always use capitalized words in the UI 2017-07-11 15:46:15 +02:00
085ed00e42 A bunch of fixes for Pose Library while checking on T51607
* Display a warning above the pose list if the pose library is in an invalid
  state (i.e. when it has keyframes but no pose-markers associated with those
  keyframes). This warning prompts users to run the "Sanitize Pose Library Action"
  operator, which should fix up such issues.

* "Sanitize" operator now creates unique names for each newly create pose
  marker it generates, including the frame on which it found the pose
2017-07-12 01:33:08 +12:00
cd3b3e4a57 Fix: Accidentally left debug print in last commit 2017-07-11 23:39:35 +12:00
fdfcbfd040 Fix T52009: F-Curve "Stepped interpolation" modifier "restrict frame-range" IN and OUT parameters cannot be edited
The problem here was that the "frame_start" and "frame_end" RNA properties of
the Stepped FModifier were shadowing/overriding "frame_start" and "frame_end"
properties of the base FModifier. As a result, when the range() callback
for the In/Out parameters (defined as part of the base FModifier) checked
it's start/end properties, they were always still zero, meaning that the
acceptable range for the In/Out parameters was 0 -> 0 = 0.

Note:
If you've got old files with this problem, you'll need to manually click on
the frame_start/end properties to flush out the old values. It's probably
not worth the effort of applying a version patch for this (given that this
modifier is not one of the most often used ones AFAIK).
2017-07-11 23:33:24 +12:00
b452003015 Fix T51879: NLA Influence can not be autokeyed
As with Strip Time, the updates here would get triggered before the
autokeying had a chance to record the unkeyed values, making it impossible
to autokey.
2017-07-11 23:33:24 +12:00
0a57597aff Temporary fix for crash related to VBO update on shader change
This frees the whole mesh batch cache, instead of only the required
parts, as freeing specific parts of a cache is currently causing
crashes.
2017-07-11 13:03:27 +02:00
64890a62cd Eevee: Add failsafe check in shadow material. 2017-07-11 12:42:59 +02:00
c0f2cbab4e Eevee: Transparency: Add transparent Shadow method UI. 2017-07-11 12:39:35 +02:00
ec9330d206 Eevee: Fix default closure to match cycles. 2017-07-11 12:39:35 +02:00
91d324b3dc Eevee: Transparency: Add support for Clip and Stochastic shadows. 2017-07-11 12:39:35 +02:00
a57bc75576 Eevee: Transparency: Add hide backside option. 2017-07-11 12:39:35 +02:00
a098d02718 Eevee: Transparency: Add object center Z sorting.
Better algo should take bounding box center, but it's not referenced yet in the draw call and cannot be tweaked by user.
2017-07-11 12:39:35 +02:00
ad7458d00c Eevee: Transparency: Add Alpha Blend mode. 2017-07-11 12:39:35 +02:00
d6b46f9ea5 DRW: Make Additive blending alpha premult. 2017-07-11 12:39:35 +02:00
d35c24f87b Eevee: Transparency: Add support for blend ADD and MULTIPLY.
This introduces a new transparency pass.
It bypass the radial distance encoding in alpha for the transparent shaders.
2017-07-11 12:39:35 +02:00
55022884ba DRW: Add shading group state disable.
This is a way to remove some state flag per Shading Group.
2017-07-11 12:39:35 +02:00
eb8dddaab1 Eevee: Material: Code cleanup in order to add transparency support. 2017-07-11 12:39:35 +02:00
05bef13b53 Eevee: Add support for Alpha clip and Hashed Alpha transparency.
Hashed Alpha transparency offers a noisy output but has the benefit of being correctly ordered. Noise can be attenuated with Multisampling / AntiAliasing.
2017-07-11 12:39:35 +02:00
e2c0197a96 Merge branch 'master' into blender2.8 2017-07-11 12:30:30 +02:00
e26f61a2b5 Cycles: Disable OpenCL clFlush workarounds
This is something which was reported to work fine by Mai, Benjamin and
confirmed by myself. Disabling this workaround gains us some speedup:

                      Before           Now
bmw27                04:28.42        04:07.79
classroom            09:26.48        08:54.53
fishy_cat            08:44.01        08:18.70
koro                 09:17.98        08:57.18
pavillon_barcelone   12:26.64        11:52.81

Test environment is:
- Ubuntu 16.04, with all updates installed
- AMD RX 480 GPU
- amdgpu pro driver version 17.10-450821
2017-07-11 12:16:58 +02:00
36ef6ff66b Theme Flatty Light
Color GraphEditor tabs, brighter 3D viewport gradient
2017-07-11 11:17:36 +02:00
d5d7d453a5 Fix memory leak caused by node clipboard
The issue was caused by combination of following factors:

- Clipboard cleanup function will pass node tree as NULL to node free
  function.

  This is fine on it's own, we don't have tree in clipboard.

- Node free function will call node storage cleanup only when there is
  a non-NULL node tree.

  This is somewhat weird, because storage cleanup does not take node
  tree as argument.

So the solution here: move node storage cleanup outside of check that
node tree is not NULL.
2017-07-11 11:06:36 +02:00
1dfc4be6ab Opensubdiv: Fix compilation error with older Opensubdiv versions 2017-07-11 11:05:39 +02:00
d415a1cbd6 Fix T49034: multi-drag crashes when UI forces exit 2017-07-11 19:10:40 +10:00
Dalai Felinto
2325d15d02 Lamps should not have their own gpu material
This was leading to multiple crashes when freeing the lamps or
materials when opening old files.

Follow up on b50839038d.
2017-07-11 11:02:56 +02:00
218c254e72 Resolve T51745: Mesh extrude keep-orig needs edges
Document to avoid confusion when called from Python.
2017-07-11 14:48:55 +10:00
64dd9a117d Merge branch 'master' into blender2.8 2017-07-11 14:21:05 +10:00
a247b367b0 Fix T51761: wpaint select depth limit fails
Limit select fails with circle and border select.

Regression in 2.76
2017-07-11 14:05:59 +10:00
8677c76f13 Fix (unreported) broken uvsculpt in Scene's toolsettings' copying.
This was serious bug actually, probably a crasher in case you free
original or copy after duplication...
2017-07-10 21:22:59 +02:00
665288ccd7 Fix (unreported) Scene's copying toolsettings' clone and canvas, and particles' scene and object pointers.
imapaint's clone and canvas are refcounting Image usages.

And particle's editsettings' object and scene seem to be pure runtime
data (they are reset to NULL in readcode), so resetting them to NULL
here as well.
2017-07-10 21:12:42 +02:00
46b9124241 Fix strict compiler warning 2017-07-10 17:43:27 +02:00
bb0bdc6ce2 Revert "Revert "Revert "Temporarily disable material preview (T51796 workaround)"""
This reverts commit 6df053e527.
2017-07-10 16:49:04 +02:00
205d750a63 Depsgraph: Use explicit bmain pointer passed to layer utilities
it is not necessarily that depsgraph is built from G.bmain.

This will solve issue reported in T51782.
2017-07-10 16:47:12 +02:00
8692c3a83f Depsgraph: Fix wrong layer used
Should be context, not render active one here.
2017-07-10 15:45:06 +02:00
6df053e527 Revert "Revert "Temporarily disable material preview (T51796 workaround)""
The "fix" happened due to a mistake in copy-on-write commit, that mistake solved
preview render but broke something else.

This reverts commit 45720922f7.
2017-07-10 15:43:04 +02:00
806bc4b433 Fix (unreported) Scene copying doing very stupid things with World and LineStyle usercounts.
Really, really, really need to get rid of this usercount handling
everywhere, hopefully incomming ID copying rewrite will help sanitize
that mess. But fix was needed for 2.79 release!
2017-07-10 15:11:58 +02:00
45897f12f8 Fix T51931: VBO not updating when UVs are added to shader node tree
UVs need specific data in the VBO, which is not computed unless the
shaders assigned to the mesh actually use UVs. When adding UVs to the
shader, the VBOs were not being recomputed to include the required data.

This adds a DEG relation between the shader and the mesh, and recomputes
the required data if the shader changed.

Thanks Sergey, for all the DEG stuff...
2017-07-10 14:43:57 +02:00
9a4cfc3e77 Partial fix of T51989: Don't set image user offset for movie files
While this is handy for image sequences, it's totally meaningless for movie files.
2017-07-10 14:23:29 +02:00
440c91b1f6 Fix T52011: Border render is incorrect with multiple scenes
The code was somewhat weird: it was first copying border/crop settings from
the "source" scene, then was checking border settings of the current scene
and only then was copying border from "source" scene.

Now we first copy border/crop flags, then copy border from source and then
check whether border is a full-frame.
2017-07-10 12:28:18 +02:00
d33cacf7e4 Fix image empties not drawing
A pointer to the uniform data for the empty drawing was being freed
before the actual draw call, which invalidates the uniform.

This makes the data only be freed after drawing.
2017-07-10 11:39:08 +02:00
7d5e9285b5 Merge branch 'master' into blender2.8 2017-07-10 17:48:57 +10:00
5b1c1d4d23 Error in last commit 2017-07-10 17:44:49 +10:00
910ab14145 Fix T51998: Anim player uses 100% CPU
The loop running with no events didn't sleep.
Now wait for events when paused.
2017-07-10 17:37:00 +10:00
2c10e8a3cf Fix T51052: CacheFile Open crashes from Python
Note that bpy.data access makes more sense here,
but better not crash when called from Python.
2017-07-10 17:06:25 +10:00
2bd908ca6e Merge branch 'master' into blender2.8 2017-07-10 16:35:56 +10:00
c055536d23 Curve: add assert for invalid next/prev use 2017-07-10 16:29:57 +10:00
004a143760 Fix T51665: No orientation for nurbs, polygons 2017-07-10 16:29:54 +10:00
2acd05b24c Fix T52007: Cancel bezier curve transform fails
Auto & aligned handles wouldn't restore to their correct locations.

Note that a more direct fix for the bug is possible
(storing the handle locations to restore on cancel).

But that still gives some odd behavior, see code-comments for details.
2017-07-10 13:38:28 +10:00
00f3ab2fb2 Fix T51898: missing sequence strip color space validation on load. 2017-07-10 01:10:26 +02:00
Dalai Felinto
2ad524bc83 Fix blenderplayer 2017-07-09 19:53:33 +02:00
f7e4484bfe Merge branch 'master' into blender2.8 2017-07-08 23:45:36 +02:00
ba256b32ee Fix T52001: material draw mode principled BSDF artifacts at some angles.
The default anisotropic tangent computation could fail in some cases,
leading to NaNs and artifacts. Use a simpler formulation that doesn't
suffer from this.
2017-07-08 23:42:20 +02:00
0584c5ba8e Fix T51959: Windows + Intel GPU offset between UI drawing and mouse.
Unfortunately this means disabling the code that ensures the title
bar is properly scaled with DPI, however better to have that as a
cosmetic issue than Blender being unusable with a lot of Intel GPUs.
2017-07-08 22:11:07 +02:00
fdadb4829c Gawain: Add support for compressed index with instancing. 2017-07-08 18:21:49 +02:00
3361f2107b Fix T51967: OSL crash after rendering finished (mainly on Windows). 2017-07-08 02:46:06 +02:00
eb8c45508d Merge branch 'master' into blender2.8 2017-07-08 02:08:41 +02:00
dbaaff2e09 Fix build after previous commit. 2017-07-08 02:07:39 +02:00
5eead4b74e Cycles: recognize Eevee material output. 2017-07-08 01:14:50 +02:00
db28e2deb9 Merge branch 'master' into blender2.8 2017-07-08 01:02:11 +02:00
7dc3ad2287 Fix T51889: new file or load factory settings results in broken UI.
Fix some cases that still assumed there to be a global DPI, instead of a per
window DPI that needs to be set before reading U.dpi.
2017-07-08 00:54:05 +02:00
1e21778261 Fix T51977: New depsgraph removes the grass in victor scene
For now just make new depsgraph do similar updates to the old one.

See bug report for more detailed information about what was going on.
2017-07-07 16:38:56 +02:00
4d4ebc8300 Fix T51991: Disabled for viewport particle system becomes visible after BI render
Move check for psys render data before it is actually requested for creation.
2017-07-07 16:13:50 +02:00
Dalai Felinto
e960cecdf8 GPU: Silence warning of potentially unused variable (NormalMatrix) 2017-07-07 15:10:09 +02:00
Dalai Felinto
15f5457502 Draw Manager: Use defines instead of hardcoded enum values 2017-07-07 12:34:36 +02:00
00d476976e Fix T50973: Directional blur node doesn't clamp value if using driver
The issue was caused by combination of following factors:

- Blender Internal viewport render can not distinguish between which parts of
  main database changed, so it does full database re-sync when anything is
  tagged for an update.

  This way, if any NodeTree (including compositor) is changed, Blender Internal
  viewport is tagged for full render database update.

- With old dependency graph, scene-level drivers are evaluated on every
  iteration of scene_update_tagged, even if nothing is tagged for an update.

  This causes compositor drivers be evaluated quite often.

- Driver evaluation checks whether value was changed, and if so it tags
  corresponding ID type as updated (this is what was telling viewport to do
  render database update).

  This check was quite stupid: current property value was checked against the
  one coming from driver expression. This means, if driver value is outside
  of the hard limit range of the property, the property will always be
  considered updated.

The fix is to compare current property value against clamped value from the
driver.
2017-07-07 12:08:14 +02:00
09bf3b1764 Eevee: Show the metadata and output panel when eevee is selected as a render engine 2017-07-07 11:57:38 +02:00
Dalai Felinto
3615350957 Merge remote-tracking branch 'origin/master' into blender2.8 2017-07-07 11:27:48 +02:00
fee7f688c3 Cycles: Fix ambiguity in call of min() function 2017-07-07 10:40:19 +02:00
d25ccf83ad Fix T51978: Setup Tracking Scene after Motion Tracking fails the first time 2017-07-07 09:36:25 +02:00
aaec4ed07d Fix T51980: Motion Tracking - png image files appear in the Blender program directory when using refine
Residue of debug code remained form some older bug fix.
2017-07-07 09:27:24 +02:00
d290266049 Eevee: Add dimension panel to eevee
Up until now users had to switch to Blender Internal to set the dimension of their openGl renderings. This simple change adds the panel at the top of the scene render tab.
2017-07-06 23:43:55 +02:00
6eea22b2b7 Eevee: Fix Planar Reflection bug / background artifact.
This was cause by a missing uniform.
2017-07-06 18:28:25 +02:00
d35e525d10 GPUTexture: Change default comparison mode to GL_NONE.
This default will prevent more errors in the future.
Also compare mode is less used nowadays.

Fixes T51904
2017-07-06 17:02:16 +02:00
d02711ed88 Eevee: Fix the NaN pixel issue.
It's cause by degenerate triangle having normals set to (0,0,0) which may not be compressed like it should.
This fix the problem in the final indirect lighting evaluation which might be costly.
2017-07-06 16:01:21 +02:00
28a9d7ec6e Add option to OpenImage operator not to detect sequences.
Otherwise, there would be no way to load a bunch of pictures with
'sequence pattern' in name in a single operation.

Related to T51778.
2017-07-06 14:52:55 +02:00
c217d518ef Eevee: Unlock compatible bsdfs in node add menu. 2017-07-06 13:32:19 +02:00
e5462421c0 Eevee: Add support for common BSDFs.
Add Diffuse BSDF, and Glossy.

Also Use World normal instead of view normal as input.
2017-07-06 13:32:19 +02:00
a69e3c9ee1 Fix T51943: Depsgraph: world update happening eternally on background (set) scene
The issue was caused by updates being flushed for all scenes, while actual update
was only called for an active one.

Not sure why do we need to flush updates for all scenes, so now we only flush
scenes which are updated.
2017-07-06 13:29:59 +02:00
9d71ec5f8d Merge branch 'master' into blender2.8 2017-07-06 12:21:21 +02:00
a7a5c20fbc Fix T51955: Changing Auto-IK length crashes Blender (with new-depsgraph)
New dependency graph is tacking root bone into account when building the graph.
This is required in order to get proper dependencies between bones. so we can
reliably use bones as targets from the same rig (and even indirect relations
via external objects). This forces us to tag relations for update when we change
root IK chain bone.

Since relations rebuild is not fully trivial operation, we only do it for
the new dependency graph. In the future it'll be nice to avoid whole graph
rebuild for such cases, but that's mentioned as a TODO.
2017-07-06 12:15:30 +02:00
bdd814d87d Fix T51015: Pack all into blend automatically leaves checkbox enabled.
Makes absolutely no sense to forcefully enable that automatic packing option here,
user can do this himself if they likes, from the very same menu...
2017-07-06 11:54:56 +02:00
9c3f1ad003 Cycles: Add artificial memory limit debug option for OpenCL 2017-07-06 05:25:46 -04:00
95b345b2fe Revert "Cycles: use std::min and max for extra overloads"
We already have this in util_algorithm.h

This reverts commit cff172c762.
2017-07-06 04:21:29 -04:00
f9963f29e8 Cycles: Dont allow global size to fall to zero 2017-07-05 20:19:15 -04:00
222b96e5c7 Cycles: Detect out of memory before buffer allocation in OpenCL devices 2017-07-05 20:19:12 -04:00
cff172c762 Cycles: use std::min and max for extra overloads 2017-07-05 19:43:34 -04:00
f67c331bed Eevee: Volumetrics: Avoid light leaking if last step is going trough geometry. 2017-07-06 00:28:13 +02:00
cb55498159 Merge branch 'master' into blender2.8 2017-07-05 22:25:05 +02:00
aea4456101 Better fix for sequencer crash when text strip doesn't have effect data.
This situation happens when a file with a text effect sequencer strip is
loaded in Blender < 2.76 and saved. This destroys the effect data, causing
a crash in Blender ≥ 2.76.

d2f748a222 prevented the crash when opening such a file, but accessing
the strip still caused a crash. This commit fixes that by actually
initialising the invalid strip. Of course this still causes data loss, but
that already happened by opening & overwriting the file in Blender < 2.76.
2017-07-05 22:18:41 +02:00
91808a67e8 Eevee: Volumetrics: Fix enum flag. 2017-07-05 22:17:09 +02:00
31f8ca5034 Cycles: Fix compilation error after recent logging changes
This file uses std::ostream for helper << operators, so need to make sure
corresponding header is included.
2017-07-05 20:40:55 +02:00
d2f748a222 Sequencer: Prevent crash when text strip doesn't have effect data. 2017-07-05 20:22:28 +02:00
7b565c8a76 Eevee: Fix typo... 2017-07-05 19:57:02 +02:00
Dalai Felinto
5495f89cf6 Fix User Interface for Volumetric 2017-07-05 19:23:57 +02:00
c62f82e35b Eevee: Fixups.
Fix float promotion and missing layer parameters.
2017-07-05 19:15:32 +02:00
f6c739cbcd Eevee: Volumetrics: Add Light contribution clamping.
This avoid too much variance at light centers and remove some noise.
2017-07-05 19:14:50 +02:00
031a4d5e22 Eevee: Volumetrics: Do not add anisotropy attribute, average it.
This makes no sense to add theses. In cycles, each volume node is computed separatly. In eevee only the combined parameters are evaluated and phase should be averaged in this case.
2017-07-05 18:31:43 +02:00
b5ee6dd9a3 DrawManager: Fix manipulator blend mode.
This was giving issue with volumetrics.
2017-07-05 18:29:40 +02:00
291b365e26 Eevee: Volumetrics: Add settings. 2017-07-05 18:28:48 +02:00
8b78a8d9bc Eevee: Volumetrics: Add support for Position Coordinates.
This enables texturing of the noise via procedural or baked textures.
Note that it gets quickly really heavy.
2017-07-05 18:21:06 +02:00
f8aab24fb5 Eevee: Volumetrics: Add Volume Absorption node. 2017-07-05 18:21:06 +02:00
d5448eac6c Eevee: Volumetrics: Colored Transmittance support.
Render the transmittance in another color buffer and apply it separatelly.
It's a bit more slow because the upsample step needs to be done twice.
2017-07-05 18:20:19 +02:00
ed4e62997e Eevee: Volumetrics: Match cycles scattering. 2017-07-05 18:03:36 +02:00
Dalai Felinto
971ecfa721 Eevee: Move volumetric to its own panel, new settings to come 2017-07-05 17:58:27 +02:00
Dalai Felinto
6de28e7f90 Override template: Add text and icon optional parameters 2017-07-05 17:58:27 +02:00
Dalai Felinto
eb48eeba84 Expose rna_translate_ui_text to be used for interface templates 2017-07-05 17:58:27 +02:00
5e9ad8065a Code comments regarding last commit (forgotten to add before)
Using an arbitrary face as the source of the UV data is mostly fine, as
vertices on seams will generally map to different parts of the texture
that have the same color.

This is regarding fed853ea78
2017-07-05 16:19:41 +02:00
bdeeb29482 Merge branch 'master' into blender2.8 2017-07-05 15:50:01 +02:00
fed853ea78 Fix T51296: UVs not working for hair emitted from vertices 2017-07-05 15:48:54 +02:00
e3bddcb215 Compositor: Fix compilation error and crash when using defocus search
Was just wondering what the option is doing. Not sure yet, but let's fix
couple of issues here.
2017-07-05 15:37:33 +02:00
d37dd97e45 Cycles: Pass string by const reference rather than by value
Some of the functions might have been inlined, but others i don't see
how that was possible (don't think virtual functions can be inlined here).

In any case, better be explicitly optimal in the code.
2017-07-05 12:27:41 +02:00
58c456b12d Cycles: Fix compilation error when building without Glog and no C++11 2017-07-05 12:01:12 +02:00
f3764d51bd Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2017-07-05 09:20:48 +02:00
Dalai Felinto
84d20dd227 Eevee: Fix world test for volumetric
Compiler even throws a warning at this.
2017-07-04 18:07:39 +02:00
3898236b81 Third fix for my merge: crash after switch to edit mode reported by @dfelinto 2017-07-04 17:53:19 +03:00
4d124418b7 Fix T51834: Active Object and Groups color difference imperceptible
16 was not enough here, -32 seems to give OK results.
2017-07-04 16:01:16 +02:00
0ef48ad504 One more fix for merged 'normal map tangents not working correctly when there are no UV maps.' 2017-07-04 16:25:49 +03:00
f23ed929ee Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesdna/DNA_particle_types.h
2017-07-04 13:13:49 +02:00
f86b43e130 Fix T51965: Custom Bone Shape Wireframe setting affects wireframe thickness.
Clearing of custom bones outline's line thickness was not done at proper
point, wireframe drawing never changes line thickness, only solid draw
with outline does...
2017-07-04 13:11:33 +02:00
d1dfd5fa26 Fix T51703: Rigid body with delta transform jumps when transforming
When doing any transformation on a rigid body object that has delta
transforms, the object would be offset by the amount of the delta
transform.
2017-07-04 12:27:21 +02:00
fc8f6e8f7a Eevee: Fix Closure define. 2017-07-04 11:40:12 +02:00
b87d10d4fe Better fix for rigid body not resimulating
Last fix only accounted for direct changes to the RB settings, but
failed for, say, object transformations. This fix accounts for any
change that might invalidate the RB cache.
2017-07-04 10:57:57 +02:00
3edc8c1f9b Fix rigid body not resimulating after cache invalidation
Fix 9cd6b03187 introduced a bug that
prevented simulation after a cache invalidation (for instance when
changing a setting after simulating). This fixes that.
2017-07-04 09:22:42 +02:00
b09052002c Eevee: Add support for volumetrics in node tree.
Only volume scatter is implemented for now.
2017-07-03 22:08:33 +02:00
2eef097831 GPU Codegen: Add new closure socket type.
This allow specialized shaders to redefine the closure interface to fit their needs.

For instance, Volumetric closure needs to pass more than one vec4 (absorption vec3, scattering vec3, anisotropy float).
2017-07-03 22:08:33 +02:00
65b01014b9 Eevee: Initial implementation of Volumetrics. 2017-07-03 22:08:33 +02:00
9d2ee7998a Draw Manager: Add new blend mode for transmission.
This blend Mode is doing  Source + Destination * Alpha.
2017-07-03 22:08:33 +02:00
9b66a320bf Eevee: Fix luma calculation for lamp fresnel. 2017-07-03 22:08:33 +02:00
Dalai Felinto
e571e6d60e Fix edit mode not drawing
This was introduced on 1ad0cc6bde.
2017-07-03 21:48:39 +02:00
Dalai Felinto
3eeac771d0 Fix alembic after merge from master 2017-07-03 21:16:34 +02:00
Dalai Felinto
3fc342bda0 Fix building with gcc6 after merge from master 2017-07-03 21:16:34 +02:00
de2faa395f Fix for merged 'normal map tangents not working correctly when there are no UV maps.' 2017-07-03 20:13:52 +03:00
e1482841dd Merge branch 'master' into blender2.8 2017-07-03 19:53:00 +03:00
15fd758bd6 Fix T51950: Abnormally long Cycles OpenCL GPU render times with certain panoramic camera settings
The problem here was that when a "invalid" path is generated by the panoramic camera, it was tagged
as RAY_TO_REGENERATE with the intention of generating a new path in kernel_buffer_update.

However, since that state was not handled in kernel_queue_enqueue, kernel_buffer_update did not
process the path which resulted in an infinite loop.
2017-07-03 18:26:19 +02:00
6782a6076c Cycles: Add missing split kernel to CPUDevice 2017-07-03 18:26:18 +02:00
56422ff6c3 Fix T51523: Lattice modifier affecting particles even when disabled
Particles were ignoring the lattice modifier visibility, and
"influence" property.
2017-07-03 18:00:13 +02:00
Dalai Felinto
1ad0cc6bde Eevee: Hide lightprobe data when using "Only Render" 2017-07-03 16:16:24 +02:00
1fb3075803 Fixed build error on Windows / VS2015 2017-07-03 16:09:19 +02:00
0900914d96 Alembic: fix T51820 for sequence files not loading properly. 2017-07-03 16:08:41 +02:00
7b12957267 Alembic: avoid crashing when doing certain file operations.
Things like missing directories are now properly checked for, rather than
crashing Blender.

This also adds support for relative paths when opening an ABC file.
2017-07-03 15:28:19 +02:00
Dalai Felinto
d97c3bc7ad Merge branch 'master' into blender2.8 2017-07-03 15:18:46 +02:00
95a97f79cc Alembic: renamed offset → sequence_offset 2017-07-03 14:21:17 +02:00
44397a7a0a Fix T51883: Wrong matrix computation in "Make Duplicates Real" 2017-07-03 12:51:10 +02:00
Dalai Felinto
871325e26f Fix T51963: Eevee: ASAN crash on copy_attrib_name
Bug introduced on f6bb3262f1.

CustomData_get_named_layer returns a different result than
CustomData_get_named_layer_index.
2017-07-03 12:47:00 +02:00
d48a9528ca Fix missing return error introduced by last commit
End of non-void function was being reached since
f5535fcb83
2017-07-03 12:12:27 +02:00
f5535fcb83 Fi T51023: MixRGB constant folding not effective with clamp option. 2017-07-03 05:25:27 +02:00
cda24d0853 Fix T51855: Cycles emssive objects with NaN transform break lighting. 2017-07-03 05:04:43 +02:00
46c7d45f77 Fix T51889: broken UI after File > New without a userpref.blend.
BLO_update_defaults_userpref_blend() was being run when no user preferences
were loaded from memory.
2017-07-03 02:24:40 +02:00
0c122d64d2 Fix T51734: batch-generate previews crashes on some materials. 2017-07-02 23:40:53 +02:00
Lucas Veber
405121d613 Fix T51759: fluid simulation particles not remoevd when colliding with outflow objects.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2719
2017-07-02 22:42:08 +02:00
3232d8ec8f Fix T51951: cell noise texture precision issue at unit vertex coordinates.
Solution is to bias the coordinates a little, same as Cycles checker texture.
2017-07-02 22:00:10 +02:00
e3e5ecfaa8 Fix T51746: normal map tangents not working correctly when there are no UV maps.
Patch by Alexander, with some refactoring by Brecht.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2709
2017-07-02 21:28:10 +02:00
eb1532a860 Fix T51772: double undo entry for color picker editing. 2017-07-02 21:27:41 +02:00
29c8c50442 Fix T51956: color noise with principled sss, radius 0 and branched path. 2017-07-02 19:21:08 +02:00
eb420e6b7f Fix T51957: principled BSDF mismatches in GLSL viewport. 2017-07-02 18:37:50 +02:00
52b9516e03 Fix principled BSDF incorrectly missing subsurface component with base color black. 2017-07-02 18:22:24 +02:00
79f27fc8d3 Fix T51947: failure setting sequence.use_proxy/crop/translation to False 2017-07-01 23:20:06 +02:00
3de5370e9d Cleanup: unused defines 2017-07-01 20:19:12 +10:00
5b2b5a4258 Fix ED_OT_undo_redo operator 2017-07-01 10:51:26 +03:00
Dalai Felinto
49a35033be Fix T51877: Deleting a scene uses freed memory
At the moment libblock_remap_data_preprocess is using
FOREACH_SCENE_OBJECT to iterate over all the objects of the scene and
unlink them.

However we were storing a reference to the Base of the removed object.
Anyways, the loop is now sanitized so that this crash no longer happens.

Also now we have an unittest for this.
2017-06-30 19:03:02 +02:00
9cd6b03187 Fix T50230: Rigid Body simulation shouldn't step when time is beyond cached area
This makes the last time (`ltime`) stored in the rigid body world (`rbw`)
only be updated once a simulation step actually occurs, this prevents
another simulation step from being solved unless the current time is
exactly one frame after the last cached frame. Thus this prevents the
formation of gaps in the cache, such as seen in T50230.

Reviewers: mont29, sergey, angavrilov

Tags: #physics

Maniphest Tasks: T50230

Differential Revision: https://developer.blender.org/D2458
2017-06-30 15:58:57 +02:00
76eefa5c0d Better fix for isfinite problem - works in older gcc's too.
Previous fix relying on __cplusplus value didn't fix for older
gcc's on linux, but this fix does.
2017-06-30 09:04:01 -04:00
1938a81e42 Fix compile error after recent 9c2bbfb6 commit.
Older C++ compilers use finite instead of isfinite.
2017-06-30 07:47:37 -04:00
Dalai Felinto
b43cdc91ce Fix T51721: OpenGL Detection is broken on Windows
Now computers that support OpenGl3.3 (but not 4.5) can run Blender 2.8.

For any given HDC, you may only call SetPixelFormat *ONCE* any future
calls for the same HDC will fail. And computers that would support only
OpenGL 3.3 wouldn't have a change to get a valid OpenGL context because
the pixelformat was already set while trying to probe the supported
contexts.

We fix this by splitting the final context creation from the query of
supported OpenGL versions.

Patch by Ray Molenkamp (bzzt_ploink/LazyDodo) with code style fixes and
comments by me.
2017-06-30 13:33:54 +02:00
0831099664 Eevee: Principled BSDF: add support for specular tint + optimisation
Only use clearcoat version if there is something linked or if the clearcoat value is not 0.
2017-06-30 14:12:25 +02:00
178c470c43 Eevee: Fix specular shadowing.
Compute luminance approximation instead of using green channel.
This is to match cycles principled bsdf.
2017-06-30 14:10:42 +02:00
1b4bd1c84e Fix T51118: Outliner crash when unlinking collection
The outliner tree was not being rebuilt after unlinking a collection,
and thus a dangling pointer to the collection was kept in the tree.
2017-06-30 12:32:18 +02:00
1a6ae0c70e DwM: Use GWN_vertbuf_raw_* access for shading data
Gives approx 14% speedup here.
2017-06-30 18:31:04 +10:00
34e4948682 Fix T51919: Tangents need UV's allocated 2017-06-30 17:48:18 +10:00
bc347f6015 Merge branch 'master' into blender2.8 2017-06-30 13:46:53 +10:00
c8fa716c06 Cycles: Use float constants instead of double 2017-06-29 23:07:18 -04:00
56dcfcce05 Cycles: Disable baking in mega kernel when not in use to improve build times 2017-06-29 23:07:18 -04:00
9c2bbfb6ce Fix T50887: Holes in fluid mesh on Windows
D2556 by @chrisr
2017-06-30 11:48:12 +10:00
9210a4faf3 Fix unpredictable trackball rotation
D2729 by @IgorNull

Currently, trackball rotation sequentially applies rotation across x axis and y axis,
which produces a strange/unusable result on diagonal pointer motion.

This change fixes the problem by using a single axis which is orthogonal
and proportional to mouse delta - matching view-port trackball.
2017-06-30 11:10:05 +10:00
eb88f0c321 Workaround T51934: Array's > SHRT_MAX aren't supported 2017-06-30 10:10:22 +10:00
cdb07ff30e Eevee: Fix broken default coordinate (reported via IRC by Dalai Felinto). 2017-06-29 20:23:06 +02:00
Dalai Felinto
98c8b5a6fb No need to free all the shaders when appending or reloading libraries
To recompile all the shaders is expensive. And something to be avoided at all costs.

It was needed before because for every new lamp in the file we needed to
recompile the shaders. Now this is no longer required since we are using
UBOs for the sahders.
2017-06-29 19:07:21 +02:00
Dalai Felinto
2c62493891 Eevee: No need to free all the gpu materials when world changes.
We have a world probe that is used to prevent exactly that.
2017-06-29 18:57:06 +02:00
7c72079381 Fix hair shading after Eevee shader refactor 2017-06-29 18:45:11 +02:00
90e16b8e03 Eevee: Fix world probe with world without nodetree. 2017-06-29 17:32:13 +02:00
5e96df7d27 Eevee: Remove Geometry shader usage for background.
This fix the behaviour of the light path node that separates the probes background from the viewport background.
2017-06-29 17:08:13 +02:00
790b15112b Eevee: Fix T51922: Avoid division by 0.
Problem was caused by a division by 0 when rendering the probes. This patch make the visibility equal to 1.0 in this case.
2017-06-29 17:08:13 +02:00
95797336f5 Eevee: Prepare support for future Anisotropic shading. 2017-06-29 17:08:13 +02:00
3888227a7b material Glsl: Fix tangent with new orco. 2017-06-29 17:08:13 +02:00
2eca054e14 Remove dupli-group support for non-empty objects
Behavior for mixing object-data & dupli data was confusing,
exporters and render engines often got it wrong.
2017-06-30 00:03:08 +10:00
f39d06589e Fix warnings in draw_cache_impl files 2017-06-29 15:46:00 +02:00
0210c6b9de Fix T51890: Turning off viewport display for array modifier is blocking dupliface in final render
DupliVert/Face were not using render DM at render time.
2017-06-29 15:44:00 +02:00
b606161458 Fix T51821: Viewport not updating when switching worlds 2017-06-29 14:49:46 +02:00
916344b49e Fix error getting the tangent layer name 2017-06-29 21:24:09 +10:00
db71df4f3f Fix world not updating when changing node links
When changing node links for the world material, a redraw of the
viewport was not being triggered.
2017-06-29 12:28:25 +02:00
7dc9e42721 Missing from last commit 2017-06-29 20:33:24 +10:00
fd3589e4c9 DwM: optimize mesh batch conversion
- Replace GWN_vertbuf_attr_set with Gwn_VertBufRaw & GWN_vertbuf_raw_step
  to avoid intermediate copy.
- Avoid extra conversion step with: float[3] -> short[3] -> Gwn_PackedNormal.
  We can skip the short[3].

Gives approx 6% speedup here.
2017-06-29 20:11:16 +10:00
34566aa969 Gawain: add method of stepping over data directly
This avoids using GWN_vertbuf_attr_set which needs to calculate the
offset and perform a memcpy every call.

Exposing the data directly allows us to avoid a memcpy in some cases
and means we can write to the vertex buffer's memory directly.
2017-06-29 20:09:05 +10:00
2343dcf0d2 Gawain: Use common prefix for packed normal 2017-06-29 18:54:23 +10:00
2113dbb013 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
2017-06-29 10:11:17 +02:00
a57a7975a1 Fix T51926: Selecting pose icon under expanded group in outliner causes crash.
Cannot switch uninstantiated armature to Pose mode...
2017-06-29 10:09:58 +02:00
10c887762a DwM: no need to calculate face normal 2017-06-29 15:52:08 +10:00
abd9d50faa Cleanup: quiet negative shift warning 2017-06-29 15:34:50 +10:00
f6bb3262f1 DwM: add CD_AUTO_FROM_NAME for mesh conversion 2017-06-29 15:23:47 +10:00
15079b0b43 Fix crash & performance regression w/ base lookup
Was doing O(n^2) list lookups with blender-render drawing & transform.
Also missing NULL checks would crash.

Use Object.base_flag (already used by new draw manager in places)
to avoid list lookup.

Note, transform still performs inefficient lookups,
but only for selected parents (like 2.7x), not all parents.
2017-06-29 12:19:22 +10:00
e14fd19105 Eevee: Add Initial support for Principle BRDF.
Lots of things not working yet but it's comming.
2017-06-29 01:47:59 +02:00
8d57f4e3c6 Eevee: Remove ShadingData struct.
That was a bad idea after all.
2017-06-29 01:47:59 +02:00
2117334737 Fix assert calculating tangents with no faces 2017-06-29 07:57:23 +10:00
a1a40bfe70 GPUTexture : Un-clamp float rect datas.
We do not need it anymore because we do not use glu anymore. And we need full range for HDRI Lighting.
2017-06-28 22:26:44 +02:00
1f3fd8e60a Fix T51909: Cycles: Uninitialized closure normals for the Hair BSDF
As the title says, the normal wasn't set for the Hair BSDF because it wasn't
needed before. However, the denoiser uses it to store the feature passes, so
it needs to be set now.
2017-06-28 21:32:02 +02:00
beb375cdb2 GPU_codegen: Fix geometry shader. 2017-06-28 21:28:24 +02:00
ada6e720f9 GPU_codegen: Add support for passing attributes through the geometry stage.
Should fix some issues with missing attributes in Eevee.
2017-06-28 21:05:43 +02:00
b5696f2799 Fix node UI not using translation context correctly.
Now that some node types may have custom context, we need to handle that
in the (convoluted :| ) UI code of nodes as well.

Reported in T43295 by Gabriel Gazzán (@gab3d), thanks.
2017-06-28 20:50:21 +02:00
26b699a105 Eevee: Fix shader linking error. 2017-06-28 18:28:52 +02:00
b6a2d255c3 Eevee: Fix Shadow Map bug: fix T51924 2017-06-28 17:21:57 +02:00
03b915d711 Eevee: Fix Shader compilation on certain driver. 2017-06-28 16:51:31 +02:00
6d0dbd3169 Probe: Irradiance Volume: Fix default clip start. 2017-06-28 16:32:08 +02:00
1982e724f4 Eevee: Refactor of shading code to be more modular.
This will enable creating shading models more easily.
2017-06-28 16:32:08 +02:00
0782c9f8dc Fix T51920: Invalidate draw cache when changing object origin 2017-06-28 14:58:25 +02:00
16eca8f47e Fix own really stupid mistake/typo in previous commit... 2017-06-28 13:21:04 +02:00
2c0ee61f6d Fix T51900: Crash after pressing "F" multiple times.
`BMO_iter_as_array()` may fill less items than requested in given array,
so we have to update number of items to work on from its returned value,
otherwise code might try to use uninitialized memory.
2017-06-28 10:53:52 +02:00
4a061a87e6 DwM: mesh data now only creates data thats used
Read from the GPUMaterial to find custom-data layers used for drawing.

This resolves problem where having UV's would always calculate tangents
causing noticeable slow down compared to 2.7x.
2017-06-28 13:44:28 +10:00
e78c0840f2 DwM: create eevee materials before the mesh
To know which custom-data layers will be needed in the mesh.

No functional change yet.
2017-06-28 13:36:55 +10:00
fc3d0da2fd DWM: Fix own error checking wrong layer type
Would calculate all tangents for every UV layer.
2017-06-28 11:39:05 +10:00
87dd9c31a0 GPU: split GPU_material_from_nodetree in two
Add GPU_material_from_nodetree_find to avoid having to construct other
arguments which won't be used in the case the material is exists.
2017-06-28 10:59:25 +10:00
037876659f Fix own error removing texface
Setting the name crashed with NULL poly layer.
2017-06-28 10:23:27 +10:00
87a95558a0 Fix own error removing texface
Using pointer offsets from different arrays
2017-06-28 10:11:49 +10:00
df70e3de63 DWM: separate tangents from UV conversion
Prepare for different number of UV/Tangent layers.
2017-06-28 09:55:40 +10:00
dbaa6c2aa2 GPU: GPU_generate_pass_new now takes vertex-attrs
Needed so we can tell which custom-data layers to use from the mesh.
2017-06-28 09:37:44 +10:00
2ed82d2e6b Fix missing globalsBlock in edit mode latice drawing
This was causing lattice vertices not to be drawn.
2017-06-27 18:40:39 +02:00
Dalai Felinto
f11bcbed9d Fix T51913: Context tab for textures issue
The original code was doing a sanity check to see if existing index was
out of range. However the comparison was wrong.

So if the previous ct->user (active index of texture node) was larger
than then number of available texture nodes + 1 in the other material,
we would never re-set the index to 0.

Bug introduced on c31f74de6b.

There was an early attempt of fixing this (2b2ac5d3cc) but it was just working
by pure, luck. And failing in cases like the one from this bug report.
2017-06-27 16:56:43 +02:00
d04f30c5d8 Implement weight colors for lattices in draw manager 2017-06-27 15:59:13 +02:00
6e83ace809 LightProbes: Change 3d view display shape.
Introduce specific shape for each probe type to easily identify them.
2017-06-27 15:00:14 +02:00
cbfdd02f2c Fix typo in Eevee hair UV handling 2017-06-27 11:59:22 +02:00
bb0e8f1c55 Cleanup: remove unused function 2017-06-27 18:05:44 +10:00
3cb562c994 mikktspace: minor optimization
Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).
2017-06-27 16:14:58 +10:00
c218d4b008 Eevee: Bloom: fix black bloom artifacts. 2017-06-27 05:18:00 +02:00
62b1d11613 RNA: update_gpu_tag() to force Batch re-generation 2017-06-27 11:09:30 +10:00
e6be5b8a2c Merge branch 'master' into blender2.8 2017-06-27 09:59:36 +10:00
b796ce0f26 CMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Convenience makefile now uses CMAKE_BUILD_TYPE_INIT,
this means you can change the build type of an existing build
and it won't be overwritten when running `make`.

Useful if you want to add debug info to a release build for profiling.
2017-06-27 09:50:35 +10:00
03b46f7941 Cleanup: quiet warning
Passing NULL arg when nonnull attr is used.
2017-06-27 07:39:44 +10:00
8cc8aad4f9 Scene object iterator: minor optimization
Avoid an extra hash when adding to gset
2017-06-27 07:30:21 +10:00
0394c04a7f Eevee: Add Planar reflection blurring.
This method is very cheap and inaccurate. This will fill the gap untill better model is supported.
2017-06-26 21:04:53 +02:00
daf02baaea Add new DRW_draw_pass_subset function
This function allows to draw only a selected range of shading groups.

This is required for some special situations as grease pencil strokes.
2017-06-26 20:42:58 +02:00
5a1bdf2c3a Add warning that 'purge all' action in Outliner does save to current .blend file.
This is a very important, potentially deadly side-effect of this
operator. If something goes wrong, it can save a broken .blend file.

Ideally we could get rid of that operation anyway, once ID management if
fully renewed, but for now would rather keep it around.

Related to T51902.
2017-06-26 19:00:45 +02:00
d4ca2ec9d5 Fix T51902: Severe problem with relocating linked libraries when using proxies.
Fix is a bit ugly, but cannot think of another solution for now, at
least this **should** not break anything else.

And now I go find myself a very remote, high and lonely mountain, climb
to its top, roar "I hate proxies!" a few times, and relax hearing the echos...
2017-06-26 18:55:30 +02:00
Dalai Felinto
1758330220 Fix viewport rendering with anti-aliasing - workaround
This commit makes the fullsample option for viewport renderings always
on: Render > OpenGL Render Options > Full Sample.

(The UI still allows users to set this, so we will need to revisit this
before 2.8 releases).

Even in computers that can handle MSAA we had issues.
The way Blender gpu_* implementation is handling anti-aliasing is buggy.
For example, in Blender 2.7x if you have depth of field in a viewport
with multi-sampling, the DoF gives us jagged edges.

Since Eevee uses framebuffers for a lot of things, this issue was
leading to very visible buggy render in some computers, and more subtle
inconsistent buggy renders in others (easy to test with the depth of
field in Eevee).
2017-06-26 18:30:21 +02:00
a48bd0db71 Remove disabled code for freeing shaders on scene update
Some code for freeing shaders on scene updates (because of previous
dependency shaders had on lamps) had been disabled, as it is no longer
required. This removes that code altogether.
2017-06-26 18:16:05 +02:00
b50839038d Stop object shaders from being updated when changing lamp properties
Object shaders no longer depend on lamp data at compile time, thus they
don't need to be invalidated when lamps change. Disabling shader
recompilation allows fast viewport updates when changing lamp settings.

Note that even though shaders for lamps are currently not being used,
`lamp_changed` is still freeing the lamp shaders, as at some point we
might want to use shaders for lamps...
2017-06-26 17:53:47 +02:00
3c2f0466d8 Enable optional jack in install_deps.sh
Based on D2578, now you can install JACK audio server and use it in
Blender build without having to specify the `--with-all` option (that
one still enables also JACK of course).

Reviewers: mont29

Maniphest Tasks: T51033

Differential Revision: https://developer.blender.org/D2578
2017-06-26 16:12:32 +02:00
bafb904807 Fix T51559: Update draw cache when changing flat/smooth shading
This also renames some flags/variables to be more generic for updating
purposes. The call used here was previously only used for updating
paint data, but as it was reused here, flags and variables were renamed
to accomodate more clearly to the new usages.
2017-06-26 14:52:59 +02:00
Dalai Felinto
37593b6a42 New scenes should use Eevee, not Blender Render 2017-06-26 12:47:33 +02:00
e304150701 Enable shadow catching for Eevee hair
Shadow catching was disabled for hair in Eevee, because of an issue in
the shadow maps. The issue has since been resolved, so this re-enables
shadow catching for hair.
2017-06-26 12:30:30 +02:00
cbbfacdac0 Hair UV implementation for Eevee
This implements UV support for Eevee hair, enabling the usage of
textures.
2017-06-26 12:17:18 +02:00
Dalai Felinto
6f0b80425b Fix shaders not working in Eevee
Not a single node based shader was working since a recent merge from
master.

The merge brought changes from the principle bsdf shader where
unsupported gl_ProjectionMatrix was still being used.
2017-06-26 12:14:21 +02:00
21f088018a Used Py3.6 feature by accident, check version 2017-06-26 19:57:48 +10:00
28b2f1c305 Manipulator: Python API
Initial support for Python/Manipulator integration
from 'custom-manipulators' branch.

Supports:

- Registering custom manipulators & manipulator-groups.
- Modifying RNA properties, custom values via get/set callbacks,
  or invoking an operator.
- Drawing shape presets for Python defined manipulators (arrow, circle, face-maps)

Limitations:

- Only float properties supported.
- Drawing only supported via shape presets.
  (we'll likely want a way to define custom geometry or draw directly).
- When to refresh, recalculate manipulators will likely need
  integration with notifier system.

Development will be continued in the 2.8 branch
2017-06-26 16:38:04 +10:00
c9e33b36de Correct copy-paste error manipulator 2017-06-26 15:46:27 +10:00
ba6d9fefc2 Rename wmManipulatorPropertyType.type -> data_type 2017-06-26 14:36:37 +10:00
3edff2e1a4 Manipulator: use 'void *' for callback data args
Non-float properties should be editable too.
2017-06-26 14:33:10 +10:00
2d2c64dd18 Building without Python works again 2017-06-26 13:50:11 +10:00
6d1ae5897f Merge branch 'master' into blender2.8 2017-06-26 13:43:56 +10:00
fb96228441 Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data 2017-06-26 13:41:44 +10:00
0a79b350b5 Merge branch 'master' into blender2.8
Note that this drops all changes from master,
useful commits will need to be cherry-picked.

Did this since most commits were relating to UV/textures
which is complicated by texface being removed in 2.8
2017-06-26 13:38:23 +10:00
f0863f2a80 Merge branch 'master' into blender2.8 2017-06-26 13:27:54 +10:00
0172ed8fe5 Building w/o Python works again 2017-06-26 13:26:44 +10:00
3cbf77b34f Cleanup: committed by accident 2017-06-26 13:21:09 +10:00
a4f16c63a2 Manipulator: name setting function
Default name includes group-name,
we may want to set the name without a prefix.
2017-06-26 13:16:25 +10:00
b0ee9aaa5d Fix freestyle lineset panels being animatable 2017-06-25 20:03:19 -04:00
957a77c0ba UI: Fix Capitalization Inconsistency 2017-06-25 19:55:05 -04:00
3a1f77650d WM: Fix crash in transform-orientation access
Need to support orientation access when context is NULL.
2017-06-26 08:38:21 +10:00
70b5cec5fa Manipulator: add optional properties argument
Needed for RNA/Py API
2017-06-26 08:19:55 +10:00
c822b1612f Docs: correct doc-strings 2017-06-26 07:36:29 +10:00
1c053c6a12 Collada: Exporter now only exports either 'Materials' or 'UV Textures as Materials'. This makes the user interface more streight 2017-06-25 22:06:42 +02:00
ad58617bd2 fix: overlooked the RET_ZERO appendix 2017-06-25 17:04:47 +02:00
c9b95c28f6 fix: T51622 The exporter now exports meshes as <Triangles> when all contained polygons are tris 2017-06-25 14:51:51 +02:00
fcb8761966 fix: Collada fprintf needs std::string be converted to char * 2017-06-25 13:18:21 +02:00
1340c7bcdc fix: collada: removed unnecessary extra qualification 2017-06-25 13:10:03 +02:00
d17786b107 fix: adjusted collada declaration after changes in collada module.
@campbell Barton: Why is this declaration needed at all in stubs.c?
Further up the file collada.h is imported and that already decalres
the function and results in a duplicate declaration.
2017-06-25 10:50:19 +02:00
bdacb60a92 Collada: Fix: Geometry exporter did not create all polylist when meshes are only partially textured 2017-06-24 23:33:34 +02:00
ddabe465b5 collada: export UV Textures as materials. Note: the reimport of the exported collada files will have materials assigned instead of UV Face Textures! This is expected behavior 2017-06-24 22:16:47 +02:00
a2a301bdb9 collada: change image export: export either UV Textures or Materials. This
avoids wrong texture data when multiple objects are exported. Note: This
commit might possiblyt not work fully. The full feature is added with the
next commit)
2017-06-24 22:16:47 +02:00
89060babbc Collada: improved Error handling: Avoid shutdown of Blender when the Collada importer finds Syntax errors in import data 2017-06-24 22:16:47 +02:00
0d2b1da3a6 Collada: added new functions for improved material exporter (not used yet) 2017-06-24 22:16:47 +02:00
ce531ed1a1 Fix T50856: crash when minimizing window on AMD / Windows. 2017-06-24 19:20:56 +02:00
f51438aea0 Fix T51792: crash calling bpy.ops.screen.animation_cancel while scrubbing. 2017-06-24 18:02:30 +02:00
3c7355b3a2 Revert "Fix py-api doc building"
This reverts commit 838a4622cf.

Also add missing 'lightprobe'
2017-06-24 17:01:25 +10:00
838a4622cf Fix py-api doc building 2017-06-24 16:11:24 +10:00
07f34ee843 Eevee: Fix linking error. 2017-06-24 05:25:33 +02:00
28ff238c45 Eevee: Planar reflection: Fix normal deformation for background pixels.
Now it matches world cubemap perfectly.
2017-06-24 05:24:59 +02:00
bff98ce3f7 Eevee: Fix opengl error cause by bad texture configuration.
This is fragile and the whole Texture/Framebuffer should be extended to be more flexible.
2017-06-24 01:46:07 +02:00
8035c0f3c6 Eevee: Use smaller texture for placeholders. 2017-06-24 01:44:43 +02:00
e92940c6f3 Eevee: Planar Reflection: Add contact hardening normal distortion.
Save radial distance to camera in alpha channel of the planar probe.
Use this distance to modulate distortion intensity when shading the surface.
2017-06-24 01:08:26 +02:00
a6593645bf Eevee: Add AO support in planar reflection.
Technically this enables the use of MinmaxZ pyramid inside the probe captures.
Also Disable AO for cubemap probes because it shows big discontinuities at cubeface limits.
2017-06-23 22:51:38 +02:00
5e3f902eaa Eevee: Planar Reflection: Fix precision issue near cliplane.
The problem was that the depth prepass was using the clip plane but not the shading pass.

During the clipping stage, the triangle is converted to a quad clipped to the given clip plane.
But this introduce subtle changes in the depth when this new geometry is rasterized. Since the shading pass was using an EQUAL depth test, the depth values from the shading pass were not always equal to the depth prepass.

Enabling clipping in the shading vertex shader has a too small impact to require a dedicated shader.
2017-06-23 22:51:38 +02:00
1111e64c72 Eevee: Planar reflection: Fix bad texture binding. 2017-06-23 22:51:38 +02:00
Dalai Felinto
dd608ba20e Silence warnings (tsc, tsc) 2017-06-23 16:45:14 +02:00
986a3d15ac GPUMaterial: Avoid freeing GLSL shaders when changing scene properties.
This was causing major slowdown when changing Colormanagment settings or post processing.
2017-06-23 16:41:56 +02:00
45720922f7 Revert "Temporarily disable material preview (T51796 workaround)"
This reverts commit 0d9611718d.

The preview issues have been solved by CoW commit
802027f3f8
2017-06-23 12:26:54 +02:00
a764044ccc Fix Eevee "No output node" issue
This fixes an issue introduced by the new output node system, where "No
output node" was displayed in the material panel even when an output
node was present.
2017-06-23 10:49:09 +02:00
Dalai Felinto
c2d285f0ff Grease Pencil: Fix hardcoded DKEY for continous drawing 2017-06-23 10:46:30 +02:00
bddb4de47c Fix T51845 2017-06-23 11:05:54 +03:00
0f99793dee Manipulator: partial depth support
Use the depth flag added for this purpose.
Although this only works for regular currently, not selection.
2017-06-23 17:24:56 +10:00
d47cb2a4e4 Manipulator: disable GL state changes drawing geometry
If there is case this is needed, we can enable and restore state
for now it seems OK to disable.
2017-06-23 16:47:49 +10:00
16b807e84f Manipulator: flip scale flag usage
Naming was confusing, while technically correct -
the result is no scaling (manipulator ignores zoom-level).

Also remove 3D from name since this can be supported for 2D views too.
2017-06-23 15:54:27 +10:00
0a5d7efab3 Manipulator: rename struct members
Rename:
- matrix -> matrix_basis
- user_scale -> scale_basis
- scale -> scale_final

Match RNA names being added to custom-manipulator branch.
2017-06-23 14:50:44 +10:00
12b985f1b1 Eevee: Put pack AO parameters. 2017-06-23 04:13:08 +02:00
823144f0a6 Manipulator: add tweak-snap (not used yet) 2017-06-23 11:15:16 +10:00
3a243ad83f Eevee: Attempt to optimize GTAO shader.
Unroll horizon search loop. Use fast version of acos.
On nvidia linux, unrolling the 2nd loop is giving very high compilation time.
2017-06-23 02:52:34 +02:00
fbffd6d364 Eevee: Fix OpenGl errors.
Also assert if texture does not exists in draw manager. Keeping it sane.
2017-06-23 02:52:34 +02:00
221c7fdaf0 Manipulator: fix broken hover option
Hover flag caused manipulators not to update
(Camera DOF works again).
2017-06-23 09:18:53 +10:00
06cc5e4994 DrawManager: Add support for writting to depth without depth testing.
Disabling depth test will prevent from writting to depth buffer.
Add DRW_STATE_DEPTH_ALWAYS to always pass the depth test and write to depth.
2017-06-22 18:54:03 +02:00
Dalai Felinto
5b2e596ce9 Eevee: Fix max range of lightprobes 2017-06-22 18:35:08 +02:00
Dalai Felinto
d9c5433144 Eevee: Interface and units
We should use PROP_DISTANCE whenever appropriate.
Also rename "Data Draw Size" > "Size" in the UI for the lightprobes.
2017-06-22 17:37:31 +02:00
Dalai Felinto
4cd9a3e337 Light Probes: interface changes, and renames
Although we are calling all of them light probes, there are a lot of
differences between them. This commit does the following:

* Prevent user from changing the probe type once added

* Unify "sphere" and "cube" probes into reflection cubemap
(as before you can switch between them from the probe UI)

To be done
==========
* Don't show add probe menus unless we are on Eevee

* Light probes panels should not be visible in Clay. Light probe objects
should not be visible in Clay viewport (nor on Cycles).

Notes
=====
* We need icons for the different light probes, and for lightprobes as a
whole (we are using RADIO for now).
2017-06-22 17:30:15 +02:00
Dalai Felinto
7773a8ad04 Indicate to users when manual conversion of Eevee materials is needed
We now shows a report error when user opens a file that need fixing.
It's fine(ish) to not do doversion. It's not fine to not communicate that.
2017-06-22 10:48:41 +02:00
f1824507e2 Manipulator: target property definitions
Changes from custom-manipulator branch.

- use property type definitions.
- add property free callback.
- move properties into the wmManipulator struct (over alloc).
- use array length from property types instead of arg passing.
2017-06-22 18:39:28 +10:00
7abed4e433 Fix T51867: Insert Keyframe I - L / I - R / I - S key combos are broken.
Reorder keyingsets registration order, since it also afects order of I
menu options, better show most used ones first, pure alphabetical order
is not great here... Will likely break some muscle memory though. :|

Based on D2720 by Carlo Andreacchio (@candreacchio), thanks.
2017-06-22 10:29:55 +02:00
Dalai Felinto
be4b5551c7 Fix T51863: CompositorNodeSwitchView have the wrong rna API
Although the original report was about the docs, the real issue was in
the API.

My original commit started from a copy-paste from the Switch
Node. However I don't use custom1 for thew Switch View node.

The docs is slightly incomplete since it would be nice to mention the
views here. Or maybe even expose them via Python. But honestly they are
generated depending on the scene multi-view settings.
2017-06-22 10:25:05 +02:00
87adeb8dd9 Eevee: Ambient Occlusion: Enable Multibounce approximation and Change influence factor.
Making the influence a power for easy tuning. Works like a contrast knob.
2017-06-22 03:51:06 +02:00
779c950098 Eevee: Ambient Occlusion: Initial implementation.
Implement GTAO (Ground Truth Ambient Occlusion) which is a special case of Horizon Based Ambient Occlusion that is more physically accurate.
Also add a bent normal option to sample indirect irradiance (diffuse lighting) with the least occluded direction.
2017-06-22 03:51:06 +02:00
5ccc02277d Eevee: Improve material variation managment.
- Unify variations between default shaders and material shader.
- Only create default shader passes if needed.

Downside is that we have a big array of passes and shading grp in the vedata ... And it will double in size each time a new variation flag is added.
2017-06-22 03:51:06 +02:00
1159d8ccc9 Eevee: Ambient Occlusion: Add UI properties. 2017-06-22 03:51:06 +02:00
2c7f6db8d1 Eevee: Minmax Depth Pyramid.
This commit introduce the computation of a depth pyramid containing min and max depth values of the original depth buffer.
This is useful for Clustered Light Culling but also for raytracing on the depth buffer (SSR).
It's also usefull to have to fetch higher mips in order to improve texture cache usage.

As of now, 1st mip (highest res) is half the resolution of the depth buffer, but everything is already done to be able to make a fullres copy of the depth buffer in the 1st mip instead of downsampling.
Also, the texture used is RG_32F which is a too much but enough to cover the 24bits of the depth buffer. Reducing the texture size would make things quite faster.
2017-06-22 03:51:06 +02:00
ed59d03bfc GPUFramebuffer: Add recursive downsampling function.
This special case function enables rendering to a miplevel while using the miplevels above as texture input.
This is needed for some algorithm (i.e. creating a min-max depth pyramid texture).
2017-06-22 03:51:06 +02:00
fe2ff3fc89 GPUTexture: Support for nearest sampling with mipmaps. 2017-06-22 03:51:06 +02:00
1979176088 Cycles: Fix excessive sampling weight of glossy Principled BSDF components
If there was any specularity in the Principled BSDF, it would get a sampling
weight of one regardless of its actual impact.

This commit makes Cycles estimate the contribution of the component and adjust
the weighting accordingly, which greatly improves the noise characteristics of
the Principled BSDF in many cases.

Note that this commit might slightly change the brightness of areas when using
MultiGGX and high roughnesses, but the new brightness is more accurate and
closer to the result of Branched Path Tracing. See T51836 for details.

Differential Revision: https://developer.blender.org/D2677
2017-06-22 00:09:56 +02:00
8cb741a598 Fix T51836: Cycles: Fix incorrect PDF approximations of the MultiGGX closures
The PDF of the MultiGGX sampling is approximated by the singlescattering GGX
term as well as a scaled diffuse term that makes up for the energy in the
multiscattering component that's missed by GGX.

However, there were two problems with the glossy terms: The diffuse term missed
a normalization factor, and the singlescattering term was not properly scaled
down based on the albedo estimate.

The glass term was completely wrong and has been rewritten. It uses the fresnel
factor to weight reflection vs. refraction and uses the glossy MultiGGX model
for reflection.
For refraction, the correct singlescattering term is now used, and a new
albedo approximation is used that was derived by evaluating GGX albedo for
roughnesses from 0 to 1 and IORs from 1 to 3 and fitting numerical
approximations to it. The resulting model has a mean relative error of 9e-5,
but could probably be simplified without losing noticable accuracy in the
final render.

The improved PDFs help with glossy highlights (due to better light sampling vs.
closure sampling MIS) and fix the situation described in T51836 where mixing
MultiGGX with other closures (as it happens in e.g. the Principled
BSDF) causes incorrect darkening.
2017-06-22 00:09:56 +02:00
968093ec2f Fix T51862: principled shader GLSL artifacts in ortho mode. 2017-06-21 21:31:08 +02:00
14ea0c5fcc Fix T51849: change Cycles clearcoat gloss to roughness.
This is compatible with UE4 and more consistent with specular and transmission
roughness, even if it deviates from the original Disney BRDF.
2017-06-21 19:55:20 +02:00
Dalai Felinto
4ceb006706 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-21 15:14:42 +02:00
Dalai Felinto
22466a5bdf Fix typo in builtbot config 2017-06-21 14:05:23 +02:00
Dalai Felinto
2ae172ec32 Fix blenderplayer (tm) 2017-06-21 12:25:07 +02:00
af35455912 Fix T51856: BKE_mesh_new_from_object() would often generate default 'Mesh' named datablock.
This is annoying especially for exporters who do use mesh name, since it
broke any relation with actual Mesh naming in original Blend file.

Unfortunately, we cannot avoid the extra .xxx digits. ;)
2017-06-21 10:30:38 +02:00
85c5c5531e Manipulator: edit_properties -> target_properties
Naming was too confusing between properties of a manipulator
and properties it edits.
2017-06-21 17:06:24 +10:00
c3a8b51413 Manipulator: Move types into their own directory 2017-06-21 16:24:16 +10:00
b7669ac1c6 Manipulators: move settings to ID properties
This makes manipulator access closer to operators,
and allows Python access.

This adds RNA for manipulators, but not Python registration yet.

- Split draw style into 2x settings:
  `draw_style` (enum) & `draw_options` (enum-flag)
- Rename wmManipulator.properties -> properties_edit,
  Use wmManipulator.properties for ID-properties.
  Note that this area of the API will need further work since
  manipulators now have 2 kinds of properties & API's to access them.
2017-06-21 14:10:14 +10:00
5b51dcacbc PyAPI: add intern strings
Avoid string conversion on each use.
2017-06-21 12:43:19 +10:00
d9bb08f111 RNA: avoid many calls to 'RNA_struct_is_a'
Quicker to find the ID-subtype then use direct pointer comparisons.

Also modify `ID_code_to_RNA_type` so missing ID-codes raise a warning
(handy when adding new ID types).
2017-06-21 12:19:37 +10:00
Dalai Felinto
0ef7ccb4d7 Introduce functions/options to indicate the type of render
We should be able to differentiate between OpenGL render (viewport
render), offline render (F12), and view render (viewport draw).

This allows for us preventing offline render to skip mode drawings, grid, ...
Even OpenGL render can benefit from this forcing a higher quality
anti-alias and sampling than the viewport drawing.

I'm not sure if it's clever to keep the memset(0x00) outside the render
loop function as it is in this patch. An alternative is to just pass the
render "type" as a flag to the render function, and set DST.options
inside it. (I may change this tomorrow, I will wait to hear from
Campbell on that).
2017-06-20 20:07:18 +02:00
9e08019b74 Fix: Icon alignment for scaled pie buttons with no text 2017-06-20 20:15:04 +03:00
5c5c09439a Clean node names and organize menus for eevee
This makes the node menus aware of the Cycles/Eevee distinction, and
only show the relevant nodes for the current engine. Names have also
been changed to accomodate for the new output node system.
2017-06-20 18:39:59 +02:00
aaf37e1216 Implement Eevee output node system
This makes Eevee consistent with Cycles, by having a single output node,
and multiple shader nodes that connect to it.

Note that node systems for Eevee saved before this will be missing the
output node, and thus will show an invalid material. This is easily
resolved by connecting the shader output to a new output node.
2017-06-20 18:39:49 +02:00
Dalai Felinto
c2f4308e6b Fix blenderplayer build (tm) 2017-06-20 15:51:51 +02:00
Dalai Felinto
63d71edfca Fix collada build after gawain rename/refactor
Collada files should not have been touched.

Bug introduced on: c31f24c63b
2017-06-20 15:42:51 +02:00
e3b1d562a7 Fix (unreported) missing Image usercount increase when copying UVProject modifier. 2017-06-20 13:46:09 +02:00
c31f24c63b Manipulators: store operator type instead of id
Avoids lookups on each access.
2017-06-20 04:44:34 +10:00
243b42af49 Alembic tests: make failures a bit easier to diagnose. 2017-06-19 17:55:51 +02:00
81775e1920 Fix T51762: Unit test script_alembic_import is failing.
Implemented workaround for use with the legacy depsgraph.
2017-06-19 17:50:43 +02:00
56dea4b7cd Fix warning in view3d_draw. 2017-06-19 16:31:20 +02:00
7461bb3f52 Fixed bl_load_py_modules / script_load_modules unit test
It tried to assert that
addons/io_blend_utils/blender_bam-unpacked.whl/__init__.py was loaded when
the io_blend_utils module was imported. However, this happens only on
demand, and not directly when importing the add-on.
2017-06-19 15:28:52 +02:00
c9291ab2ac Use for/else instead of setting 'ok' variable.
This is more efficient, and this use case is exactly what the else clause
is for.
2017-06-19 15:28:52 +02:00
9af3119c53 Removed trailing spaces 2017-06-19 15:28:52 +02:00
Dalai Felinto
701a76769d Fixup for gawan rename
inten/opencolorio and *.cc were ignored.

Build error introduced on b4d053efc7.
2017-06-19 15:19:25 +02:00
54c9803e81 Depsgraph: Fix crash with mouse select in edit mode with Copy-on-Write enabled 2017-06-19 15:09:48 +02:00
24486513d5 Fix (unreported) bad copying code of Surface Deform modifier. 2017-06-19 14:57:40 +02:00
5347aa40d5 Fix compiler warnings from own recent rB0d5c7e5e36b9. 2017-06-19 14:43:44 +02:00
1addac8e0c Fix (unreported) bad copying of Ocean modifier.
Was needlessly complicated code, forgot to copy a value (foam_fade), and
was utterly leaking memory!
2017-06-19 14:43:15 +02:00
fbff09bf7a Depsgraph: Synchronize selection from original scene to copied-on-write one
This makes it possible to select objects in the viewport.

Selection in edit mode is still tricky, mainly because currently such update
would require tagging batch as updated, which is not possible with using just
and original object because it will never have batch.

Possible solution here would be to introduce some "batch" or "render" component
to depsgraph ID node for objects, so we can tag batch for update via depsgraph
tagging API.
2017-06-19 13:23:42 +02:00
802027f3f8 Depsgraph: Initial groundwork for copy-on-write support
< Dependency graph Copy-on-Write >
 --------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

This is an initial commit of Copy-on-write support added to dependency graph.
Main priority for now: get playback (Alt-A) and all operators (selection,
transform etc) to work with the new concept of clear separation between
evaluated data coming from dependency graph and original data coming from
.blend file (and stored in bmain).

= How does this work? =

The idea is to support Copy-on-Write on the ID level. This means, we duplicate
the whole ID before we cann it's evaluaiton function. This is currently done
in the following way:

- At the depsgraph construction time we create "shallow" copy of the ID
  datablock, just so we know it's pointer in memory and can use for function
  bindings.

- At the evaluaiton time, the copy of ID get's "expanded" (needs a better
  name internally, so it does not conflict with expanding datablocks during
  library linking), which means the content of the datablock is being
  copied over and all IDs are getting remapped to the copied ones.

  Currently we do the whole copy, in the future we will support some tricks
  here to prevent duplicating geometry arrays (verts, edges, loops, faces
  and polys) when we don't need that.

- Evaluation functions are operating on copied datablocks and never touching
  original datablock.

- There are some cases when we need to know non-ID pointers for function
  bindings. This mainly applies to scene collections and armatures. The
  idea of dealing with this is to "expand" copy-on-write datablock at
  the dependency graph build time. This might introduce some slowdown to the
  dependency graph construction time, but allows us to have minimal changes
  in the code and avoid any hash look-up from evaluation function (one of
  the ideas to avoid using pointers as function bindings is to pass name
  of layer or a bone to the evaluation function and look up actual data based
  on that name).

  Currently there is a special function in depsgraph which does such a
  synchronization, in the future we might want to make it more generic.

At some point we need to synchronize copy-on-write version of datablock with
the original version. This happens, i.e., when we change active object or
change selection. We don't want any actual evaluation of update flush happening
for such thins, so now we have a special update tag:

  DEG_id_tag_update((id, DEG_TAG_COPY_ON_WRITE)

- For the render engines we now have special call for the dependency graph to
  give evaluated datablock for the given original one. This isn't fully ideal
  but allows to have Cycles viewport render.

  This is definitely a subject for further investigation / improvement.

This call will tag copy-on-write component tagged for update without causing
updates to be flushed to any other objects, causing chain reaction of updates.
This tag is handy when selection in the scene changes.

This basically summarizes ideas underneath this commit. The code should be
reasonably documented.

Here is a demo of dependency graph with all copy-on-write stuff in it:

  https://developer.blender.org/F635468

= What to expect to (not) work? =

- Only meshes are properly-ish aware of copy-on-write currently, Non-mesh
  geometry will probably crash or will not work at all.

- Armatures will need similar depsgraph built-time expansion of the copied
  datablock.

- There are some extra tags / relations added, to keep things demo-able but
  which are slowing things down for evaluation.

- Edit mode works for until click selection is used (due to the selection
  code using EditDerivedMesh created ad-hoc).

- Lots of tools will lack tagging synchronization of copied datablock for
  sync with original ID.

= How to move forward? =

There is some tedious work related on going over all the tools, checking
whether they need to work with original or final evaluated object and make
the required changes.

Additionally, there need synchronization tag done in fair amount of tools
and operators as well. For example, currently it's not possible to change
render engine without re-opening the file or forcing dependency graph for
re-build via python console.

There is also now some thoughts required about copying evaluated properties
between objects or from collection to a new object. Perhaps easiest way
would be to move base flag flush to Object ID node and tag new objects for
update instead of doing manual copy.

here is some WIP patch which moves such evaluaiton / flush:

  https://developer.blender.org/F635479

Lots of TODOs in the code, with possible optimization.

= How to test? =

This is a feature under heavy development, so obviously it is disabled by
default. The only reason it goes to 2.8 branch is to avoid possible merge
hell.

In order to enable this feature use WITH_DEPSGRAPH_COPY_ON_WRITE CMake
configuration option.
2017-06-19 13:21:44 +02:00
e917bc5ee0 Fix (unreported) bad copying code in Mesh Deform modifier. 2017-06-19 12:55:11 +02:00
0d5c7e5e36 Fix (unreported) Dynamic Paint modifier not increasing ID usercount in copy function.
*Sigh* One more example of why we should keep ID management handling in
as few places as possible! It's impossible to keep more than a few
places in sync regarding which ID pointer is refcounted etc.
2017-06-19 12:25:41 +02:00
e9aaf5ed21 Fix (unreported) memory leak in Fluid modifier copying.
Also generally simplify/sanitize this copy code.
2017-06-19 12:21:14 +02:00
b4d053efc7 Gawain API naming refactor
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
2017-06-19 20:18:04 +10:00
349946bd01 Cleanup: quiet warnings 2017-06-19 20:09:26 +10:00
33e5163550 CMake: Remove unused legacy depsgraph option
We don't have legacy depsgraph anymore, no reason to keep the option.
2017-06-19 11:14:40 +02:00
4046f3a54d Manipulator: use ui-scale for widgets 2017-06-19 19:03:22 +10:00
5a029d7a6d Eevee: Add data display for planar reflection.
Maybe not very useful but it's here for feature parity with the other probes.
The fragment shader clipping is here because I'm lazy and don't want to creating a proper quad Batch.
2017-06-19 10:47:56 +02:00
bd9a328b58 Eevee: Fix Planar Probe offset changing influence calculation. 2017-06-19 10:47:56 +02:00
0993af5484 Planar Probe: Add UI, 3d view Display and change defaults. 2017-06-19 10:47:56 +02:00
3e4b9d2b5a Eevee: Initial implementation of planar reflections.
Still pretty barebone: No roughness support, No normal distortion support.
2017-06-19 10:47:56 +02:00
5c67ac2236 Eevee: Add special shader for depth prespass.
This way we can extend it to output more data (like motion vectors).
Add a variation that uses clip distances.
2017-06-19 10:47:56 +02:00
539225db81 DrwManager: Remove the need for buffers to be available.
This way we can just avoid binding a texture by setting it's ref to NULL.
2017-06-19 10:47:56 +02:00
6dbe2b0385 DrwManager: Remove unnecessary ifs. 2017-06-19 10:47:56 +02:00
83a001267a Probe: Add planar type. 2017-06-19 10:47:56 +02:00
9a5cb2e6f8 DrwManager: Add support for Custom Clipping Planes 2017-06-19 10:47:56 +02:00
9a040fa3d4 DrwManager: Add the possibility to invert backfacing.
This is done in order to support planar reflection rendering.
2017-06-19 10:47:56 +02:00
8a10fa1c53 GPUFramebuffer: Add support to attach individual texture layer. 2017-06-19 10:47:56 +02:00
7b14065729 Manipulator: de-duplicate flags and scale option 2017-06-19 17:52:26 +10:00
2ecb9856bc Cleanup: move copy-paste code into function 2017-06-19 16:12:11 +10:00
9649c6bef5 Merge branch 'master' into blender2.8 2017-06-19 15:06:48 +10:00
72c9141a7a Cleanup: doxygen comments
Also remove duplicate & mismatching comments from grease-pencil header.
Keep comments close to implementation to avoid getting out of sync.
2017-06-19 10:04:30 +10:00
3190eaf109 Fix T51774: Children particles hair interpolation not correct with textures or dp.
Children where always getting at least one segment of fixed length...

Now fully hidden ones (zero length) get no segment at all.

Note that even very short ones keep getting one 'unit' length segment - would
rather avoid changing that at this point, given how complex children
particles 'length' can get with all kind of modifiers... Think we can
live with that for now anyway.
2017-06-19 00:03:36 +02:00
f158a206f2 Fix T51840: UI redraw in node editor header missing on pointcache bake
Missing a notifier handler in the node editor
2017-06-18 16:31:59 +02:00
cd8c46627f Fix unreported: Copy-pasting nodes crashes when they have an undefined type 2017-06-18 05:14:26 +02:00
cf7447dacb Manipulator: comments 2017-06-18 09:08:30 +10:00
f860369ebf Manipulator: use matrix for manipulator direction
Remove type-specific axis functions.
2017-06-18 08:37:50 +10:00
49be79693c Manipulator: use matrix instead of origin
This avoids having to use manipulator-type specific functions
to set the orientation.
And will make it simpler to access transformation from Python.

Currently the matrix is still used as an offset in places.
Also per-type orientation values still need to be removed.
2017-06-18 05:38:10 +10:00
b94a433ca3 Docs: Fix file:line links in generated API docs 2017-06-18 02:38:20 +10:00
1ec987f73c Add Cone: tip soft-min should be zero
Default value should be included in range.
2017-06-18 02:07:22 +10:00
83c28ff96a Merge branch 'master' into blender2.8 2017-06-18 01:44:08 +10:00
54f0f87a4b Cleanup: use uint 2017-06-18 01:34:41 +10:00
8bf108dd48 Guarded allocator: Fix type in macro definition
The crash did not happen yet because we always had proper vmemh defined in
the parent scope.

Patch by Ivan Ivanov (aka obiwanus), thanks!

Differential Revision: https://developer.blender.org/D2715
2017-06-17 16:13:30 +02:00
a56de26704 Manipulator: draw options for dial
- Option to start helper angle lines based on a vector
  instead of the initial mouse coords (useful for bisect & spin).
- Option to show 2x helper lines
  useful when dial is used to rotate an axis value.
2017-06-17 15:32:47 +10:00
865bf8ecbc Manipulator: correct dial angle
Calculation was done in screen-space giving inaccuracy,
making the angle incorrect for tool code.

Cast mouse coords onto the dial plane to calculate the angle instead.
2017-06-17 14:34:23 +10:00
57c9bc9bb0 Manipulator: fix general purpose dial use
Wasn't checking own location when checking if flip is needed.
2017-06-17 11:55:53 +10:00
03f67fd5b0 Cleanup: unused code 2017-06-17 11:32:30 +10:00
608cabe2a1 Manipulator: Ignore zoom-level for on-screen widgets 2017-06-17 11:24:26 +10:00
41e22cccee Camera widget only drew 3 sides 2017-06-17 11:09:08 +10:00
aeeebacd6a Cleanup: minor consistency tweak for type name 2017-06-17 10:04:48 +10:00
8c22d31dcc Manipulator: remove type specific 'new' functions
Instead use generic 'WM_manipulator_new', adding a new 'setup'
callback (like wmManipulatorGroup.setup) used to initialize type vars.

This moves conventions closer to wmOperator and simplifies exposing to
Python.
2017-06-17 10:02:54 +10:00
71b70b23b3 Manipulator: initial manipulator for spin operator 2017-06-17 06:38:51 +10:00
df017f7867 Manipulator: New grab preset, use for bisect 2017-06-17 06:14:29 +10:00
2b8d599b3a Manipulator: add array get/set functions 2017-06-17 02:38:49 +10:00
ed6d88f06a PyAPI: Fix warning about indent 2017-06-16 12:30:18 -04:00
Dalai Felinto
946bc4d3c1 Fix object selection doversion issue since Workspace
Workspace commit (7f564d74f9) made
selection to not be carried away from 2.7x files into 2.8.
2017-06-16 18:12:22 +02:00
fc4154f857 Fix T51810: Add minimal example of usage of translation API for non-official addons. 2017-06-16 16:43:46 +02:00
34389999b2 Usual i18n/UI messages fixes.
Please do not add useless tooltips! We have enough messages to translate
already...
2017-06-16 12:50:24 +02:00
24ec761bb4 Merge branch 'master' into blender2.8 2017-06-16 10:26:37 +02:00
794311c92b Cycles: Fix race condition happening in progress utility
This is not enough to mutex-guard modification code of integer values,
since this operation is NOT atomic. This is not even safe for a single
byte data types.

For now guarded the getter functions, similar to other functions in
this module.

Ideally we want to switch modification to an atomic operations, so we
wouldn't need any locks in the getters.
2017-06-16 10:22:35 +02:00
18e1c8d9fa PyAPI: Fix changed ref link 2017-06-15 22:03:22 -04:00
a348023196 PyAPI: Add HTML logo and favicon
Differential Revision: https://developer.blender.org/D2621
2017-06-15 22:01:04 -04:00
127a754615 PyAPI: Remove addon tutorial
This page now lives at https://docs.blender.org/manual/en/dev/advanced/scripting/addon_tutorial.html
2017-06-15 22:01:03 -04:00
e306499a41 Missed last commit 2017-06-16 08:52:42 +10:00
637fa5f670 Cleanup: rename manipulator files 2017-06-16 08:51:14 +10:00
65905a76c2 Add bisect manipulator
Example that uses library widgets to control an operator,
the API hasn't been reviewed yet so this can be seen as a test.
2017-06-16 08:25:24 +10:00
400d3f85e1 Add support for delayed manipulator removal
This is needed so manipulators can tag themselves for removal
without causing problems from freeing data within a callback.

Also use properties within the dial manipulator and fix an error where
removing a wmManipulatorGroupType didn't remove its keymap.
2017-06-16 08:20:27 +10:00
6b502731a5 CMake: print absolute CMakeCache.txt
Message didn't show the path of the file to remove
which could be confusing.
2017-06-16 07:38:20 +10:00
4054914813 UV manipulator from custom widgets branch
This isn't advanced, just adding to get custom
manipulator branch from being too much out of sync with 2.8.
2017-06-16 07:34:23 +10:00
Dalai Felinto
281a4540e2 Expose World ID panel for Eevee
That said, materials need to be updated when switching the world.
2017-06-15 18:46:14 +02:00
Dalai Felinto
cd21236ea1 Fix duplication of scene, it was missing duplication of layer properties 2017-06-15 18:37:02 +02:00
51404724cc Merge branch 'master' into blender2.8 2017-06-16 01:29:20 +10:00
1d966ca7a1 Math Lib: add angle_on_axis_v3v3_v3
Use for calculating the angle between 2 directions on an axis.

Also signed version and normalized plane projection,
use when input is normalized.
2017-06-16 01:27:58 +10:00
60c5b3f76f Merge branch 'master' into blender2.8 2017-06-15 16:37:10 +02:00
3d03616772 Cleanup: do not use BKE_libblock_free_ex() unless needed! 2017-06-15 16:20:51 +02:00
a35e733ff1 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/MeshImporter.cpp
	source/blender/editors/object/object_add.c
	source/blender/editors/screen/screen_edit.c
2017-06-15 15:54:11 +02:00
880e96dd66 Fix/workaround 'convert object' messing up linked data.
'Convert To...' Object operation has very weird effect of actually
working at obdata level, not object level, which means *all* objects
(even unselected/hidden/in other scenes/...) using same obdata will be
converted to new selected type.

IMHO this is very bad behavior, but... not a bug really, so do not
change this for now.

But at least, do not do that when working on some linked data, else it
leaves Blend file in invalid (incoherent) state until next reload.

So workaround for now is to enforce the 'Keep Original' option when some
linked object/obdata is affected by the operation.

Also fixed somewhat broken usercount handling in Curve->Mesh part.
2017-06-15 15:47:16 +02:00
Dalai Felinto
60a36f2028 Eevee: Use PROP_NONE for probe grid resolution
It makes no sense to use PROP_PIXEL as unit here.
2017-06-15 15:02:32 +02:00
Dalai Felinto
32cd8ac710 Layers: Scene copy should copy selection as well.
We need this for Depsgraph, otherwise CoW scene will have different selection properties.
2017-06-15 13:47:14 +02:00
9e0a253ea1 Cleanup: make Group Unlink outliner action use `BKE_libblock_delete() too.
Same as in rB2bd51474a44...
2017-06-15 13:06:31 +02:00
ddb8330571 Cleanup: remove useless call to BKE_screen_free() in screen deletion.
`BKE_libblock_free()` will call it itself.
2017-06-15 13:00:11 +02:00
ee5ed2ae26 Fix dangerous code when deleting Scene.
That one was probably not an actual issue, except maybe in some corner
cases (like deleting a linked scene also used by some other linked scene).

Again, better not try to do smart & complex freeing logic outside of
BKE_library area, let's keep spaghetti nitghmare in a single place!
2017-06-15 12:57:08 +02:00
830df9b33d Updates to manipulator API
While this is work-in-progress from custom-manipulators branch
its stable so adding into 2.8 so we don't get too much out of sync.

- ManipulatorGroupType's are moved out of the manipulator-map and are now
  global (like operators, panels etc) and added into spaces as needed.
  Without this all operators that might ever use a manipulator in the 3D
  view would be polling the viewport.
- Add optional get/set callbacks for non-RNA properties
  Needed so re-usable manipulators can control values that
  don't correspond to a single properly or need conversion.
- Fix divide by zero bug in arrow manipulator (when moving zero pixels).
2017-06-15 20:56:22 +10:00
2bd51474a4 Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what it is doing.
Previous code (same as what `BKE_libblock_free_us()` is doing when
usercount reach 0) was probably OK in that specific case, but still not
good idea, and potentially risky.
2017-06-15 12:49:40 +02:00
7853ebc204 Fix collada importer doing own handling of usercount/freeing.
Better use generic `BKE_libblock_free_us()`.
2017-06-15 12:44:15 +02:00
25c0666b90 Fix potentially dnagerous code in doversionning of brush.
Even though in that specific it was probably safe-ish, there is no
guarantee at this point Brush we want to remove are not used somewhere,
better take the slightly slower, much safer `BKE_libblock_delete()` path here.
2017-06-15 12:38:55 +02:00
7a80c34f52 Fix serious bug in 'curve-to-mesh' conversion code.
Eeeeeek!^2 Calling unconditionnaly ID freeing `BKE_libblock_free()` on a
datablock (ob->data, i.e. Curve) that may be used elsewhere...
Veryveryvery bad!
2017-06-15 12:34:12 +02:00
b488988ab1 Fix potential memory leak in Sequencer sound strip creation code. 2017-06-15 12:32:27 +02:00
Dalai Felinto
1a7099f3ec Fix T51463: Eevee motion blur not working (with AMD)
GLSL needs FragColor to be initialized. The default vec4 value seems to be
implementation dependent. Or it's a bug on Mesa/AMD.
2017-06-15 11:31:45 +02:00
826f3c715c Fix strict cflags compilation after recent const changes 2017-06-15 10:19:33 +02:00
35ec72bcb8 Merge branch 'master' into blender2.8 2017-06-15 10:17:51 +02:00
038b73bab1 Fix compilation error with strict cflags after recent const changes 2017-06-15 10:14:56 +02:00
692ce81d93 Further improvements of text editor for POV-Ray
*tryed "#" as preprocessor used in POV-Ray for language keywords best behaviour was to have it as a punctuation symbol
*moved "finish" to its proper category
*changed order of some POV-Ray ini files keywords to have them work better
*added a few keywords from latest pov version
*Fixed C-style closing of multiline comments (*/)

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D2707
2017-06-15 09:34:38 +02:00
a96030b3da PyAPI: Add toctree link on parent page of submodule 2017-06-15 01:41:28 -04:00
44fd84bcc3 PyAPI: Proper Solution to bpy.app 2017-06-15 00:54:41 -04:00
f2d7a28a09 Probes: Modify Add Menu and change defaults. 2017-06-15 00:57:16 +02:00
f5203e6cba Probe: Fix display of the Influence of grid probes. 2017-06-15 00:57:16 +02:00
634dbfa2ed Eevee: Fix grid probe updating when updating cube probe. 2017-06-15 00:57:16 +02:00
cac851a00e Eevee: Probes: Add data display for cubemaps. 2017-06-15 00:57:16 +02:00
810464e5f7 Eevee: Group octahedron map functions into one file. 2017-06-15 00:57:16 +02:00
246ee82a2f Eevee: Some probe update changes.
Dont render grids if cubemap count changes (because it does not depends on).
Recalc lighting if probe type change.
2017-06-15 00:55:45 +02:00
9c82203e82 Eevee: Probes: Change falloff of irradiance grid. 2017-06-15 00:55:45 +02:00
99ff1bb21a Probe: fix clip distances showing only for one probe. 2017-06-15 00:55:45 +02:00
0ca2f5affd Eevee: Irradiance grid: support for non-blocking update and multiple bounces. 2017-06-15 00:55:45 +02:00
26e710b1fd Eevee: Add Grid debug display. 2017-06-15 00:55:45 +02:00
4873ff005b Eevee: Fix probe diffuse computation. 2017-06-15 00:55:44 +02:00
49ba446f68 Eevee: Split irradiance functions to their own new file. 2017-06-15 00:55:44 +02:00
88602ea017 Probe: Fix probe panel 2017-06-15 00:53:41 +02:00
4a83f3e2a5 Eevee: Disable specular when rendering probes.
This prevents weird reflections and really strong indirect lighting.
2017-06-15 00:53:41 +02:00
fbd05d3b6a Probe: fix grid default resolution. 2017-06-15 00:53:41 +02:00
dccf46f18f Eevee: Add Irradiance Grid support
Early implementation. Slow and still has quality
3 ways of storing irradiance:
- Spherical Harmonics: Have problem with directionnal lighting.
- HL2 diffuse cube: Very low resolution but smooth transitions.
- Diffuse cube: High storage requirement.

Also include some name change.
2017-06-15 00:53:41 +02:00
8e5609665f Probe: Add grid probe parameters. 2017-06-15 00:53:41 +02:00
df7c609fda PYAPI: Fix mathutils doc structure 2017-06-14 16:47:43 -04:00
7439919ac0 Merge branch 'master' into blender2.8 2017-06-14 22:39:33 +02:00
eeb9e5316a Make whole ID copying code use const source pointer.
Noisy change, but safe, and better do it sooner than later if we are to
rework copying code. Also, previous commit shows this *is* useful to
catch some mistakes.
2017-06-14 22:38:11 +02:00
31437b0d4d Fix three obvious mistakes in brush/mask/cachefile ID copying.
They were modifying some source ID prop, instead of copied version of
it... Found while making all source of ID copying const. ;)
2017-06-14 22:38:11 +02:00
5e485e34e8 PYAPI: fix documention structure of bpy.app 2017-06-14 16:19:05 -04:00
9a0673a5d4 Fix missing toctree for bmesh submodules 2017-06-14 15:22:26 -04:00
e1983adef4 PYAPI: Fix freestyle submodules without tocrees
Fixes 6 compile warnings
Follow up on rBf87ca5f1c314f67353b6111d3647aef159dc07c6
2017-06-14 14:42:44 -04:00
dbca1afefa Add an option to free scene without doing id-counters
This is similar to some other datablocks. Mainly applies to collections,
so freeing scene does not involve changing any non-directly owned data.

There are two main usecases foreseen for the future:

- Less CPU ticks on bmain free, where everything is freed anyway and
  there is no need to preserve id counters.

- Easier freeing of temporary data, including data which is used by
  depsgraph's copy-on-write mechanism.

Neither of those are currently implemented, but will be shortly.
2017-06-14 16:59:52 +02:00
c59abb4c9a Implement hair in eevee
New implementation of hair for Eevee.

Note: A hard coded "transmission" property is being used. This should
eventually be exposed to the UI, possibly in the form of SSS
properties.
2017-06-14 14:04:36 +02:00
0d9611718d Temporarily disable material preview (T51796 workaround)
This stops the memory breakage caused by the material preview jobs,
to enable the new hair drawing implementation.

(This should be reverted once T51796 is actually fixed!)
2017-06-14 14:03:58 +02:00
28af03c1c2 Merge branch 'master' into blender2.8 2017-06-14 12:02:58 +02:00
481cf2982b Depsgraph: Cleanup, indentation 2017-06-14 12:01:52 +02:00
6656af2d11 Merge branch 'master' into blender2.8 2017-06-14 11:17:13 +02:00
20e5052a72 Remove unused bmain argument from BKE_libblock_free_data 2017-06-14 11:16:34 +02:00
48cd25a11a Merge branch 'master' into blender2.8 2017-06-14 10:54:58 +02:00
97f9f90986 Cleanup: Indentation got broken in previous commit 2017-06-14 10:54:30 +02:00
edad3076a9 Merge branch 'master' into blender2.8 2017-06-14 10:48:20 +02:00
1e6ad49dca Add utility function to free memory used by a datablock
This function is similar to BKE_libblock_free but does no DEG
tagging or any extra things, just operates on memory.
2017-06-14 10:45:20 +02:00
07c7bbef0d Merge branch 'master' into blender2.8 2017-06-14 10:11:18 +02:00
bbd0d43417 Depsgraph: Remove unused ID node removal 2017-06-14 10:10:52 +02:00
64aa0cff89 Cycles: Fix typo in comment 2017-06-14 09:54:07 +02:00
26efc7bbd1 Merge branch 'master' into blender2.8 2017-06-14 17:17:00 +10:00
2462320210 Fix buffer read error w/ 2 pass select queries
Also don't do second pass when the first has no hits.
2017-06-14 17:10:24 +10:00
Julian Eisel
a394d68177 Fix possible heap use-after-free in workspace lib-linking
Caused by one of the recent commits during workspace review.
2017-06-14 00:09:37 +02:00
Julian Eisel
c9de10a632 Fix compiling blenderplayer (tm) 2017-06-13 23:40:31 +02:00
Julian Eisel
0095f4f834 Fix T51794: Crash on hair file when opening with no UI
Just a workaround for now.
2017-06-13 23:37:37 +02:00
be4cf933ab Merge branch 'master' into blender2.8 2017-06-13 17:45:36 +02:00
f02e04f133 Add utility function to get size of given ID type
Optionally it'll also give name used for memory allocation.
2017-06-13 17:42:31 +02:00
Dalai Felinto
6ea6c51670 Better Fix for T51777: Separating objects by selected vertices
This reverts commit 47b9d0d040. And
implement a fix that doesn't require Depsgraph refresh.
2017-06-13 16:31:42 +02:00
7cfa6094ab Merge branch 'master' into blender2.8 2017-06-13 15:11:58 +02:00
6becdf5d00 Depsgraph: Pass function bindings by const reference
Avoids using copy-constructor invoked every time we pass function
to the builder functions.

Should lower number of CPU ticks spent during DEG construction.
2017-06-13 15:10:29 +02:00
4577bda634 Merge branch 'master' into blender2.8 2017-06-13 14:16:43 +02:00
90bc882068 Depsgraph: Remove root node concept
Was rather weird and only used for time source. It is simpler to make depsgraph
to keep track of time source directly.

No need to introduce extra entitites without actual need.
2017-06-13 14:13:55 +02:00
Hristo Gueorguiev
6cfa3ecd4d Fix T51791: Point Density doesn't work on GPU 2017-06-13 13:50:27 +02:00
b0b83c0db4 Draw manager: Fix initialization of static struct
It's first member is a multi-dimensional array, so proper way to initialize that
is to use multiple levels of braces.
2017-06-13 12:20:20 +02:00
4c6cb33764 Draw manager: Don't check matrix to be non-NULL
It isn't a pointer, so the check was confusing and totally redundant.
2017-06-13 12:17:55 +02:00
56ad2f0f1a Woarkspace: Remove residue of hidden type
There is no reason to be special for workspace and go against other design
decision in Blender. If something like this is going to become a common
practice in Blender it should be well thought and well tested, including
tests of all supported compilers and configurations.

This feature was relying on type re-definition, which is not only confusing
but also available in C11 only.
2017-06-13 12:02:08 +02:00
40c04dd649 Cycles: Cleanup, indentation 2017-06-13 10:28:38 +02:00
0aa5431998 Cycles: Fix compilation error of OpenCL mega kernel
Was some mismatch in address space. Seems to be caused by recent additions.

Additionally, moved decoupled ray marching functions under ifdef, so they
don't try to use malloc() functions.

Thanks Mai for testing the patch!
2017-06-13 10:26:45 +02:00
eaadfdbdc0 CMake: add missing includes 2017-06-13 14:51:15 +10:00
Dalai Felinto
47b9d0d040 Fix T51777: Separating objects by selected vertices in Eevee causes crash
I considered just copying the evaluated data from the LayerCollection.
However we need to run the evaluation so Depsgraph can handle overrides.

I will double-check with Sergey Sharybin.
2017-06-12 18:35:39 +02:00
Dalai Felinto
193a1df8fa Renaming: *_Iterator_begin/next > *_iterator_begin/next 2017-06-12 18:19:54 +02:00
2270ca9023 Merge branch 'master' into blender2.8 2017-06-12 16:55:57 +02:00
85fafccb4c Depsgraph: Remove residue from partial updates support 2017-06-12 16:55:04 +02:00
Dalai Felinto
109447d008 Draw Manager: Fix memory issues when copying scene 2017-06-12 16:12:33 +02:00
Dalai Felinto
8ca497b911 Depsgraph: Traversing should be consistent for nodes and relationship
We need to traverse the same exact objects for both nodes and relationship
builder. We were using FOREACH_SCENE_OBJECT for relationships, which
would lead to plenty of warnings in multiple situations.

In the future we will need to change this to build the depsgraph
relations and nodes to one single render_layer.

Fix T51780: If an object is in two collections and I do a full copy of
scene things go bad
2017-06-12 16:08:57 +02:00
0f4f4d8754 Merge branch 'master' into blender2.8 2017-06-12 15:12:36 +02:00
d8957e4cce Depsgraph: Use depsgraph from handle rather than from scene
This way the code is more decoupled from the way where depsgraph is stored.
2017-06-12 14:45:43 +02:00
1ba6ef25b6 Depsgraph: Add utility function to get depsgraph from node handle
The idea is to use this function for modifiers' updateDepsgraph functions
instead of doing direct scene->depsgraph access.
2017-06-12 14:41:46 +02:00
987ec1d030 Depsgraph: Remove outdated comment 2017-06-12 14:25:05 +02:00
f52dc2f371 Rename probe to light-probe
Probe is a real general term, the new name is used often in docs online.
2017-06-12 21:34:55 +10:00
12bd960df9 Fix crash drawing non-mesh geometry 2017-06-12 14:43:19 +10:00
00c4f49a6d Cleanup: indentation, long lines 2017-06-12 13:38:21 +10:00
5ccaef6d67 Fix T51737: Material properties error
D2706 by @knox
2017-06-12 12:55:47 +10:00
1bd6ed7128 Correct gtest EXPECT use 2017-06-12 10:25:18 +10:00
Hristo Gueorguiev
04530c9383 Cycles: adjust supported driver version for AMD GPUs
On Windows 17.Q1 and 17.Q2 return driver version 2236.10.
2017-06-11 23:17:46 +02:00
Julian Eisel
09eb11363e Use two decimal places for UI scale User Preference option 2017-06-11 22:59:54 +02:00
eb1cde5a81 GTest: initial kdopbvh test
Currently only find-nearest, ray-casting needs to be added.
2017-06-11 19:10:33 +10:00
dfd8b38e0c BLI_kdopbvh: add ifdef's for debugging info
Allow to quickly enable print & tree verify.
2017-06-11 18:56:56 +10:00
558bea2252 Cycles Denoising: Add more failsafes for invalid pixels
Now, when there is no usable neighboring pixel for denoising, the noisy value
is preserved instead of producing a NaN.
Also, negative results are clamped to zero.

Note that there are just workarounds that don't fix the underlying problems,
but these issues are very rare and I'm not sure if it's even possible to fix
the underlying problems without introducing a significant slowdown or quality
decrease in other situations.
Because of that and since 2.79 is happening very soon, I just went for these
workarounds for now.
2017-06-11 01:51:39 +02:00
Julian Eisel
0dd6e5bfee UI: Replace placeholder icons in object-add menu
Replaces the placeholder 'emtpy' icons of "Force Field" and "Group
Instance" entries in object-add menu with proper new ones.

Icons by @zlsa, thanks a lot!

Maniphest task T51291.
2017-06-10 16:47:21 +02:00
c2f6ca313e Draw Cache: fix probe vbo size 2017-06-10 13:57:39 +02:00
e097fc4aa6 Cycles: Selectively include denoising in kernel 2017-06-10 04:45:13 -04:00
eb293f59f2 Cycles: Pass all buffers to each kernel call for OpenCL
Technically not passing all buffers used by a kernel is undefined
behavior. We haven't had any issues with this so far on AMD or
Nvidia, but it's known to be a problem with Intel and we received
a report from AMD that this is a problem on newer hardware, so we
need to make this change at some point.

Unfortunately there a cost to being correct, about 5% for the
benchmark scenes. For low sample counts it's even worse, I've
seen up to 50% slowdown. For the latter case I think adjusting
tile updating logic can help, but not sure what that would look
like yet (it would be just a few lines change however).
2017-06-10 04:08:49 -04:00
6238214159 Cycles: Faster split branched path tracing by sharing samples with inactive threads
Unlike regular path tracing, branched path tracing is usually used with lower
sample counts, at least for primary rays. This means that are less samples for
the GPU to work on in parallel and rendering is slower. As there is less work
overall there is also more inactive threads during rendering with BPT. This
patch makes use of those inactive rays to render branched samples in parallel
with other samples.

Each thread that is preparing for a branched sample will attempt to find an
inactive thread and if one is found the state for the sample is copied to that
thread. Potentially, if there are enough inactive threads, 100s of branched
samples could be generated from the same originating thread and ran in
parallel giving large speed ups.

Gives 70% faster render for pavillion midday scene. 20-60% faster on BMW
with car paint replaced with SSS/volumes.
2017-06-10 04:08:49 -04:00
32299d32e7 Cycles: Modify path_radiance_accum_sample to use atomics for split kernel
Samples ran in parallel need a safe way to accumulate their results
with the results of other threads.
2017-06-10 04:08:02 -04:00
6995b50e41 Cycles: Add function to dequeue a ray 2017-06-10 03:51:18 -04:00
4360e8ce13 Cycles: Add atomic decrement functions to util_atomic.h 2017-06-10 03:51:18 -04:00
ea846a4dfc Cycles: Add kernel to enqueue inactive rays
The queue will be used to make reuse of inactive threads to keep
the GPU more busy.
2017-06-10 03:51:18 -04:00
Hristo Gueorguiev
1f0998baa7 Cycles: Blacklist unsupported OpenCL devices
Due to various driver issues with AMD GCN 1 cards we can no longer support
these GPUs. This patch makes them unavailable to select for Cycles rendering.

GCN cards 2 and higher are still supported. Please use the most recent
drivers available to ensure proper functionality.

See here for a list to check which GPUs are supported:
https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units
2017-06-10 03:51:18 -04:00
a5b3df7545 Rename node_widgets -> node_manipulators 2017-06-10 10:59:19 +10:00
054a6a06f2 Missed last commit 2017-06-10 10:59:16 +10:00
11d90f0f3b Manipulator Update/Refactor
Sync with custom-manipulators branch

- Use identifiers for properties.
- Property array index access.
- Remove operator from manipulators
  (wasn't used and will likely add in a different way).
2017-06-10 10:42:35 +10:00
0a5e9e2f56 Probe: Small UI improvments
-Better falloff default.
-Add clip distance visualisation.
-Reformat UI and add a display panel.
2017-06-10 00:36:33 +02:00
b35f562e18 Eevee:Uuse compressed format for probes.
One 1024px² octahedral probe (according to the GPU mem stats):
- RGBA16F = 17Mb
- RGB_11_11_10 = 4Mb
For the time being I prefer to maximize the number of probe possible in the scene for users to test.
This is obviously a temporary solution and the final choice of cubemap format should be exposed to the user.
2017-06-09 23:51:48 +02:00
97a77b43be Eevee: Probe: fix roughness bug and optimize probe evaluation. 2017-06-09 23:24:51 +02:00
a17bb772a0 Probe: Add object mode volume visualisation 2017-06-09 23:21:55 +02:00
85990343f6 Probe: Remove Bounding Box parameter.
After using it for like 30 sec, the min max bound box is absolutely not practical. Reverting into using a unit cube with object transform.
This also simplify the code.
In the future of center probes will be implemented using another object matrix (via an object pointer).
2017-06-09 23:21:23 +02:00
c73206acc5 Cycles: Fix denoising passes being written when they're not actually generated 2017-06-09 23:02:56 +02:00
0a898e2405 Cleanup Cycles Denoising platform-specific defines 2017-06-09 22:38:16 +02:00
7dc51f87ed Cycles Denoising: Speedup reconstruction by skipping near-zero weights 2017-06-09 22:38:16 +02:00
20572497a4 Eevee: Add parallax correction to probe reflections 2017-06-09 22:30:49 +02:00
f0bbb67e8a UI: Fix some small ui inconsistencies
- Use "..." to indicate non immediate action.
- First letter of words in labels should be capitalized.
2017-06-09 15:25:17 -04:00
Julian Eisel
da30509725 Fix failing render-layer tests after workpsace commit 2017-06-09 19:30:14 +02:00
ebb2c1511b Fix missing updates when changing probe's clipping
Probes were completely out of depsgraph, so tagging them could not work at all.

For now using some placeholder operations just to ensure order of updates.
2017-06-09 18:06:10 +02:00
Dalai Felinto
dadb99074c Fix crash when using sculpt dynamic smooth 2017-06-09 17:32:51 +02:00
Julian Eisel
2bb004e03d Fix crash when deleting active workspace render-layer
Also fixes some failing unit-tests for render-layers.
2017-06-09 17:17:28 +02:00
Dalai Felinto
f35df9a25a Draw Manager: stop using stack memory!
We still do it a few times, but that helps already. Related to T51718.

Note that it also reinforces the idea that any geometry datablock will
have a generated copy-on-write Mesh provided by Depsgraph.
2017-06-09 16:39:36 +02:00
Dalai Felinto
35f8a02496 Implement a new util function to get reference of mesh tex space 2017-06-09 16:39:36 +02:00
e0bc5b533c Cleanup: get rid of some now unused animdata ID management custom functions.
That's the kind of commit that are nice to do - getting rid of
half-working custom pieces of code, now that we have generic tools
to do same thing. ;)
2017-06-09 16:30:59 +02:00
f097e73a2a Fix crash when making local object+obdata with linked armature.
Reported by Andy Goralczyk (@eyecandy) over IRC, thanks!

Simply nuke all that poor broken custom one-by-one handling in
object_relations.c code, and use highly complex but powerful and
well-tested BKE_library_make_local() in all cases of MakeLocal!

ID management, especially related to linking, is very hairy matters,
better to have as few as possible core functions managing all the dirty
details. ;)
2017-06-09 16:30:59 +02:00
ccc625ce23 Eevee: Fix crash when saving file / opengl render. 2017-06-09 15:01:32 +02:00
Dalai Felinto
ee93bc806b Eevee DoF: Use more reasonable UI range for anamorphic bokeh
Regular camera lens have a ratio of 1.0. The anamorphic bokeh can be
used freely as an artistic decision, but it's nice to clamp it to 2.0,
to match real cameras.

That end up giving a reference for artistis playing with the
parameters unaware of the more realistic limits.
2017-06-09 11:56:40 +02:00
Dalai Felinto
461ea375ad Fix T51720: Depth of Field Bug - Black Screen 2017-06-09 11:56:22 +02:00
bb773acd5f Merge branch 'master' into blender2.8 2017-06-09 19:40:47 +10:00
d7f33668d6 Math Lib: Add mat3_from_axis_conversion_single
Single axis version of mat3_from_axis_conversion,
when the second axis isn't important (orienting an arrow for eg).
2017-06-09 19:31:27 +10:00
d583af0026 Fix T51756: Fix crash when transforming vertices in edit mode
The issue was caused by under-allocation of UV islands calculation.
2017-06-09 10:46:00 +02:00
16ecd0b79e Fix T51750: Group selection broken
Proper way, no base is involved.
2017-06-09 10:04:12 +02:00
ab4b7b5368 Fix T51648: Inconsistent edge collapse point depending on orientation
Edge collapse was using bounding box center as the point to collapse to.
When collapsing multiple adjacent edges together, this caused
inconsistencies in placement of the collapsed point, depending on the
orientation of the edges in relation to the space axis.

This makes edge collapse use the mean point instead.
2017-06-09 10:03:46 +02:00
a46a168705 install_depsh: update OpenCollada to 1.6.51, and OIIO to 1.7.15 2017-06-09 09:44:40 +02:00
Dalai Felinto
3a60b4511e Revert "Fix T51750: Group selection broken"
This reverts commit 484e3527d1.
2017-06-09 09:42:08 +02:00
58de2164c9 Fix for fix for bplayer (c) :/ 2017-06-09 09:23:54 +02:00
03a5da0a63 Fix bplayer building (c) 2017-06-09 09:13:54 +02:00
705c43be0b Cycles Denoising: Merge outlier heuristic and confidence interval test
The previous outlier heuristic only checked whether the pixel is more than
twice as bright compared to the 75% quantile of the 5x5 neighborhood.
While this detected fireflies robustly, it also incorrectly marked a lot of
legitimate small highlights as outliers and filtered them away.

This commit adds an additional condition for marking a pixel as a firefly:
In addition to being above the reference brightness, the lower end of the
3-sigma confidence interval has to be below it.
Since the lower end approximates how low the true value of the pixel might be,
this test separates pixels that are supposed to be very bright from pixels that
are very bright due to random fireflies.

Also, since there is now a reliable outlier filter as a preprocessing step,
the additional confidence interval test in the reconstruction kernel is no
longer needed.
2017-06-09 03:46:11 +02:00
3b9e8b385c Fix compilation issue 2017-06-09 01:28:43 +02:00
67913c603c Probe: Add influence display and rework UI. 2017-06-09 01:15:17 +02:00
e45ebec335 Probes: Add more parameters.
Add Min Max for box, and distance for sphere falloff.
Same for parallax.
Add clip distances.
2017-06-09 01:15:17 +02:00
974c0cc7b6 Eevee: First commit of Probe support. 2017-06-09 01:15:17 +02:00
cadb950490 Draw Manager: Add request redraw method.
This is extremly hacky and against notifier design. This must be revisited later.
We might want to mimic external renderer way of requesting redraw.
2017-06-09 01:15:17 +02:00
1ee5d08c95 Draw Manager: Add support for temporary matrix override.
This allow to specify custom matrices for certain specific passes.
2017-06-09 01:15:17 +02:00
4abb3c1bc4 Draw Manager, GPUTexture: Add support for binding individual cubeface to framebuffer. 2017-06-09 01:15:17 +02:00
c1009af596 Probe: Add panel and "Add-menu" items.
Also revisits defaults.
2017-06-09 01:15:17 +02:00
4df449edd5 Probe: Add initial visualisation 2017-06-09 01:15:17 +02:00
f6898f9ae5 Probe: fix some missing bits / errors in RNA ... 2017-06-09 01:15:17 +02:00
618aef1e58 Eevee: Fix normal orientation on default shader. 2017-06-09 01:15:17 +02:00
73949ffbf3 DNA_ID Fix comment 2017-06-09 01:15:17 +02:00
cc31d7bb49 Probe: Add new object datablock
We went for a new datablock because blending probe functionality with empties was going to be messy.
2017-06-09 01:15:17 +02:00
346619159a Merge branch 'master' into blender2.8 2017-06-09 07:21:43 +10:00
8a757bf34a RNA: remove static strings from registration
* Static strings aren't needed anymore, use stack memory.
* Fix obscure leak on failed macro registration.
* Use prefix for wrappers exported from bpy module.
2017-06-09 07:20:25 +10:00
46c073e4ac Cleanup: cmake indentation, missing include 2017-06-09 06:45:21 +10:00
Dalai Felinto
836c3c14cc Remove unused lay value from Dupli object evaluation context 2017-06-08 19:28:54 +02:00
Dalai Felinto
c5daddbef3 Revert "Fix some groups not showing in the viewport"
This reverts commit c19fedf636.
2017-06-08 19:03:42 +02:00
Dalai Felinto
c19fedf636 Fix some groups not showing in the viewport
If the group was freshly created in 2.8 from a new object, this will prevent the object to be shown.
2017-06-08 19:03:38 +02:00
Dalai Felinto
484e3527d1 Fix T51750: Group selection broken
This was introduced in 23c93873f4.

This could be moved to deg_flush_base_flags_and_settings but since we
only need this for duplis I think it's fine to be handled separately.
2017-06-08 19:00:30 +02:00
9bcc44d505 Depsgraph: Avoid over-documentation
The comment adds zero information.
2017-06-08 16:12:04 +02:00
2335bfeaa0 Avoid allocation of evaluation context for iterator
Use stack-allocated context when possible.
2017-06-08 16:11:14 +02:00
c71e160c02 Fix T51733: 3d print toolbox checks report false positives.
Colinear vertices in a same face would not be handled correctly.
2017-06-08 14:05:36 +02:00
6a546fc73e Cycles: Don't leave multiple spaces in the device name 2017-06-08 12:15:24 +02:00
45d3e22204 Cycles: Display optional board name in system info 2017-06-08 12:10:15 +02:00
78c0f09d4f Cycles: Cleanup, indentation 2017-06-08 12:03:08 +02:00
2f9cfda459 Fix compilation error after recent depsgraph cleanup 2017-06-08 10:59:33 +02:00
23c93873f4 Remove selection color from the base
Use indirect access to it via object.

It was already flushing from base to object, now we can avoid such flushing.

Still weird to have selection color filled in by dependency graph, but now
there is no synchronization going on at least.
2017-06-08 10:46:45 +02:00
d675415eef Replace all old DAG calls with direct calls to new DEG and remove BKE_depsgraph.h
This removes BKE_depsgraph.h and depsgraph.c
2017-06-08 10:17:04 +02:00
ff6b249046 Simplify Array modifier 'relative offset' handling.
Was looping three times over the source mesh's vertices to get min/max
along all three axes... Nothing critical, but still!
2017-06-08 09:17:08 +02:00
7f480352ca WM: move manipulator library into editors
As with operators, the window-manager has the API for defining,
the editor can implement and register its own manipulators.

This exposes wmManipulator, keeping it opaque isn't
practical if editors and Python are to implement their own.
2017-06-08 07:42:17 +10:00
bfa5efeebe Fix MSVC compile (T51740)
Gawain doesn't include Blender's cross-platform "inline" definition. This change slipped in as part of D2697.
2017-06-07 16:28:24 -04:00
179bb97740 Gawain: stricter lookup of builtin uniforms
UNIFORM_NONE should never match a valid uniform (builtin or custom).

The logic for UNIFORM_CUSTOM was just wrong, since it returned the first custom uniform. This function should only accept builtin (non-custom) uniforms.
2017-06-07 16:20:37 -04:00
bb3e669d06 Gawain: faster lookup shader attribs by name
Quick hash rejection instead of string comparison. Uniform lookups already work this way. I don't expect a major overall speedup since attributes are looked up less frequently than uniforms.
2017-06-07 16:20:37 -04:00
a5242d08fb cleanup floating point literals 2017-06-07 16:20:37 -04:00
575db256db WM: add wmManipulatorType, from wmManipulator
Having the type in mixed in with each instance
made it hard to expose types to RNA/Python.
2017-06-08 05:30:21 +10:00
d25ab3fcc4 Fix: GP Clone brush was not correcting color references for pasted strokes either 2017-06-08 03:23:31 +12:00
2bd49785f9 Fix: Pasting GP strokes files between files (or when the original colors were deleted) would crash
The problem was that the strokes in the copy-paste buffer could be keeping
dangling pointers to colors that were already freed. Therefore, this commit
makes it so that when copying the strokes, we now make copies of the colors
and put them in a hashtable beside the stroke buffer. This is convenient,
as it saves us having to look up what colours need to be copied over each
time when pasting.
2017-06-08 03:23:30 +12:00
7667040dd0 GP Copy/Paste Fix: Paste button doesn't update after copying strokes using Ctrl-C 2017-06-08 03:23:29 +12:00
89d4164f54 GPencil Copy/Paste Fix: Copying/Pasting strokes between datablocks would crash
The problem was that newly pasted strokes were still using colours from
the original datablock. As a result, you'd either get an immediate crash,
or if you managed to save the file before it crashed, each stroke would get
reloaded with a dummy colour.

This commit fixes makes it possible to copy/paste strokes between datablocks
again. However, there are still problems when trying to paste across file
boundaries (i.e. copy strokes in one file, paste in another), which the next
commit will address.
2017-06-08 03:23:29 +12:00
8ff1bce40f Manipulators: lamp, camera & force-field
From custom-manipulators branch.
These may be improved they work on a basic level.
2017-06-07 23:56:24 +10:00
ed84388e7d Bevel Op (internal and API) now returns new edges and verts as well as
faces.

This was requested by script writers. Especially needed if beveling
wire edges with vertex_only.
Should be backward compatible as just adds two new keys to returned
dict in python ('edges' and 'verts').
2017-06-07 08:53:10 -04:00
cff176df37 Minor manipulator API changes
Sync up with custom-manipulator branch
2017-06-07 22:13:31 +10:00
3b6facb3d2 Merge branch 'master' into blender2.8 2017-06-07 14:09:53 +02:00
a3bb309275 Depsgraph: Remove modifiers operation code
Was internally a no-op operation, which only caused extra work
to be done during depsgrpah traversal and evaluation, without
making any measurable improvement.
2017-06-07 14:08:11 +02:00
b31e84a4b3 Depsgraph: Remove unused operation codes 2017-06-07 12:53:38 +02:00
8be55193c9 Depsgraph: Remove dead/unused operation codes 2017-06-07 12:47:19 +02:00
00b009ca74 Merge branch 'master' into blender2.8 2017-06-07 12:18:07 +02:00
5489b40a5a Report OpenSubdiv version Blender is compiled against 2017-06-07 12:16:48 +02:00
3fe73c72d6 Collada: Add search path which is used default by it's SCons build system 2017-06-07 11:38:35 +02:00
Dalai Felinto
6fee241db5 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-07 11:38:03 +02:00
Dalai Felinto
29ace10f7e gcc5 has issues with Wconversion
This leads to a crash in 2.8, but commiting here.
Patch by Campbell Barton.
2017-06-07 11:37:28 +02:00
ce18956d9b Optimization of tangent calculation
Avoid doing string comparison when we already know layer is
to be added to bitfield.
2017-06-07 11:25:05 +02:00
e17a90074f WM: remove unused return values 2017-06-07 15:49:50 +10:00
Dalai Felinto
7f01329a84 Small cleanup: Use ELEM and wrong identation 2017-06-06 18:57:47 +02:00
Dalai Felinto
6d2aabc1d0 CMake: Update clay engine message 2017-06-06 18:57:47 +02:00
46f659ba2d Eevee: Fix shader compilation issue. 2017-06-06 18:27:59 +02:00
81615ddf86 Cycles: Fix infinite update when using duplis
The issue was caused by usage of address of dupli-object (which will vary
from iteration process to iteration process) as something denoting whether
we've got the data synchronized to Cycles or not.

For now solved by using address of original object (the one DupliObject
points to) as a pointer for the map.

Need to do more thoughts about this.
2017-06-06 16:30:14 +02:00
Dalai Felinto
cb97b07e23 Draw Manager: Prevent misuse of static draw context
This is supposed to help catch bugs if referrencing stack data out of
the draw loop context.

No change is suppose to happen for users (specially because the changes
here happens mostly on debug).

It includes a change in the logic for render loop, to make sure DST is
not accessed before we enter it - contribution by Campbell Barton.
2017-06-06 16:20:39 +02:00
ae6bfe9c19 Depsgraph: Cleanup, unused includes 2017-06-06 14:19:25 +02:00
e1e41e4447 Cycles: Support rendering objects from dupli-list
This commit extends the work from Dalai made around scene iterators to
support iterating into objects from dupli-lists.

Changes can be summarized as:

- Depsgraph iterator will hold pointer to an object which created current
  duplilist. It is available via `dupli_parent` field of the iterator.
  It is only set when duplilist is not NULL and guaranteed to be NULL
  for all other cases.

- Introduced new depsgraph.duplis collection which gives a more extended
  information about depsgraph iterator.  It is basically a collection on top
  of DEGObjectsIteratorData.

  It is used to provide access to such data as persistent ID, generated space
  and so on.

Things which still needs to be done/finished/clarified:

- Need to introduce some sort of `is_instance` boolean property which will
  indicate Python and C++ RNA that we are inside of dupli-list.

- Introduce a way to skip dupli-list for particular objects.

  So, for example, if we are culling object due to distance we can skip all
  objects it was duplicating.

- Introduce a way to skip particular duplicators.

  So we can skip iterating into particle system.

- Introduce some cleaner API for C side of operators to access all data such as
  persistent ID and friends.

  This way we wouldn't need de-reference iterator and could keep access to such
  data really abstract. Who knows how we'll be storing internal state of the
  operator in the future.

While there is still stuff to do, current state works and moves us in the proper
direction.
2017-06-06 14:17:32 +02:00
d220e54f28 WM: manipulator callback arg order
Use same arg order for C & RNA
2017-06-06 22:16:12 +10:00
Dalai Felinto
d267d76540 Force crash on depsgraph iterator wrong access.
Related to T51718, so it crashes even when no fancy ASAN flags are used.
Patch suggestion by Campbell Barton.
2017-06-06 12:48:12 +02:00
47fd882e79 Merge branch 'master' into blender2.8 2017-06-06 12:17:07 +02:00
58a434b372 Depsgraph: Only use extern "C" when really needed 2017-06-06 12:14:39 +02:00
1846627ae0 BLI: Use C++ guards for stack header
This is handy to have C++ guards for BLI functions so they
can be easily re-used in C++ code. This matches other headers
from this library as well.
2017-06-06 12:13:45 +02:00
Dalai Felinto
a418e269c8 Draw manager: visibility of objects centers to mimic old 2.7x behaviour
We only show object center if object is selected, active or if viewport
has the "All Object Origins" options.

The viewport display options can migrate to renderlayer options.
However, we can mimic 2.7x as a compromise while the final design is
finalized.
2017-06-06 12:00:35 +02:00
28e44da860 Scene object iterator: Replace recursion with loop
This way we are not afraid of recursion being too deep.

That could have happened when having two collections which
are sharing same list of 1000s of objects.
2017-06-06 11:22:13 +02:00
4e1257f2d8 Make particle size follow world space instead of screen space 2017-06-06 09:57:18 +02:00
443904f1f4 WM: functions for assigning all manipulator callbacks
- Move callbacks into type struct.
- Rename render_3d_intersection -> draw_select.
- Add header for function signatures (needed for types and api headers).
- Add WM_manipulatormaptype_find
2017-06-06 17:09:01 +10:00
2ebde4c82b Eevee: Optimize scene with a large number of objects.
Using a GHash to store the shgroup of every Material. This way we do not duplicates the DRWShadingGroups allocations on every object.
2017-06-05 22:05:37 +02:00
6d4f084677 WM: pass manipulator-map when creating wmManipulatorGroup
Also store parent-pointer in wmManipulatorGroup's,
since its not always possible to access the parent pointer.
2017-06-06 03:34:09 +10:00
e83001b782 Merge branch 'master' into blender2.8 2017-06-05 18:11:59 +10:00
cb4f7594a0 WM: add WM_manipulatorgrouptype_append_ptr
Needed for PyAPI registration.
2017-06-05 18:10:52 +10:00
0d428c674a WM: de-duplicate operator append code
WM_operatortype_append(_ptr) functions had diverged.
2017-06-05 17:57:57 +10:00
81d7ff8476 PyAPI: is_staticmethod used for classmethods's too
Add note to investigate this, don't change so close to release.
2017-06-05 16:09:39 +10:00
bd8377cb5a PyAPI: correct exception, expect 'staticmethod' 2017-06-05 15:31:05 +10:00
4ee9016e62 DwM: skip background-set objects w/ selection 2017-06-05 15:02:47 +10:00
7bff00b522 Fix alembic tests not running with debug build on windows 2017-06-04 17:05:59 -06:00
c838dd9de6 Clay Engine: Improve sampling of SSAO
Replace completly random noise by Blue noisen, giving a better aspect.
Also randomize the distance in the sample direction to cover the whole distance even with 1 sample. Using another blue noise for this.
Replace spiral samples (that had tendency to align if the number of samples was near the chosen constant) with Hammersley samples that have good coverage even for low number of samples.
Use a UBO instead of Texture (a bit less latency) making things a tiny bit faster.
Move the noise data to the SceneLayerData, because each render layer can have a different sample count.
2017-06-04 23:11:48 +02:00
288b54b5a7 Eevee: Modify Blue Noise. 2017-06-04 21:45:41 +02:00
819b8adb94 Eevee: Move Spherical Harmonics to a new Probe UBO.
Keep data packing tight to prevent use of padding floats
2017-06-04 16:50:22 +02:00
28b597b6df Eevee: Material code refactor.
Separate material handling inside another file.
Make use of enums to identify shader variations.
Group all 64*64 LUTs into one array texture.
Only update world probe if world changes.
2017-06-04 12:12:58 +02:00
8d1e6d7833 World: Add temporary update flag. 2017-06-04 12:08:34 +02:00
556942ec07 Fix T51587: Blender fails to interpret a specific layer in OpenEXR multilayer file 2017-06-04 00:58:38 +02:00
3fa2409002 Eevee: Fix compilation error 2017-06-03 01:43:25 +02:00
2851e91db4 Eevee: Cleanup. Group data functions into one file. 2017-06-03 00:54:01 +02:00
433bb91a37 Eevee: fix bad eye vector and get rid of two uniform 2017-06-03 00:54:01 +02:00
bc984fd09b Eevee: Reduce shadow map precision.
Since we only store linear distance now we don't need so much bytes per pixels.
2017-06-03 00:54:01 +02:00
403c6b1b8d Eevee: fix shadows artifact by clearing to max depth 2017-06-03 00:54:01 +02:00
d385ad3ce8 Eevee: fix light update when a shadow caster is deleted 2017-06-03 00:54:01 +02:00
0d52f8daea Eevee: Polishing of Exponential Shadow mapping
Added exponent parameter to tweak light bleeding.
Added depth bias to the shadow test.
Added better blurring using 32 samples.
2017-06-03 00:54:01 +02:00
4bd2de2030 UI: Change shadow map bias tooltip 2017-06-03 00:54:01 +02:00
e97085778b Eevee: Update Light data panel 2017-06-03 00:54:01 +02:00
04992a6ffc Object Mode Engine: Fix spot cone shader. 2017-06-03 00:54:01 +02:00
nBurn
420d4a70b8 PyAPI: Cleanup "Python API Overview" doc
Reword to clean up some odd grammar (mostly dangling modifiers) and
improve readability.

Differential Revision: https://developer.blender.org/D2699
2017-06-02 17:22:44 -04:00
68e5c082b8 Fix for crash/error drawing duplis
Drawing object centers used stack memory,
we don't want to draw these anyway so add check.
2017-06-03 02:21:10 +10:00
f6b9b452d8 Cleanup: Trailign whitespace 2017-06-02 16:08:53 +02:00
Dalai Felinto
8ff405ebd4 Fix logic for bitwise flags in bases during deg iterator
Spotted/reported by Sergey Sharybin.
2017-06-02 14:30:45 +02:00
Dalai Felinto
c5dccc9734 Fixup for 824bf261f7 so Cycles does not show dupli
Cycles is using rna_depsgraph, not rna_scene. Duplis are still not working there
but now at least it shows it was showing before the commit.

To show duplis in Cycles do:

-       data->flag = DEG_OBJECT_ITER_FLAG_SET;
+       data->flag = DEG_OBJECT_ITER_FLAG_ALL;
2017-06-02 13:05:15 +02:00
863f0434ec Fix T51691: Shear cursor input scales w/ zoom
Use relative value from cursor movement.
2017-06-02 20:40:41 +10:00
Dalai Felinto
9dddd73ee3 Silence annoying rna warnings from Eevee 2017-06-02 11:47:47 +02:00
Dalai Felinto
824bf261f7 Initial implememtation for dupli objects
Now dupli groups, objects, particles, ... are all working.

This introduces a flag for the iterator to determine whether we go over
Set and dupli objects or not.

Important to remember to keep the iteration of DEG_ as readonly.

Cycles is not working well for dupli groups, and it's memleaking
for dupli particles. So for now we iterate over main objects and set
only, not dupli.

To change that go in rna_scene.c and:

-DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_SET)
+DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_ALL)

Review and suggestions by Sergey Sharybin
2017-06-02 10:45:45 +02:00
f8ea2c92db Suppress assert for meshes with no faces 2017-06-02 16:42:39 +10:00
678a6b6c49 Fix T51695: Border select fails w/ lamps
Draw order doesn't match scene order when mixing object types.
2017-06-02 16:38:35 +10:00
eae486f5e6 Merge branch 'master' into blender2.8 2017-06-02 15:39:29 +10:00
0d8bf4bf94 Cleanup: style 2017-06-02 15:38:04 +10:00
cb23927c9b Fix View3D orientation index initial value
Would assert after transform
2017-06-02 15:21:56 +10:00
7beb173d70 Fix crash using non-camera object as camera
Also sync with master to avoid conflicts
2017-06-02 15:12:59 +10:00
nBurn
e1910ac6ed PyAPI: update to bpy.types.Operator.5.py
This is a minor update add more information on how Blender handles modal
operators. The existing docs provide a good overview, but might not be
as helpful to those unfamiliar with modal programming. This patch also
corrects a few small grammar issues.
2017-06-01 21:59:51 -04:00
f59b1179c5 Eevee: Tag shadow maps to update only when necessary.
Shadow maps are now only updated if one shadow casting object inside it's shadow bounds has been updated.
2017-06-01 23:54:36 +02:00
071315e21b DEG: Add per object update flag for Depsgraph.
This is in order to communicate what portion of this object has changed.
For now it's just a bool, but it will be extended later.
2017-06-01 23:54:36 +02:00
Julian Eisel
46fc0bb87e Move custom transform orientations to workspace
This commit moves the list of transform orientations from scenes to workspaces.
Main reasons for this are:
* Transform orientations are UI data and should not be stored in the scene.
* Introducion of workspaces caused some (expected) glitches with transform orientations. Mainly when removing one.
* Improves code.

More technically speaking, this commit does:
* Move list of custom transform orientations from Scene to WorkSpace struct.
* Store active transform orientation index separate from View3D.twmode (twmode can only be set to preprocessor defined values now).
* Display custom transform orientation name in header when transforming in it (used to show "global" which isn't really correct).
2017-06-01 20:46:18 +02:00
Julian Eisel
7f564d74f9 Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)

Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)

== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.

Opening files without UI and commandline rendering should work fine.

Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.

== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.

== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)

== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)

Reviewed By: campbellbarton, mont29

Tags: #user_interface, #bf_blender_2.8

Maniphest Tasks: T50521

Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:59:37 +02:00
Julian Eisel
0af93cf1ac Merge branch 'master' into blender2.8 2017-06-01 19:56:11 +02:00
020bbbb046 Remove comment (missed last commit) 2017-06-02 01:10:34 +10:00
3be073807b Fix T51651: translate w/ individual origins fails
Regression in fix for T46892
2017-06-02 01:04:11 +10:00
237e17a957 Merge branch 'master' into blender2.8 2017-06-01 16:31:56 +02:00
e5d8b04abe Depsgraph: Cleanup, line wraps after shortening API 2017-06-01 16:22:35 +02:00
df7d38c111 Depsgraph: Remove operation types enum
Was only used to indicate entry/exit operation of component,
which is now done explicitly. No reason to keep something which
is unused and confusing.
2017-06-01 16:22:35 +02:00
a72daea36e Depsgraph: use explicit marking of component entry/exit operations
This isn't used too often, and haivng such API will let us to skip
specifying operation type for all oeprations.
2017-06-01 16:22:35 +02:00
3a7361ec39 Depsgraph: Cleanup, use DEG_NODE_CLASS prefix for node classes 2017-06-01 16:22:35 +02:00
6799fb387d Depsgraph: Cleanup, use DEG_NODE_TYPE prefix for depsgraph node types 2017-06-01 16:22:35 +02:00
5bda458bce Depsgraph: Remove unused argument from time source query 2017-06-01 16:22:35 +02:00
a4925b05a7 Depsgraph: Remove subgraph nodes
Those were never finished nor used. Again, starting from clean
state before we go into more complicated details.
2017-06-01 16:22:35 +02:00
d492ae8893 Depsgraph: Remove dead code
Was never used or worked on in ages, if any of this code is
needed in the future it'll need to be redone anyway.
2017-06-01 16:22:35 +02:00
a13aa12d7c Depsgraph: Remove dead code from add_time_source()
This was never finished or done or used, no reason to keep it.
Better to simplify things before adding complexity of overrides
and copy-on-write.
2017-06-01 16:22:35 +02:00
a6bb98aef9 Depsgraph: Cleanup, get rid of relation type
It was never actually used apart from being stored at a construciton time.
This caused some redundancy and ncertanty about which relation type to use
during construciton (often existing types were not close enough to particular
use case).
2017-06-01 16:22:35 +02:00
d5d7455796 Cleanup: use row() sub-layout to expand enum properties horizontaly 2017-06-01 16:54:45 +03:00
3bc8e88643 GPUCodegen: fix missing ViewMatrix in new shading. 2017-06-01 13:23:06 +02:00
8c09826d58 Gawain: Optimize shader uniform access
Before this change Gawain was doing list lookup twice,
doing string comparison of every and each input which
is not efficient and not friendly for CPUs with small
cache size.

Now we store hash of input name together with actual
name and compare hashes first. Additionally, we do
everything in a single pass which is much better from
cache coherency point of view.

This brings Eevee cache population time from 80ms to
60ms on my desktop and from 800ms to 400ms for Clement
when navigating in a file from T50027.

Reviewers: merwin, dfelinto

Subscribers: fclem

Differential Revision: https://developer.blender.org/D2697
2017-06-01 12:33:41 +02:00
528ae8885e Fix T51687: GPUmat evaluation of shader tree would crash uppon unknown/unsupported socket types.
Made this resilient to unknown types, for now. Supporting specific INT
sockets (through implicit conversion to GPU_FLOAT ones) is considered nice TODO.
2017-06-01 12:18:57 +02:00
3c703df327 Correct select-similar end value 2017-06-01 19:41:19 +10:00
8cf5eaa2ba Add Face-Map to select similar
Handy for setting up face-maps,
also allows selecting all faces with no assigned map.
2017-06-01 16:42:14 +10:00
e2b1c70b48 Fix bad index use drawing deformed face centers 2017-06-01 15:04:22 +10:00
e0216ea89b Clear pose draw data in BGE pose copy 2017-06-01 14:57:27 +10:00
42e336728d Fix custom-bone display-at option 2017-06-01 13:54:29 +10:00
a5783d08f9 Resolve assert in weight paint mode w/ no weights 2017-06-01 13:37:18 +10:00
8b0f968a31 Fix bad handling of 'extra' user for groups at their creation.
Was just keeping the default '1' user from `BKE_libblock_alloc()`,
instead of using correct way to handle extra virtual user needed when we
want to keep unused datablocks around...
2017-05-31 21:24:41 +02:00
f783efd127 Fix T51680: 'Delete Group' from Group view of Outliner does not work.
Do not call invoke ops from outliner's operations menus. Invoke op would
search again for item under mouse coordinates... when it is invoked!
Means often entry menu you would have clicked would not be over target
item, leading to either nothing or operation being applied to wrong item.

Note: about groups, there is another minor annoyance leading to some
assert - groups have an annoying virtual fake user which breaks
usercount, will see whether this is easily fixable. :|
2017-05-31 21:14:08 +02:00
390648b984 DwM: Show wire only mesh objects 2017-06-01 02:26:24 +10:00
72cc6bea14 Fix manipulator immediate mode use
Needs 3D coords
2017-06-01 02:07:17 +10:00
f32a18994a Merge branch 'master' into blender2.8 2017-05-31 15:52:11 +02:00
a481908232 Task scheduler: Optimize subsequent pushing bunch of tasks
The idea is to accumulate all new tasks in a thread local queue
first without doing any thread synchronization (aka, locks and
conditional variables) and move those tasks to a scheduler queue
once they are all ready. This way we avoid per-task-pool lock
and only have one lock per bunch of tasks.

This is particularly handy when scheduling new dependency graph
node children. Brings FPS of cached simulation from the linked
below file from ~30 to ~50.

See documentation for BLI_task_pool_delayed_push_{begin, end}
and for TaskThreadLocalStorage::do_delayed_push.

Fixes T50027: Rigidbody playback and simulation performance regression with new depsgraph

Thanks Bastien for the review!
2017-05-31 15:44:08 +02:00
82276d6cf7 Fix bone selection (index can't skip hidden bones) 2017-05-31 23:29:04 +10:00
2ae6973936 Cleanup: Easier to read constant name 2017-05-31 14:52:45 +02:00
a51dccc6f3 Fix T51661: Swaping strips does not refresh sequencer 2017-05-31 14:26:04 +02:00
140d9a9b15 Cleanup: Use more clear parenthesis 2017-05-31 14:25:40 +02:00
4f11ffcce7 Fix outliner crash clicking on pose bones
From 15317775c, we can't assume directdata is a Base.
This matches logic from master.
2017-05-31 22:16:13 +10:00
ec804b1694 Libmv: Re-bundle from upstream to ensure code base is perfectly in sync 2017-05-31 11:43:39 +02:00
Pascal Schoen
c91d2d30df Improve backscatter color of subsurface scattering in Principled BSDF
Differential Revision: https://developer.blender.org/D2685
2017-05-31 07:29:17 +02:00
c2d81f257f Eevee: Put shadows and probes inside SceneLayerEngineData
This remove the duplication of data for each viewport improving memory usage.
2017-05-30 22:30:16 +02:00
e7fb013a60 Draw Manager: Add SceneLayerEngineData and use callbacks to clear runtime engine data 2017-05-30 22:30:16 +02:00
Dalai Felinto
ff02103194 Fix T51667: blenderplayer building (tm)
Broken since 272ec8a7cf
2017-05-30 19:14:16 +02:00
Dalai Felinto
2cd7b80cae Fix T49570: Cycles baking can't handle materials with no images
If users wanted to bake only a few of the mesh materials, they would
still need to create dummy textures for the other parts.

This commit report (as RPT_INFO) the materials with no texture, but move
on to bake the others materials.
2017-05-30 19:06:39 +02:00
Dalai Felinto
9cae631059 Baking: Add logic to get material from API regardless of Mesh/Object ownership 2017-05-30 19:06:39 +02:00
d1d359b792 Depsgraph: Fix missing relations for objects which are indirectly linked
This is a corresponding part of 7dda3cf.
2017-05-30 17:42:38 +02:00
f92fc950c2 Depsgraph: Remove extra modifiers callback loop
Seems to be a copy-paste error from code above.
2017-05-30 17:38:22 +02:00
272ec8a7cf Move ED_object_facemap functions into ED_object.h 2017-05-31 01:31:53 +10:00
fb27bde1c8 Somehow missed this in recent Face Maps commit
Since the previous layer type was for ints too, it worked in tests.
2017-05-31 01:31:53 +10:00
9f43b36f1c Eevee: UI add world and material nodetree layout. 2017-05-30 17:18:00 +02:00
7b379313de Bpy Extras: Port cycles node functions to new node_utils.py 2017-05-30 17:18:00 +02:00
470d66397d Eevee: Fix ggx sun light. 2017-05-30 17:18:00 +02:00
03469d90b2 Displace modifier: Pre-fetch all possible images to image pool prior execution
This way we reduce amount of time wasted in spin-lock later on when all threads
are starting to sample texture.
2017-05-30 15:40:14 +02:00
b62a7767a0 Image pool: Use memory pool for allocating elements
Reduces amount of system-wide allocation calls. Will be
mainly visible when using lots of images in texture nodes
or regular BI rendering.
2017-05-30 15:25:12 +02:00
34cb934343 Depsgraph: Fix object being tagged for data update when it shouldn't 2017-05-30 14:36:50 +02:00
be59428877 Depsgraph: Add missing update tag clear for proxy objects
This was causing proxies updates on every frame, even if they
do not really change. Additionally, it was causing second round
of armature update when used from inside dupligroup (viewport
ensures all objects from dupligroup are up to date before draw).
2017-05-30 14:36:50 +02:00
24a0b332e2 Alembic import: fixed bug interpolating between frames. 2017-05-30 13:47:51 +02:00
35f4abcf53 Alembic: simplified sub-frame sampling
It's now less confusing (for example, using nr_of_samples directly,
instead of using 1 / 1 / nr_of_samples). Might also have fixed a bug.

Also added unittests.
2017-05-30 13:47:51 +02:00
4e5440686d Alembic export: normalise the homogeneous component after scaling
The scale matrix must have its homogeneous 'w' (at mat[3][3]) set to the
scale in order to also scale the translations along with it. However, this
also scales the transform matrix's 'w' component, which is not supposed
to happen.
2017-05-30 13:47:51 +02:00
916eca6a1e Alembic export: make the start/end frame default values less reasonable
The old default values (start/end frame = 1) could have been an actually
desired setting (for example when exporting a non-animated model). To
make this worse, this was only interpreted as "start/end of the scene" by
the export operator when running interactively, but not when run from
Python.

By choosing INT_MIN as default it's highly unlikely that the interval
[start, end) was intended as actual export range.
2017-05-30 13:47:51 +02:00
4aeba3b90d Alembic export: avoid create-and-reset of shared pointer
Constructing the shared pointer where the object is actually allocated
makes the code a bit clearer.
2017-05-30 13:47:51 +02:00
cfce8623a8 Alembic export: prevent rounding error buildup in frame sample time 2017-05-30 13:47:51 +02:00
71dcead790 Move GHash/GSet/LinkList iterators to BLI files
Those are not depsgraph or C++ specific and can be used by everyone.
2017-05-30 12:48:06 +02:00
Dalai Felinto
eed26b25d2 Layer collection doversion: Remove "converted from 2.7" from the name
Followup and partial revert from d78b1147be
2017-05-30 12:30:04 +02:00
aab3a0fda3 Fix UI message (no points and no phrases in tooltips please!). 2017-05-30 11:42:55 +02:00
31bc9beeac Depsgraph: Use own implementation of stack rather than the one from STL
This way we always have predictable behavior, especially from the
performance point of view. Additionally, if some bottleneck is found
in stack implementation it'll be easier for us to address.
2017-05-30 11:41:29 +02:00
7eceb756e4 Tweak UI messgae checking macro, identifiers are not always available... 2017-05-30 11:40:51 +02:00
47aedb97b6 Silence warning in RNA when building without fluidsim. 2017-05-30 11:35:31 +02:00
15692c8cfe Move hash_combine utility function to a more generic place
This way everyone can benefit from it, not only dependency graph.
2017-05-30 11:09:44 +02:00
fb82948043 Fix strict compiler warning in C++ RNA
Hopefully it is supported by all the compilers.
2017-05-30 10:58:12 +02:00
6c16130356 ImBuf: Fix strict compiler warning in Cineon image IO 2017-05-30 10:58:12 +02:00
2c515df83d Audaspace: Don't use strict flags 2017-05-30 10:58:12 +02:00
46da985c8e Cycles: Cleanup, trailing whitespace 2017-05-30 10:58:12 +02:00
d888453244 Face Maps: custom-data, UI and RNA API
Add face maps, needed for face-map widgets,
only data structure, widgets will be separate commit.

This comes from 'custom-manipulator' branch with only minor changes.
2017-05-30 18:05:59 +10:00
76c97aaff9 Fix T50775: Missing parenthesis on fluid bake button.
Yep, that got reported... Was slightly more involved than UI message
fixing though: RNA string length getter shall return exact lentgh of
string (same as strlen), not size of allocated buffer to contain it!
Otherwise, NULL final char leaks in and...
2017-05-30 09:46:53 +02:00
9b914764a9 Fix T51652: Cycles - Persistant Images not storing images
Denoising was setting session parameters for every frame, which was detected as
a change and therefore caused a resync.

Since the parameter modification change is only needed for viewport rendering
(which doesn't support denoising anyways) and resyncing after a frame change
(which isn't affected by denoising settings), an easy fix is to just ignore
the denoising parameters like it's currently done with the samples.
2017-05-30 06:34:53 +02:00
d321ed62b8 Revert "Revert "Remove MTexPoly layers""
I reverted this commit by mistake. Sorry :/

This reverts commit 9caf328a7c.
2017-05-30 01:29:03 +02:00
5773f58762 Eevee: Replace Cubemaps by octahedron maps for env. probes.
This enables us to use 2D texture arrays for multiple probes.
There is a little artifact with very high roughness caused elongated pixel due to the projection (along every 90° meridian).
2017-05-29 22:04:30 +02:00
6757ca8b40 NDOF: clean up after MinGW removal
Follow up to 9f044cb422

These comments described the difference between Microsoft & MinGW's struct definition. Now that we dropped MinGW we don't need to go into these details.
2017-05-29 14:04:46 -04:00
1fa216487d Gawain: update comments to match latest API 2017-05-29 13:37:02 -04:00
538fe7d48e Fix T50906 and T49361, bevel didn't curve in plane sometimes. 2017-05-29 13:32:57 -04:00
f2d7356f16 Background Fit could set inf zoom 2017-05-30 02:39:07 +10:00
f212bfa3cd Fix T51657: ID user count error when deleting a newly created object with an assigned dupli_group
Stupid RNA accessor was not handling usercount at all on Object.dupli_group...
2017-05-29 17:44:39 +02:00
818268b394 Fix own mistake with NULL materials in particles 2017-05-29 16:30:56 +02:00
Dalai Felinto
30278342d1 Rename Eevee post process effects
No need to have "Enable" in their names.
2017-05-29 16:29:45 +02:00
ec90780767 Gawain: Add support for rendering using an instance batch (for particles) 2017-05-29 16:28:54 +02:00
06ca2c9d03 Fix T51390: Blender 2.78c will freeze or force close when adding particles at random.
DM evaluation code was simply never clearing the `deformedOnly` flag
when evaluating a generative modifier...

Quite astonishing this never got catched before, a lot of particle code
relies on valid value of this flag!!!
2017-05-29 16:05:35 +02:00
97e89027fc Eevee : fix light colors 2017-05-29 15:52:27 +02:00
dbed33479a Eevee: Remove non-ltc area light code + optimisation.
Reduce size ShadingData struct leads to some improvement even with more computation.
2017-05-29 15:52:27 +02:00
932399612b 3D grid: Fix precision issue 2/2
We now floor the corner position and use this position as origin.
This gives us perfect derivatives in all cases even if very far from the origin.
Unfortunately this won't fix the low precision of coordinates used for computing the actual grid size, resulting in thick, non-smoothed lines.

Also did a bit of refactor how the axes are drawn.
2017-05-29 15:52:27 +02:00
330007f571 3D grid: only draw if needed. 2017-05-29 15:52:27 +02:00
e104d82376 Object Mode Engine: Fixing the 3D grid 1/2
Do not use the inverse perspective matrix inside the shader to recover world positions.
That leads to severe float imprecision leading to nasty artifacts.

Instead we compute the world view vector for each pixels and do a ray to plane intersection.
We are still getting low precision derivatives when going far away from the origin, and thus artifacts.

This commit also fixes the non-appearing negative Z axis in 3D view.
2017-05-29 15:52:27 +02:00
9caf328a7c Revert "Remove MTexPoly layers"
This reverts commit c6e92b4947.
2017-05-29 15:52:27 +02:00
35022d0f63 Move particle cache population to a dedicated function
Should help readability of switch statement which becomes far too big now.
2017-05-29 15:26:52 +02:00
377947342e Node Backdrop Manipulator
From custom-manipulator branch, usable when viewer node is selected.

This might need some changes but works on basic level.
2017-05-29 22:09:57 +10:00
1f1926e068 Fix leak with texture-paint shaders 2017-05-29 20:48:02 +10:00
08b7955415 Fix T51625: fix impossibility to delete uninstantiated objects from Outliner.
The fact that we can end with uninstantiated objects is not expected
currently, but would rather not start chasing all corner cases that may
lead to that situation.

User shall be able to delete uninstantiated objects from Outliner, though!
2017-05-29 12:27:59 +02:00
51d1e204b8 Fix texture paint crash when there are no UV's
Missing check in own recent commits,
also only use texture-paint drawing on active object.
2017-05-29 20:17:42 +10:00
2fb56e7157 Fix T51520: Broken vertex weights after two mesh joining.
Take Two, did not detect that dynapaint was also creating named vgroup cdlayer!
2017-05-29 12:06:40 +02:00
Dalai Felinto
4e39b31671 Fix crash on rna show diffuse color update
(untested because texture painting is not working)
2017-05-29 11:15:08 +02:00
be31582e3d Fix T51624: Scene Full Copy ignores shader node links.
Properly remap nodes' pointers to copied IDs in copied ntrees.

Note that this only affects root trees, node groups are not concerned
here, since they are assumed to be reusable chunks and hence *not*
duplicated.
2017-05-29 11:02:27 +02:00
Dalai Felinto
05f9155902 Fix crash when setting sculpt settings 2017-05-29 10:54:36 +02:00
ea147e9a28 UI: Make GP "Add Blank Frame" operator name and description fit its behavior.
The operator is indeed not adding frames but inserting them at the current frame (shifting all subsequent ones). Changed the operator name and description.

Approved by Antonio.
2017-05-29 10:51:20 +02:00
ecf2f1593a Fix T51646: Motion Tracker instantly crashes
Was a mistake in previous changes.

Weirdly enough, frame reading assumes cache_key is always non-NULL..
2017-05-29 09:40:43 +02:00
c0cf767460 Access node backdrop as vector
Minor change from 'custom-manipulators' branch, avoid conflicts.
2017-05-29 14:29:44 +10:00
94a3bc63cc Add some missing VSE tooltips
Part of T51061

Differential Revision: https://developer.blender.org/D2664
2017-05-28 21:45:30 -04:00
5f46374c89 UI correct use of "..." in the VSE 2017-05-28 20:41:23 -04:00
8051f2412e Usual i18n/message tweaks & fixes. 2017-05-28 21:47:16 +02:00
9ba7805a3b Fix T48996, bevel bad for certain in-plane edges. 2017-05-28 14:02:56 -04:00
8ead56c4c9 Merge branch 'master' into blender2.8 2017-05-28 17:48:59 +02:00
b947810291 Make 'set offset from cursor' group operator internal.
This operator relies on a rather specific context setup, so it shall not
be exposed to user in 'operator search' menu etc.

Based on D2528 by Vuk Gardašević (lijenstina).
2017-05-28 17:35:24 +02:00
9f044cb422 Remove MinGW support
The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.


Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648
2017-05-27 15:34:55 -04:00
275e2fb0ff Fix T51637: Mesh Tools - Noise Button Crashes.
Logic behind which mtext to use from material was broken here... Though
ultimately that whole tool could probably be deprecated or reworked!
2017-05-27 14:46:14 +02:00
7df5ed14b1 Release wasn't building, limit debug scope 2017-05-27 20:47:41 +10:00
2eead82ce0 CustomData: assert on bad arguments to free
Assert the index is in-range for the layer type.
2017-05-27 14:05:44 +10:00
19809c8385 Add automated ctest for complex merge in Array modifier.
See also T50851.
2017-05-26 21:58:29 +02:00
4d58080e23 Fix T50851: Array modifier generating invalid geometry.
We had handling of fully duplicated polygons already, but... absolutely
nothing to sanitize partially merged polygons! This were giving us
totally invalid geometry, with duplicated vertices in single poly,
invalid edges, etc.

Now we do check for invalid loops inside polys, and generate new edges
as needed to get only valid polys.

For some reason this was a nightmare to get running fully OK, playing
with old and new indices is really, really mind breaking.
2017-05-26 21:58:29 +02:00
Dalai Felinto
6dfe56f01a Silence warning in draw manager 2017-05-26 17:51:08 +02:00
Dalai Felinto
43badbd631 Rename: FILE_ACTIVELAY > FILE_ACTIVE_COLLECTION 2017-05-26 17:44:00 +02:00
Dalai Felinto
984cd29fda Implement support for Append objects in Blender 2.8
Note for users
==============

The active_layer option used for the filebrowser operators is now called
active_collection.

If there is no collections in the scenelayer or if this option is not selected
we automatically create a new collection for the new objects.

This is the same behaviour of trying to add a new object when there is
no collection.

Note for developers
===================

For those cases I moved the object user count handling from readfile to
the scene collection system. It's working fine for those, but we still
need to re-visit this for Add objects, and Duplicate - In those cases
the usercount is 2 when it should be 1.

Reviewers: mont29, sergey

Differential Revision: https://developer.blender.org/D2686
2017-05-26 17:44:00 +02:00
Dalai Felinto
65a042b273 Rename BKE_layer_collection_active > BKE_layer_collection_get_active 2017-05-26 17:44:00 +02:00
Dalai Felinto
0ab9b943a2 Move util function to add new scene collection when active is not available from object to layer 2017-05-26 17:44:00 +02:00
Dalai Felinto
0c6227ce77 Depsgraph iterator: Add assert for bases not yet evaluated 2017-05-26 17:44:00 +02:00
620516965b Gawain: move convert_prim_type_to_gl to private API 2017-05-26 11:23:23 -04:00
cd8a8a3d1f Fix removing texface layer 2017-05-26 23:37:10 +10:00
7d7c5135d7 Merge branch 'master' into blender2.8 2017-05-26 23:32:56 +10:00
ac66fb193f Fix freeing all custom-data layers
Would crash when the active index was out of range,
since there is no reason to use the active layer when freeing all,
free the first instead.
2017-05-26 23:30:20 +10:00
b0015686e2 Fix T50908: Motion Tracker ignored grease pencil mask
This feature got lost with new auto-track API,

Added it back by extending frame accessor class. This isn't really
a frame thing, but we don't have other type of accessor here.

Surely, we can use old-style API here and pass mask via region
tracker options for this particular case, but then it becomes much
less obvious how real auto-tracker will access this mask with old
style API.

So seems we do need an accessor for such data, just matter of
finding better place than frame accessor.
2017-05-26 15:27:49 +02:00
bddd9d809d Fix integer overflows in meshcache modifier.
Differential Revision: https://developer.blender.org/D2688
2017-05-26 06:26:21 -06:00
3b311b7cb2 Fix uninit shading group in object mode particles 2017-05-26 13:36:12 +02:00
c6e92b4947 Remove MTexPoly layers 2017-05-26 21:04:34 +10:00
ff29914dcc Remove default shading groups from eevee 2017-05-26 12:55:50 +02:00
f75ca733ed Fix indentation in clay_engine.c 2017-05-26 12:55:50 +02:00
f2a8b74c25 Merge branch 'master' into blender2.8 2017-05-26 19:57:28 +10:00
bf5e717ef5 Fix T51609: Bake Texture, Margin crashing Blender
Integer overflow in margin filter code.
2017-05-26 11:28:01 +02:00
Dalai Felinto
3b24ece297 Depsgraph: Rename DAG > DEG functions from depsgraph_query.cc 2017-05-26 11:23:10 +02:00
f78ba0df02 Fix T51350: 2D curve normals flip when deformed
Deforming 2D curves & text with modifiers/shape-keys
could flip the normals.

Now check the back-facing flag instead of `z < 0`.
2017-05-26 19:03:30 +10:00
98df7d778f Fix T51287: Matrix.lerp fails w/ shear
Use interp_m4_m4m4 (wraps Eigen),
`MATH_STANDALONE` will need to be updated to support this.
2017-05-26 17:02:27 +10:00
b5a976ec19 Fix GPencil depth checks
Regression in 195d0fba
2017-05-26 16:16:33 +10:00
4badf67739 Fix T51629: Select w/ object lock fails
Regression in 195d0fba
2017-05-26 16:11:56 +10:00
9158d16219 Cleanup: warning 2017-05-26 14:25:52 +10:00
0021268311 Cycles: Cleanup: Remove semicolons from line endings in Python code 2017-05-26 02:15:09 +02:00
3722ed13cd Cycles: Update compositor when debug or denoising passes are changed 2017-05-26 02:13:21 +02:00
2bc008e8a9 Cycles: Cleanup: b_srlay is always used now, no more need to silence warning 2017-05-26 01:55:32 +02:00
dc23b48101 Cleanup: Typo in colormanagement (ColormnaageCacheData -> ColormanageCacheData) 2017-05-26 01:52:43 +02:00
1358c39455 [MSVC] Fix build error. linker was searching for a mangled version of versionstr 2017-05-25 15:23:45 -06:00
9179797811 Fix blender player python installation on macOS after recent changes. 2017-05-25 22:18:50 +02:00
2580c3cb82 Fix T50112: Sequencer crash w/ missing proxy data 2017-05-25 20:23:31 +10:00
1ddf67382b Docs: Image.has_data clarification
Resolves T51615
2017-05-25 19:54:54 +10:00
24e3a930f1 Fix T51444: Unit tests don't run on Windows 2017-05-25 18:56:00 +10:00
bdbf4471a6 TexFace removal part 3
- MTexPoly structure & layer type.
- The 'Mesh.uv_textures' layers.
- DerivedMesh TexFace drawing.
- Scripts & UI.
2017-05-25 15:19:58 +10:00
c7c6070a64 Merge branch 'master' into blender2.8 2017-05-25 02:48:14 +02:00
bbce6ce249 Fix macOS python cmake install to work when switching lib directories.
It's a bit ugly but I couldn't find a better way to keep fast installs and
correct handling of switching between master and blender2.8 with different
lib directories.
2017-05-25 02:34:39 +02:00
Julian Eisel
45ff4a807a Merge branch 'master' into blender2.8 2017-05-25 00:43:01 +02:00
aec76fdcc6 Fix compiler error for VS2017
a void function cannot return a value.
2017-05-24 20:13:45 +02:00
a033a7bef9 Fix error accessing tessface color in edit-mode
Was checking for loop-color in poly-layer.
2017-05-25 02:46:30 +10:00
214c42157a Only calc split normals when auto-smooth is enabled
This matches cycles & derived-mesh
2017-05-25 02:31:39 +10:00
154ff1afde Fix/Workaround T51561: Disable split normals 2017-05-25 01:40:15 +10:00
f2cc6c9254 TexFace removal part 2
- Derived-mesh drawing.
- All non UV members of TexFace structs.

MTexPoly is now redundant but keeping with a dummy member,
will check on complete removal later.
2017-05-25 01:40:15 +10:00
55c15ad9de Cycles: Use falltrhough attribute to help catching missing break statements 2017-05-24 17:23:54 +02:00
3de9db9650 Proper fix for crash loading old files with compositor
Now we keep all links around, even for sockets which were
implicitly renamed. And also ensuring new sockets have proper
storage.
2017-05-24 15:39:15 +02:00
7a9ad029dd Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.

To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.

This is used as a bake-target when not using Cycles too.
2017-05-24 23:38:15 +10:00
f4074ce8d7 Revert "Fix crash opening really old files with compositor"
This commit broke compatibility with newer files: due to rename
of Speed to Vector the links got lost.

This reverts commit 0e46da76b7.
2017-05-24 15:29:14 +02:00
707340edd7 Cleanup: minor de-duplicate from last commit 2017-05-24 22:54:19 +10:00
429f6bee28 Fix T51561: Normal maps fail w/ quad + eevee
Generalize derived-mesh tangent calculation so
it can be used by Batch cache creation too.
2017-05-24 22:39:50 +10:00
a6c60affff Merge branch 'master' into blender2.8 2017-05-24 21:17:05 +10:00
d252ac6b95 Fix possible invalid normal use w/ tangent calc
Was using MFace normals, not MPoly
2017-05-24 21:15:35 +10:00
6715bfee92 Alembic: Export mesh as mesh, even when it has no vertices.
This makes it possible to have an animated / procedurally generated mesh
that starts empty and obtains data in later frames.

Fixes the export of an empty mesh with an Ocean Modifier, as described in
issue T51351.
2017-05-24 12:39:37 +02:00
e921e0f0af Alembic export: consider mesh with animation data as "animated"
This allows you to put any kind of animation data on the mesh, and its
shape will be exported on each timekey. Note that this timekey is unrelated
to the animation data (so we don't export on each keyframe, for example).

A practical example is the addition of an animated custom property to
trigger the export of animated mesh data. The mesh data can then be created
from any source, like Python scripts.

Not only is this useful in itself, it also provides a workaround for one
of the two issues described in T51351.
2017-05-24 12:38:17 +02:00
eafea25c41 Alembic export: write Blender version to Alembic file
This is written in a custom metadata key, so it isn't shown by utilities
like abcecho or abcls. However, it's still something that's useful to
have available.
2017-05-24 11:45:14 +02:00
d5d9d1fe7d CMake: document that WITH_FFTW3 is also used for the ocean sim. 2017-05-24 11:36:41 +02:00
ad27e97ee7 Fix T51586: Regression: Alembic containing animated curves / hair no longer working
Also fixed the same type of error when reading points.
2017-05-24 10:24:25 +02:00
Pascal Schoen
e20a33b89d Fix T51589: Principled Subsurface Scattering, wrong shadow color
Apply mix of subsurface and base color (wrt subsurface) for rays that
have transmitted the surface.
2017-05-24 07:37:02 +02:00
60a099fb09 Move empty image drawing into its own pass 2017-05-24 14:28:48 +10:00
3c92e6b8f0 Cleanup: bmesh var naming 2017-05-24 13:33:48 +10:00
c9d890585b DwM: avoid indirect edit-mesh conversion
Storing edit-mesh data as indices for passing
only to get back edit-mesh data.

This also complicated checks for real edges in tessellation tris.

Simpler to pass data directly.
2017-05-24 13:27:11 +10:00
c99e70ae6c Fix leak in particle velocity global ramp 2017-05-24 13:27:11 +10:00
eef92770a1 Optimize particle primitive shader 2017-05-23 18:39:22 +02:00
e1c4908771 Temp fix for vertex format with batch instancing
This prevents memory alignment from being screwed up when attributes are
optimized out in shader.
2017-05-23 18:39:22 +02:00
9bc88b69d8 Implement particle velocity and acceleration visualization 2017-05-23 18:39:22 +02:00
99c6601a1f Merge branch 'master' into blender2.8 2017-05-23 17:35:45 +02:00
7b25ffb618 Fix T51534: Alembic: added support for face-varying vertex colours
Houdini writes vertex data in a different format than Blender does; Houdini
uses "face-varying scope", which means that the vertex colours are indexed
by an ever-increasing number over all vertices of all faces instead of the
vertex index.

I've also merged the read_custom_data_mcols() and read_mcols() functions,
because the latter was only called from the former, and the changes in this
commit would add yet more function parameters to pass.
2017-05-23 17:27:15 +02:00
cc0cc880de Alembic: reduced code duplication in read_mcols()
A big chunk of code was copied between the if and else bodies. By using
a boolean to store whether the c3f_ptr or c4f_ptr should be used, the
in-loop condition is kept as simple as possible.
2017-05-23 17:27:15 +02:00
96e068d3aa Alembic: split up read_custom_data_ex() into read_custom_data_{mcols,uvs}()
The read_custom_data_ex() function was basically two functions inside
if/else bodies.
2017-05-23 17:27:15 +02:00
c1b321e1b8 Add PovRay file extensions to our 'textual' file filtering. 2017-05-23 17:09:50 +02:00
116e8933a6 Fix some POV keywords not colored correctly.
We need to ensure longer keywords are catched first, when there are
shorter subsets of them in keywords list as well!
2017-05-23 17:09:50 +02:00
3db15ae23a Eevee: Disable directionnal lamps shadows 2017-05-23 15:12:47 +02:00
6f063bdb1c Use pointers to actual data for particle uniforms
This makes particle color uniforms point directly to material color, and
particle size uniforms point directly to ParticleSettings size.
2017-05-23 14:37:01 +02:00
340e4394d4 Use custom shader for dot particles 2017-05-23 14:25:12 +02:00
b5426b50fb Rename/move particle shaders 2017-05-23 14:20:10 +02:00
49cc78ef18 Fix T48668, bevel mistake on presumed reflex angle.
Note: the angle in bug isn't really reflex - using the vertex normal
for this test isn't always right, but usually is. At any rate,
shouldn't try to put vertex on edge between if a reflex angle.
2017-05-23 07:55:14 -04:00
21857cb081 Create new shading group for each psys 2017-05-23 13:52:50 +02:00
b30cefa650 Revert "Implement UBOs for particles"
This reverts commit 845732652f.
2017-05-23 13:52:50 +02:00
da9c2607c4 DWM: Add short to float / int uniform function.
Short values are common in DNA, this enables using them directly without storing temporary float somewhere.
2017-05-23 13:59:58 +02:00
694bc97768 Draw Manager: Prevent errors when overwritting the instance batch. 2017-05-23 13:59:58 +02:00
b2dc54ffe5 Stupid mistake in material access optimization 2017-05-23 21:52:18 +10:00
72d67ba4c2 Make msvc2015 happy again.
Looks like that wanabe compiler does not support more than a few tens of
if/else conditions...
2017-05-23 13:04:58 +02:00
8d26f2c222 Fix T51319: Alembic export crash w/simple child particles if Display value < 100%
This was two-fold.

1) The export used viewport settings to obtain the particle cache, rather
   than render settings.
2) The child hair writer tried to obtain UV-coordinates from the parent
   chair, without checking whether those were available in the first place.
2017-05-23 12:31:39 +02:00
d859bac9e8 Cleanup: Make Gawain code style more consistent
Not as if i'm totally fine with such style, but i'd better be consistent
with whatever the project is using.
2017-05-23 11:53:47 +02:00
7add6b89bc Fix T51592: Simplify AO Cycles setting remains active while Simplify is disabled 2017-05-23 10:34:03 +02:00
96f7b08aec DwM: optimize material access
- Split BMesh/Mesh loops.
- Loop over faces instead of tris.
- Add out-of-bounds check for material index (rare but can happen).
2017-05-23 18:26:16 +10:00
611779ca96 Cleanup: use more generic naming
Can be used by any user that needs faces split by materials.
2017-05-23 17:48:05 +10:00
f21c235c6f DwM: texture paint support & mask mode
Uses workaround so material slots are used when neither blender-internal
or cycles are enabled.
2017-05-23 17:40:48 +10:00
44f91a9a18 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2017-05-22 22:49:02 +02:00
6cc293a6d9 Gawain: replace switch with lookup table
This function is not performance critical, but I prefer the branch-free code and no hack needed to appease gcc.

Follow-up to recent 23035cf46f and f637145450.
2017-05-22 16:43:33 -04:00
9b29233800 Add PovRay syntax hilghting.
Since we already have a rather advanced PovRay exporter, makes sense to
also nicely display generated 'code'.

Patch by Maurice Raybaud (@mauriceraybaud), thanks!
Cleanup (mostly styling) by @mont29.
2017-05-22 22:08:02 +02:00
8cc4c3da8c Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
Brightness/contrast node was changing color but did not modify alpha
or ensured colors are premultiplied on the output. This was giving
artifacts later on unless alpha was manually converted.

Compositor is supposed to work in premultiplied alpha (except of
some really corner cases) so it makes sense to ensure premultiplied
alpha after brightness/contrast node.

This is now done as an option enabled by default, so we:

(a) Keep compatibility with old files.
(b) Have correct behavior for newly created files.

Later on we can get rid of this option.
2017-05-22 17:15:45 +02:00
849e77b1f9 Fix T51318: Non-update of preview when switching from world to lamp panel.
Lamp preview panel is in DATA buttons context...
2017-05-22 17:11:55 +02:00
f08f8a2df2 Enhance vgroup handling when merging meshes.
We were looping over all vgroups in destination mesh and making string
comparison, for every vgroup of every vertex of merged mesh! Crazy!

Now we simply create a temp mapping of vgroup indices, seriously
simplifies things (and gives significant speedup when merging huge meshes
with lots of vgroups, here with quick stupid test went from 120ms in
vgroup merging to less than 5ms, 25 times quicker!).
2017-05-22 16:43:46 +02:00
e3d6321530 Fix T51520: Broken vertex weights after two mesh joining.
Root of the issue here was that two stupid modifiers could create named
vgroup CD layers (vgroup editing ones... shame on me :") ).

Fix that, and added some versionning code to also fix 'corrupted' blend
files created by those so far.
2017-05-22 16:43:46 +02:00
81667b770c Fix wrong comment in BLI_findstringindex (returns 0-based index!). 2017-05-22 16:43:46 +02:00
845732652f Implement UBOs for particles
This fixes the issue where all particles were drawn with the colors and
size of the last psys to be drawn.
2017-05-22 16:42:08 +02:00
cedebeb5de Minor cleanup of previous hair commits 2017-05-22 16:42:08 +02:00
f5a9f150dc Fix T51577: ColorBalance strip modifier misses some color input
Was a mistake in recent VSE interface change.
2017-05-22 14:56:08 +02:00
9737401688 Fix T51169: Push/pull fails w/ local lock axis 2017-05-22 21:12:43 +10:00
34b689892b Fix T51568: CUDA error in viewport render after fix for for OpenCL
Seems re-loading module invalidates memory pointers by the looks of it,
which gives an error on the next kernel call.

Not sure how to move memory pointer from one CUDA module to another one,
so for now simply disabling kernel re-load for CUDA devices. Not ideal,
but better than failing render.

Feature-selective option for CUDA is not an official feature anyway.
2017-05-22 12:28:21 +02:00
Dalai Felinto
c0202c0d33 Fix T51578: Blender 2.8 crash when select Dopesheet->Grease Pencil 2017-05-22 12:25:40 +02:00
baf788d7cd Fix T51336: Crash on broken file opening.
`screen_findedge()` is not expected to return NULL in that case, but
checking against that does not hurt (we do it in all its other call
cases anyway), better than crashing.
2017-05-22 12:08:03 +02:00
bd09b51379 Fix/workaround GCC bug about -Wno-implicit-fallthrough
For some reason GCC-6 successfully compiles test program with
-Wno-implicit-fallthrough passed via command line. It just
silently ignores the unknown arguments which are starting with
-Wno-.

The issue is, if some other waning happens in the code, then
GCC will complain about unknown -Wno- argument which is not
supported by current GCC version.

This makes some misleading warning prints about unknown
command line argument when any other warning happens in code
from extern/.
2017-05-22 11:08:10 +02:00
dbb1a692f7 Revert assert, Eevee uses uniforms that might not exist 2017-05-22 17:57:34 +10:00
9efd3a3f63 Cleanup: move custom-data layers into a struct
Changed because the values co-exist with active layers
(Mesh.mloopuv, Mesh.mloopcol).
2017-05-22 17:25:31 +10:00
02cc4d8cec Cleanup: line length 2017-05-22 16:25:27 +10:00
e98652b64f Cleanup: minor edits 2017-05-22 16:21:44 +10:00
f637145450 Fix compilation on gcc 2017-05-22 03:36:05 +03:00
23035cf46f Gawain: remove GLenum from IndexType API
Goal is to make most of the API independent of OpenGL, Vulkan, any other backend.

Able to remove default case from ElementList_size because IndexType only covers index types. Not that and *everything else* like GLenum.
2017-05-21 18:25:30 -04:00
054eb9422c Gawain: use integer math to convert int16 to int10
@fclem does this work for you?
2017-05-21 18:07:23 -04:00
ea31c55b08 Gawain: cleanup code formatting 2017-05-21 17:53:16 -04:00
3f6f02e433 Gawain: drop support for APPLE_flush_buffer_range
Modern GL's glMapBufferRange works the same on all platforms.

Part of T49012
2017-05-21 17:06:42 -04:00
90a1d49180 Gawain: drop support for APPLE_vertex_array_object
Recent versions of OpenGL support VAOs natively.

Part of T49012
2017-05-21 16:48:54 -04:00
68d8618538 Gawain: promote 10_10_10 to first-class vertex format
This format is part of OpenGL 3.3, and one of the reasons for choosing 3.3 over 3.2.

Instead of checking #if USE_10_10_10 just use it wherever needed.
2017-05-21 15:59:34 -04:00
f3d9f0c779 [msvc] Use debug nunmpy archive for debug builds 2017-05-21 09:31:55 -06:00
3bf69b26ef Cycles Denoising: Skip feature pass writing for volume-only shaders
Volume shaders without anything connected to the surface output are treated
as if they had a transparent BSDF as the surface shader in Cycles, so the
denoiser should skip feature pass writing for them just as it does with an
actual transparent BSDF.
2017-05-21 05:40:13 +02:00
96769f3b19 Cycles Denoising: Skip confidence interval test for outlier central pixels
If the central pixel is an outlier, the denoiser is supposed to predict its
value from the surrounding pixels. However, in some cases the confidence
interval test would reject every single surrounding pixel, which leaves the
model fitting with no data to work with.
2017-05-21 05:26:13 +02:00
67b9a5b3d6 Eevee: Initial implementation of exponential shadowmaps
Also fixes the rendering of depth.
2017-05-20 16:58:07 +02:00
d9d65a06d3 Eevee: Move cube shadows to octahedron shadowmaps.
We render linear distance to the light in a R32 texture and store it into an octahedron projection inside a 2D texture array.

This render the sampling function much more simpler and without edge artifacts.
2017-05-20 16:58:07 +02:00
4c3382d55f GPUTexture: Enabling R32 format for linear depth encoding. 2017-05-20 16:58:07 +02:00
3f1a7aec13 Eevee: optimize vertex shader for probe and shadows. 2017-05-20 16:58:07 +02:00
07dd208209 Cleanup: warnings 2017-05-21 09:39:31 +10:00
53d1026f2a DwM: assert when uniforms aren't found
More useful when this error shows up early
2017-05-20 23:54:58 +10:00
8e3cefd0d5 DwM: Object mode empty-image support 2017-05-20 23:17:50 +10:00
38a2bf665b Cycles: Cleanup, style and unused arguments
- Some arguments were inapproriatry tagged as unused
  using (void)foo semantic.

  Only use such semantic in tricky casses, when something
  needs to be ignored in release builds or something is
  dependent on tricky ifndef policy.

  For rest of the cases just use void foo(int /bar*/)
  semantic, which ensures variable is not used. Solves
  confusion and code running out of sync with later
  development.

- Used proper unused semantic to some arguments.

- Added braces to make code easier to follow, tricky
  indentation with ifdef, uh.
2017-05-20 05:21:27 -07:00
65aab6cdae Merge branch 'master' into blender2.8 2017-05-20 14:19:05 +10:00
81e584ed17 CMake: Use GCC7's -Wimplicit-fallthrough=5
Use to avoid accidental missing break statements,
use ATTR_FALLTHROUGH to suppress.
2017-05-20 14:01:03 +10:00
6cd1d34dc1 Cycles Denoising: Prevent overfitting when using a very low radius
For example, when using a radius of 1, only 9 pixels (due to weighting maybe
even less) will be used, but the transform code may still decide to use a
5-dimensional (or even higher) fit.
This causes severe overfitting and therefore weird pixel values.

To avoid this, this commit limits the amount of dimensions to a third of the
pixel number. For a radius of 3 or more, this doesn't change anything, but
for 1 and 2 it can prevent fireflies and/or negative values being produced.
2017-05-19 23:33:22 +02:00
3dee1f079f Fix T51560: Black pixels on a denoising render
Once again, numerical instabilities causing the Cholesky decomposition to fail.

However, further increasing the diagonal correction just because of a few
pixels in very specific scenes and settings seems unjustified.
Therefore, this commit simply falls back to the basic NLM-filtered pixel
if the more advanced model fails.
2017-05-19 23:31:49 +02:00
177385dc43 Cycles: Reload kernels from Session when requested features change
This fixes T49496.
2017-05-19 16:24:19 -04:00
996bf65730 Clay/Eevee: fix more crash when entering edit mode
Shader stages need to agree about interpolation qualifiers. Apparently implicit smooth (the default) and explicit smooth are considered different by some GLSL compilers. Found by @letterrip on Linux + Intel.

Follow-up to 941e739d70
2017-05-19 16:12:13 -04:00
8d7b98bfd3 OpenGL: cleanup material shader GLSL
prefer vector math over scalar
prefer * over /
shorten vec3(x, x, x) to vec3(x)
use clamp, max, etc. instead of custom logic
declare loop vars as part of for loop
spacing
2017-05-19 14:20:37 -04:00
a1c558e19f OpenGL: cleanup edit overlay shaders
Mostly simple fixes to spacing & comments.
2017-05-19 14:20:37 -04:00
941e739d70 Clay/Eevee: fix crash when entering edit mode
vertexColor output was not being written --> shader failed to link --> assert hit while setting that shader's uniforms.

Vertex attribs are smooth by default, so I shortened the declaration.

@fclem or @dfelinto: is color = 0 ok here?
2017-05-19 14:20:37 -04:00
b6f5e8d9a1 Fix T51524: Instantiated Hair Object which has dupligroup children and hidden orig objects of group crash at render.
Note that this is speculative fix, actually precisely understanding what
happens in this code is... not easy.
2017-05-19 19:40:22 +02:00
985574c010 Move particle drawing to object mode 2017-05-19 19:18:34 +02:00
8561a2dda7 OpenGL: remove BIT_OPERATIONS check from GLSL
Since the upgrade we can use bitwise operations without checking. No more lame fallbacks!
2017-05-19 12:36:10 -04:00
5218860607 Fix issue with alpha layering for AA dot drawing 2017-05-19 18:01:24 +02:00
42804d49b5 Implement particle drawing with draw manager
This still has a couple of issues:
* Instancing is not working when multiple particle systems use the same
primitive. Only the last particle system to be drawn with a particular
primitive shows up.

* Because of colors being passed as uniforms with static variables, the
color of the collection of the last object to be evauluated is used for
all particles being displayed.

Also, note that while this is being drawn in the clay engine, this might
be moved to the object mode later intead.

Part of T51378
2017-05-19 17:23:19 +02:00
c62bec8d99 Change particle draw_size default and limits
Particle draw size can now no longer be less than 1px, and the default
value has been changed to 4.
2017-05-19 17:23:19 +02:00
ef3c255457 fix typo in interlace shader
introduced by recent 8adec78ca5
2017-05-19 11:09:12 -04:00
648f2a61ad OpenGL: convert old texture2D calls in built-in shaders 2017-05-19 11:09:12 -04:00
fa47437426 OpenGL: clean up smoke & fire shaders
TODO: swap gl_Vertex for vec3 pos, update smoke setup code
2017-05-19 11:09:12 -04:00
f6ffe12ddb OpenGL: convert old texture2D calls in FX shaders
And one texture1D call.
2017-05-19 11:09:12 -04:00
4c5e9d7c0d OpenGL: convert old texture2D calls in material GLSL
Modern GLSL simplifies texture sampling functions. Info about 1D, 2D, 3D, Cube, etc. comes from the sampler type.
2017-05-19 11:09:12 -04:00
8d4aff31ce Cycles: Fix compilation error after recent changes
Spotted by Steffen Dünner, thanks@
2017-05-19 16:48:42 +02:00
Julian Eisel
b90ad0ded7 Remove redundant workaround for removing collections in outliner
Collections are now identified by their pointer.
Also had to correct TSE_IS_REAL_ID to fix undefined behavior on undo.
2017-05-19 15:51:09 +02:00
Dalai Felinto
3af8f52752 Fix crash when changing Clay "Edge Strength"
This was introduced by a removed line in
rB0eb32ab22809d9c0c41bfff5082f58b1a7aa9965

If we want to change the value to a differen default, it should be done
in a separated commit.
2017-05-19 15:50:30 +02:00
0e46da76b7 Fix crash opening really old files with compositor
There was lack of certain sockets do-versaions: namely the ones
which were added in blender versions after the one used to save
the file.
2017-05-19 15:41:26 +02:00
Dalai Felinto
4525357a3a Fix crash when adding Torus in edit mode 2017-05-19 15:33:50 +02:00
Dalai Felinto
eb90798727 Fix assert on framebuffer binding 2017-05-19 14:39:27 +02:00
a7c4b6f49c Cleanup: add braces for multi-line blocks 2017-05-19 22:18:54 +10:00
Dalai Felinto
8975ad7a88 Remove unused functions after WITH_LEGACY_OPENGL cleanup 2017-05-19 14:16:00 +02:00
Dalai Felinto
2383667a2e Remove reference to WITH_LEGACY_OPENGL
We only keep this as a way to get GPU_stubs to run, in case we want to do a
throughout cleanup in the codebase and want code using legacy calls to
fail to build.
2017-05-19 14:15:49 +02:00
Dalai Felinto
3527739002 Remove reference to SUPPORT_LEGACY_MATRIX
Since the change to core profile this is no longer supported.
2017-05-19 14:14:46 +02:00
Dalai Felinto
60fc04fb9b Remove reference to WITH_GL_PROFILE_CORE
There is no more point of keep those around. ES20 may need special case
when/if we dabble with it again. Meanwhile no point on polluting the
code with this.

(ghost still has reference for the PROFILE, but that's reasonable)
2017-05-19 14:14:46 +02:00
Dalai Felinto
bad8b91fd3 Correct core profile way of getting color depth 2017-05-19 14:14:32 +02:00
ef549b9e55 Cycles: Cleanup, always use parenthesis
Easier to read/follow, and more robust for the further changes.
2017-05-19 12:57:51 +02:00
908bb8bd82 Cycles: Cleanup, indentation in preprocessor 2017-05-19 12:54:46 +02:00
90a62404cb Cycles: Cleanup, variable names
Don't use camel case for variable names. Leave that for the structures.
2017-05-19 12:52:12 +02:00
3a634524e3 Cycles: Cleanup, useless new lines 2017-05-19 12:45:22 +02:00
de86da521c Cycles: Cleanup, braces after function definition
I wouldn't mind switching fully to Google style, but i am against of
mixing two different styles in same project. So just stick to brace
at the new line after function definition.
2017-05-19 12:43:26 +02:00
803337f3f6 \0;115;0cCycles: Cleanup, use ccl_restrict instead of ccl_restrict_ptr
There were following issues with ccl_restrict_ptr:

- We already had ccl_restrict for all platforms.

- It was secretly adding `const` qualifier to the declaration,
  which is quite weird since non-const pointer can also be
  declared as restricted.

- We never in Blender are using foo_ptr or FooPtr type definitions,
  so not sure why we should introduce such a thing here.

- It is absolutely wrong from semantic point of view to put pointer
  into the restrict macro -- const is a part of type, not part of
  hint for compiler that some pointer is never aliased.
2017-05-19 12:41:03 +02:00
8e655446d1 Fix T51537: Light passes are summed twice for split kernel since denoise commit
Denoise commit introduced kernel_write_result() which saves light passes, so
no need to call both kernel_write_result() and kernel_write_light_passes() from
the split kernel.

Weirdly enough. kernel_write_result() does not take care about debug passes.
2017-05-19 12:14:03 +02:00
a5c73129c5 Fix T51556: Sequencer - White Balance Modifier - Masking is not honored 2017-05-19 11:29:18 +02:00
ec051f5103 Fix/workaround T51070: Cannot scale procedural texture in compositor
The issue is coming from some weird semi-finished canvas feature, which
was remapping coordinate without applying any differential on the sampling
ellipse (in fact, there is no ellipse, sampling think is always a single
pixel).

The whole thing is just weak in the compositor, for now just bring behavior
back to how it was prior to optimization (multithreading) commit.
2017-05-19 10:56:26 +02:00
edbd3ebcdc Compositor: Remove unused funciton 2017-05-19 10:55:26 +02:00
c409acd842 Cleanup: removing dummy legacy dashed line shader.
Dashed requires geom shader, which was not available with older OpenGL,
now that we are on 3.3 we do not need that dummy workaround anymore.
2017-05-19 09:42:30 +02:00
1f46da922a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/depsgraph_tag.cc
	source/blender/editors/mask/mask_draw.c
2017-05-19 09:36:14 +02:00
f95828a018 Fix empty-image draw size
Was out of sync with 2.7x.
2017-05-19 16:41:23 +10:00
4a04d7ae89 Fix T51553: Cycles Volume Emission turns black when strength is 0 or color is black
The problem was that Cycles implicitly uses a transparent surface shader when only
volume nodes are used, but since the black emission shader gets optimized away,
it was no longer detected and therefore no transparent surface was used.

Therefore, the shader now stores whether volume nodes were connected before
optimizing.
2017-05-19 04:59:35 +02:00
cf1127f380 Fix T51506: Wrong shadow catcher color when using selective denoising 2017-05-19 04:04:54 +02:00
29f4a8510c Cycles: Fix random noise pattern seen with multiscatter bsdf and split kernel
Differentials were unset if roughness was low giving undefined behavior.
2017-05-18 21:39:23 -04:00
a21277b996 Fix T51555: Cycles tile count is incorrect when denoising is enabled
Now rendered and denoised tiles are counted and displayed separately.
2017-05-19 03:29:18 +02:00
321b98602d Remove use_display_lists option 2017-05-19 10:07:02 +10:00
ffd83a34ab Fix T51502: Cycles denoising not using correctly aligned width for NLM on CUDA 2017-05-19 02:06:54 +02:00
e03e977385 OpenGL: call glProgramUniform only if version >= 4.1
Otherwise crash! Called from OpenSubdiv setup code. Might start using this in more places...
2017-05-18 18:30:24 -04:00
77f8d631b1 OpenSubdiv: insert TODO notes for OpenGL 2017-05-18 18:30:24 -04:00
2e56e1415a OpenGL: remove EXT_geometry_shader4 from OpenSubdiv
Old extension was made obsolete by GL 3.2.
Input/output layout is part of GLSL.
2017-05-18 18:30:23 -04:00
ff8673399e OpenSubdiv: remove legacy support & display queries
OSD display needs more work, since it uses some legacy OpenGL light and material functions.
2017-05-18 18:30:23 -04:00
51278bab5d remove GPU_legacy_support query
In the move to OpenGL 3.3 core profile, we drop support for compatibility profile and older versions.

OpenSubdiv was the only user; I'll update OSD next.
2017-05-18 18:30:23 -04:00
414c1c0e77 OpenGL: remove -noglsl option & GPU_extensions_disable
Also removed a leftover reference to the old basic-shader-glsl option.
2017-05-18 18:30:23 -04:00
5ed0944ce6 GPU: cleanup GLSL version and standard extensions
Now we always use GLSL 3.3, AKA #version 330. Most of the extensions we used are built into OpenGL 3.3 so we don't need them anymore.

Cleaned up comments related to GLSL version.

Part of T49012
2017-05-18 18:30:23 -04:00
7823957455 remove GPU_geometry_shader_support, instanced_drawing_support queries
These are always supported now
- instancing as of GL 3.1
- geometry shaders as of GL 3.2

The change to rna_scene.c could use some cleanup, since we don't really need a runtime query function.
2017-05-18 18:30:23 -04:00
8cb3c7bdec remove GPU_display_list_support query
Display lists are not part of modern OpenGL.

Only BGE used this, and I forced those uses to false. Commented out old BGE logic for reference.
2017-05-18 18:30:23 -04:00
740cd28748 Cycles Denoising: Add more robust outlier heuristic to avoid artifacts
Extremely bright pixels in the rendered image cause the denoising algorithm
to produce extremely noticable artifacts. Therefore, a heuristic is needed
to exclude these pixels from the filtering process.

The new approach calculates the 75% percentile of the 5x5 neighborhood of
each pixel and flags the pixel if it is more than twice as bright.

During the reconstruction process, flagged pixels are skipped. Therefore,
they don't cause any problems for neighboring pixels, and the outlier pixels
themselves are replaced by a prediction of their actual value based on their
feature pass values and the neighboring pixels.

Therefore, the denoiser now also works as a smarter despeckling filter that
uses a more accurate prediction of the pixel instead of a simple average.
This can be used even if denoising isn't wanted by setting the denoising
radius to 1.
2017-05-18 21:55:56 +02:00
b3a3459e1a Cycles Denoising: Fix wrong order of denoising feature passes 2017-05-18 21:55:56 +02:00
9586cc4708 Cycles: Cleanup MultiGGX closure implementation
The implementation originally handled four different cases:
Regular glossy, glass, metallic fresnel glossy and diffuse.

However, only the first two are actually used currently. Therefore, this commit
removes the other two, which allows to simplify the code.

Additionally, due to the Principled BSDF, the function arguments are now
identical for glossy and glass, which allows to get rid of some ugly #ifdefs.
2017-05-18 21:55:56 +02:00
13687e89d8 GPUViewport: Fix huge memory leak. 2017-05-18 20:32:36 +02:00
Dalai Felinto
781e22c2df Remove viewport shading panel
We can remove the RNA options as well, but I wanted to tackled the UI
first.
2017-05-18 18:46:46 +02:00
Dalai Felinto
740f33d8a2 Remove "Modern Viewport"
The "Modern Viewport" was an option in the Viewport panel that would use
the new fancy wire frame code and some depth debugging functionality.

This was introduced as a quick and dirty way to get the new drawing
system showing in the viewport.

Overtime we built a complete Draw Manager system, leaving this original
approach deprecated which adds clutter to Blender code since it would be
removed sooner or later.

Note: The new fancy wireframes and related shaders (white out other
objects) are still in Blender code, though you can't use them anymore.

If we are to have any of those drawing options they should be integrated
in the new draw manager, instead of integrated in the old drawing
pipeline as it was originally coded.
2017-05-18 18:46:46 +02:00
ec774fdb48 Eevee: Fix fresnel factor to match Unreal Engine specular input. 2017-05-18 18:35:55 +02:00
e52a7584be Eevee: Fix GPUShader not free. 2017-05-18 18:35:55 +02:00
d00ab4a507 Fix menu inconsistencies
This commit fixes two issues:

- UV/Image editor uvs menu did not match the 3D View's which was changed in rB2b240b043078
- Circle select tool was missing in particle edit mode

Reviewers: Severin
Differential Revision: https://developer.blender.org/D2329
2017-05-18 18:22:45 +02:00
Dalai Felinto
c9e7a13abb Fix UI button text for Eevee "Use Nodes" 2017-05-18 17:42:25 +02:00
Dalai Felinto
c2191912ca Freestyle is back for 2.8
It works with Cycles and Blender Internal for now.

The Blender Internal support will disappear, but we should be able to
integrate it with the Draw manager and use it with Clay, Eevee, ...
2017-05-18 17:34:03 +02:00
6bf05ab2ca Install_deps: py 3.5.3, collada 22b1f4ff026881b4 (2.6.47), OCIO 6de971097c7f5. 2017-05-18 16:53:07 +02:00
Dalai Felinto
c36eb9b291 Rename Iterator struct to BLI_Iterator 2017-05-18 16:53:02 +02:00
849b26c746 Draw Manager: Fix buffer reuse. 2017-05-18 16:50:48 +02:00
d92a9a5472 Use the correct depsgraph for freestyle
Freestyle itself is still not working, but that's to be addressed
separately.
2017-05-18 16:14:32 +02:00
7490b24241 Draw Manager: Fix instancing. Again. 2017-05-18 16:05:03 +02:00
242a044bd1 GPUMaterial: Add support for tangent node. 2017-05-18 16:05:03 +02:00
49bd3d3a1a Cycles: Fix crash loading single channel texture
Was  typo in recent isfinite check.
2017-05-18 15:49:03 +02:00
Dalai Felinto
c55c2dbfba Make sure external engines also render fine with depsgraph + freestyle wip
There is still a crash when using freestyle and Cycles,
but the changes here present are harmless
2017-05-18 14:48:13 +02:00
00164f3c70 Correct own error using u32 for back-buffer select 2017-05-18 22:33:34 +10:00
1247f609d4 Correct last commit
VERT_VISIT was used in a nested function.
2017-05-18 21:48:52 +10:00
Pascal Schoen
32c9d2322c Fix T51408: Cycles - Principled BSDF Shader - Transparency is not working as expected
Renamed the "Transparency" input of the Principled BSDF to
"Transmission" and "Refraction Roughness" to "Transmission Roughness".
2017-05-18 13:18:19 +02:00
208462e424 Fix T51539: BMesh boolean crash
In some cases the vertex visit queue would exceed its max length,
visiting the same vertex multiple times.
2017-05-18 21:09:06 +10:00
dad10ab118 DwM: Support flat-shaded w/ clay & eevee engines
Needed for sculpt mode drawing w/ engines, see: T51497
2017-05-18 20:43:53 +10:00
5dd9e17266 DwM: Armature: Cleanup envelope bone code a bit.
Mainly adding 'wire' suffix to wire/distance drawing func and shader.

Also, match wire vertex shader behavior with solid one regarding
head/tail only drawing (i.e. alwas expect head bone mat, never tail one,
and assume that if a radius is negative, then we only draw on the other
end of the bone).
2017-05-18 12:13:19 +02:00
23f256b24b DwM: Armature: add solid envelope bone drawing.
Envelope bones are now pretty much identical to old drawing code.

Note that currently new DwM drawing code does not seem to care about
wire/solid drawing modes at all, guess this is still TODO... For now we
hence just get both wire and solid for envelope bones, this can be
refined later.
2017-05-18 12:13:19 +02:00
5919919955 DwM: Armature: refine drawing condition of envelope distance outline.
Should match better original 2.7x behavior now.
2017-05-18 12:13:19 +02:00
c75cde31db Re-use vertex position VBO in weight-paint mode 2017-05-18 14:53:43 +10:00
3900b7b1e7 Cleanup: simplify material checks w/ clay engine
Instead of manipulating args when checking for duplicates,
just convert the material and memcmp.
2017-05-18 13:06:51 +10:00
4047715af3 Cleanup: use pre-defined STRINGIFY macro 2017-05-18 11:22:24 +10:00
102394a323 Fix T51538: Weight-paint circle select w/ clipping 2017-05-18 10:43:34 +10:00
5ec6982a82 Draw Manager: Fix instancing. 2017-05-18 01:50:06 +02:00
11e7e0769a Eevee: fix orco. 2017-05-18 01:50:06 +02:00
00a5885136 Eevee: Refactor shaders defines 2017-05-18 01:50:06 +02:00
af3954fe90 Eevee: fix bug with postprocess buffer sharing. 2017-05-18 01:50:06 +02:00
ecee490d13 Eevee: Some changes to default shader.
Use old BI material prop and use a metallic approach.
2017-05-18 01:50:06 +02:00
Dalai Felinto
60cd996c0a Silence warnings in Mac (based on buildbot build report) 2017-05-17 18:13:10 +02:00
Dalai Felinto
970a7c8bb9 Fix blenderplayer 2017-05-17 17:55:31 +02:00
cd8909fbc9 Fix typo in hair shader view vector 2017-05-17 17:27:48 +02:00
c4d122e305 Cycles: Optimize expansion of headers in the source
Use smarter check of where the file is coming from instead of
attempting to replace same source twice with different settings.

Brings down processing time from 3.6sec to 1.8sec.
2017-05-17 17:26:35 +02:00
9a910443c4 Fix compilation error in Cycles
Was caused by recent fix with finite checks.

Fixes T51536.
2017-05-17 17:23:32 +02:00
f628cfd297 Fix T51535: View vector inverting in pespective/ortho 2017-05-17 16:42:38 +02:00
1d49205b1a Fix T51529: Black boxes on a denoising render when using a .exr image as a environmental texture
It is caused by NaN value in the input texture. Now we check for all the pixels
having proper finite values.

Should also help here in the studio,
2017-05-17 15:29:47 +02:00
a56c80cd45 Eevee: fixed Material UI. 2017-05-17 15:06:26 +02:00
cc2755b443 Revert "Cycles: Fix wrong shading on GPU when background has NaN pixels and MIS enabled"
This reverts commit 581c819013.

Seems we do need to do finite check early on, this is incoming.
2017-05-17 15:06:05 +02:00
47f8459ead Fix T51388: Mask moves when zoom is changed in the movie clip editor
Incorrect matrix space for stabilization.
2017-05-17 14:51:51 +02:00
1693d7d887 Fix annoying warning about unused debug var in release builds. 2017-05-17 14:37:30 +02:00
d0ceb1821b DwM: Armature: fix bone distance outline drawing.
This indeed needed its own draw pass, thank to @fclem for the hints!

Also fixes a stupid mistake in bones head/tail coloring.
2017-05-17 14:33:34 +02:00
3c799ba801 DwM: Armature: Add distance outline and wire drawing of envelope bones.
This is not complete, it does not implement 3D solid drawing of
envelope bones. 2D wire is hence always drawn for now.

Some notes:

I did not try to implement the 'capsule' approach suggested by @fclem, because:
  1. I spent enough time on this already, and finally got something working.
  2. I managed to get rid of geometry shader completely.
  3. Current approach allows us to use same shader for
     distance outline and envelope wire.

It's working fine, except for one glitch - superpositions of envelope
outlines do not work as expected, not sure what's wrong here, tried to
disable zbuff, enable GL_BLEND, no luck so far...
I think we need our own 'background' drawpass to get them working (also
to avoid them drawing over the wire lines).
2017-05-17 12:34:06 +02:00
f674bc90e2 BMesh: remove duplicate argument for wireframe op 2017-05-17 20:31:14 +10:00
Hristo Gueorguiev
40e6f65ea1 Fix T50937: baking with OpenCL and CPU have slightly different brightness
OpenCL baking with SSS and Volume are not supported.
2017-05-17 12:24:16 +02:00
11c167ff76 Fix particle system batch_cache on object duplication 2017-05-17 11:19:36 +02:00
c104b7b0b3 DWM: reuse position VBO for vpaint select overlay 2017-05-17 19:21:16 +10:00
a769c4a3a0 Fix weight-painting out of facemask mode w/ hidden faces
Own error in recent commit
2017-05-17 19:08:09 +10:00
Dalai Felinto
c8e96a8b6b Fixup on weightpaint shader after rBfabd55a5e9 2017-05-17 10:35:36 +02:00
24676b535a Fix T49981: When camera is on inactive layer, it does not evaluate constraints
Second round of fix, was broken by 843be91.
2017-05-17 10:22:40 +02:00
Dalai Felinto
fca52c42ae Clay hair: use builtin reflect function 2017-05-17 10:21:08 +02:00
fabd55a5e9 DWM: hide hidden verts in weight-paint mode 2017-05-17 18:09:40 +10:00
c18c3ff3d5 Cleanup: line length 2017-05-17 17:37:23 +10:00
d41f98406f DWM: minor changes to face-flag use 2017-05-17 17:27:20 +10:00
e74177d3b1 Correct own error in copying vertex color to VBO's 2017-05-17 17:14:10 +10:00
e074ac65a6 DWM: don't use engine drawing for paint modes
Also only use sculpt-mode drawing with the active object.
2017-05-17 17:06:55 +10:00
3926e3ef68 DWM: correct unselected face overlay 2017-05-17 16:41:21 +10:00
9995bd8532 DWM: use DRWContextState.obact 2017-05-17 16:08:36 +10:00
741a4cfc0b DWM: Initial support vert & weight hidden faces 2017-05-17 16:01:18 +10:00
17458c511c Cleanup: quiet warning 2017-05-17 13:38:06 +10:00
aa66f2c7eb Use byte color for selection drawing
Some small advantage to using 1/4 sized data-type.
2017-05-17 13:31:01 +10:00
431b7c8eb1 Correct flag when drawing editmode face select
Own error in updating select code.
2017-05-17 13:26:09 +10:00
b4ec0e8cd5 DWM: use generic header for DRWCall
Avoid alignment mis-match casting between different draw-call types.
2017-05-17 12:58:58 +10:00
5bfeaf6cc1 Cleanup: group VBO attributes in a struct
Some names are a bit arbitrary,
this makes it clear which names are VBO attributes.
2017-05-17 12:36:02 +10:00
3d6361aa9c Cleanup: clarify select terminology
In mesh cache we have select: color, id, bool.
Current naming didn't make this clear.
2017-05-17 11:47:31 +10:00
89483c73fd DWM: write mesh data to the VBO directly
Was using intermediate functions to store each data type.
This is still done in some places (for more involved access).

For basic data: coords, normals, colors..etc this is unnecessarily indirect.
2017-05-17 11:34:42 +10:00
2f6bc53874 DWM: Add obact for convenience
Modes often need to check if the object is the active one.
2017-05-17 11:03:09 +10:00
8adec78ca5 Cleanup: remove GLSL version checks 2017-05-17 10:46:42 +10:00
c8bf3984ee Gawain: Fix crash in release build.
Non-initiliazed var, I thought I was clever than this. :(
2017-05-17 01:43:49 +02:00
0a6c57d3d2 Fix crash from freeing of NULL pointer 2017-05-16 16:29:27 -04:00
966a2681f9 Cycles: Fix building with native only option
Approach suggested by Lukas S.
2017-05-16 16:05:04 -04:00
e14a2e87dc Revert "Cycles: Fix native only kernel since denoiser commit"
Fix didn't work in debug mode due to undefined references.

This reverts commit 5319571511.
2017-05-16 16:03:27 -04:00
58a810e640 Draw Manager: Add support for instance Batch.
Idea is to specify a batch as source of vbo instance attrib.
2017-05-16 20:30:17 +02:00
fa76c69627 Draw Manager: support render only mode. 2017-05-16 20:30:17 +02:00
90aff807ab Draw Manager: Texture Memory usage improvement.
-Use 11_11_10 buffers for hdr content.
-Eevee compositing share 1 buffer if bloom and DOF are both activated.
-Fix slowdown when resizing EEVEE viewport.
-Removed DRW_BUF_*** enums causing confusion.
2017-05-16 20:30:17 +02:00
ddc5896c81 Draw Manager: Improve debug 2017-05-16 20:30:17 +02:00
2e8cb8d836 Draw Manager: Make use of texture reuse. 2017-05-16 20:30:17 +02:00
7a029f4e00 GPUViewport: Add a Texture Pool to reuse textures across engines. 2017-05-16 20:27:52 +02:00
dc01586b40 Fix crash when particle display is below 100% 2017-05-16 17:42:14 +02:00
95547bd750 Minor cleanup in clay_engine.c 2017-05-16 16:43:48 +02:00
Dalai Felinto
15317775c5 Outliner: Bring back "activate" object when selecting from outliner 2017-05-16 16:40:00 +02:00
d59721c2c3 Fix T50673: OpenEXR multilayer image truncated on save
The issue is in OpenEXR itself. See the report fomr some more details.
2017-05-16 16:34:49 +02:00
Dalai Felinto
3826e77593 Draw Manager: Small cleanup on bool and bitwise
We should avoid casting from an int to a flag.

In this case it is probably fine, but if the OB_MODE_SCULPT
was too high it can overflow the bool.

(also adding explicit parenthesis to a flag check)
2017-05-16 16:26:00 +02:00
Dalai Felinto
b11168c8f1 Clay/Hair: Only show hair when in object mode 2017-05-16 16:18:17 +02:00
c6da3c2655 Fix hair drawing with collection clay settings overrides 2017-05-16 16:07:45 +02:00
26b2323189 Fix memory leak when saving OpenEXR files
It is not a good idea to:

1. Duplicate metadata to self
2. Ignore the fact that something might have had metadata already.

Also moved metadata copy to a preparation function, so it is
never lost.
2017-05-16 15:36:29 +02:00
Dalai Felinto
e43597446e Fix hair width changing 2017-05-16 14:55:36 +02:00
8be9d68dd4 Fix T49467: Crash due to assert failure in bevel.
The mesh interpolation code had an edge case where one of two
adjacent edges to a vertex has 0 length. This caused an assert
failure indexing the vertex mesh for splash Blenderman.blend.
2017-05-16 07:19:01 -04:00
Dalai Felinto
c81950fbd5 UI: Expose Views to eevee and clay 2017-05-16 12:58:02 +02:00
Dalai Felinto
1e31127933 Fix info header stats to iterator over layer instead of scene
Although this is working fine, there are two changes expected in the new
future once depsgraph copy on write is implemented:

1) To call ED_info_stats_clear a callback from depsgraph, instead of the
notifier system. (that would also allow us to clear only one
SceneLayer).

2) To store/get stats from the evaluated SceneLayer, as well as iterate
over the evaluated objects as well.
2017-05-16 12:50:23 +02:00
a70a7f9db3 Fix T49864: EnvMap baking crashes 2.78 if 'Full Sample' checked in AA 2017-05-16 12:40:04 +02:00
f89c6e739a Fix memory leak in environment
Found when was looking into T49864. The issue is caused here
by render_copy_renderdata() doing a copy of views with
BLI_duplicatelist() so we can not just zero the pointers out.

Similar thing is happening for layers as well.
2017-05-16 10:57:28 +02:00
9619275729 Correct last commit, missing assignment 2017-05-16 18:47:43 +10:00
027ae0fdef Fix sculpt dyntopo undo leaving PBVH at NULL 2017-05-16 18:38:45 +10:00
Olly Funkster
06ac6ded66 Fix byte-to-float conversion when using scene strips in sequencer with identical color spaces
Fix T50882: VSE: Blend Modes on Scenes do not layer properly
Fix T51002: Scene strip with Alpha over not working as expected

The byte-to-float conversion was being skipped if the color spaces of the sequence and the scene
are the same, which is the default, resulting in any non-float strips becoming invisible.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2635
2017-05-16 10:36:33 +02:00
f6afd1b73c Make imbuf's OIIO bindings to compile with latest OIIO from git 2017-05-16 09:35:46 +02:00
6c951fbd34 GPU: use ifdef for flat shader 2017-05-16 16:57:26 +10:00
2fa2814c82 Fix sculpt drawing with Blender viewport
Would draw without any lighting
2017-05-16 16:38:50 +10:00
cbe97bc50f Fix face-dot's not drawing
regression in d12d8956
2017-05-16 14:57:28 +10:00
a8aebc8dd1 Fix memory leak with mesh cache (w/ select invalidate) 2017-05-16 14:55:29 +10:00
d05d73ae75 Fix memory leak with mesh cache (missed last commit) 2017-05-16 13:06:23 +10:00
57660aac74 Merge branch 'master' into blender2.8 2017-05-16 13:01:26 +10:00
d508b69e44 Cleanup: gcc7.1 warnings 2017-05-16 12:46:52 +10:00
5a90542d3d Fix memory leak with mesh cache 2017-05-16 11:45:23 +10:00
12651aba03 Fix hair_step is a short 2017-05-15 17:28:01 -04:00
15e8fbd549 Fix compile error on gcc after last commit
error: static assertion failed: "invalid limits"
2017-05-15 16:43:33 -04:00
4621583612 Fix T51297: Use A Higher Hair Segment Limit
Normally, segments up to 50 can be quite enough for most cases.
However, when dealing with things like braids,
the current limit can sometimes be quite a pain.
2017-05-15 14:29:59 -04:00
87bbeb2837 Gawain: further cleanup to VertexBuffer_prime
Get buffer size once, use it to both allocate and track VRAM.
2017-05-15 13:08:38 -04:00
30d325c9e6 Gawain: cleanup VRAM usage metric
same functionality
2017-05-15 13:08:38 -04:00
4f7c738a38 Gawain: revert recent VRAM usage metric
Revert 7a18ee62eb and 1ff97bbfff after discussing with @fclem.

VertexBuffer_size should always report the same buffer size, but without asking/calling OpenGL.
2017-05-15 13:08:38 -04:00
5319571511 Cycles: Fix native only kernel since denoiser commit 2017-05-15 18:37:33 +02:00
77d0aec3d1 Mesh Batch Cache: Use compressed format.
We don't compress UV by default because that would mean restricting them to [0, 1]
Leaving all other code for later settings switch.
2017-05-15 17:55:36 +02:00
9035aa9cee Use better prng algo and fix randomness UI 2017-05-15 17:27:15 +02:00
392b5b8212 Implement matcaps for hair 2017-05-15 17:27:14 +02:00
7a18ee62eb Gawain: Fix memory manager. 2017-05-15 16:24:24 +02:00
c28a4eb8cb Eevee: fix some glsl for low quality lamps. 2017-05-15 16:14:18 +02:00
e053fade99 Mesh Batch Cache: get rid of the ORCO VBO data, and reconstruct it in shader.
With only one MADD instruction we recover the orco data and reduce both the storage and the fetching cost of an attrib layer.
2017-05-15 16:14:18 +02:00
ae9da3786a Gawain: Add assert for maximum attribute name. 2017-05-15 16:14:18 +02:00
1ff97bbfff Gawain: Better metric for VRAM usage. 2017-05-15 16:14:18 +02:00
38125d0499 Mesh Batch Cache: Define Compressed format for shading data.
Deactivated by default.
All shading attribs can be packed to take less VRAM at the cost of precision (not noticable in this case).
UVs can be packed into I16 but that limits their positions into the [-1, +1] range.

This could be a setting option in the future.
2017-05-15 16:14:17 +02:00
f83a244749 Mesh Batch Cache: Optimization, make use of gawain attrib aliases. 2017-05-15 16:14:17 +02:00
cfbfa94e6b Gawain: Add support for multiple attrib names.
This adds the possibility to give multiple name to the same attrib.
This allow multiple binding points depending on the shader.
2017-05-15 16:14:17 +02:00
acc5d02f69 Edit Mode Engine: Fix loose edges/verts not displaying. 2017-05-15 16:14:17 +02:00
5a377521aa Mesh Batch Cache: Split Edit Mesh mode Vertex Buffers for faster update. 2017-05-15 16:14:17 +02:00
b3e62a8aa2 Gawain: add short vector conversion to 10_10_10 2017-05-15 16:14:17 +02:00
1c21e088f2 Fix T50109: Blender crash when a "Render Result" as a Texture
This commit fixes crash, but user feedback can be improved here to
inform artist that one can't use Render Result as a texture since that
will cause feedback loop.
2017-05-15 15:59:47 +02:00
ef8ad66aa2 Fix T49324: True displacement crashes when shader returns NaN 2017-05-15 15:45:19 +02:00
1f96dd2e0b Fix T51348: Node highlighting is broken
This feature was disabled in the code but not in the interface.

Removing the code, since it needs full re-implementation anyway.
2017-05-15 13:52:17 +02:00
Dalai Felinto
b60f80e9b3 Fix T51501: Cycles baking cancel affects baking script
Basically upon invoking cycles baking we could canell it which would
leave G.is_break hanging as true. Since we were not setting is_break to
false before exec baking, it would misbehave.
2017-05-15 13:04:44 +02:00
b43f66bcb6 Add show-weights to edit-mode UI 2017-05-15 17:56:22 +10:00
df94f2f399 Fix T51180: BMesh crash using calc_uvs=True
Don't assume UV layer exist.
2017-05-15 16:53:57 +10:00
0d65dda147 Merge branch 'master' into blender2.8 2017-05-15 15:51:54 +10:00
b5b72a3f29 PyAPI: don't re-register add-ons on 'New File'
Some add-ons have bugs with re-registration,
they should be fixed, but no need to exacerbate the problem.
2017-05-15 15:33:01 +10:00
687ff699e9 Cleanup: warnings, style 2017-05-15 14:58:55 +10:00
Julian Eisel
77a90f7666 Fix crash when using template_search with non-ID data 2017-05-13 19:48:04 +02:00
Julian Eisel
2d22092230 Merge branch 'master' into blender2.8 2017-05-13 19:35:54 +02:00
890d871bc3 Fix T51314: crash cancelling Cycles bake during scene sync and update. 2017-05-13 07:15:25 +02:00
41c4c3f8fd remove unused #includes 2017-05-12 23:34:21 -04:00
6deaab207c remove old PBVH VertexBufferFormat struct
Follow-up to 0722e41f9e which removed all uses of this struct. Gawain VertexFormat auto aligns attributes as described in @nicholasbishop's performance note.
2017-05-12 23:32:37 -04:00
1bcbad446e Fix ogl deprecated calls. 2017-05-12 18:02:31 +02:00
7d12d8956d Sculpt: Move sculpt drawing to engines.
Only mask are handled by sculpt mode engine and are multiplied on top of the render.
There is room for improvement:
 - Shaded meshes don't have correct tangents or uvs.
 - Masks are in range 0.8 - 0.2 thus always darkening at least 20% the render.
 - It only uses the first material slot of the mesh.
2017-05-12 17:54:14 +02:00
Dalai Felinto
2eff390e13 UI: Expose more UI settings to CLAY and EEVEE
Physics panels are not all back, and the material related panels (e.g.,
hair render panel) should go be changed since there should be no
material for those.
2017-05-12 16:45:51 +02:00
8ca9fa5fd3 Fix T51153: Video duration is detected wrong after FFmpeg update
The issue was caused by stupid workaorund for libav. Now things works for
FFmpeg. There might need some tweaks needed for Libav, but that one is
not really priority for support.
2017-05-12 16:43:36 +02:00
dbd3bf5ed2 Fix memleak in previous hair commit 2017-05-12 16:34:33 +02:00
c986b07e4d Draw Manager: Fix crash when saving file. 2017-05-12 16:31:12 +02:00
5aca575d85 Eevee: Add Rotation and ratio parameters to DoF. 2017-05-12 16:31:12 +02:00
0eb32ab228 Implement hair drawing with Draw Manager in Clay engine
Part of T51378
2017-05-12 16:14:55 +02:00
bd31b1f182 Clay: Use switch statement instead of if-else chain 2017-05-12 15:47:33 +02:00
Dalai Felinto
24168f72c3 Fix for edit modes (sculpt, weight paint) menus not showing in header
But introduced on 2b0f02057f
2017-05-12 15:46:54 +02:00
Julian Eisel
18a96e39ea Merge branch 'master' into blender2.8 2017-05-12 15:36:52 +02:00
Dalai Felinto
56859ae7fd Startup.blend: set EEVEE as the default engine
The original idea was to use Clay as the default. But since clay may not
even be in the final release, we can't afford to have a startup.blend
that doesn't deliver a reliable result regardless of build options.
2017-05-12 13:54:48 +02:00
3a5501d168 Use static assert in Clay engine to ensure struct alignment 2017-05-12 12:02:45 +02:00
20881a7794 Some minor cleanup. 2017-05-12 11:57:15 +02:00
3394f7c74b Fix again DwM bbones drawing.
Stupid mistake in rB6824ee0595c9dd7d1c18864f2 fix, again reported by
@campbellbarton, thanks.
2017-05-12 11:56:26 +02:00
37bc3850ce Mesh Center: improved center-of-mass calculation
Previous method was based on face-area, giving un-even results
based on topology and gave issues with zero area faces.

This method gives matching results for concave ngons and the same geometry triangulated.
2017-05-12 11:04:38 +10:00
Julian Eisel
c20c203b82 UI: Add template_search (version of template_ID for non-IDs)
Adds a version of template_ID that can be used for non-ID properties.
The property to search for and the collection to search in has to be
passed to it.
Like template_ID it also takes arguments to define a 'new' and 'unlink'
operator. They will be displayed as icon-only buttons then.
Also added a version that can display preview thumbnails.

Had to do some additional changes to make text-buttons support
displaying/modifying empty RNA properties.

This will be needed for workspaces, see D2451.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D2666
2017-05-12 01:47:55 +02:00
868678c85f Fix T51449: empty node editor continuously redrawing and using CPU. 2017-05-11 20:32:19 +02:00
Dalai Felinto
c8ab7d4656 Force core profile as main profile
This removes a few options from CMake:
* WITH_LEGACY_OPENGL
* WITH_GL_PROFILE_COMPAT
* WITH_GL_PROFILE_CORE

We still have WITH_GL_PROFILE_ES20. So you can still alternate between
ES20 and CORE profile (when es20 is disabled).

If you want to explicitly see the stubs errors just define
WITH_LEGACY_OPENGL.
2017-05-11 16:47:46 +02:00
9c102f339d Merge branch 'master' into blender2.8 2017-05-11 16:47:21 +02:00
77d633399c BGE: Use BLI's stringify instead of implementing it again
Will solve compilation error in 2.8.
2017-05-11 16:46:43 +02:00
ef3aaa3269 Eevee: Small Dof upsampling blur.
This soften the low res buffer so that jaggies are less perceptible.
Also soften the nearplane transition.
2017-05-11 16:29:35 +02:00
3fbafaffa1 Eevee: Add tonemapping using ocio.
Actually it's done by the Draw Manager, so other engines can use it.
2017-05-11 16:29:35 +02:00
3341c11bcc Eevee: Disable motion blur if camera is different from its animated pose. 2017-05-11 16:29:35 +02:00
2e39a27e3b Eevee: Fix light color being non-linear. 2017-05-11 16:29:35 +02:00
c8d8f04746 Eevee: Fix motion blur when not having set another key. 2017-05-11 16:29:35 +02:00
6fb568af79 Eevee: Add render properties and scene panel. 2017-05-11 16:29:35 +02:00
4edee280e4 Merge branch 'master' into blender2.8 2017-05-11 16:28:58 +02:00
8eeb610832 Depsgraph: Fix/workaround crahs when fcu->rna_path is NULL 2017-05-11 16:28:21 +02:00
Dalai Felinto
2f8a5ed985 Remove warnings after CDDM fix 2017-05-11 16:15:26 +02:00
Dalai Felinto
4f96c24af2 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-11 16:11:02 +02:00
Dalai Felinto
bde45b5ae7 Allow building the game engine with core profile
Note: This is not about functionality, but about using the same stub file
we are using in Blender for the game engine.
2017-05-11 16:10:53 +02:00
Dalai Felinto
6b9ab1f7a2 Unifying access to GLEW from the Blender Game Engine
Note: This is not about functionality, but about using the same stub file
we are using in Blender for the game engine in blender2.8.
2017-05-11 16:08:03 +02:00
d58310fe37 Support drawing of solid mode CDDM with core profile
Nothing terribly exciting, just a hackish implementation of solid mode CDDM
drawing for cases when we are building with core profile.

The goal is to be able to see SOMETHING with new OpenGL for thew guys who
tests alembic and friends in blender2.8 branch. This is a temporary solution,
the whole drawing will be reworked. Limited to hardcoded material and lighting.
Selection outline color is also hardcoded because of lack of glColor() in the
core profile.

After this commit there is no big stoppers from stop worrying about legacy
OpenGL, so we can go core profile as the only way for Blender.

While some areas will become broken after that, we'd better just fix them
after that and for now just focus on more important design work.
2017-05-11 16:00:47 +02:00
f129e48993 Merge branch 'master' into blender2.8 2017-05-11 22:16:23 +10:00
4e7eafb86f Eevee: Fix motion blur. 2017-05-11 14:17:38 +02:00
0e0888970d Merge branch 'master' into blender2.8 2017-05-11 22:07:00 +10:00
15038975a3 Cleanup: GPU PBVH naming
Use GPU_pbvh prefix.
2017-05-11 22:05:19 +10:00
5ae58f8ab8 DWM: Use draw manager for sculpt PBVH drawing
Add a shader-group type to draw
generated geometry by running a callback.
2017-05-11 21:27:33 +10:00
f1242ea93b Fix bug in copying VertexFormat
Pointer-offsets need updating on copy,
seems VertexFormat's were being made static to avoid this bug?
2017-05-11 21:05:49 +10:00
Hristo Gueorguiev
90b9467861 Cycles: fix AO approximation for split kernel 2017-05-11 11:58:25 +02:00
0ffb19ca64 Revert "DWM: remove redundant state reset"
Enable this for now, needs some investigation.
2017-05-11 18:56:41 +10:00
2a2b23c142 Fix typo in the CMakeFile message 2017-05-11 10:06:12 +02:00
bb376c6693 Ammend last commit: add missing align for row props 2017-05-10 23:53:03 -04:00
c95a8bc68f UI: Follow up on recent VSE work
Fix a few more columns that should be rows
2017-05-10 23:53:03 -04:00
58a0c27546 Cycles: Fix occasional black pixels from denoising with excessive radii
Numerical inaccuracies would cause the XtWX matrix to be no longer
positive-semidefinite, which in turn caused the LSQ solver to fail.
2017-05-11 03:21:54 +02:00
f4b7c33c1a update new 2.79 themes: T50869 2017-05-11 10:27:16 +10:00
edd7c55796 Fix Blenderplayer stubs
The change from 62aa925c11 wasn't included.
2017-05-11 01:13:32 +02:00
3465f80319 DWM: remove redundant state reset 2017-05-11 08:36:17 +10:00
1e9f922c9e Merge branch 'master' into blender2.8 2017-05-11 07:53:03 +10:00
891159cea0 Merge branch 'master' into 28 2017-05-11 07:42:35 +10:00
722bcb554f Sculpt Drawing: reduce redundant color conversion
Also replace macro with for loop.
2017-05-11 07:39:56 +10:00
b82954f6f4 Fix T51455: Render Layers in compositor from a different scene not working
The code only updated nodes in the nodetree of the scene to which the render layer belongs. Therefore, when using scene B in the compositor setup of scene A, A's node wouldn't be updated.
With this fix, the update function loops over all scenes and checks them for relevant nodes.
2017-05-10 22:39:43 +02:00
50b67d83a9 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesrna/intern/rna_space.c
2017-05-10 20:40:31 +02:00
Dalai Felinto
f305aba868 Make sure 'use_property_button_exec' can deal with arrays as well 2017-05-10 20:36:11 +02:00
42c346028f Fix missing relation in new DEG between World and its NodeTree.
Was preventing update in 3DView etc. when changing something in the
World's NodeTree, especially annoying in blender2.8 branch (since legacy
depsgraph has been removed there), but also affecting master.
2017-05-10 20:35:59 +02:00
Dalai Felinto
4f80260f11 Expand the collection settings RNA API for arrays 2017-05-10 20:04:50 +02:00
Dalai Felinto
4240b67e4c Expand the collection settings API to support float arrays
We still need to update the RNA interface to access those. But since
there is no RNA_def_property_float_array_funcs I'm not sure how many
changes this will require.
2017-05-10 19:25:39 +02:00
8246246bda UI: editor menu, swap Text and node editors
Proposed by @sebastian_k and approved by @severin over IRC.

Follows up on rB0f561da5fb77540626aec7a995314271a91acdf6
2017-05-10 12:20:57 -04:00
Dalai Felinto
e5ec386803 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-10 17:03:27 +02:00
Dalai Felinto
62aa925c11 Fix T51354: Final take on multi-view (single view) issues
We now handle selection and transform manipulators
(kudos to Julian Eisel to help hunting down the latter).
2017-05-10 16:54:57 +02:00
45207bf3ce Eevee: Post process parameters.
-Display almost all parameters.
-Made some small adjustment to motion blur to support FOV motion blur.
-Made DOF max radius a parameter.
2017-05-10 16:03:25 +02:00
fdf2d8bb95 Eevee: Support for light path node "is camera ray" output. 2017-05-10 16:03:25 +02:00
da8b34e527 Eevee: Fix some issues
Fix issue with manipulator contributing to depth.
Fix blender internal shader.
2017-05-10 16:03:25 +02:00
Dalai Felinto
7902e3f1c8 Fix multi-view (single camera) selection 2017-05-10 16:00:42 +02:00
Dalai Felinto
a438750cad Fix multi-view (single camera) manipulators selection 2017-05-10 15:54:23 +02:00
Dalai Felinto
1a6b97e98f Merge remote-tracking branch 'origin/master' into blender2.8
Note: Depth placement was working already for BI, and althugh this
commit breaks it for it, it makes it work for the draw manager engines.
2017-05-10 15:40:08 +02:00
Dalai Felinto
90997710cc Merge commit 'origin/master (9395646c2c)' into blender2.8 2017-05-10 14:21:14 +02:00
Dalai Felinto
195d0fbae3 Fixup for multi-view single eye viewport issues
In d2f1f80a6f I was always calling view3d_main_regio_setup_view with
NULL matrices, which is not always correct.
2017-05-10 13:13:55 +02:00
0722e41f9e DWM: Use Gawain for sculpt drawing
Currently only uses the simple shader.
2017-05-10 20:35:51 +10:00
Dalai Felinto
d2f1f80a6f Partial fix to Multi-View single eye issues in viewport
Handling depth loop for now (3d cursor positioning). Selection is a bit
more tricky.

Reported on 51354
2017-05-10 12:21:51 +02:00
1c18d07a1c Eevee: Make Depth of field zoom invariant.
Multiply the sensor size by the viewcamtexcofac which is basicaly how scaled is the viewport relativly to the camera frame.
2017-05-10 00:57:53 +02:00
965571cca7 Draw Manager: Handle negative scaled meshes. 2017-05-10 00:47:27 +02:00
707756d277 Draw Manager: Extend simplification to UBOs & fix a context error. 2017-05-09 23:55:19 +02:00
8277609810 Small cleanup 2017-05-09 23:55:19 +02:00
e32ec677c3 Draw Manager: Simplify usage and check for errors. 2017-05-09 23:55:19 +02:00
9075f934aa Eevee: Initial Depth Of Field commit. 2017-05-09 23:55:19 +02:00
435f5017fa GPUCompositing: Fix comment and component count. 2017-05-09 23:55:19 +02:00
1413bee158 Draw Manager: Add additive blending. 2017-05-09 23:55:19 +02:00
26b6bd6e90 Object Mode Engine: Fix grid distance if view is camera view. 2017-05-09 23:55:19 +02:00
306603ae76 GPUTexture: Add support for 32bit textures. 2017-05-09 23:55:19 +02:00
6dc8368b8f Draw Manager: Add Triangle batching and empty batch.
This is usefull for Depth Of Field because we don't need to store data for each sprites and just generate them when rendering.
2017-05-09 23:55:19 +02:00
bf0ebfca1a Draw Manager: Fullscreen triangle
Used a triangle instead of a quad for fullscreen passes.
2017-05-09 23:55:19 +02:00
9395646c2c Fix errors in vse ui commit
- Fixes double labels
- Fixes an aligned layout when un-needed
- Fixes an error were a layout can become disabled but never enabled again
2017-05-09 14:46:29 -04:00
894513c7fd Fix (unreported): Crash if a right click is performed on an image datablock (open btn f.e.).
Only access/insert the button_pointer if it's not null...
2017-05-09 20:12:25 +02:00
Dalai Felinto
75ba1826c8 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-09 17:56:16 +02:00
4d38932cb4 Cycles: Use more stable version of integer square root function
Old code was working quite unreliable in combination with fast math
flag, especially when compiling with Clang. It seems we were hitting
result of the following bug submitted to Clang [1].

Basically, it was happening so that (int)sqrtf(64) was 7 when Cycles
is built with Clang but was correct 8 when built with GCC.

This commit works this around. Annoying, but don't see other way to
keep sampling pattern the same for Clang and GCC.

[1] https://bugs.llvm.org//show_bug.cgi?id=24063
2017-05-09 17:07:17 +02:00
e20eb2dec0 Cycles: Properly free memory used by KernelGlobals
Previous logic did not free memory used by vector classes
which were storing images, causing memory leaks.
2017-05-09 17:07:17 +02:00
24a64cb414 Fix shadow shader to support core profile. 2017-05-09 16:30:40 +02:00
Dalai Felinto
65ebb668ec glPushAttrib/Pop change implementation to use a stack
The original implementation (cbd78c8126) broke depth of field.
2017-05-09 15:23:33 +02:00
98ab2c682d Fix denoiser tooltip 2017-05-09 14:44:59 +02:00
86c299c6a4 Merge branch 'master' into blender2.8 2017-05-09 14:33:05 +02:00
Dalai Felinto
dad797d037 Expose camera stereo settings in Clay engines 2017-05-09 12:33:13 +02:00
ffc95a33b6 Fix T51434: Module math operation is wrong in GLSL shading
Based on patch from @lazydodo.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2661
2017-05-09 12:32:47 +02:00
06b2f10ad1 Cycles: Enable BPT for NVidia OpenCL 2017-05-09 11:44:18 +02:00
378d44daef Fix assert failure caused by bug in sequencer interface script
If icon_only is True then one must not pass text attribute.
2017-05-09 10:44:31 +02:00
586ab120e5 Libmv: Fix strict compiler warnings, unused variables 2017-05-09 10:16:42 +02:00
382c38efae Fix T51439: Object not updated when particle system settings change in 2.8
A bit too early to disable workaround for particles.

Guess it was commented out after particles removal but was not brought back
after particles restore commit.
2017-05-09 10:05:54 +02:00
0f561da5fb UI: Editor menu, move VSE below MCE
The idea here is to keep things in a logical order to match the order of ones worflow.
This concept can be seen in Graph > Dope Sheet > NLA. This issue is mainly affecting the manual.

Fixes T50709

Differential Revision: https://developer.blender.org/D2630
2017-05-08 23:38:31 -04:00
f7ce1be694 DWM: share positions & normals in shading VBO. 2017-05-09 10:56:22 +10:00
e35e23c72c Cleanup: rename layer-names -> layer-uuid
These names are created from a hash,
don't confuse with actual layer names.
2017-05-09 10:38:52 +10:00
faba1e7d6e DWM: Tangent support for editmesh 2017-05-09 10:26:36 +10:00
54af61440e Merge branch 'master' into blender2.8 2017-05-08 17:44:17 +02:00
717d85fb1c Fix missing render update when building without OCIO but having GLSL image draw method 2017-05-08 17:43:32 +02:00
a04c29e8ab Fix crash and assert failure when using OCIO GLSL draw mode and color management disabled
The issue was happening when display device is set to None, which makes it so
all the color transformation is a no-op which does not really require any LUT.

This is something we can not know from Blender side easily, because LUT sampling
and related logic is fully done in OCIO library itself. The following happens:

- OCIO sees that no LUT is needed and uses simple pass-through logic in the
  color conversion function.

- GLSL compiles sees that uniform used for LUT is unused in the GLSL code and
  strips it out.

We can not know this from Blender side because technically any conversion to
the same space might be a no-op and that we wouldn't know without some tricky
parse of the OCIO configuration.

So for now we simply avoid crash but are disabling checks for existence of the
uniform.

Ideally would be nice to have some GLSL-code parses which gets the uniforms
from the code itself, so we can distinguish between typo in the uniform name
and uniform being optimized out.
2017-05-08 16:45:07 +02:00
883c62d5d3 Add comment about vertex format created in OCIO 2017-05-08 16:40:59 +02:00
6aa7843de7 Fix wrong attributes and shader binding in sequencer when using OCIO 2017-05-08 16:38:49 +02:00
907135011a Fix hardcoded attribute locations used in image draw 2017-05-08 16:31:10 +02:00
81ecd3f938 Fix OCIO shader being attmepted to be unbound twice 2017-05-08 15:59:00 +02:00
0719a1bce0 Merge branch 'master' into blender2.8 2017-05-08 15:51:17 +02:00
49523c4d0e Cycles: Fix compilation error with gcc-6.3.0 and debug mode 2017-05-08 15:41:28 +02:00
a1442b7cea Fix capitalization in some particle panels 2017-05-08 15:24:31 +02:00
5e82981f47 Sequencer: Fix broken interface script since 415ff74 2017-05-08 14:54:49 +02:00
2fed99ad9f Fix T51379: Entering particle edit crash (temporary)
Disabled particle edit mode for now, as there's no point in fixing it
before refactor.
2017-05-08 11:47:47 +02:00
0dd766b043 DWM: Share VBO positions & normals for mesh cache
Select, weight & color cache included redundant position and normals.

Use multiple VBO's per batch for more efficient storage.
2017-05-08 17:39:41 +10:00
6f1a8739a0 DWM: Fix face center's not working w/ hidden faces 2017-05-08 16:16:28 +10:00
ce30ab1e02 Accidentally left show_weight enabled 2017-05-08 14:44:13 +10:00
d8bf5c1378 Cleanup: use struct for custom-data offsets 2017-05-08 13:00:44 +10:00
1a869fb6b9 DWM: show weights in edit-mode
Engine collection settings aren't currently flushed,
once they are this will work as expected.
2017-05-08 13:00:43 +10:00
0927748624 Vertex color access for edit-mode
Currently not used, adding since legacy drawing can display this.
2017-05-08 13:00:43 +10:00
d94e7936ee Cleanup: style & header guards 2017-05-08 13:00:43 +10:00
d2bd9195d4 Cleanup: naming 2017-05-08 13:00:43 +10:00
1cfc48192c Fix T51432: Find Files case sensitive on win32 2017-05-08 09:44:11 +10:00
Julian Eisel
9181f13af7 Merge branch 'master' into blender2.8 2017-05-08 00:19:22 +02:00
415ff7467c UI: Cleanup VSE Properties Shelf
The goal is to reduce wasted space and improve clarity in the 'N' panel of the VSE through layout changes.
The changes are intentional conservative to avoid making people re-learn anything.

Author: @mpan3

Differential Revision: https://developer.blender.org/D2439
2017-05-07 18:13:50 -04:00
ce28025eaf Remove unused node socket flag that was added in the render pass commit 2017-05-07 20:32:51 +02:00
e518ea9b5e Cycles: Fix transform addressing in the denoiser code 2017-05-07 18:50:24 +02:00
c9451f1cff [Cycles] Fix math problems in safe_logf
log(0) is undefined and should not have been included
log(1) == 0, dividing by zero is not recommended
2017-05-07 09:16:14 -06:00
3cd27374ee Color management: add Filmic view transform to Blender configuration.
* "Filmic" and "False Color" view transforms added (sRGB display device only).
* "Very Low/Low/Base/High/Very High Contrast" looks added.
* Added filtering so that Filmic only shows look names prefixed with "Filmic - ".

Filmic Dynamic Range LUT configuration created by Troy James Sobotka with
special thanks and feedback from Guillermo, Claudio Rocha, Bassam Kurdali,
Eugenio Pignataro, Henri Hebeisen, Jason Clarke, Haarm-Peter Duiker, Thomas
Mansencal, and Timothy Lottes.

Differential Revision: https://developer.blender.org/D2659
2017-05-07 16:41:38 +02:00
c47926542a GPUMaterial: Fix regressions concerning background texco 2017-05-07 15:51:54 +02:00
2a0c91b70c GPUViewport: Make Depth texture not depth testable. 2017-05-07 15:51:54 +02:00
104e6a7b8a GPUMaterial: Make background not transparent 2017-05-07 15:51:54 +02:00
0aa2a662b9 Eevee: Add Bloom post process.
Based on Kino/Bloom v2 - Bloom filter for Unity
MIT license.
2017-05-07 15:51:54 +02:00
29c5692eba Draw Manager: Fix multiple timer query issued for one pass. 2017-05-07 15:51:54 +02:00
43b374e8c5 Cycles: Implement denoising option for reducing noise in the rendered image
This commit contains the first part of the new Cycles denoising option,
which filters the resulting image using information gathered during rendering
to get rid of noise while preserving visual features as well as possible.

To use the option, enable it in the render layer options. The default settings
fit a wide range of scenes, but the user can tweak individual settings to
control the tradeoff between a noise-free image, image details, and calculation
time.

Note that the denoiser may still change in the future and that some features
are not implemented yet. The most important missing feature is animation
denoising, which uses information from multiple frames at once to produce a
flicker-free and smoother result. These features will be added in the future.

Finally, thanks to all the people who supported this project:

- Google (through the GSoC) and Theory Studios for sponsoring the development
- The authors of the papers I used for implementing the denoiser (more details
  on them will be included in the technical docs)
- The other Cycles devs for feedback on the code, especially Sergey for
  mentoring the GSoC project and Brecht for the code review!
- And of course the users who helped with testing, reported bugs and things
  that could and/or should work better!
2017-05-07 14:40:58 +02:00
Julian Eisel
cbdaa47abb Fix unfreed render-layer properties memory after loading file
Would cause pointer to allocated memory to be overridden.
Steps to recreate were:
* Start Blender
* Save
* Open saved .blend
* Close Blender -> should report unfreed memory
2017-05-07 00:30:33 +02:00
bca6978347 Cleanup: use index syntax instead of addition
Harmless but made accessing the first element read strangely.
2017-05-07 03:21:27 +10:00
ce31a892db Cleanup: use uint/ushort for polyfill2d 2017-05-07 02:19:56 +10:00
bdb4ecfbdd Cleanup: use const pointers where possible 2017-05-07 02:12:35 +10:00
5cdd94a58e Fix PyAPI crash assigning/deleting id-properties
Caused by D113.
2017-05-06 23:30:21 +10:00
90ebf4832f Merge branch 'master' into blender2.8 2017-05-06 22:54:28 +10:00
0eef40ed51 Cleanup: unused return, redundant assignments 2017-05-06 22:43:32 +10:00
a9572c2820 PyAPI: Remove bpy.app.handlers.scene_update
This is routinely mis-used to continuously run scripts,
causing performance problems.

This should be replaced with more specific handlers, or possibly timers.
See: T47811
2017-05-06 22:24:12 +10:00
5221093512 Cleanup: naming 2017-05-06 22:23:59 +10:00
89120cd241 bmesh: use 'uint' instead of 'unsigned int'
no functional changes.
2017-05-06 14:19:08 +10:00
b85f7e288e Cleanup: line length, use const struct members 2017-05-06 11:13:14 +10:00
317544455e Add missing weight paint vertex shader 2017-05-06 01:34:43 +02:00
Julian Eisel
cffe15e9c9 Fix all objects being selected when opening pre-2.80 files
Caused by rBe87ddda149b. Selecting objects shouldn't be done in such a
low level function anyway (IMHO).
Made sure duplicating objects still works correctly.
2017-05-05 19:32:06 +02:00
d9949c351d Pass selection to weight paint vert overlay instead of colors 2017-05-05 18:23:27 +02:00
5539544958 Update paint wire when changing modes 2017-05-05 18:23:27 +02:00
Dalai Felinto
8d9c484152 Implement overridable scene render settings
This add a new set of (possible) render settings that can be defined at
the scene level and overridable at the scene layer level.

Once we get workspaces we can either add workspace inbetween scene and
scene layer evaluation. Or to replace layer settings, to avoid extra
confusion to users.

An example of this setting is "samples", as implemented now for the clay
engine.
2017-05-05 18:08:24 +02:00
741d848cf8 Fix crash with no active object 2017-05-05 17:59:08 +02:00
2eb906e1b4 Cycles: Fix access array index of -1 in SSS and volume split kernels 2017-05-05 17:54:03 +02:00
850bb7a50b Cycles: Cleanup, indentation 2017-05-05 16:54:37 +02:00
622ce5672a MakeLocal: fix bad (missing) handling of proxy_from uglyness.
Those shall not be considered while checking whether a to-be-made-local
ID will end up fully local, or still be partially used by linked data...
Even less since we already do have special handling of proxies later.

Fixes main remaining issue found with 04_01_H.lighting.blend Agent327
file, and allows us to switch back to optimized post-processing in
make_local code.
2017-05-05 16:19:16 +02:00
198248fa3d Add a new LOOPBACK flag to libquery's callbacks.
That one tags those ugly little 'from' ID pointers (shape keys and
proxies), which point back from used to user ID, and require a lot of
special care in data-block management...
2017-05-05 16:19:16 +02:00
872d8993dd Clean up weight/vertex painting code
Now passing selection state instead of colors for the wire/face mask
overlay thing. Also added masking indication on the faces in vertex
paint.
2017-05-05 15:53:37 +02:00
294ffa0d49 Masks: Fix broken animation after adding primitives
Was missing mask shape initialization.

Not ideal from the CPU ticks point of view, but will work for now.
2017-05-05 13:50:18 +02:00
Hristo Gueorguiev
8b97e42eca Cycles: Split kernel SSS & Volume data definitions cleanup 2017-05-05 13:42:26 +02:00
Hristo Gueorguiev
b9fda4480f Cycles: Show samples progress for OpenCL split kernel 2017-05-05 13:37:21 +02:00
Julian Eisel
14bf4ed194 Fix Blenderplayer linking error 2017-05-05 13:11:44 +02:00
31f2f1b5f2 Eevee: Fix compilation issue on certain driver. 2017-05-05 13:07:11 +02:00
Hristo Gueorguiev
f3c3483242 Cycles: Workaround for AMD GPU OpenCL compiler
Fix for SSS in BPT.
2017-05-05 13:00:43 +02:00
Julian Eisel
8b8792e7b8 Merge branch 'master' into blender2.8 2017-05-05 12:44:52 +02:00
a7388d650a Fix empty struct errors in paint_vertex_mode.c 2017-05-05 11:38:15 +02:00
5b6838129f Fix (unreported) memleak in Warp modifier copying. 2017-05-05 10:36:23 +02:00
52e6a6c5ef MakeLocal: switch back to secure, slightly slower final steps.
Again, Agent327's 04_01_H.lighting.blend shows some problem here, it
triggers several times the 'not used at all' assert in step 5 of secure
code, and with optimized version we lose the connection between
rigs and the main characters!

Will keep investigating on this, but for now let's try to give something
working to the studio.
2017-05-05 09:56:17 +02:00
d2cd27a39d MakeLocal: forcefully recalc affected armatures' poses.
This should not be needed imho, we already set POSE_RECALC flag
correctly there, but it still is missing actual update of poses in some
(complex and convoluted) cases. So at least for now, let's go with this
hack, it's not really harming anyone anyway.

Fixes crash in Agent327's 04_01_H.lighting.blend when making all local.
2017-05-05 09:56:17 +02:00
fbf4b2f17a Add check (error message + assert) that pose is valid in armature evaluation.
Not sure how this happens, but in some cases we can evaluate
deformations of an armature which pose is not valid, at least put a
warning here to help identifying the issue quickly.
2017-05-05 09:56:17 +02:00
ce04c7e9f6 Use immediate mode for back-buffer selection
Needed so selection works with core profile.
2017-05-05 10:37:12 +10:00
Julian Eisel
839bf119c1 Revert "Add red alert in UI controls for datablock pointer properties"
This reverts commit f5bc8ad4ce.

We agreed there needs to be a better solution for this, see comments in
rBf5bc8ad4ce87165.
2017-05-05 00:44:06 +02:00
1c2b5430ca Merge branch 'master' into blender2.8 2017-05-05 08:23:59 +10:00
57bcc19bb3 Fix reading past bounds removing from color ramp 2017-05-05 07:41:12 +10:00
97caad858f Remove redundant backbuffer/transform check
Transform no longer uses backbuffer for snap.
2017-05-05 07:06:15 +10:00
ef746be982 Cleanup: include the type of data in function name
Was confusing, some functions return vert or triangle data
but naming wasn't very clear.
2017-05-05 06:42:53 +10:00
Dalai Felinto
129355c80a Multiline support for ED_region_info_draw
Many thanks for Campbell Barton for the help here and the idea to
implement the multi-line as a new function with array as arguments.
2017-05-04 22:24:38 +02:00
d29e3ebcc6 Typo: 'Signle program' -> 'Single program' 2017-05-04 22:15:53 +02:00
6f5307e74d Draw Manager: Add a memory stats to debug view.
Adds 2 static unsigned int to Gawain and GPUTexture to roughly keep track of the memory stats on the GPU.

Stats can be view at the bottom of the GPU stats with debug value > 20.
2017-05-04 21:26:54 +02:00
4bd2429f35 Use mesh draw cache for back-buffer selection
Vertex/weight paint now work with core profile, resolves T51380.
2017-05-05 05:17:31 +10:00
9869436b89 Cleanup: use doxy categories 2017-05-05 05:07:52 +10:00
c6800dd65b Missed last commit 2017-05-05 05:06:57 +10:00
83d43a0e0b Cleanup: de-duplicate mesh data calculation 2017-05-05 04:56:28 +10:00
ed688e4843 Cycles: Fix crash when assigning KernelGlobals
The memory isn't initialized during allocation, so calling the assignment operator is a bad idea.
2017-05-04 20:49:04 +02:00
3103b819aa Vertex paint with draw manager
Reviewers: fclem

Subscribers: campbellbarton, dfelinto

Differential Revision: https://developer.blender.org/D2658
2017-05-04 20:05:59 +02:00
Dalai Felinto
b5b9b2d04d Draw Manager: Combine multiple engines info texts
This join them with \n separators.(right now they clash on top of each
other).

Note: We still need to change "ED_region_info_draw" to accept multi-line strings.
2017-05-04 19:38:16 +02:00
5b70283717 Draw Manager: Fix debugging output. 2017-05-04 19:38:03 +02:00
550b0a22ad GLSL Materials: Fix envmap node artifacts. 2017-05-04 19:12:19 +02:00
665296e6f9 Eevee: Motion blur switch 2017-05-04 19:11:20 +02:00
fbfa53ae1d GPUMaterial: Remove unused Normal input. 2017-05-04 17:42:22 +02:00
4ef0513aab Eevee: Draw background shader.
Also fixes some remaining errors caused by some matrices not updated.
2017-05-04 17:42:22 +02:00
5601a62179 Eevee: Simple Camera Motion Blur.
Disabled by default. Set ENABLE_EFFECT_MOTION_BLUR to 1 to enable.
No fancy motion blur. Use depth and camera matrix to get the motion vectors. Then blur in this direction.
Only available in camera view.
Only Camera animation is supported, does not take into account the parents motion
2017-05-04 17:42:22 +02:00
Dalai Felinto
a3d8ef059c Draw Manager: Implement render info for external engines
This can be used by any engine actually. For example to give feedback
regarding probe caching in Eevee, ....

Unline master, we try to conciliate both the original viewport info
(FPS, view name) and the render info.

Note: I had to split the function in two because the camera alpha
passepartout is handled inside the view3d_draw_region_info function.

Review: Campbell Barton and Clement Foucault.

Thanks to Sergey Sharybin and Pablo Vazquez for some of the design
discussions.
2017-05-04 16:59:58 +02:00
a523dfd2fd Fix T51412: Instant crash with texture plugged into the Displacement output
The issue was caused by unlimited textures commit, root of the issue is that
displacement code updates some of the image slots directly, so it needs to
ensure device vectors are all proper size.
2017-05-04 16:28:22 +02:00
6ea45da05c Cleanup: rename ct -> len
Also use 'defgroup' instead of 'index' for passing weight arg.
2017-05-04 23:37:03 +10:00
b180900e52 Fix missing usercount update of poselib when copying Object.
Still finding such missing cases... :(
2017-05-04 15:08:57 +02:00
e3bc021079 Add debug/timing prints in MakeLocal and remapping code. 2017-05-04 15:08:57 +02:00
Dalai Felinto
77cb570e72 Cycles: Remove "Preview active layer"
In Blender 2.8 we always only preview active layer
Also remove use_viewport_visibility since it's no longer required.

Reviewer: Sergey Sharybin
2017-05-04 13:04:07 +02:00
002b2066ac Remove cpack
Places where it's removed are already replaced by newer logic.
2017-05-04 20:50:03 +10:00
ffa31a8421 Fix use after free of new render layer ID properites after copying scene 2017-05-04 12:27:28 +02:00
0f4de9336a Fix memory leak of ID properties after recent render passes commit 2017-05-04 12:18:39 +02:00
f3550242ed Remove visibility check for project paint
This is such a corner case, and currently there is no way to paint on a
hidden object, removing.
2017-05-04 19:59:57 +10:00
Dalai Felinto
e778be9e20 Fix "doversion" of collection settings for collections
For collections we do not need a doversion as granular as the scene one.
However if a new engine settings is added we need to take care of it.
2017-05-04 11:26:29 +02:00
930f0ba702 Fix passing object to BKE_mesh_batch_cache_dirty 2017-05-04 19:31:05 +10:00
c8d45a7e97 Merge branch 'master' into blender2.8 2017-05-04 10:05:01 +02:00
Dalai Felinto
55ae54c469 Fix relationship lines in draw manager [*]
This fix doesn't really fix the situaion now because at the moment we
only flush the evaluated flags at DEG_OBJECT_ITER time, which is silly.

But it's all we can do until we have CoW.

So the parent visibility flag is not flushed. And even if we flushed its
visibility flag, we would need to rely on having the parent flag flushed
before we get to the object in question.

Anyways, take this commit as a future fix for when depsgraph comes to
rescue all our souls.
2017-05-04 09:57:20 +02:00
Dalai Felinto
b2e908f929 Fix relationship lines visibility test for legacy viewport 2017-05-04 09:47:17 +02:00
5fde78dcad Cycles: Fix unused argument warning when building without debug passes 2017-05-04 09:33:51 +02:00
Dalai Felinto
e87ddda149 Better fix for duplicate objects not moving them
(original fix on 51a977a86f)
2017-05-04 00:21:49 +02:00
Dalai Felinto
b1858b4d2f Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-03 23:55:29 +02:00
ad8587b798 [msvc/make.bat] Limit the amount of simultaneously compiled projects.
This was set to maxcpu which in an 8 core box would be 8, each project would then spawn
8 instances of cl.exe, making a possible of 64 simultaneously running compiler instances
slowing the compile down instead of speeding it up.
2017-05-03 15:15:35 -06:00
Dalai Felinto
c171f0b3c9 Fix Cycles build on Windows 2017-05-03 21:16:45 +02:00
606d1f2b6e Fix projection paint initialization failing 2017-05-04 05:09:05 +10:00
51a977a86f Select new object bases using object's base flag
This fixes object duplicate operator.
2017-05-04 05:09:05 +10:00
Dalai Felinto
628dad4f01 Fix building on Windows and blenderplayer linking after weightpaint engine
Those problems were introduced on 20f95de6ba.
2017-05-03 20:24:42 +02:00
Dalai Felinto
62189a5ab7 Fix potential crash introduced by weightpaint engine when no active object 2017-05-03 20:10:54 +02:00
8c2b98ffa5 Cleanup: line length 2017-05-04 03:35:01 +10:00
d96171ab53 Correct struct type (harmless) 2017-05-04 03:17:05 +10:00
6abcd6cfd5 Fix error in node flag check 2017-05-04 02:57:39 +10:00
20f95de6ba Weight painting with draw manager
This implements weight rendering with the draw manager, with all drawing
options (Shading, wire, face masking, vertex masking).

This is part of T51208

Reviewers: campbellbarton

Subscribers: dfelinto

Differential Revision: https://developer.blender.org/D2654
2017-05-03 18:57:35 +02:00
b9451c0493 Merge branch 'master' into 28 2017-05-04 02:58:26 +10:00
82e242cc72 Merge branch 'master' into blender2.8 2017-05-03 18:33:02 +02:00
2564d929fc Correct over-alloc struct declaration 2017-05-04 02:15:50 +10:00
Dalai Felinto
673e6fc535 Draw Manager: Bring pose bones to the pose engine
Note: We should test if the armature is the "armature modifier" parent of the
object.

If any good samaritan feels like tackling this, the function to change
is: DRW_pose_mode_armature
2017-05-03 18:06:47 +02:00
3bf31c6d23 Move pose-bone colors into draw_data
Also only allocate necessary number of bone segments.
2017-05-04 01:32:16 +10:00
15189baa52 "Fix" root cause of T51260 Forward compatibility crash fter adding new IDProp type.
We unfortunately cannot fix this for previous versions of Blender, but
at least the issue (Blender crashing on unknown IDProp types) should now
be addressed for future.

Simply reset unknown IDProp types to integer one, and reset its value to zero.
2017-05-03 17:05:28 +02:00
4cf7fc3b3a Render API/Cycles: Identify Render Passes by their name instead of a type flag
Previously, every RenderPass would have a bitfield that specified its type. That limits the number of passes to 32, which was reached a while ago.
However, most of the code already supported arbitrary RenderPasses since they were also used to store Multilayer EXR images.
Therefore, this commit completely removes the passflag from RenderPass and changes all code to use the unique pass name for identification.
Since Blender Internal relies on hardcoded passes and to preserve compatibility, 32 pass names are reserved for the old hardcoded passes.

To support these arbitrary passes, the Render Result compositor node now adds dynamic sockets. For compatibility, the old hardcoded sockets are always stored and just hidden when the corresponding pass isn't available.

To use these changes, the Render Engine API now includes a function that allows render engines to add arbitrary passes to the render result. To be able to add options for these passes, addons can now add their own properties to SceneRenderLayers.
To keep the compositor input node updated, render engine plugins have to implement a callback that registers all the passes that will be generated.

From a user perspective, nothing should change with this commit.

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

Differential Revision: https://developer.blender.org/D2444
2017-05-03 16:44:52 +02:00
1f16703792 Error in last commit 2017-05-04 00:43:54 +10:00
827818d37d Rename bPoseChannel's temp/cache pointer for DrawManager to draw_data.
More generic name, this remains a temp solution anyway, until we have
proper handling of temp data from 'magic DEG'! ;)
2017-05-03 16:18:03 +02:00
6824ee0595 Fix bad scaling of BBone single-segment bones in new Armature drawing code.
Reported by @campbellbarton over irc, thanks.
2017-05-03 16:18:03 +02:00
3c91fbf6be Draw Manager: Use color-sets for solid pose-bones 2017-05-04 00:16:31 +10:00
e0722a2c07 Draw Manager: use pose bone theme and constraint colors 2017-05-04 00:01:10 +10:00
Hristo Gueorguiev
6bf4115c13 Cycles: Split kernel - sort shaders
Reduce thread divergence in kernel_shader_eval.

Rays are sorted in blocks of 2048 according to shader->id.

On R9 290 Classroom is ~30% faster, and Pabellon Barcelone is ~8% faster.

No sorting for CUDA split kernel.

Reviewers: sergey, maiself

Reviewed By: maiself

Differential Revision: https://developer.blender.org/D2598
2017-05-03 15:30:45 +02:00
Dalai Felinto
2bec7c6070 Code Style: Don't add padding in a function call 2017-05-03 14:32:29 +02:00
60886670cd Move GPU compositing out of draw-manager off-screen drawing
Also no need to use VP_legacy_ prefix here.
2017-05-03 22:17:07 +10:00
6f9c839f44 Cycles: Fix OpenCL compilation failure after recent color changes
It is really confusing to have some functions available in some devices
and not on another devices.
2017-05-03 14:11:19 +02:00
825430c589 Cleanup: move off-screen drawing to view3d_draw.c
Since offscreen drawing now uses draw engine, this doesn't need to be
considered legacy.

Note that there are some calls into view3d_draw_legacy.c from view3d_draw.c
this is generally not accepted, so its only dont where there are checks
for new/old engine.
Functions exposed to do this use a VP_deprecated prefix.
2017-05-03 22:03:48 +10:00
a2a436bba3 Update comment 2017-05-03 22:03:48 +10:00
Dalai Felinto
5f38a4a238 Draw Manager: Enable Pose engine as part of the weight paint mode
We still need to bring pose bone drawing for the pose engine.

Note: In the future, once we get face-widget selection, we will need to
make sure the pose engien only draws then if "weight paint mode" is not
enabled too.
2017-05-03 12:41:58 +02:00
Dalai Felinto
50a7d104d2 Draw Manager: Fix pose mode not working well.
In the future this will allow us to implement things like face manipulators.

For now however, this is getting on the way of using pose mode
(mesh objects are drawn green).

NOTE: pose engine should also be the one taking care of pose bones

(and for that matter, X-Ray armature option should/could be a property
of the Pose engine even).
2017-05-03 12:16:40 +02:00
44991a0132 Cycles: Use render visibility for duplis when Render Layer option in viewport is used
Previously the logic was different for duplis and regular objects: regular objects
were using render visibility when Render Layer option is enabled which duplis were
always using viewport visibility when rendering from the viewport.

This was quite confusing because caused different results in viewport and render
when artists were expecting them to match 1:1.
2017-05-03 12:14:05 +02:00
b08fc83d1d Eevee: Fix Lamp Roughness. 2017-05-03 12:08:56 +02:00
e0fded5d3a GPUMaterial: Force old outputs to fail with EEVEE.
Workaround waiting for compatibility bit / or PyNodes.
2017-05-03 12:08:56 +02:00
5570ba9c4f NodeTree: Add eevee default shader tree. 2017-05-03 12:08:56 +02:00
a740495814 Eevee: Add "uber" Shader Output Nodes.
Include Metallic and Specular workflow.
Clearcoat and are not implemented yet.
2017-05-03 12:08:56 +02:00
54bde82445 Draw Manager: Introduce a foreach function for all shgroups in a pass. 2017-05-03 12:08:55 +02:00
bde4499496 Fix draw manager w/ cycles
8b2640f08 introduced the error,
caused by external-engine needing depth mask to be disabled,
which happened to be the case before changing state changing logic.
2017-05-03 20:12:31 +10:00
Dalai Felinto
2a86082945 Validate collection properties at readile
The alternative would be to do version bump + doversioning every
time a new property is added.
2017-05-03 11:51:49 +02:00
Dalai Felinto
66c74242bb Make IDP_MergeGroup recursive
With this we also do not need IDP_MergeGroupValues anymore.
If this causes problems in the future we can always make recursion an
option (like overwrite is).
2017-05-03 11:51:49 +02:00
cea0236026 Cycles: Simplify code in SVM image by using new utility function
Can not measure any performance difference, so seems the code is identical
and just shorter.
2017-05-03 11:22:48 +02:00
e616cd5706 Cycles: Add utility function to convert float4 color from srgb to linear
It will use SSE2 optimized version when is possible.
2017-05-03 11:19:40 +02:00
bf0ac873ba Fix crash loading files where outliner treestore isn't set 2017-05-03 18:13:09 +10:00
d116932f3a Add BBone and Wire Armature draw types to DrawManager.
Most of this was copying/adapting code from octahedral existing draw
code, tough part was to get BBone matrices to behave as expected, they
are using a fairly specific setup...

Addresses T51365 and T51362.
2017-05-03 08:37:24 +02:00
8b2640f088 Draw Manager: fix draw-state switching logic
Changing states didn't properly reset between shading groups
causing the GL state to be wrong based on draw order.

States are now only set when changed.
2017-05-03 08:24:50 +10:00
85ca3156fc Cleanup: typedef for empty list
Without this the intent isn't clear.
2017-05-03 05:21:55 +10:00
1b6c21c03b Workaround external engines with OpenGL rendering
For now just do the OpenGL render and don't render using the engine.
This is a slightly odd-use case since it makes more sense to do a regular render.
2017-05-03 05:06:13 +10:00
d187014675 Cycles: Remove extra clFinish from driver workaround
These were causing problems with Nvidia OpenCL.
2017-05-02 14:26:46 -04:00
299d839dc5 Cycles: Output split state element size 2017-05-02 14:26:46 -04:00
915766f42d Cycles: Branched path tracing for the split kernel
This implements branched path tracing for the split kernel.

General approach is to store the ray state at a branch point, trace the
branched ray as normal, then restore the state as necessary before iterating
to the next part of the path. A state machine is used to advance the indirect
loop state, which avoids the need to add any new kernels. Each iteration the
state machine recreates as much state as possible from the stored ray to keep
overall storage down.

Its kind of hard to keep all the different integration loops in sync, so this
needs lots of testing to make sure everything is working correctly. We should
probably start trying to deduplicate the integration loops more now.

Nonbranched BMW is ~2% slower, while classroom is ~2% faster, other scenes
could use more testing still.

Reviewers: sergey, nirved

Reviewed By: nirved

Subscribers: Blendify, bliblubli

Differential Revision: https://developer.blender.org/D2611
2017-05-02 14:26:46 -04:00
89b1805df6 BGE: Fix silly typo that invalidates negative scaling camera feature.
Negative scale on camera is a nice trick to invert render image on one
axis at no extra CPU cost. It was implemented in the Decklink branch but
I introduced a typo when porting it to master. It is now fixed.
2017-05-02 20:11:02 +02:00
075638f85c Cleanup: consistent arg order 2017-05-03 03:06:37 +10:00
3f567535da Draw Manager: OpenGL render support
Works for clay-engine but doesn't draw objects with eevee.
2017-05-03 02:52:39 +10:00
2b0f02057f Draw Manager: split DRW_draw_view into 2 functions
Needed for offscreen render
2017-05-03 00:45:10 +10:00
47239b4041 Cleanup: use depsgraph for scene/layer access 2017-05-03 00:14:54 +10:00
22855f1a60 Merge branch 'master' into blender2.8 2017-05-02 15:41:15 +02:00
4846184095 Cycles: Fix missing type declaration in OpenCL image
Spotted by Mai in IRC, thanks!
2017-05-02 15:39:33 +02:00
143d7ad40f Revert "Depsgraph: Link from material to object shading"
The change was initially needed for Blender 2.8 branch but the actual
function was reverted in there. So no reason to keep dead unused
placeholder in the dependency graph.

This reverts commit fd69ba2255.
2017-05-02 15:31:49 +02:00
7f833c0da8 Merge branch 'master' into blender2.8 2017-05-02 15:29:00 +02:00
Dalai Felinto
ec9ce9e118 Draw Manager: No need of glScissor for external engines 2017-05-02 15:26:18 +02:00
Dalai Felinto
8c660c7801 Cycles integration with Draw Manager
We can now use object and other modes on top of Cycles.
Since we are now always on "render_to_view" (old Rendered mode), the
pause button is always visible.
2017-05-02 15:13:50 +02:00
61b77d8948 OCIO: Fix crash cause by bad IMM usable. 2017-05-02 15:13:12 +02:00
4384a7cf46 Cycles: Fix CUDA split kernel
Global size y needs to be a multiple of 16.
2017-05-02 15:03:51 +02:00
4174e533c0 Cycles: Cache split kernels in CUDA device
This way we don't re-load kernels for every sample in the viewport.
Additionally, we don't risk global size changed inbetween of samples.
2017-05-02 15:03:12 +02:00
Dalai Felinto
d3964db5bd RNA: Remove remaining relevant scene->basact and BaseLegacy
Note: In one case (rna_Scene_editmesh_select_mode_set) I had to resort
to the temporary solution of BKE_scene_layer_context_active.

This is fine for now, but it will be a problem once workspaces are
introduced. In this case the fix is to use a temporary value in the set
routine, and actually only set the active object in the update function
(which can take bContext).
2017-05-02 12:59:07 +02:00
a9d6a07d78 Add scene argument for notifiers
From workspaces branch
2017-05-02 09:58:01 +10:00
7eebc5113c Eevee: Add support for legacy materials node. (not PBR) 2017-05-01 18:11:21 +02:00
62ea911e1a GPUMaterial: Making material node tree compatible with new drawmanager.
- code_generate_fragment : Making sure that shaders uses the new uniforms.
- code_generate_vertex_new : create require attribute based on their names and not their id (see draw_cache_impl_mesh.c).
- add support for ramp textures.
2017-05-01 18:11:21 +02:00
19f86a3d5f Mesh Batch Cache: Add support for uv/vcol/tangent data layers.
This is a bad implementation waiting for some improvement that are :
- Gawain support for multiple names. -> will remove duplication of attribute alloc
- Glsl safe name string escaping. -> will remove any risk of hash colision.

Old glsl drawing was relying on attribute being choosen by DerivedMesh at drawing time.
For this reason, we declare all possible attrib "name" for each data layer inside the batches.
In the glsl code, we declare required data by type and name.
Then Gawain only bind vbos if names correspond.
This is way cleaner as we do not need to access the CD itself when drawing.

One other problem is that the hash maybe 11 caracters long and rapidly overload gawain's attrib name buffer.
2017-05-01 18:11:21 +02:00
27fc8ae1cb Eevee: Change MAX2 to max_ff 2017-05-01 18:11:21 +02:00
e868b459bb Eevee: World nodetree gpumaterial compatibility.
- Unify GPUMaterial creation (world/mesh).
- Support for multiple shader variations (not used for now).
- Convert GPUInputs to DRWUniforms to be used with the draw manager.
- Nodetree Update is not supported. The only way to refresh the shaders is to change render engine.
- Cleanup in GPUPass.
- Add new temporary Node Compatibility type. Compatibility types should be removed in the future.
2017-05-01 18:11:21 +02:00
2f100c13ee Getting rid of setlinestyle: FCurves drawing. 2017-05-01 17:43:51 +02:00
9c73cead49 Getting rid of setlinestyle: last bit in NLA.
Note that smooth-shaded outlines of muted NLA strips should also be
dashed, not sure how to do that currently (in a simple way), so kept
them solid for now.
2017-05-01 17:43:51 +02:00
Dalai Felinto
d5acf4f467 Fix for issue when duplicating text objects
The crash happens with Cycles and Font objects if we get Cycles working
with draw manager.
2017-05-01 16:48:09 +02:00
bb5f4a1f67 Cleanup/followup to previous commit: get rid of dashed-specific helpers.
Those are no more needed.
2017-05-01 16:32:55 +02:00
d7d4bca23b Reworked version of dashed line shader.
Using geometry shader allows us to get rid of the 'line origin' extra
vertex attribute, which means dashed shader no longer requires fiddling
with those vertex attributes definition, and, most importantly, does not
require anymore special drawing code!

As you can see, this makes code much simpler, and much less verbose,
especially in complex cases.

In addition, changed how dashes are handled, to have two 'modes', a
simple one with single color (using default "color" uniform name), and a
more advanced one allowing more complex and multi-color patterns.

Note that since GLSL 1.2 does not support geometry shaders, a hack was
added for now (which gives solid lines, but at least does not make
Blender crash).
2017-05-01 16:32:55 +02:00
Dalai Felinto
6ef497d401 WITH_CLAY_ENGINE: Should be used for CLAY only, not drawmanager 2017-05-01 15:44:50 +02:00
Dalai Felinto
22be057e37 Draw Manager: Fix copy-paste harmless comment "typo" 2017-05-01 15:44:50 +02:00
ea9d163644 Blender 2.8: Update arc config 2017-05-01 15:20:19 +02:00
c899c7c9e1 Check we've got GLEW version 2 when building with core profile
There was a bug in older GLEW version which kept glGenVertexArrays as NULL
when 3.2 core context is requested [1].

Didn't find a way to check GLEW version from CMake, it seems the version
is not really exposed to the header.

[1] https://sourceforge.net/p/glew/bugs/124/
2017-05-01 10:37:04 +02:00
fc8f428224 fix typo in WITH_SYSTEM_GFLOG in CMakeLists.txt 2017-04-30 10:52:38 -06:00
c4491d76ed Getting rid of setlinestyle: sample line in Image space. 2017-04-29 20:41:57 +02:00
74f9d31409 Getting rid of setlinestyle: UV editor drawing. 2017-04-29 20:12:30 +02:00
785950c18a Getting rid of setlinestyle: remove gpencil's debug-only dashed line drawing.
No need to add extra complexity of conditional dashing here for now!
2017-04-29 19:42:04 +02:00
c5fd6acfce Getting rid of setlinestyle: ed_util's pos-to-mouse dashed line. 2017-04-29 19:40:32 +02:00
b1b8ce0bbf Getting rid of setlinestyle: GPencil eraser.
Note the ugly hack on number of segments for outline dashed circle, to
get an OK-ish rendering of dashes...
2017-04-29 19:31:36 +02:00
45eaad88e2 Getting rid of setlinestyle: add imm_draw_circle_wire_dashed() util.
Needed a bit of twisting in generic private func behind the imm_draw_circle
helpers, but think it's fine.

Note that this demonstrate yet another downside of new dashed shader
compared to olde line style: not only does it needs more complex setup,
and can only work with PRIM_LINES type of primitives, but it also
behaves totally wrong with chained short segments!

We really need to find a better way to do this effect at some point. :(
2017-04-29 19:31:36 +02:00
8f5f4241c0 Cleanup: comment blocks 2017-04-30 03:14:57 +10:00
fbd172a00a Merge branch 'master' into blender2.8 2017-04-30 03:06:42 +10:00
0fbce637b3 Cleanup: comment blocks 2017-04-30 02:58:36 +10:00
a1164eb3dd View3D: support both orbit select & depth
When using both preferences, use cursor depth when nothings selected.
2017-04-30 02:41:25 +10:00
47769b5f40 Curve Fitting: minor change to re-fitting method
Avoid calculating a new split-index when re-fitting.

While checking if a knot can be removed, the index with the highest error
can be used as a candidate to replace the knot
(in the case it can't be removed).
2017-04-30 00:01:16 +10:00
b0a72c98bb Getting rid of setlinestyle: NLA (part I).
Also restore drawing of local action markers in NLA strips...

Note: there is another usage of setlinestyle in this file, not sure how
to hanlde it for now, so will leave it for later...
2017-04-29 13:19:17 +02:00
56e10c1997 Getting rid of setlinestyle: Color ramp markers. 2017-04-29 12:57:14 +02:00
d2589b0a31 Getting rid of setlinestyle: Text space margin line. 2017-04-29 12:43:37 +02:00
8f028ec840 Cleanup: rename struct for private engine data
Also remove from pass list (there were some duplicate unused entries).
2017-04-29 16:52:12 +10:00
33a5248b6c Merge branch 'master' into blender2.8 2017-04-29 16:32:30 +10:00
6d73e2d3cf Cleanup: unused includes 2017-04-29 16:27:29 +10:00
b5298bf819 Cleanup: menu example
remove some redundant checks, imports
2017-04-29 16:20:06 +10:00
Dalai Felinto
de9e45a88b blenderplayer: fix warnings in stubs 2017-04-29 02:07:39 +02:00
8f66d6826b Cycles: Fix crashes after recent image changes
Not sure if this is a proper fix, but was getting frequent crashes, so
committing this real quick just to make master sable again. Can be
reverted later if there's a better fix. The changes to images really
need a closer look...
2017-04-28 18:54:18 -04:00
Dalai Felinto
e702b391ed Draw manager: Style cleanups 2017-04-29 00:54:11 +02:00
d6963630dc Implementation of custom python entries in all right click menus
Hi Guys,

as one of my clients needs the possibility to have custom menu entries in the general right click menu (all over Blender: in the node editor, properties, toolbars,..) I talked with Campbell about expanding our hard coded menu a bit. This is the outcome. As I only need those two, I support currently a button_prop and a button_pointer.

{F540397}

I tested the changes with a custom script where I added a custom entry and executed an operator on click - it seems to work exactly how it's intended to. The script: {F540435}

As I'm not too experienced in rna stuff I would really appreciate any review.
Thanks very much Campbell for his open ears & help on this issue!

Reviewers: campbellbarton, mont29

Reviewed By: campbellbarton, mont29

Subscribers: sybren, mont29

Tags: #addons

Differential Revision: https://developer.blender.org/D2612
2017-04-28 23:44:52 +02:00
b2178472e9 Disable custom armature colors 2017-04-29 04:26:31 +10:00
04f43d4cdf Merge branch 'master' into blender2.8 2017-04-29 03:39:24 +10:00
Dalai Felinto
b868f43fd3 Cycles support for preview on viewport with core profile
This upgrade the drawing code to use latest opengl calls.
Also, it adds a fallback shader for opencolorio.

Reviewers: sergey, brecht
Subscribers: merwin, fclem

Differential Revision: https://developer.blender.org/D2652
2017-04-28 19:25:57 +02:00
ba4f47ce8e Getting rid of setlinestyle: Clip drawing code.
This one has been painful, it's doing lots of nifty conditional drawing
of all kind... Also, very nice illustration of how cumbersome it is to
use dashed shader currently, we really need to find a simpler way at
some point imho. But this is not critical issue either, for now we can
live with some uglyness like that. :/
2017-04-28 19:22:45 +02:00
9fe19437e9 Getting rid of setlinestyle: markers' dashed line in VSE. 2017-04-28 19:22:45 +02:00
5e04e4eb0d Merge branch 'master' into blender2.8 2017-04-29 03:24:03 +10:00
af3f7db4ec Fix T51324: Auto-Depth fails rotating out of camera 2017-04-29 03:21:03 +10:00
9ebd737df3 Cycles: Use relative path for #line directives
This way moving Blender bundle around doesn't re-trigger kernels compilation.
2017-04-28 17:46:11 +02:00
b46aad19c0 Libmv: Make ERROR a default printing severity 2017-04-28 16:47:35 +02:00
c648ddb9a1 Cycles: Correct comment after previous commit 2017-04-28 16:47:24 +02:00
9ff88a596c Cycles: Lower default severity level to ERROR 2017-04-28 16:46:30 +02:00
074c5f0d26 Merge branch 'master' into blender2.8 2017-04-28 15:52:07 +02:00
08142dde2c Hide object center and other info when drawing sets 2017-04-28 23:52:02 +10:00
aa88796a6c Alembic: use object-oriented approach in ABC_read_mesh()
This is easier to extend than the if/else if/else chain that was in place,
and allows for somewhat more granular error messages.
2017-04-28 15:33:57 +02:00
2e67a20045 Alembic: Construct ISampleSelector once and pass along 2017-04-28 15:33:57 +02:00
1e8d7f3b25 Fix T51331: fixes for Alembic unit tests on Windows 2017-04-28 15:28:41 +02:00
f383c926b4 Cycles: De-duplicate bit magic for decoding image options in OpenCL kernel 2017-04-28 15:20:34 +02:00
f8d0b27d9d Cycles: Simplify code around maximum OpenCL info size allocation 2017-04-28 15:15:15 +02:00
407fd66d0a Cycles: Cleanup, de-duplicate image packing of various types 2017-04-28 15:08:54 +02:00
886966aa38 Correct comment, we need wire_outline data in this case 2017-04-28 23:04:29 +10:00
0f339a748e Cycles: Quick (real) fix for broken textures on OpenCL
Previous fix did not work for mixed textures. This one will over-allocate
information array, but it's better than not being able to render at all.

Some more cleanup and improvement is coming.
2017-04-28 14:56:22 +02:00
1ec59c8e06 Revert "Cycles: Fix image textures were completely broken since recent unlimited textures commit"
This reverts commit 8f4166ee49.

The fix was not correct for cases when we've got float textures.
2017-04-28 14:48:40 +02:00
0e94d91048 Draw Manager: pose-mode custom bone display 2017-04-28 22:31:58 +10:00
06034b147a Cycles: Cleanup, spelling and braces 2017-04-28 14:10:21 +02:00
8f4166ee49 Cycles: Fix image textures were completely broken since recent unlimited textures commit
The indexing was totally wrong in both image packing code and image sampling in kernel.

Fixes T51341: Cycles OpenCL corruption in todays buildbot
2017-04-28 14:04:27 +02:00
e3fc945fe2 Cycles: Cleanup, always use braces for blocks 2017-04-28 13:39:14 +02:00
82e5f60302 Cycles: Cleanup, indentation in preprocessor 2017-04-28 13:24:09 +02:00
20ebeb1a15 Cycles: Cleanup, use ccl::vector instead of std::vector 2017-04-28 13:22:07 +02:00
4245ed360e Cycles: Cleanup, indentaiton and trailing whitespace and wrapping 2017-04-28 13:21:17 +02:00
cc43dd054f Recent commit state broke lattice vertex drawing
e4d856e3 caused lattice vertices not to draw in editmode.
2017-04-28 18:43:46 +10:00
226b6e60b9 Fix draw manager draw-modes interfering with eachother 2017-04-28 05:22:30 +10:00
a680bcd13b Draw Manager: basic text overlay support 2017-04-28 04:54:04 +10:00
e4d856e31b OpenGL: manage legacy state only when WITH_LEGACY_OPENGL=ON
- enabled lights
- alpha test
- texture environment
- point sprites (always enabled in modern GL)

Moved is_clip_plane for better struct packing, no functional change there.

Part of T51164
2017-04-27 14:32:47 -04:00
079e0b5943 OpenGL: don't set texture LoD bias via glTexEnvf
Not supported in core profile. We could do this in GLSL if it's really needed.

Part of T51164
2017-04-27 14:24:32 -04:00
0d5c5a8438 OpenGL: early exit from functions that don't mix with core profile
These parts will not be part of final viewport, but are called indirectly during the transition. To avoid runtime errors on core profile, exit early -- functions effectively do nothing.

I put the early exits inside the functions to avoid cluttering the code that calls these. But (long term) the calling functions need to change.

Basic shader's detect_options function was unused and full of old, so I deleted it.

Part of T51164
2017-04-27 14:21:12 -04:00
99fde39f49 OpenGL: fix color logic op
GL_LOGIC_OP is a synonym for GL_INDEX_LOGIC_OP, from OpenGL 1.0's indexed color drawing. It's not part of modern GL and causes an error in core profile.

GL_COLOR_LOGIC_OP is still supported in the latest GL. It's the last stage before writing to the framebuffer.

Part of T51164
2017-04-27 14:19:03 -04:00
87a66864bc Add back text color for legacy drawing 2017-04-28 03:05:24 +10:00
75fac519c0 Gawain: safely orphan immediate mode's VBO
There are multiple ways to orphan a buffer resource, and this code picks the oldest/safest way no matter which OpenGL version we're running.

TODO: use other (more recent) methods after thorough testing

Follow up to 8e0c57a812
2017-04-27 11:43:25 -04:00
741ed16d13 OpenGL: don't glGet(GL_RED_BITS) in core profile
or GREEN or BLUE. These are deprecated and cause errors under core profile.

TODO: get color depth value another way

Part of T51164
2017-04-27 11:43:25 -04:00
bfaf7a3eb1 OpenGL: stop enabling GL_TEXTURE
Texturing is always enabled in GLSL. Simply use a sampler in the shader.

Replaced gpu_generate_mipmap with glGenerateMipmap since the former just Enabled/Disabled the texture target and called the latter.

Part of T51164
2017-04-27 11:24:35 -04:00
a49708a691 OpenGL: stop using GL_NORMALIZE
With GLSL there is no need for GL_NORMALIZE. We explicitly normalize in the shader, or (better) send in unit vectors.

Part of T51164
2017-04-27 10:35:12 -04:00
34c808287e Gawain: fix pointer arithmetic warning
void* + offset = ???

This Mac-only code works, but wasn't strictly correct. clang doesn't warn about this, gcc does.
2017-04-27 09:59:19 -04:00
9a193a28c4 fix Clay compatibility comment
When building WITH_LEGACY_OPENGL, Mac uses GL 2.1, Mesa uses GL 3.0. Has nothing to do with Intel!

Clay assumes GL 3.3 is available.
2017-04-27 09:30:49 -04:00
1dbb41f195 OpenGL: restore all 8 lights
fixes a copy/paste mistake
2017-04-27 09:30:48 -04:00
5c7b8cfffa OpenGL: remove GL_MAP1_VERTEX_3
This is related to OpenGL evaluators (old feature). From my understanding, we don't seem to be actually using it.

Part of T51164
2017-04-27 09:30:48 -04:00
6f0cf4a804 support OpenGL 3.0 on Linux only when WITH_LEGACY_OPENGL=ON
Part of T49012
2017-04-27 09:30:48 -04:00
cbaacc08dc Getting rid of setlinestyle: transform code.
Note that I also made 'dash anchor point' consistent (the static one,
not the mouse one), in previous code somtimes dashed were anchored to
the static center point, in others, to the moving mouse position, the
later was rather disturbing imho...
2017-04-27 15:28:30 +02:00
a85f457195 Fix: T50271: Bilateral/Directional blur's iterations is zero by default
Differential Revision: https://developer.blender.org/D2632
2017-04-27 09:00:11 -04:00
b649f53a62 Error in last commit 2017-04-27 22:01:31 +10:00
23b8fa5299 Cleanup: split cmake source/headers 2017-04-27 21:58:43 +10:00
e9ccc98877 Revert "Fix T51328: Add note to cmdline help that threads must be first"
The help message already notes that argument order matters,
and this doesn't need to be the first.
2017-04-27 21:48:06 +10:00
98b6c6f2c0 Merge branch 'master' into blender2.8 2017-04-27 21:42:08 +10:00
bdf8ad6c4e Cleanup: spelling 2017-04-27 21:41:03 +10:00
ed14c15b7a Cleanup: remove unused matrix arg 2017-04-27 21:41:03 +10:00
21d31f8f58 3D widgets were obscured by view geometry 2017-04-27 19:43:27 +10:00
acec2a92ef Pose-mode drawing used alpha where it shouldn't 2017-04-27 19:31:19 +10:00
a00f54332d Cleanup: Some style and code tweaks to Image Code after changes.
Whitespace and order of switch/case etc. Let's try to stick to float4/byte4/half4/float/byte/half order as defined in "ImageDataType".
2017-04-27 11:11:08 +02:00
a845fc0d39 Fix gpuScaleUniform (caused strange pose-bone size) 2017-04-27 18:44:57 +10:00
f4c548ce2b Use pose-mode colors for pose-bone drawing
Also move static vars into structs
2017-04-27 18:17:47 +10:00
Stefan Werner
ec25060a05 Unlimited number of textures for Cycles
This patch allows for an unlimited number of textures in Cycles where the hardware allows. It replaces a number static arrays with dynamic arrays and changes the way the flat_slot indices are calculated. Eventually, I'd like to get to a point where there are only flat slots left and textures off all kinds are stored in a single array.

Note that the arrays in DeviceScene are changed from containing device_vector<T> objects to device_vector<T>* pointers. Ideally, I'd like to store objects, but dynamic resizing of a std:vector in pre-C++11 calls the copy constructor, which for a good reason is not implemented for device_vector. Once we require C++11 for Cycles builds, we can implement a move constructor for device_vector and store objects again.

The limits for CUDA Fermi hardware still apply.

Reviewers: tod_baudais, InsigMathK, dingto, #cycles

Reviewed By: dingto, #cycles

Subscribers: dingto, smellslikedonkey

Differential Revision: https://developer.blender.org/D2650
2017-04-27 09:35:22 +02:00
2d11d7c570 Cleanup: use doxy groups for armature 2017-04-27 17:06:52 +10:00
a4b97390d9 Fix basic pose-mode select drawing 2017-04-27 16:57:11 +10:00
58e61446df Fix wrong scene assigned when using sets
Depsgraph was left with wrong set-scene.
2017-04-27 16:21:56 +10:00
4afbd08941 Fix/workaround crash with non mesh geometry
eevee was crashing on curve grometry, draw without material for now.
2017-04-27 15:56:04 +10:00
a6b9bd023b Fix T51328: Add note to cmdline help that threads must be first 2017-04-26 22:48:18 -04:00
d8ce3ed140 Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
2017-04-26 21:28:16 +02:00
c6bf5d4724 Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
2017-04-26 21:28:16 +02:00
38563bad9d Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
2017-04-26 21:28:16 +02:00
25b2dfcbf0 [msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds. 2017-04-26 21:28:16 +02:00
4b682fa3e7 Getting rid of setlinestyle: Paint 'line' strokes. 2017-04-26 21:22:05 +02:00
cf959dc03a Getting rid of setlinestyle: armature drawing code.
Firts usage of 3D version of new dashed line shader... Though not sure
whether that code will be kept for long?
2017-04-26 20:57:18 +02:00
bb43dff935 Add 3D version of dashed line shader.
This is actually nearly same code as 2D version, maybe we can
deduplicate that later?
2017-04-26 20:57:18 +02:00
224f148e22 2D dashed line shader: changed to use viewport side instead of scale.
The scale version was working(ish), but it was not really extendable to
a 3D line version of the shader.

Also note that sequencer view still keeps its 'UI scale' adaptation
(dashes grow together with UI scale setting). Would be nice to do that
everywhere ultimately imho, but nothing urgent here.
2017-04-26 20:57:18 +02:00
795e839d3b Cleanup: rename select engine -> basic
This is used by depth drawing too and had no selection specific code.
2017-04-27 02:51:07 +10:00
a7c5d2e159 Pass graph to depth functions 2017-04-27 02:36:56 +10:00
edd1512741 Draw Manager: cleanup, use doxy categories
Also add DRW_state for accessing current draw state.
2017-04-27 02:04:56 +10:00
7631f4bf6d Draw Manager: use engine drawing for depth drawing 2017-04-27 01:43:05 +10:00
f59d3a7b0c View3D: move depth drawing into own function
No functional changes
2017-04-27 01:01:43 +10:00
c9d4a0930b Merge branch 'master' into 28 2017-04-27 00:58:28 +10:00
dc27d31a21 Merge commit 'master@6ed15c5a41130b55cb57a43a8a9470a91d38c3d5' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
2017-04-26 16:50:29 +02:00
7c1263c1ee Cycles: Allow samples to finish in split kernel to avoid artifacts when canceling
Previously canceling a render done by the split kernel could cause artifacts
such as very bright or dark tiles. This was caused by unfinished samples
being included in the output buffer. To avoid this we now wait till all the
currently rendering samples have finished, up to a limit of twice the
expected time for them to finish (currently this is no more than 20 seconds,
but usually its much less). If samples still haven't finished by then we
stop anyways in case there's an endless loop occurring.
2017-04-26 10:48:15 -04:00
90b2539248 Cycles: Change OpenCL split kernel to use single program by default
Single program builds twice as fast as multi programs, so its better for
users to have it as the default.
2017-04-26 10:48:15 -04:00
fe81a32f69 Cycles: Enable Correlated Multi Jitter for OpenCL and split kernel
Testing showed no issues so there's no reason to not have this.
2017-04-26 10:48:15 -04:00
c13acebd61 [msvc/make.bat] Provide a convenience rebuild.cmd in the build folder for easy rebuilds. 2017-04-26 08:46:35 -06:00
be60e9b8c5 Cycles: Fix over-allocation of triangles storage for triangle primitive hair
Was also causing some bad memory access caused by read data from non-initialized
arrays.

Repoted by bzztploink in IRC, thanks!
2017-04-26 16:00:02 +02:00
e6954a5a7c Fix race condition invalidating object data's bounding box 2017-04-26 16:00:02 +02:00
e61ba39e7c Ensure task scheduler exists before any threading starts in Blender 2017-04-26 16:00:02 +02:00
e2f8bb56d6 Avoid race condition copying Scene for off-thread OpenGL image save 2017-04-26 16:00:02 +02:00
c0f555905d User preferences: Use checkbox for Cycles device selection
It was totally unclear whether the device is enabled or disabled.
Lots of people got fully lost in the current interface.

While the solution is not fully ideal, it is at least solves
ambiguity in the interface.
2017-04-26 16:00:02 +02:00
146db944e5 Threading: Remove thread lock which seems useless
Render data is never guarded by image drawe lock.
2017-04-26 16:00:02 +02:00
449ad35093 Move depth select loop into its own function
Useful for splitting out draw logic in 2.8x
2017-04-27 00:01:23 +10:00
6ed15c5a41 Alembic export: support simple child hairs (Fix T51144)
Simple child hairs don't have a face index number assigned, so the
call to dm->getTessFaceData(dm, num, CD_MFACE) would cause a crash. To
work around this, UV and normal vectors are copied from the parent
hair.

I've also removed an unnecessary call to dm->getTessFaceArray(dm);

Reviewers: kevindietrich

Differential Revision: https://developer.blender.org/D2638
2017-04-26 15:31:03 +02:00
51e3a184ea Alembic: fixed indentation 2017-04-26 15:19:37 +02:00
ef80164e1c Alembic: fixed memory leaks 2017-04-26 15:19:37 +02:00
20621d46d1 Alembic: fixed refcount issue when duplicating imported objects
Duplicating an imported object didn't increment the cache reader's refcount,
whereas removing the duplicate did decrement it. This caused problems.
2017-04-26 15:19:37 +02:00
ff1f115706 Fix T51280: Alembic: Crash when removing cache modifier
The calls to id_us_plus/min were unnecessary (and caused assertion
failures) as this is already taken care of by transformcache_id_looper().
2017-04-26 15:19:37 +02:00
7517cf6bbb Getting rid of setlinestyle: 3DView ruler. 2017-04-26 15:19:03 +02:00
318216e677 Gawain: add immAttrib2fv helper. 2017-04-26 15:19:03 +02:00
75e9d59b96 Getting rid of setlinestyle: non-camera 3DView render border.
Also fixed wrong color for in-camera render border, and added a comment
to imm_cpack about expected color components order in integer parameter.
2017-04-26 15:19:03 +02:00
Dalai Felinto
e791e01c0b Fix material preview for Cycles and BI
I had to update the .blend files too, and get them to use collections over the nameless old layers.
2017-04-26 14:37:18 +02:00
b38d87fbaf Last commit broke object-armature select 2017-04-26 22:39:12 +10:00
aca6a12330 Draw Manager: pose-bone selection 2017-04-26 22:28:42 +10:00
87f483debb OSX buildbot: remove redundant option 2017-04-26 14:28:36 +02:00
c1aea353ae OSX buildbot: disable unsupported calls for now and use quicktime off default 2017-04-26 14:04:09 +02:00
f351cb5479 Avoid platform dependant PATH_MAX 2017-04-26 21:06:00 +10:00
ec442224df Getting rid of setlinestyle: Squencer space.
Not much to add here, except that it needs the scale of its MVP matrix
to be taken into account here...

Reviewers: merwin, dfelinto

Differential Revision: https://developer.blender.org/D2647
2017-04-26 12:26:30 +02:00
9b3e3d4def Alembic export: also export empties
Exporting an empty creates an Alembic XForm object. The empties can also
be animated.
2017-04-26 12:26:21 +02:00
afe1c25d06 Alembic export: renamed func object_is_shape → object_type_is_exportable
The function doesn't return whether the object is a shape at all, since
it also returns true for camera objects (and soon also for empties). It
returns true when objects of this type can be exported to Alembic at all.
This is now reflected in the name.
2017-04-26 12:25:45 +02:00
8de3778d11 Getting rid of setlinestyle: 3DView camera view.
Use new 2D dashed line shader in 3DView camera view.

Note that this also involved converting UI_draw_safe_areas() to this
dashed shader, which means it cannot be used anymore with other shaders.

Part of D2647.
2017-04-26 12:17:46 +02:00
88a7d3438d Move imm_draw_line_box_dashed to GPU_immediate_util. 2017-04-26 12:11:40 +02:00
621b8bdf86 Tweak 2D line dashed shader to take a scale parameter.
Even though in some cases this does not seems useful, in others (like
zommed 2D views) we have to correct MVP matrix scaling to get fixed
dashes size.

Note that we could do that differently (commented about it in shader),
would also have been cleaner to extract that MVP scale from within the
shader, but there does not seem to be a way to initialize uniform values
from within a shader, and would rather avoid recomputing the scale for
every run (especially since 3DViewport does not need it e.g.).

Part of D2647.
2017-04-26 12:04:35 +02:00
80b49c1521 UI utils: add helper to get float3 blended color from theme. 2017-04-26 12:00:15 +02:00
2387ba93d2 BLI_math: add helper function to extract XY 2D scale from a 4D matrix. 2017-04-26 12:00:15 +02:00
Dalai Felinto
b2fde7b1ee Silence eevee warnings 2017-04-26 11:25:43 +02:00
Dalai Felinto
c2e91bcfc4 Proper fixup for selection and core
That still not ideal, but so be it. IS_VIEWPORT_LEGACY should be
removed anyways, this is code from pre-draw manager and the
"modern viewport" as well as legacy will go away entirely once the draw
manager is feature complete.
2017-04-26 11:21:55 +02:00
Dalai Felinto
8b4941b7c5 Revert "Fixup for "always use selection in core""
This reverts commit 535cf2c714.
2017-04-26 11:19:15 +02:00
Dalai Felinto
535cf2c714 Fixup for "always use selection in core"
In my previous commit [1] I forgot one of the if() calls. Handled it
differently now.

[1] dc1f491a50
2017-04-26 11:13:22 +02:00
Dalai Felinto
b27775138b Pass depsgraph via Context to selection code 2017-04-26 11:05:04 +02:00
Dalai Felinto
dc1f491a50 Selection: Always use new selection code when building with using core profile 2017-04-26 10:42:40 +02:00
Dalai Felinto
f88e6763d6 Depsgraph and selection: Flush selcol on Depsgraph
Selection code needs to iterate over DEG_OBJECT_ITER otherwise we won't
get modifiers, dupli objects, ...

Also make selection respect selectability flag.

Review by: Sergey Sharybin
2017-04-26 10:42:40 +02:00
edc9f8b766 Alembic: shortened CacheFile.filepath to 1024 bytes again
As per discussion on 3128600a8a
2017-04-26 10:42:20 +02:00
268cb5fbd3 Alembic: fixed C++98 compatibility 2017-04-26 10:42:20 +02:00
dba6e170c4 Alembic import: added unit test for mesh deformation. 2017-04-26 10:42:20 +02:00
3dc6528cd4 Merge branch 'master' into blender2.8 2017-04-26 10:11:03 +02:00
ab168f63f6 Remove show_backface_culling check in select engine
May add back so selection engine can read backface cull state
from from different engines.
2017-04-26 18:08:49 +10:00
9623d93f14 Cycles: Fix access undefined macro on non-MSVC compiler
Also rremove trailing whitespace.
2017-04-26 10:00:31 +02:00
3f91567052 Cleanup: draw engine
- use DRW_engine prefix for engine types.
- use engine suffix for files that define a draw engine.
- remove engines from include path (they're only referenced once)
2017-04-26 17:42:39 +10:00
bfc2043332 Draw Manager: add select engine
This does very little currently, but allows changing behavior for
selection drawing in the future.
2017-04-26 17:25:41 +10:00
de0d3ec457 Allow new selection in eevee & blender draw modes 2017-04-26 16:52:02 +10:00
5634763e5e Draw Manager: armature editmode selection 2017-04-26 16:12:01 +10:00
82686f0a0c Eevee: World default shader.
- Use uniform color world for the world probe.
- Refactored the Fresnel expression to be better with Area Lights.
- Squared the roughness for default materials.
2017-04-25 23:51:05 +02:00
bb75b0bcbc Eevee: Disable shadow rendering until we get proper update scheduling.
Performance is quickly getting poor when you have lights otherwise.
2017-04-25 23:51:05 +02:00
7bc637a40d Eevee: Fix Square light with non uniform scale. 2017-04-25 23:51:05 +02:00
0f2d0ff124 workaround for T50176
This works around a long outstanding issue T50176 with cycles on msvc2015/x86 . root cause is still unknown though,feels like a game of whack'a'mole

Reviewers: sergey, dingto

Subscribers: Blendify

Tags: #cycles

Differential Revision: https://developer.blender.org/D2573
2017-04-25 14:21:46 -06:00
d8e83516e2 Draw Manager: support for selection using engines
Needed to remove old draw code entirely.

Object mode selection support, pose and armature still need to be added.
Enabled when 'use_modern_viewport' is set.
2017-04-26 04:59:18 +10:00
Hristo Gueorguiev
e91dc3a97c Cycles: use safe compiler flags for OpenCL.
Using -cl-fast-relaxed-math assumes no NaN/Inf values in any expression.
This causes problems on overflow, division by zero, square root of negative number.
Comparisons with NaN or infinite value are affected as well.

This patch causes <2% slowdown on benchmark scenes.

Fix T50985: Rendering volume scatter with GPU OpenCL comes to an halt after a few seconds
2017-04-25 20:10:51 +02:00
Hristo Gueorguiev
9d26e32ea2 Workaround for AMD GPU OpenCL compiler. 2017-04-25 20:08:14 +02:00
041a50291b Eevee: Make default shaders works.
- Added New Batch cache routine to get the split mesh for each material. (optimization needed)
- Did some shader modifications to create default_frag and support a somwhat correct fresnel for lamps (to finish)
2017-04-25 18:47:20 +02:00
Dalai Felinto
00f5c621a6 Outliner: Re-build depsgraph when reordering collections
Otherwise if we create a new collection, and drag a collection into it we either
get a crash, or at the very least we dont get the visibility flags correct.
2017-04-25 18:44:17 +02:00
Dalai Felinto
973f4944e0 Render API: Rename render > render_to_image; view_draw > render_to_view
This is part of the new draw manager design. Any engine (even clay, eevee, ...) should be able to draw to the viewport, as well as render to an image directly.
Changing the API names to conform to that.
2017-04-25 18:03:13 +02:00
Dalai Felinto
4122eeb09a Cycles: Use depsgraph instead of layers 2017-04-25 18:03:13 +02:00
Dalai Felinto
05243a633a Depsgraph: Store Scene in depsgraph struct
This way we can retrieve the scene from depsgraph that were not created from a G.main (e.g., when doing material thumbnail preview render).
2017-04-25 18:03:13 +02:00
Dalai Felinto
b43200a120 Cleanup: Line-width 2017-04-25 18:03:13 +02:00
6822e353ff Merge branch 'master' into blender2.8 2017-04-25 17:04:17 +02:00
99d2d6f387 Alembic import: don't use global main 2017-04-25 17:03:15 +02:00
2aa4f8ab92 Alembic import: removed BaseLegacy from BKE_cachefile_clean
Now we just iterate over all objects. It may be a better idea to use a
smarter approach for performance. However, since this function is not
called regularly (only when changing Alembic file paths), it's not a very
big deal.
2017-04-25 16:59:36 +02:00
7cf7b3b7e5 Draw Manager: clear draw global data after use 2017-04-26 00:39:53 +10:00
acf07e7366 Draw Manager: store context vars per draw
Was performing context access per object for scene, region etc.
While not very slow they don't change during drawing so cache in a struct.

This also makes it possible to draw in views besides the current context.
2017-04-26 00:35:08 +10:00
9dadd5ff93 Fix T51292: Alembic import, show notification when trying to load HDF5
HDF5 Alembic files are not officially supported by Blender. With this
commit, the HDF5 format is detected even when Blender is compiled without
HDF5 support, and the user is given an explanatory error message (rather
than the generic "Could not open Alembic archive for reading".
2017-04-25 14:30:09 +02:00
ab4f6f01a6 Cycles: Fix strict compiler flags 2017-04-25 14:12:14 +02:00
0b84f21b08 Fix OSX buildbot 2017-04-25 14:05:03 +02:00
3128600a8a Fix T51262: Blender CRASH with alembic file
Also added a unit test for exporting & importing very long names.
2017-04-25 12:06:03 +02:00
1f85a35a3d Cycles: Cleanup, mainly line length in random module
Was doing lots of investigation recently, with need to have lots of things
side by side.
2017-04-25 11:43:20 +02:00
e353cf8705 Revert "Alembic: Construct ISampleSelector once and pass along"
This reverts commit 099816587a. It had some
unforseen side-effects that should be investigated first.
2017-04-25 10:45:26 +02:00
0a07cdbe80 Cycles: Split vectorized math utilities to a dedicated files
This file was even a bigger mess than vectorized types header,
cleaning it up to make it easier to maintain this files and
extend further.
2017-04-25 10:33:26 +02:00
51ec9441b7 Cycles: Split vectorized types into separate files
The final goal to reach is to make vectorized types much easier to maintain
and the previous design had following issues:

- Having all types and methods implementation made the source file rather
  bloated and unfun to navigate in.

- It was not possible to quickly glance available API for the type you are
  interested in.

- Adding more vectorization types will bloat the file even more, making
  things even more tricky to follow.
2017-04-25 10:33:26 +02:00
b06cd746ce Cycles: Cleanup, preprocessor indentation 2017-04-25 10:33:26 +02:00
573f6d1ec4 Fix T51284: Mesh not skinned 2017-04-25 10:01:34 +02:00
7398b3b71b WM: don't search for app-template when its empty
Changing from a loaded app-template back to Default (none set)
would scan paths for a file with no name. Harmless but silly.
2017-04-25 17:15:23 +10:00
75a759ea5e OpenGL: better context creation on Windows
Compatibility profile was working fine, this is mostly to get the highest GL core profile version available.

Our minimum requirement is 3.3 core profile.  When we request a specific GL version:
 - AMD and Intel give us exactly this version 
 - NVIDIA gives at least this version <-- desired behavior 
so we ask for 4.5, 4.4 ... 3.3 in descending order to get the best version on the user's system.

Accept OpenGL 3.0 on Mesa instead of 3.3+ compatibility profile. (requested by @LazyDodo) This will be removed after we finish moving to core profile.

Part of T49012 and T51164
2017-04-24 22:30:17 -04:00
9c87bb124a group WITH_LEGACY_OPENGL with the other GL options
Blender subsystems that care about OpenGL use GL_DEFINITIONS, which now includes the newest (temporary) WITH_LEGACY_OPENGL.

Also updated Gawain's CMake to use this instead of its own logic.
2017-04-24 17:41:26 -04:00
d8661ee2d5 Cycles: Remove re-hashing done in BPT volume code
Since 9d50175 this is no longer needed, at least not with the current
sampler we are using.
2017-04-24 21:48:01 +02:00
Dalai Felinto
0f143627d2 Collection: __FUNCTION__ > __func__ 2017-04-24 18:15:37 +02:00
Dalai Felinto
9f074444ad Layer cleanup: Rename _Iterator_ > _iterator_ 2017-04-24 18:14:41 +02:00
Dalai Felinto
9b94e2a743 Bring back outliner hierachy delete 2017-04-24 18:08:08 +02:00
Dalai Felinto
8c7e0f23c2 Fix view local not working 2017-04-24 18:06:48 +02:00
Dalai Felinto
a8fd510bd5 Outliner: Bring back bases when pertinent
This partially reverts c4e34a84e0

Note: This is necessary for the "delete hierarchy" functionality
2017-04-24 18:06:48 +02:00
Dalai Felinto
1ffdffc699 FOREACH_SELECTED_BASE iterator 2017-04-24 18:06:48 +02:00
2f2e2bae8d Fix own mistake in smoke.c 2017-04-24 17:15:17 +02:00
913e9350a5 Convert BaseLegacy to Base (part) 2017-04-24 16:09:04 +02:00
69a216d343 Cleanup: remove unnecessary texface checks 2017-04-24 22:45:40 +10:00
2010dbe8a5 Merge branch 'master' into blender2.8 2017-04-24 22:11:05 +10:00
aff30aaf2d Cleanup: style 2017-04-24 22:00:46 +10:00
50bfaffc6b Cycles: Cleanup, space after keyword 2017-04-24 11:23:19 +02:00
d67609697e Add C internal version of msgfmt (similar to makesrna/dna binaries).
Fixes performance issues of C++ one with Windows MSVC debug builds...

Merely a translation from msgfmt.cc code by @sergey, using BLI libs intead of C++'s stdlib.

Reviewers: sergey, campbellbarton, LazyDodo

Subscribers: sergey

Differential Revision: https://developer.blender.org/D2605
2017-04-24 10:49:54 +02:00
6d9a223c90 BLI_dynstr: add memarena-based version, and helper to clear without freeing. 2017-04-24 10:42:10 +02:00
5a232039d5 Usual i18n/UI messages fixes and cleanup. 2017-04-24 09:33:49 +02:00
f1ada2e719 [msvc/make.bat] Add convenience option to turn off game engine+player 2017-04-23 14:46:33 -06:00
da82f65424 CMake: Fix CMake for non Apple systems
Follow up to https://developer.blender.org/rB14a4ce6d7fb4dcf3d1aa5b58f9a543549df6d5dc
apple_check_quicktime() macro is only defined for apple, so ignore it otherwise.
2017-04-23 19:10:04 +02:00
14a4ce6d7f CMake: move some Apple specific code into platform_apple_xcode.cmake. 2017-04-23 18:24:47 +02:00
Romain Foyard
a192d5b81c CMake: disable WITH_CODEC_QUICKTIME for macOS > 10.11 for configurations.
QtKit was removed in macOS Sierra, this patch disables WITH_CODEC_QUICKTIME
in Sierra and greater versions of macOS.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2645
2017-04-23 18:24:47 +02:00
cedb1915fe CMake: fix wrong alembic test name on Windows. 2017-04-23 18:24:43 +02:00
4a9e546fed [msvc/make.bat] Allow override of the build folder name 2017-04-23 10:10:57 -06:00
f93f4169cb Merge branch 'master' into blender2.8
Conflicts:
	build_files/cmake/platform/platform_apple.cmake
2017-04-23 10:49:39 +02:00
79fd8eeb0e missing from last commit 2017-04-23 04:06:45 +10:00
2acb5d1e38 Fix armature drawing ignoring object matrix
Looks like name-space collision.
2017-04-23 04:03:13 +10:00
23c4f01fb4 Draw Manager: hide 2d curves normals 2017-04-23 03:28:53 +10:00
20c9c1b44e OSX: satisfy macro to also apply alembic tests 2017-04-22 19:03:59 +02:00
517bd13baa Disable breaking alembic test for osx 2017-04-22 18:39:11 +02:00
4ee36a2aea Cleanup: line length 2017-04-22 16:13:18 +10:00
36b29c05db Cleanup: use DRW_shgroup_call prefix for dynamic and fixed
More useful for completion since an 'shgroup_dynamic' is not a thing
(would be confusing if other dynamic functions are added).
2017-04-22 15:53:11 +10:00
9fe9cf8261 fix omission from previous commit
Missed one old call on Linux/X11.
Follow-up to ef640ecf10
2017-04-22 00:58:42 -04:00
ef640ecf10 OpenGL: remove use of GLEW MX
MX (Multiple conteXt) support was dropped from the GLEW 2.0 library to make core profile support cleaner.

Our WITH_GLEW_MX build option was OFF by default already; this commit removes the inactive code paths.

I'm working on a plan for multiple GPUs, contexts, resource sharing, etc. This commit gives us a cleaner starting point for that upcoming work.

Tested on Mac, will test on Linux & Windows immediately after pushing.
2017-04-22 00:35:04 -04:00
1beed61b76 OpenGL/GHOST: don't request accum buffer on Mac
This was blocking core context setup on Mac, since accumulation buffers are obsolete. With this (and appropriate CMake options) I now get

renderer:	'Intel HD Graphics 4000 OpenGL Engine'
vendor:		'Intel Inc.'
version:	'4.1 INTEL-10.24.45'

in system-info.txt intead of 

version:	'2.1 INTEL-10.24.45'
2017-04-21 16:04:03 -04:00
12261aa047 fix unitizialized use warning
The code would only use 'type' uninitialized in error conditions, but it's still better to avoid that.

caught by clang
2017-04-21 15:51:08 -04:00
dcda9b4136 Eevee/OpenGL: fix shader for core profile 2017-04-21 15:48:56 -04:00
dc5bd2784f [cmake] Fix Alembic build errors with msvc 2017-04-21 12:18:19 -06:00
8ac1f03f41 Eevee: Cascaded Shadow Maps, follow up.
- Compute coarse bounding box of split frustum. Can be improved
- Make use of 4 cascade.
- View dependant glitches are fixed.
- Optimized shader code.
2017-04-21 16:43:35 +02:00
cc2d501642 Merge branch 'master' into blender2.8 2017-04-21 16:30:24 +02:00
Dalai Felinto
111a53f74c Fix crash when duplicating objects by tagging depsgraph
This may change once depsgraph becomes aware of workspaces.
For now this is the best we can do.
2017-04-21 16:25:20 +02:00
7e977470f3 Alembic unit tests: Removed trailing spaces 2017-04-21 16:20:35 +02:00
e6ee3fd924 Alembic unit tests: don't depend on ALEMBIC_ROOT_DIR being defined by user
By mistake, the code relied on ALEMBIC_ROOT_DIR being defined by the user
running the tests. Now CMake macros are used to correctly find the Alembic
root directory.
2017-04-21 16:20:01 +02:00
Dalai Felinto
e6f073fe41 Re-enabling Alembic test
(disabled because of bug fixed on 19548040d9)
2017-04-21 16:07:53 +02:00
349cafac52 Matrix.decompose(): changed terminology, "location" → "translation"
Matrix.decompose() should either return "location, orientation, size" or
"translation, rotation, scale". Since there are constructors for the former,
I've replaced "location" in the documentation with "translation".

The code is still the same, I just changed the documentation.
2017-04-21 15:51:35 +02:00
Dalai Felinto
19548040d9 Fix T51261: New objects aren't selected
The original code was failing because the base to object flushing was
only happening as part of the depsgraph. However we can use the
evaluated values to set the initial values of the base.

In this particular case, we couldn't set the new object visible because
its selectability flag was not set yet.
2017-04-21 15:27:32 +02:00
Dalai Felinto
2f506b9458 Fix objects visibility evaluation bug
This was introduced on 4b77fb3075 no idea how I left this in, shame on me
2017-04-21 15:27:02 +02:00
Dalai Felinto
cc8f104098 Tag depsgraph update when hide and hide_select are changed
We were not updating depsgraph when collection just "became" selectable,
but although this doesn't change object selection, it change its
selectability.
2017-04-21 14:42:45 +02:00
9781139590 Cycles: Solve speed regression of classroom scene after principled commit
This way we can skip it from compiling into OpenCL kernels by making
this shader compile-time feature.
2017-04-21 14:41:42 +02:00
b6da2a6a86 Cycles: Make it a generic base class for all types of closure nodes
The idea is to have osme geenric BSDF node which is subclassed by
"regular" BSDF nodes and uber shaders.

This way we can access special type and closure type for making
decisions somewhere else.
2017-04-21 14:36:56 +02:00
e4ab70da86 CMake: Add option to build against system-wide Glog
Similar to previous commit for Gflags.
2017-04-21 14:36:34 +02:00
81011679dd Merge branch 'master' into blender2.8 2017-04-21 14:19:05 +02:00
9c02990ac1 Alembic import: changing cache modifier path no longer discards object paths
This allows, for example, the path of an Alembic file to be changed from
absolute to relative, without having to reconstruct all object paths.
2017-04-21 14:11:49 +02:00
9d819775b7 Alembic: properly initialising cachefile object paths list. 2017-04-21 14:11:49 +02:00
45b9ee525d Alembic: fixed memory leak 2017-04-21 14:11:49 +02:00
099816587a Alembic: Construct ISampleSelector once and pass along
No longer passing time as float and constructing ISampleSelectors all
over the place. Instead, just construct an ISampleSelector once and
pass it along.
2017-04-21 14:11:49 +02:00
bfa888cef2 Cleanup: move draw-cache creation from BKE to DRW
Creating draw-cache should only ever be used by the draw-manager.
2017-04-21 22:06:06 +10:00
Dalai Felinto
c7f00feaba Unify RNA and core depsgraph.objects
Note: Since this is not listbase nor array I'm also expanding
RNA_types.h to allow for custom data.
2017-04-21 13:00:40 +02:00
Dalai Felinto
4b77fb3075 Move DEG_OBJECT_ITER inside depsgraph 2017-04-21 13:00:40 +02:00
df84082c70 Cycles: Cleanup, indentation in preprocessor 2017-04-21 12:26:04 +02:00
470b54a37a Cycles: Cleanup, indentation inside preprocessor 2017-04-21 12:01:27 +02:00
aa2cff4509 Cycles: Fix regression in SSS rendering after principled commit 2017-04-21 12:01:27 +02:00
7a59d381ce Cycles: Cleanup, indentation of comment
Was broken after principled commit.
2017-04-21 12:01:27 +02:00
c7a5c48cba CMake: Add option to link against system-wide Gflags library
It is disabled by default, so should not affect existing configurations.

Main benefits of this goes as:

- Linux distros can use that to avoid libraries duplication and link
  blender package against gflags package from the system.

- It it easier to test whether Blender works with updated version of
  Gflags prior to re-bundling the library.
2017-04-21 12:01:27 +02:00
3540b50780 Cleanup: use id-property access macros 2017-04-21 19:47:01 +10:00
Dalai Felinto
6294bd1b8b Depsgraph: Move DAG_get_object function
BKE_depsgraph.h will be deprecated eventually, so moving it to DEG_depsgraph_query.h
2017-04-21 11:33:15 +02:00
3e7968c35f Draw Manager: don't assign bool from flags
Some MSVC versions don't support this.
2017-04-21 18:43:54 +10:00
15d73e53c3 Gawain: fix for building empty element list 2017-04-21 18:33:44 +10:00
Dalai Felinto
dafdf72904 Rename: Alembic job struct sl > scene_layer 2017-04-21 10:03:44 +02:00
Dalai Felinto
01a627dac9 Include the set in the depsgraph objects iterator
Pending: Include the set in the rna depsgraph.objects

In fact it would be nice to unify them both. However this will likely
change once Depsgraph incorporate this iterator, so I'm not sure we
should bother with that.

Related to T51203
2017-04-21 09:56:26 +02:00
3a75e84376 Draw Manager: edit-mode 3d text drawing
Draw cursor and selection, also support for fast-display.
2017-04-21 17:58:18 +10:00
55a3d48046 Docs: diagram for reflect_v3_v3v3 2017-04-21 17:27:20 +10:00
2b9738b7f8 Merge branch 'master' into 28 2017-04-21 17:14:13 +10:00
13ee5ba467 Store edit-font select-box length
A little awkward to calculate when drawing.
2017-04-21 17:12:43 +10:00
Stefan Werner
aeda1a16f3 D2607: Switch eye dropper to use linear color space internally
This switches the internal color representation of the eye dropper from display space to linear. Any time a linear color is requested and the color is picked from a linear object, the result is now precise to the bit as the color gets patched through directly. Color space conversion now only happens when a color is picked from non-linear display space objects or when the color is requested to be returned in non-linear space.

In addition, this patch changes the DifferenceMatte node to interpret a tolerance of 0.0 to accept colors that are identical bit by bit, as apposed to simply refusing all colors.
2017-04-20 22:41:26 +02:00
Stefan Werner
b628f765b0 D2608: Allow HDR picking from Compositor background
Replaced some STREQ(snode->tree_idname, ...) calls with ED_node_is_*() calls for improved readability, fixed one case where the STREQ was used the wrong way
2017-04-20 22:32:00 +02:00
c4780ee459 Cleanup: redundant struct qualifier & long lines 2017-04-21 04:40:44 +10:00
d21a4407dc Cleanup: rename & change order of declaration 2017-04-21 04:29:33 +10:00
677aa36632 Curve: draw curve/surface/text geometry
Note that displists will be removed, but this wont be hard to replace.

Signed-off-by: Campbell Barton <ideasman42@gmail.com>
2017-04-21 04:23:28 +10:00
ca958642fa Fix Surface Deform not unbinding if target is removed 2017-04-20 17:49:45 +02:00
Dalai Felinto
9d1421c069 RNA: depsgraph.objects
Iterator to return the objects evaluated from depsgraph. The
iterator itself will change once CoW is implemented.

This reproduces the behaviour of DEG_OBJECT_ITER but for Python.
2017-04-20 17:21:06 +02:00
Dalai Felinto
f2a2adc910 RNA: bpy.context.depsgraph 2017-04-20 17:20:56 +02:00
74023d46ce Implement DAG_get_scene_layer
Even though this will have to change once we get workspaces, we will
still have a depsgraph for the Scene.

This is required for the upcoming depsgraph.objects RNA iterator.
2017-04-20 17:18:31 +02:00
52295dd480 Alembic export: don't show warning for every exported frame
The warning about not having a UV map is now only shown once per hair
system.
2017-04-20 15:30:13 +02:00
ee3faddfaa Fix T45350: Cache not being recomputed with "Bake All Dynamics" 2017-04-20 15:01:21 +02:00
66377b89da Fix T51251: Armature/Normal-button scaled twice 2017-04-20 22:12:08 +10:00
afc885cd13 Draw Manager: round vertex size up
Without this assigning `gl_PointSize = sizeVertex`
made vertices too small.
2017-04-20 21:16:37 +10:00
84c464a4b8 Use theme vertex size for lattice & curve vertices 2017-04-20 21:16:37 +10:00
3d17ece539 Eevee: Start Implementation of Cascaded Shadow Maps 2017-04-20 13:07:51 +02:00
b386828671 Eevee: Do shadow cube render in one pass. 2017-04-20 13:07:51 +02:00
3fa665f56d Draw Manager: Fix Gradient Background 2017-04-20 13:07:51 +02:00
6028ff2736 Correct error drawing curve normals 2017-04-20 21:01:23 +10:00
aa4102a441 Merge branch 'master' into blender2.8
Disabled a unittest, to be re-enabled when T51261 is fixed.

# Conflicts:
#	source/blender/alembic/intern/alembic_capi.cc
2017-04-20 12:50:20 +02:00
8e0c57a812 Gawain: fix immediate mode drawing exceeding IMM_BUFFER_SIZE
Would cause crazy colors in file selector.
2017-04-20 20:43:56 +10:00
ae79eb2105 Alembic import: select imported objects
When the Alembic import is finished, all imported objects are selected.
2017-04-20 12:01:31 +02:00
28ed66552b Fix debug checks were enabled for release builds only
NDEBUG meanse Not DEBUG.
2017-04-20 11:03:55 +02:00
Dalai Felinto
913472165b Fix T51215: depsgraph evaluation of collection properties (overrides) 2017-04-20 11:00:32 +02:00
Dalai Felinto
3cb0e8e1af IDProperty: New util function to merge groups recursively 2017-04-20 11:00:32 +02:00
Dalai Felinto
53d59af364 Corrections for layers unittest based on design change
Example, imagine an object Cube in collections 1 and 2 where both
collections are nested to A. Now we set a "color" property as follow:

```
Scene -> GREEN
--
A     -> RED
↳ 1   -> BLUE
↳ 2   -> -
```

In this case the object will be RED, because of A↳ 2.

Now if we have:

```
Scene -> GREEN
--
A     -> RED
↳ 1   -> -
↳ 2   -> PINK
1     -> -
--

The object will be PINK because of A↳ 2.

Note that the (top level) collection 1 doesn't influence the object color
because there are no overrides on it. The scene render settings (GREEN
in this case) are only used as fallback if an override is not set at
all.
2017-04-20 11:00:32 +02:00
b5b0fc9c94 Cleanup: Use explicit unsigned int type
This is as per our code style states ans as majority of the team
prefers types to be used.
2017-04-20 10:56:08 +02:00
09bf8f4a69 Use reflect for calculating second normal 2017-04-20 18:56:53 +10:00
31c644b657 Fix T51198: Crash with new Datablock ID Properties 2017-04-20 11:40:31 +03:00
d8bf090090 Merge branch 'master' into 28 2017-04-20 18:16:01 +10:00
6da53e46c9 Use reflect for calculating second normal 2017-04-20 18:08:05 +10:00
9bb8e46460 Docs: move note (was mixed up) 2017-04-20 17:11:12 +10:00
462d9e37ea Cleanup: remove type prefix from render-data vars
Render data is never mixed with other object types,
no need to make a distinction.
2017-04-20 16:25:20 +10:00
6c26911c3d Fix T51248: user preferences window size not adapted to DPI. 2017-04-20 01:19:47 +02:00
c7c162e2e0 Fix merge of master (no more base...). 2017-04-19 22:13:57 +02:00
6a5b53fe6f Merge branch 'master' into blender2.8 2017-04-19 22:11:53 +02:00
1873ea337c Fix T51243: Delete Globally won't work with Datablock ID Properties.
That's a quick hack to address that specific case, new pointer IDProp
actually enlights a generic problem - datablocks using themselves - which
is not really handled by current code, would consider this not-so-urgent
TODO though.
2017-04-19 22:07:57 +02:00
a738e985c6 Fix update drawing curve editmode 2017-04-20 05:55:48 +10:00
1c28e12414 Fix (unreported) missing handling of GPencil Layer's parent Object pointer in BKE_library_query.
Grrrr... still finding missing pointers here... :/
2017-04-19 21:47:01 +02:00
72efee07ff Draw Manager: draw curve normals 2017-04-20 05:33:52 +10:00
896d62d1c2 Fix error disabling curve handles 2017-04-20 04:53:55 +10:00
43a273616b No need for while-loop counting curve-normals 2017-04-20 03:01:13 +10:00
e28a92bacb Cleanup: put overlay & wire in own structs 2017-04-20 02:53:33 +10:00
c0f9d962f0 Merge branch 'master' into blender2.8
Updated tests/python/bl_alembic_import_test.py to be 2.8-compatible.
2017-04-19 17:33:22 +02:00
307059ed61 Alembic import: correctly linking objects to scene layer.
The import is always performed on the active LayerCollection. If there
is none, a new one is created.
2017-04-19 17:30:06 +02:00
aaec934096 Alembic import: added simple unit test for importer.
It only tests the presence of the objects and their parent/child pointers.
Matrix and animated properties should be done in a later test.
2017-04-19 17:28:25 +02:00
8accea07f7 UI: Reorganize the UV/Image "Game Properties" Pannel
This uses the same amount of room while giving it a more clean look and adds a label for the mapping options so users can tell the purpose.
2017-04-19 11:15:41 -04:00
248946542d Fix alpha overlay for sculpt/paint when using core profile
Same fundamental problem as fonts -- there is no longer GL_ALPHA format.
2017-04-19 16:57:44 +02:00
e708f45eab Cleanup: Remove executable flag from GLSL shaders 2017-04-19 16:57:44 +02:00
553d820b80 Remove basic shader from paint cursor overlay
Immediate mode built-in shader is used for this drawing already.
So there is no reason to try building basic shader which is not
supported in the core profile.
2017-04-19 16:57:44 +02:00
4bee5b80d4 Convert direct usages of base defines
This replaces all direct usage of:
- FIRSTBASE
- LASTBASE
- BASACT
- OBACT

Some usages still remain in legacy utility functions which are called
all over the place.
2017-04-19 16:52:27 +02:00
2f2420709c Remove local view toggle operator 2017-04-19 16:52:27 +02:00
1427765ec5 Cleanup: remove redundant assignments
Return the 'Batch' instead of assigning a variable.
2017-04-20 00:52:53 +10:00
cdba73c8fa Draw Manager: curve support
Draws the curve centerline and editmode verts/handles.

Handle theme colors, and normal display still need adding.
2017-04-20 00:38:44 +10:00
ce6b01f203 Cleanup: move theme-id to shader-group into funcs 2017-04-20 00:26:44 +10:00
d8c698a76d Fix mistake in previous commit 2017-04-19 16:16:30 +02:00
3f11be3f7d Get rid of glMatrixMode calls
With the explicit calls we don't need to worry about current state
outside of the GPU module now. In fact. we don't need to worry about
current matrix mode in core profile at all.

Legacy OpenGL now has some code which ensures current matrix mode
when using explicit calls to push/pop matrix.
2017-04-19 15:22:58 +02:00
288892bf08 Make UI block drawing closer to master
There is no need to break assumptions of what's being modified
by this call and what's restored. The changes in this function
simply spread crappyness outside of the UI block.
2017-04-19 15:22:58 +02:00
ba4d23fe37 Fix node editor drawing when built with core profile
There are two major things in this commit.

First one is to have proper stack for projection matrices. This is
something what OpenGL specification grants to have at least 2 elements
for and what is required to have for proper editor drawing without
refactoring the way how we restore projection matrix.

Supporting this stack have following advantages:

- Our GPU stack is closer to OpenGL specs, making it easier to follow
  by other developers who are always familiar with OpenGL.

- Makes it easier to port all editors to a new API.

- Should help us getting rid of extra matrix push/pop added in
  various commits to 2.8 branch.

The new API follows the following convention:

- gpuPushMatrix/gpuPopMatrix ALWAYS deals with model view matrix
  and nothing more.

  While this name does not fully indicate that it's only model view
  matrix operator, it matches behavior of other matrix operations
  such as transform which also doesn't indicate what matrix type
  they are operating on.

- Projection matrix has dedicated calls for push/pop which are
  gpuPushProjectionMatrix/gpuPopProjectionMatrix.
2017-04-19 15:22:58 +02:00
781108cdc6 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.cc
#	source/blender/alembic/intern/abc_exporter.h
2017-04-19 15:07:54 +02:00
b01df8222f Comment out places which are using texture matrix mode for core profile
There is only two places which are using texture matrix mode:

- Tiled tface support.
- Texture shading mode for texture mapping.

Both cases are subject for reconsideration: it is likely that we'll be getting
rid of tface, which means game properties like tiles needs to be revisited
anyway. As for texture shading it is using basic shader which is also not
supported by core profile anyway.
2017-04-19 14:44:42 +02:00
2dac8b3ee0 Alembic import/export: added as_background_job option
The ABC_export and ABC_import functions both take a as_background_job
parameter, and return a boolean.

When as_background_job=true, returns false immediately after scheduling
a background job. This was the old behaviour of this function, which makes
it very hard for scripts to do something with the data after the import
or export completes.

When as_background_job=false, performs the export synchronously, and
returns true when the export was ok, and false if there were any errors.
This allows further processing.

The Scene.alembic_export() function is deprecated, and will be removed from
Blender 2.8 in favour of calling the bpy.ops.wm.alembic_export() operator.
As such, it has been hard-coded to the old background job behaviour.
2017-04-19 14:40:57 +02:00
Dalai Felinto
9c84d99819 Unittests: Layer render settings evaluation
More failing unittests to add to the existing ones.
2017-04-19 14:35:29 +02:00
bca55e7adf Cleanup, indentation of preprocessor 2017-04-19 14:33:34 +02:00
fb2330c1e0 Use model view matrix instead of texture matrix for texture brush overlay
It is required for our new matrix stack to only have projection and model view
matrix modes. This commit ports paint cursor overlay to model view matrix.
2017-04-19 14:13:53 +02:00
b148ac5cf7 Alembic export: made hair/particle export optional.
The export is still slower than needed, as the particle systems themselves
aren't disabled during the export. It's only the writing to the Alembic
file that's skipped.
2017-04-19 13:03:52 +02:00
4b376dbe84 Fix wrong RNA update function declarations
This fixes lots of crashes, especially with painting/brush updates.
2017-04-19 12:23:06 +02:00
0fd53c87de Alembic export: converted some export params to actual bools
The variables were interpreted as booleans, and had a 1-bit width. I don't
see a reason to not just use the bool type instead.
2017-04-19 11:43:43 +02:00
Dalai Felinto
54f03914b0 Fix identation 2017-04-19 11:17:14 +02:00
76ecbd38f2 Edit Mode Engine: Fix shader compilation on AMD. Also fix Bweight display. 2017-04-19 11:09:07 +02:00
b3edd94e42 Eevee: Fix black background 2017-04-19 11:09:07 +02:00
42c8d93c5f Fix 'API defined' ID properties still having 'remove' button in UI.
We could not edit them, but still could delete them, which makes no
sense, API-defined properties are similar to class members, removing
them from single instances is pure garbage. And it was broken anyway.

Found by @a.romanov while checking on T51198, thanks.
2017-04-19 09:54:47 +02:00
9a5b379374 Cleanup: set-but-unused warning 2017-04-19 15:57:37 +10:00
94d5ca7cdb Eevee: Remove last deprecated textureCubeLod 2017-04-18 22:56:55 +02:00
8c584dcb65 Eevee: fix core profile. 2017-04-18 22:46:09 +02:00
0610bc88a3 Eevee: Re fix Compilation on MSVC 2017-04-18 22:34:44 +02:00
5670e4149b Eevee: fix compilation error with MSVC 2017-04-18 22:02:46 +02:00
303a9ae0e8 Eevee: Optimize Spherical Harmonic computation time (17ms -> 1ms) 2017-04-18 21:33:09 +02:00
80db709250 Eevee: Spherical Harmonic diffuse.
For now it's done each frame and it's rather slow (16ms) but result will be cached soon.
2017-04-18 21:33:09 +02:00
5bbc803ff0 Eevee: Fix crash on core profile. 2017-04-18 21:33:09 +02:00
85b4398d90 Draw Manager: Fix uniforms array not been found. 2017-04-18 21:33:09 +02:00
94789e30a5 Gawain: fix building WITH_GL_PROFILE_CORE
I intially hard-coded this for compatibility profile. This commit makes the library respect the main CMake options so they match the rest of Blender.
2017-04-18 14:51:42 -04:00
26e171c4d9 OpenGL: don't require legacy extensions when using WITH_GL_PROFILE_CORE
These checks guarantee we meet the minimum expected GL requirements listed in T49012.
2017-04-18 14:44:57 -04:00
473c2b1c94 Gawain: fix stupid APPLE_LEGACY mistake
@dfelinto caught this while building on Linux

fixes a copy/paste mistake from b0351bd3bd
2017-04-18 12:43:50 -04:00
53c56dcd08 Gawain: enable 10.10.10 vertex format for core profile (any platform)
This is an OpenGL 3.3 feature, currently being used for surface normals. It's 1/3 the size of floating point triples and perfect for normals or colors.

See T49012 for why Windows can use this feature regardless of core vs compatibility.
2017-04-18 12:09:17 -04:00
45b3555cba OpenGL: fix compatibility with Mac & Mesa
This combines the Mesa fix (16e929e6ff by @brita_) with the Mac fix (89e23c743e by @merwin).

And uses the same fix for another call to glFramebufferTexture introduced in f1fb605ec9.
2017-04-18 12:09:17 -04:00
b0351bd3bd Gawain: define feature macros in a more compatible way
Thanks to @sergey for proactively testing clang 4.0, which does not accept defined(FOO) as part of macro definitions.
2017-04-18 12:09:17 -04:00
72fc837d1e Cleanup: replace num/ct/tot with 'len' 2017-04-19 01:04:42 +10:00
989080c4f6 Alembic import: little fix for D2634
Now it doesn't crash any more when the Alembic curves object doesn't
have any user properties.
2017-04-18 17:00:21 +02:00
bb31648b9b Merge branch 'master' into blender2.8 2017-04-18 16:47:25 +02:00
2c29b94384 Fix text drawing with core profile
The issue was going to the fact that GL_ALPHA was deprecated in core profile
and common solution online is to use GL_RED instead. That is what is done in
this commit.
2017-04-18 16:42:16 +02:00
5bdbc88ab8 Alembic import/export: write curve resolution to user property
Curve resolution isn't natively supported by Alembic, hence it is stored
in a user property "blender:resolution". I've looked at a Maya curves
example file, but that also didn't contain any information about curve
resolution.

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

Reviewers: kevindietrich
2017-04-18 16:36:33 +02:00
Dalai Felinto
c9d78b6c43 Merge remote-tracking branch 'origin/master' into blender2.8 2017-04-18 16:30:13 +02:00
Dalai Felinto
bc6a75b405 Revert "Object Info node support for GLSL mode and the internal render"
This reverts commit 76425feed8.

** Note **
This was supposed to be a merge, but it was rebased.
2017-04-18 16:29:42 +02:00
70018eb16e Cleanup: missing headers 2017-04-19 00:25:31 +10:00
b8fd6f94a0 Cleanup: replace num/ct/tot with 'len' 2017-04-19 00:12:12 +10:00
Dalai Felinto
2926675bfd OpenGL: Update GPU_legacy_stubs.c
The list is now re-ordered too.
And we are no longer including the new tokens suggestions here (the ones
defined as USE_ in gl-deprecated.h)
2017-04-18 16:02:17 +02:00
Dalai Felinto
80b6f8b1d8 OpenGL: Comment out the old tokens from gl-deprecated
Those tokens are still valid. Although we should not being using them,
they should not prevent us from building with core profile.

In the future we can have a new flag WITH_GL_CORE_STRICT for those.
But only after we build with core profile by default
2017-04-18 16:02:17 +02:00
Dalai Felinto
e5bf726f44 BGL: Remove deprecated enums
Note: The enums that are deprecated and supported are still there
2017-04-18 16:02:17 +02:00
4778369ee8 Eevee: Fix warning 2017-04-18 15:37:22 +02:00
76425feed8 Object Info node support for GLSL mode and the internal render
Object Info node can be useful to give some variation to a single material assigned to multiple instances. This patch adds support for Viewport and BI.

{F499530}

Example: {F499528}

Reviewers: merwin, brecht, dfelinto

Reviewed By: brecht

Subscribers: duarteframos, fclem, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2425
2017-04-18 15:37:22 +02:00
8fdd568343 Draw Manager: T51218 Support edit-mesh hide 2017-04-18 23:33:50 +10:00
3922d5194f Fix install_deps.sh for new Ubuntu 17.04, which does not have libopenjpeg! 2017-04-18 15:24:09 +02:00
1129fd1c51 Use better workaround ofr getting scene layer for Derivedmesh's mask
This replaces access to the first scene layer (which was wrong) with a linear
lookup of scene layer by it's active index.

This seems to be a better temporary solution to have things working for until
we've got proper workspace, depsgraph and it's per-layer storage in place.
2017-04-18 15:06:41 +02:00
363ea3a1ce Remove deprecated GL_LIGHTING chunk from manipulator draw code.
This is new feature, will likely need own shader to get same result.
Just commented it as TODO, though, this is not high priority.

Part of T51164.
2017-04-18 14:58:45 +02:00
2836003f6b Fix T51187: Memory leak when exporting OpenEXR monochrome animation 2017-04-18 14:28:13 +02:00
b27a98df1d Merged master@e12c3110024dc4b62ffefa739288218b04e39f71 into blender2.8
This doesn't merge entire master into blender2.8, but at least solves
one conflict.
2017-04-18 14:18:06 +02:00
a229ca8f48 Garwain: fix ShaderInterface buffer shrinking 2017-04-18 22:04:00 +10:00
7d5a1c0c4c Alembic unittest: pass unknown CLI arguments to unittest.main()
This allows specifying test names on the CLI, in order to run only one
of the tests.
2017-04-18 13:57:04 +02:00
86288725df Alembic import: fall back to linear when variable order array is invalid.
This seems like more sane behaviour than to keep the orderu at the
invalid default value 0.
2017-04-18 13:57:04 +02:00
d24578b676 Alembic export: fixed curve type and order.
The order number written to Alembic is the same as we use in memory, so
the +1 wasn't needed, at least according to the reference Maya exporter
maya/AbcExport/MayaNurbsCurveWriter.cpp, function
MayaNurbsCurveWriter::write(), in the Alembic source code.

Furthermore, when writing an array of nurb orders, the curve type should
be set to kVariableOrder, otherwise the importer will ignore it.
2017-04-18 13:57:04 +02:00
edcf128ce2 Eevee: Introduction of world preconvolved envmap.
For now only compute GGX convolution. The GGX LUT used for the split sum approximation (UE4) is merged with the LTX mag LUT that uses the same parameters (theta and roughness)
2017-04-18 13:10:17 +02:00
f1fb605ec9 GPUFramebuffer: Allow to bind a specific texture mip to framebuffer. 2017-04-18 12:52:29 +02:00
40e69ad6df GPUTexture: Fix Cubemap upload 2017-04-18 12:50:28 +02:00
eda0ebc7b3 GPUTexture: Add Mipmap Control functions. 2017-04-18 12:50:28 +02:00
Dalai Felinto
7bf8ab3c49 Remove 4.1 pseudo-deprecated calls from gl-deprecated
First: we settle on core profile 3.3, not 4.1. Second, GL_CURRENT_PROGRAM still exists in 4.1 and 4.2. But it is recommented to use GL_ACTIVE_PROGRAM instead.

Following the logic of gl-deprecated.h we should define it to USE_GL_ACTIVE_PROGRAM instead. That said, removing it for now.
2017-04-18 12:09:32 +02:00
Pascal Schoen
8825a8e951 Squashed commit of the following:
commit 90778901c9
Merge: 76eebd9 3bf0026
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Mon Apr 3 07:52:05 2017 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 76eebd9379
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Thu Mar 30 15:34:20 2017 +0200

    Updated copyright for the new files.

commit 013f4a152a
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Thu Mar 30 15:32:55 2017 +0200

    Switched from multiplication of base and subsurface color to blending
    between them using the subsurface parameter.

commit 482ec5d1f2
Author: Schoen <schoepas@deher1m1598.emea.adsint.biz>
Date:   Mon Mar 13 15:47:12 2017 +0100

    Fixed a bug that caused an additional white diffuse closure call when using
    path tracing.

commit 26e906d162
Merge: 0593b8c 223aff9
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Feb 6 11:32:31 2017 +0100

    Merge branch 'master' into cycles_disney_brdf

commit 0593b8c51b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Feb 6 11:30:36 2017 +0100

    Fixed the broken GLSL shader and implemented the Disney BRDF in the
    real-time view port.

commit 8c7e11423b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Feb 3 14:24:05 2017 +0100

    Fix to comply strict compiler flags and some code cleanup

commit 17724e9d2d
Merge: 379ba34 520afa2
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jan 24 09:59:58 2017 +0100

    Merge branch 'master' into cycles_disney_brdf

commit 379ba346b0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jan 24 09:28:56 2017 +0100

    Renamed the Disney BSDF to Principled BSDF.

commit f80dcb4f34
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Dec 2 13:55:12 2016 +0100

    Removed reflection call when roughness is low because of artifacts.

commit 732db8a57f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Nov 16 09:22:25 2016 +0100

    Indication if to use fresnel is now handled via the type of the BSDF.

commit 0103659f5e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Nov 11 13:04:11 2016 +0100

    Fixed an error in the clearcoat where it appeared too bright for default
    light sources (like directional lights)

commit 0aa68f5335
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Nov 7 12:04:38 2016 +0100

    Resolved inconsistencies in using tabs and spaces

commit f5897a9494
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Nov 7 08:13:41 2016 +0100

    Improved the clearcoat part by using GTR1 instead of GTR2

commit 3dfc240e61
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 31 11:31:36 2016 +0100

    Use reflection BSDF for glossy reflections when roughness is 0.0 to
    reduce computational expense and some code cleanup

    Code cleanup includes:
    - Code style cleanup and removed unused code
    - Consolidated code in the bsdf_microfacet_multi_impl.h to reduce
      some computational expense

commit a2dd0c5faf
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Oct 26 08:51:10 2016 +0200

    Fixed glossy reflections and refractions for low roughness values and
    cleaned up the code.

    For low roughness values, the reflections had some strange behavior.

commit 9817375912
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Oct 25 12:37:40 2016 +0200

    Removed default values in setup functions and added extra functions for
    GGX with fresnel.

commit bbc5d9d452
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Oct 25 11:09:36 2016 +0200

    Switched from uniform to cosine hemisphere sampling for the diffuse and
    the sheen part.

commit d52d8f2813
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 16:17:13 2016 +0200

    Removed the color parameters from the diffuse and sheen shader and use
    them as closure weights instead.

commit 8f3d927385
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 09:57:06 2016 +0200

    Fixed the issue with artifacts when using anisotropy without linking the
    tangent input to a tangent node.

commit d93f680db9
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 09:14:51 2016 +0200

    Added subsurface radius parameter to control the per color channel
    effection radius of the subsurface scattering.

commit c708c3e53b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Oct 24 08:14:10 2016 +0200

    Rearranged the inputs of the shader.

commit dfbfff9c38
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 09:27:05 2016 +0200

    Put spaces in the parameter names of the shader node

commit e5a748ced1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 08:51:20 2016 +0200

    Removed code that isn't in use anymore

commit 75992bebc1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Oct 21 08:50:07 2016 +0200

    Code style cleanup

commit 4dfcf455f7
Merge: 243a0e3 2cd6a89
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Oct 20 10:41:50 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 243a0e3eb8
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Oct 20 10:01:45 2016 +0200

    Switching between OSL and SVM is more consistant now when using Disney
    BSDF.

    There were some minor differences in the OSL implementation, e.g. the
    refraction roughness was missing.

commit 2a5ac50922
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 09:17:57 2016 +0200

    Fixed a bug that caused transparency to be always white when using OSL and
    selecting GGX as distribution of the Disney BSDF

commit e1fa862391
Merge: d0530a8 7f76f6f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:59:32 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit d0530a8af0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:53:18 2016 +0200

    Cleanup the Disney BSDF implementation and removing unneeded files.

commit 3f4fc826bd
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 27 08:36:07 2016 +0200

    Unified the OSL implementation of the Disney clearcoat as a simple
    microfacet shader like it was previously done in SVM

commit 4d3a0032ec
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Sep 26 12:35:36 2016 +0200

    Enhanced performance for Disney materials without subsurface scattering

commit 3cd5eb56cf
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 16 08:47:56 2016 +0200

    Fixed a bug in the Disney BSDF that caused specular reflections to be too
    bright and diffuse is now reacting to the roughness again

    - A normalization for the fresnel was missing which caused the specular
      reflections to become too bright for the single-scatter GGX
    - The roughness value for the diffuse BSSRDF part has always been
      overwritten and thus always 0
    - Also the performance for refractive materials with roughness=0.0 has
      been improved

commit 7cb37d7119
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Thu Sep 8 12:24:43 2016 +0200

    Added selection field to the Disney BSDF node for switching between
    "Multiscatter GGX" and "GGX"

    In the "GGX" mode there is an additional parameter for changing the
    refraction roughness for materials with smooth surfaces and rough interns
    (e.g. honey). With the "Multiscatter GGX" this effect can't be produced at
    the moment and so here will be no separation of the two roughness values.

commit cdd29d06bb
Merge: 02c315a b40d1c1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 6 15:59:05 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 02c315aeb0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Sep 6 15:16:09 2016 +0200

    Implemented the OSL part of the Disney shader

commit 5f880293ae
Merge: 630b80e b399a6d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 2 10:53:36 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit 630b80e08b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Sep 2 10:52:13 2016 +0200

    Fresnel in the microfacet multiscatter implementation improved

commit 0d9f4d7acb
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Aug 26 11:11:05 2016 +0200

    Fixed refraction roughness problem (refractions were always 100% rough)
    and set IOR of clearcoat to 1.5

commit 9eed34c7d9
Merge: ef29aae ae475e3
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Aug 16 15:22:32 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit ef29aaee1a
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Aug 16 15:17:12 2016 +0200

    Implemented the fresnel in the multi-scatter GGX for the Disney BSDF

    - The specular/metallic part uses the multi-scatter GGX
    - The fresnel of the metallic part is controlled by the specular value
    - The color of the reflection part when using transparency can be
      controlled by the specularTint value

commit 88567af085
Merge: cc267e5 285e082
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 15:05:09 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit cc267e52f2
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 15:00:25 2016 +0200

    Implemented the Disney clearcoat as a variation of the microfacet bsdf,
    removed the transparency roughness again and added an input for
    anisotropic rotations

commit 81f6c06b1f
Merge: ece5a08 7065022
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Aug 3 11:42:02 2016 +0200

    Merge branch 'master' into cycles_disney_brdf

commit ece5a08e0d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 16:29:21 2016 +0200

    Base color now applied again to the refraction of transparent Disney
    materials

commit e3aff6849e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 16:05:19 2016 +0200

    Added subsurface color parameter to the Disney shader

commit b3ca6d8a2f
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 12:30:25 2016 +0200

    Improvement of the SSS in the Disney shader

     * Now the bump normal is correctly used for the SSS.
     * SSS in Disney uses the Disney diffuse shader

commit d68729300e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jul 26 12:23:13 2016 +0200

    Better calculation of the Disney diffuse part

    Now the values for NdotL und NdotV are clamped to 0.0f for a better look
    when using normal maps

commit cb6e500b12
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:26:42 2016 +0200

    Now one can disable specular reflactions again by setting specular and
    metallic to 0 (cracked this in the previous commit)

commit bfb9cb11b5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:11:07 2016 +0200

    fixed the Disney SSS and cleaned the initialization of the Disney shaders

commit 642c0fdad1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Jul 25 16:09:55 2016 +0200

    fixed an error that was caused by the missing LABEL_REFLECT in the Disney
    diffuse shader

commit c10b484dca
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Fri Jul 22 01:15:21 2016 +0200

    Rollback attempt to fix sss crashing, it prevented crash by disabling sss completely, thus useless

commit 462bba3f97
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Thu Jul 21 23:11:59 2016 +0200

    Add an undef for sc_next for safety

commit 32d348577d
Author: Jens Verwiebe <info@jensverwiebe.de>
Date:   Thu Jul 21 00:15:48 2016 +0200

    Attempt to fix Disney SSS

commit dbad91ca6d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed Jul 20 11:13:00 2016 +0200

    Added a roughness parameter for refractions (for scattering of the rays
    within an object)

    With this, one can create a translucent material with a smooth surface and
    with a milky look.

    The final refraction roughness has to be calculated using the surface
    roughness and the refraction roughness because those two are correlated
    for refractions. If a ray hits a rough surface of a translucent material,
    it is scattered while entering the surface. Then it is scattered further
    within the object. The calculation I'm using is the following:

    RefrRoughnessFinal = 1.0 - (1.0 - Roughness) * (1.0 - RefrRoughness)

commit 50ea5e3e34
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue Jun 7 10:24:50 2016 +0200

    Disney BSDF is now supporting CUDA

commit 10974cc826
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 31 11:18:07 2016 +0200

    Added parameters IOR and Transparency for refractions

    With this, the Disney BRDF/BSSRDF is extended by the BTDF part.

commit 218202c090
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 15:08:18 2016 +0200

    Added an additional normal for the clearcoat

    With this normal one can simulate a thin layer of clearcoat by applying a
    smoother normal map than the original to this input

commit dd139ead7e
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 12:40:56 2016 +0200

    Switched to the improved subsurface scattering from Christensen and
    Burley

commit 11160fa4e1
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 10:16:30 2016 +0200

    Added Disney Sheen shader as a preparation to get to a BSSRDF

commit cee4fe0cc9
Merge: 4f955d0 6b5bab6
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon May 30 09:08:09 2016 +0200

    Merge branch 'cycles_disney_brdf' of git.blender.org:blender into cycles_disney_brdf

    Conflicts:
    	intern/cycles/kernel/closure/bsdf_disney_clearcoat.h
    	intern/cycles/kernel/closure/bsdf_disney_diffuse.h
    	intern/cycles/kernel/closure/bsdf_disney_specular.h
    	intern/cycles/kernel/closure/bsdf_util.h
    	intern/cycles/kernel/osl/CMakeLists.txt
    	intern/cycles/kernel/osl/bsdf_disney_clearcoat.cpp
    	intern/cycles/kernel/osl/bsdf_disney_diffuse.cpp
    	intern/cycles/kernel/osl/bsdf_disney_specular.cpp
    	intern/cycles/kernel/osl/osl_closures.h
    	intern/cycles/kernel/shaders/node_disney_bsdf.osl
    	intern/cycles/render/nodes.cpp
    	intern/cycles/render/nodes.h

commit 4f955d0523
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 24 16:38:23 2016 +0200

    SVM and OSL are both working for the simple version of the Disney BRDF

commit 1f5c41874b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 24 09:58:50 2016 +0200

    Disney node can be used without SVM and started to cleanup the OSL implementation

    There is still some wrong behavior for SVM for the Schlick Fresnel part at the
    specular and clearcoat

commit d4b814e930
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:22:29 2016 +0200

    Switched from a parameter struct for Disney parameters to ShaderClosure params

commit b86a1f5ba5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:19:57 2016 +0200

    Added additional variables for storing parameters in the ShaderClosure struct

commit 585b886236
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 12:03:17 2016 +0200

    added output parameter to the DisneyBsdfNode

    That has been forgotten after removing the inheritance of BsdfNode

commit f91a286398
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 10:40:48 2016 +0200

    removed BsdfNode class inheritance for DisneyBsdfNode

    That's due to a naming difference. The Disney BSDF uses the name 'Base Color'
    while the BsdfNode had a 'Color' input. That caused a text message to be
    printed while rendering.

commit 30da91c9c5
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 16:08:10 2016 +0200

    disney implementation cleaned

commit 30d41da0f0
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 13:23:07 2016 +0200

    added the disney brdf as a shader node

commit 1f099fce24
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 3 16:54:49 2016 +0200

    added clearcoat implementation

commit 00a1378b98
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Apr 29 22:56:49 2016 +0200

    disney diffuse und specular implemented

commit 6baa7a7eb7
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 15:21:32 2016 +0200

    disney diffuse is working correctly

commit d8fa169bf3
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 08:41:53 2016 +0200

    added vessel for disney diffuse shader

commit 6b5bab6cec
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:22:29 2016 +0200

    Switched from a parameter struct for Disney parameters to ShaderClosure params

commit f6499c2676
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 18 10:19:57 2016 +0200

    Added additional variables for storing parameters in the ShaderClosure struct

commit 7100640b65
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 12:03:17 2016 +0200

    added output parameter to the DisneyBsdfNode

    That has been forgotten after removing the inheritance of BsdfNode

commit 419ee54411
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 17 10:40:48 2016 +0200

    removed BsdfNode class inheritance for DisneyBsdfNode

    That's due to a naming difference. The Disney BSDF uses the name 'Base Color'
    while the BsdfNode had a 'Color' input. That caused a text message to be
    printed while rendering.

commit 6006f91e87
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 16:08:10 2016 +0200

    disney implementation cleaned

commit 0ed0895914
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Wed May 4 13:23:07 2016 +0200

    added the disney brdf as a shader node

commit 0630b742d7
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Tue May 3 16:54:49 2016 +0200

    added clearcoat implementation

commit 9f3d39744b
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Fri Apr 29 22:56:49 2016 +0200

    disney diffuse und specular implemented

commit 9b26206376
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 15:21:32 2016 +0200

    disney diffuse is working correctly

commit 4711a3927d
Author: Pascal Schoen <pascal_schoen@gmx.net>
Date:   Mon Apr 18 08:41:53 2016 +0200

    added vessel for disney diffuse shader

Differential Revision: https://developer.blender.org/D2313
2017-04-18 11:43:09 +02:00
f970e859cf Cycles: Cleanup, style 2017-04-18 11:39:21 +02:00
968d86afc3 Depsgraph: Use proper scene to get frame from for pose constraints evaluaiton
Spotted by Luca, thanks!
2017-04-18 11:31:45 +02:00
dd356ec08d Cycles: Remove meaningless volume shaders
This is possible to use surface-only nodes and connect them to volume output.
If there was something connected to surface output those extra connections
will not change anything visually but will force volume features to be included
into feature-adaptive kernels.

In fact, this exact reason seems to be causing slowdown of Barcelone file
comparing AMD OpenCL to NVidia CUDA.

Currently only supported by the final F12 renders because of the current design
of what gets optimized out when and how feature-adaptive kernel accesses
list of required features.

Reviewers: dingto, nirved, maiself, lukasstockner97, brecht

Reviewed By: brecht

Subscribers: bliblubli

Differential Revision: https://developer.blender.org/D2569
2017-04-18 11:20:39 +02:00
bb8f7784ce Fix strict compiler compilation 2017-04-18 09:41:15 +02:00
554277986d Gawain: fix missing NULL check
Also shadowed variable warning
2017-04-18 15:04:01 +10:00
8d78df315c Fix UI: double separator in Movie Clip Editor's view menu 2017-04-17 23:54:19 -04:00
157a8727b5 Fix brush menu broken before adding uv and texture data
To reproduce: 1) go to texture paint mode 2) go into the brush menu

Pointed out by @lijenstina on IRC also fix is authored by him.
2017-04-17 23:42:17 -04:00
4d0d1b5936 Fix T51150: user_remap on itself changes users to 0.
Remapping to itself is nonsense here (was triggering an assert in
BKE_library code actually), just make it a bail out early in RNA
callback in that case.
2017-04-17 22:33:07 +02:00
16e929e6ff OpenGL: Fix crash on start with Mesa drivers
glFramebufferTexture() is only available from OGL 3.2, it is also not part of the ARB_framebuffer_object extension.
I don't know if there is a better way to check for mesa drivers or if using the 2D version will have issues with f2f16a256, but so far I had no problems
2017-04-17 22:31:56 +02:00
4621392353 Fix T51176: Cache file location can be blank and prevent fluid simulation from reading baked data
Sanitize a bit how cache path is handled by fluidsim (there is much more
to be done here though :( ), and forbid empty path (we reset to default
path relative to current .blend file in case it's empty).

If people really, really want to use current OS-wise directory, they can at
least use '.' as path. ;)
2017-04-17 17:35:53 +02:00
819064154c BLI: make BLI_make_existing_file() return true on success, and false on failure... 2017-04-17 17:35:53 +02:00
c89ed72048 Fluidsim cleanup: get rid of magic numbers! 2017-04-17 17:35:53 +02:00
11f4b407d4 Fix build error on Windows introduced in D2425 2017-04-17 13:41:05 +03:00
c6e8a004a1 Gawain: fix for last commit
Follow-up to 3bc6b831d8

Initial code was getting the number of ShaderInterfaces that could fit between two pointers (which makes no sense). I really meant number of bytes.

Surprised it worked on Mac, glad I tested on Windows before bed  :D
2017-04-17 04:01:46 -04:00
3bc6b831d8 Gawain: shrink ShaderInterface name buffer
ShaderInterface stores names of custom uniforms and all attributes in an internal buffer, but it doesn't know how large to make this buffer until all inputs are scanned.

This commit shrinks the buffer to the exact size needed.
2017-04-17 01:45:21 -04:00
b3e38cfc6b Gawain: look up uniforms by name quicker
ShaderInterface_uniform searches custom uniforms first, then builtin uniforms if needed.

This reduces the amount of string matching since you're almost certainly looking for one of those custom uniforms. Otherwise you would've called ShaderInterface_**builtin**_uniform.
2017-04-17 01:19:28 -04:00
57d31171d0 Object.raycast: more minor improvements ...
- if it is to check a bool, let it be local;
- removes gotos;
2017-04-16 18:50:06 -03:00
47e0d2b235 OpenGL: tweak GPU_texture_create_nD
- test for 2D textures first since it's the most common case
- declare variables close to where they're used
- fix compiler warning for proxy (uninitialized use)
- safe return if n != 1, 2, 3 (should never happen)
- white space
2017-04-16 15:11:38 -04:00
8dcf7a46a2 OpenGL: fix GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR
The fragment shader expects a normal, but the vertex shader was not providing one.

Fix: added a new vertex shader that has normals + smooth color interpolation.

I also split gpu_shader_3D_vert in two:
- one with just position
- one with position + normal

For each of the builtin shaders, we should be able to look at the GLSL and tell exactly what it's doing. Using #defines and #ifdefs for rendering options makes the shaders hard to read and easy to break.
2017-04-16 15:04:07 -04:00
6a2c82332b fix mistake from last commit
I didn't build this BGE-related code before pushing. My bad!

fix for af61b5eb0c
2017-04-16 13:57:16 -04:00
af61b5eb0c cleanup use of immUniformColor
- use best function for the job
- don't specify alpha if 100%
- 'f' for floating point literals
2017-04-16 13:44:34 -04:00
ae07130540 Gawain: add immUniformColor3ubvAlpha
Convenience function for specifying colors with separate RGB and alpha. Alpha ranges from 0 to 255.
2017-04-16 13:33:21 -04:00
7041b99b5a use immUniformColor instead of immUniform("color"
The specialized color functions are better in every way:
- faster lookup (don't have to match "color" string)
- flexible inputs (RGB with separate alpha)
- automatic alpha = 1.0 if not specified

Sort of related to T49043
2017-04-16 12:25:42 -04:00
15215652e1 Fix T49617: Grease Pencil Stroke Placement regression
When moved the options to toolsetting, this part was missing. The problem was not the pointer as suggested in D2629.

Thanks Arvīds Kokins for his help fixing this bug
2017-04-16 17:52:39 +02:00
bf441fcfac Gawain: move AttribBinding funcs to private interface
Other parts of Gawain uses these internally, but they're not part of the public API.

Part of T51219
2017-04-16 11:21:45 -04:00
4a41bc8cea Gawain: fix compiler warnings
vertex_format.c implements both public and private functions, so needs to include the private header.

Follow-up to 7c57ca5109
2017-04-16 11:08:26 -04:00
30249499c4 Gawain: fix compilation on MSVC 2013
attrib_binding.c uses NULL, so include stddef.
Also swapped stdlib for stddef in vertex_format.c, since it only needs NULL.

Not sure why MSVC 2017 and clang/Mac work without this...

Thanks to @youle for reporting!
2017-04-16 11:00:59 -04:00
888e742f84 OpenGL: minor cleanup & TODO
Just clearing out some old git stashes.

No point getting old GL light model to work on old Intel GPUs (both are obsolete for 2.8)
2017-04-15 19:43:56 -04:00
da17928fd5 Gawain: look up builtin uniforms by enum, not by name
This speeds up color and transformation matrix lookups at draw time (used by almost all shaders).
2017-04-15 19:19:00 -04:00
abd1934be6 Gawain: use ShaderInterface to manage vertex attribs
This eliminates tons of glGetAttribLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!
2017-04-15 18:06:54 -04:00
2593ce9c33 Gawain: remove 2D matrix uniforms from ShaderInterface
- remove 2D-specific variants of BuiltinUniform enum
- rename remaining builtins to exclude "_3D" since they can be used by 2D or 3D shaders

Follow up to D2626
2017-04-15 17:07:29 -04:00
ea105bab2b Gawain: fix header comments
Missed this when splitting VertexBuffer from Batch -- they used to live in the same file.
2017-04-15 15:42:58 -04:00
7c57ca5109 Gawain: move some VertexFormat funcs to private interface
Other parts of Gawain uses these internally, but they're not part of the public API.

Part of T51219
2017-04-15 13:10:14 -04:00
16f08b08fc Gawain: rename AttribBinding clear for consistency
AttribBinding is only used internally by Gawain.

Part of T51219
2017-04-15 13:06:43 -04:00
Julian Eisel
b92b250b08 Fix missing manipulator update after undo
Steps to recreate the error were:
* Enter edit mode
* Change Vertex positions
* Undo -> Manipulator position isn't updated
2017-04-15 15:58:49 +02:00
2f78d58681 Cleanup: lattice drawing had mesh include & names 2017-04-15 17:52:42 +10:00
376d05bf30 Cleanup: GPU header guards 2017-04-15 17:51:08 +10:00
8c0864b5ed GPU matrix: add back type checks
Without this gpuGet functions would cast everything
(no type or size checks and override const variables).
2017-04-15 17:45:20 +10:00
ce1dc55453 Remove redundant declaration 2017-04-15 17:17:09 +10:00
4b043994e8 GPU Matrix API: clean up after 2D-3D unification
See GPU_matrix.h & gpu_matrix.c for the important changes. Other files are mostly just updated to use the latest API.

- remove unused functions, defines, enums, comments
- remove "3D" from function names
- init to Identity transform (otherwise empty stack)
- gpuMatrixReset lets outside code return to initial state

Part of T49450
Follow up to D2626 and 49fc9cff3b
2017-04-15 01:29:56 -04:00
ff3942505a Cleanup: Use doxy-groups for draw-cache 2017-04-15 14:24:30 +10:00
608b711beb Cleanup: explicit names for return arguments and position last 2017-04-15 14:07:57 +10:00
Dalai Felinto
49fc9cff3b GPU Matrix API: Remove ModelView/Projection 3D suffix 2017-04-14 18:07:16 +02:00
Dalai Felinto
cb2c4bfb74 GPU Matrix API refactor: Stick to a single 4x4 stack for 2D and 3D
* Brings us closer to core profile, all matrices are working, and apart
from a problem with text drawing, Blender is working fine.

* Reduce the coding overhead of having to setup/teardown when
alternating between 2D and 3D drawing sessions.

* Gives us fewer modes and states we need to keep track of.

Unfortunatelly this also "rejects a fundamental change" the original
design was trying to make - that 2D is different from 3D and
deserves its own best implementation.

That said, it is still aligned with the function API design as
originally implemented (i.e., it still uses gpuTranslate2D, ...).

Finally, if you build with core profile and this patch you get:
https://developer.blender.org/F545352

[The text glitch is an unrelated issue].

Reviewers: merwin, sergey, brecht

Differential Revision: https://developer.blender.org/D2626
2017-04-14 18:07:16 +02:00
e7c4eddace Add fatal error in CMake when trying to build WITH_GAMEENGINE but without WITH_LEGACY_OPENGL
This won't work currently.
2017-04-14 17:16:15 +02:00
89e23c743e OpenGL: fix Mac crashing on startup
On Apple we use OpenGL 2.1 + an ARB extension for framebuffers.

The glFramebufferTexture function is part of OpenGL 3.0 but not part of the ARB extension. This commit fills that gap.

All other platforms are using GL 3.0+ already so it's not an issue there. All platforms (Mac too) will use GL 3.3+ soon so this workaround will be removed.
2017-04-14 10:35:30 -04:00
Dalai Felinto
bef2aab862 Gawain: fix crash when drawing batches (e.g., scale manipulator)
Introduced in b02786ae6b
2017-04-14 14:33:29 +02:00
95b3632112 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.cc
2017-04-14 12:39:54 +02:00
6cda217a82 Fix Blenderplayer (c) 2017-04-14 12:14:47 +02:00
26f25b1b27 OpenGL: use ShaderInterface to look up uniforms
These were the last few glGetUniformLocation calls in source/blender.

The new system gets uniform information once when a shader is created, then uses this cached info every time after that.
2017-04-13 18:37:26 -04:00
Dalai Felinto
532532afc7 Revert "OpenGL core: add some missing gpuBegin to allow clay with no UI"
This reverts commit 1c01811cce.

It broke everything.
2017-04-13 18:24:04 -04:00
02273441dc Draw Manager: lattice editmode drawing 2017-04-14 04:34:12 +10:00
Dalai Felinto
1c01811cce OpenGL core: add some missing gpuBegin to allow clay with no UI 2017-04-13 19:18:42 +02:00
Dalai Felinto
fe559d0659 OpenGL: do not support legacy matrix when using core profile 2017-04-13 18:45:17 +02:00
257e6c0c7d Remove deprecated opengl stuff from opensubdiv
This removes glGetBooleanv queries for GL_LIGHTING. This has been #ifdef'd
out with legacy opengl disabled. Thus a false positive still shows up in
the gl queries. Also, note that this removes support for wireframes in
opensubdiv, when desabling legacy opengl, which should be fixed later.

Part of T49043
2017-04-13 16:57:53 +02:00
8458ffcf5b Remove some elbeem debug functions
Some elbeem debug functions had old gl drawing calls. I removed the
functions instead of converting, because Blender doesn't even build
with them enabled anymore, because some elbeem debug libs got removed
at some point.

Part of T49043
2017-04-13 16:57:53 +02:00
Dalai Felinto
5a5f1dc8e4 Unittests for depsgraph layer collection render settings evaluation
Some of the tests are failing at the moment.
Those problems were introduced in eba09b1520
2017-04-13 16:28:50 +02:00
Dalai Felinto
9b53bab0b7 Update despsgraph when set/unset variables 2017-04-13 15:38:35 +02:00
Dalai Felinto
368b3c145b Layer collection settings API
This way we can set a property via RNA, and also force an update of scene layer (which I am using for unittesting)
2017-04-13 15:38:15 +02:00
2128e26d86 Draw Manager: initial lattice support
Still misses support for edit-mode selection & weight drawing.
2017-04-13 22:09:59 +10:00
b96777b3e1 Cleanup: minor changes to logic for outline drawing
Use brace placement following code-style too.
2017-04-13 21:46:18 +10:00
102c331146 Fix RNA LayerCollectionEngineSettingsClay not inheriting from LayerCollectionSettings.
Was hence missing the 'name' property, which broke the 'dict-like'
behavior of Scene.collection_properties.
2017-04-13 12:17:50 +02:00
6f268ac55d Merge branch 'master' into blender2.8 2017-04-13 13:02:39 +03:00
0a62e971b2 Draw Engine: Draw sets recursively
Matchers regular viewport behavior
2017-04-13 19:42:59 +10:00
ffa63d2de6 Use regular header guards in GPU 2017-04-13 19:11:55 +10:00
1c426d5b6c OpenGL: implement 2D with 4x4 matrices
... even though 3x3 feels better.
 
This is a compromise to get core profile up & running sooner. Eventually I'd like to finish the original 3x3 plans, but this commit will let us get on with other tasks.

External API stays (almost) the same. Our GLSL shaders can use this without any changes.

Part of T49450 and T51164
2017-04-13 04:00:19 -04:00
fae01c3a54 use new 3D matrix impl in draw manager
These functions mark the beginning and end of 3D drawing, causing the matrix API to use our own implementation instead of legacy OpenGL.

Part of T49450
2017-04-13 01:07:52 -04:00
56e9629d96 Gawain: look up array uniforms correctly
Look up "name[0]" when asked for "name", since that marks the beginning of the array.

We're comparing to the name stored in ShaderInterface which comes from glGetActiveUniform.
2017-04-13 01:07:51 -04:00
f7087109ce cleanup image drawing setup 2017-04-13 01:07:51 -04:00
b02786ae6b Gawain: use ShaderInterface to manage uniforms
This eliminates tons of glGetUniformLocation calls from the drawing loop. Vast majority of code can keep making the same function calls. They're just faster now!

- Batch_Uniform*
- immUniform*
- gpuBindMatrices
- and others
2017-04-13 01:07:51 -04:00
6bfb9b7b5f Gawain: add immUniform4iv
Needed soon by OCIO.
2017-04-13 01:07:50 -04:00
c61b7b0263 Gawain: add (temp) legacy GLSL support to ShaderInterface
A temporary measure needed by GPU_basic_shader.

Part of T51164
2017-04-13 01:07:50 -04:00
02fd9a1aaf Gawain: improve ShaderInterface
- builtin uniforms match what Blender needs
- set input counts in struct (stupid mistake)
- look up uniforms by name
- look up builtin uniforms by enum
- check attrib/uniform locations for error
2017-04-13 01:07:49 -04:00
c0a9e388b3 GLSL: rename edit_overlay -> edit_mesh_overlay
Avoid confusion with overlays with non-mesh types
2017-04-13 14:13:46 +10:00
64660b902c Use 'safe' macros for common free operation
Same as MEM_SAFE_FREE macro,
checks for NULL, runs free then sets NULL.

Blocks of code that do this many times are noisy and likely
errors here wouldn't be noticed immediately.

Also NULL's static vars which were being left set.
2017-04-13 13:37:27 +10:00
c080702e73 fix drawing file column dividers (T51189)
Problem was an edge case where vertex_ct logic and draw logic disagreed on how many dividers to draw.

Fix: copy draw logic to earlier vertex_ct

I also skip any drawing or setup if vertex_ct = 0, and set color attribute only for each line's provoking vertex. Small optimizations but these things add up.
2017-04-12 14:20:55 -04:00
Dalai Felinto
2871bad8ea Fix T51188 compilation errors in Windows 2017-04-12 18:58:38 +02:00
Dalai Felinto
6e4cc26265 Layer / Outliner / Depsgraph: update depsgraph when running outliner operators 2017-04-12 16:55:04 +02:00
Julian Eisel
428e07a9f7 Outliner: Draw nested collections before objects of a collection
Collections may contain a huge list of objects, would be annoying having
to scroll over it all the time to get to the nested collections.
2017-04-12 14:47:54 +02:00
Julian Eisel
64905c4c77 Outliner: Fix objects of master collection not showing up in 'Master Collection Tree' 2017-04-12 14:45:42 +02:00
af2fc7b637 Merge branch 'master' into 28 2017-04-12 20:23:44 +10:00
0c9a2def8b Draw Engine: remove hard coded limit on array sizes
This removes MAX_STORAGE, MAX_BUFFERS, MAX_TEXTURES, MAX_PASSES limits.

Actual memory saving isn't so important, it just means we don't need to
manually bump these based on changes to engines.
2017-04-12 19:51:14 +10:00
b380f4927e Remove bool -> int cast
Wont work as expected on big endian systems
2017-04-12 18:23:40 +10:00
208f25d626 Cleanup: naming & line length 2017-04-12 18:23:17 +10:00
cc0c5dbd91 Cleanup: use DRW_cache_mesh prefix w/ mesh objects
Avoid confusion for non mesh types where verts/wire/surface might apply.

Other object types use this convention already.
2017-04-12 18:11:10 +10:00
9e94479359 EditMesh Render: remove edges-of-vert loop
Replace topology check which checked edges twice
with a loop on the edge array.
2017-04-12 15:43:20 +10:00
dc1499ba1c Merge branch 'master' into 28 2017-04-12 14:23:47 +10:00
ed8c71da1c Cleanup: replace char array with struct 2017-04-12 14:08:44 +10:00
5cf090ffec EditMode: remove edge-hash from MeshRenderData
LoopTri's can access this data.
2017-04-12 13:45:56 +10:00
e78412c905 Cleanup: use const pointer for view access API 2017-04-12 12:10:01 +10:00
95dd478e47 Cleanup: line length
Avoid right-shift
2017-04-12 12:05:11 +10:00
42349f6efd fix compile warnings 2017-04-11 19:35:30 -04:00
e8ddd258ef Correct own error in adding colors
Make comment regarding GLSL more clear.
2017-04-12 00:56:19 +10:00
5a4fceff1b Make image drawing code working with core profile
The issue was caused here by usage of deprecated GL_CURRENT_PROGRAM
which was returning rubbish value.

Now we use imm API and create vertex format prior to immBindProgram.
This made us required to have some sort of state passed from setup
function to actual drawing.
2017-04-11 16:49:39 +02:00
Dalai Felinto
35ee9db1e2 Renaming: sl > scene_layer 2017-04-11 16:49:32 +02:00
Dalai Felinto
4fe4c82dbd Fix blenderplayer(tm) 2017-04-11 16:24:59 +02:00
70e4f1e003 Draw Manager: Fix blended color. 2017-04-11 16:13:29 +02:00
181c8f8ccd Draw Manager: Fix Background sets not being drawn. 2017-04-11 16:13:29 +02:00
Dalai Felinto
aef4519c8a Renaming: sl > scene_layer 2017-04-11 16:09:30 +02:00
Dalai Felinto
6f8c838b78 Cleanup: remove no longer needed BASE_ defines 2017-04-11 15:51:18 +02:00
Dalai Felinto
9a303d5db7 Bring snapping back (Base / BaseLegacy) 2017-04-11 15:46:01 +02:00
513aacbdb6 Use immediate mode API for OpenColorIO 2017-04-11 15:39:04 +02:00
fd5b882a67 Move cage_manipulator.c to new GL code.
Note: I’d assume gawain equivalent to glDrawArrays would be batches? But
for two lines drawn twice this looks totally overkill anyway, so
switched back to basic immediate-mode-like API.

A bit frustrating to work on this code, since afaict you cannot check
the results in Blender, being mostly unused currently...
2017-04-11 15:19:00 +02:00
b8c4be0844 FIx copy/paste mistake in own previous commit. 2017-04-11 15:19:00 +02:00
85f81293c4 GL/WIP: fix crash drawing text object
Note that this doesn't set the normal as it should (noted as a TODO),
just committing to avoid the crash.
2017-04-11 22:46:56 +10:00
88fddd118f Draw Manager: replace varargs with a pointer array
Allows to ensure correct number of args
2017-04-11 21:20:18 +10:00
7c4e164ff3 Get rid of last deprecated OpenGL calls in arrow_manipulator.c
Hope that makes sense...
2017-04-11 12:47:38 +02:00
633a2a3592 Move arrow2d_manipulator to new immediate mode GL. 2017-04-11 12:46:49 +02:00
9d00b7680f Uncomment deselected center point color 2017-04-11 15:48:54 +10:00
e199eae39d Draw Manager: Add center-color for linked/multiuser objects
Draws a blue center circle for library objects.
As with regular drawing, this uses a hard-coded color.
2017-04-11 14:05:39 +10:00
c8e2436734 Merge branch 'master' into blender2.8 2017-04-11 11:01:16 +10:00
016790b3b0 Object Engine: Fix Selected Group Objects color. 2017-04-10 22:23:50 +02:00
4f063dc4dd Object Engine: Ported Force Field object drawing. 2017-04-10 22:23:50 +02:00
fb1ecbc2da Gawain: remove PRIM_QUADS_XXX
Thanks @mont29 for finishing off the last few QUADS in blender.
2017-04-10 16:20:24 -04:00
f0404c3382 Get rid of last PRIM_QUAD usage, in blf_font.c/blf_glyph.c. 2017-04-10 21:21:38 +02:00
c9685a148f Nuke three remaining uages of PRIM_QUAD in drawobject.c
This was slightly less obvious, especially particle billboard drawing.
That one now requires 1.5 times more space in VBOs and ParticleDrawData
buffers, since we have to draw two triangles per particle, instead of a
single quad... And diagonal of each quad is now drawn in wire mode, not
sure how much we consider this an issue (as in, will this particle draw
code change a lot in future?).

From quick check on the web seems there is no other way to do anyway. :/
2017-04-10 20:33:09 +02:00
490fea6107 Minor cleanup/fix for own rB45f3150c9844326 merge. 2017-04-10 18:52:35 +02:00
d8fa3dd7c3 GL: use imm* module for 2D cage manipulator 2017-04-11 02:32:53 +10:00
304935e02a GL/playanim: use immediate mode wrapper, replace glDrawPixels 2017-04-11 02:05:53 +10:00
45f3150c98 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2017-04-10 17:34:31 +02:00
5f70116030 OpenGL: Fix textureXd deprecated calls. 2017-04-10 16:59:20 +02:00
01bd6da68f Draw Manager: Add Manipulator Back. 2017-04-10 16:59:20 +02:00
9a38a6bdab GPencil 2D Drawing: get rid of PRIM_QUAD_XXX.
Here we can easily use a PRIM_TRIANGLE_STRIP instead!
2017-04-10 16:54:21 +02:00
346964eb3f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
2017-04-10 16:53:12 +02:00
39451ac712 Fix compilation error with strick flags caused by missing abort() 2017-04-10 16:20:18 +02:00
Dalai Felinto
e68b808564 Fix glCheckFramebufferStatusEXT 2017-04-10 15:53:08 +02:00
9fd3435a93 First batch of PRIM_QUAD_XXX replacement by PRIM_TRIANGLES. 2017-04-10 15:17:26 +02:00
Dalai Felinto
2d158a425d Upgrade glew to v2.0 2017-04-10 14:53:32 +02:00
f2f16a2568 Eevee: First Shadows implementation
Using Texture Arrays to store shadow maps so less texture slots are used when shading. This means a large amount of shadows can be supported.

Support Projection Shadow Map for sun like in old BI/BGE.

Support Cube Shadow Map for Point/Spot/Area lights. the benefit of using it for spot light is that the spot angle does not change shadow resolution (at the cost of more memory used). The implementation of the cubemap sampling is targeted for 3.3 core. We rely on 2D texture arrays to store cubemaps faces and sample the right one manualy. Significant performance improvement can be done using Cubemap Arrays on supported hardware.

Shadows are only hardware filtered. Prefiltered shadows and settings comming next.
2017-04-10 12:36:32 +02:00
0811d089b4 Draw Manager: Use Texture flag in Framebuffer init. 2017-04-10 12:36:32 +02:00
fad3fe4ed1 GPUTextures: Work on cubemap support and array textures 2017-04-10 12:36:32 +02:00
da082a095b Eevee: Fix spot lights 2017-04-10 12:36:32 +02:00
Dalai Felinto
f87815705b Make build with GL 3.3 again
This is a workaround while the PRIM_QUADS_XXX are still in the code
2017-04-10 12:21:13 +02:00
Dalai Felinto
b6ba507c1b Layers unittest: layer_cyncing test was not being called 2017-04-10 10:08:29 +02:00
Dalai Felinto
90b2b99505 Unitettesting: Force python errors to show as error 2017-04-10 10:03:02 +02:00
Dalai Felinto
29c738258b GL stubs: no need to assert when calling deprecated calls 2017-04-10 09:33:57 +02:00
Dalai Felinto
2482f94706 Expand OpenGL stubs to allow for breakpoints 2017-04-10 09:15:59 +02:00
Dalai Felinto
91056337a8 Add stubs to build WITH_GL_PROFILE_CORE
This is an auto-generated list, crossing gl-deprecated.h, glew.h and the
Blender code. It allows Blender to build with core profile.

WITH_OPENGL_LEGACY=ON: nothing changes

WITH_OPENGL_LEGACY=OFF and WITH_GL_PROFILE_CORE=OFF:
It stubs deprecated legacy calls.

WITH_OPENGL_LEGACY=OFF and WITH_GL_PROFILE_CORE=ON:
It stubs deprecated legacy calls thus allowing Blender to build with
core profile only.

Technically you only want to use WITH_OPENGL_LEGACY=OFF when
WITH_GL_PROFILE_CORE=ON. But it doesn't hurt to have it working for both
scenarios.

Reviewed by: merwin

Differential Revision: https://developer.blender.org/D2610
2017-04-10 08:45:00 +02:00
Julian Eisel
15bcfaa36b Merge branch 'master' into blender2.8 2017-04-09 22:51:38 +02:00
928f5df1b4 Cleanup: glsl indentation 2017-04-09 16:36:39 +10:00
c800ee6bfe Merge branch 'master' into blender2.8 2017-04-09 16:09:12 +10:00
79e862ad6b GPU lib support for WITH_LEGACY_OPENGL
For early testing of core profile:
- GPU_legacy_support = false
- GPU_display_list_support = false
- GPU_geometry_shader_support = true

Relates to T49012
2017-04-08 02:34:30 -04:00
f60626e3a6 OpenGL: drop support for EXT_geometry_shader4
See gpu_shader.c for the main changes.

EXT_geometry_shader4 brought this feature to GL versions < 3.2, but now it's just cluttering up our code.

Soon all platforms will be on version 3.3 so we won't even have to check support at runtime!
2017-04-08 02:21:13 -04:00
d5883bb1ba Gawain: remove GL enum from primitive API
Callers now have to use Gawain's PRIM enum to specify geometric primitives.

This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than GL_POINTS, GL_LINES, etc.

Also prepares us for Vulkan.
2017-04-08 01:19:48 -04:00
0947c97fad OpenGL: use PRIM instead of GL enum everywhere else
Well, everywhere that uses Gawain for drawing. Places that call OpenGL directly still use GL enums.

Part of T49043
2017-04-08 01:19:48 -04:00
1de61696fd Correct constraint manipulator colors
Widget show as color of constrained axis
2017-04-08 12:08:51 +10:00
8205a19323 Fix WITH_LEGACY_OPENGL=ON
This wasn't working outside of gpu module.
2017-04-08 12:01:29 +10:00
bd3a1b9490 OpenGL: use PRIM instead of GL enum for immBegin
Getting ready for a Gawain API change...

Part of T49043
2017-04-07 16:31:26 -04:00
c1dc078840 Gawain: remove GL enum from vertex format API
Callers now have to use Gawain's COMP enum to specify vertex attributes.

This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than component types.

Also prepares us for Vulkan.
2017-04-07 16:00:03 -04:00
1ad5287260 use COMP instead of GL enum to construct vertex format
I converted all other files a day or two ago; this file was part of a recent merge.
2017-04-07 15:51:39 -04:00
da24848fb4 OpenGL: remove UI_reinit_gl_state function
All line & point drawing is responsible for setting its own state (as of January 2016) making this redundant.
2017-04-07 15:10:48 -04:00
7a75581d92 OpenGL: transition away from GL_QUADS
Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order.

Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this.

Part of T49043
2017-04-07 15:03:24 -04:00
d6ae3789a1 Gawain: append XXX to PRIM_QUADS to make it scary
Quads are not part of modern GL or Vulkan, so we should avoid them. XXX makes coders think "hmm how could I draw this without using quads?"

Quads will be removed during the transition to core profile.

Part of T49043
2017-04-07 14:21:10 -04:00
23b10b549a fix use of uninitialized variable
Bug crawled in via 2944438e9a as part of custom manipulators.
2017-04-07 13:48:11 -04:00
3f6d25f4eb shrink fixed-size internal GLSL string buffers
We concatenate #defines and #extensions into these, and can count the max string lengths needed. 256 is enough to hold today's strings; we can adjust later if needed.
2017-04-07 13:28:42 -04:00
1a156f7103 use best GPU matrix function for the job
Follow-up to 204e067111 which coverted manipulators' legacy GL matrix calls to new ones.

part of T49450
2017-04-07 13:24:00 -04:00
f0ce39ab16 OpenGL: support GLSL 3.3 core profile
When WITH_LEGACY_OPENGL = OFF.

This is our final target for Blender 2.8, all previous versions will be dropped in the future. GLSL 3.3 is richer so we don't require as many extensions.
2017-04-07 12:51:11 -04:00
Dalai Felinto
db444fc783 Workaround for weightpoint not working
Kudos to Germano Cavalcante for spotting the issue, the real fix is to pass SL to the function though
2017-04-07 18:00:54 +02:00
31c272e840 Simplified some test code in render_layer_common.py 2017-04-07 17:51:23 +02:00
ad60283bc8 No more need to alter sys.path in each and every render_layer unit test.
I tried the clean way, by setting the PYTHONPATH environment variable for
CTest, using SET (CTEST_ENVIRONMENT blablab), but that didn't seem to
work.
2017-04-07 17:50:47 +02:00
6cf3fa9ff0 Tests: import blendfile without modifying sys.path 2017-04-07 17:29:14 +02:00
063bae4fcc Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/alembic/intern/abc_exporter.h
#	source/blender/alembic/intern/abc_util.cc
2017-04-07 17:28:22 +02:00
Julian Eisel
711ac03fa1 OpenGL: Get rid of PRIM_QUADS usage in manipulators code 2017-04-07 17:05:33 +02:00
Dalai Felinto
4e09533f8c OpenGL / Outliner: QUADS are not supported in core 2017-04-07 16:43:05 +02:00
Julian Eisel
204e067111 Fix drawing of planar transfrom manipulators, update matrix code 2017-04-07 16:04:04 +02:00
2dd84c9570 3D Manipulator: add back protected flags check
This used to be a separate pass
2017-04-07 23:01:20 +10:00
2944438e9a 3D View: manipulator from custom-manipulators branch
Original code from @Severin with changes from @dfelinto & @hypersomniac.

This doesn't cause many functional changes
besides using new transform manipulators.

Submitted as D2604
2017-04-07 21:23:32 +10:00
Dalai Felinto
8ec1a05ef5 Replace CGSubSurf direct includes to GL/glew.h 2017-04-07 13:03:31 +02:00
d649f26858 Fix compilation error after recent changes 2017-04-07 09:58:54 +02:00
9c01aaa3dd OpenGL: disable rotate manipulator clipping on Mac
This fixes T51143.

gl_ClipDistance is part of GLSL version 1.3 but Mac is stuck on 1.2 for now.

This workaround uses GPU_SHADER_3D_UNIFORM_COLOR for the entire rotation widget, ignoring any clipping plane. The CLIPPING shader only works on GLSL 1.3+ so I removed its 1.2 cruft.

A legacy implementation using gl_ClipVertex might be possible, but is not worth the effort. This problem (and workaround) goes away when all platforms move to 3.3 core profile.
2017-04-07 03:08:00 -04:00
c986a2c7aa fix rotation manipulator's Push/PopMatrix balance
Was popping out the bottom of the stack.
2017-04-07 03:51:10 -04:00
115a889bd7 OpenGL: refactor ui_panel_category_draw_tab
changes:
- exact vertex count
- take bool (filled vs outline) instead of GLenum

This function has some flexibility that is not currently used. I left that in.
2017-04-06 19:37:50 -04:00
f69678482c OpenGL: refactor UI_draw_roundbox functions
Each function takes a bool (filled vs outline) and a color. We already had multiple ways of passing color in; these are still here. Special variant for anti-aliasing.

- took GLenum out of interface
- removed UI_RB_ALPHA flag (only one place really used it)
- use exact vertex count
- removed redundant state changes (BLEND, LINE_SMOOTH)
2017-04-06 19:15:26 -04:00
Dalai Felinto
934dfc4200 New build option WITH_LEGACY_OPENGL
This introduces a new CMake option - WITH_LEGACY_OPENGL. Without this option
things may not draw perfectly, however, we should soon be able to build with
OpenGL core profile.

The matrix-related api calls are (still) not handled here (glTranslate, ...).

There seems to be no consensus on whether to make this build option the
default. We can talk about this later. For now two things are the
priority:

(1) To get rid of deprecated calls when WITH_LEGACY_OPENGL is ON
(2) To make core profile work for Mesa/Mac when WITH_LEGACY_OPENGL is OFF

Reviewers: merwin, sergey, campbellbarton

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

Many thanks for Sergey Sharybin for the help.
2017-04-06 18:46:33 +02:00
843922a480 Depsgraph: Prefer use anonymous structs for unused arguments 2017-04-06 16:58:19 +02:00
035b340f48 Depsgraph: Remove old depsgraph header from window manager 2017-04-06 16:44:32 +02:00
ec178b861c Depsgraph: Remove print dependnecies operator
This is not really supported with the new depsgraph.
2017-04-06 16:43:09 +02:00
ed1ef06199 Depsgraph: Remove old depsgraph header from blender internal 2017-04-06 16:38:43 +02:00
2d80f37bce Depsgraph: Remove old depsgraph header from python 2017-04-06 16:36:15 +02:00
05ffca5c8a Depsgraph: Remove old depsgraph header from modifiers 2017-04-06 16:34:38 +02:00
1165027308 Depsgraph: Remove old depsgraph header from freestyle 2017-04-06 16:32:59 +02:00
35db70a466 Depsgraph: Remove olde depsgraph header from new depsgraph 2017-04-06 16:18:42 +02:00
e9e703f0dd Depsgraph: Remove old depsgraph header from collada 2017-04-06 16:17:21 +02:00
7da2379124 Depsgraph: Remove old depsgraph header from blenloader 2017-04-06 16:13:57 +02:00
7b45edacab Depsgraph: Remove old header from blenkernel 2017-04-06 16:11:50 +02:00
2613ad64c5 Depsgraph: Remove old depsgraph header from alembic files 2017-04-06 15:49:56 +02:00
ae33f78229 Depsgraph: Remove old depsgraph header from game engine 2017-04-06 15:40:53 +02:00
d36fb4f08f Depsgraph: Remove old depsgraph headers from creator 2017-04-06 15:40:08 +02:00
a1b8c0bca2 Depsgraph: More type definitions to new depsgraph header 2017-04-06 15:37:46 +02:00
d8f931c9b7 Changes from custom-manipulators branch
Minor changes from custom-manipulators branch,
before larger changes are applied.
2017-04-06 22:10:09 +10:00
0feca278a4 Merge branch 'master' into blender2.8 2017-04-06 12:31:26 +02:00
Dalai Felinto
967b04cb07 Layer unittesting: pep8 touch up on test_evaluation_selectability_f.py 2017-04-06 12:22:21 +02:00
0debbe2b7f Gawain: VertexFormat_add_attrib (function name change)
See intern/gawain for the API change. Other files are updated to use the new name. Also updated every call site to the recommended style:
unsigned int foo = VertexFormat_add_attrib(format, "foo", COMP_ ... )
2017-04-06 01:18:12 -04:00
c2f5cd8f64 Gawain: add VertexBuffer prefix to functions
See intern/gawain for the API change. Other files are updated to use the new names.
2017-04-06 01:18:12 -04:00
957b408458 Fix manipulator showing in pose & editmode 2017-04-06 15:17:38 +10:00
0899b4bb3f Fix building without clay engine 2017-04-06 15:17:38 +10:00
ff3880ff93 Initialize immediate mode in Animation Player
PS. With this solution, immediate mode can be initialized and finalized consecutively if you drop a video

part of T49043
2017-04-06 01:54:10 -03:00
9f72580d07 Merge branch 'master' into blender2.8 2017-04-06 12:26:55 +10:00
13f77de214 Merge branch 'master' into blender2.8 2017-04-06 12:04:48 +10:00
e63ba6d0f4 Remove NULL check from gimbal_axis 2017-04-06 11:32:45 +10:00
Dalai Felinto
40cb5a067b Immediate Mode: missing ALPHA_TEST in gpuRestoreState
Missed in rBcbd78c81268f06e7b658ae042f3ab6a3816149b0
2017-04-05 21:46:08 +02:00
fa5e5f898e Cleanup: Remove depsgraph stubs 2017-04-05 15:57:36 +02:00
1980f3d3b8 Motion paths: Switch to a slower evaluation which does not need bases to be sorted
New dpesgtraph does not ensure bases are sorted by the evaluation order
any more, so motion paths update might go horrribly wrong.
2017-04-05 15:56:27 +02:00
5b386270a5 Cleanup: Get rid of legacy depsgraph header file 2017-04-05 15:50:45 +02:00
a13878b9af Cleanup: Remove legacy depsgraph private header from modifiers 2017-04-05 15:46:56 +02:00
70aa5f97f2 Cleanup, remove unused function 2017-04-05 15:45:54 +02:00
3bb88a7807 Merge branch 'master' into blender2.8 2017-04-05 15:36:55 +02:00
Dalai Felinto
929c45b7d4 Paint cursor changes, so it save/load only the required flags 2017-04-05 15:02:31 +02:00
Dalai Felinto
cbd78c8126 Immediate Mode: replacing glPushAttrib/glPopAttrib
Reference document: http://docs.gl/gl3/glPushAttrib

This patch only tackles the bits that are set by Blender with the
following exceptions:

1) Deprecated states (e.g., GL_STIPPLE) are not saved/restored

2) The exception being GL_ALPHA_TEST, which will be removed, but it may
affect drawing too much now. To be removed once we no longer set GL_ALPHA_TEST
elsewhere.

3) paint_cursor will be tackled separated, since it was abusing
glPush/PopAttrib in the first place.

4) Despite what the glPushAttrib page above may suggest, GL_DEPTH_WRITEMASK needs glGet, not glIsEnabled

5) BGE is still a problem since it relies on GL_ALL_ATTRIB_BITS which
would lead to a way more complete/lenghty solution. Since the BGE has
other (OpenGL deprecated) problems anyways, it can be handled on its own
time.

Finally, the original design for 2.8 was to implement a proper stack
system. However we need to move to core profile sooner than later. So
this is a pragmatic temporary (that may be permanent) solution.

Reviewers: merwin, campbellbarton

Differential Revision: https://developer.blender.org/D2600
2017-04-05 15:02:31 +02:00
Dalai Felinto
bbfa1a8639 Viewport: 3D cameras don't need glPushAttrib/glPopAttrib 2017-04-05 15:02:31 +02:00
ba5b792dd9 Depsgraph: Remove all layer bit flags related checks
These bits became obsolete with the new layer system, so we can
simplify some code around them or avoid existing workarounds which
were trying to keep things working for them.

There are still work needed to be done for on_visible_change to
avoid unnecessary updates, but that can also happen later.
2017-04-05 11:39:30 +02:00
1f6037c887 Fix T50976: Blender UI problems with certain theme files.
Core of the issue was that some of our Theme colors are RGB-only, but
were loaded as RGBA.

Note that tracking all possible cases is pretty impossible, so we'll
have to tackle those as they get reported am afraid.
2017-04-05 11:01:27 +02:00
2f700b8280 GPU_immediate_util: missed last commit 2017-04-05 18:53:34 +10:00
a4fac21fc5 Cleanup: Move imm_draw utils into own file
These were in BIF_glutil which is documented to be removed,
so best not define new API's there.
2017-04-05 18:43:59 +10:00
e9bb018a4a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.h
2017-04-05 10:02:25 +02:00
4dadb6d445 Naming constancy for 'imm' utility functions
- use 'imm_draw_' prefix for functions that draw.
- use '_3d' suffix for 3d functions, no suffix for 2d functions.
- use terms fill/wire (shorter than filled / lined).

Also add `imm_draw_circle_fill_3d` (only had wire version)
2017-04-05 17:46:25 +10:00
bcd95dbdbb Merge branch 'master' into blender2.8 2017-04-05 11:40:17 +10:00
064eba208e revert recent cleanup, keep useful changes
Don't want to annoy module owner.

What is kept:
- UI_view2d_scale_get with unused y scale
- corrected comment
- unsigned --> unsigned int
2017-04-04 19:36:32 -04:00
Julian Eisel
ebe1b4f11f Fix rotation manipulators not clipping
Added new shader for clipping, also cleaned up rotation manipulator
drawing code a bit.
This code should be replaced by new transform manipulators soon, just
keeping this working in the meanwhile.
2017-04-05 01:33:10 +02:00
Julian Eisel
dd4de189dd Fix blenderplayer compilation 2017-04-04 21:52:28 +02:00
125ce644f2 cleanup
I started cleaning up UI_view2d_scale_get where the y scale was unused, then got carried away...

- for loop scope
- declare variables closer to where they are used
- move early exits closer to function start
- unsigned --> unsigned int
2017-04-04 15:40:21 -04:00
Dalai Felinto
db0f67f464 Collada export cleanup 2017-04-04 20:44:22 +02:00
9ecb196237 fix: Collada export selected worked only for the very first export (needs further testing and cleanup, see comments) 2017-04-04 19:17:52 +02:00
Dalai Felinto
f10219a977 Immediate Mode: handle other cases of glPop/glPushClientAttrib
Those cases were not using ClientAttrib but they should :)
Rather use a OpenGL3.3 alternative anyways.
2017-04-04 18:43:01 +02:00
Dalai Felinto
fa317eb69c Fix collada exporting for Blender 2.8
Instead of exporting all the scene objects, I'm exporting the scene
layer objects instead.
2017-04-04 17:45:55 +02:00
Dalai Felinto
69f7b513b5 Immediate Mode: removing unecessary comment on gpencil (false positive) 2017-04-04 17:04:03 +02:00
Dalai Felinto
a0ef482124 Image Draw: remove unused code since 2009
(removing false positive deprecated OpenGL calls)
2017-04-04 16:47:09 +02:00
7fc84d4e32 Merge branch 'master' into blender2.8 2017-04-04 15:47:58 +02:00
Dalai Felinto
c8cff31922 UV editor using new depsgraph for shadow uv 2017-04-04 14:31:01 +02:00
Dalai Felinto
c87bfb1f7d Immediate Mode / DerivedMesh: Handle UV Shadow 2017-04-04 14:31:01 +02:00
Dalai Felinto
0e95270eb7 Depsgraph: placeholder function for COW objects query 2017-04-04 14:31:01 +02:00
Dalai Felinto
1baa236acb CTX_data_depsgraph(bContext *C); 2017-04-04 14:31:01 +02:00
Dalai Felinto
5eac4e3057 Immediate Mode: glPop/glPushClientAttrib 2017-04-04 14:31:01 +02:00
373d362e4a Fix bad level call. 2017-04-04 11:04:00 +02:00
4fe8395215 Cleanup: avoid long lines (search tools complain!) 2017-04-04 17:38:51 +10:00
0c68c92840 fix node editor drawing (T51086)
Fixed a few issues
- wrong transform matrices
- assert on node with no sockets
- color of collapsed nodes, some title areas

Also includes minor cleanup.
2017-04-04 01:15:35 -04:00
e9944fee33 Draw Manager: Fix engine_type not set 2017-04-03 22:30:34 +02:00
ccaa21df6d Infinite Grid: View angle fade
and show Z axis in special persp views
2017-04-03 21:52:42 +02:00
4a8aaab0b2 Draw Manager: Use engine type pointer instead of engine name.
Faster search
2017-04-03 21:52:42 +02:00
ccd8353d58 Object Engine: Fix multi user lamp data display bug.
Objects that were using the same lamp data were having the same display matrices.
This is fixed by allowing engine to store a memory block inside the object itself.
2017-04-03 21:52:42 +02:00
682c4dcd1e Draw Manager: Fix Cache timers
Also expand the timer average range.
2017-04-03 21:52:03 +02:00
eca256bc32 GPULamp: Separate GPULamp from GPUMaterial
Since we need GPULamps for draw engines, it makes sense to separate them.
2017-04-03 21:52:03 +02:00
8e0bfee1e5 Draw Manager: Fix glBlitFramebuffer error 2017-04-03 21:52:03 +02:00
46cd87f5da Eevee: LTC area lights
Using Linear Transform Cosines to compute area lighting. This is far more accurate than other techniques but also slower.

We use rotating quad to mimic sphere area light. For a better approximation, we use a rotating octogon.
2017-04-03 21:52:03 +02:00
Dalai Felinto
a78e97b206 Layer/Depsgraph: Update depsgraph for new objects 2017-04-03 18:47:50 +02:00
Dalai Felinto
d31c4c5666 Layer/Depsgraph: Fix selectability issues 2017-04-03 18:05:06 +02:00
Dalai Felinto
db6b4639fc Layer: Adding unittest for a problem with selectability evaluation
This is currently failing (and causing the object_delete test to fail). To be fixed separately
2017-04-03 17:46:03 +02:00
Dalai Felinto
ee6f858c91 Layer: Small refactor on layer_collection_add 2017-04-03 17:45:59 +02:00
5884c9f1ba Merge branch 'master' into blender2.8 2017-04-03 15:15:56 +02:00
3b6eaf8d96 Cleanup: style 2017-04-03 22:10:39 +10:00
fbcb920748 Rename circle_partial -> disk_partial
We may have a 'disk' function (not the partial version).
2017-04-03 22:10:38 +10:00
d1e55be96e Add gluPartialDisk replacement (imm_draw_filled_circle_partial)
Needed for custom-manipulators branch but generally useful.
2017-04-03 15:25:43 +10:00
eba09b1520 Blender 2.8: Hook of layer collections evaluation in DEG
This moves selectability/visibility flag flush from some hardcoded
places in the code to depsgraph. This way it is possible to simply
tag depsgraph to update those flags and rest it'll do on its own.

Using depsgraph for such flush is an overkill: those flags are fully
static and can not be animated, so it doesn't really make sense to
hook only those to depsgraph.

However, in the future we will have overrides on collections, which
ideally would need to be animatable and drivable and easiest way
to support this is to do this on depsgraph level, so it ensures
proper order of evaluation for animation and drivers. And it seems
logical to do both overrides and flags flush from depsgraph from
this point of view.

This commit also includes the evaluation of IDProperty for collections,
which basically are just another form of override. So once we implement
the other kind of overrides the flushing and collection evaluation won't
change.

Patch by Sergey Sharybin and Dalai Felinto
2017-04-01 01:27:08 +02:00
Dalai Felinto
97b9afda37 Layers / Depsgraph: Unittesting for selection and visibility evaluation 2017-04-01 01:22:39 +02:00
Dalai Felinto
5bfa6d8455 Fix crash in draw manager when no object active 2017-04-01 01:01:57 +02:00
Dalai Felinto
4c2f5ab33e Bumping version to 2.80
This should have been done earlier. But now that we may see more activity in master due to bcon3 merges, it is even more important to stress out the separation between master and 2.8.

Also I needed the version bump for idproperties doversion (they needed
to happen in _after_linking, and we don't have access to
DNA_struct_elem_find there).

Last but not least, every time I posted a video or image from 2.80, I
got someone confused about the version showing in the infobar.
2017-04-01 00:04:45 +02:00
Dalai Felinto
b0998df608 Layers: Fix scene copying after IDProperty changes
(also unittest: split scene copy in 4 tests)
2017-03-31 17:37:52 +02:00
Dalai Felinto
d9b89ca0d0 Layers unittest: Fix tests breaking since Folded was removed 2017-03-31 17:37:49 +02:00
Dalai Felinto
1f17b72efe Layers unittest: Breaking pep8, but getting tests to work again
I will investigate this further later.

The big problem is that the way I'm running tests if I have any error
(e.g., ImportError) the pass still pass.
2017-03-31 17:37:45 +02:00
Dalai Felinto
d1f402acfd Fix blenderplayer (tm) 2017-03-31 15:02:28 +02:00
70fdf0fe37 Merge branch 'master' into blender2.8 2017-03-31 23:52:22 +11:00
0be064067a Blender 2.8: Cleanup, no need in escape 2017-03-31 10:28:27 +02:00
e254aa8965 Eevee: Codestyle, optimisation and a few fixes
Something is very wrong with the energy factor. For now I tweaked them by hand to fit cycles.
2017-03-31 01:07:51 +02:00
Dalai Felinto
3fdbd78a6b Layer / IDProperty: Prevent previously created demo files from crash 2017-03-30 18:53:46 +02:00
Dalai Felinto
f2c6c831e3 Layer: remove no longer used settings 2017-03-30 18:40:31 +02:00
Dalai Felinto
ce3c7e8ff5 Layers: use IDProperty and override collection properties system
First this replace a custom data struct with IDProperty, and use
IDProperty group merge and copying functions. Which means that a collection
property setting is only created if necessary.

This implements the "Layer Collection settings" override system, as
suggested in the "Override Manifesto" document.

The core is working, with Scene, LayerCollection and Object using a
single IDProperty to store all the render settings data. Next step is to
migrate this to depsgraph.

Note: Clay engine "ssao_samples" was hardcoded to 32 for now. It will come
back as part of "Workspace Settings" later.

Many thanks for Bastien Montagne for the help with the UI template
nightmare ;)

Differential Revision: https://developer.blender.org/D2563
2017-03-30 17:01:23 +02:00
Dalai Felinto
98e69631b0 Remove unused variable (warning since recent Scene/SceneLayer change) 2017-03-30 14:33:57 +02:00
Dalai Felinto
3f6a74560e Layers: Scene->basact > SceneLayer->basact (more work)
This brings back adding hooks among other areas
2017-03-30 11:41:33 +02:00
Dalai Felinto
35b731c9c8 Prevent crash on weight paint
Weight painting is still wrong, but it doesn't crash any more.
2017-03-30 11:25:53 +02:00
Dalai Felinto
f4d597efff Fix breakage when using radial control (shift f) with weight paint
This was likely introduced on rBf90b480f957f . Basically the BLF routines have their own shaders, so any previous programs must be unbind before it
2017-03-30 11:20:54 +02:00
10b27bd30a fix screen layout thumbnails (T51078)
GPU_framebuffer no longer handles transform matrices, which this code was relying on. Made screen_preview_draw responsible for its own ModelView matrix.
2017-03-30 03:01:50 -04:00
126ee42a30 fix OpenGL Render to image (T51082)
This restores the feature for legacy viewport only. Modern viewport, Clay, Eevee, etc. will need further work.

Eventually we should rename this something other than "OpenGL".
2017-03-30 02:32:33 -04:00
0dc30e9dd8 fix build on Mac/clang
Not all code paths returned a value, so we can use a safe default (8-bit RGBA) when the input is bogus.
2017-03-30 01:43:51 -04:00
4743fa52ac Eevee: Diffuse Light (2/2) and GGX low quality lights
GGX is missing sun lamps area.
2017-03-29 23:45:44 +02:00
ccb9f683e5 Eevee: fix HDR buffer 2017-03-29 23:45:44 +02:00
Julian Eisel
15336eb262 Merge branch 'master' into blender2.8 2017-03-29 23:01:16 +02:00
Dalai Felinto
e922e42fe6 Remove BASE_VISIBLE, BASE_SELECTABLE, TESTBASELIB (no longer used) 2017-03-29 22:33:09 +02:00
Dalai Felinto
61134dc02c Base: update localview, however ...
Local view will not be supported in 2.8, at least not at first. This updates the code anyways.
2017-03-29 22:33:09 +02:00
Dalai Felinto
08875452b0 Base: update createTransObject
I was hoping this would fix the issue of the object not moving after you copy it (right now you need to manually grab the object afterwards). But unfortunatelly it does not
2017-03-29 22:33:09 +02:00
Dalai Felinto
9571811b5d Base: update (unused) image_aspect function, copy_attr_menu and its sub-functions
Since this is unused, I didn't test the code. It should be fine though.
2017-03-29 22:33:09 +02:00
Dalai Felinto
63bbf753fc Base: update select_group 2017-03-29 22:33:09 +02:00
Dalai Felinto
328dcae3a9 Fix fit camera view frame to selected objects 2017-03-29 22:33:09 +02:00
Dalai Felinto
40f764f922 Fix viewselected (NUMPAD PERIOD) 2017-03-29 22:21:14 +02:00
Dalai Felinto
539e41f226 Fix T51083: View all is broken in 2.8 2017-03-29 21:04:21 +02:00
Julian Eisel
b0581cd92c Correct own earlier commit for recursive behavior of property groups 2017-03-29 12:53:38 +02:00
Julian Eisel
ac08482886 Fix glitches caused by new outliner versioning code
Mainly caused by TreeStoreElem.flag not being cleared.
2017-03-29 12:31:27 +02:00
Julian Eisel
38d0ea4f69 Alternative fix for crash displaying 'New Window' keymap item
rB870440dee910c9 just did NULL-check for Main pointer, actual issue is
that bContext pointer was NULL. This can be fixed by ensuring
PROP_ENUM_NO_CONTEXT flag is not set by calling
WM_operator_properties_sanitize when creating RNA buttons. Now, layout
previews are visible in keymap editor too.
2017-03-29 12:27:10 +02:00
Dalai Felinto
870440dee9 Prevent crash when seeing the window new on keymaps
CTX_data_main(C) is NULL in those cases :/
2017-03-29 11:39:36 +02:00
2be098a1a0 Merge branch 'master' into blender2.8 2017-03-29 20:20:53 +11:00
Julian Eisel
ff3e1fa760 Merge branch 'master' into blender2.8 2017-03-28 23:11:10 +02:00
855b56b90c Add GL_LINE_STRIP_ADJACENCY support to Gawain
This primitive is used in geometry shaders like new grease pencil stroke shaders
2017-03-28 13:05:45 +02:00
885260117d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/windowmanager/intern/wm_window.c
2017-03-28 10:41:10 +02:00
6d21970aa0 Eevee: Diffuse Lights (1 / 2)
I added srgb tonemapping for previewing purpose. Also since the color buffer is still not HDR, there is ugly artifacts (fixed in part2)
2017-03-28 00:09:45 +02:00
4d3d10f625 New Outline: Fix warning. 2017-03-28 00:06:14 +02:00
21d0f71963 New Outline: Fix ATI compile error. 2017-03-28 00:05:41 +02:00
6435983876 New Outline: make it countour the screen. 2017-03-27 16:36:13 +02:00
0396a15cbb New Outlines: fix upper edge 2017-03-27 14:09:55 +02:00
b33693cb44 New Grid: small modification
Fix wrong coord picked when display only one axis.
Small optimizations here and there.
2017-03-27 14:01:47 +02:00
deda6a43fc Draw Engines: Make g_data struct part of the viewport storage
This makes viewport cache construction independant from each others and will allow multithread down the road.
2017-03-27 14:01:47 +02:00
7ee41920fa Draw Manager: New debug timers
Both CPU time and GPU time are printed to spot bottlenecks.

GPU Timers works only if cache is enabled.
2017-03-27 14:01:47 +02:00
e54d8eeab2 Draw Manager: Make Viewport Data passed by the manager call. 2017-03-27 14:01:47 +02:00
Dalai Felinto
522ca18281 Keep base layer around for forward compatibility in 2.78 2017-03-27 12:53:16 +02:00
7979bc4c51 OpenGL: remove gpuMatrixBegin3D_legacy function
It helped during the transition, but we don't need this anymore. Evolution of T49450
2017-03-27 02:06:33 -04:00
ebdff8c3b8 OpenGL: simplify initial state
Client vertex array state is deprecated, and these are the default values anyway.

No need to bind any basic shader. Let drawing code decide which shader it wants to use.

Part of T49165 (general OpenGL upgrade)
2017-03-27 01:49:25 -04:00
8f620f2e85 cleanup unused GPU includes 2017-03-27 01:45:40 -04:00
271471bbe6 OpenGL: remove matrix manip from framebuffer setup
It doesn't really belong here... Any code using framebuffers will set up its own matrices.

Part of T49450
2017-03-27 01:43:12 -04:00
b95ee78ed3 OpenGL: prepare GLSL for version 3.3
- use in/out instead of attribute/varying
- use named output instead of gl_FragColor
- use texture() instead of the multitude of older texture sampling functions

The #if __VERSION__ == 120 paths (needed on Mac) will be removed after we switch to 3.3 core profile.

Part of T49165 (general OpenGL upgrade)
2017-03-27 01:16:18 -04:00
159f56f4ab add missing matrix uniforms to material shader
My bad again! Failed to test this part of 4c08c5b192
2017-03-27 00:28:52 -04:00
2e88237ee6 fix shadow map shader input
My bad! Messed up the conversion from ftransform -- 4c08c5b192
2017-03-26 23:39:17 -04:00
8b204831f2 OpenGL: use new matrix implementation in "Modern" viewport
This change looks small, but it switches the entire 3D viewport from legacy OpenGL functions to our own code.

Kept non-modern viewport on legacy path so we can compare easily (via the Modern Viewport checkbox).

Part of T49450
2017-03-26 21:23:55 -04:00
4c08c5b192 OpenGL: use new matrix names in GLSL
Builtin names staring with gl_ will not be available in core profile. Same with the ftransform function. New matrix API provides the same names minus the gl_ prefix.

Part of T49450
2017-03-26 21:23:55 -04:00
2a7e4c3040 OpenGL: fix & enhance new matrix lib
- init projection matrices with identity
- fix copy/paste mistake in GetProjectionMatrix3D
- add extra matrices needed by material GLSL

Working toward T49450
2017-03-26 21:23:54 -04:00
cc53c180ac GPU_shader automatically uses new matrix values
Whether used from Gawain or from traditional OpenGL draw methods.

TODO: make sure we bind matrices only once per shader change.

Part of T49450
2017-03-26 21:23:54 -04:00
a68cc0dc26 OpenGL: use old API for texture matrix
New matrix API does not support texture matrices. Not sure what the final code will look like, but this at least avoids interference with new ModelView matrix.

Marked each line with TEXTURE so they can be disregarded during searches.

Related to T49450
2017-03-26 21:23:54 -04:00
67ffad8cd2 OpenGL: remove several glMatrixMode calls
A few of these were redundant, others could be converted to new matrix API.
Part of T49450
2017-03-26 21:23:54 -04:00
59c5623372 Draw Manager: fix glitches when setting 3d cursor position by click. 2017-03-25 19:11:01 +01:00
0495e689e6 New Grid : Feature parity with old grid.
Removed infinite details and went for decreasing details with the distance instead (like the axis aligned ortho view auto sized grid).
Separate drawing of the Z axis into 2 pass (using shading group) to render ordered transparency with the main grid pass.
2017-03-25 19:11:01 +01:00
d2c94c7873 New Grid: Fix depth fighting and remove some unused variables. 2017-03-25 19:11:01 +01:00
8f4d58de4a Clay Engine: Cleanup
Remove unused code.
Fixed the amount of sample in the noise texture.
Add a small optimisation.
2017-03-25 19:11:01 +01:00
f730e386eb Merge branch 'master' into blender2.8 2017-03-25 13:49:13 +11:00
edd2c556cd Quiet warnings 2017-03-25 13:48:27 +11:00
0c93bc2b63 Merge branch 'master' into blender2.8 2017-03-25 13:39:47 +11:00
5d6e9f237b OpenGL: viewport background & depth buffer fixes
Untangling some of the logic in view3d_draw.
2017-03-23 16:28:20 -04:00
96e1b46791 OpenGL Immediate Mode: finalize image_draw
The directive `#if 0` was ignored.

Part of T49043
2017-03-23 14:56:42 -03:00
3de5e71501 GLSL viewport: Fix shader compilation error.
Moved the global lib insertion to the draw manager instead
2017-03-23 15:07:53 +01:00
f98d9baea9 Revert own previous commit, the bug is already fixed a fiew commits before. Sorry for the noise. 2017-03-23 16:36:28 +03:00
0b9041905f Fix (unreported) assertion in immBegin. Zerro number of points (Ctrl+LMouse without moving in node space) 2017-03-23 15:54:14 +03:00
09ad684249 cleanup use of GPU matrix API
Take advantage of 2D functions, rotation about the X Y or Z axis, uniform scale factors.

We no longer need to call gpuMatrixBegin_legacy() before using the new API locally in functions.

related to T49450
2017-03-23 01:46:14 -04:00
c2366009c0 OpenGL: paint_cursor port to immediate mode (Part 2)
Part of T49043
2017-03-23 01:33:34 -03:00
b69f0479a4 OpenGL: remove GLU option from build system
Also remove linking in glu libs.

T49042 is now done!
2017-03-22 21:33:53 -04:00
005b7bfbdc remove mention of GLU from comments
related to T49042
2017-03-22 21:33:53 -04:00
559bfd973e convert last remaining GLU calls in BGE
Focus is on getting rid of GLU. We expect UPBGE to replace current BGE.

Part of T49042
2017-03-22 21:33:53 -04:00
cd37248f90 OpenGL: paint_cursor port to immediate mode (Part 1)
Part of T49043
2017-03-22 19:43:06 -03:00
8abc315a23 Object Mode Engine: New grid drawing.
Move the grid drawing to the Object mode engine and implement a new infinite grid.
Everything is done but it needs better parameters to be intuitive.
2017-03-22 21:29:23 +01:00
26c140fbc8 Draw Module: Move the Global Ubo block definition to it's own file. 2017-03-22 21:29:23 +01:00
4646ecf749 OpenGL: use new API for persp & ortho projection
Still using legacy GL within the GPU library itself, but we'll be able to switch soon.

Part of T49450
2017-03-22 15:52:48 -04:00
98a0dd6888 OpenGL: load projection matrix with new API
New API does not share legacy OpenGL's concept of matrix modes.

Part of T49450
2017-03-22 14:48:47 -04:00
0c2fd1357d OpenGL: fix new projection matrix API
Now using the correct GL enum.
Part of T49450
2017-03-22 14:45:35 -04:00
Dalai Felinto
505cc694b3 Layer Unittesting: pep8 2/2
Mass replacing the common code of all tests

```
echo "Fixing $1"

ed "$1" <<'EOF'
1,/Testing/d
i

from render_layer_common import *
import unittest
import os
import sys

sys.path.append(os.path.dirname(__file__))

.
w
q
EOF
```

Using line-width of 120
2017-03-22 15:27:47 +01:00
Dalai Felinto
6883a983e6 Layer Unittesting: pep8 1/2
Manual corrections, using line-width of 120
2017-03-22 15:27:20 +01:00
4e92ed87ac Object Mode Outline: Changed algorithm a bit.
First pass find outline pixel.
Second pass expand it by 1px in each direction.
Subsequent passes fade the occluded outlines inward.
2017-03-22 02:17:16 +01:00
c2f3ec4378 OpenGL: convert one more matrix call
Missed this earlier.
Part of T49450
2017-03-21 19:38:00 -04:00
78878a132f fix blenderplayer build
GPU lib should not depend on editor (glutil) code.
2017-03-21 19:36:29 -04:00
0a274df536 OpenGL: add gpuLoadProjectionMatrix3D function
Make an existing 4x4 matrix the current projection.
Found a need for this while converting code to new API.
Part of T49450
2017-03-21 18:10:20 -04:00
6d2aca5a96 OpenGL: convert to new matrix API (part 5)
Pretty sure source/blender is now finished, with all legacy matrix calls confined to gpu_matrix.c.

This was the easy part, but doing it first makes the next part much easier. TODO and XXX notes describe what is left.

glMatrixMode is still in place, since the new API does not share this concept of modes. Similar for glOrtho and glFrustum which I'll tackle very soon.

Part of T49450
2017-03-21 17:49:21 -04:00
7aad5cf573 OpenGL: generic inputs for new matrix API
For functions that expect a 4x4 matrix, you can pass in that, or array[16], or float*, or... Casting at each call site can get annoying, and obscures the logic.

The C11 section still needs work, but the non-C11 macros help on the system I tested on (Mac/clang).

Part of T49450
2017-03-21 17:27:17 -04:00
20d02be6b8 OpenGL: remove fdrawline & other helper functions
Finally, fdrawline is no more!

Part of T49043 & T49450
2017-03-21 16:11:55 -04:00
3bd831d1d6 OpenGL: convert to new matrix API (part 4)
Part of T49450, fixes a Push/Pop mismatch from part yesterday's 3.
2017-03-21 16:11:55 -04:00
7870bde275 Object Outline: trying something new 2017-03-21 19:29:58 +01:00
80e6638ad3 Object Mode Engine: Support for active color. 2017-03-21 17:47:49 +01:00
d409c48310 OpenGL: convert to new matrix API (part 3)
Part of T49450
2017-03-21 02:51:02 -04:00
8fe9e94a52 OpenGL: remove 'circ' helper function
This was no longer being used.
Part of T49043
2017-03-21 02:27:58 -04:00
4a01ff278d fix use-before-init error + local cleanup
"path" was being used uninitialized. Thanks for the warning, clang!
2017-03-21 01:41:48 -04:00
bef63acbd6 remove gpuMatrixUpdate_legacy function
No longer needed since 231b5d96bb tracks dirty state of legacy matrix stacks.

Part of T49450
2017-03-21 01:36:51 -04:00
54bed786a6 OpenGL: convert to new matrix API (part 2 of x)
Part of T49450

For this batch I focused on usage of gpuMatrixUpdate_legacy.
2017-03-21 01:32:25 -04:00
231b5d96bb track dirty state of legacy matrix API
This is used to send latest matrix values to shader when drawing.

Previously handled by calling OpenGL matrix functions, followed by gpuMatrixUpdate_legacy. With this change that function is no longer needed.

Part of T49450
2017-03-21 00:25:47 -04:00
0c47923fca OpenGL: remove older matrix macros
Some of these were unused, the others are now handled by GPU_matrix.

Part of T49450
2017-03-21 00:11:17 -04:00
938613f720 OpenGL: convert to new matrix API (part 1 of x)
Part of T49450

For this batch I focused on usage of (now-obsolete) macros in BIF_gl.h
2017-03-21 00:09:40 -04:00
06f7fba6aa add missing gpuRotate2D function
Prototype was there, we just weren't using this yet.

Part of T49450
2017-03-21 00:08:09 -04:00
74434beb1c OpenGL: more legacy support for matrix routines
For the sake of forward progress on T49450

We can now replace legacy gl* matrix function calls with their gpu equivalents. "Inactive" in this code means we're using the legacy matrix stacks, not our own. Setting up the proper gpuMatrixBegin2D/3D/End calls can be done afterward.

Most or all of this will be removed after the transition to core profile.
2017-03-21 00:05:03 -04:00
060243a8ae Edit Mode Engine: Remove unecessary matrix. 2017-03-20 15:19:03 +01:00
9ca0e08236 Object Mode Engine: New outline method.
We render selected meshes into another buffer and use a screen space shader to expand the color out of the mesh silouhette.

Pros: only one additionnal render pass is needed (like old outline code), and we have occluded informations.
Cons: memory usage is a problem. This method needs 2 color buffer to ping pong when expanding the outline and 1 depth buffer to test occluded fragments. This gives a 88 bits/pix memory footprint.

Idea: Since we don't need all color range but only some uniform colors (theme colors) we could manipulate only the color ID instead of the whole color this could cut the color buffer size and lower the memory footprint to 58 bits/pix.
2017-03-20 15:19:03 +01:00
fc72a2ff4b Draw module: code style, encapsulate static vars 2017-03-20 15:19:03 +01:00
69a17bce1a Cleanup: remove useless glDisable(GL_LINE_STIPPLE) call.
Note that muted strips have solid border currently, marked as TODO to
add back stippled lines (if with want them back?).
2017-03-20 14:46:26 +01:00
21b361194f Merge branch 'master' into blender2.8 2017-03-20 14:37:44 +01:00
Dalai Felinto
a6d4ac28f5 Layers unittesting: update after doversion changes
Collections now are called "Collection 1", instead of "1"
2017-03-20 10:30:19 +01:00
Dalai Felinto
01c4e598e5 Silence unused vars warning 2017-03-20 09:50:25 +01:00
3f818c7898 Merge branch 'master' into blender2.8 2017-03-20 09:32:40 +11:00
4137f30928 Object Mode: Add stencil test to remove object outlines inside the silouhette.
It also adds nice occluded silouhette information for selected objects that are behind visible objects.
This methods is really heavy because it needs to render the wires twices.
2017-03-18 01:56:34 +01:00
cddde85f2c Fix shader compilation. 2017-03-18 01:56:34 +01:00
c4644b484d GPUTexture: Add support for depth_stencil textures. 2017-03-18 01:56:34 +01:00
b7355425cd Eevee: Initial commit
Basic support for lamps. Only diffuse.
2017-03-18 01:56:34 +01:00
8cad48df28 Draw Manager: Created a general fullscreen shader. 2017-03-18 01:56:34 +01:00
cf62424e47 Gawain: remove PER_THREAD macro
This attempt at TLS was leftover from an earlier prototype. It never worked with Blender's build system, and was defined to just exist, not to actually do anything.
2017-03-17 14:14:22 -04:00
Julian Eisel
2977a8cd21 Add tabs as standard button types
NOTE: This is really a backend-only implementation, nothing is changed in the UI

Adds a tab button-type and the basic drawing and handling code for it.
More work needs to be done on it, but idea is to get in ready for usage in the
topbar.

Differential Revision: https://developer.blender.org/D1371
2017-03-17 17:10:05 +01:00
Julian Eisel
a96008f3aa Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
2017-03-17 15:38:45 +01:00
Dalai Felinto
4b190e312f Remote unecessary call to ces_type->callback 2017-03-17 12:12:41 +01:00
722451e146 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/writefile.c
2017-03-17 11:00:41 +01:00
a8c7152eea Cleanup: Use proper indentation 2017-03-17 10:26:30 +01:00
63fb57fbc6 fix blenderplayer build after moving Gawain to intern 2017-03-16 23:57:36 -04:00
c669bf126c Gawain: fix compiler warning
This function is only used when strict run-time checks are enabled.
2017-03-16 23:51:18 -04:00
4452bea2f1 move Gawain library to intern
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.

Tested on Mac, time to push and test on Windows.

Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?
2017-03-16 23:32:35 -04:00
b4e8dc8c82 set required MacOS version to 10.9
We could do more to simplify build files, but this is a start.
2017-03-16 15:02:55 -04:00
Julian Eisel
7eecc2e1c4 Fix T50958: template_ID_preview is crashing the blender's UI from branch 2.8
So apparently ID pointer is allowed to be NULL here.
2017-03-16 18:54:11 +01:00
e2df9ab386 Merge branch 'master' into blender2.8 2017-03-16 17:28:04 +01:00
fc61cdf142 Merge branch 'master' into blender2.8 2017-03-16 15:42:49 +01:00
dd3ae7bad7 OpenGL immediate mode: image_draw.c: Draw Sample Line with new imm mode
part of T49043
2017-03-16 10:15:01 -03:00
dd7b60c638 Adds missing immUnbindProgram() in image_draw
This was interruping the execution of the code (To test: Just left click on the UV editing window to read the pixel)
2017-03-16 01:13:18 -03:00
0fc4cf7637 OpenGL: draw navmesh with new imm mode
This is an old stash. Part of DerivedMesh so the whole thing might be removed soon.

part of T49043
2017-03-16 00:05:05 -04:00
0895550d24 OpenGL: more new imm mode for image_draw
plus some minor cleanup

part of T49043
2017-03-15 16:53:45 -04:00
c5f97dfe59 Gawain: bypass strict error checking for release builds
Now that we're almost done with T49043, let's run immediate mode at full speed. Debug builds will still do strict checks.

Developers should still test their changes before committing! Recommended:
$ make debug (or make lite debug)
$ blender --debug-gpu
2017-03-15 16:53:45 -04:00
Julian Eisel
0d0d68d39d Outliner: Don't show master collection itself in "Master Collection Tree"
It would always be the only highest-level element in the tree, without
serving a real purpose. Even collapsing it wouldn't make much sense.
2017-03-15 21:48:18 +01:00
Julian Eisel
a449214854 Outliner: Rename "All Collections" display mode to "Master Collection Tree"
Also don't show alphabetical sorting option for "Active Render Layer" mode.
2017-03-15 20:50:35 +01:00
Julian Eisel
209d4d6993 Merge branch 'master' into blender2.8
Needed for compile fix.
2017-03-15 20:28:23 +01:00
Julian Eisel
7f596d39df Outliner: Change default display mode to "Active Layer"
We concluded this is going to be the display mode users will need to work
with the most, so makes sense to make it the default one.
Also, if the opened file only has one collection in the active render
layer, we expand it (almost empty list would be misleading).

What I had to do to make the expanding work is a bit ugly, but didn't
find a better way. During do_version we don't have access to the
TreeElement instances, and including ED_outliner.h to share code here
should be avoided too.
2017-03-15 20:14:26 +01:00
104a03beed Merge branch 'master' into blender2.8 2017-03-16 04:53:07 +11:00
fce0ff0a31 OpenGL: remove non-GLSL option from basic shader
This code path was only used when Blender was launched with --enable-legacy-basic-shader at the command line.

Part of general OpenGL upgrade (T49165)
2017-03-15 11:53:48 -04:00
Julian Eisel
8892c7869e Fix "search for unknown operator 'WM_OT_window_duplicate'" warning
Mistake in rB7bc76f8a3c1416.
2017-03-15 16:03:01 +01:00
19b3b11c64 Immediate Mode: Fix text color in iuage info line 2017-03-15 15:04:41 +01:00
e016a29ba0 Blender 2.8: Always prefer Occlusion Queries when using AUTO selection mode
GL_SELECT is really slow in this branch and will be removed.

For now we simply change AUTO behavior to avoid possible conflicts with merges
and upcoming color-id-based selection.
2017-03-15 14:55:46 +01:00
6b720dffc9 Merge branch 'master' into blender2.8 2017-03-15 14:19:53 +01:00
6d71169478 De-duplictae fix for lasso with Dalai
Git silently merged our both fixes together. Sure thing it's double safe this way, but cmon.
2017-03-15 14:18:37 +01:00
Dalai Felinto
d78b1147be Layers: handle doversion naming differently
Talked with Pablo Vazquez (venomgfx) and Julian Eisel (Severin), and we came up with this solution instead.

Basically, if the file has only one layer, it is converted to a collection named "Default Collection". Otherwise we name the collections: "Collection 1 [converted from 2.75]"
2017-03-15 14:12:52 +01:00
c10fbc002b Correct assert failure in debug mode with lasso select
Just do early output and don't bother with any GLSL program bind when
there is not enough points of lasso to draw.

This could have happened at the very beginning of the stroke.
2017-03-15 14:04:03 +01:00
Dalai Felinto
c16796089c Remove commented out code from transform_snap.c
Code was commented out in 2012 and it was not working even then. So it makes for an impossible conversion to the new gawain API.
2017-03-15 13:57:52 +01:00
Dalai Felinto
32d90220c2 Remove commented out code from reeb.c
Code was commented out in 2009
2017-03-15 13:57:52 +01:00
Dalai Felinto
f274332bb3 Remove commented out code from pbvh.c
Code was commented out in 2009
2017-03-15 13:57:52 +01:00
Dalai Felinto
6d8a25920d Remove commented out code from editarmature_sketch.c
Code was commented out in 2010
2017-03-15 13:57:52 +01:00
Dalai Felinto
9f366aee3b Immediate Mode: update drawnode.c commented out debug code
It works fine if you uncomment it, it shows a bigger circle around the re-route element, with a different color based on the selection state
2017-03-15 13:57:52 +01:00
Dalai Felinto
e00f52aeab Fix crash on node editor when using lasso to remove nodes connections 2017-03-15 13:57:52 +01:00
Dalai Felinto
279bcd8492 Remove unused code from drawnode.c
The code in question was marked as /* not used in 2.5x yet */.
2017-03-15 13:57:52 +01:00
Dalai Felinto
c72d319b47 Immediate Mode: remove commented out code from drawgpencil.c
Some of this was "tagged" for removal by Dec 2016.
2017-03-15 13:57:52 +01:00
d4b3068f36 Use FTOCHAR rather than CLAMP of uchar output
This makes no sense to clamp after value was assigned to uchar already.
Proper way to do so is to use FTOCHAR.
2017-03-15 13:50:41 +01:00
407f8eed7d OpenGL: Converted gpu_compositing.c to use batches. 2017-03-15 13:17:49 +01:00
79f94674fb Merge branch 'master' into blender2.8 2017-03-15 12:48:48 +01:00
1d5ba269c1 Merge branch 'master' into blender2.8 2017-03-15 06:04:52 +11:00
0f13f5a683 CMake: add missing headers 2017-03-14 18:47:26 +11:00
91837cd5b0 Cleanup: warnings 2017-03-14 18:40:23 +11:00
3ee0723b7d fix warnings from previous commit
Batch struct initializer needed more {{braces}}
2017-03-14 01:41:09 -04:00
225e3a6857 Gawain: multiple VertexBuffers per Batch
So we can store (for example) vertex positions in one buffer and normals + colors in another buffer. Not super exciting right now, but very useful once we start changing some attribute values.

Supports future work by Clément et al. Only tested with one VBO per Batch since that's all our current code uses.
2017-03-14 01:38:42 -04:00
9bf0b246ac OpenGL: remove deprecated calls
glMaterial
glColorMaterial
glPixelTransfer

and glEnable/Disable for
GL_FOG, GL_LIGHTING, GL_COLOR_MATERIAL

All of these were just setting default values, so I don't expect any visible change.

Part of T49165 (general OpenGL upgrade)
2017-03-14 00:44:38 -04:00
ac276e1541 fix "Modern Viewport" regression
GPU_viewport_bind & unbind should be called as pairs. A recent commit -- 3b91989a09 -- called unbind only for some code paths, overflowing OpenGL's matrix & attrib stacks.
2017-03-13 16:10:10 -04:00
b4157dedb0 OpenGL: remove packed imm mode functions from Python API
These are from the ARB_vertex_type_2_10_10_10_rev extension that became part of OpenGL 3.3.

So they are new, but only exist for compatibility with immediate mode, which is old.

Related to T49165 (general OpenGL upgrade)
2017-03-13 14:08:03 -04:00
0e40f1bac4 OpenGL: remove GLU functions from Python API
Part of T49042
2017-03-13 14:08:03 -04:00
Dalai Felinto
ddedcf7ada Outliner/layer: fix users trying to drop a collection into itself (recursion hell) 2017-03-13 17:38:37 +01:00
ecce1fabca Mode Engines: Fix MSVC compilation error. 2017-03-13 11:39:41 +01:00
Dalai Felinto
7bc76f8a3c New Window Operator (to replace Duplicate Window)
A user doesn't want to necessarily create a new Screen only because she
wants a new window.

This patch allows the user to pick the screen to use for the new Window.
If the screen picked is the active one, it duplicates it (as the old
behaviour in Blender).

Patch with contributions and fixes by Julian Eisel (Severin)

Subscribers: venomgfx

Differential Revision: https://developer.blender.org/D2555
2017-03-13 10:45:15 +01:00
4dacda58f9 Merge branch 'master' into blender2.8 2017-03-13 07:51:10 +11:00
6d3d2b15cb Clay Engine: Fix missing grid 2017-03-12 21:16:19 +01:00
9c6b9e889c Clay Engine: Mode engine templates.
Standard Engine layout easy to extend.

Note that most of the work will also happen in mesh_render.c to create geometry batches.
2017-03-12 21:16:03 +01:00
40532b9c3b OpenGL: Convert drawobject.c (cont)
All remaining 28 deprecated calls are derivedMesh related.
2017-03-11 21:09:15 +01:00
acd4fc3b7a OpenGL: Convert drawobject.c (cont)
Edit Particle mode.
2017-03-11 17:15:40 +01:00
e29e63c0ba OpenGL: Convert drawobject.c (cont)
Particle system (not edit mode)
2017-03-11 17:15:40 +01:00
b90a61917a OpenGL: Convert drawobject.c (cont)
This commit have a serrious perf issue when drawing nurbs (+5 times slower) but it gets rid of deprecated functions.
2017-03-11 17:15:40 +01:00
fbb1b311ea Merge branch 'master' into blender2.8 2017-03-12 03:00:06 +11:00
Julian Eisel
cdb7498f66 Cleanup: Add comment about use of ID pointer in TreeStoreElem 2017-03-10 23:29:32 +01:00
Julian Eisel
176698b2eb Fix unwanted expanding/collapsing of collections using drag & drop
Turned out to be a quite easy fix. I thought the issue was that we
couldn't identify the TreeStoreElem when (re)creating its TreeElement item
correctly, because for non-ID elements that would be index dependent (=
bad for drag & drop). Turns out that we're actually allowed to store
custom data within the TreeStoreElem, the thing is just that it gets
stored as ID pointer (highly ugly and highly misleading).
Anyway, seems to work now so I won't complain too much :)
2017-03-10 23:18:19 +01:00
Julian Eisel
736a32e7bf Ouliner drag&drop: Correct/increase margin for triggering insert into 2017-03-10 21:06:10 +01:00
Julian Eisel
fcd3bf5275 Insert into master collection when dragging above it 2017-03-10 21:01:10 +01:00
Julian Eisel
0d7dfd9f46 Outliner: Support dragging objects into different collections
Doing so will remove the object from the old collection and insert it
into the new one.
2017-03-10 20:48:39 +01:00
Julian Eisel
0210df079c Outliner drag&drop: Do generic check if no custom poll callback is defined
And quite some cleanup.
2017-03-10 18:24:14 +01:00
Dalai Felinto
e9dd97405e Layers util function to move objects around
This is required for outliner, so we can move an object from a collection into another
2017-03-10 18:13:19 +01:00
Julian Eisel
6730202510 Improve outliner drag&drop feedback by using drop poll callbacks
This way we can ensure the overlay to indicate where the item would be
placed if it was dropped now is always at the correct place and doesn't
mislead the user.
2017-03-10 17:17:13 +01:00
Dalai Felinto
1100ddeaa9 Layers: fix bug in move layer collection above/below
Reported by Julian Eisel (Severin)
2017-03-10 16:48:09 +01:00
Julian Eisel
13f5bed32e Gaah, managed to undo a previous fix somehow...
Somehow undid rBc70eb873057 in rB8e303aae255.
2017-03-10 16:03:50 +01:00
Julian Eisel
989632417b Draw drag&drop feedback overlays with element indentation
That way users can see better at which hierarchy level the element will
be inserted into.
2017-03-10 15:58:08 +01:00
Julian Eisel
08cde7c785 Fix incorrect positioning of collection when dropping it after expanded one 2017-03-10 15:56:41 +01:00
Julian Eisel
8e303aae25 Support drag & drop of collections across multiple hierarchy levels
Two issues are remaining, they'll be fixed separately:
* Graphical feedback when dragging within the master collection is wrong
* There's some bug where collections swap places instead, Dalai will investigate
2017-03-10 15:24:53 +01:00
b3bb4a6936 Fix lamp draw setting color without checking if its needed 2017-03-11 00:48:56 +11:00
Julian Eisel
c70eb87305 Fix issues in outliner collection reordering function 2017-03-10 13:59:03 +01:00
6a8cb92404 OpenGL: Convert drawobject.c (cont)
- drawDispListwire_ex()
- removed primitive check in Batch_init()
2017-03-10 01:53:57 +01:00
e37538b472 OpenGL: Convert drawobject.c (cont)
removed draw_box
2017-03-10 00:28:00 +01:00
85fa1403f4 OpenGL: Convert drawobject.c (cont)
-Softbody matrix
-EditCurve/NURBS
2017-03-09 22:10:48 +01:00
6ce1d71914 OpenGL: Convert drawobject.c (cont)
Remove drawcircball
Convert texturespace, editfont, metaball (except for displist usage)
2017-03-09 22:10:48 +01:00
55a56a31a0 Merge branch 'master' into blender2.8
Manually merged viewport xray changes
2017-03-10 06:58:29 +11:00
711ac90481 Merge branch 'master' into blender2.8 2017-03-10 06:11:50 +11:00
Dalai Felinto
4c746bb3b0 Immediate Mode: Updated commented out code from textview.c 2017-03-09 19:21:08 +01:00
Dalai Felinto
aca29bcc65 Immediate Mode: Fix text color for Info and Console editors
Bug introduced in rB4b365064cfbd
2017-03-09 19:20:31 +01:00
Dalai Felinto
01b2071c14 Immediate Mode: Fix crash on text editor when going over suggestion list 2017-03-09 18:12:38 +01:00
Dalai Felinto
51737a2c8c Immediate Mode: text_draw.c 2/2
Tackle the remaining parts of the code, mainly the commented out
function `draw_documentation`.
2017-03-09 18:02:25 +01:00
Dalai Felinto
fc53c6f953 Immediate Mode: text_draw.c 1/2
Note 1: renamed draw_cursor to draw_text_decoration, since it was drawing
cursor, margin, selection and line highlight

Note 2: commented out code update coming next

Part of T49043
2017-03-09 18:01:56 +01:00
Dalai Felinto
8a6d055f37 Merge remote-tracking branch 'origin/master' into blender2.8 2017-03-09 17:10:06 +01:00
Dalai Felinto
528cb8877f Building 2.8 again after warning cleanup (696ed6d3ca) 2017-03-09 12:08:44 +01:00
b40a4f66b2 Merge branch 'master' into blender2.8 2017-03-09 16:47:31 +11:00
696ed6d3ca Cleanup: warnings 2017-03-09 16:44:11 +11:00
a68c631cf8 Merge branch 'master' into blender2.8 2017-03-09 16:41:33 +11:00
8d98362710 OpenGL immediate mode: graph_draw.c
This also fixes a little bug, which caused `draw_fcurve_samples` to
never be called, and thus sampled curve range boundaries were not drawn.

Part of T49043
2017-03-09 01:00:59 -03:00
2a62ec8003 OpenGL: drawobject.c (cont) 2017-03-09 03:21:42 +01:00
49ef1a25b8 Edit Mesh overlay: Ported Display Normals option 2017-03-09 01:30:26 +01:00
4b31f1e591 Edit Mesh overlay: remove sizeNormal from ubo. 2017-03-09 01:30:26 +01:00
3b91989a09 Draw Manager: structural change
All engines are now called by the draw manager. Engines are separate entities that cannot interfer with each others.
Also separated draw_mode_pass.c into the mode engines.
2017-03-09 01:30:26 +01:00
Dalai Felinto
d9f42e5fab Layers: move LayerCollection
This is to be used from the Outliner, when dragging and dropping
collections from the Active Render Layer

It also includes a cleanup on the outliner so it calls the new
functions. Note: the outliner still needs fix to allow all the
functionality here exposed.

But this will be tackled by Julian Eisel later.
2017-03-08 23:35:54 +01:00
Dalai Felinto
3a1748146b Layers: move SceneCollection
This is to be used from the Outliner, when dragging and dropping.
It does not include moving LayerCollection (from Active Render Layer)
2017-03-08 23:35:54 +01:00
Dalai Felinto
9b2877ad88 New util function: BLI_listbases_swaplinks 2017-03-08 23:35:54 +01:00
a42a0b5ef3 OpenGl: Converted more of drawobject.c 2017-03-08 15:03:03 +01:00
Dalai Felinto
04a391c2f8 Outliner fix: prevent segfault when there is no active layer collection 2017-03-08 11:27:11 +01:00
1345d29806 OpenGL: convert editarmarture_sketch to new imm mode
Part of T49043, T49042

Reviewers: fclem, merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2548
2017-03-07 22:14:27 -05:00
696bb47c6e OpenGL: Converted bit more of drawobject.c. 2017-03-07 18:10:55 +01:00
76ae10f580 OpenGL immediate mode: finish outliner_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
78d9a0a563 OpenGL immediate mode: finish file_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
def4ffd1c5 OpenGL immediate mode: finish node_draw.c
Part of T49043
2017-03-07 01:44:04 -03:00
583373f049 OpenGL: Object bound drawing. 2017-03-06 20:57:16 +01:00
517db46b34 OpenGL: A little bit of drawobject() 2017-03-06 20:57:16 +01:00
aa44b77129 Fix T50841: Scene object iterator did not get data from LinkData for the master collection
Debug session with Dalai Felinto.
2017-03-06 17:56:19 +01:00
Julian Eisel
a5cba9aab9 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_nla/nla_draw.c
	source/blender/editors/space_view3d/view3d_draw.c
2017-03-06 13:00:46 +01:00
dc9a7f861f Edit Mode overlay: Optimisation
Don't generate more verts than we need if we don't render vertex.
Getting a big boost from 12fps to 20fps on my test scene
2017-03-06 04:07:54 +01:00
d4e7288af9 Edit Mode overlay: Update cache on selection 2017-03-06 03:58:08 +01:00
33c093ef70 Clay Engine: Fix shader linking issue 2017-03-05 20:29:21 +01:00
b36f93fa37 Clay Engine: support draw callbacks 2017-03-05 18:10:08 +01:00
ff96f527fd Edit Mode overlay: fix clear color, and possibly a crash. 2017-03-05 18:10:08 +01:00
747ac66800 Clay Engine: More Lamp drawing work 2017-03-05 18:10:08 +01:00
45b42d3fb7 Clay Engine: Make panels compatible with the new engine 2017-03-05 18:10:08 +01:00
608b96c49b Clay Engine: camera drawing 2017-03-05 18:10:08 +01:00
76c9f1a649 OpenGL: remove fdrawcheckerboard
This helper function was marked DEPRECATED since it uses old OpenGL calls.

Switched last 2 uses to imm_draw_checker_box, which does the same thing, only awesome.

Part of T49043
2017-03-04 01:49:07 -05:00
a514fea932 OpenGL: remove old DrawPixels util functions
a little bit of T49043, mostly related to T49165

Thx to @fclem for marking these as unused & making shader-based replacements.
2017-03-03 18:18:21 -05:00
87d5f670a0 OpenGL: remove glaDrawBorderCorners
This helper function was marked DEPRECATED since it uses old OpenGL calls.

Part of T49043
2017-03-03 17:55:41 -05:00
0215b3e957 OpenGL: draw image render info with new imm mode (part 1)
Part of T49043

This was the last use of glaDrawBorderCorners.

Plenty more to do in this file, I'll keep working on it...
2017-03-03 17:53:53 -05:00
af1635eeb0 OpenGL: remove stipple pattern defines
GPU_basic_shader handles this internally; no other code depends on it.
2017-03-03 17:36:17 -05:00
29683d623c OpenGL: remove glutil_draw_*_arc (lined, filled)
These helper functions were marked DEPRECATED since they use old OpenGL calls. Now they are marked GONE!

Part of T49043
2017-03-03 17:23:35 -05:00
053589da7d OpenGL: paint_draw_cursor with new imm mode
Part of T49043.

This was the last use of glutil_draw_lined_arc.

Plenty more to do in this file, I'll keep working on it...
2017-03-03 17:21:34 -05:00
3fdffc1e95 Gawain: fix for MSVC 2013
<stddef.h> defines offsetof. For some reason MSVC 2015 does not need this. Mystery!
2017-03-03 14:50:35 -05:00
3381cf98cb OpenGL: remove fdrawbox, sdrawbox, sdrawline
These helper functions were marked DEPRECATED since they use old OpenGL calls. Now they are marked GONE!

Part of T49043
2017-03-03 13:26:43 -05:00
6999e82693 OpenGL: remove last uses of fdrawbox
Part of T49043
2017-03-03 13:22:16 -05:00
b3a4b61a3b OpenGL: remove last uses of sdrawline & sdrawbox
Part of T49043
2017-03-03 13:12:49 -05:00
0c5b197447 Edit Mesh overlay: remove one extra buffer. 2017-03-03 13:51:59 +01:00
Julian Eisel
2a82162618 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/armature/pose_select.c
	source/blender/editors/include/ED_armature.h
2017-03-03 12:55:35 +01:00
Dalai Felinto
22df0b2fe2 Fix blenderplayer building (tm) 2017-03-03 10:09:42 +01:00
8cf524cec9 plug ShaderInterface into GPUShader
Renamed existing getter/setter that only FX shaders use. We could convert FX code to use the richer new interface or leave it as is.

Removed unused GPUShader fields. ShaderInterface tracks the same information.
2017-03-02 21:46:54 -05:00
c2baf3e486 OpenGL: draw PBVH bounding box with new imm mode
It wasn't using old immediate mode, but was using
- client vertex arrays (obsolete)
- quads (obsolete)
- state attrib stack (obsolete)
- polygon mode (still allowed, but gross)
2017-03-02 21:40:13 -05:00
e0a2bd43dd Gawain: add ShaderInterface for GLSL introspection
After a GLSL program is linked we can get all its inputs & never have to ask it again.

Several uniforms are considered "built-in". Nothing special about these to OpenGL itself, they just follow conventions of our built-in shaders.

This will help the matrix API, immediate & batch drawing APIs, and allow extra error/compatibility checking.
2017-03-02 21:28:28 -05:00
85945849a9 Edit Mode overlay: backwire "ghost wireframe" with variable intensity 2017-03-03 02:53:16 +01:00
bb8a172dfb Draw Manager: Changed buffer uniform api.
Use a reference to where will the texture be instead of an index.
2017-03-03 02:53:16 +01:00
0c1c646118 clean up clay vertex shader
Clay engine only works on modern GL, so this shader doesn't need compatibility with legacy Mac GL.
2017-03-02 18:11:21 -05:00
33758c7cb8 Gawain: move PRIM types to new file, classify by geometry
PrimitiveClass will help match shaders to draw calls & detect usage errors. For example a point sprite shader only makes sense with PRIM_POINTS.

Updated other files to include new primitive.h
2017-03-02 15:07:14 -05:00
Julian Eisel
a99495d291 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/scene.c
2017-03-02 19:15:32 +01:00
Dalai Felinto
5ce6388f7c Outliner: add hooks for (yet to be implemented) layer reordering routines 2017-03-02 18:12:30 +01:00
Julian Eisel
0322700d87 Get UI ready for using drag & drop to nest a collection into another one
Nothing happen yet when it's supposed to insert the collection into
another one, that part will be handled by @dfelinto.

See gif for demo of how it works UI wise: {F500337}

Also fixed off-by-one error in utility function.
2017-03-02 17:15:30 +01:00
Dalai Felinto
146a88dd60 Remove all instance of OBACT from particle_edit.c and related changes 2017-03-02 17:14:59 +01:00
Dalai Felinto
209021a703 Remove all instances of OBACT from drawobject.c and related changes 2017-03-02 17:09:24 +01:00
Dalai Felinto
083bc48816 Remove OBACT from rigidbody_constraint.c and remove uneeded sanity check 2017-03-02 17:09:24 +01:00
Dalai Felinto
aa845eed1e Remove tons of OBACT
There are now only referenced in:
* drawobject.c
* particle_edit.c
* space_image.c (a single case to be handled on workspace branch)
* rigidbody_constraint.c (to be handled in the following commit)
2017-03-02 17:09:24 +01:00
561d11c5e6 Edit Mesh overlay: pack normals with face centers.
Needed for face normals.
2017-03-02 15:03:40 +01:00
0b6fa1a0fb Mesh batch cache: fix memory leak 2017-03-02 14:20:36 +01:00
Dalai Felinto
7b1de2b407 Revert "Depsgraph: Add placeholder function to handle objects update"
This reverts commit 9023abbf27.
2017-03-02 13:05:17 +01:00
Dalai Felinto
4bf9a65da9 Fix mesh edit wasn't updating for new objects
The problem was that we were updating the mesh cache on
BKE_object_eval_shading, not on mesh change.
2017-03-02 12:58:30 +01:00
Dalai Felinto
007fcfc193 Fixup for layer rename unittest (rB3baa186724) 2017-03-02 09:52:33 +01:00
Dalai Felinto
a65af5d0cf Layers unittest: isolate the depsgraph crash in individual tests
(and re-order the tests alphabetically)
2017-03-02 09:40:17 +01:00
869f2940c2 Gawain: allow use of final 2 bits of 10_10_10_2 format
Requested by @fclem
2017-03-02 03:16:02 -05:00
b463cd2ab8 Edit Mode overlay: Moved Shaders to draw modules and resolved some draw issue.
We don't want to clutter gpu_shader.c with engine specific code
Added face's center dot
Simplified loose vert shader
2017-03-02 01:08:32 +01:00
aa102283da Edit Mode overlay: Added theme color via UBO. 2017-03-02 01:08:32 +01:00
043c90fdcd Edit Mode overlay: fast navigate 2017-03-02 01:08:32 +01:00
26fc6c71c4 Edit Mode overlays: separate multiple shaders for loose edges and verts 2017-03-02 01:08:32 +01:00
Julian Eisel
3baa186724 Add tests for layer renaming
Could have an own file for each test, but this is good enough.
With great help from @dfelinto, thanks!
2017-03-01 20:14:20 +01:00
Julian Eisel
0f7a664731 Fix collection renaming not checking for unique name in entire hierarchy
Only checked for unique name in direct children of the master
collection.

Also added missing listener for outliner.
2017-03-01 20:13:40 +01:00
Julian Eisel
18684e546f Outliner: Make sure collection name is unique after renaming 2017-03-01 16:34:16 +01:00
Julian Eisel
b00b9dadd8 Outliner: Support dragging object into collection
Doing this will add the object to the collection.
2017-03-01 15:35:21 +01:00
c1f43c9dc6 Cleanup: warnings 2017-03-02 00:36:33 +11:00
8901263b5f Merge branch 'master' into blender2.8 2017-03-02 00:22:13 +11:00
f64df0e102 Fix error moving keyframes in graph editor after refactor base 2017-03-01 13:08:15 +01:00
3626521346 Base Refactor Tasks: Fix some legacy bases for dopesheet 2017-03-01 11:41:23 +01:00
e142793815 Base Refactor Tasks: Change selection flags 2017-03-01 11:31:10 +01:00
14627cc2ee Base Refactor Tasks for gpencil filter 2017-03-01 11:21:06 +01:00
Dalai Felinto
6ee70312bb Dopesheet: fix crash when dragging keyframes 2017-03-01 10:43:04 +01:00
Julian Eisel
0b0347dcca Cleanup: Rename outliner enum 2017-03-01 11:28:17 +01:00
Julian Eisel
512fb74980 Outliner: Make deleting collections from "All Collections" mode work 2017-02-28 22:18:11 +01:00
Julian Eisel
fcbae6c3b3 Outliner: Highlight active layer collection in "All Collections" mode 2017-02-28 21:58:07 +01:00
Julian Eisel
f35907444e Cleanup: Add outliner_utils.c, move functions into it 2017-02-28 21:37:15 +01:00
3176bb8346 clean up GL / GPU #includes 2017-02-28 15:30:39 -05:00
2a8dd3c5ff remove GPU_basic_shader calls from wm_gesture
Gestures are drawn with specific built-in shaders now.
2017-02-28 15:30:39 -05:00
7b1e5e8620 remove unused code from interface_icons
No longer depends on basic shader API
2017-02-28 15:30:39 -05:00
2fcdb6df10 remove unused code from uvedit_draw
Keep USE_EDBM_LOOPTRIS code paths, remove not-USE_EDBM_LOOPTRIS paths.

Discussed with @LucaRood in IRC since he worked on this file recently.
2017-02-28 15:30:39 -05:00
Julian Eisel
c0e055fa7e Outliner: Delete all selected collections, not just active one
There were some issues with how we store outliner tree elements:
Apparently the only removable elements have been data-blocks so far.
When recreating the TreeElements, their TreeStoreElem instances were
mainly identified by their ID pointer. However non-data-blocks mostly
depend on an index. For collections, such an index isn't a reliable
measure though if we want to allow removing items. Depending on it for
identifying the TreeStoreElem instance would cause some quite noticeable
glitches (wrong highlights, two elements sharing highlight, etc).

For now I've solved that by actually removing the TreeStoreElem that
represents the removed element. A little limitation of this is that
after undoing the removal, some information might get lost, like
flags to store selection, or opened/closed state.
A better solution that would also fix this issue would be having a real
unique identifier for each non-data-block element, like an idname or even
its data-pointer. Not sure if we can get those to work reliable with
file read/write though, would have to investigate...

Also added a general Outliner tree traversal utility.
2017-02-28 21:15:51 +01:00
5e889ebf19 OpenGL: no more display lists
Part of the OpenGL core profile upgrade (T49165)

Use the Batch drawing API (GPU_batch.h) when you want do draw something multiple times.
2017-02-28 13:15:11 -05:00
54ed1b7324 Fix Dopesheet and Curve editor to use new bases in SceneLayer instead of old base.
(see D2538)

Thanks to dfelinto for his support.
2017-02-28 17:16:46 +01:00
7175838b61 Draw Manager: Fix ortho grid in front of overlays. 2017-02-28 15:15:34 +01:00
96d63d2232 Edit Mesh overlays: fix half cut vertices.
Artifacts still remained when 2 vertices were linedup in orthographic mode or with very acute vertex angles.

This commit fix that by adding even more geometry.
2017-02-28 15:00:16 +01:00
677f066634 Edit Mesh overlays: added looses edges and verts as triangle.
We loose a bit of memory for (more?) performance.
2017-02-28 14:31:16 +01:00
Julian Eisel
6af21b4e7f Highlight active collection in outliner 2017-02-28 14:11:15 +01:00
2de9bf1138 skip OpenGL debug logic on Apple
ifdef out most debugging code since Apple does not implement any debug extensions. We can revisit this if they ever do (don't expect that).

Changed output message so Mac users don't think --debug-gpu is broken.
2017-02-28 04:38:30 -05:00
811e90c957 OpenGL: enable use of AMD_debug_output
This extension is the best we have on some older supported GPU + OS combinations.

All the code was in place, just disabled.
2017-02-28 04:05:53 -05:00
08e654935c OpenGL: remove GPU_state_print function
I was removing deprecated/obsolete state from this function. About halfway through I started questioning the need for the whole thing.

GPU_state_print is not called anywhere, but is (was) available as a development aid.

External GL debugging tools are really good these days! We should use those to examine state & not roll our own.
2017-02-28 03:19:53 -05:00
6a3dd21edd OpenGL: remove obsolete GL_POINT_SMOOTH
Was only used in one place, to show the 3D mouse rotation center.
2017-02-28 03:09:44 -05:00
8a76049e84 rename built-in point shaders, SMOOTH --> AA
Updated shader names and code that uses them.

All of these shaders produce round points that are anti-aliased and blended against the background.

These were initially named SMOOTH because they replace glEnable(GL_POINT_SMOOTH). But SMOOTH in shader-land refers to vertex attribute interpolation (like glShadeModel(GL_SMOOTH)).

Using SMOOTH to mean two things is confusing, so we now use AA to mean "the point is anti-aliased".
2017-02-28 02:18:52 -05:00
e7d57628c9 OpenGL: keyframe shape fixes
- Size parameter is total size of the shape, not its radius (half size). Updated hard-coded sizes to match this.
- Shader expands size to include outline.
- Fixed fringe between outline color and transparent background.
2017-02-28 01:21:27 -05:00
Julian Eisel
5138fe3c0a Outliner: "All Collections" mode showing the master collection hierarchy
Reordering is disabled for now. Link, unlink and override operators
are only available while in "Active Layer" mode, not in "All
Collections".
2017-02-27 22:24:59 +01:00
Julian Eisel
c24b4e0cd0 Outliner: Rename "Collections" display mode to "Active Render Layer" 2017-02-27 21:15:49 +01:00
6ab9af0083 Merge branch 'master' into blender2.8 2017-02-27 16:08:25 -03:00
Dalai Felinto
bf243752fc Immediate Mode: Lattice drawing
Part of T49043
2017-02-27 18:31:03 +01:00
Dalai Felinto
b5dd04b7e7 Immediate Mode: force fields
Part of T49043
2017-02-27 17:57:07 +01:00
416bd1bbe8 Clay Engine: Edit Mesh overlay fix jaggy edges.
We do a strip of triangles around the triangle of interest and modify the variying vars to "trick" the fragment shader into rendering what we need.
This keeps the compatibility for both shaders.
Vertex still get half displayed when angle at the vertex is very acute.

This patch is only for the simple, no vert clipped case.

This is 2.5x slower than without the trick (on my hardware with 1million tris).
2017-02-27 17:41:35 +01:00
Dalai Felinto
35290f5d4e Bring back border selection 2017-02-27 12:16:27 +01:00
Dalai Felinto
edba025c92 Prevent crash when copying object
ob->collection_settings is to be handled by depsgraph, but we may as well make sure things do not crash meanwhile
2017-02-27 11:18:11 +01:00
Julian Eisel
aff8ce438a Outliner: Don't use alphabetical sorting for collections
Order of collections matters, so sorting the outliner entries to be
alphabetical is misleading.
2017-02-26 22:34:58 +01:00
16b2005bfb Clay Engine: fix shader :/ 2017-02-26 21:33:29 +01:00
6dabcdf69e Clay Engine: Replace if() by assert() 2017-02-26 21:12:56 +01:00
712530eb93 Clay Engine: Edit mesh overlays
Based on the previous overlay shader from merwin.
This shader takes care of clipped vertex cases and do all edit mode face info in one pass (except face centers).
As the shading is done one the triangle itself the visual can't go beyond the surface of the mesh. That leads to half displayed edges on the outline of the mesh.
This problem can be fixed by a second pass.

This is work in progress.
2017-02-26 21:12:56 +01:00
Julian Eisel
fabde06b37 Fix outliner "Sort Alphabetically" having not working 2017-02-26 19:24:01 +01:00
Julian Eisel
20a105d54c Fix errors in new immediate mode for interface_widgets.c
Text editing cursor, text editing selection highlights and pie menu
direction indicator weren't visible.

Caused by rB4f2375b82f72.
2017-02-26 16:53:04 +01:00
2724fad582 OpenGL: replace gluProject and gluUnProject, and simplify surrounding code.
Part of T49042.
2017-02-26 00:16:46 +01:00
e9011100f7 Fix compiler warnings on macOS / clang / c++11. 2017-02-26 00:16:21 +01:00
3cf2821f2f Merge branch 'master' into blender2.8 2017-02-26 00:15:59 +01:00
bda0456933 OpenGL: wm_gesture uses new imm mode
D2376 by @ianwill, part of T49043
review by @merwin

Box select, circle select, etc. Introducing the dashed-line shader! See D2376 for more info.
2017-02-24 15:33:32 -05:00
1f453a8909 OpenColorIO: Update glsl implementation to be ready for ogl 3.3 core 2017-02-24 12:38:50 +01:00
1e7475a5d7 Opengl glaDrawPixels removal: More descriptive setup. 2017-02-24 12:38:50 +01:00
Dalai Felinto
0584c82ad7 Fix break in drawscredge_area_draw when in fullscreen 2017-02-24 11:05:52 +01:00
Dalai Felinto
2f9a0dfe64 Fix T50714: Collections: Adding object to scene without an existing collection
This was causing blender to segfault.

We now add create a new collection and link to the layer before adding
the new object

(also included unittests, and requires updated lib/tests)
2017-02-24 10:10:24 +01:00
Dalai Felinto
8261a84ffb Unittest: split object_add in individual test files
(and small cleanup in unittest)

This is required to the upcoming unittest + bugfix
2017-02-24 10:10:24 +01:00
Dalai Felinto
4c8d8da2e7 Silence warnings in draw_armature.c
Also add note about incomplete functions there
2017-02-24 10:10:24 +01:00
9dd86e2758 OpenGl immediate mode: drawnode.c
Part of T49043
2017-02-24 01:09:51 -03:00
4c6190d08f Add immDrawBorderCorners function
This replaces `glaDrawBorderCorners`.
2017-02-24 01:09:50 -03:00
c2453007f4 Opengl glaDrawPixels removal: #if 0 glDrawPixels... 2017-02-24 01:26:45 +01:00
7b744f9e1a Opengl glaDrawPixels removal: mask_draw.c 2017-02-24 01:26:45 +01:00
ab8958bbd5 Opengl glaDrawPixels removal: image_draw.c
Using float buffer is still laggy because of the data volume we have to transfer to the GC.
2017-02-24 01:26:45 +01:00
2ea5446197 Opengl glaDrawPixels removal: interface 2017-02-24 01:26:45 +01:00
ccec97ea0a Opengl glaDrawPixels removal: editors/spaces 2017-02-24 01:26:45 +01:00
c9e8584e7f Opengl glaDrawPixels removal: windowmanager 2017-02-24 01:26:45 +01:00
6628446bdf Opengl glaDrawPixels removal: editors/render 2017-02-24 01:26:45 +01:00
44ea6fb857 OpenGL: Make glaDrawImBuf_glsl functions compatible with new immDrawPixels
And change relevant function calls.
2017-02-24 01:26:45 +01:00
45711c3fde OpenGL immediate mode: new shader image shuffle color
new shader to draw an image with one isolated channel
2017-02-24 01:26:44 +01:00
071fdfbfb3 OpenGL immediate mode: fix asserts in clip dopesheet 2017-02-24 01:26:44 +01:00
e437841239 OpenGL immediate mode: modifying immDrawPixelsTex
This way OCIO can be used with it.
2017-02-24 01:26:44 +01:00
3d8f4fedd0 Clay Engine: fix format (3D instead of 2D) 2017-02-24 01:26:44 +01:00
e5799d1389 OpenGL immediate mode: gpu_framebuffer.c
I had to make some changes to the sep_gaussian_blur shader to be compliant for gl 3.3 leap
2017-02-24 01:26:44 +01:00
34c07c0d6d Fix Py API doc generation - missing new context members definition. 2017-02-23 22:27:49 +01:00
dec323659d Merge branch 'master' into blender2.8 2017-02-23 22:09:09 +01:00
2e83814e18 OpenGl immediate mode: clip_draw.c and clip_graph_draw.c fixes
Fixed little typo in clip_draw.c and special case assert in
clip_graph_draw.c (track segments with single point).

Part of T49043
2017-02-23 16:12:08 -03:00
ef60979029 Rework of BKE's mesh_render to support BMesh directly.
Note that since there is no (efficient) ways to get arrays of
MVert/MEdge/etc. out of a BMesh, I refactored quite heavily internals of
BKE_mesh_render.

Now, when you do need acess to mesh data to generate cached batches, you
create an abstract struct from mesh (either Mesh or BMesh if available),
and then use advanced helpers to extract needed data, on a per-item
basis (no more handling of arrays of verts/edges/... in batches code).

This allows to:
* Avoid having to create arrays of BMesh elements.
* Take advantage of existing advanced BMesh topology and connectivity data.

Reviewers: dfelinto, fclem, merwin

Differential Revision: https://developer.blender.org/D2521
2017-02-23 11:54:40 +01:00
d751676cf3 Fix building full. 2017-02-23 11:03:56 +01:00
b46b2834b9 Merge branch 'master' into blender2.8 2017-02-23 10:56:28 +01:00
Dalai Felinto
53a9dec2bf Silence "defined but not used" warnings 2017-02-23 10:24:59 +01:00
3b3ed19c18 OpenGl immediate mode: remove imm_draw_line
Replaced all calls to `imm_draw_line` by plain `immVertex2f` calls, and
removed `imm_draw_line`, as that function was not supposed to exist in
the first place, and causes unnecessary calls to `immBegin`/`immEnd`.

Part of T49043
2017-02-23 03:21:58 -03:00
30420845b9 OpenGl immediate mode: fix screen_draw.c
* Fix several wrong coordinates, causing things to be drawn in the wrong places.
* Remove unexpected return.
* Slight peformance improvement, by reducing number of shader binds.
* Minor code style stuff.

Part of T49043
2017-02-23 00:27:35 -03:00
Julian Eisel
a8d6e41bbc Fix issues when reordering nested collections
Item was inserted at the head of the top-level collection list, instead
of parent-level one.
2017-02-23 00:09:43 +01:00
Julian Eisel
9c106ff211 Cleanup: Style 2017-02-22 18:54:56 +01:00
efc499cb99 OpenGL immediate mode: paint_stroke.c 2017-02-22 18:20:16 +01:00
Julian Eisel
f1d59073cc Disallow renaming master collection from Outliner
Shows warning when trying to do so.
2017-02-22 17:50:10 +01:00
Julian Eisel
910b7dec8d UI: Support drag & drop reordering of collections
This adds initial support for reordering collections from the Outliner
using drag & drop.
Although drag & drop support is limited to collections for now, this
lays most foundations for general drag & drop reordering support in the
Outliner. There are some design questions to be answered though:
* Would reordering of other data types (like objects) be a purely visual change or would it affect the order in which they are stored? (Would that make a difference for the user?)
* Should/can we allow mixing of different data types? (e.g. mixing render layers with objects)
* How could we realize this technically?

Notes:
* "Sort Alphabetically" has to be disabled to use this ("View" menu).
* Reordering only works with collections on the same hierarchy level.
* Added some visual feedback that should work quite well, it's by far not a final design though: {F493806}
* Modified collection orders are stored in .blends.
* Reordering can be undone.
* Did minor cleanups here and there.
2017-02-22 17:25:00 +01:00
e003499f6f OpenGl immediate mode: uvedit_smart_stich.c
This is a quick fix. A better fix should be to store the batches inside the StitchPreviewer struct.
2017-02-22 17:22:28 +01:00
3952349a81 OpenGl immediate mode: fix false positive (again) 2017-02-22 14:27:04 +01:00
48752d8802 OpenGL: Fix Object Axes color 2017-02-22 14:24:09 +01:00
d4f0e10cc4 OpenGl immediate mode: Fix false positive 2017-02-22 14:23:20 +01:00
eff5924c75 OpenGl immediate mode: screen_draw.c 2017-02-22 14:05:56 +01:00
cd0d335183 Clay Engine: Started Armature drawing
This should give the overall direction to whom wants to finish it.

- Renamed EDIT mode engine to EDIT_MESH mode engine
- Introduce EDIT_ARMATURE mode engine
- Started to port legacy drawarmature.c to draw_armature.c
2017-02-22 13:00:15 +01:00
48aeb0b640 Clay Engine: Renaming shader. 2017-02-22 12:50:03 +01:00
6dbc6dfc14 Clay Engine: Prepare for Armature drawing.
- Added runtime display matrices to EditBone and bPoseChannel
- Added Object space instance vertex shader and modified the simple lighting shader accordingly
2017-02-22 12:46:27 +01:00
e05d3d5d9b Clay Engine: Fix Memory Leak. 2017-02-22 12:19:10 +01:00
4f2375b82f OpenGL immediate mode: interface_widgets.c
Added rgba_float_args_set_ch to BLI_math_color.h
2017-02-20 21:21:47 +01:00
5c39aad283 OpenGL immediate mode: interface_panel.c 2017-02-20 21:21:47 +01:00
86d8dc12c1 Use Git submodule tracking feature
This way we can point submodules to different branches.

There are two side-effects to this:

- Git 1.8.2 becomes the minimal required version now
  to support this feature.

- Not sure how doing local changes in submodules followed
  by `make update` will behave. We don't use explicit rebase
  now.

  Perhaps this is not so bad, since it was already quite
  dangerous thing to do.
2017-02-20 10:16:58 +01:00
22119f976e Point addons to 2.8 branch 2017-02-20 10:14:25 +01:00
446625c561 Clay Engine: Use G.debug_value to test cache performance
Use debug 666 for cache without instance buffer caching.
Use debug 667 for cache with instance buffer caching.
2017-02-19 14:31:02 +01:00
c8b7e7973a OpenGL immediate mode: transform_manipulator.c 2017-02-19 14:00:21 +01:00
9f839a2ff5 OpenGL: fix MVP matrix order
Numbers were correct but names were mixed up.
2017-02-18 19:53:55 -05:00
fae895125e fix OpenGL line count in VSE backdrop 2017-02-18 15:39:21 -05:00
Dalai Felinto
ab6993811f Fixup for last commit :/ 2017-02-17 22:29:53 +01:00
Dalai Felinto
b30044d4af Fix crash introduced in engine separation (50fb3ea3)
Basically DEG_OBJECT_ITER (or rather,
BKE_scene_layer_engine_settings_update) wasn't creating
Object->collection_settings data for invisible objects.

Now I'm removing those objects from the loop entirely. If we are to
bring them back we need to either create CollectionEngineSettings dat
from them or to skip them in DRW_mode_cache_populate.
2017-02-17 22:26:40 +01:00
39e212eb05 OpenGL: further mask_draw tweaks
- smooth round points
- fewer state changes
- minor cleanup & warning fix

This is a follow-up to rB84141f27a668
2017-02-17 15:42:11 -05:00
b41c5c81c6 Fix bplayer (c) 2017-02-17 20:07:13 +01:00
a54e461b84 Fix building without Clay engine. 2017-02-17 20:06:31 +01:00
322b1d3187 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/animation/anim_draw.c
2017-02-17 20:03:55 +01:00
Dalai Felinto
cb36dbe606 bug in DEG_OBJECT_ITER 2017-02-17 19:37:11 +01:00
Dalai Felinto
7868c0aa8b Layers: Fix unittest after 65a75e11 2017-02-17 18:27:32 +01:00
Dalai Felinto
df56721931 Layer/Outliner: add a few operators that I need for the video demo 2017-02-17 17:54:05 +01:00
Dalai Felinto
65a75e112c Layer: change default name of doversion layer (Viewport now) 2017-02-17 17:54:05 +01:00
Dalai Felinto
1ed20a692f Follow up on mode engine code separation
The settings initialization belong within the engines
2017-02-17 17:54:04 +01:00
50fb3ea3de Clay Engine: Separate mode drawing to different files/engines. 2017-02-17 17:30:15 +01:00
Dalai Felinto
9cb44cbba1 Layers: Fix visibility evalution + Unittesting
test_evaluation_visibility_a failed before, but it is now fixed
test_evaluation_visibility_b passed before and was used as control to make sure it was not broken
2017-02-17 14:08:31 +01:00
Dalai Felinto
7884406f33 Layers: ob.visible_get()
Similar to ob.select_get(), but for BASE_VISIBLED.
2017-02-17 12:57:14 +01:00
Dalai Felinto
5a14578116 Layers: Fix crash on opening files saved in clay
Basically we were not tagging the layers and bases as dirty. As usual this will likely change once Depsgraph kicks in. But this will do for now.
2017-02-17 11:02:25 +01:00
84141f27a6 OpenGL: mask_draw uses new imm mode
Based on D2371 from @ryry. Mostly T49043, a little T49042.
Deleted some unused drawing code instead of updating it.
I have a few more things in mind for this file... tomorrow!
2017-02-17 03:23:46 -05:00
23e51f4734 OpenGL immediate mode: sequencer_draw.c (finished)
Converted the remaining diagonal stripes thingies...

Part of T49043
2017-02-17 00:07:16 -02:00
ff53949145 Add diagonal stripe shader (GPU_SHADER_2D_DIAG_STRIPES)
Reviewed By: merwin

Differential Revision: https://developer.blender.org/D2512
2017-02-17 00:07:16 -02:00
077988dd44 blender2.8: New immediate mode for sculpt_uv.c
[Note: this patch functionality was implemented in parallel, independently at bf83f097ad
That said, the original patch was also removing an unnecessary include,
so here it is]

Replaced the one call to `glutil_draw_lined_arc`.
This seems to be the only draw call in this file.

Reviewers: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2497
2017-02-16 22:05:27 +01:00
cbc5388a4a Minor cleanup in sequencer_draw.c
Minor style cleanup, and also replaced manual checker drawing by a call
to `imm_draw_checker_box`.

Part of T49043
2017-02-16 18:48:37 -02:00
34d3ae9d5b OpenGL immediate mode: clip_draw.c
Part of T49043
2017-02-16 18:48:37 -02:00
b5cae50376 Add imm_draw_checker_box function
This replaces `fdrawcheckerboard` in drawing a standard gray
checkerboard for alpha backgrounds.
2017-02-16 18:48:19 -02:00
Dalai Felinto
e3dd2b1591 Doversion: merge collection engine properties
This is a more complex approach, which makes me really want to use
IDProperty instead (assuming we handle their merging nicely).

In fact I would expect this to happen in readfile.c, not during
doversion, but I can revert this later.

For now this allow for demo files saved with 2.8 to keep working even
after we add/remove engine settings properties.

The values are merged. There is no purge though, so
old CollectionEngineSettings and CollectionEngineProperty will live
forever (for the time being).
2017-02-16 20:02:35 +01:00
Dalai Felinto
6d58f1e87d Doversion: reset layer collection properties when needed
This prevents crashes when a file was saved with 2.8, but a new
engine settings property was created.

In those cases any previous collection settings are wiped out. We can do
an elegant merge soon.
2017-02-16 20:02:35 +01:00
Dalai Felinto
9f4004261e Layer: add name to mode engines 2017-02-16 20:02:35 +01:00
db2a05999a Clay Engine: Fix Cursor too bold 2017-02-16 16:22:44 +01:00
b512c2a794 Clay Engine: Correct Mesh Normals 2017-02-16 16:22:44 +01:00
268670cdee Clay Engine: Fix Axis Name shader 2017-02-16 16:22:44 +01:00
Dalai Felinto
d8df7ce6a4 Outliner collection operators: linking! 2017-02-16 16:02:44 +01:00
Dalai Felinto
011c8c730f Outliner collection operators, all but collection link
Note: It may be missing a notifier to prevent Outliner from crashing
when deleting collections.
2017-02-16 14:39:56 +01:00
3d63b9a88f Clay Engine: Hidden wire 2017-02-16 14:00:55 +01:00
eeeb1aa658 Clay Engine: Wire and Backface cull collection settings. 2017-02-16 14:00:55 +01:00
f5ab4bc339 Clay Engine: Fix grid not showing. 2017-02-16 14:00:55 +01:00
dbe23c5456 OpenGL immediate mode: sequencer_draw.c
Other than the general conversion:
* Made some slight aesthetic improvements.
** Removed gradients.
** Replaced stipples with transparency for hidden strips.
** Made strip borders less harsh.
** Removed stripes from offsets and made them brighter.
* Made only the visible parts of waveforms be drawn.
* Fixed a few drawing bugs.
** Background was not being drawn when buffer is NULL, and no
grease pencil is being drawn.
** Offset drawing ignored strip visibility.

Also, note that diagonal stripes for locked and error strips, are still
being drawn with the old api, as they await a new shader in order to
be converted.

Part of 49043
2017-02-15 17:10:19 -02:00
10d2ee6287 Remove redundant draw call (sequencer)
`SEQUENCER_OT_slip` was calling `draw_sequence_extensions` to redraw the
extensions during modal operation, but that is redundant, as it is
already called by the regular draw loop. Because it was called on top of
the draw loop, it was actually obscuring other parts of the strip that
would normally be drawn on top of it.

Somewhat part of 49043
2017-02-15 17:10:19 -02:00
Dalai Felinto
45bebbf5ad Remove "Object List" panel from collection context tab 2017-02-15 19:29:09 +01:00
Dalai Felinto
5a10c64e8c Layers: Show collection objects in Outliner 2017-02-15 19:29:09 +01:00
Dalai Felinto
a428daada0 Layers: Separate between scene render layer (F12) and context render layer (everything else)
For now they are the same. However with workspaces they will be
different, and should be treated differently.
2017-02-15 19:29:09 +01:00
883ef2c9ce Clay Engine: New collection settings (not working yet) 2017-02-15 18:54:31 +01:00
69b96e27ee Collections Settings: Added Bool type. 2017-02-15 18:18:43 +01:00
Dalai Felinto
574d6011f4 Revert "Collection Editor based on patch by Julian Eisel"
This reverts commit 3da834e83c.

We will use the outliner for this now.

I'm also moving the collections_ops.c to outliner_collections.c
2017-02-15 18:17:34 +01:00
Dalai Felinto
a47235f5fd Add note to RNA about layer/engine macros 2017-02-15 18:12:05 +01:00
Dalai Felinto
bf83f097ad Immediate Mode: sculpt_uv.c 2017-02-15 15:52:28 +01:00
Dalai Felinto
226ba44775 Fix sculpt brush draw crash on Blender2.8
Temporary solution by Sergey Sharybin, it needs further investigation.
This should not be necessary, specially since this works fine in master.
2017-02-15 15:52:28 +01:00
f9e4d8e93a Clay Engine: Replace Manual depth test by depth copy.
This avoid glitches due to float comparison precision.
2017-02-15 15:16:06 +01:00
Dalai Felinto
bdd3fd64e9 Bring rendering back (update all references to SETLOPPER) 2017-02-15 14:40:56 +01:00
Dalai Felinto
c694aedcad Update SETLOOPER to account for layers
The idea is to iterator over the active layer of the current scene and
then over the active layer of the set scenes.

In the future, once we get workspace we will get the initial renderlayer
from context, while the background sets will still use their active
renderlayer.
2017-02-15 14:40:56 +01:00
310593def1 Clay Engine: Support vertex normals (smooth shading), no face normals yet. 2017-02-15 13:32:35 +01:00
b0c125bcd3 Clay Engine: draw Speaker 2017-02-15 12:28:26 +01:00
cd472bc7de Clay Engine: Fix Grid depth write. 2017-02-15 12:28:26 +01:00
021f8d56d0 OpenGL immediate mode: Fix assert when using camera.show_sensor 2017-02-15 12:28:26 +01:00
9f03718a5b Clay Engine: drawaxis names drawn with shaders & instance 2017-02-15 12:28:26 +01:00
ee2a718763 Clay Engine: Fix empty drawing 2017-02-15 12:28:26 +01:00
e813ebab71 Clay Engine: new draw_view.c containing all dynamic drawing routines. 2017-02-15 12:28:26 +01:00
0f7dee19ed Viewport: Ported info drawing to from legacy code. 2017-02-15 12:28:26 +01:00
1f139beee3 Clay Engine: Added immUniform functions...
for vec3 arrays and matrix4.
2017-02-15 12:28:26 +01:00
Dalai Felinto
e30bc6f517 Layer Unittest: use macro for tests 2017-02-15 12:12:59 +01:00
Dalai Felinto
7e3d2a8baa Sorted BaseLegacy > Base convertions
Including bring back UV Edit show other objects
2017-02-14 18:21:47 +01:00
Dalai Felinto
a76d45cf72 Layer DNA_scene_types _NEW defines, protect macro parameters 2017-02-14 18:21:47 +01:00
Dalai Felinto
1ff3d5bc9a Layer Macros: create the instance as part of the macro
Instead of pre-initializing an instance prior to the macro, we do it as part of the macro itself now.
2017-02-14 18:21:46 +01:00
Dalai Felinto
b9762fed93 Layers: Unittesting - make them granular
Some tests may break Blender, which makes the entire unittest routine to fail.
They are now I isolate the tests into individual files

Kudos to Sybren Stüvel and Sergey Sharybin for the advice.

Note: at the moment test_link.py is failing (since a41bbfb7)
2017-02-14 18:21:46 +01:00
Dalai Felinto
6906a884ee Immediate Mode: make triangles smooth again
Instead of bothering with matrix transformations, I am simply adding the jitter to the vertices.

Related to: rB31a21135cf72c8623be7f5aee2bfdac983ceae2e
2017-02-14 14:35:18 +01:00
Dalai Felinto
c80b760d4a Immediate Mode: particle_edit.c 2017-02-14 14:27:31 +01:00
Dalai Felinto
31a21135cf Immediate Mode: area.c and UI_draw_icon_tri, ui_draw_anti_tria
Note: This makes the jittering to not work :/

@merwin, would you know how to use gpuMatrixBegin2D for this case? I
think it must be the reason behind the lack of jittering. But I couldn't
get it to work (the 2D shader is asking for a 3D Matrix).

Part of T49043
2017-02-14 13:02:58 +01:00
Dalai Felinto
9151f12dad Immediate Mode: animation markers 2017-02-14 11:10:51 +01:00
1089294439 OpenGL immediate mode: Remove unecessary light shader 2017-02-14 00:49:16 +01:00
7fc632a856 OpenGL immediate mode: drawarmature.c (end)
No deprecated call left.
2017-02-14 00:35:25 +01:00
22df54acb6 OpenGL immediate mode: drawarmature.c (cont)
All (except for stick and wire) are now rendered using batch or immediate API.
Using simple front facing lighting for now, waiting for gpu_basic_shader.c to be recoded.
2017-02-14 00:35:25 +01:00
0790976b6c OpenGL immediate mode: fix inverted normal in sphere batch 2017-02-14 00:35:25 +01:00
8c09fa3be2 OpenGL immediate mode: added gpuRotate3f to GPU_matrix 2017-02-14 00:35:25 +01:00
9c35907ca2 OpenGL immediate mode: Replacement for gluCylinder 2017-02-14 00:35:25 +01:00
Dalai Felinto
1634cef2b3 Immediate Mode: timeline cached frames
This involved some refactoring. The original code was relying on a cache of pre-allocated arrays which in turn were still re-populated every redraw loop.

We now ditch those arrays, and make the draw "on the fly".

Part of T49043

@merwin can you just check if you foresee any performance impact with this approach?
2017-02-13 18:10:28 +01:00
Dalai Felinto
d4e9c27e4e Immediate Mode: curve draw stroke
How to test this drawing: create and edit a curve and press shift + drag your mouse (or tablet). The Curve needs a Bevel Depth > 0.0.

Note: The ideal solution would be to use a different shader, that takes
no lighting. However according to Clément Foucault there is an assert preventing the same batch to
me used with different attributes (or something like that). Il wait
until the end of such resolution before revisiting this. That said, it
is working fine.

Part of T49043

Differential Revision: https://developer.blender.org/D2501
2017-02-13 12:41:05 +01:00
Dalai Felinto
4e64151787 Outliner: allow for renaming of collection and small touch ups in the
code

Note: Master Collection should not be renamable, but also, it should be marked as MasterCollection (with an icon probably)
2017-02-13 11:16:23 +01:00
Dalai Felinto
8a92277a31 Layers: Per-Collection edit mode parsing
Note: we are now merging all the collection engines (mode and render), which eventually may get slow. But as stated before, this is to expose the functionality, while waiting for proper depsgraph integrated solution.
2017-02-13 00:25:30 +01:00
Dalai Felinto
adf355849f Layers: Per-Collection edit mode settings
I didn't manage to get the proper object context in the collection
properties editor. That said I got it working for now in a temporary way
since this will change once we get workspaces anyways

(see changes in buttons_context.c and
rna_scene.c::rna_LayerCollection_mode_settings_get)

I still need to handle the merging of the settings. I will find a
provisory solution while we wait for depsgraph.

(also layer_collection_create_mode_settings_object and layer_collection_create_mode_settings_edit could probably be elsewhere - under draw/engines likely)
2017-02-12 20:47:34 +01:00
b104057d00 OpenGL: enable program point size for keyframes
Allows vertex shader to determine how large to rasterize each point sprite. Forgot to do this before.
2017-02-12 01:56:08 -05:00
09bfc37889 OpenGL: convert NLA editor to new imm mode
Plus plenty of C99 cleanup.

Part of T49043. Needs more testing, I don't really use the NLA editor.
2017-02-12 01:30:21 -05:00
24703c97a1 GPU shaders / Clay engine : small renaming / cleanup 2017-02-11 21:15:46 +01:00
737d349dbc Clay Engine: fix instancing (again) 2017-02-11 20:36:20 +01:00
e05800d23b Clay Engine: converted Empties to the new instancing method 2017-02-11 20:36:20 +01:00
1abd2f279d Clay Engine: Small instancing fixes 2017-02-11 20:36:20 +01:00
eb473143a8 Clay Engine: Convert Lamp to use new instancing feature. 2017-02-11 20:36:20 +01:00
1976fd7af1 Clay Engine: Fix instance attrib. 2017-02-11 20:36:20 +01:00
08c1afb088 Clay Engine: Separate batch for Z straight line 2017-02-11 20:36:20 +01:00
fc0797142d Clay Engine: Refactoring of the dynamic batches
Support more attribs for interesting instancing
2017-02-11 20:36:20 +01:00
c5f2380be7 OpenGL immediate mode: drawarmature.c (cont)
Cube bone wire.
Fix do_const_color.
This breaks the selection in glSelect mode. Occlusion queries are fine.
2017-02-11 14:19:23 +01:00
e008ca13f1 OpenGL: updated clip_utils.c to new immediate mode
D2391 by @darwin, part of T49043

Reviewed by @merwin who made some small changes before committing.
2017-02-11 00:59:43 -05:00
768e4e991c fix warning
Strip start & end are floating-point values, so clang expected fabsf here. Casting to int since we want a discrete number of vertices.
2017-02-11 00:27:43 -05:00
bbc31e8929 OpenGL: draw keyframe markers as point sprites
Also some conversion to new imm mode (T49043).

Multiple editors affected.
We could push this even further & draw all keyframes in an editor with a single draw call.

Something is strange with keyframe markers in blender2.8 -- they're not showing up before or after this commit. They do appear in master. This commit probably needs some follow-up work after keyframes are showing again. Better to share this code now instead of sitting on it.
2017-02-11 00:24:59 -05:00
a161d45cfb add builtin GPU_SHADER_KEYFRAME_DIAMOND
Now we can draw keyframe markers as point sprites, with fewer draw calls and state changes.

Based on the builtin shader for round points with anti-aliased outline. This one is more pointy.
2017-02-11 00:02:28 -05:00
f7b1b87ba9 Gawain: minor cleanup 2017-02-10 22:27:20 -05:00
1c09c8f32f OpenGL immediate mode: drawarmature.c
Changed the color function to output a float[4] to use with shaders.
Temporary leaving the UI_ThemeColor/glColor function.
Porting draw_bone_octahedral (wire) to Batch API.
2017-02-11 00:43:03 +01:00
b97864203e Gawain : Added Batch_init()
to init a batch without allocating memory
2017-02-11 00:43:03 +01:00
af2df36248 OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_TRACKPREVIEW

Changed stipple shader usage to a bunch of GL_LINES with flat color

OpenGL immediate mode: interface_draw.c (end)

Eradicate leftover legacy functions.
Fix a crash with histogram resolution.
2017-02-11 00:43:00 +01:00
7252049cba OpenGL immediate mode: Added replacement for glaDrawPixelsTex_* 2017-02-11 00:42:59 +01:00
13ab43afcf OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_CURVE
2017-02-11 00:42:59 +01:00
ae3646cd9f cleanup from recent commits
coding style, float literals

Converted some (expr / literal) to (expr * literal) where it does not impact readability.

Simplified a few function calls.
2017-02-11 00:42:55 +01:00
ef600e8ccf OpenGL immediate mode: clip_graph_draw.c
Part of T49043 and T49042
2017-02-11 00:39:18 +01:00
dfadb45254 OpenGL immediate mode: gluSphere replacement
Updated interface_draw.c to use the new sphere batch.
2017-02-11 00:39:17 +01:00
5b10a6bb8e OpenGL immediate mode: fix Waveform Font color 2017-02-11 00:39:17 +01:00
b4a01e7f4f OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_COLORBAND
Introduced a new checker shader to be used mostly on transparent areas.

OpenGL immediate mode: interface_draw.c (cont)

ui_draw_but_UNITVEC
Introduced a new shader to be used for simple lighting.
2017-02-11 00:39:09 +01:00
8fbf1c4d77 OpenGL immediate mode: Convert leftover UI_ThemeColor calls
Some `UI_ThemeColor` calls were left in converted files, in some cases
because they were just overlooked, and in the case of text drawing,
because the new BLF color functions were not yet implemented at the
time of conversion.

Also converted one `drawcircball` call that was left in
transform_constraints.c

Part of T49043
2017-02-11 00:36:06 +01:00
3f9f82f3c4 fix clang warning
uninitialized variable (glGen functions set the value)
2017-02-11 00:18:36 +01:00
8add4cc900 OpenGL immediate mode: uvedit_draw.c
Still has one `UI_ThemeColor` call, because drawing is happening in a DM
drawing callback which hasn't been converted yet.

Also has some old gl calls that are #ifdef'ed out.

This also changes active face drawing in UVs from stippled to a solid
color, which makes active faces much more visible, and also looks nicer.
The same should probably be done for active face drawing in the 3d view.
(has been discussed with merwin on IRC)

Part of T49043
2017-02-11 00:18:36 +01:00
Dalai Felinto
0b27b65f24 Use OBACT_NEW to show the object edit mode 2017-02-10 20:46:16 +01:00
f9329997c3 Complete immUniform functions to support 2float and 3float 2017-02-10 17:29:12 +01:00
26f8095384 Alembic: fixed mistake in bounding box computation
By performing the Z-up to Y-up conversion, the change in sign of the
Z-coordinate swaps "minimum" and "maximum".
2017-02-10 11:52:51 +01:00
ae6e9401ab Alembic: using Base* instead of Object* to get selection
I also added some remarks & TODOs to indicate work in progress.
2017-02-10 11:52:33 +01:00
48a6aa3499 Alembic: don't use parent_selected() to determine which object to export
The parent_selected() function mixed semantics of "needs to be exported"
and "is selected", which is confusing. Now just selected objects are
exported to Alembic; any parent transforms that are required were already
taken care of by other code.
2017-02-10 11:52:33 +01:00
Julian Eisel
0c0bdd83a4 Cleanup: Use const for array argument 2017-02-10 00:20:46 +01:00
Julian Eisel
4b365064cf Remove most (maybe all?) remaining yellow text
Decided to request the text color as argument for UI_fonstyle_draw
functions, rather than keeping it being another state to keep track of.
2017-02-10 00:17:50 +01:00
Julian Eisel
0ce76a4274 Fix missing highlights in 3D View
Things like selection outlines didn't work at all.

Caused by rBc973e8d2da5cf3f.
When splitting up bitflags, the equivalent to `foo->flag & (bar1 + bar2)` is
`(foo->flag1 & bar1) || (foo->flag2 & bar2)`, *not*
`(foo->flag1 & bar1) && (foo->flag2 & bar2)`.
Also, let's please avoid using '+' operator for bitwise operations, a
binary addition is a binary OR *with* cary, which can cause quite some damage.
2017-02-09 21:26:38 +01:00
Julian Eisel
ca9c1de33e Fix object selection in 3D View 2017-02-09 20:49:53 +01:00
Julian Eisel
9e3cf0c2e8 Draw buttons for editing collections in outliner 2017-02-09 20:39:58 +01:00
Julian Eisel
c80f9822fd Support activating collections from outliner 2017-02-09 20:31:40 +01:00
Dalai Felinto
d82bb1f634 Main fix for outliner, but still need changes
Fix outliner related crashes. Basically in some functions bContext was
not passed around, so CTX_data_scene_layer(C) was crashing.

Right now we still rely on ob->flag SELECT in some places. In order to use the base flag we will need to bring back the Bases to the outliner.
2017-02-09 17:52:53 +01:00
Julian Eisel
1bcf199d2e Support displaying collections in outliner
Adds a new outliner display mode "Collections" which draws the active
collection. We might want to rename it to "Active Collection" if we don't
plan to support showing other collections there.
Also added the buttons for restricting visibility and selectability.

@dfelinto, code in restrictbutton_collection_hide_cb and
restrictbutton_collection_hide_select_cb is duplicated from
rna_LayerCollection_hide_update and
rna_LayerCollection_hide_select_update, maybe utility functions would be
handy for this?
2017-02-09 17:25:21 +01:00
Dalai Felinto
a41bbfb7f3 Depsgraph fix for scene layers
Objects can be moved around freely now
2017-02-09 16:46:05 +01:00
Dalai Felinto
1045026ea2 More housecleaning (BASACT > BASACT_NEW) 2017-02-09 16:34:26 +01:00
Dalai Felinto
cb490561d3 Layers: set active object in doversion for all render layers 2017-02-09 15:57:06 +01:00
Dalai Felinto
5bee553b1f Update get_camera_with_movieclip 2017-02-09 15:51:30 +01:00
Dalai Felinto
ff4dc7abfa Change ITER_BEGIN to work in C++ (include object type in the macro) 2017-02-09 15:26:28 +01:00
Dalai Felinto
0b473168cd Fix widget not showing up
(and more Scene.base > SceneLayer.object_bases changes in transforma code)
2017-02-09 14:49:56 +01:00
Dalai Felinto
8ff7f14c76 Temporary fix for object panel 2017-02-09 14:30:35 +01:00
Dalai Felinto
f20cc9e54c Fix logic in CollectionEngineSetting update
Now Clay engine can show different materials per collection o/
2017-02-09 12:48:39 +01:00
08399aca62 Clay Engine : fix 2017-02-09 12:04:37 +01:00
Dalai Felinto
0692fc9665 CollectionEngineSettings calculate: set COLLECTION_PROP_USE for combined property
This way the render engines can have a fallback value (scene or layer default value) for the shader values that were never set.
2017-02-09 11:48:09 +01:00
6b372e3a22 Clay Engine: support for overrides (not working yet) 2017-02-09 11:25:51 +01:00
Dalai Felinto
09af91e096 Fix crashes on outliner (fixup for rB2a16a4ee)
FOREACH_SCENE_OBJECT was wrong (skipping an object), but rB2a16a4ee made it crash. Things should be better now.
2017-02-09 11:22:56 +01:00
Dalai Felinto
9e95b5edd9 Fix active object name not showing in viewport 2017-02-09 10:28:50 +01:00
Cyrax
f2ea319316 OpenGL: outliner_draw_tree_element uses new imm mode
D2438 by @cyrax
review by @merwin
part of T49043
2017-02-08 18:36:03 -05:00
Cyrax
6444ba2635 added UI_GetThemeColorShade4ubv function
And updated UI_ThemeColorShade to use it.

Part of D2438 by @cyrax
2017-02-08 18:34:02 -05:00
Cyrax
b08483defa Update outliner_draw_hierarchy_lines to use new imm mode
Patch D2437 by @cyrax
review by @merwin
2017-02-08 15:02:55 -05:00
Cyrax
525937cc39 OpenGL: outliner_draw_highlights uses new imm mode
Patch D2433 by @cyrax, part of T49043
reviewed by @merwin
2017-02-08 14:37:37 -05:00
61df9fdb2f Cleanup: warnings 2017-02-09 02:39:31 +11:00
2a16a4ee43 Fix uninitialized var with FOREACH_SCENE_OBJECT 2017-02-09 02:25:27 +11:00
Dalai Felinto
3f7ca93490 Fix breakage when saving files from the UI
The problem was with offscreen buffer rendering
2017-02-08 16:06:11 +01:00
Dalai Felinto
260f97b3d9 create BKE_scene_layer_active 2017-02-08 16:05:24 +01:00
Dalai Felinto
a38298f4dd Bring back Lasso and Circle selection back
(and replace more instances of BaseLegacy/scene->base with Base/sl->object_bases)

Still need mouse selection, box selection, and menu selection

Also, there is still a problem with BA_WAS_SEL, at the moment only the
objects centers are highlighted.
2017-02-08 14:44:37 +01:00
d4913af846 Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/blenloader/intern/writefile.c
2017-02-08 13:10:16 +01:00
Dalai Felinto
c973e8d2da Partial "fix" for objects not being selected
To bring this fix a step further we need to address all the BA_WAS_SEL instances, and make sure they follow the new design.

This commit allow you to see the object selected (its center anyways) when you do select all.

Note: in the clay engine selection (a) was already working fine.
2017-02-07 19:11:17 +01:00
Dalai Felinto
6432c8cc00 Layers: get/update CollectionEngineSettings (depsgraph placeholder)
Every time:
  * A collection settings is set
  * A collection visibility changes
  * An object is added/removed/ ...

We need to recalculate the "accumulated" CollectionEngineSettings that
the render engine should use for an object.

This is to be handled by the depsgraph. Meanwhile this code should allow
us to start using those settings in the render engines.

Note: We are storing this in the objects, which means we can only have
one active calculated option every time.

This is intended to get the conversation with the Depsgraph department
going.
2017-02-07 16:54:09 +01:00
6bf9c8ac89 Fix broken COLLADA building. 2017-02-07 12:05:23 +01:00
83adc54438 Clay-Engine (merge clay-engine)
Initial work by Clément Foucault with contributions from Dalai Felinto
(mainly per-collection engine settings logic, and depsgraph iterator placeholder).

This makes Blender require OpenGL 3.3. Which means Intel graphic card
and OSX will break. Disable CLAY_ENGINE in CMake in those cases.

This is a prototype render engine intended to help the design of real
render engines. This is mainly an engine with enphasis in matcap and
ambient occlusion.

Implemented Features
--------------------

* Clay Render Engine, following the new API, to be used as reference for
future engines

* A more complete Matcap customization with more options

* Per-Collection render engine settings

* New Ground Truth AO - not enabled

Missing Features
----------------

* Finish object edit mode
  - Fix shaders to use new matrix
  - Fix artifacts when edge does off screen
  - Fix depth issue
  - Selection sillhouette
  - Mesh wires
  - Use mesh normals (for higher quality matcap)
  - Non-Mesh objects drawing
  - Widget drawing
  - Performance issues

* Finish mesh edit mode
  - Derived-Mesh-less edit mode API (mesh_rende.c)

* General edit mode
  - Per-collection edit mode settings

* General engines
  - Per-collection engine settings
    (they are their, but they still need to be flushed by depsgraph, and
    used by the drawing code)
2017-02-07 11:31:22 +01:00
Dalai Felinto
aeb8e81f27 Render Layers and Collections (merge from render-layers)
Design Documents
----------------

* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers

* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised

User Commit Log
---------------

* New Layer and Collection system to replace render layers and viewport layers.

* A layer is a set of collections of objects (and their drawing options) required for specific tasks.

* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.

* All Scenes have a master collection that all other collections are children of.

* New collection "context" tab (in Properties Editor)

* New temporary viewport "collections" panel to control per-collection
visibility

Missing User Features
---------------------

* Collection "Filter"
  Option to add objects based on their names

* Collection Manager operators
  The existing buttons  are placeholders

* Collection Manager drawing
  The editor main region is empty

* Collection Override

* Per-Collection engine settings
  This will come as a separate commit, as part of the clay-engine branch

Dev Commit Log
--------------

* New DNA file (DNA_layer_types.h) with the new structs
  We are replacing Base by a new extended Base while keeping it backward
  compatible with some legacy settings (i.e., lay, flag_legacy).

  Renamed all Base to BaseLegacy to make it clear the areas of code that
  still need to be converted

  Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp

* Unittesting for main syncronization requirements
  - read, write, add/copy/remove objects, copy scene, collection
  link/unlinking, context)

* New Editor: Collection Manager
  Based on patch by Julian Eisel
  This is extracted from the layer-manager branch. With the following changes:

    - Renamed references of layer manager to collections manager

    - I doesn't include the editors/space_collections/ draw and util files

    - The drawing code itself will be implemented separately by Julian

* Base / Object:
  A little note about them. Original Blender code would try to keep them
  in sync through the code, juggling flags back and forth. This will now
  be handled by Depsgraph, keeping Object and Bases more separated
  throughout the non-rendering code.

  Scene.base is being cleared in doversion, and the old viewport drawing
  code was poorly converted to use the new bases while the new viewport
  code doesn't get merged and replace the old one.

Python API Changes
------------------

```
- scene.layers
+ # no longer exists

- scene.objects
+ scene.scene_layers.active.objects

- scene.objects.active
+ scene.render_layers.active.objects.active

- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()

- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)

- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')

-AddObjectHelper.layers
+ # no longer exists
```
2017-02-07 11:11:00 +01:00
97fa285ae1 OpenGL: add gpuMatrixUpdate_legacy function
Marks matrix state as dirty so shader will use the latest values from glScale, glTranslate, etc.

We'll remove this after transitioning 100% to the new matrix API, which handles this sort of thing automatically.

Part of T49450
2017-02-06 23:24:10 -05:00
d23c57b84c fix unused var warnings
follow-up to earlier patch
2017-02-06 23:24:10 -05:00
6c95e97e64 OpenGL: convert clip_dopesheet_draw to new imm mode
D2486 by @TCMBoby, part of T49043
2017-02-06 23:24:10 -05:00
9b742ff61b OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_WAVEFORM
ui_draw_but_VECTORSCOPE
2017-02-07 00:24:44 +01:00
a54110751a OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_HISTOGRAM
UI_draw_text_underline (untested)
2017-02-06 16:54:26 +01:00
e58359c26f OpenGL immediate mode: interface_draw.c (cont)
Replaced GL_POLYGON in various places.
Ported UI_draw_roundbox_unfilled
2017-02-06 15:19:45 +01:00
8dbd961a3e OpenGL immediate mode: interface_draw.c 2017-02-06 14:06:13 +01:00
Dalai Felinto
cb3daaf355 Immediate mode: edit_curve_paint 1/2
Part of T49043
2017-02-06 12:43:24 +01:00
c3e2faaad5 BLF: simplify API for default font
We had two versions of several BLF functions -- one for a specific font ID & another for the default font.

New BLF_default function lets us simplify this API & delete the redundant code.
2017-02-05 01:01:41 -05:00
5ad5bb235b fix most UI text color
There are still many places to fix. I'll miss the bright yellow!

This commit also uses the new BLF_default function where possible.

Part of T49043 since we call glColor less often.
2017-02-05 00:54:21 -05:00
5908382011 add BLF_default function
So we don't need two versions of all other BLF functions -- one for specific font ID & another for the default font.
2017-02-04 23:12:53 -05:00
627566cb9a OpenGL: use GL4 on Linux when available
Minimum target is still 3.3

On AMD pro driver, asking for a 3.3 context gives us *exactly* 3.3, not 3.3+ as desired.

Have not tested proprietary NV or Intel drivers, but this fix should work on all vendors.
2017-02-04 19:35:54 -05:00
520ced4ad5 Modifications to GPU_texture:
-Remove NPOT check as it should be supported by default with OGL 3.3
-All custom texture creation follow the same path now
-Now explicit texture format is required when creating a custom texture (Non RGBA8)
-Support for arrays of textures

Reviewers: dfelinto, merwin

Differential Revision: https://developer.blender.org/D2452
2017-02-03 16:01:32 +01:00
b1b5ded37f Fix shaders in some immBindBuiltinProgram calls
Had mistakenly used 3D shaders for some 2D drawings...
Replaced those now.

Part of T49043
2017-02-02 23:21:08 -02:00
d85295534b Merge branch 'master' into blender2.8 2017-02-02 21:50:12 +01:00
47b21dd4c6 OpenGL immediate mode: transform_snap.c and part of drawnode.c
Also converted ED_node_draw_snap from drawnode.c
Committing these together, as they are inter-dependent.

Part of T49043
2017-02-02 14:28:46 -02:00
9a22b32e7e Make imm_drawcircball public
(Approved by merwin in IRC)

Required by part of T49043
2017-02-02 14:28:26 -02:00
57ac20d5b7 OpenGL immediate mode: space_graph.c
Part of T49043
2017-02-02 14:24:43 -02:00
3b71d5c0ae install_deps.sh: don't use backticks
The script complained that it could not find the executable "--build-all".
2017-02-02 16:04:49 +01:00
2e8be8ac6b OpenGL immediate mode: view3d_ruler.c
Differential Revision: https://developer.blender.org/D2485

Part of T49043
2017-02-01 22:23:49 -02:00
8e05a5bf8c fix build: BLF Theme color
blenderplayer uses BLF but not Editor UI, so we got a link error for the missing UI_GetThemeColor function.

Moved the new function from BLF to UI.

@Blendify reported problem in IRC
2017-02-01 19:00:51 -05:00
64b4a3185c OpenGL immediate mode: drawanimviz.c
Differential Revision: https://developer.blender.org/D2484

Part of T49043
2017-02-01 20:58:56 -02:00
57573df0d3 Add GetThemeColorBlendShade3ubv function
Differential Revision: https://developer.blender.org/D2484

Used by part of T49043
2017-02-01 20:40:49 -02:00
4935e2449b BLF can use Theme colors
For anything fancier than regular Theme colors (shading, alpha, etc.) do this:

unsigned char color[4]
UI_GetThemeColor[Fancy]4ubv(... color)
BLF_color4ubv(fontid, color)

That way the BLF color API stays simple.
2017-02-01 16:44:00 -05:00
7493a2b3c0 set default color for BLF fonts
Set to an annoying bright color so we can see where to add BLF_color calls.
2017-02-01 16:21:08 -05:00
ba551014f8 add BLF_color functions
Needed a way to pass main font color to BLF without using obsolete glColor. Could not use immUniform since BLF binds its shader internally.
2017-02-01 16:21:08 -05:00
13399d471e OpenGL immediate mode: editmesh_knife.c
Differential Revision: https://developer.blender.org/D2481

Part of T49043
2017-02-01 18:52:10 -02:00
fd089843b3 OpenGL immediate mode: transform_constraints.c
Differential Revision: https://developer.blender.org/D2483

Part of T49043
2017-02-01 17:32:33 -02:00
eca2f918a7 OpenGL immediate mode: transform_generics.c
Differential Revision: https://developer.blender.org/D2482

Part of T49043
2017-02-01 17:03:58 -02:00
be72d7a9f5 OpenGL: use new matrix API for Loop Cut
Follow-up to rB85174329d9f5
Part of T49450
2017-01-31 17:10:25 -05:00
adb422e500 OpenGL: fix MultMatrix order
Partial revert of rB06d4aca87956

Problem found while converting old GL matrix calls to new API (T49450)
2017-01-31 17:10:25 -05:00
3e9ade6e31 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/library_query.c
2017-01-31 10:47:43 +01:00
85174329d9 blender 2.8: OpenGL immediate mode: editmesh_loopcut.c
Reviewers: merwin

Reviewed By: merwin

Subscribers: dfelinto

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2480
2017-01-31 03:07:47 -05:00
b997914f80 OpenGL: remove NPOT texture rescaling logic
This code was already disabled.

We might be able to simplify GPU_check_scaled_image even further. Maybe even delete it? Just removing the obvious stuff now.

Keeping is_power_of_2_resolution function since it is still used in DXT logic.
2017-01-31 02:52:43 -05:00
Dalai Felinto
2081dac93b Mesh batch caches should not be stored in file 2017-01-27 15:21:14 +01:00
Dalai Felinto
8d04f49d0e Mesh batch caches update from depsgraph
We no longer need to rely on Derived mesh flag since the mesh is
properly flushed from the depsgraph
2017-01-26 19:14:39 +01:00
Dalai Felinto
9b7b9d6ae9 Depsgraph: mesh cache depends needs updates when geometry changes (patch by Sergey Sharybin) 2017-01-26 19:06:17 +01:00
Dalai Felinto
4c43dddeb7 Use the ultimate depsgraph callback function
Note: when in edit mode this depsgraph update is not being called. We are using DerivedMesh in those cases, so it is fine. I would like to investigate this though
2017-01-26 18:56:52 +01:00
9023abbf27 Depsgraph: Add placeholder function to handle objects update
This way @dfelinto can do some special trickery in there.
2017-01-26 17:24:57 +01:00
5ef2f21963 Merge branch 'master' into blender2.8 2017-01-26 17:23:33 +01:00
d812e0cb64 Blender 2.8: Apparently auto-merge worked incorrect in the merge commit 2017-01-26 17:04:25 +01:00
9e48cafd6d Merge branch 'master' into blender2.8 2017-01-26 17:02:28 +01:00
Dalai Felinto
290e080db4 Fix T50530: Crash on Info Editor "console"
Introduced on rB2de882e8 - the original size of the array was neglected
2017-01-26 09:41:40 +01:00
Dalai Felinto
99cfad6a01 Convert MBC_ API to Mesh (instead of derived mesh) and move it to mesh_render
This includes a few fixes in the MBC_ api.

The idea here is for this to be the only interface the render engines
will deal with for the meshes.

If we need to expose special options for sculpting engine we refactor
this accordingly. But for now we are shaping this in a per-case base.

Note:
* We still need to hook up to the depsgraph to force clear/update of
batch_cache when mesh changes

(I'm waiting for Sergey Sharybin's depsgraph update for this though)

* Also ideally we could/should use BMesh directly instead of
DerivedMesh, but this will do for now.

Note 2:
In the end I renamed the `BKE_mesh_render` functions to `static
mesh_render`. We can re-expose them as BKE_* later once we need it.

Reviewers: merwin

Subscribers: fclem

Differential Revision: https://developer.blender.org/D2476
2017-01-25 10:01:48 +01:00
5be2a62ca3 Merge branch 'master' into blender2.8 2017-01-24 14:56:56 +01:00
f286e7e017 Depsgraph: Make it more clear and explicit compile fail when required features are not found 2017-01-24 12:57:33 +01:00
769d189ff1 Depsgraph: Remove legacy code from new depsgraph
Now we have no remaining WITH_LEGACY_DEPSGRAPH in the code.
2017-01-24 12:55:37 +01:00
610af632a9 Depsgraph: Remove command line argument to use new depsgraph 2017-01-24 12:54:21 +01:00
a2d609331b Depsgraph: Remove more legacy code from viewport 2017-01-24 12:52:20 +01:00
218b06eb83 Depsgraph: Remove legacy updateDepgraph callbacks from modifiers 2017-01-24 12:49:23 +01:00
55e6d5428d Depsgraph: Remove legacy implementation of depsgraph 2017-01-24 12:47:23 +01:00
f20b8ae5aa Depsgraph: Remove legacy calls from scene update routines 2017-01-24 12:42:56 +01:00
46d6992907 Depsgraph: Remove special exception in update logging 2017-01-24 12:34:28 +01:00
9e40027110 Depsgraph: Remove special version of pose builder 2017-01-24 12:34:24 +01:00
23122ca889 Depsgraph: Remove legacy depsgraph code from viewport 2017-01-24 12:34:18 +01:00
991bda6959 Depsgraph: Remove legacy depsgraph code from transform 2017-01-24 12:34:14 +01:00
08ca32093a Merge branch 'master' into blender2.8 2017-01-23 18:11:42 +01:00
Julian Eisel
1814241526 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_action/action_draw.c
2017-01-22 21:16:00 +01:00
cdaed4d360 Fix compilation error with strict flags and gcc-6 2017-01-20 17:43:13 +01:00
8aa8165e85 OpenGL: convert legacy calls in transform.c
Took pieces from D2316 and D2359, changed a few more things.

- use new immediate mode
- use new matrix stack
- remove state push/pop

Part of T49043 and T49450
2017-01-19 00:46:20 -05:00
3216831c76 T50457 Remove temporary solution for animation types and put in definitve position
After revert the commit rB4b99958ca12642, the line added at the end of the enum is not necessary anymore because it is replaced by the corresponding element in the list in the right position.
2017-01-17 20:01:59 +01:00
3df30c34c3 Revert "Remove particle expander"
This reverts commit 4b99958ca1.
2017-01-17 19:46:05 +01:00
61b52f6d90 Fix previous commit because there are some code using this define, but really it is not used in editors. This is a temporary fix to broken editors, but this entry must be removed or moved to the right place when particles are in place again. 2017-01-17 15:53:31 +01:00
276e36a59f Remove unused definition. This enum must be synchronized with the registration ANIM_init_channel_typeinfo_data function in anim_channels_define.c
If the list is not equal, weird things start to happend in animation editors.
2017-01-17 13:33:37 +01:00
43872f59b9 Merge branch 'master' into blender2.8 2017-01-16 21:03:12 +01:00
af9e99763c OpenGL: convert anim_channel_defines.c to new imm mode
This is part of T49043

fixed up some color/rect calls

fixed up ANIM_channel_draw()

Reviewers: krash, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2377
2017-01-16 00:18:28 -05:00
7d55761c5d OpenGL: fix immRect usage & convert more glRect calls
part of T49043
2017-01-15 23:48:46 -05:00
4e2c6ad8ee Updating outliner_draw_struct_marks to retained mode
Had to add a few utility functions to replace existing functions. Let me know if these are duplicates.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2434
2017-01-15 19:30:05 -05:00
7eb4c850d3 Merge branch 'master' into blender2.8 2017-01-12 12:59:45 +01:00
Dalai Felinto
77dcf0fbc5 Merge remote-tracking branch 'origin/master' into blender2.8 2017-01-11 09:44:25 +01:00
Dalai Felinto
80865bd583 Fix building with INPUT_NDOF after warning cleanup
Reported by Clément Foucault
2017-01-11 09:43:40 +01:00
Dalai Felinto
9533eb4908 Fix warnings (mostly unused arguments) 2017-01-10 18:36:00 +01:00
Dalai Felinto
5ed5ed59c3 Fix T49861: Interlace stereo drawing
This does not address stapling shader in 2.8, though the solution can be
similar (own shader, not polutting interlace shader).

part of T49043

Reviewers: merwin

Differential Revision: https://developer.blender.org/D2440
2017-01-09 17:58:13 +01:00
Julian Eisel
e42e1769b3 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
2017-01-05 00:31:15 +01:00
Dalai Felinto
329879239e Merge remote-tracking branch 'origin/master' into blender2.8
I'm deliberately ignoring/reverting rB070f22c4 which in turns means T49861 is happening on 2.8
2017-01-02 11:47:26 +01:00
Dalai Felinto
d78f51a4c2 Merge remote-tracking branch 'origin/master' into blender2.8 2017-01-02 11:31:03 +01:00
fb20cbe04c Fix missing particlemode context mode, after recent particle-removal revert.
This caused the particle mode tools panel to appear in object mode, where it
misses some contextual data and spews python exceptions.
2016-12-30 12:13:21 +01:00
f874aeef70 Merge branch 'master' into blender2.8
Please **DO NOT** add changes from master when it's totally uneeded!

Changes to BLI_ area most certainly shall *always* be done in master,
there is absolutely no point in adding more diff between the two
branches than needed, will only makes merging more cumbersome!

Conflicts:
	CMakeLists.txt
	source/blender/blenlib/intern/math_vector_inline.c
2016-12-29 20:05:22 +01:00
6ecab6dd8e Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be912 and b4a721af69.

Due to postponement of particle system rewrite it was decided to put particle code
back into the 2.8 branch for the time being.
2016-12-28 17:30:58 +01:00
Dalai Felinto
605263177b Merge remote-tracking branch 'origin/master' into blender2.8 2016-12-23 15:36:16 +01:00
76c4f0ec6c Fix parameter error (changes by Mike Erwin) 2016-12-19 22:36:56 +01:00
3af98b4c04 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/CMakeLists.txt
	source/blender/editors/gpencil/drawgpencil.c
	source/blender/editors/physics/physics_ops.c
2016-12-17 13:07:00 +01:00
1bfe359802 OpenGL fixes
- mixing of old & new APIs
- vertex format mismatch
2016-12-14 02:43:26 -05:00
1e21b8dc1b OpenGL: another way to set uniform theme color 2016-12-13 16:45:59 -05:00
0fa887ae35 OpenGL: finish area action zone todo
Replace outlined circle (24 vertices) with a point sprite (1 vertex).

Replace one todo with another todo.
2016-12-13 15:43:13 -05:00
3b98b44223 small fix for previous commit 2016-12-13 15:03:58 -05:00
fe59296361 OpenGL: new immediate mode in area.c
D2361 by @punya, part of T49043
2016-12-13 14:51:39 -05:00
9be6d5ff18 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/makesrna/intern/rna_main_api.c
	source/blender/makesrna/intern/rna_particle.c
2016-12-12 16:17:57 +01:00
Julian Eisel
54528079e3 Correction to previous commit
Accidentally included some changes from workspaces branch.
2016-12-08 23:27:56 +01:00
Julian Eisel
35c18e4871 Move screen drawing functions into new screen_draw.c 2016-12-08 23:17:45 +01:00
47c6047873 3D cursor & mini axis for modern viewport
Shuffle existing code, hook it up to the new (& old) viewport.

Also the 3D mouse rotation guide for NEW viewport only. Minor feature not worth enabling for legacy 3D view.
2016-12-05 02:50:28 -05:00
6ab42eb0bd OpenGL: delete bl_debug_draw
Eliminating this chunk of legacy GL as part of T49043.

We can introduce some sort of "debug plate" to fill this need in the future.
2016-12-04 20:34:44 -05:00
5de33c3b64 cleanup: C99 for view3d_draw
Mostly for clarity & to declare things close to where they are used.

I'm getting ready to do substantial work in these files.
2016-12-04 20:11:12 -05:00
7458a022aa OpenGL: cleanup function parameters & state
glDepthMask takes GLenum
glLineWidth & PointSize take float
glCullFace has no effect when GL_CULL_FACE disabled
2016-12-01 18:18:07 -05:00
Julian Eisel
52ec962516 UI: Previews for screen layouts
Basically all this does is drawing layout previews into the opened layout search menu.
https://youtu.be/RHYWtZP7pyA

The previews are drawn using offscreen rendering so they can't use multi-threading (yet!). But that shouldn't be an issue since only a handful of previews are drawn at the same time. Normally we only need to redraw the preview if a screen layout was changed. Would be nice if PreviewImage could store if it supports threaded rendering.
Previews are saved in files, might be useful if you later want to support appending layouts.
Adds a new file screen_draw.c.
2016-12-01 17:19:58 +01:00
4ff4dbc0ab Immediate mode replacement for compositor node backdrop elements.
Part of T49043.
2016-12-01 17:08:29 +01:00
ff2a74906a Merge branch 'master' into blender2.8 2016-12-01 10:29:46 +01:00
73c1c92c0e Fix C++11 building on MSVC 2015
Newest 2017 not yet supported because i don't know its version symbol...
2016-11-29 02:35:46 -05:00
a76f1a7449 Default to C++11 for all compilers (2.8)
This fixes multiple problems on latest Mac OS + Xcode. Hopefully does not cause any on other platforms.

The Xcode detection logic could use further cleanup. It's checking several old versions that are unsupported for Blender 2.8+ development.
2016-11-29 01:01:38 -05:00
8d4421b0fc DerivedMeshes clean up their draw-batch caches
No more "Not freed memory blocks"!

This code was almost ready 1 month ago, waiting for other pieces to fall into place.
2016-11-29 00:26:21 -05:00
9f35495a26 Gawain: batch mode uses buffer ID funcs
The _discard functions now free their resources! These were waiting on thread-safe ID management, which we now have.
2016-11-29 00:12:50 -05:00
4af42f06c3 Gawain: immediate mode uses buffer ID funcs
These functions are called very infrequently.
2016-11-29 00:08:07 -05:00
328a47fa2c Gawain: manage GL buffer IDs in a thread-safe way
Needed because deps graph can destroy objects from any thread. We ran into the same problem & solved it in GPU_buffers.

Implemented in C++11 since it provides the needed machinery. The interface is in C like the rest of Gawain.
2016-11-29 00:03:54 -05:00
e369b85e2f Replacing UI_view2d_scrollsers_draw() to immedaite mode
Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision: https://developer.blender.org/D2364
2016-11-28 20:14:15 -05:00
c6d6f39153 Moved UI_view2_multi_grid_draw() to Gawain
Part of T49043, to replace gl immediate calls with Gawain

Reviewers: krash, merwin

Reviewed By: krash, merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2363
2016-11-28 20:11:13 -05:00
Julian Eisel
2821da5b70 Enable multi-selection editing by default (Alt-key behavior)
This means editing a property will now always affect all selected objects, bones or sequencer strips. Support for this was added in rBdfbb876d4660 but you had to hold the Alt-key to use it. The old behavior of only editing the active object will not be kept like decided in the 2.8 workflow meeting (reports comming). If you only want to edit the active object, you have to deselect others.

There are still a couple of issues to be resolved (listed below), but having it enabled by default helps testing and getting used to it and should motivate us to fix them ;)
To be fixed:
* Give users hint when edits are applied to all objects/bones/strips ("Applying to x objects") - there are ideas but we need to finalize and implement them
* Make it work better in corner cases (material editing, modifier property editing, etc)

Note: Values usually override the initial value of the object/bones/strips, except of number buttons where it depends if you enter the value (absolute override) or drag the value (add value change). This behavior is consistent with multi-button editing.
2016-11-27 16:28:56 +01:00
Julian Eisel
a796a84a43 Use const for color array arguments 2016-11-22 14:51:34 +01:00
Julian Eisel
60ce602380 Fix missing conversion of uchar color to float
Decided to just pass float [4] args, so no type conversion is needed at all.
2016-11-22 14:40:57 +01:00
559bd75766 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_270.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/space_view3d/drawobject.c
2016-11-19 16:28:39 +01:00
Martijn Berger
5cbc7b6ed2 bgl do not bind parts of OpenGL that are not exposed in core profiles 2016-11-19 15:07:01 +01:00
Martijn Berger
53267d2579 convert icon_draw_texture to gawain imm mode replacements 2016-11-18 16:04:25 +01:00
e0bea34c51 fix problem from D2360
I was too eager to get patch in after a last-minute change. My bad!
2016-11-18 00:40:40 -05:00
43ed3079e2 Moved UI_view2d_grid_draw() to immediate functions
Part of T49043

Reviewers: krash, merwin

Reviewed By: krash, merwin

Differential Revision: https://developer.blender.org/D2360
2016-11-17 22:49:22 -05:00
2de882e8cb OpenGL: textview port to immediate mode -> T49043
Updated the GL calls to the new immediate mode.
I left some glcolor calls which I'm not sure wether thats right?
Part of T49043

warm regards,
Sebastian Witt

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2305
2016-11-17 22:05:49 -05:00
fe73b8c29c use new enum types in glutil & imm_util 2016-11-17 16:10:53 -05:00
d915e89ec8 delete deprecated fdrawXORcirc function
Only one place used it, and that place was dead code already.
2016-11-17 15:03:55 -05:00
feccadd81b mark certain glutil functions as deprecated
These will be removed before we ship 2.8
2016-11-17 14:44:15 -05:00
86f435d6c8 Gawain: small note for future Vulkan work 2016-11-16 18:25:36 -05:00
Martijn Berger
b757e8298a Convert console_draw.c to Gawain
Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2276
2016-11-16 22:56:39 +01:00
b1f700dad3 Gawain: use PRIM_ and INDEX_ enums instead of GLenum
For a few reasons:
- separate enum sets for separate concepts
- debug with symbolic names instead of 0x4e72
- prepare for a Vulkan future
2016-11-16 16:03:15 -05:00
36ac979ee0 Gawain: use COMP_ instead of GL_ internally
Because GLenum could be ANYTHING. We use our own enum type for components.
2016-11-16 15:18:06 -05:00
7aa82e7ed2 Gawain: re-enable strict error checking in release builds
Makes it easier for new volunteers to catch errors early.
2016-11-16 12:14:55 -05:00
472e2c5acf Blender 2.8: Added immVertex2s() and immAttrib2s()
Just as mentioned in title. Need new functions for calls found in `transform.c`

T49043

Reviewers: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2358
2016-11-16 11:53:41 -05:00
Dalai Felinto
2bcb1b208a Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-16 17:04:21 +01:00
930f999f6e Part of T49043: Convert drawsimdebug.c to use the new Gawain API.
This conversion is pretty straightforward.

The code for debug drawing is not great, but it does the job.
Rewriting it is for another day, if it becomes more widely used.
2016-11-16 12:18:12 +01:00
15b2a64d0a Add stdlib.h include to fix missing 'abort' prototype. 2016-11-16 11:31:35 +01:00
3b06c42616 Blender2.8 convert UI_view2d_constant_grid_draw to new immediate mode
Convert UI_view2d_constant_grid_draw to new immediate mode.

Part of T49043.

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2298
2016-11-15 18:59:24 -05:00
edddd2c6f5 Use new immediate mode for ED_region_grid_draw
Convert ED_region_grid_draw to new immediate mode.

Part of T49043

Reviewers: merwin

Reviewed By: merwin

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2289
2016-11-15 18:37:03 -05:00
2653758adc blender 2.8: OpenGL immediate mode: anim_draw
Reviewers: merwin

Reviewed By: merwin

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2353
2016-11-15 12:19:47 -05:00
b78ddd43a5 start using COMP_* instead of GL_* in viewport
Gawain can accept either enum, but its own COMP_ values are recommended.
2016-11-15 11:49:00 -05:00
093b6c9e6e blender 2.8: OpenGL immediate mode: action_draw
Updated action_draw to use imm mode.

Reviewers: merwin

Subscribers: LazyDodo

Differential Revision: https://developer.blender.org/D2351
2016-11-14 23:02:57 -05:00
665aa6a2a0 blender 2.8: Opengl: UI_draw_roundbox
all is in the title too..

Reviewers: merwin

Reviewed By: merwin

Subscribers: Blendify, Severin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2337
2016-11-14 20:27:54 -05:00
8859aa3828 OpenGL: use packed normals for fancy wireframes
Consumes much less memory (1/3 for both normals = 32 bytes less per edge). Same visual result.

We can pack normals for other draw modes to get similar savings.

Part of T49165
2016-11-13 20:27:50 -06:00
ffc26fc5a8 Gawain: add support for 10_10_10 vertex format
Most useful for packed normals, which take 1/3 the space of float32 normals.

2-bit alpha|w component is ignored for now.

Batch API can use these now, will add support to immediate mode API if desired.

Enabling on Windows first. Will enable on all platforms after we switch Blender to core profile.
2016-11-13 20:18:51 -06:00
1dbe26f76c OpenGL: simplify debug, use only newer features
Drop SciTech support & workarounds for WinCE and OpenGL ES.

AMD_debug_output is still in the code but disabled. Once I verify the newer extensions are available on all the GPU + OS combos we support we can delete this disabled code.
2016-11-12 17:18:13 -06:00
eb880f280d Gawain: strict error checking in debug builds
Not release builds. Fix 66d7f01ecc to match what I meant to do.
2016-11-11 23:53:58 -06:00
8fd510f4b8 Gawain: new enum type for vertex attrib components
Motivations:
1) GLenum is too broad; tightly-defined enum just for this is safer.
2) enable a Vulkan future

New code should use these instead of GL_FLOAT etc. When all existing code has been updated to use new enum, we can drop compatibility with GLenum values.

Early work towards 10_10_10 format, more to come soon.
2016-11-11 19:39:56 -06:00
Julian Eisel
82ba89b042 Fix T49961: Blender 2.8 Crashes on saving an image
Caused by 4811b2d356 which caused the event handler hack that is used to fire up the file browser from other operators to fail. Basically the context from before the file browser is opened gets stored and used later for executing the actual file read/write operation (in this case, saving image). This context storage is cleared when exiting an editor since 4811b2d356, which is technically correct, but causes usage of NULLed context data in this case, because the file browser is exited before the file read/write operation is executed.

For now I solved this by moving the fileselect handler to list of normal handlers, instead of modal ones. 4811b2d356 only touches list of modal handlers so we avoid the crash. Ideally we'd completely refactor how the file browser opening works to get rid of these event handler hacks.

Note that I wouldn't be suprised if this causes other regressions, but I couldn't find one so worth a try.
2016-11-10 20:34:35 +01:00
Dalai Felinto
69655a1103 Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-09 14:36:59 +01:00
a0ae6d7116 OpenGL: manage built-in shaders better
As our library of built-in shaders grows, it's important to create, access, and discard them efficiently.

Lookup via GPU_shader_get_builtin is now constant time instead of linear (# of built-in shaders). This is called very often with our new immediate mode.

Creation and discard are unified.

Adding a new shader requires fewer steps.

365 lines shorter  :D
2016-11-08 22:53:59 -06:00
2b726b054e blender 2.8: OpenGL immediate mode: node_draw_preview_background
all is in the title.

Reviewers: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2336
2016-11-08 11:12:29 -05:00
12bce04b2f Blender 2.8: OpenGL: new immediate mode for paint_image.c
This one is for the straight line (white with width 2.0 over a black with width 4.0) drawn when you use the gradient tool.

To test: Image editor, create / open an image, choose image paint mode and on the tool shelf: choose the Fill brush and enable "Use Gradient" for it. Then click and drag on the image.

From what I checked, calls to glLineWidth are not being removed yet, so I kept them.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2312
2016-11-08 11:08:16 -05:00
f90b480f95 OpenGL: wm_operators.c uses new immediate mode
D2311 by @ianwill

This is the radial control that appears when we change the size of a brush in sculpt and vertex and texture painting modes, by pressing "f".

Also includes a new built-in shader that can be useful in other places.

Part of T49043
2016-11-08 10:55:23 -05:00
4e80bd2d6d Blender 2.8: OpenGL: new immediate mode API for screendump.c
It's the screencast cursor, tested here, compared to original, seems to be working fine.

Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2306
2016-11-08 10:10:55 -05:00
66d7f01ecc Gawain: less error checking in release builds
Gawain does very strict runtime checking to help us catch coding errors. Final release should disable most of these checks, so I'm disabling now for all non-debug builds.

When writing Blender code that uses Gawain, always make debug builds and test there! "make lite debug" is my favorite.
2016-11-08 05:28:40 +01:00
de101fe9a8 OpenGL: mesh edit mode uses edge overlays
Legacy GL uses GL_LINES, modern GL uses the good stuff.

Edit mode still has a long way to go...
2016-11-08 05:22:17 +01:00
0b83680d85 OpenGL: support for edge overlays
Has some obvious opportunities for improvement. This is my second attempt. First attempt used MLoopTri and sort of worked...
2016-11-08 05:06:09 +01:00
016aca7427 OpenGL: fade other objects during edit mode
Right now this only affects other objects in wireframe. The idea is to do something similar for other draw modes, and keep focus on the edit object.

As seen at #bcon16
2016-11-07 20:32:27 +01:00
a3277ae384 OpenGL: simple mesh edit mode for new viewport
Very very simple. Needs a lot of work to reach "legacy viewport" capabilities.
2016-11-07 20:24:03 +01:00
5abf1a4e9d OpenGL: enable fancy wireframes
Most of this was already in place, just enabling & adding comments.

One fix was needed to make batch uniforms stick between multiple draws.

Added comments to selection outline; no functional changes there.
2016-11-07 20:07:31 +01:00
1cd754ad31 OpenGL: simple batch of all mesh triangles
Can be used for drawing basic surfaces, hit testing, depth pre-pass, ...
2016-11-07 20:07:31 +01:00
c1ba58c44d Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/properties.py
2016-11-07 15:46:27 +01:00
93dbd81796 Gawain: manage batch API's current shader program + uniform funcs
Typical pattern:
Batch_set_program
Batch_Uniform(s)
Batch_draw
2016-11-05 21:03:26 +01:00
5b26c36008 OpenGL: edge overlay shaders
As seen at #bcon16. These were produced quickly and probably need further work.

SIMPLE variant draws triangle mesh edges. Based on this research:
http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/4884/pdf/imm4884.pdf
http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf

Non-SIMPLE variant can adjust thickness per edge. This can be used to draw only some edges, or accentuate some edges. Given the right inputs this is a general n-gon perimeter shader.

Part of T49165
2016-11-05 19:26:13 +01:00
a85f68e9c7 OpenGL: further wireframe shaders
As seen at #bcon16

Geometry shader version is automatically used on modern GL runtimes. Legacy version is used on pre-3.2 systems (Mac, Mesa compat profile). They have the same inputs and visual result.

TODO: specialized versions that are less flexible -- draw ALL edges or draw JUST silhouette edges.

Part of T49165
2016-11-05 18:56:57 +01:00
Dalai Felinto
c25c3bb6cb Fix UI for smoke cache
(this was probably broken since we got rid of point cache in 2.8)
2016-11-02 11:09:27 +01:00
Dalai Felinto
a41bbd3053 Merge remote-tracking branch 'origin/master' into blender2.8 2016-11-02 10:59:52 +01:00
fb6f42dc4f OpenGL: draw NLA strip curves with new imm mode
Part of T49043.
2016-10-31 17:42:11 +01:00
1556a28108 OpenGL: draw filebrowser dropshadow with new imm mode
Part of T49043.
2016-10-28 20:46:10 +02:00
Dalai Felinto
a25d3d7de2 Viewport: Set outline color for mesh based on active/select state
(also, fix warning regarding const float being written)

You only see the color if you use the "modern" viewport option
(otherwise I believe Blender is drawing the old on top of the new outline).

That said, in the "modern" viewport we have unfreed mem. To be
investigated separately.
2016-10-26 13:57:22 +00:00
2783d5df61 OpenGL: follow up on mesh wire TODOs
- depth test on (affects scene depth for now)
- color variations
- object outline  does not need GL_BLEND with latest shader
2016-10-26 04:18:19 -04:00
a394f4e545 OpenGL: edge shader discards fragments of unused edges
Discarded edges should not update depth buffer or blend with color buffer.

Geometry shader version will make this obsolete.
2016-10-26 03:57:14 -04:00
222ba0247f fix edge shader input 2016-10-25 19:38:22 -04:00
456d145d07 OpenGL: new mesh draw routines for new viewport
Totally WIP.

Started with copies of legacy routines, modified to use the new shaders & batch cache. Not all features are implemented; this is why we keep legacy viewport around during development!
2016-10-25 19:34:17 -04:00
Dalai Felinto
821fa24876 Viewport: fix depth not being cleared in ortho mode 2016-10-25 11:18:56 +00:00
Dalai Felinto
b4f849b9c6 Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-25 11:18:41 +00:00
392551bd95 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
2016-10-25 05:31:25 -04:00
d8d42e1702 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?
2016-10-25 04:46:07 -04:00
bc566e9393 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.
2016-10-25 04:39:55 -04:00
94e14a2c43 OpenGL: new built-in shaders for mesh edges 2016-10-25 03:19:10 -04:00
c5072941c3 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.
2016-10-25 01:02:41 -04:00
Dalai Felinto
4d11b2fb91 Viewport: original gradient background
Last but not least, fix the original 3d view background based on
@merwin's comment.
2016-10-24 19:40:37 +00:00
Dalai Felinto
1458f0136d Viewport: move the background to the "modern" viewport
This also leaves room for the gradient background Mike Erwin wants to
implement.
2016-10-24 19:05:49 +00:00
Dalai Felinto
744718f635 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)
2016-10-24 17:26:27 +00:00
Dalai Felinto
a3b69c8131 Viewport: fix depth filled before solid plates 2016-10-24 12:58:23 +00:00
6388d0c4a0 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.
2016-10-24 05:06:45 -04:00
1abdb0c2ee OpenGL: add NormalMatrix & inverse to new API
Part of T49450
2016-10-23 23:37:53 -04:00
2cb45c9938 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
2016-10-23 23:22:16 -04:00
e53ab2b9ec Gawain: fixups & progress for batch API 2016-10-23 23:16:54 -04:00
Julian Eisel
dabbe6eb22 Fix memory leak when using depth-only shader 2016-10-24 00:03:55 +02:00
Julian Eisel
46257e01a7 Fix compiling with blenderplayer (once again...) 2016-10-22 00:30:28 +02:00
Dalai Felinto
5ff586610a 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
2016-10-21 20:51:12 +00:00
Dalai Felinto
deb77c0e74 Viewport: create a shader to show depth images linearized 2016-10-21 20:51:10 +00:00
Dalai Felinto
4c3624a7a0 Viewport: add missing alpha for stereo 2016-10-21 20:51:05 +00:00
Dalai Felinto
af20ca51a1 Viewport: Bring camera, speaker, rigid body shape and bounding box 2016-10-21 20:50:36 +00:00
cdcddddd96 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.
2016-10-21 16:25:17 -04:00
Dalai Felinto
01872d7f5d Fix build for gameengine 2016-10-21 12:50:04 +00:00
Dalai Felinto
dd23e52817 Merge remote-tracking branch 'origin/master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/versioning_defaults.c
2016-10-21 12:22:50 +00:00
224d70c978 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)
2016-10-20 16:55:40 -04:00
4ea6917468 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
2016-10-20 14:33:32 -04:00
c6abbb40ad 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
2016-10-20 14:29:59 -04:00
a92d20a0a4 OpenGL: dirty bit for GPU matrix API
Have matrices changed since the most recent bind?

Part of T49450
2016-10-20 14:18:34 -04:00
Dalai Felinto
225edf4e66 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
here).
2016-10-20 01:44:49 +00:00
Dalai Felinto
33d99bdfe6 immediate mode: ed_util.c
note: I switched one of the glVertex2iv into glVertex2fv to use the same attrib_id
2016-10-19 23:59:22 +00:00
9941bc3041 OpenGL: draw empties with new imm mode
Part of T49043
2016-10-19 04:01:15 -04:00
625f1a1c30 OpenGL: draw cameras using new matrix API
Also removed some extra push/pops.
Ref T49450
2016-10-18 20:57:36 -04:00
05117d71a3 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
2016-10-18 20:27:24 -04:00
54a0ff3ab5 Gawain: yet another way to set uniform color 2016-10-18 20:22:22 -04:00
e9268abf4a 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.
2016-10-18 17:34:29 -04:00
117af2356a 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.
2016-10-18 13:12:40 -04:00
46a069822a draw gpencil dots smooth
Some strokes are just single dots. Draw these smooth / antialiased.
2016-10-18 13:07:35 -04:00
827ad4125c OpenGL: new built-in shader for smooth round 3D points 2016-10-18 13:03:30 -04:00
70ff63e63f 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
2016-10-18 00:08:34 -04:00
0c6939f5f5 minor cleanup & deprecation 2016-10-17 23:48:12 -04:00
8327795f8d 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
2016-10-17 23:28:51 -04:00
Dalai Felinto
6a0292cc19 Fix for gpu_shader_2D_texture_2D_frag.glsl
Report and patch by Willian Padovani Germano (ianwill)
2016-10-17 19:24:08 +00:00
Julian Eisel
4811b2d356 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.
2016-10-17 19:28:09 +02:00
e7fddc0772 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.
2016-10-17 02:36:51 -04:00
42677fa937 Gawain: tweak tracking of unassigned attributes (no API change)
Hoping for a small performance win.
2016-10-16 23:50:18 -04:00
ca369e6f0c OpenGL: draw object centers nicer
Shaders + new immediate mode = very nice dots.

Part of T49043
2016-10-16 18:49:48 -04:00
61ca73ea10 OpenGL: new built-in shader for smooth round 3D points w/ outline 2016-10-16 18:43:24 -04:00
36d2365ac3 OpenGL: new immUniformThemeColorShadeAlpha function
Plus some naming cleanup.

Supports T49043
2016-10-16 17:48:35 -04:00
9cdf4afb76 Gawain: new immUniform4fv function 2016-10-16 17:48:35 -04:00
f7414b7412 fix IS_VIEWPORT_LEGACY macro 2016-10-16 17:48:35 -04:00
Julian Eisel
d1a35b7a08 Fix outliner items sometimes not opening
Own mistake in 9a9a663f40. 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".
2016-10-16 22:23:50 +02:00
Julian Eisel
fa39ec9e46 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 d7af7a1e04 and 8d573aa0ec
2016-10-16 20:47:44 +02:00
Julian Eisel
196654ad08 Fix crash when joining areas (caused by manipulators)
Manipulator code tried to access the removed region from handler->op_region. Use context region now.
2016-10-16 19:31:57 +02:00
Julian Eisel
69713aa2da Cleanup: Quiet warnings, use RAD2DEG macro 2016-10-16 17:28:12 +02:00
Julian Eisel
b557ceb2c1 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/space_outliner/outliner_edit.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/editors/space_outliner/outliner_select.c
2016-10-16 15:33:00 +02:00
Julian Eisel
9a9a663f40 Outliner: Rework element selection behavior
* LMB now replaces selection instead of adding to it. Shift+LMB adds to selection (or removes if already selected). This is usual selection behavior Blender.
* Outliner selection isn't completely separate from object/sequencer-strip/render-layer/... selection anymore, when selecting an outliner item we now always try to select (and activate) the object it belongs to. Previously you had to click the name or icon of an item to select the object (or whatever) and on empty space within the row to set outliner selection.
* Collapsed items may show click-able icons for their children (nothing new). Clicking on such an icon will also select the hidden item it represents now, you'll notice after opening the parent. This valid from a technical POV, I'm not sure if this is wanted from user POV though. Changing would be easy, feedback welcome!
* Code cleanup.

Part of T37430.
2016-10-16 14:29:38 +02:00
Julian Eisel
f929045c2c Outliner: Avoid rebuilding tree when mouse-hover highlight changes 2016-10-16 14:10:30 +02:00
3999910b19 OpenGL: add GLSL #version 330, drop 140 and 150
GL 3.3 is the new minimum. Compatibility profile for now, core profile eventually. During development, GL 3.0 (on Mesa) and 2.1 (on Mac) will still work.

Part of T49012
2016-10-16 03:18:17 -04:00
1deab69e0a BLF/OpenGL: more text drawing optimization
Make color values compact. Set color once per primitive. Use new immSkipAttrib to avoid useless color copies.

All of this should make text drawing less CPU hungry.
2016-10-16 02:08:16 -04:00
741965615d Gawain: new immSkipAttrib function
Now you can explicitly skip a vertex attribute -- you don't give it a value and it won't get a copy of the previous vert's value. Useful for flat interpolated per-primitive values.

This is an advanced feature. Expect garbage in the empty spaces, and copies of garbage if you rely on the attrib copy behavior after skipping.
2016-10-16 01:58:26 -04:00
a4fe823416 BLF/OpenGL: accurate vertex count for drawing
We still need to BeginAtMost instead of simple Begin, since some glyphs could be clipped & not drawn.
2016-10-15 20:04:25 -04:00
a8dc3f4596 BLF: make blurry text an optional (disabled) feature
While trying to simplify text drawing, noticed no Blender code uses the blur feature. Hopefully scripts don't use it!
2016-10-15 19:40:41 -04:00
878938f203 OpenGL: remove some unused legacy matrix calls
Part of T49450
2016-10-15 19:08:19 -04:00
3996fbc564 OpenGL: bump Windows to GL 3.3 compat profile
Part of T49012
2016-10-15 14:41:29 -04:00
cf5750a85e Gawain: improve immediate mode performance
This was already fast on Apple, but @Severin and @dfelinto noticed slowdowns in user prefs, which is text heavy.

The problem was immBeginAtMost not being smart about VBO write flushing. immBeginAtMost can use all of its allocated range or only a subrange. The previous code was forcing back-to-back draw calls and buffer writes to serialize. This commit lets OpenGL know that our VBO writes never overlap, so there's no need to wait.

Should be much faster now!
2016-10-15 14:41:29 -04:00
Julian Eisel
5e428b3b3f Fix unitialized variable use
Own mistake in ae8e845470.
Patch by @efi0ng, thanks!
2016-10-15 18:59:31 +02:00
fcff984338 Merge branch 'master' into blender2.8 2016-10-15 10:05:03 +02:00
9632ca0a13 OpenGL: draw node sockets more efficiently
1 or 2 draw calls per node instead of 1 per socket (inputs + outputs).
Rearranged draw order so we set uniforms less frequently.
Some style & dead code cleanup.

Part of T49043
2016-10-15 02:49:00 -04:00
2df27995f9 OpenGL: new built-in point shader, clean up other shader names
Smooth round point with outline (uniform color) and fill (varying color).

Updated shader naming scheme: a shader that doesn't deal with color does not have to say "no color". Vertex shaders do not have to say "uniform color" since their frag counterpart actually has the uniform. Each name should describe what that shader *does*, not what it *doesn't do*.
2016-10-15 02:30:59 -04:00
48db35468f blender 2.8: OpenGL: node_circle_draw use now immediate mode
I use your new point shader to draw the node's soket

Reviewers: Severin, merwin

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2286
2016-10-15 00:14:28 -04:00
29b47924dd OpenGL: bump Linux to GL 3.3 compat profile
fall back to 3.0 if needed (during development)

Part of T49012
2016-10-14 23:42:45 -04:00
4f4c7808e4 fix pointer type warning
thanks, gcc
2016-10-14 22:40:55 -04:00
Julian Eisel
325b21c1d5 Outliner: Fix missing indentation for search-match highlight
Own mistake in ae8e845470.
2016-10-15 02:08:38 +02:00
4736f19000 BLF: early exit when drawing empty strings
Avoids all kinds of setup & preparations to draw nothing.
2016-10-14 20:00:31 -04:00
3f0c0ed87d BLF: fix crash on text input fields
Some strings have known length, others are NULL terminated (len = INT_MAX in this case).

Now font drawing knows to treat INT_MAX special.
2016-10-14 20:00:31 -04:00
Julian Eisel
9904d73d9a Outliner: Draw highlights over entire row
Previously, highlights (mouse hover, selection, search-match) didn't affect background of restriction icons, now the entire line gets highlighted.
2016-10-15 01:38:44 +02:00
Julian Eisel
ae8e845470 Outliner: Element mouse hover feedback
Some little UI polish to get familiar with outliner code (but also because it's a useful feature). Committing to blender2.8 branch but can also port to master (2.7) if wanted.

This basically causes the mouse hovered element to be highlighted. Contrast of the highlight should be fine, even with a non-default theme. Also did some minor cleanup.
2016-10-15 01:03:25 +02:00
Dalai Felinto
ee54a6f130 viewport: draw non-mesh objects for a starter
This starts to decouple non-mesh objects and the legacy draw pipeline.
It shows how we can mix e.g., Cycles and lamps and empties.
2016-10-14 19:00:59 +00:00
Dalai Felinto
608e2402ef viewport: move border drawing code to new file 2016-10-14 19:00:45 +00:00
Dalai Felinto
4a10eb38a3 immediate mode: convert render border code and move to new drawing
routine
2016-10-14 19:00:32 +00:00
Dalai Felinto
e1e97bbb98 Immediate mode: use new util functions, and border draw functions
Part of T49043

Reviewers: merwin
2016-10-14 18:58:58 +00:00
Dalai Felinto
11653f85ff Immediate mode: new util functions (imm_cpack and imm_draw_line_box) 2016-10-14 18:57:38 +00:00
34dc660a76 OpenGL: draw text with fewer draw calls
Was one draw call per glyph,  now one per line.

Still room for improvement here.
2016-10-14 14:41:36 -04:00
dd350c0b37 GPencil: Avoid assert error if the immEnd is called with only one point for lines
This function will be replace by geometry shader, but we need this fix until the shader will be ready. The problem is similar to T49614.
2016-10-14 19:24:27 +02:00
6855ba4034 Fix T49614: Grease Pencil GPF error if stroke thickness change too much between stroke points
The problem was the function tried to draw a line with one point only. This fix will be replaced by new geometry shaders, but we need while this change is not ready.
2016-10-14 18:35:01 +02:00
f23db59e48 GPencil: Display stroke filling while drawing
Before this change, the stroke was filled only after complete the stroke drawing. For artist is better to get a feedback of the area he is filling while drawing, so this commit draws the filling area while drawing.

The triangulation of the stroke is recalculated every time the function is called because using a cache is not useful because the points information is changing all the time while the stroke is being drawing.
2016-10-14 12:06:30 +02:00
Dalai Felinto
58f0af965c viewport: fix rv3d->viewport mem free issue 2016-10-14 05:17:55 +00:00
Dalai Felinto
3cecf39069 immediate mode: starting using new immUniformThemeColorBlendShade and more conversion 2016-10-13 20:08:52 +00:00
Dalai Felinto
05cf74622f more theme color functions: UI_GetThemeColorBlendShade4fv, immUniformThemeColorBlendShade 2016-10-13 20:08:51 +00:00
945f8e3f93 Gawain: vertex format now uses fixed allocations (CPU perf++)
API stays exactly the same.

Attribute names can still be of variable length, as long as the average length does not exceed AVG_VERTEX_ATTRIB_NAME_LEN. Since this includes unused attributes (length = 0) the current avg of 5 might even be too high.
2016-10-13 15:15:40 -04:00
Dalai Felinto
dfa5b32c8c Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-13 16:42:54 +00:00
Dalai Felinto
ecbedce81e viewport: barebones to handle viewport compositing in gpu_viewport.c 2016-10-13 16:26:29 +00:00
14d0549295 Gawain: fix build when TRUST_NO_ONE is disabled 2016-10-13 12:24:01 -04:00
Julian Eisel
916e631fc9 Fix compiling with Blenderplayer 2016-10-13 17:17:17 +02:00
Dalai Felinto
3579350481 immediate mode: small cleanup on timeline
(no need to unbind/rebind the same program)
2016-10-13 14:18:47 +00:00
6f220c1c55 inform immediate mode when switching OpenGL context
Longstanding to-do is now to-done.

Heinous bug reported by @dfelinto pushed me to fix this.
2016-10-13 00:38:29 -04:00
71656ac222 Gawain: fix immediate mode for multiple GL contexts
New functions activate & deactivate immediate mode. Call these when switching context and the internal VAO will be handled properly. VAOs are one of the few things *not* shared between OpenGL contexts.
2016-10-13 00:38:29 -04:00
Dalai Felinto
d5b75256e0 Fix for crash on dopesheet drawing with immediate mode (rB7a552612c) 2016-10-13 04:23:58 +00:00
Dalai Felinto
c565f7b5fd viewport: bring the manipulators 2016-10-13 02:50:42 +00:00
Dalai Felinto
165bdfb672 Fix timeline break after recent immediate mode change (rBf6e7e46f) 2016-10-13 02:19:04 +00:00
Dalai Felinto
b5c539f9fa gawain: assert for immBeginAtMost(..., 0) 2016-10-13 02:16:55 +00:00
Dalai Felinto
84ed9d9829 Draw depth even when in wire mode (for OB_RENDER)
Note: this is not working at the moment, but the logic is sound.
Since we will still change the drawing code a lot I think the commit is valid.
2016-10-13 00:36:58 +00:00
Dalai Felinto
69b1b95356 immediate mode: use new ThemeColor functions 2016-10-13 00:36:56 +00:00
Dalai Felinto
e79f302f16 gawain/immediate mode: new util functions for color uniforms 2016-10-13 00:36:52 +00:00
Dalai Felinto
f6e7e46fac Immediate mode: timeline (keyframes and range)
Part of T49043
2016-10-12 22:36:54 +00:00
683656681c BLF/OpenGL: use new matrix API when drawing text
First test of matrix API. This will eventually use the 2D part of this API, but the 3D part is ready now.

Part of T49450
2016-10-11 21:21:02 -04:00
06d4aca879 OpenGL: matrix fixes & compatibility
Was multiplying matrices backward, so concatenation was broken. Fixed!

Also a way to mix legacy matrix stacks with the new library. Just during the transition! Anything within SUPPORT_LEGACY_MATRIX will go away after we switch to core profile.

Part of T49450
2016-10-11 21:16:26 -04:00
c330f37135 quiet GPU matrix debug printing
Will be needed soon but turn it off by default.
Part of T49450
2016-10-11 14:44:12 -04:00
53d82c3e8d BLF/OpenGL: draw text with new immediate mode
Part of T49043
2016-10-11 14:36:16 -04:00
2fe7e70e92 install_deps: make c++11 building mandatory on blender2.8 branch. 2016-10-11 12:19:04 +02:00
0c43567a5a Merge branch 'master' into blender2.8 2016-10-11 12:09:59 +02:00
587a16352a Gawain: add immRect utility functions (replaces legacy glRect)
Caller is responsible for setting up vertex format, binding a shader program, and setting the color *before* calling immRect.
2016-10-10 12:31:38 -04:00
6371f8ff8a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/space_view3d/view3d_draw.c
2016-10-10 12:41:32 +02:00
ecbad54df9 blender 2.8; OpenGL. ui_panel_category_draw_tab with immediate API
Reviewers: dfelinto, Severin, merwin

Reviewed By: merwin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2281
2016-10-10 01:41:31 -04:00
22f59b81d7 OpenGL: remove GLSL support query (it's always supported) 2016-10-10 01:13:03 -04:00
78abbdf264 remove call to GLSL support query (it's always supported)
Reworked logic in the one place that still called this. Deleted the "GLSL not supported" fallback.
2016-10-10 01:11:03 -04:00
5fc9bed8b3 BGE: remove calls to GLSL support query (it's always supported)
Reworked logic in the few places that still called this. Deleted the "GLSL not supported" fallbacks.

Also removed some nearby checks for ARB_multitexture and OpenGL 1.1. Blender 2.77 removed checks like this, but game engine still has some.
2016-10-10 01:08:49 -04:00
7a60f889d3 OpenGL: plug new matrix system into shaders (WIP)
Built-in shaders now use uniforms instead of legacy built-in matrices. So far I only hooked this up for new immediate mode.

We use the same matrix naming convention as OpenGL, but without the gl_ prefix, e.g. gl_ModelView becomes ModelView.

Right now it can skip the new matrix stack and use the legacy built-in matrices app-side. This will help us transition gradually from glMatrix functions to gpuMatrix functions.

Still some work to do in gpuBindMatrices. See TODO comments in gpu_matrix.c for specifics.
2016-10-09 23:03:35 -04:00
e636529e33 OpenGL: Draw dividers in space_file with the new immediate mode
Thanks to @merwin for the review

Part of T49043
2016-10-09 18:20:52 +02:00
99db1b8d95 fix shaders for picky GLSL compilers
@zeauro reported this issue:
texture2DRect needs the ARB_texture_rectangle extension.
But isn't that an OpenGL 2.1 feature and should be part of GLSL 1.2+?

This should fix it, and future shaders should do something similar.
2016-10-09 10:53:03 -04:00
a2471d2b37 Gawain: validate inputs to add_attrib
Should help prevent errors when building vertex formats.
2016-10-08 16:58:06 -04:00
187d8f473a OpenGL: fix smooth point fringe
Smooth edge was fading to transparent black instead of transparent color. My bad.
2016-10-08 03:34:05 -04:00
7a552612c3 OpenGL: draw f-curve points and handles with new imm mode
Got rid of GLU and some matrix manipulation. Everything is shader driven now, drawn with point sprites.

Still plenty to do in this file...

Part of T49042 and T49043
2016-10-08 03:27:02 -04:00
25e4dc45e5 OpenGL: shaders for smooth round points
Solid color with an optional outline.

size (diameter) and outlineWidth are in pixels.
2016-10-08 03:11:53 -04:00
b071ac315c Gawain: allow immBeginAtMost, immEnd with no vertices
The whole point of BeginAtMost is to avoid counting before drawing. Sometimes the uncounted count is zero, and that's ok!
2016-10-07 23:50:52 -04:00
2a76da9ec2 draw region emboss with new immediate mode
Simple convert of drawing emboss lines to new immediate mode.

Part of T49043

Reviewers: merwin

Reviewed By: merwin

Subscribers: dfelinto

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D2271
2016-10-07 23:46:52 -04:00
a398cdedfa Gawain: code cleanup & inline docs
Made function categories more clear & added more notes about how to use this API.

immEndVertex is no longer part of the public API.

Minor cleanup & organizing of recent additions.
2016-10-07 18:51:42 -04:00
b613d25354 Blender 2.8: OpenGL: replace old GL with the new immediate API in UI_draw_roundbox_gl_mode
I change UI_draw_roundbox_gl_mode to use immediate API.
The rest of the change is the call to the function.
I also make some change in UI_ThemeColor4(int colorid) for eg to make convenience to use.
I would really like to know if it's the good way to do, if yes I will make all the change in the node_daw.c after, else say me what's wrong and how to deal with color else.

Reviewers: merwin, dfelinto, Severin

Reviewed By: merwin

Subscribers: fablefox, Severin

Tags: #bf_blender_2.8, #opengl_gfx

Maniphest Tasks: T49043

Differential Revision: https://developer.blender.org/D2274
2016-10-07 15:03:21 -04:00
5c23b863f8 fix grid floor drawing assert
@dfelinto reported crash when setting grid subdivisions too low.

Code was setting color twice and Gawain was catching this. Fix is to only set regular grid color when we have regular grid lines to draw.  Then emphasized grid lines are free to set their own color further down.
2016-10-07 13:00:23 -04:00
Julian Eisel
6e358a1d06 Custom Manipulators Core Backend
This commit lands the core backend of the Custom Manipulators project onto the blender2.8 branch. It is a generic backend for managinig interactive on-screen controls that can be integrated into any 2D or 3D edito. It's also already integrated into the window-manager and editor code where needed.

NOTE: The changes here should not be visible for users at all. It's really just a back-end patch. Neither does this include any RNA or Python integration.

Of course, there's still lots of work ahead for custom manipulators, but this is a big milestone. WIP code that actually uses this backend can be found in the 'custom-manipulators' branch (previously called 'wiggly-widgets').

The work here isn't completely my own, all the initial work was done by @Antony Riakiotakis (psy-fi) and - although it has changed a lot since them - it's still the same in essence. He definitely deserves a big credit! Some changes in this patch were also done by @Campbell Barton (campbellbarton). Thank you guys!

Merge accepted by @brecht and @merwin.
Patch: https://developer.blender.org/D2232
Code documentation: https://wiki.blender.org/index.php/Dev:2.8/Source/Custom_Manipulator
Main task: https://developer.blender.org/T47343
More info: https://code.blender.org/2015/09/the-custom-manipulator-project-widget-project/
2016-10-07 16:59:55 +02:00
Julian Eisel
53d1dbbe5c Merge branch 'master' into blender2.8 2016-10-07 15:14:49 +02:00
4639664b3c Merge branch 'master' into blender2.8 2016-10-07 11:50:17 +02:00
107b585a41 OpenGL/gpencil: delete unused utility functions
Part of T49043  -- done with this file!
2016-10-07 03:17:23 -04:00
9d40c3dc32 OpenGL: draw gpencil fill with new imm mode
Part of T49043
2016-10-07 03:04:34 -04:00
1865bcd3cf OpenGL: draw 2D gpencil strokes with new imm mode
Part of T49043
2016-10-07 00:56:28 -04:00
1f6d704008 OpenGL: draw 3D gpencil strokes with new imm mode
Part of T49043
2016-10-07 00:06:20 -04:00
0fbe35c674 OpenGL: fix shader input typo 2016-10-07 00:00:12 -04:00
70a16298ea gpencil: disable / remove some legacy drawing
Want to avoid updating code we no longer use anyway.

Comments for areas to investigate or deadlines for deletion.

also some minor bool cleanup

Part of T49165
2016-10-06 22:05:28 -04:00
Julian Eisel
fc77787f6f Avoid possible compatibility issues with tmp viewport flags
We can't prevent users from using this branch, so I'd say it's reasonable to be a bit careful about what we store to files. In this concrete case we were storing a bit-flag for temporary use (only during early viewport transition) in a bit-field that's saved in files. Doing so would mean we either can't reuse this bit later or we risk breaking files (admittedly, likely in a pretty minor way). Moved the bit-flag to a new bit-field which can be removed later.
2016-10-07 03:56:32 +02:00
Dalai Felinto
49beb714c5 Viewport: support for external render engines (e.g., Cycles) with depth
(it is still a rough approach, but you can already see Cycles with Floor (when using board render or full render)
2016-10-07 01:47:30 +00:00
Dalai Felinto
4539c2b173 Viewport: floor cleanup 2016-10-07 01:47:30 +00:00
Dalai Felinto
82d069c232 Viewport: draw floor routine should not use GL_ALWAYS for depth
(talked with merwin about that, and he agrees on it, we are not supposed to write to the scene depth buffer
but we should read its depth)
2016-10-07 01:47:30 +00:00
Julian Eisel
490a938c8b Move panel for new viewport up
Makes it easier to enable it and avoids jumping of the panel when activating/deactivating it (because some panels disappear then). Also changed how panel title is drawn to make it behave like other panels.
2016-10-07 03:22:48 +02:00
Julian Eisel
1997b0f03c Use theme color for clearing viewport background
We'll obviously do more fancy stuff here later, but we don't have to look at pure blackness either ;)
2016-10-07 03:11:08 +02:00
1b4b4dfd0c OpenGL/GPencil: draw stroke-in-progress with new imm mode
We should revisit this later and use geometry shader to draw one continuous tapered stroke.

Part of T49043
2016-10-06 20:51:31 -04:00
fe654a93c7 Gawain: allow strips of 1 line, fans of 1 triangle
My initial tests were stricter than necessary, and blocked some valid uses. Fixed!
2016-10-06 20:51:31 -04:00
e01b1eac84 cleanup: C99, const, blank lines 2016-10-06 20:51:30 -04:00
Julian Eisel
553b4faac8 Merge branch 'master' into blender2.8 2016-10-07 00:22:21 +02:00
ffc46668c4 OpenGL: modernize gp_draw_strokes_edit
Single draw call per stroke!

Part of T49043
2016-10-06 17:41:23 -04:00
Dalai Felinto
ea89b4a918 Viewport: bring grid over to the new viewport
We will keep the old system working as long as we can. At the moment even the visibility flags we are getting from the old system. That will continue like this until we have decided on the new UI
2016-10-06 20:35:41 +00:00
Dalai Felinto
6b88f3118f Viewport: Starting to port over the principles of the draw flux into placeholder functions
A lot of the work still have to done on space_view3d.c for initialize the data and buffers properly, but it is a start
2016-10-06 20:35:40 +00:00
198e3a35c8 OpenGL: another built-in shader for 2D points
GPU_SHADER_2D_POINT_VARYING_SIZE_VARYING_COLOR
2016-10-06 16:32:02 -04:00
86e439e311 OpenGL: convert gp_draw_stroke_point to new immediate mode
and constify some static utility functions

Note: 2D shader will ignore position's z value, but making pos a vec3 lets us unify code in this function.
2016-10-06 14:40:47 -04:00
edcce96d97 OpenGL: more built-in GPU_SHADERs for points
No new GLSL shaders were needed! Just combined existing vertex & fragment shaders in new ways.
2016-10-06 14:20:33 -04:00
360cb87007 OpenGL: modernize more volumetric gpencil drawing
Main goal is to get rid of GLU.

Part of T49042, touches on T49043 and T49450
2016-10-06 12:45:04 -04:00
e86bd78745 Gawain: more ways to set uniform color 2016-10-06 09:37:04 -04:00
1731e94d0c draw gpencil erase cursor with new imm mode
Part of T49043 and T49450.
2016-10-05 14:05:55 -04:00
e874f3cdc5 draw gpencil sculpt cursor with new imm mode
Part of T49043 and T49450.
2016-10-05 13:45:28 -04:00
c462500618 Gawain: more ways to set uniform color 2016-10-05 13:12:18 -04:00
Dalai Felinto
5e8c4ae75b Barebones for viewport code apart from 2.7x drawing code
A new option (set in the properties region) allows the user to pick the
"new viewport" for the rendering  (in the UI: Modern Viewport).

For now we have a semi-blank file (view3d_draw.c) that can starts to take
over the drawing pipeline.

I can't guarantee we will be able to keep both drawing systems working
through the entire 2.8 development, but it should do for now.

also, we can use branches for some of the viewport development, but it's
better to keep things in 2.8 whenever we can, so people can test it.
2016-10-04 22:02:05 +00:00
3a4c1db14b fix Linux build
My mistake. Breakage reported by @mont29
2016-10-04 01:31:24 -04:00
79b8242fd1 Gawain: fix bug in immUniformColor4ubv
Reported by @kgeogeo
2016-10-04 01:24:33 -04:00
Dalai Felinto
ae44e24fed Merge remote-tracking branch 'origin/master' into blender2.8 2016-10-03 20:54:22 +00:00
55aadccbde Merge branch 'master' into blender2.8 2016-10-03 20:48:00 +02:00
72473a61b0 Fix compile errors with Alembic. 2016-10-02 20:52:25 +02:00
c50ccc8476 Merge branch 'master' into blender2.8 2016-10-02 18:53:01 +02:00
ba30b852f3 OpenGL: draw volumetric gpencil with point sprites
Transition away from GLU and legacy matrix stack. Using point sprites eliminated the need for most of the matrix math!

Depends on decent support of large aliased points. NVIDIA is good at this, must test limits on AMD & Intel systems.

Still needs proper scaling based on view zoom.

Part of T49042, touches on T49043 and T49450.
2016-10-01 18:11:58 -04:00
b8e3d81f31 OpenGL: fix point sprites
Apparently GL_POINT_SPRITE is important to GL 3.2+ compatibility profile, not just to GL 2.1 as thought.

We'll remove this during the core profile transition.
2016-10-01 17:34:41 -04:00
875d63ccb5 OpenGL: one more point shader
Added a built-in shader for points that vary both size and color.
2016-10-01 17:32:29 -04:00
5753a1462f OpenGL: new built-in shaders for drawing points
Both of these draw round points with jaggy edges, but treat color & size differently.
2016-09-30 20:44:22 -04:00
d1b21d1278 OpenGL: add support for programmable point size
And enable point sprites always. Fragment shaders can use gl_PointCoord now.
2016-09-30 19:51:04 -04:00
82648a8f91 OpenGL: make platform requirements explicit
At context startup, make sure our assumptions about the OpenGL version are true. Should match since we set up the contexts... but this is what asserts are for, to check "should"s!

Part of T49012
2016-09-30 19:10:30 -04:00
Julian Eisel
42ed1f0e3c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/writefile.c
2016-09-30 01:18:41 +02:00
47bba7e15f OpenGL: draw nurbs control verts with new imm mode
patch P397 by @lichtwert + minor const by @merwin

Notes from drawvertsN function:
this used to be called twice (once for selected/active, once for unselected -- guess: to avoid state switches[color]?)
this used to be called in a loop, too (subcurves), moved the loop here to avoid multiple init stuff

Part of T49043
2016-09-29 15:23:13 -04:00
Julian Eisel
35bd833e02 Cleanup: Style 2016-09-29 21:15:27 +02:00
bbf32980b0 OpenGL: draw speaker with new immediate mode
patch P388 by @lichtwerk, I tweaked a few things.

Since speaker theme color is opaque we leave blend mode alone.

Part of T49043
2016-09-29 14:47:38 -04:00
Dalai Felinto
9bac74c27b Complement fixup for 4a1feaa555 (texture shaders)
We now multiply the alpha by the image alpha (as per severin
suggestion).
That still doesn't solve the main question of user preference drawing
black.
2016-09-28 19:11:11 +00:00
Dalai Felinto
4c7ff8fb1e Fix animation transition in region overlay not working since 4a1feaa5
We still have stills with the User Preference window, though.
2016-09-28 18:48:51 +00:00
83d5a919e2 modernize basic shader a tiny bit
"varying" is redundant here, all GS inputs & outputs vary.

Any code that uses this will be GLSL 1.3 or newer.
2016-09-27 21:25:38 +02:00
0ca2118851 safety checks in GPU shader library
If shader compilation fails, or for some other reason the shader is NULL or 0, we need to know.
2016-09-27 21:25:38 +02:00
ad32b774cb fix basic shader syntax when drawing lines
Fixed on GL 3.2+, Mac still lays an egg due to the geometry shader.
2016-09-27 21:05:48 +02:00
Julian Eisel
88aa42a6f7 Fix most toolbar panels not visible
Was likely in here since initial blender2.8 branch commit (particle removal).
2016-09-27 03:38:24 +02:00
Dalai Felinto
fc485302cc immediate mode: using texture shader for stereo drawing
(for side-by-side and top-bottom stereo modes)
2016-09-26 15:38:24 +00:00
8cff9c20ff Merge branch 'master' into blender2.8
WARNING! Full build is broken, alembic has not been merged in correctly and has some references to particle stuff.
Don't have time to tackle this now (and probably would be better if someone knowing what he's doing does it anyway).

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/editors/physics/particle_object.c
	source/blender/editors/physics/physics_intern.h
	source/blender/editors/physics/physics_ops.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/editors/space_view3d/drawvolume.c
	source/blender/makesrna/intern/rna_smoke.c
2016-09-26 17:19:03 +02:00
628ef78e8a overhaul gpuMatrix API
Complete (for our needs) 2D & 3D transformation API. Should be easy to port legacy OpenGL matrix stack-based code to this. Still needs testing.

Ported ortho, frustum, lookAt functions from Viewport FX (rB194998766c65). Kept plenty of Viewport FX code from previous commit.

Stack API and 2D routines ported from Gawain. This version uses BLI_math library so everything is licensed under GPL instead of the usual MPL.

Part of T49450
2016-09-25 19:29:45 +02:00
a731c75442 port math function from Viewport FX
mul_v4_m4v3(r, M, v) means r = M * vec4(v, 1.0)
Based on rB194998766c65
2016-09-25 19:01:18 +02:00
9bea012b8c specialize mat3 multiply routines
Same as 5c6baf1ee9 but for 3x3 matrices.
2016-09-25 18:48:11 +02:00
5c6baf1ee9 specialize mat4 multiply routines
mul_m4_m4m4(R, A, B) gives us R = AB in general. Existing code assumed the worst, that A and B both alias the output R. For safety it makes internal copies of A and B before calculating & writing R.

This is the least common case. Usually all 3 matrices differ. Often we see M = AM or M = MB, but never M = MM.

With this revision mul_m4_m4m4 is called in exactly the same way but copies inputs only when needed. If you know the inputs are independent of the output use the "uniq" variant to skip the saftety checks.
2016-09-25 14:27:48 +02:00
addc666999 constify BLI_math_matrix inputs
GPU_matrix needs this very soon, and it's good practice in general.

also sprinkled in some TODOs for later
2016-09-24 16:21:38 +02:00
36bbdf142c OpenGL: fix new shader for Mac
Follow-up to rB4a1feaa5558ed60388fd3be41db74fbc54f2ab08
2016-09-23 18:16:45 +02:00
7fc2e333bb small merge fix
Follow-up to rB1dfb89d22930
2016-09-23 18:12:24 +02:00
Julian Eisel
1dfb89d229 Merge branch 'master' into blender2.8
Conflicts:
	intern/ghost/intern/GHOST_ContextCGL.mm
	intern/ghost/intern/GHOST_WindowCocoa.mm
	source/blender/makesrna/intern/rna_main.c
2016-09-23 01:40:19 +02:00
Dalai Felinto
4a1feaa555 immediate mode: Triple Buffer and two new shaders for TEXTURE_2D and TEXTURE_RECT
Use the same vertex shader for both fragment shaders
2016-09-22 13:40:33 +00:00
1d469f3780 OpenGL: remove double precision matrix functions
Proper fp64 is a GL 4.x feature. Pretending to support it in our API is just clutter.
2016-09-22 12:19:24 +02:00
0e7c3dfe75 OpenGL: matrix code from viewport-fx
Bringing over whole files from rB194998766c65
2016-09-22 12:11:40 +02:00
825150605e GPU_basic_shader uses GLSL by default
switch back to old mode at runtime:
blender --enable-legacy-basic-shader
2016-09-21 20:24:02 +02:00
9047717b3f Gawain: support triangle strips & fans in immediate mode
fixes crash in Vertex Paint (color picker)
2016-09-21 15:47:08 +02:00
0f759da370 Gawain: batch drawing works
Forgot to tell OpenGL which shader program the batch is using. Now it works!
2016-09-20 18:03:59 +02:00
Dalai Felinto
284398e517 immediate mode refactor: walk navigation cross 2016-09-20 14:50:24 +00:00
Dalai Felinto
04bc828fb6 gawain update: immAttribute for 2i 2016-09-20 14:50:20 +00:00
Dalai Felinto
6ebf5c18c3 immediate mode refactor: fly navigation square 2016-09-20 14:47:14 +00:00
d3365c5c72 OpenGL: fix GPU_SHADER_TEXT on non-Mac
Developed on Mac and committed quickly.. oops
2016-09-20 16:13:01 +02:00
Julian Eisel
42ad5952ff Quiet warning with -Wformat-signedness
Is actually a redundant cast since Blender uses -funsigned-char, however I think it's fine to be explicit about it in new code so cast is required to make compiler happy. Am not a fan of -funsigned-char anyway...
2016-09-20 14:23:15 +02:00
34bd89a9f6 OpenGL: draw_view_axis with new immediate mode
Changed drawing to use smooth lines, and to fade away when axis points toward / away from screen. (transform manipulators do this already)

Also fixed a nearby (but unrelated) missing immUnbindProgram.

Part of T49043
2016-09-17 15:52:32 +02:00
e21853abb9 OpenGL: streamline font rendering
Ignore texture matrix in the shader, stop messing with texture matrix in BLF code.

Use linear screen-space interpolation instead of perspective.

Avoid redundant call to glMatrixMode.
2016-09-17 13:54:30 +02:00
1b1275f0db add GPU_SHADER_TEXT for font rendering
With USE_GLSL enabled, GPU_basic_shader(TEXTURE|COLOR) always rendered black. New shader uses a solid color + alpha channel of texture (which in our case is a font glyph). See fragment shader for details.

I prefer this approah -- multiple shaders that each do one thing well (and are easy to read/write/understand), instead of one shader that can do many things given the right options.
2016-09-17 13:33:48 +02:00
c3034afa58 OpenGL: simplify basic_shader_bind
No need to enable/disable texturing with GLSL, just use textures in the fragment shader.
2016-09-17 13:33:48 +02:00
834cb93f40 Blender 2.8: Fix some strict aspects on Linux 2016-09-16 17:18:19 +02:00
d96b8e168f Merge branch 'master' into blender2.8 2016-09-16 17:09:28 +02:00
76c99f361f Gawain improvements
Fixed compile error in debug build (thanks mont29)

Renamed some functions for consistency.

New features:

Create a Batch with immediate mode! Just use immBeginBatch instead of immBegin. You can keep the result and draw it as many times as you like. This partially replaces the need for display lists.

Copy a VertexFormat, and create a VertexBuffer using an existing format.

Resize a VertexBuffer to a different number of vertices. (can only resize BEFORE using it to draw)
2016-09-15 21:45:10 +02:00
5eddb80513 Extend Gawain to use Blender's built-in shaders
Was already done for immediate mode, but rearranged code to make a clean separation. Cleaned up #includes for code that uses this feature.

Added same for batched rendering.
2016-09-15 18:41:28 +02:00
39f7a81176 Gawain: batch rendering API
Follow-up to rBddb1d5648dbd

API is nearly complete but untested.

1) create batch with vertex buffer & optional index buffer
2) choose shader program
3) draw!
2016-09-15 16:51:10 +02:00
0d54d32dd6 Gawain: simplify attrib binding API
This API is used internally by the immediate and batch drawing systems.
2016-09-15 12:57:07 +02:00
2fb5a959e9 Gawain: delete bind_attrib_locations
This function modifies the GL program object, which reduces our ability to share a shader among meshes with different vertex formats. Recommended approach is to use get_attrib_locations.
2016-09-15 12:24:06 +02:00
110d68ca1d Gawain: flesh out VertexBuffer
create, specify, fill with data
2016-09-14 16:29:01 +02:00
df7be04ca6 fix Mac build with Xcode 8
Small issues in GHOST
- use NSApplicationDelegate protocol for our app delegate
- make sure NSApp is initialized before using
2016-09-14 16:29:01 +02:00
54b00657ca Gawain: fix Windows compile error
MSVC was NOT happy about uint64_t, now it is.
2016-09-13 03:21:16 -04:00
1b5b899228 OpenGL: add built-in GPU_SHADER_3D_DEPTH_ONLY
We’re discussing several techniques that require a depth pre-pass.
2016-09-13 02:51:38 -04:00
ddb1d5648d Gawain: geometry batches (unfinished)
Vertex Buffer to store vertex attribute data.
Element List (AKA Index Buffer) to select which vertices to use.
Batch combines these into an object that can be built once then drawn
many times.

Porting over from the C++ version… Most of this C code is compiled but
unused. Some of it is not even compiled. Committing now in case I’m
lost at sea.
2016-09-13 02:41:43 -04:00
b6bd299359 Gawain: reorganize source code
Put Gawain source code in a subfolder to make the boundary between the
library and the rest of Blender clear.

Changed Gawain’s license from Apache to Mozilla Public License. Has
more essence of copyleft — closer to GPL but not as restrictive.

Split immediate.c into several files so parts can be reused (adding
more files soon…)
2016-09-13 02:18:33 -04:00
18d49a8283 Gawain: add immBeginAtMost
immBegin requires us to know how many vertices will be drawn. Most times this is fine, but sometimes it can be tricky. Do we make the effort to count everything in one pass, then draw it in a second?

immBeginAtMost makes this simple. Example: I'll draw at most 100 vertices. Supply only 6 verts and it draws only 6.

Any unused space is reclaimed and given to the next immBegin.
2016-09-06 16:56:08 -04:00
031c5bad87 Gawain: fix GL_POINTS in immediate mode
Was using GL_NONE to mean "no primitive" but GL_NONE and GL_POINTS are both defined as 0x0000.

Introducing PRIM_NONE = 0xF which does not clash with any primitive types.
2016-09-06 15:45:10 -04:00
3c29aad787 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_particles.cpp
	source/blender/blenkernel/intern/particle.c
	source/blender/gpu/intern/gpu_shader.c
2016-09-04 16:41:06 +02:00
498583844f OpenGL: use new uniform color functions
Color picker code motivated these convenience functions. looks much better now.
2016-08-27 14:14:01 -04:00
9d3813e602 Gawain: convenience functions for uniform color
Application code can pass ubytes, Gawain converts to float vec4 expected by shader.

For now the conversion is simple linear. We can add sRGB support later if needed.
2016-08-27 14:10:37 -04:00
42bbfe7f0a OpenGL: draw grid floor & axes with new immediate mode
Significant rewrite with some improvements.

Maintain visual hierarchy of the grid:
- emphasized lines draw atop normal lines
- axes draw atop all lines (same as before)

Draw axes only once, not twice.

Return early if nothing to draw.

Single draw call for the default case (grid floor with X and Y axes).

Z axis needs a second draw call because it uses 3D coordinates.

Part of T49043
2016-08-26 01:12:44 -04:00
060bf1bd28 OpenGL: draw empties without GLU
Also reduced number of matrix ops by generating final positions directly.

Also removed a display list (deprecated in modern GL).

Tried to reuse sinval & cosval tables but those values are skewed (last value repeats first value, middle values are squished to compensate). Went with sinf & cosf instead.

Part of T49042
2016-08-25 13:45:39 -04:00
da36b447c7 OpenGL: de-GLU the transform manipulator
Part of T49042

Also reduced the number of matrix ops.

TODO: replace glBegin/glVertex with new immediate mode
2016-08-24 23:47:45 -04:00
1fc1fd8372 OpenGL: draw area resize handle with new immediate mode
The little grabby handle in the corner of an area. Now uses 1 draw call
instead of 6.

Also one version of the (+) icon to show a hidden region. Why do we
have multiple versions of this?

Fixed a harmless signed/unsigned error.

Fixed a GL state error that prematurely disabled blending.

Added imm_draw_filled_circle function, which can be used for drawing
other widgets.

Work toward T49042 and T49043
2016-08-22 23:39:42 -04:00
069569f820 Merge branch 'master' into blender2.8
In addition to pack of conflicts listed below, also had to comment out particle part of new Alembic code... :/

Conflicts:
	intern/ghost/intern/GHOST_WindowWin32.cpp
	source/blender/blenkernel/BKE_effect.h
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/effect.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenkernel/intern/pointcache.c
	source/blender/blenkernel/intern/rigidbody.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/blenkernel/intern/softbody.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/gpu/intern/gpu_debug.c
	source/blender/makesdna/DNA_object_types.h
	source/blender/makesrna/intern/rna_particle.c
2016-08-21 13:18:26 +02:00
be2bc7e0f6 OpenGL: draw color picker wheel with new immediate mode
Includes new imm_draw_lined_circle function that can be used for other
widgets.

Part of T49043
2016-08-20 15:40:08 -04:00
eb717ee979 Gawain: more immediate mode functions
Scanned Blender code for commonly used glVertex, glColor functions.
Implemented immVertex, immAttrib versions of these to ease transition
away from legacy OpenGL.
2016-08-20 15:09:32 -04:00
1e6b3ef1a1 cleanup: unused OpenGL utility code
Keeping unused gla2D code because it might be useful, or inspire
something useful, for Blender 2.8 development.

Also removed an old Mac driver bug workaround. Disabled this before the
2.77 release and nobody has complained.
2016-08-20 13:57:17 -04:00
7e02d335c0 OpenGL: don't poll for errors, rely on KHR_debug
Errors are caught & reported by our GL debug callback. This gives us way more useful information than sporadic calls to glGetError.

I removed almost all use of glGetError, including our own GPU_ASSERT_NO_GL_ERRORS and GPU_CHECK_ERRORS_AROUND macros.

Still used in rna_Image_gl_load because it passes unvalidated input to OpenGL functions.

Still used in gpu_state_print_fl_ex as an exception handling hack -- will rewrite this soon.

The optimism embodied by this commit will not prevent OpenGL errors. We need to analyze what would cause GL to fail at certain points and proactively intercept these failures. Or guarantee they can't happen.
2016-08-19 00:52:52 -04:00
d8f036efd6 OpenGL: draw NDOF guide with new immediate mode
This is the rotation pivot guide for 3D mouse input.

Work toward T49043
2016-08-16 21:54:50 -04:00
6b34eed217 Gawain: add v functions to immediate mode
Legacy OpenGL has a matching Vertex3fv for every Vertex3f, and so on. Add something similar to Gawain, just for a few common functions. Might add more as the need arises.
2016-08-16 21:45:17 -04:00
b92d76000d fix #includes for GPU debug
Can now build release and debug.

Close to final version in master (which took several commits).
2016-08-16 17:14:42 -04:00
b8f27b2514 OpenGL: shaders for simple 3D drawing
These are intended for very simple drawing. No lighting etc.

Shares some fragment code with the 2D shaders.

Similar to their 2D counterparts, but are not combined because of
future plans for separate 2D & 3D matrix stacks.
2016-08-16 14:58:53 -04:00
8619e09107 OpenGL: tweak legacy 2D shader
EXT_gpu_shader4 lets us say “noperspective” in GLSL #version 120 just
like in later GLSL.

Mac shader now matches modern GLSL available on other platforms.
2016-08-15 21:44:44 -04:00
23d7ae1843 OpenGL: backtrace on errors (--debug-gpu)
Backtrace so we can pinpoint where the GL error came from. Then fflush
on severe errors in case it's severe enough to crash Blender.
2016-08-15 04:00:59 -04:00
f1ad3483af get latest OpenGL version on Windows + AMD
When we ask for GL 3.2 compatibility profile:
AMD (Radeon HD 6970) gives us exactly this version
NVIDIA (Quadro K600) gives at least this version
Still need to check Intel behavior

We want *at least* the version requested, plus more recent features if
available.

Both GPUs tested & mentioned above are capable of GL 4.5. With this
commit they both give 4.5 to Blender.
2016-08-14 01:27:00 -04:00
91f04b82a5 early out for ortho grid drawing
Helps most when real-world units are used.

Previous code started at the smallest visible unit (e.g. Inches) then
followed to Feet, Yards, Chains, Furlongs, Miles. Always to the largest
unit of the set, even though most would be way off screen.

New code knows whether it skipped any grid lines for the next unit to
fill in, can stop once all lines are on screen.
2016-08-13 22:33:49 -04:00
90c4ad7387 Mac fixes for new ortho grid drawing
Previous commit works on Windows, found some issues after trying on Mac.

- benign warnings about && within ||
- replaced nearbyint() with round() to avoid floating point environment
surprises
- remquo function appears to be broken on Mac (!) results were way way
off. Replaced with simple division.
- minor tweaks to debug output
2016-08-13 22:13:24 -04:00
db5ad6a79e draw ortho grid with new immediate mode
Work toward T49043, with a side of client vertex arrays.

Not a straightforward port from glVertex to immVertex since Gawain needs
to know how many vertices we'll be drawing *before* we start drawing.

Fixed these not-so-great aspects of grid drawing:
- coarse grids would draw atop some lines from the finer grids
- visible axes would draw atop lines from coarse grid
- axes were drawn even if they weren't in view
- terrible misuse of vertex arrays
- each line issued its own draw call

New code draws each line exactly once. The entire grid is one draw call.

Bonus: I had to / got to learn how the units system works!
2016-08-13 18:14:45 -04:00
e36af2c257 Gawain: increase size of immediate mode buffer
New value of 4MB should handle our needs without taking up too many GPU
resources.

Old value of 1KB was for observing what happens when the buffer fills up
and we need to flush and start a new one.
2016-08-13 16:31:44 -04:00
dfbc51f764 cleanup: ortho grid drawing
Getting this ready for Gawain treatment.

Removed setlinestyle(0) -- solid lines are the default,  hope this isn't
really needed.

Eliminated redundant math.

Arithmetic is still double precision, passed to OpenGL as single
precision. Even though it said GL_DOUBLE before, values were converted
to GL_FLOAT internally.

Use C99-isms for declaring variables close to where they're used.

Minor whitespace tweaks.
2016-08-12 17:20:21 -04:00
4565f3d0c8 use new immediate mode for UI_draw_box_shadow
This serves as a good example of the Gawain API. (I’ve thought of a
better way to draw drop shadows, but that can wait!)

Part of T49043.

This is what I had in mind for D1753.
2016-08-11 01:06:17 -04:00
7664d947b3 Gawain: allow partial vertex specification
If you don’t specify a vertex’s color, it will use the color of the
previous vertex. Similar for all other attributes.

This matches the legacy behavior of glColor, glNormal, etc. *except* in
Gawain the first vertex of each immBegin must be fully specified. There
is no “current” color in the new system.
2016-08-11 00:11:48 -04:00
4aadf7331e Gawain: tweak immediate mode API
Should be simpler to use now.

Made vertex format structure private. New immVertexFormat() function
clears and returns the format. Devs can start with add_attrib(format...)
and not have to clear it first.

immBindProgram automatically packs the vertex format if needed.

Updated 3D cursor drawing to use new API.
2016-08-10 18:01:04 -04:00
f537d96286 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2016-08-10 16:09:08 -04:00
adbbcefe57 Gawain: fewer glEnable/DisableVertexAttribArray calls
Track previously enabled attrib locations so we can call OpenGL only
when needed.

Same result, fewer GL calls.
2016-08-10 16:08:32 -04:00
8fd4a8ab5d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/particle.c
2016-08-10 15:06:40 +02:00
e7a32365cf Gawain: map vertex format to shader inputs
glBindAttribLocation does not take effect until the program is
re-linked. In other words I was doing it wrong!

New code gets attrib locations from program, then remembers the attrib
-> location mapping for subsequent draw calls.

The program and VertexFormat are not modified (makes threading and reuse
easier).
2016-08-10 04:45:23 -04:00
5320a0ad9b Gawain: fix compiler warnings
properly typed function parameters
pointer casting & arithmetic
ptrdiff_t formatting
2016-08-10 02:38:51 -04:00
e4e1b0c7d3 OpenGL: invalidate buffers the modern way
There are older ways to give OpenGL hints about buffer invalidation, but
glInvalidateBufferData does exactly what we want. Use this function when
OpenGL 4.3 is available (Windows and proprietary Linux drivers).

Part of Gawain immediate mode.
2016-08-09 17:17:34 -04:00
f3d65ad23c OpenGL: debug context on Windows
Enable based on --debug-gpu at the command line. Linux already works
this way.
2016-08-09 03:29:49 -04:00
b7f3fb0ef9 Gawain: fix Windows build error
MSVC is more strict than  gcc or clang about pointer arithmetic. Also
fixed pointer cast warnings.
2016-08-09 02:27:54 -04:00
a77e77599d OpenGL: enhance debug output
When running blender --debug-gpu

Display which debug facilities are available. One of these, in order of preference:
- OpenGL 4.3
- KHR_debug
- ARB_debug_output
- AMD_debug_output

All messages are logged now, not just errors. Will probably turn some of these off later.

GL_DEBUG_OUTPUT_SYNCHRONOUS lets us break on errors and backtrace to the exact trouble spot.

Callers of GPU_string_marker no longer pass in a message length, just the message itself (null terminated).

Apple provides no GL debug logging features.
2016-08-09 01:29:58 -04:00
9893153799 OpenGL: fix FBO error messages
Old code had a mix of framebuffer error codes from OpenGL ES, EXT_framebuffer_object, and desktop GL. We use desktop GL (or ARB_framebuffer_object which acts just like GL 3.x) so I made it compatible with that.

Changed messages to the actual GL_FRAMEBUFFER_XXX symbols. These are less friendly and more accurate. Can easily look up what an error means, unfiltered by what a Blender dev thinks it means.

Kept ES error codes around in case we support that one day. Just flip the #if or use a compile-time option.
2016-08-08 18:02:40 -04:00
39259fc8ab draw 3D cursor with new immediate mode
Replace legacy OpenGL with Gawain. Use shaders instead of fixed
function pipeline.

This simple UI element is shown at startup so is easy to verify things
are working. It also serves as a good example for people converting
other parts of the code.

Part of T49043
2016-08-08 15:45:18 -04:00
c73e4e99a5 OpenGL: simple 2D shader with flat color
Flat color means each primitive will use color from the provoking
vertex.
2016-08-08 04:56:02 -04:00
4214b3c44a OpenGL: simplify 3D cursor drawing
Use simple alternating colored lines instead of stippled overdraw.

Reimplement circ function to not use deprecated GLU (T49042). It also
leaves matrix stack untouched.

Remove unused circf function.
2016-08-08 03:17:24 -04:00
6c65e5a00c GPU: bind builtin shader for immediate mode
immBindBuiltinProgram extends Gawain’s immBindProgram to use Blender’s
library of built-in shader programs.

It uses imm prefix instead of GPU_ so people won’t be tempted to call
GPU_unbind_program() afterward.

From my understanding, Apache code is not allowed to call GPL code, so
this function needs to be in the GPU lib.
2016-08-07 22:11:45 -04:00
8e99eec026 Gawain: immediate mode set uniforms for active program
Start simple with vec4 uniforms. Add more later.
2016-08-07 21:30:02 -04:00
11ffbfb36a Gawain: bind a shader for immediate mode
How to use:
1) set up vertex format
2) bind a shader
3) draw with immBegin … immEnd
4) unbind shader

TODO: expand this a little, so we can send uniform values to the bound
shader.
2016-08-07 01:35:42 -04:00
6fea42d677 Gawain: initialize & destroy immediate mode
TODO: make this work better with multiple OpenGL contexts
2016-08-07 01:30:45 -04:00
f27516839f fix simple 2D built-in shaders
Forgot the projection matrix.
2016-08-07 01:26:29 -04:00
0ea8430549 Gawain: legacy Mac VBO workarounds
glMapBufferRange is a wonderful function that doesn’t exist on GL < 3.0.

Use the APPLE_flush_buffer_range extension on Mac. It offers several of
glMapBufferRange’s benefits.

Use older “black arts” method to orphan VBOs when we are done with
them. In modern OpenGL this behavior is more obvious.

Add APPLE_flush_buffer_range to Mac requirements. Every GPU is
supported. T49012
2016-08-07 01:05:49 -04:00
e7f9614f07 Gawain: legacy OpenGL compatibility
Apple invented VAOs and exposes them via an extension in legacy GL.
Other platforms use at least GL 3.0 which has VAOs built in.

QUADS were removed from core profile but are useful for immediate-mode
drawing. We’ll have to implement our own QUAD drawing before switching
to core profile.
2016-08-07 01:05:49 -04:00
6b21d22c60 Gawain: fix VAO and VBO binds
Immediate mode no longer leaves its internals bound after use. Part of
transition from a simple prototype app to non-simple Blender, which has
lots of other parts using OpenGL.
2016-08-07 01:05:49 -04:00
a55c5dbcc4 Gawain: flesh out immediate mode
More ways to send values via immAttrib:
2D float vectors
3 & 4 component ubytes (for colors mostly)

New immVertex functions that act more like familiar glVertex. We’ll
find a balance between making this API convenient and keeping it small.
2f and 3f are enough for now.
2016-08-07 01:05:49 -04:00
3eae585791 Merge branch 'master' into blender2.8 2016-08-06 12:57:21 +02:00
9843921288 Merge branch 'master' into blender2.8
Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
	release/scripts/startup/bl_ui/properties_physics_cloth.py
	release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
	release/scripts/startup/bl_ui/properties_physics_softbody.py
	source/blender/blenkernel/BKE_library.h
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/cloth.c
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/library_query.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/blenkernel/intern/scene.c
	source/blender/blenkernel/intern/softbody.c
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/space_file/filesel.c
	source/blender/editors/space_outliner/outliner_intern.h
	source/blender/makesdna/DNA_ID.h
	source/blender/makesdna/DNA_object_force.h
	source/blender/makesdna/DNA_particle_types.h
	source/blender/makesrna/intern/rna_particle.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blender/makesrna/intern/rna_smoke.c
	source/blender/makesrna/intern/rna_space.c
2016-08-06 12:45:03 +02:00
4571fdde0e OpenGL: transition to ARB FBOs, remove runtime checks
ARB_framebuffer_object replaces several related EXT extensions. The ARB
version pulls GL 3 FBO features into GL 2.1, useful for Mac platform.
Its functions and enums have no ARB suffix so transition to modern GL
will be seamless!

Extension is checked at startup, so is guaranteed to be true at runtime.

Part of T49012
2016-08-04 21:11:45 -04:00
58697444bb OpenGL: remove runtime check for EXT_gpu_shader4
It’s checked at startup, so is guaranteed to be true at runtime.

Part of T49012
2016-08-04 20:27:24 -04:00
32757d488f OpenGL: require EXT_gpu_shader4 & ARB_framebuffer_object on Mac
Mac’s OpenGL version is furthest away from our target of GL 3.2. This
commit brings Mac closer to other platforms, so that our shaders and
other code don’t diverge too much during development.

According to Apple’s OpenGL matrix these useful extensions are
available on all GPUs that will be able to run Blender 2.8.

Only checked in debug builds; we might need something more forceful.

Part of T49012
2016-08-04 20:25:47 -04:00
396dd82428 OpenGL: add simple shaders for 2D drawing
The first two of several new simple built-in shaders (will test these
before adding more). These are intended for the new immediate mode API,
but you can use them just like any built-in GPUShader.

Due to limitations on different platforms, shaders need to work with
GLSL versions 120, 130 and 150. Final Blender 2.8 will be pure #version
150.
2016-08-04 15:59:38 -04:00
797f1896fa OpenGL: immediate mode work-alike
Introducing an immediate mode drawing API that works with modern GL 3.2
core profile. I wrote and tested this using a core context on Mac.

This is part of the Gawain library which is Apache 2 licensed. Be very
careful not to pull other Blender code into these files.

Modifications for the Blender integration:
- prefix filenames to match rest of Blender’s GPU libs
- include GPU_glew.h instead of <OpenGL/gl3.h>
- disable thread-local vars until we figure out how best to do this
2016-08-04 15:36:20 -04:00
42d816a3d9 Blender 2.8 requires Mac OS 10.7 or later
MacOS 10.7 “Lion” was the first to implement OpenGL 3.2, which will be
required to run Blender 2.8.

Minimum OS version was unspecified before.
2016-08-04 03:13:20 -04:00
3d9cc4d3f1 support automatic GPU switching on Mac
First attempt. On my laptop (Intel + nVidia) Blender still switches to
nVidia at launch time.
2016-08-04 03:08:13 -04:00
b3cb7e2652 OpenGL: on Mac use legacy 2.1 or core 3.2
This implements Mac part of T49012.

Removed options for EGL, ES2, compatibility profile. None of these
exist on Mac platform.

Create a GL 3.2 core context when requested at build time. Old code
just pretended to support core profile.
2016-08-04 02:36:46 -04:00
0d1f0116fe OpenGL: Blender 2.8 on X11 requires GL 3.0
Implements the Linux part of T49012.

Simplify the options for context creation. No options for legacy GL or EGL or ES2. Select 3.2 CORE or COMPATIBILITY profile at build time.

If that fails, use a GL 3.0 context. This keeps Mesa supported while we work on full 3.2 core elsewhere in the code.
2016-08-03 17:58:24 -04:00
eccf5a6f81 OpenGL: Blender 2.8 on Windows requires GL 3.2
This greatly simplifies the options for context creation. No options for
legacy GL or EGL or ES2. Select CORE or COMPATIBILITY profile at build
time.

OpenGL 3.2 core profile will be our final target on all platforms. Until
all our code is ready we can use 3.2 compatibility profile or "legacy"
GL 2.1 on platforms that don't support compatibility profile.
2016-08-03 14:46:29 -04:00
251349c3c2 Merge branch 'master' into blender2.8 2016-07-28 12:00:58 +10:00
b1532493c2 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/particle.c
2016-07-25 15:07:17 +02:00
9186b9ae48 Merge branch 'master' into blender2.8 2016-07-18 19:25:44 +10:00
cfbd605567 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/ui.py
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/library.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenkernel/intern/particle_distribute.c
	source/blender/blenkernel/intern/texture.c
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/physics/particle_object.c
	source/blender/editors/transform/transform_snap_object.c
2016-07-12 00:07:44 +02:00
71a57a37b2 Merge branch 'master' into blender2.8 2016-06-29 17:58:39 +02:00
f45fbf4b83 Merge branch 'master' into blender2.8 2016-06-29 17:45:16 +02:00
b90b02a480 Merge branch 'master' into blender2.8 2016-06-28 21:21:11 +10:00
5ae6a3b6b6 Merge branch 'master' into blender2.8 2016-06-28 21:10:11 +10:00
0f927d6eca Fix stupid merge error. 2016-06-27 16:07:38 +02:00
cbce7fef16 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/pointcache.c
	source/blender/makesrna/intern/rna_main_api.c
	source/blender/makesrna/intern/rna_particle.c
2016-06-27 15:59:01 +02:00
c2dc77983d Merge branch 'master' into blender2.8
No changes, just resolve conflicts.
2016-06-23 08:04:19 +10:00
3b0a5dd158 Merge branch 'master' into blender2.8 2016-06-23 07:52:58 +10:00
97ee7f8609 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/physics/particle_edit.c
2016-06-22 13:12:44 +02:00
48c58bd913 Merge branch 'master' into blender2.8 2016-06-21 12:14:49 +10:00
2cfff95ba3 Merge branch 'master' into blender2.8 2016-06-15 17:41:22 +10:00
eedcc4a6a0 Merge branch 'master' into blender2.8 2016-06-15 17:29:11 +10:00
5864269b2c Merge branch 'master' into blender2.8 2016-06-13 19:26:56 +10:00
46e1d85e61 Reduce conflicts be keeping same indent-level as master 2016-06-10 05:51:34 +10:00
c96d4ec644 Merge branch 'master' into blender2.8 2016-06-10 05:46:29 +10:00
a151806698 Merge branch 'master' into blender2.8 2016-06-10 05:17:33 +10:00
10d57f991b Merge branch 'master' into blender2.8 2016-06-10 05:15:06 +10:00
4b99958ca1 Remove particle expander
Having this caused buffer-overrun on startup
2016-06-07 18:27:31 +10:00
1e5735ab99 World space switch for BI nodes.
At the moment light shading in Blender is produced in viewspace. Apparently, that's why
shader nodes work with normals in camera space. But it is not convenient for artists.
The more convenient approach is implemented in Cycles where normals are represented in world space.
Blend4Web Team designed the engine keeping in mind shader parameters readability,
so normals are interpreted in world space as well. And now our users have to use some tweaks, like
empty node group with the name "Replace", which is replacing one input by another on the engine side
(replacing working configuration in Blender Viewport by the configuration that has the same behavior in the engine).

This patch adds the ability to switch to world space for normals and lamp vector in BI and Viewport.
This patch is very important to us and we crave to see this patch in Blender 2.7 because
it will significantly simplify Blend4Web material creation workflow.

{F315547}

{F315548}

Reviewers: campbellbarton, brecht

Reviewed By: brecht

Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D2046
2016-06-07 10:21:55 +02:00
5750549f6a Cleanup: warnings 2016-06-07 18:16:03 +10:00
ed6f86a510 Merge branch 'master' into blender2.8 2016-06-07 18:06:46 +10:00
24d29f2e50 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/particle.c
	source/blender/editors/transform/transform_snap_object.c
2016-06-07 09:59:26 +02:00
11af9e9a5b Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	intern/cycles/blender/blender_particles.cpp
	source/blender/depsgraph/intern/builder/deg_builder_relations.h
	source/blender/depsgraph/intern/depsgraph_build.cc
2016-06-01 14:34:11 +02:00
faec430914 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/transform/transform_snap_object.c
	source/blender/editors/util/undo.c
	source/blender/makesrna/intern/rna_object_force.c
2016-05-24 16:48:10 +02:00
f85745b17b Flat shading for basic shader
The purpose of the patch is to replace deprecated  glShadeModel.

To decrease glShadeModel calls I've set GL_SMOOTH by default

Reviewers: merwin, brecht

Reviewed By: brecht

Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D1958
2016-05-16 11:13:21 +03:00
b4a721af69 Merge branch 'temp_remove_pointcache' into blender2.8 2016-05-02 11:00:34 +02:00
5aa19be912 Merge branch 'temp_remove_particles' into blender2.8 2016-05-02 11:00:26 +02:00
735727e2b8 Removed DNA for point caches. 2016-04-30 14:20:13 +02:00
ac30a04b27 Removed point cache blenkernel code. 2016-04-29 15:03:58 +02:00
181d095f50 Removed PointCache RNA struct definition and uses. 2016-04-29 11:07:11 +02:00
ceb452bc9d Removed point cache operators. 2016-04-29 10:44:09 +02:00
c3863650cc Removed UI for point cache users. 2016-04-28 18:38:10 +02:00
1f723603c8 Merge branch 'master' into temp_remove_particles 2016-04-28 17:33:19 +02:00
3632c4997f Merge branch 'master' into temp_remove_particles 2016-04-20 16:25:16 +02:00
773efb506a Removed particle sync code from Cycles.
Note that this only removes the actual dependencies of Cycles on the
particle code in Blender, but not the internal "particle" definition
or the curve type handling inside Cycles. These structures may be in need
of some improvement themselves, but that is out of scope here.
2016-04-20 11:59:02 +02:00
ba279efbdb Removed the ND_PARTICLE notifier and outliner particle elements. 2016-04-16 17:27:49 +02:00
9465d3decf Removed the particle context of property buttons space. 2016-04-16 17:17:31 +02:00
ecb695ccc8 Removed tool settings for particle edit mode. 2016-04-16 14:26:09 +02:00
cd0ec340c4 Removed remaining uses of the particle edit mode flag. 2016-04-16 12:39:41 +02:00
15c8d095e5 Removed the Main.particle list, used for ParticleSettings ID blocks.
There were still some type-agnostic uses as well, owing to the generic
ListBase type.
2016-04-16 12:28:29 +02:00
7c57822afa Fixed some minor errors in game engine and player. 2016-04-16 12:11:34 +02:00
c92b6f1de6 Removed the translation context for particle settings. 2016-04-16 11:32:45 +02:00
d30b942f07 Removed the ID_PA code used for ParticleSettings. 2016-04-16 11:29:28 +02:00
df2e543d44 Removed some unused declarations for boids code. 2016-04-16 11:11:39 +02:00
fbed29a246 Merge branch 'master' into temp_remove_particles 2016-04-15 17:59:54 +02:00
987bb50a74 Removed remaining use of pointers to particle types as well as boids headers. 2016-04-13 18:10:23 +02:00
d474ed9b88 Partially revert 82ec9c87a7, to add back point cache operators.
Eventually point cache will also be replaced, but it can be kept working at first even without particles.
2016-04-13 16:58:44 +02:00
664f5b8c06 Removed particle DNA. 2016-04-13 13:41:11 +02:00
d8d49befa0 Removed particle system and particle instance modifiers. 2016-04-13 11:45:15 +02:00
d47173c8ca Removed blenkernel particle code. 2016-04-13 10:49:39 +02:00
cf6cb3dcaf Removed most particle system code from RNA. 2016-04-12 18:26:19 +02:00
bcd12bf64d Removed most partical-related code from UI scripts.
There are a lot of cases here where deciding for removal is a bit tricky.
Many features have options for "use_particles" and similar settings. Only
features which actually store a particle object reference or work on actual
particle data have been removed.
2016-04-12 16:28:00 +02:00
29a792a75b Removed all direct uses of BKE_particle.h and DNA_particle_types.h from source/blender/editors. 2016-04-12 13:04:31 +02:00
cc468c1974 Removed remnants of particle draw code. 2016-04-12 12:18:38 +02:00
82ec9c87a7 Removed particle operators API and point cache operators. 2016-04-12 11:47:08 +02:00
5a783144e2 Removed particle operators from editors/physics/. 2016-04-12 11:25:40 +02:00
4876 changed files with 1046276 additions and 546434 deletions

View File

@@ -1,6 +1,7 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/master",
"arc.land.update.default" : "rebase"
"git.default-relative-commit" : "origin/blender2.8",
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "blender2.8"
}

9
.gitignore vendored
View File

@@ -21,7 +21,6 @@ Desktop.ini
# commonly used paths in blender
/blender.bin
/user-config.py
/BUILD_NOTES.txt
# local patches
@@ -34,8 +33,6 @@ Desktop.ini
/doc/python_api/sphinx-in/
/doc/python_api/sphinx-out/
/doc/python_api/rst/bmesh.ops.rst
/doc/python_api/rst/in_menu.png
/doc/python_api/rst/menu_id.png
/doc/python_api/rst/op_prop.png
/doc/python_api/rst/run_script.png
/doc/python_api/rst/spacebar.png
# in-source lib downloads
/build_files/build_environment/downloads

8
.gitmodules vendored
View File

@@ -1,20 +1,20 @@
[submodule "release/scripts/addons"]
path = release/scripts/addons
url = ../blender-addons.git
branch = blender2.8
ignore = all
branch = master
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
ignore = all
branch = master
ignore = all
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
ignore = all
branch = master
ignore = all
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
ignore = all
branch = master
ignore = all

View File

@@ -32,7 +32,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
if(NOT DEFINED WITH_IN_SOURCE_BUILD)
message(FATAL_ERROR
"CMake generation for blender is not allowed within the source directory!"
"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
"\n Remove \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" and try again from another folder, e.g.:"
"\n "
"\n rm CMakeCache.txt"
"\n cd .."
@@ -45,7 +45,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()
endif()
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)
if(NOT EXECUTABLE_OUTPUT_PATH)
set(FIRST_RUN TRUE)
@@ -58,27 +58,20 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform")
# avoid having empty buildtype
set(CMAKE_BUILD_TYPE_INIT "Release")
if(NOT DEFINED CMAKE_BUILD_TYPE_INIT)
set(CMAKE_BUILD_TYPE_INIT "Release")
endif()
# quiet output for Makefiles, 'make -s' helps too
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
# global compile definitions since add_definitions() adds for all.
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
$<$<CONFIG:MinSizeRel>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
)
else()
# keep until CMake-3.0 is min requirement
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG _DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO NDEBUG)
endif()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
$<$<CONFIG:MinSizeRel>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
)
#-----------------------------------------------------------------------------
# Set policy
@@ -163,7 +156,6 @@ option_defaults_init(
_init_OPENCOLORIO
_init_SDL
_init_FFTW3
_init_GAMEENGINE
_init_OPENSUBDIV
)
@@ -192,8 +184,8 @@ endif()
#-----------------------------------------------------------------------------
# Options
# First platform spesific non-cached vars
if(UNIX AND NOT APPLE)
# First platform specific non-cached vars
if(UNIX AND NOT (APPLE OR HAIKU))
set(WITH_X11 ON)
endif()
@@ -229,19 +221,14 @@ mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${_init_FFTW3})
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and audio effects)" ${_init_FFTW3})
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
if(APPLE)
set(WITH_GAMEENGINE_DECKLINK OFF)
else()
option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
endif()
option(WITH_PLAYER "Build Player" OFF)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
option(WITH_CLAY_ENGINE "Enable Clay engine" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -249,6 +236,8 @@ option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" _init_OPEN
option(WITH_OPENVDB "Enable features relying on OpenVDB" OFF)
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF)
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
# GHOST Windowing Library Options
option(WITH_GHOST_DEBUG "Enable debugging output for the GHOST library" OFF)
@@ -283,11 +272,12 @@ endif()
if(WITH_X11)
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON)
option(WITH_X11_ALPHA "Enable X11 transparent background" ON)
endif()
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
else()
# not an option for other OS's
@@ -307,7 +297,6 @@ endif()
# Modifiers
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
option(WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON)
option(WITH_MOD_BOOLEAN "Enable Boolean Modifier" ON)
option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
# option(WITH_MOD_CLOTH_ELTOPO "Enable Experimental cloth solver" OFF) # this is now only available in a branch
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
@@ -321,7 +310,6 @@ option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON)
# Audio/Video format support
option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@ -332,10 +320,6 @@ option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd
option(WITH_ALEMBIC "Enable Alembic Support" OFF)
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
if(APPLE)
option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF)
endif()
# 3D format support
# Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA})
@@ -363,6 +347,12 @@ option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." OFF)
mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
# Logging/unbit test libraries.
option(WITH_SYSTEM_GFLAGS "Use system-wide Gflags instead of a bundled one" OFF)
option(WITH_SYSTEM_GLOG "Use system-wide Glog instead of a bundled one" OFF)
mark_as_advanced(WITH_SYSTEM_GFLAGS)
mark_as_advanced(WITH_SYSTEM_GLOG)
# Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
@@ -382,10 +372,14 @@ if(UNIX AND NOT APPLE)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
mark_as_advanced(PYTHON_NUMPY_PATH)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
if(WITH_PYTHON_INSTALL)
option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON)
if(UNIX AND NOT APPLE)
option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -404,16 +398,25 @@ option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
option(WITH_CYCLES_OPENSUBDIV "Build Cycles with OpenSubdiv support" ${_init_CYCLES_OPENSUBDIV})
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for")
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
mark_as_advanced(WITH_CYCLES_LOGGING)
mark_as_advanced(WITH_CYCLES_DEBUG)
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
option(WITH_CYCLES_DEVICE_OPENCL "Enable Cycles OpenCL compute support" ON)
option(WITH_CYCLES_NETWORK "Enable Cycles compute over network support (EXPERIMENTAL and unfinished)" OFF)
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
mark_as_advanced(WITH_CYCLES_DEVICE_OPENCL)
mark_as_advanced(WITH_CYCLES_NETWORK)
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)
@@ -445,7 +448,8 @@ option(WITH_BOOST "Enable features depending on boost" ON)
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_TESTS "Enable OpenGL related unit testing (Experimental)" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
# Documentation
@@ -456,28 +460,16 @@ endif()
# OpenGL
option(WITH_GLEW_MX "Support multiple GLEW contexts (experimental)" OFF )
option(WITH_GLEW_ES "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF)
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
mark_as_advanced(
WITH_GLEW_MX
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_COMPAT
WITH_GL_PROFILE_CORE
WITH_GL_PROFILE_ES20
)
if(WITH_GL_PROFILE_COMPAT)
set(WITH_GLU ON)
else()
set(WITH_GLU OFF)
endif()
if(WIN32)
option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
mark_as_advanced(WITH_GL_ANGLE)
@@ -496,13 +488,17 @@ endif()
# Experimental support of C11 and C++11
#
# We default options to whatever default standard in the current compiler.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
if(APPLE)
set(_c11_init ON)
set(_cxx11_init ON)
set(WITH_C11 ON)
set(WITH_CXX11 ON)
elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
set(_c11_init ON)
else()
set(_c11_init OFF)
set(_cxx11_init OFF)
endif()
set(_cxx11_init ON)
option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
mark_as_advanced(WITH_C11)
@@ -515,6 +511,41 @@ if(CMAKE_COMPILER_IS_GNUCC)
mark_as_advanced(WITH_LINKER_GOLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
option(WITH_COMPILER_ASAN "Build and link against address sanitizer (only for Debug & RelWithDebInfo targets)." OFF)
mark_as_advanced(WITH_COMPILER_ASAN)
if(WITH_COMPILER_ASAN)
set(_asan_defaults "\
-fsanitize=address \
-fsanitize=bool \
-fsanitize=bounds \
-fsanitize=enum \
-fsanitize=float-cast-overflow \
-fsanitize=float-divide-by-zero \
-fsanitize=leak \
-fsanitize=nonnull-attribute \
-fsanitize=object-size \
-fsanitize=returns-nonnull-attribute \
-fsanitize=signed-integer-overflow \
-fsanitize=undefined \
-fsanitize=vla-bound \
-fno-sanitize=alignment \
")
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CFLAGS)
set(COMPILER_ASAN_CXXFLAGS "${_asan_defaults}" CACHE STRING "C++ flags for address sanitizer")
mark_as_advanced(COMPILER_ASAN_CXXFLAGS)
unset(_asan_defaults)
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
mark_as_advanced(COMPILER_ASAN_LIBRARY)
endif()
endif()
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
@@ -532,6 +563,9 @@ if(WIN32)
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
option(WINDOWS_USE_VISUAL_STUDIO_FOLDERS "Organize the visual studio project according to source folders." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
endif()
# avoid using again
@@ -560,128 +594,24 @@ endif()
# Apple
if(APPLE)
# require newer cmake on osx because of version handling,
# older cmake cannot handle 2 digit subversion!
cmake_minimum_required(VERSION 3.0.0)
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
"Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
FORCE)
endif()
if(NOT DEFINED OSX_SYSTEM)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE OSX_SYSTEM
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# workaround for incorrect cmake xcode lookup for developer previews - XCODE_VERSION does not
# take xcode-select path into account but would always look into /Applications/Xcode.app
# while dev versions are named Xcode<version>-DP<preview_number>
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_CHECK OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate to bundlepath in any case
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if(${XCODE_VERSION} VERSION_GREATER 4.2)
# reduce to XCode name without dp extension
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
if(${DP_NAME} MATCHES Xcode5)
set(XCODE_VERSION 5)
endif()
endif()
##### cmake incompatibility with xcode 4.3 and higher #####
if(${XCODE_VERSION} MATCHES '') # cmake fails due looking for xcode in the wrong path, thus will be empty var
message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
endif()
### end cmake incompatibility with xcode 4.3 and higher ###
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
endif()
else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR)
string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
unset(XCODE_VERS_BUILD_NR)
endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}")
if(${XCODE_VERSION} VERSION_LESS 4.3)
# use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk CACHE PATH "" FORCE)
else()
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk
set(CMAKE_OSX_SYSROOT ${OSX_SYSROOT_PREFIX}/${OSX_DEVELOPER_PREFIX} CACHE PATH "" FORCE)
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# to silence sdk not found warning, just overrides CMAKE_OSX_SYSROOT
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx${OSX_SYSTEM})
endif()
# QuickTime framework is no longer available in SDK 10.12+
if(WITH_CODEC_QUICKTIME AND ${OSX_SYSTEM} VERSION_GREATER 10.11)
set(WITH_CODEC_QUICKTIME OFF)
message(STATUS "QuickTime not supported by SDK ${OSX_SYSTEM}, disabling WITH_CODEC_QUICKTIME")
endif()
endif()
if(OSX_SYSTEM MATCHES 10.9)
# make sure syslibs and headers are looked up in sdk ( expecially for 10.9 openGL atm. )
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
endif()
if(WITH_CXX11)
# 10.9 is our min. target, if you use higher sdk, weak linking happens
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
message(STATUS "Setting deployment target to 10.9, lower versions are incompatible with WITH_CXX11")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
else()
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
# 10.6 is our min. target, if you use higher sdk, weak linking happens
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE)
endif()
endif()
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
# force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else ( cmake bug ? )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
include(platform_apple_xcode)
endif()
#-----------------------------------------------------------------------------
# Check for conflicting/unsupported configurations
if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE)
if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
message(FATAL_ERROR
"At least one of WITH_BLENDER or WITH_PLAYER or "
"WITH_CYCLES_STANDALONE must be enabled, nothing to do!"
"At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
"must be enabled, nothing to do!"
)
endif()
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
if(NOT WITH_CXX11)
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
endif()
endif()
if(NOT WITH_AUDASPACE)
@@ -691,9 +621,6 @@ if(NOT WITH_AUDASPACE)
if(WITH_JACK)
message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
endif()
if(WITH_GAMEENGINE)
message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
endif()
endif()
if(NOT WITH_SDL AND WITH_GHOST_SDL)
@@ -701,10 +628,6 @@ if(NOT WITH_SDL AND WITH_GHOST_SDL)
endif()
# python module, needs some different options
if(WITH_PYTHON_MODULE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
endif()
if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
endif()
@@ -732,17 +655,11 @@ if(NOT WITH_BOOST)
endmacro()
set_and_warn(WITH_CYCLES OFF)
set_and_warn(WITH_AUDASPACE OFF)
set_and_warn(WITH_INTERNATIONAL OFF)
set_and_warn(WITH_OPENVDB OFF)
set_and_warn(WITH_OPENCOLORIO OFF)
set_and_warn(WITH_MOD_BOOLEAN OFF)
set_and_warn(WITH_OPENAL OFF) # depends on AUDASPACE
set_and_warn(WITH_GAMEENGINE OFF) # depends on AUDASPACE
set_and_warn(WITH_PLAYER OFF) # depends on GAMEENGINE
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_MOD_BOOLEAN)
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO)
# Keep enabled
else()
# New dependency graph needs either Boost or C++11 for function bindings.
@@ -784,6 +701,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_X11 OFF)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_X11_XFIXES OFF)
set(WITH_X11_ALPHA OFF)
set(WITH_GHOST_XDND OFF)
set(WITH_INPUT_IME OFF)
@@ -809,30 +727,18 @@ TEST_SHARED_PTR_SUPPORT()
TEST_UNORDERED_MAP_SUPPORT()
if(WITH_AUDASPACE)
if(WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
-DWITH_SYSTEM_AUDASPACE
"-DAUD_DEVICE_H=<AUD_Device.h>"
"-DAUD_SPECIAL_H=<AUD_Special.h>"
"-DAUD_SOUND_H=<AUD_Sound.h>"
"-DAUD_HANDLE_H=<AUD_Handle.h>"
"-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
"-DAUD_TYPES_H=<AUD_Types.h>"
"-DAUD_PYTHON_H=<python/PyAPI.h>"
)
else()
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
set(AUDASPACE_DEFINITIONS
-DWITH_AUDASPACE
"-DAUD_DEVICE_H=<AUD_C-API.h>"
"-DAUD_SPECIAL_H=<AUD_C-API.h>"
"-DAUD_SOUND_H=<AUD_C-API.h>"
"-DAUD_HANDLE_H=<AUD_C-API.h>"
"-DAUD_SEQUENCE_H=<AUD_C-API.h>"
"-DAUD_TYPES_H=<AUD_Space.h>"
)
if(NOT WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
endif()
endif()
# Auto-enable CUDA dynload if toolkit is not found.
if(NOT WITH_CUDA_DYNLOAD)
find_package(CUDA)
if (NOT CUDA_FOUND)
message("CUDA toolkit not found, using dynamic runtime loading of libraries instead")
set(WITH_CUDA_DYNLOAD ON)
endif()
endif()
@@ -855,6 +761,17 @@ if(WITH_INTERNATIONAL)
endif()
if(WITH_PYTHON)
# While we have this as an '#error' in 'bpy_capi_utils.h',
# upgrading Python tends to cause confusion for users who build.
# Give the error message early to make this more obvious.
#
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.6")
message(FATAL_ERROR "At least Python 3.6 is required to build")
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules")
message(WARNING
"Addons path '${CMAKE_SOURCE_DIR}/release/scripts/addons' is missing, "
@@ -893,6 +810,15 @@ set(PLATFORM_LINKLIBS "")
set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
if(WITH_COMPILER_ASAN)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CFLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY}")
endif()
#-----------------------------------------------------------------------------
#Platform specifics
@@ -924,6 +850,14 @@ if(WITH_X11)
endif()
endif()
if(WITH_X11_XFIXES)
if(X11_Xfixes_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xfixes_LIB})
else()
set(WITH_X11_XFIXES OFF)
endif()
endif()
if(WITH_X11_ALPHA)
find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
mark_as_advanced(X11_Xrender_LIB)
@@ -1013,16 +947,16 @@ endif()
if(MSVC)
# for some reason this fails on msvc
add_definitions(-D__LITTLE_ENDIAN__)
# OSX-Note: as we do crosscompiling with specific set architecture,
# endianess-detection and autosetting is counterproductive
# OSX-Note: as we do cross-compiling with specific set architecture,
# endianess-detection and auto-setting is counterproductive
# so we just set endianess according CMAKE_OSX_ARCHITECTURES
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
add_definitions(-D__LITTLE_ENDIAN__)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
add_definitions(-D__BIG_ENDIAN__)
else()
include(TestBigEndian)
test_big_endian(_SYSTEM_BIG_ENDIAN)
@@ -1057,19 +991,11 @@ endif()
find_package(OpenGL)
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
if(WITH_GLU)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
list(APPEND GL_DEFINITIONS -DWITH_GLU)
endif()
if(WITH_SYSTEM_GLES)
find_package_wrapper(OpenGLES)
endif()
if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
elseif(WITH_GL_PROFILE_ES20)
if(WITH_GL_PROFILE_ES20)
if(WITH_SYSTEM_GLES)
if(NOT OPENGLES_LIBRARY)
message(FATAL_ERROR
@@ -1129,6 +1055,9 @@ elseif(WITH_GL_PROFILE_ES20)
endif()
else()
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
endif()
if(WITH_GL_EGL)
@@ -1176,16 +1105,10 @@ if(WITH_GL_EGL)
endif()
if(WITH_GL_PROFILE_COMPAT)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
endif()
if(WITH_GL_PROFILE_CORE)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
else()
list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
endif()
if(WITH_GL_EGL)
@@ -1222,10 +1145,6 @@ endif()
#-----------------------------------------------------------------------------
# Configure GLEW
if(WITH_GLEW_MX)
list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
endif()
if(WITH_SYSTEM_GLEW)
find_package(GLEW)
@@ -1235,11 +1154,7 @@ if(WITH_SYSTEM_GLEW)
message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
endif()
if(WITH_GLEW_MX)
set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
else()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
endif()
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
else()
if(WITH_GLEW_ES)
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
@@ -1247,12 +1162,11 @@ else()
list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
# These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
if(NOT WITH_GL_PROFILE_ES20)
if(WITH_GL_PROFILE_ES20)
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
else()
# No ES functions are needed
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
# ES is enabled, but the other functions are all disabled
list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
endif()
if(WITH_GL_PROFILE_ES20)
@@ -1289,9 +1203,7 @@ else()
endif()
if(NOT WITH_GLU)
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
endif()
list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
#-----------------------------------------------------------------------------
# Configure Bullet
@@ -1317,15 +1229,42 @@ endif()
# Configure GLog/GFlags
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
if(WITH_SYSTEM_GFLAGS)
find_package(Gflags)
if(NOT GFLAGS_FOUND)
message(FATAL_ERROR "System wide Gflags is requested but was not found")
endif()
# FindGflags does not define this, and we are not even sure what to use here.
set(GFLAGS_DEFINES)
else()
set(GFLAGS_DEFINES
-DGFLAGS_DLL_DEFINE_FLAG=
-DGFLAGS_DLL_DECLARE_FLAG=
-DGFLAGS_DLL_DECL=
)
set(GFLAGS_NAMESPACE "gflags")
set(GFLAGS_LIBRARIES extern_gflags)
set(GFLAGS_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/extern/gflags/src")
endif()
set(GFLAGS_DEFINES
-DGFLAGS_DLL_DEFINE_FLAG=
-DGFLAGS_DLL_DECLARE_FLAG=
-DGFLAGS_DLL_DECL=
)
if(WITH_SYSTEM_GLOG)
find_package(Glog)
if(NOT GLOG_FOUND)
message(FATAL_ERROR "System wide Glog is requested but was not found")
endif()
# FindGlog does not define this, and we are not even sure what to use here.
set(GLOG_DEFINES)
else()
set(GLOG_DEFINES
-DGOOGLE_GLOG_DLL_DECL=
)
set(GLOG_LIBRARIES extern_glog)
if(WIN32)
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
else()
set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/include)
endif()
endif()
endif()
#-----------------------------------------------------------------------------
@@ -1396,6 +1335,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_RESTRICT -Wrestrict)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1437,6 +1377,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1449,9 +1390,20 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
endif()
# Use 'ATTR_FALLTHROUGH' macro to suppress.
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
endif()
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
endif()
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
@@ -1459,11 +1411,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to not fail all tests due presence of -fopenmp !
set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # these are only used for the checks
endif()
# strange, clang complains these are not supported, but then yses them.
# strange, clang complains these are not supported, but then uses them.
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_RETURN_TYPE -Werror=return-type)
@@ -1516,8 +1464,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
# disable numbered, false positives
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556,858,597,177,1292,167,279,592,94,2722,3199")
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# most msvc warnings are C & C++
set(_WARNINGS
@@ -1535,8 +1483,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
"/wd4305" # truncation from 'type1' to 'type2'
"/wd4800" # forcing value to bool 'true' or 'false'
"/wd4828" # The file contains a character that is illegal
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
"/we4431" # missing type specifier - int assumed
)
@@ -1559,10 +1509,15 @@ if(WITH_PYTHON)
)
endif()
if(WIN32 OR APPLE)
if(WIN32)
# pass, we have this in an archive to extract
elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
find_python_package(numpy)
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy)
unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
endif()
endif()
if(WIN32 OR APPLE)
@@ -1593,7 +1548,12 @@ else()
endif()
# Visual Studio has all standards it supports available by default
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
# Clang on windows copies this behavior and does not support these switches
if(
CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
(CMAKE_C_COMPILER_ID MATCHES "Intel")
)
# Use C99 + GNU extensions, works with GCC, Clang, ICC
if(WITH_C11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
@@ -1607,7 +1567,7 @@ endif()
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS}")
# defined above, platform spesific but shared names
# defined above, platform specific but shared names
mark_as_advanced(
CYCLES_OSL
OSL_LIB_EXEC
@@ -1647,7 +1607,7 @@ if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER OR WITH_PLAYER)
if(WITH_BLENDER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1672,13 +1632,6 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
add_subdirectory(source/blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
@@ -1692,10 +1645,7 @@ include(build_files/cmake/packaging.cmake)
# Use dynamic loading for OpenMP
if(WITH_BLENDER)
openmp_delayload(blender)
endif(WITH_BLENDER)
if(WITH_PLAYER)
openmp_delayload(blenderplayer)
endif(WITH_PLAYER)
endif()
#-----------------------------------------------------------------------------
# Print Final Configuration
@@ -1729,8 +1679,6 @@ if(FIRST_RUN)
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
info_cfg_text("Build Options:")
info_cfg_option(WITH_GAMEENGINE)
info_cfg_option(WITH_PLAYER)
info_cfg_option(WITH_BULLET)
info_cfg_option(WITH_IK_SOLVER)
info_cfg_option(WITH_IK_ITASC)
@@ -1753,6 +1701,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_INSTALL_PORTABLE)
info_cfg_option(WITH_X11_ALPHA)
info_cfg_option(WITH_X11_XF86VMODE)
info_cfg_option(WITH_X11_XFIXES)
info_cfg_option(WITH_X11_XINPUT)
info_cfg_option(WITH_MEM_JEMALLOC)
info_cfg_option(WITH_MEM_VALGRIND)
@@ -1792,17 +1741,13 @@ if(FIRST_RUN)
endif()
info_cfg_text("Modifiers:")
info_cfg_option(WITH_MOD_BOOLEAN)
info_cfg_option(WITH_MOD_REMESH)
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
info_cfg_option(WITH_GLU)
info_cfg_option(WITH_GL_EGL)
info_cfg_option(WITH_GL_PROFILE_COMPAT)
info_cfg_option(WITH_GL_PROFILE_CORE)
info_cfg_option(WITH_GL_PROFILE_ES20)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
@@ -1816,4 +1761,3 @@ endif()
if(0)
print_all_vars()
endif()

View File

@@ -43,6 +43,16 @@ ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
endif
# Dependencies DIR's
DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
DEPS_BUILD_DIR:=$(BUILD_DIR)/deps
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
endif
# Allow to use alternative binary (pypy3, etc)
ifndef PYTHON
PYTHON:=python3
@@ -86,13 +96,7 @@ ifndef NPROCS
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), Darwin)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), FreeBSD)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), NetBSD)
ifneq (,$(filter $(OS),Darwin FreeBSD NetBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif
@@ -104,7 +108,7 @@ endif
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
-DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
# -----------------------------------------------------------------------------
@@ -146,6 +150,27 @@ cycles: all
headless: all
bpy: all
# -----------------------------------------------------------------------------
# Build dependencies
DEPS_TARGET = install
ifneq "$(findstring clean, $(MAKECMDGOALS))" ""
DEPS_TARGET = clean
endif
deps: .FORCE
@echo
@echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\"
@cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
@echo
@echo Building dependencies ...
$(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
@echo
@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
@echo
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
@@ -164,6 +189,7 @@ help: .FORCE
@echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo " * deps - build library dependencies (intended only for platform maintainers)"
@echo ""
@echo " * config - run cmake configuration tool to set build options"
@echo ""
@@ -210,9 +236,10 @@ help: .FORCE
@echo " * check_descriptions - check for duplicate/invalid descriptions"
@echo ""
@echo "Utilities (not associated with building blender)"
@echo " * icons - updates PNG icons from SVG files."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo " * icons - updates PNG icons from SVG files."
@echo " * icons_geom - updates Geometry icons from BLEND file."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo ""
@echo "Environment Variables"
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
@@ -397,11 +424,21 @@ icons: .FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
icons_geom: .FORCE
BLENDER_BIN="$(BUILD_DIR)/bin/blender" \
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE
if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
fi
if [ -d "../lib" ]; then \
svn cleanup ../lib/* ; \
svn update ../lib/* ; \
fi
git pull --rebase
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master

View File

@@ -0,0 +1,131 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################
#
# This is a build system used by platform maintainers to build library dependencies on
# Windows and macOS. There is some support for Linux as well, but not ready for releases.
#
# Windows and macOS users should download the precompiled libraries in lib/, Linux users
# should run install_deps.sh for building dependencies.
#
# WINDOWS USAGE:
# Don't call this cmake file your self, use build_deps.cmd
# build_deps 2013 x64 / build_deps 2013 x86
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install autoconf automake libtool yasm openssl xz
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
# Install compiler, cmake, autoconf, automake, libtool, yasm
# Run "make deps" from main Blender directory
#
####################################################################################################
project("BlenderDependencies")
cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/options.cmake)
include(cmake/versions.cmake)
include(cmake/zlib.cmake)
include(cmake/blendthumb.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/boost.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/ilmbase.cmake)
include(cmake/openexr.cmake)
include(cmake/freetype.cmake)
include(cmake/freeglut.cmake)
include(cmake/glew.cmake)
include(cmake/alembic.cmake)
include(cmake/glfw.cmake)
include(cmake/clew.cmake)
include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
include(cmake/opencollada.cmake)
include(cmake/opencolorio.cmake)
include(cmake/llvm.cmake)
include(cmake/clang.cmake)
include(cmake/openimageio.cmake)
include(cmake/tiff.cmake)
include(cmake/flexbison.cmake)
include(cmake/osl.cmake)
include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/numpy.cmake)
if(WITH_WEBP)
include(cmake/webp.cmake)
endif()
if(WIN32)
include(cmake/hidapi.cmake)
endif()
if(ENABLE_MINGW64)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
include(cmake/setup_mingw64.cmake)
else()
include(cmake/setup_mingw32.cmake)
endif()
else()
set(mingw_LIBDIR ${LIBDIR})
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/openjpeg.cmake)
if(BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)
endif()
include(cmake/lame.cmake)
include(cmake/ogg.cmake)
include(cmake/vorbis.cmake)
include(cmake/theora.cmake)
include(cmake/vpx.cmake)
include(cmake/orc.cmake)
include(cmake/schroedinger.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
include(cmake/faad.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake)
include(cmake/sndfile.cmake)
if(WIN32)
include(cmake/iconv.cmake)
include(cmake/lapack.cmake)
endif()
if(UNIX)
include(cmake/flac.cmake)
if(NOT APPLE)
include(cmake/spnav.cmake)
include(cmake/jemalloc.cmake)
include(cmake/xml2.cmake)
endif()
endif()
endif()
endif()
include(cmake/harvest.cmake)

View File

@@ -0,0 +1,80 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(ALEMBIC_HDF5)
set(ALEMBIC_HDF5_HL)
# in debug mode we do not build HDF5_hdf5_hl_LIBRARY which makes cmake really
# unhappy, stub it with the debug mode lib. it's not linking it in at this
# point in time anyhow
if(BUILD_MODE STREQUAL Debug)
set(ALEMBIC_HDF5_HL -DHDF5_hdf5_hl_LIBRARY=${LIBDIR}/hdf5/lib/libhdf5_hl_D.${LIBEXT})
endif()
endif()
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DALEMBIC_LIB_USES_BOOST=ON
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DUSE_STATIC_BOOST=On
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DILMBASE_ROOT=${LIBDIR}/ilmbase
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/ilmbase/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DUSE_PYILMBASE=0
-DUSE_PYALEMBIC=0
-DUSE_ARNOLD=0
-DUSE_MAYA=0
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DHDF5_ROOT=${LIBDIR}/hdf5
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=On
-DALEMBIC_SHARED_LIBS=OFF
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
${ALEMBIC_HDF5_HL}
)
ExternalProject_Add(external_alembic
URL ${ALEMBIC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ALEMBIC_MD5}
PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic
)
add_dependencies(
external_alembic
external_boost
external_zlib
external_ilmbase
)

View File

@@ -0,0 +1,67 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
if(WIN32)
set(THUMB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../release/windows/blendthumb)
ExternalProject_Add(external_zlib_32
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_32}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib32 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib32
)
ExternalProject_Add(external_zlib_64
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_64}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib64 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib64
)
ExternalProject_Add(external_blendthumb_32
CMAKE_GENERATOR ${GENERATOR_32}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb32
)
add_dependencies(
external_blendthumb_32
external_zlib_32
)
ExternalProject_Add(external_blendthumb_64
CMAKE_GENERATOR ${GENERATOR_64}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb64
)
add_dependencies(
external_blendthumb_64
external_zlib_64
)
endif()
endif()

View File

@@ -0,0 +1,49 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BLOSC_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DBUILD_TESTS=OFF
-DBUILD_BENCHMARKS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DThreads_FOUND=1
-DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
)
ExternalProject_Add(external_blosc
URL ${BLOSC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc
)
add_dependencies(
external_blosc
external_zlib
)
if(WIN32)
add_dependencies(
external_blosc
external_pthreads
)
endif()

View File

@@ -0,0 +1,114 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PYTHON_ARCH x64)
set(PYTHON_ARCH2 win-AMD64)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/amd64/)
else()
set(PYTHON_ARCH x86)
set(PYTHON_ARCH2 win32)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
endif()
if(MSVC12)
set(BOOST_TOOLSET toolset=msvc-12.0)
set(BOOST_COMPILER_STRING -vc120)
set(PYTHON_COMPILER_STRING v120)
endif()
if(MSVC14)
set(BOOST_TOOLSET toolset=msvc-14.0)
set(BOOST_COMPILER_STRING -vc140)
set(PYTHON_COMPILER_STRING v140)
endif()
set(JAM_FILE ${BUILD_DIR}/boost/src/external_boost/user-config.jam)
set(semi_path "${PATCH_DIR}/semi.txt")
FILE(TO_NATIVE_PATH ${semi_path} semi_path)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat &&
echo using python : ${PYTHON_OUTPUTDIR}\\python.exe > "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/pc >> "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/pcbuild >> "${JAM_FILE}" &&
type ${semi_path} >> "${JAM_FILE}"
)
set(BOOST_BUILD_COMMAND bjam)
#--user-config=user-config.jam
set(BOOST_BUILD_OPTIONS runtime-link=static )
#set(BOOST_WITH_PYTHON --with-python)
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
if(BUILD_MODE STREQUAL Release)
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_60/ ${HARVEST_TARGET}/boost/include/)
endif()
set(BOOST_PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/boost/src/external_boost < ${PATCH_DIR}/boost.diff)
elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./bjam)
set(BOOST_BUILD_OPTIONS toolset=clang cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .)
set(BOOST_PATCH_COMMAND echo .)
else()
set(BOOST_HARVEST_CMD echo .)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./bjam)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_PATCH_COMMAND echo .)
endif()
set(BOOST_OPTIONS
--with-filesystem
--with-locale
--with-thread
--with-regex
--with-system
--with-date_time
--with-wave
--with-atomic
--with-serialization
--with-program_options
--with-iostreams
${BOOST_WITH_PYTHON}
${BOOST_TOOLSET}
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(BOOST_ADDRESS_MODEL 64)
else()
set(BOOST_ADDRESS_MODEL 32)
endif()
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
ExternalProject_Add(external_boost
URL ${BOOST_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${BOOST_MD5}
PREFIX ${BUILD_DIR}/boost
UPDATE_COMMAND ""
PATCH_COMMAND ${BOOST_PATCH_COMMAND}
CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} variant=${BOOST_BUILD_TYPE} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WIN32)
add_dependencies(
external_boost
Make_Python_Environment
)
endif()

View File

@@ -0,0 +1,54 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
)
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PATCH_COMMAND ${PATCH_CMD} -p 2 -N -R -d ${BUILD_DIR}/clang/src/external_clang < ${PATCH_DIR}/clang.diff
PREFIX ${BUILD_DIR}/clang
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/)
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/include/ ${HARVEST_TARGET}/llvm/debug/include/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(
external_clang
ll
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL ${CLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL ${CUEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/cuew
)

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FAAD_EXTRA_ARGS)
ExternalProject_Add(external_faad
URL ${FAAD_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FAAD_HASH}
PREFIX ${BUILD_DIR}/faad
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/faad/src/external_faad < ${PATCH_DIR}/libfaad.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && ${CONFIGURE_COMMAND} --disable-shared --enable-static --prefix=${LIBDIR}/faad
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make install
INSTALL_DIR ${LIBDIR}/faad
)
if(MSVC)
set_target_properties(external_faad PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,137 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/dirac/include/dirac -I${mingw_LIBDIR}/schroedinger/include/schroedinger-1.0 -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/dirac/lib -L${mingw_LIBDIR}/schroedinger/lib -L${mingw_LIBDIR}/orc/lib -L${mingw_LIBDIR}/zlib/lib")
set(FFMPEG_EXTRA_FLAGS --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/schroedinger/lib/pkgconfig:${mingw_LIBDIR}/orc/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--disable-static
--enable-shared
--enable-w32threads
--disable-pthreads
--enable-libopenjpeg
)
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--enable-static
--disable-shared
--enable-libopenjpeg
)
endif()
if(APPLE)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--target-os=darwin
)
endif()
ExternalProject_Add(external_ffmpeg
URL ${FFMPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFMPEG_HASH}
PREFIX ${BUILD_DIR}/ffmpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} &&
cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
${FFMPEG_ENV} ${CONFIGURE_COMMAND_NO_TARGET} ${FFMPEG_EXTRA_FLAGS}
--disable-lzma
--disable-avfilter
--disable-vdpau
--disable-bzlib
--disable-libgsm
--disable-libspeex
--enable-libvpx
--prefix=${LIBDIR}/ffmpeg
--enable-libschroedinger
--enable-libtheora
--enable-libvorbis
--enable-zlib
--enable-stripping
--enable-runtime-cpudetect
--disable-vaapi
--disable-nonfree
--enable-gpl
--disable-postproc
--disable-x11grab
--enable-libmp3lame
--disable-librtmp
--enable-libx264
--enable-libxvid
--disable-libopencore-amrnb
--disable-libopencore-amrwb
--disable-libdc1394
--disable-version3
--disable-debug
--enable-optimizations
--disable-sse
--disable-ssse3
--enable-ffplay
--disable-openssl
--disable-securetransport
--disable-indev=avfoundation
--disable-indev=qtkit
--disable-sdl
--disable-gnutls
--disable-vda
--disable-videotoolbox
--disable-libxcb
--disable-xlib
--disable-audiotoolbox
--disable-cuvid
--disable-nvenc
--disable-indev=jack
--disable-indev=alsa
--disable-outdev=alsa
--disable-crystalhd
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/ffmpeg
)
if(MSVC)
set_target_properties(external_ffmpeg PROPERTIES FOLDER Mingw)
endif()
add_dependencies(
external_ffmpeg
external_zlib
external_faad
external_openjpeg
external_xvidcore
external_x264
external_schroedinger
external_vpx
external_theora
external_vorbis
external_ogg
external_lame
)
if(WIN32)
add_dependencies(
external_ffmpeg
external_zlib_mingw
)
endif()

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FFTW_EXTRA_ARGS)
if(WIN32)
set(FFTW3_ENV set CFLAGS=-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-lto &&)
set(FFTW3_PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/fftw3/src/external_fftw3 < ${PATCH_DIR}/fftw3.diff)
endif()
ExternalProject_Add(external_fftw3
URL ${FFTW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${FFTW3_ENV} cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/fftw3
PATCH_COMMAND ${FFTW3_PATCH_COMMAND}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make install
INSTALL_DIR ${LIBDIR}/fftw3
)
if(MSVC)
set_target_properties(external_fftw3 PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_flac
URL ${FLAC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make install
INSTALL_DIR ${LIBDIR}/flac
)
if(MSVC)
set_target_properties(external_flac PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,31 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FLEXBISON_EXTRA_ARGS)
ExternalProject_Add(external_flexbison
URL ${FLEXBISON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FLEXBISON_HASH}
PREFIX ${BUILD_DIR}/flexbison
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/flexbison/src/external_flexbison/ ${LIBDIR}/flexbison/
INSTALL_DIR ${LIBDIR}/flexbison
)

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if(BUILD_MODE STREQUAL Release)
set(FREEGLUT_EXTRA_ARGS
-DFREEGLUT_BUILD_SHARED_LIBS=Off
-DFREEGLUT_BUILD_STATIC_LIBS=On
)
ExternalProject_Add(external_freeglut
URL ${FREEGLUT_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREEGLUT_HASH}
PREFIX ${BUILD_DIR}/freeglut
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freeglut
)
endif()
endif()

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d -DWITH_BZip2=OFF -DWITH_HarfBuzz=OFF)
ExternalProject_Add(external_freetype
URL ${FREETYPE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FREETYPE_HASH}
PREFIX ${BUILD_DIR}/freetype
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freetype
)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLEW_EXTRA_ARGS
-DBUILD_UTILS=Off
-DBUILD_SHARED_LIBS=Off
)
ExternalProject_Add(external_glew
URL ${GLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLEW_HASH}
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
PREFIX ${BUILD_DIR}/glew
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glew
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL ${GLFW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLFW_HASH}
PREFIX ${BUILD_DIR}/glfw
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glfw
)

View File

@@ -0,0 +1,276 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
########################################################################
# Copy all generated files to the proper strucure as blender prefers
########################################################################
if(NOT DEFINED HARVEST_TARGET)
set(HARVEST_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/Harvest)
endif()
message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
# Zlib Rename the lib file and copy the include/bin folders
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstatic.lib ${HARVEST_TARGET}/zlib/lib/libz_st.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/include/ ${HARVEST_TARGET}/zlib/include/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/bin/ ${HARVEST_TARGET}/zlib/bin/ &&
# jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# FreeType, straight up copy
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype &&
# pthreads, rename include dir
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib &&
# ffmpeg copy include+bin
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/include ${HARVEST_TARGET}/ffmpeg/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ffmpeg/bin ${HARVEST_TARGET}/ffmpeg/lib &&
# sdl merge bin/lib folder, copy include
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/include/sdl2 ${HARVEST_TARGET}/sdl/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/lib ${HARVEST_TARGET}/sdl/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/sdl/bin ${HARVEST_TARGET}/sdl/lib &&
# openal
${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/lib/openal32.lib ${HARVEST_TARGET}/openal/lib/openal32.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openal/bin/openal32.dll ${HARVEST_TARGET}/openal/lib/openal32.dll &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openal/include/ ${HARVEST_TARGET}/openal/include/ &&
# OpenImageIO
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
# openEXR
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ilmbase ${HARVEST_TARGET}/openexr &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# fftw3
${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/lib/libfftw3.a ${HARVEST_TARGET}/fftw3/lib/libfftw.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/include/fftw3.h ${HARVEST_TARGET}/fftw3/include/fftw3.h &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# sndfile
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/lib/libsndfile.dll.a ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
# iconv
${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/lib/libiconv.a ${HARVEST_TARGET}/iconv/lib/iconv.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/iconv/include/iconv.h ${HARVEST_TARGET}/iconv/include/iconv.h &&
# opencolorIO
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenColorIO/ ${HARVEST_TARGET}/opencolorio &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenColorIO/lib/OpenColorIO.dll ${HARVEST_TARGET}/opencolorio/bin/OpenColorIO.dll &&
# Osl
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/osl/ ${HARVEST_TARGET}/osl &&
# OpenVDB
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openVDB/ ${HARVEST_TARGET}/openVDB &&
# blosc
${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc.lib ${HARVEST_TARGET}/blosc/lib/libblosc.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/blosc/include/ ${HARVEST_TARGET}/blosc/include/ &&
# tbb
${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/ &&
# opencollada
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/ ${HARVEST_TARGET}/opencollada/ &&
# opensubdiv
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opensubdiv ${HARVEST_TARGET}/opensubdiv &&
# python
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
# alembic
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/alembic ${HARVEST_TARGET}/alembic &&
# BlendThumb
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll &&
# python
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}.tar.gz &&
# numpy
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}.tar.gz &&
# hidapi
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
# webp, straight up copy
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp
DEPENDS
)
endif()
if(BUILD_MODE STREQUAL Debug)
add_custom_target(Harvest_Debug_Results
# OpenImageIO
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
# ilmbase+openexr
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Half.lib ${HARVEST_TARGET}/openexr/lib/Half_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Iex-2_2.lib ${HARVEST_TARGET}/openexr/lib/Iex-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IexMath-2_2.lib ${HARVEST_TARGET}/openexr/lib/IexMath-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmThread-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Imath-2_2.lib ${HARVEST_TARGET}/openexr/lib/Imath-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImf-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImf-2_2_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImfUtil-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImfUtil-2_2_d.lib &&
# opencollada
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib &&
# blosc
${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc_d.lib ${HARVEST_TARGET}/blosc/lib/libblosc_d.lib &&
# osl
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib &&
# opensubdiv
${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdCPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdCPU_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/opensubdiv/lib/osdGPU.lib ${HARVEST_TARGET}/opensubdiv/lib/osdGPU_d.lib &&
# tbb
${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib &&
# openvdb
${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib &&
# python
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
# alembic
${CMAKE_COMMAND} -E copy ${LIBDIR}/alembic/lib/alembic.lib ${HARVEST_TARGET}/alembic/lib/alembic_d.lib &&
# hdf5
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
# numpy
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz &&
# python
${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz
DEPENDS Package_Python
)
endif()
else(WIN32)
function(harvest from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "clang" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(blosc/lib openvdb/lib "*.a")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(ilmbase openexr "*")
harvest(ilmbase/include openexr/include "*.h")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
harvest(openexr/include openexr/include "*.h")
harvest(openexr/lib openexr/lib "*.a")
harvest(openimageio/bin openimageio/bin "idiff")
harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
harvest(openjpeg/include/openjpeg-1.5 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(openvdb/include/openvdb/openvdb openvdb/include/openvdb "*.h")
harvest(openvdb/lib openvdb/lib "*.a")
harvest(orc/lib/liborc-0.4.a ffmpeg/lib/liborc.a)
harvest(osl/bin osl/bin "oslc")
harvest(osl/include osl/include "*.h")
harvest(osl/lib osl/lib "*.a")
harvest(osl/shaders osl/shaders "*.h")
harvest(png/include png/include "*.h")
harvest(png/lib png/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(python/include python/include "*h")
harvest(python/lib python/lib "*")
harvest(schroedinger/lib/libschroedinger-1.0.a ffmpeg/lib/libschroedinger.a)
harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(sndfile/include sndfile/include "*.h")
harvest(sndfile/lib sndfile/lib "*.a")
harvest(spnav/include spnav/include "*.h")
harvest(spnav/lib spnav/lib "*.a")
harvest(tbb/include tbb/include "*.h")
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
endif()

View File

@@ -0,0 +1,42 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HDF5_EXTRA_ARGS
-DHDF5_ENABLE_THREADSAFE=Off
-DHDF5_BUILD_CPP_LIB=Off
-DBUILD_TESTING=Off
-DHDF5_BUILD_TOOLS=Off
-DHDF5_BUILD_EXAMPLES=Off
-DHDF5_BUILD_HL_LIB=On
-DBUILD_STATIC_CRT_LIBS=On
-DBUILD_SHARED_LIBS=On
)
if(WIN32)
set(HDF5_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/hdf5/src/external_hdf5 < ${PATCH_DIR}/hdf5.diff)
endif()
ExternalProject_Add(external_hdf5
URL ${HDF5_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HDF5_HASH}
PREFIX ${BUILD_DIR}/hdf5
PATCH_COMMAND ${HDF5_PATCH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hdf5
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HIDAPI_EXTRA_ARGS)
ExternalProject_Add(external_hidapi
URL ${HIDAPI_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HIDAPI_HASH}
PREFIX ${BUILD_DIR}/hidapi
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_hidapi.txt ${BUILD_DIR}/hidapi/src/external_hidapi/cmakelists.txt && ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/hidapi/src/external_hidapi < ${PATCH_DIR}/hidapi.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hidapi -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${HIDAPI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hidapi
)

View File

@@ -0,0 +1,34 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ICONV_EXTRA_ARGS)
ExternalProject_Add(external_iconv
URL ${ICONV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make install
INSTALL_DIR ${LIBDIR}/iconv
)
if(MSVC)
set_target_properties(external_iconv PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
endif()
set(ILMBASE_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_STANDARD_LIBRARIES=${ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES}
)
ExternalProject_Add(external_ilmbase
URL ${ILMBASE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ILMBASE_HASH}
PREFIX ${BUILD_DIR}/ilmbase
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ilmbase ${DEFAULT_CMAKE_FLAGS} ${ILMBASE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_jemalloc
URL ${JEMALLOC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JEMALLOC_HASH}
PREFIX ${BUILD_DIR}/jemalloc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make install
INSTALL_DIR ${LIBDIR}/jemalloc
)

View File

@@ -0,0 +1,65 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
# cmake for windows
set(JPEG_EXTRA_ARGS -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d)
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT})
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
else(WIN32)
# autoconf for unix
if(APPLE)
set(JPEG_EXTRA_ARGS --host x86_64-apple-darwin --with-jpeg8)
else()
set(JPEG_EXTRA_ARGS --with-jpeg8)
endif()
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && autoreconf -fiv && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jpg NASM=yasm ${JPEG_EXTRA_ARGS}
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CONFIGURE_ENV} && make install
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg
)
set(JPEG_LIBRARY libjpeg${LIBEXT})
endif(WIN32)

View File

@@ -0,0 +1,47 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAME_EXTRA_ARGS)
if(MSVC)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(LAME_EXTRA_ARGS CFLAGS=-msse)
endif()
endif()
ExternalProject_Add(external_lame
URL ${LAME_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LAME_HASH}
PREFIX ${BUILD_DIR}/lame
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS}
--enable-export=full
--with-fileio=sndfile
--without-vorbis
--with-pic
--disable-mp3x
--disable-mp3rtp
--disable-gtktest
--enable-export=full
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && make install
INSTALL_DIR ${LIBDIR}/lame
)
if(MSVC)
set_target_properties(external_lame PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,43 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAPACK_EXTRA_ARGS)
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw64/bin/gfortran.exe)
else()
set(LAPACK_EXTRA_ARGS -G "MSYS Makefiles" -DCMAKE_Fortran_COMPILER=${DOWNLOAD_DIR}/mingw/mingw32/bin/gfortran.exe)
endif()
endif()
ExternalProject_Add(external_lapack
URL ${LAPACK_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LAPACK_HASH}
PREFIX ${BUILD_DIR}/lapack
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && ${CMAKE_COMMAND} ${LAPACK_EXTRA_ARGS} -DBUILD_TESTING=Off -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lapack .
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lapack/src/external_lapack/ && make install
INSTALL_DIR ${LIBDIR}/lapack
)
if(MSVC)
set_target_properties(external_lapack PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,61 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
)
if(WIN32)
set(LLVM_GENERATOR "NMake Makefiles")
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
# short project name due to long filename issues on windows
ExternalProject_Add(ll
URL ${LLVM_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR}
PREFIX ${BUILD_DIR}/ll
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm-alloca-fix.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
else()
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/
)
endif()
ExternalProject_Add_Step(ll after_install
COMMAND ${LLVM_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()

View File

@@ -0,0 +1,60 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(MSVC)
if(BUILD_MODE STREQUAL Debug)
set(NUMPY_DIR_POSTFIX -pydebug)
set(NUMPY_ARCHIVE_POSTFIX d)
set(NUMPY_BUILD_OPTION --debug)
else()
set(NUMPY_DIR_POSTFIX)
set(NUMPY_ARCHIVE_POSTFIX)
set(NUMPY_BUILD_OPTION)
endif()
endif()
set(NUMPY_POSTFIX)
if(WIN32)
set(NUMPY_INSTALL
${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
)
set(NUMPY_PATCH ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff )
else()
set(NUMPY_INSTALL echo .)
set(NUMPY_PATCH echo .)
endif()
ExternalProject_Add(external_numpy
URL ${NUMPY_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${NUMPY_HASH}
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
LOG_BUILD 1
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
INSTALL_COMMAND ${NUMPY_INSTALL}
)
add_dependencies(
external_numpy
Make_Python_Environment
)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ogg
URL ${OGG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install
INSTALL_DIR ${LIBDIR}/ogg
)
if(MSVC)
set_target_properties(external_ogg PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,43 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
set(OPENAL_EXTRA_ARGS
-DALSOFT_UTILS=Off
-DALSOFT_NO_CONFIG_UTIL=On
-DALSOFT_EXAMPLES=Off
-DALSOFT_TESTS=Off
-DALSOFT_CONFIG=Off
-DALSOFT_HRTF_DEFS=Off
-DALSOFT_INSTALL=On
-DALSOFT_BACKEND_SNDIO=Off
)
if(UNIX)
set(OPENAL_EXTRA_ARGS ${OPENAL_EXTRA_ARGS} -DLIBTYPE=STATIC)
endif()
ExternalProject_Add(external_openal
URL ${OPENAL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENAL_HASH}
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
)
endif()

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX AND NOT APPLE)
set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
endif()
ExternalProject_Add(external_opencollada
URL ${OPENCOLLADA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencollada
)
if(UNIX AND NOT APPLE)
add_dependencies(
external_opencollada
external_xml2
)
endif()

View File

@@ -0,0 +1,73 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENCOLORIO_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_INCLUDEDIR=${LIBDIR}/boost/include/boost_1_60/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_DEBUG=ON
-DBoost_MAJOR_VERSION=1
-DBoost_MINOR_VERSION=60
-DOCIO_BUILD_APPS=OFF
-DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_NUKE=OFF
)
if(WIN32)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_BOOST_PTR=ON
-DOCIO_BUILD_STATIC=OFF
-DOCIO_BUILD_SHARED=ON
)
else()
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_BOOST_PTR=OFF
-DOCIO_BUILD_STATIC=ON
-DOCIO_BUILD_SHARED=OFF
)
endif()
ExternalProject_Add(external_opencolorio
URL ${OPENCOLORIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENCOLORIO_HASH}
PREFIX ${BUILD_DIR}/opencolorio
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencolorio
)
if(NOT WIN32)
add_custom_command(
OUTPUT ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libtinyxml.a ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/libyaml-cpp.a
)
add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a)
endif()
add_dependencies(
external_opencolorio
external_boost
)

View File

@@ -0,0 +1,45 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
endif()
set(OPENEXR_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_CXX_STANDARD_LIBRARIES=${OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES}
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase
)
ExternalProject_Add(external_openexr
URL ${OPENEXR_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENEXR_HASH}
PREFIX ${BUILD_DIR}/openexr
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openexr/src/external_openexr < ${PATCH_DIR}/openexr.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr
)
add_dependencies(
external_openexr
external_zlib
external_ilmbase
)

View File

@@ -0,0 +1,152 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
set(OIIO_TOOLS ON)
else()
set(OIIO_TOOLS OFF)
endif()
if(UNIX AND NOT APPLE)
# This causes linking to static pthread libraries which gives link errors.
# Since we manually specify library paths it should static link other libs.
set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=OFF)
else()
set(OPENIMAGEIO_LINKSTATIC -DLINKSTATIC=ON)
endif()
if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
set(OPENJPEG_POSTFIX _msvc)
else()
set(PNG_LIBNAME libpng${LIBEXT})
set(OIIO_SIMD_FLAGS)
endif()
if(WITH_WEBP)
set(WEBP_ARGS
-DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
)
set(WEBP_DEP external_webp)
endif()
if(MSVC)
set(OPENJPEG_FLAGS
-DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
-DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
)
else()
set(OPENJPEG_FLAGS
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILDSTATIC=ON
${OPENIMAGEIO_LINKSTATIC}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/openexr/
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/IlmImf-2_2${LIBEXT}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-OIIO_BUILD_CPP11=ON
-DUSE_OPENGL=OFF
-DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
-DUSE_QT=OFF
-DUSE_PYTHON=OFF
-DUSE_GIF=OFF
-DUSE_OPENCV=OFF
-DUSE_OPENSSL=OFF
-DUSE_OPENJPEG=ON
-DUSE_FFMPEG=OFF
-DUSE_PTEX=OFF
-DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF
-DUSE_PYTHON=OFF
-DUSE_PYTHON3=OFF
-DUSE_OCIO=OFF
-DUSE_WEBP=${WITH_WEBP}
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF
-DBUILD_TESTING=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
${OPENJPEG_FLAGS}
-DOCIO_PATH=${LIBDIR}/opencolorio/
-DOpenEXR_USE_STATIC_LIBS=On
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_PATH=${LIBDIR}/ilmbase/
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Half${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DSTOP_ON_WARNING=OFF
${WEBP_FLAGS}
${OIIO_SIMD_FLAGS}
)
ExternalProject_Add(external_openimageio
URL ${OPENIMAGEIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENIMAGEIO_HASH}
PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND
${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff &&
${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_staticexr.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openimageio
)
add_dependencies(
external_openimageio
external_png external_zlib
external_ilmbase
external_openexr
external_jpeg
external_boost
external_tiff
external_opencolorio
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
)
if(NOT WIN32)
add_dependencies(
external_openimageio
external_opencolorio_extra
)
endif()

View File

@@ -0,0 +1,64 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the encoder/decoder may use png/tiff/lcms system libraries, but the
# library itself does not depend on them, so should give no problems.
set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
if(WIN32)
set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles")
else()
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
endif()
ExternalProject_Add(external_openjpeg
URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
INSTALL_DIR ${LIBDIR}/openjpeg
)
#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc
URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openjpeg_msvc after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
DEPENDEES install
)
endif()
endif()
set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
if(MSVC)
set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,78 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENSUBDIV_EXTRA_ARGS
-DNO_EXAMPLES=ON
-DNO_REGRESSION=ON
-DNO_PYTHON=ON
-DNO_MAYA=ON
-DNO_PTEX=ON
-DNO_DOC=ON
-DNO_CLEW=OFF
-DNO_OPENCL=OFF
-DNO_TUTORIALS=ON
-DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
-DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
)
if(WIN32)
#no cuda support for vc15 yet
if(msvc15)
set(OPENSUBDIV_CUDA ON)
else()
set(OPENSUBDIV_CUDA ON)
endif()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=${OPENSUBDIV_CUDA}
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
-DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
)
endif()
ExternalProject_Add(external_opensubdiv
URL ${OPENSUBDIV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENSUBDIV_Hash}
PREFIX ${BUILD_DIR}/opensubdiv
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/opensubdiv/src/external_opensubdiv < ${PATCH_DIR}/opensubdiv.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv
)
add_dependencies(
external_opensubdiv
external_glew
external_glfw
external_clew
external_cuew
)

View File

@@ -0,0 +1,80 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d)
endif()
set(OPENVDB_EXTRA_ARGS
-DILMBASE_HOME=${LIBDIR}/ilmbase/
-DILMBASE_CUSTOM=ON
-DILMBASE_CUSTOM_LIBRARIES=Half;Imath-2_2;IlmThread-2_2;Iex-2_2
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DILMBASE_HALF_LIBRARIES=${LIBDIR}/ilmbase/lib/Half${LIBEXT}
-DILMBASE_IMATH_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DILMBASE_ILMTHREAD_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DILMBASE_IEX_LIBRARIES=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DOPENEXR_USE_STATIC_LIBS=ON
-DOPENEXR_CUSTOM=ON
-DOPENEXR_CUSTOM_LIBRARY=IlmImf-2_2
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DTBB_ROOT_DIR=${LIBDIR}/tbb/
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARY=${LIBDIR}/tbb/lib/tbb_static${LIBEXT}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DWITH_BLOSC=ON
-DBLOSC_INCLUDE_DIR=${LIBDIR}/blosc/include/
-DBLOSC_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
)
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS})
# CMake script for OpenVDB based on https://raw.githubusercontent.com/diekev/openvdb-cmake/master/CMakeLists.txt
# can't be in external_openvdb because of how the includes are setup.
ExternalProject_Add(openvdb
URL ${OPENVDB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENVDB_HASH}
PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_openvdb.txt ${BUILD_DIR}/openvdb/src/openvdb/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy_directory ${PATCH_DIR}/cmake/ ${BUILD_DIR}/openvdb/src/openvdb/cmake/ &&
${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_vc2013.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb
)
add_dependencies(
openvdb
external_tbb
external_boost
external_ilmbase
external_openexr
external_zlib
external_blosc
)

View File

@@ -0,0 +1,211 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
set(BUILD_MODE "Release")
message(STATUS "Build type not specified: defaulting to a release build.")
endif()
message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
else(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif()
option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
message("LIBDIR = ${LIBDIR}")
message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}")
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
else()
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/patch.exe)
endif()
set(LIBEXT ".lib")
set(LIBPREFIX "")
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
# TODO FIXME highly MSVC specific
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)
set(PLATFORM_CMAKE_FLAGS)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw64)
set(MINGW_SHELL ming64sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
set(MINGW_HOST x86_64-w64-mingw32)
else()
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw32)
set(MINGW_SHELL ming32sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl32/portableshell.bat)
set(MINGW_HOST i686-w64-mingw32)
endif()
set(CONFIGURE_ENV
cd ${MINGW_PATH} &&
call ${MINGW_SHELL} &&
call ${PERL_SHELL} &&
set path &&
set CFLAGS=-g &&
set LDFLAGS=-Wl,--as-needed -static-libgcc
)
set(CONFIGURE_ENV_NO_PERL
cd ${MINGW_PATH} &&
call ${MINGW_SHELL} &&
set path &&
set CFLAGS=-g &&
set LDFLAGS=-Wl,--as-needed -static-libgcc
)
set(CONFIGURE_COMMAND sh ./configure)
set(CONFIGURE_COMMAND_NO_TARGET ${CONFIGURE_COMMAND})
else()
set(PATCH_CMD patch)
set(LIBEXT ".a")
set(LIBPREFIX "lib")
if(APPLE)
# Let's get the current Xcode dir, to support xcode-select
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.9)
set(OSX_SDK_VERSION 10.12)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk)
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin13.0.0) # OS X 10.9
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
)
else()
set(PLATFORM_CFLAGS "-fPIC")
set(PLATFORM_CXXFLAGS "-std=c++11 -fPIC")
set(PLATFORM_LDFLAGS)
set(PLATFORM_BUILD_TARGET)
set(PLATFORM_CMAKE_FLAGS)
endif()
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "-O2 -DNDEBUG")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "-g")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-g ${PLATFORM_CXXFLAGS}")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${PLATFORM_LDFLAGS}
)
set(CONFIGURE_ENV_NO_PERL ${CONFIGURE_ENV})
set(CONFIGURE_COMMAND ./configure ${PLATFORM_BUILD_TARGET})
set(CONFIGURE_COMMAND_NO_TARGET ./configure)
endif()
set(DEFAULT_CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=${BUILD_MODE}
-DCMAKE_C_FLAGS_DEBUG=${BLENDER_CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL=${BLENDER_CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELEASE=${BLENDER_CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_FLAGS_DEBUG=${BLENDER_CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
${PLATFORM_CMAKE_FLAGS}
)
if(WIN32)
#we need both flavors to build the thumbnail dlls
if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64")
elseif(MSVC14)
set(GENERATOR_32 "Visual Studio 14 2015")
set(GENERATOR_64 "Visual Studio 14 2015 Win64")
endif()
endif()
if(WIN32)
set(ZLIB_LIBRARY zlibstatic${LIBEXT})
else()
set(ZLIB_LIBRARY libz${LIBEXT})
endif()
if(MSVC)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
set(CMAKE_INSTALL_MESSAGE LAZY)

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_orc
URL ${ORC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${ORC_HASH}
PREFIX ${BUILD_DIR}/orc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/orc --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/orc/src/external_orc/ && make install
INSTALL_DIR ${LIBDIR}/orc
)
if(MSVC)
set_target_properties(external_orc PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,98 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DFLEX_EXTRA_OPTIONS="--wincompat" -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
else()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
endif()
else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}")
endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/ilmbase/lib/Imath-2_2.lib^^${LIBDIR}/ilmbase/lib/Half.lib^^${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib^^${LIBDIR}/ilmbase/lib/Iex-2_2.lib")
set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/LLVMipo${LIBEXT}")
set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
-DLLVM_VERSION=3.4
-DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_HOME=${LIBDIR}/ilmbase/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/ilmbase/include/
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Imath-2_2${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}IlmThread-2_2${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/ilmbase/lib/${LIBPREFIX}Iex-2_2${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DOSL_BUILD_TESTS=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
-DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
-DOPENIMAGEIO_INCLUDES=${LIBDIR}/openimageio/include
${OSL_FLEX_BISON}
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
-DOSL_BUILD_PLUGINS=Off
-DSTOP_ON_WARNING=OFF
-DOSL_BUILD_CPP11=ON
-DUSE_LLVM_BITCODE=OFF
${OSL_SIMD_FLAGS}
)
ExternalProject_Add(external_osl
URL ${OSL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
LIST_SEPARATOR ^^
URL_HASH MD5=${OSL_HASH}
PREFIX ${BUILD_DIR}/osl
PATCH_COMMAND
${PATCH_CMD} -p 3 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff &&
${PATCH_CMD} -p 0 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl_simd_oiio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/osl
)
add_dependencies(
external_osl
external_boost
ll
external_clang
external_ilmbase
external_openexr
external_zlib
external_flexbison
external_openimageio
)

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PNG_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DPNG_STATIC=ON
)
ExternalProject_Add(external_png
URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PNG_HASH}
PREFIX ${BUILD_DIR}/png
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/png
)
add_dependencies(
external_png
external_zlib
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,46 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(PTHREAD_XCFLAGS /MD)
if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H /D_TIMESPEC_DEFINED ")
else() # everything before doesn't
set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H ")
endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA512=${PTHREADS_SHA512}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll ${LIBDIR}/pthreads/lib/pthreadVC2.dll &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h
INSTALL_DIR ${LIBDIR}/pthreads
)
endif()

View File

@@ -0,0 +1,140 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PYTHON_POSTFIX)
if(BUILD_MODE STREQUAL Debug)
set(PYTHON_POSTFIX _d)
endif()
if(WIN32)
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe)
macro(cmake_to_dos_path MsysPath ResultingPath)
string(REPLACE "/" "\\" ${ResultingPath} "${MsysPath}")
endmacro()
set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
message("Python externals = ${PYTHON_EXTERNALS_FOLDER}")
message("Python externals_dos = ${PYTHON_EXTERNALS_FOLDER_DOS}")
message("Python DOWNLOADS_EXTERNALS_FOLDER = ${DOWNLOADS_EXTERNALS_FOLDER}")
message("Python DOWNLOADS_EXTERNALS_FOLDER_DOS = ${DOWNLOADS_EXTERNALS_FOLDER_DOS}")
ExternalProject_Add(external_python
URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND
echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python.diff &&
${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/pc < ${PATCH_DIR}/pyshell.diff
CONFIGURE_COMMAND ""
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE} -k ${PYTHON_COMPILER_STRING}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} &&
${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h
)
message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist")
message("POutput = ${PYTHON_OUTPUTDIR}")
else()
if(APPLE)
# we need to manually add homebrew headers to get ssl module building
set(PYTHON_CFLAGS "-I/usr/local/opt/openssl/include -I${OSX_SYSROOT}/usr/include ${PLATFORM_CFLAGS}")
set(PYTHON_LDFLAGS "-L/usr/local/opt/openssl/lib ${PLATFORM_LDFLAGS}")
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && export CFLAGS=${PYTHON_CFLAGS} && export LDFLAGS=${PYTHON_LDFLAGS})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_apple.diff)
else()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
endif()
ExternalProject_Add(external_python
URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND ${PYTHON_PATCH}
CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python
BUILD_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
INSTALL_DIR ${LIBDIR}/python)
add_custom_target(Make_Python_Environment ALL DEPENDS external_python)
endif()
if(MSVC)
add_custom_command(
OUTPUT ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz
OUTPUT ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/lib ${BUILD_DIR}/python/src/external_python/redist/lib
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_bz2${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_bz2${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_hashlib${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_hashlib${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_lzma${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_lzma${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_sqlite3${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_sqlite3${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ssl${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ssl${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/pyexpat${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/pyexpat${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/select${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/select${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/unicodedata${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/unicodedata${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/winsound${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/winsound${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes_test${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes_test${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_decimal${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_decimal${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_elementtree${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_elementtree${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_msi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_msi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_multiprocessing${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_multiprocessing${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_overlapped${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_overlapped${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_socket${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_socket${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testbuffer${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testbuffer${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testcapi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testcapi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testimportmultiple${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testimportmultiple${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testmultiphase${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testmultiphase${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/python/src/external_python/redist" ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz" "."
)
add_custom_target(Package_Python ALL DEPENDS external_python ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe)
if(MSVC12)
set(PYTHON_DISTUTIL_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/run/lib/distutils < ${PATCH_DIR}/python_runtime_vc2013.diff)
else()
set(PYTHON_DISTUTIL_PATCH echo "No patch needed")
endif()
add_custom_command(OUTPUT ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/redist ${BUILD_DIR}/python/src/external_python/run
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/run/include
COMMAND ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${BUILD_DIR}/python/src/external_python/run/include/pyconfig.h
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib #missing postfix on purpose, distutils is not expecting it
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib #other things like numpy still want it though.
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe -m ensurepip --upgrade
COMMAND ${PYTHON_DISTUTIL_PATCH}
)
add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
endif()

View File

@@ -0,0 +1,41 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(HARVEST_CMD cmd /C FOR /d /r ${BUILD_DIR}/python/src/external_python/run/lib/site-packages %d IN (__pycache__) DO @IF EXIST "%d" rd /s /q "%d" &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests
)
else()
set(HARVEST_CMD echo .)
endif()
ExternalProject_Add(external_python_site_packages
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: && ${HARVEST_CMD}
)
add_dependencies(
external_python_site_packages
Make_Python_Environment
)

View File

@@ -0,0 +1,48 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(SCHROEDINGER_EXTRA_FLAGS "CFLAGS=-g -I./ -I${LIBDIR}/orc/include/orc-0.4" "LDFLAGS=-Wl,--as-needed -static-libgcc -L${LIBDIR}/orc/lib" ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a ORCC=${LIBDIR}/orc/bin/orcc.exe)
else()
set(SCHROEDINGER_CFLAGS "${PLATFORM_CFLAGS} -I./ -I${LIBDIR}/orc/include/orc-0.4")
set(SCHROEDINGER_LDFLAGS "${PLATFORM_LDFLAGS} -L${LIBDIR}/orc/lib")
set(SCHROEDINGER_EXTRA_FLAGS CFLAGS=${SCHROEDINGER_CFLAGS} LDFLAGS=${SCHROEDINGER_LDFLAGS} ORC_CFLAGS=-I${LIBDIR}/orc/include/orc-0.4 ORC_LDFLAGS=-L${LIBDIR}/orc/lib ORCC=${LIBDIR}/orc/bin/orcc) # ORC_LIBS=${LIBDIR}/orc/lib/liborc-0.4.a
endif()
ExternalProject_Add(external_schroedinger
URL ${SCHROEDINGER_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${SCHROEDINGER_HASH}
PREFIX ${BUILD_DIR}/schroedinger
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/schroedinger/src/external_schroedinger < ${PATCH_DIR}/schroedinger.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/schroedinger --disable-shared --enable-static ${SCHROEDINGER_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/schroedinger/src/external_schroedinger/ && make install
INSTALL_DIR ${LIBDIR}/schroedinger
)
add_dependencies(
external_schroedinger
external_orc
)
if(MSVC)
set_target_properties(external_schroedinger PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,39 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(SDL_EXTRA_ARGS
-DSDL_STATIC=Off
)
else()
set(SDL_EXTRA_ARGS
-DSDL_STATIC=ON
-DSDL_SHARED=OFF
-DSDL_VIDEO=OFF
)
endif()
ExternalProject_Add(external_sdl
URL ${SDL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SDL_HASH}
PREFIX ${BUILD_DIR}/sdl
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/sdl
)

View File

@@ -0,0 +1,219 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################################
# Mingw32 Builds
####################################################################################################################
# This installs mingw32+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)
string(REPLACE ":" "" TmpPath "${MsysPath}")
string(SUBSTRING ${TmpPath} 0 1 Drive)
string(SUBSTRING ${TmpPath} 1 255 PathPart)
string(TOLOWER ${Drive} LowerDrive)
string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
endmacro()
cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
message("mingw_LIBDIR = ${mingw_LIBDIR}")
message("Checking for mingw32")
# download mingw32
if(NOT EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
message("Downloading mingw32")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z" "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z")
endif()
# make mingw root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract mingw32
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/mingw32env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z"))
message("Extracting mingw32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
)
endif()
message("Checking for pkg-config")
if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
message("Downloading pkg-config")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
endif()
# extract pkgconfig
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
message("Extracting pkg-config")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe"
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win32/nasm-2.12.01-win32.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe"
)
endif()
message("Checking for mingwGet")
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
message("Downloading mingw-get")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
endif()
# extract mingw_get
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
message("Extracting mingw-get")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/make.exe"))
message("Installing MSYS")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get install msys msys-patch
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
message("Downloading CoreUtils 5.97")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
endif()
if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"))
message("Installing pr from CoreUtils 5.97")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd")
message("Installing ming32sh.cmd")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming32sh.cmd ${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd
)
endif()
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
message("Downloading perl")
file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-32bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
endif()
# make perl root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/perl32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl32
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract perl
if((NOT EXISTS "${DOWNLOAD_DIR}/perl32/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip"))
message("Extracting perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip
WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl32
)
endif()
# get yasm for vpx
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
message("Downloading yasm")
file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
endif()
message("checking i686-w64-mingw32-strings")
# copy strings.exe to i686-w64-mingw32-strings for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe")
message("fixing i686-w64-mingw32-strings.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe"
)
endif()
message("checking i686-w64-mingw32-ar.exe")
# copy ar.exe to i686-w64-mingw32-ar.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe")
message("fixing i686-w64-mingw32-ar.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe"
)
endif()
message("checking i686-w64-mingw32-strip.exe")
# copy strip.exe to i686-w64-mingw32-strip.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe")
message("fixing i686-w64-mingw32-strip.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe"
)
endif()
message("checking i686-w64-mingw32-ranlib.exe")
# copy ranlib.exe to i686-w64-mingw32-ranlib.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
message("fixing i686-w64-mingw32-ranlib.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -0,0 +1,219 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################################
# Mingw64 Builds
####################################################################################################################
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)
string(REPLACE ":" "" TmpPath "${MsysPath}")
string(SUBSTRING ${TmpPath} 0 1 Drive)
string(SUBSTRING ${TmpPath} 1 255 PathPart)
string(TOLOWER ${Drive} LowerDrive)
string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
endmacro()
cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
message("mingw_LIBDIR = ${mingw_LIBDIR}")
message("Checking for mingw64")
# download ming64
if(NOT EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
message("Downloading mingw64")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z" "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z")
endif()
# make mingw root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract mingw64
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/mingw64env.cmd") AND (EXISTS "${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z"))
message("Extracting mingw64")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
)
endif()
message("Checking for pkg-config")
if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
message("Downloading pkg-config")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
endif()
# extract pkgconfig
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
message("Extracting pkg-config")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/pkg-config.exe"
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip" "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.12.01-win64.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.12.01/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/nasm.exe"
)
endif()
message("Checking for mingwGet")
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
message("Downloading mingw-get")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
endif()
# extract mingw_get
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
message("Extracting mingw-get")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/make.exe"))
message("Installing MSYS")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get install msys msys-patch
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
message("Downloading CoreUtils 5.97")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
endif()
if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"))
message("Installing pr from CoreUtils 5.97")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/pr.exe"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd")
message("Installing ming64sh.cmd")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming64sh.cmd ${DOWNLOAD_DIR}/mingw/mingw64/ming64sh.cmd
)
endif()
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
message("Downloading perl")
file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-64bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip")
endif()
# make perl root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract perl
if((NOT EXISTS "${DOWNLOAD_DIR}/perl/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip"))
message("Extracting perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-64bit-portable.zip
WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl
)
endif()
# get yasm for vpx
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
message("Downloading yasm")
file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/yasm.exe")
endif()
message("checking x86_64-w64-mingw32-strings.exe")
# copy strings.exe to x86_64-w64-mingw32-strings.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe")
message("fixing x86_64-w64-mingw32-strings.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strings.exe"
)
endif()
message("checking x86_64-w64-mingw32-ar.exe")
# copy ar.exe to x86_64-w64-mingw32-ar.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe")
message("fixing x86_64-w64-mingw32-ar.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ar.exe"
)
endif()
message("checking x86_64-w64-mingw32-strip.exe")
# copy strip.exe to x86_64-w64-mingw32-strip.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe")
message("fixing x86_64-w64-mingw32-strip.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-strip.exe"
)
endif()
message("checking x86_64-w64-mingw32-ranlib.exe")
# copy ranlib.exe to x86_64-w64-mingw32-ranlib.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe")
message("fixing x86_64-w64-mingw32-ranlib.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw64/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw64/bin/x86_64-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -0,0 +1,62 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(SNDFILE_EXTRA_ARGS)
set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
#shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared )
else()
set(SNDFILE_OPTIONS --enable-static --disable-shared )
endif()
if(UNIX)
set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
else()
set(SNDFILE_PATCH_CMD)
endif()
ExternalProject_Add(external_sndfile
URL ${SNDFILE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SNDFILE_HASH}
PREFIX ${BUILD_DIR}/sndfile
PATCH_COMMAND ${SNDFILE_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install
INSTALL_DIR ${LIBDIR}/sndfile
)
if(MSVC)
set_target_properties(external_sndfile PROPERTIES FOLDER Mingw)
endif()
add_dependencies(
external_sndfile
external_ogg
external_vorbis
)
if(UNIX)
add_dependencies(
external_sndfile
external_flac
)
endif()

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_spnav
URL ${SPNAV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${SPNAV_HASH}
PREFIX ${BUILD_DIR}/spnav
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/spnav --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make install
INSTALL_DIR ${LIBDIR}/spnav
)

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=Off
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
if(TBB_VERSION MATCHES 2018)
set(TBB_VS_VERSION vs2013)
elseif(TBB_VERSION MATCHES 2017)
set(TBB_VS_VERSION vs2012)
else()
set(TBB_VS_VERSION vs2010)
endif()
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
ExternalProject_Add(external_tbb
URL ${TBB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TBB_HASH}
PREFIX ${BUILD_DIR}/tbb
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/${TBB_VS_VERSION}/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tbb
)

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_theora
URL ${THEORA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${THEORA_HASH}
PREFIX ${BUILD_DIR}/theora
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
--disable-shared
--enable-static
--with-pic
--with-ogg=${LIBDIR}/ogg
--with-vorbis=${LIBDIR}/vorbis
--disable-examples
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make install
INSTALL_DIR ${LIBDIR}/theora
)
add_dependencies(
external_theora
external_vorbis
external_ogg
)
if(MSVC)
set_target_properties(external_theora PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,47 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_STATIC=ON
-DBUILD_SHARED_LIBS=OFF
-Dlzma=OFF
-Djbig=OFF
)
ExternalProject_Add(external_tiff
URL ${TIFF_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TIFF_HASH}
PREFIX ${BUILD_DIR}/tiff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tiff ${DEFAULT_CMAKE_FLAGS} ${TIFF_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tiff
)
add_dependencies(
external_tiff
external_zlib
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,257 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ZLIB_VERSION 1.2.8)
set(ZLIB_URI https://netcologne.dl.sourceforge.net/project/libpng/zlib/${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 44d667c142d7cda120332623eab69f40)
set(OPENAL_VERSION 1.17.2)
set(OPENAL_URI http://kcat.strangesoft.net/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 1764e0d8fec499589b47ebc724e0913d)
set(PNG_VERSION 1.6.21)
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.gz)
set(PNG_HASH aca36ec8e0a3b406a5912243bc243717)
set(JPEG_VERSION 1.4.2)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH f9804884c1c41eb7f4febb9353a2cb27)
set(BOOST_VERSION 1.60.0)
set(BOOST_VERSION_NODOTS 1_60_0)
set(BOOST_URI http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_NODOTS}.tar.bz2/download)
set(BOOST_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe)
set(BLOSC_VERSION 1.7.1)
set(BLOSC_URI https://github.com/Blosc/c-blosc/archive/v${BLOSC_VERSION}.zip)
set(BLOSC_HASH ff5cc729a5a25934ef714217218eed26)
set(PTHREADS_VERSION 2-9-1)
set(PTHREADS_URI ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-${PTHREADS_VERSION}-release.tar.gz)
set(PTHREADS_SHA512 9c06e85310766834370c3dceb83faafd397da18a32411ca7645c8eb6b9495fea54ca2872f4a3e8d83cb5fdc5dea7f3f0464be5bb9af3222a6534574a184bd551)
set(ILMBASE_VERSION 2.2.0)
set(ILMBASE_URI http://download.savannah.nongnu.org/releases/openexr/ilmbase-${ILMBASE_VERSION}.tar.gz)
set(ILMBASE_HASH b540db502c5fa42078249f43d18a4652)
set(OPENEXR_VERSION 2.2.0)
set(OPENEXR_URI http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz)
set(OPENEXR_HASH b64e931c82aa3790329c21418373db4e)
set(FREETYPE_VERSION 263)
set(FREETYPE_URI http://download.savannah.gnu.org/releases/freetype/ft${FREETYPE_VERSION}.zip)
set(FREETYPE_HASH 0db2a43301572e5c2b4a0864f237aeeb)
set(GLEW_VERSION 1.13.0)
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066)
set(FREEGLUT_VERSION 3.0.0)
set(FREEGLUT_URI http://pilotfiber.dl.sourceforge.net/project/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(HDF5_VERSION 1.8.17)
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
set(ALEMBIC_VERSION 1.7.1)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.zip)
set(ALEMBIC_MD5 cf7705055501d5ea0cb8256866496f79)
## hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
#latest uid in git as of 2016-04-01
set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
#latest uid in git as of 2016-04-01
set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(OPENSUBDIV_VERSION v3_1_1)
set(OPENSUBDIV_Hash 25a9a6a94136b0eb85ce69e9c8cb6ab3)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.zip)
set(SDL_VERSION 2.0.4)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 44fc4a023349933e7f5d7a582f7b886e)
set(OPENCOLLADA_VERSION v1.6.51)
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLLADA_HASH 23db5087faed4bc4cc1dfe456c0d4701)
set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/6de971097c7f552300f669ed69ca0b6cf5a70843.zip)
set(OPENCOLORIO_HASH c9de0fd98f26ce6f2e08d617ca68b8e4)
set(LLVM_VERSION 3.4.2)
set(LLVM_URI http://releases.llvm.org/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz)
set(LLVM_HASH a20669f75967440de949ac3b1bad439c)
set(CLANG_URI http://releases.llvm.org/${LLVM_VERSION}/cfe-${LLVM_VERSION}.src.tar.gz)
set(CLANG_HASH 87945973b7c73038871c5f849a818588)
set(OPENIMAGEIO_VERSION 1.7.15)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.zip)
set(OPENIMAGEIO_HASH_178 e156e3669af0e1373142ab5e8f13de66)
set(OPENIMAGEIO_HASH_179 4121cb0e0433bda6a7ef32c8628a149f)
set(OPENIMAGEIO_HASH_1713 42a662775b834161ba88c6abdb299360)
set(OPENIMAGEIO_HASH_1715 e2ece0f62c013d64c478f82265988b0b)
set(OPENIMAGEIO_HASH ${OPENIMAGEIO_HASH_1715})
set(TIFF_VERSION 4.0.6)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH d1d2e940dea0b5ad435f21f03d96dd72)
set(FLEXBISON_VERSION 2.5.5)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
set(OSL_VERSION 1.7.5)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.zip)
set(OSL_HASH 6924dd5d453159e7b6eb106a08c358cf)
set(PYTHON_VERSION 3.6.2)
set(PYTHON_SHORT_VERSION 3.6)
set(PYTHON_SHORT_VERSION_NO_DOTS 36)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 2c68846471994897278364fc18730dd9)
if(UNIX AND NOT APPLE)
# Needed to be compatible with GCC 7, other platforms can upgrade later
set(TBB_VERSION 2017_U7)
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH 364f2a4b80e978f38a69cbf7c466b898)
else()
set(TBB_VERSION 44_20160128)
set(TBB_URI https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${TBB_VERSION}oss_src_0.tgz)
set(TBB_HASH 9d8a4cdf43496f1b3f7c473a5248e5cc)
endif()
set(OPENVDB_VERSION 3.1.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 30a7e9571a03ab7bcf1a39fb62aa436f)
set(IDNA_VERSION 2.6)
set(CHARDET_VERSION 3.0.2)
set(URLLIB3_VERSION 1.22)
set(CERTIFI_VERSION 2017.7.27.1)
set(REQUESTS_VERSION 2.18.4)
set(NUMPY_VERSION v1.13.1)
set(NUMPY_SHORT_VERSION 1.13)
set(NUMPY_URI https://pypi.python.org/packages/c0/3a/40967d9f5675fbb097ffec170f59c2ba19fc96373e73ad47c2cae9a30aed/numpy-1.13.1.zip)
set(NUMPY_HASH 2c3c0f4edf720c3a7b525dacc825b9ae)
set(LAME_VERSION 3.99.5)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME_VERSION}.tar.gz)
set(LAME_HASH 84835b313d4a8b68f5349816d33e07ce)
set(OGG_VERSION 1.3.2)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692)
set(VORBIS_VERSION 1.3.5)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
set(VORBIS_HASH 6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce)
set(THEORA_VERSION 1.1.1)
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
set(FLAC_VERSION 1.3.1)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c)
set(VPX_VERSION 1.5.0)
set(VPX_URI http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-${VPX_VERSION}.tar.bz2)
set(VPX_HASH 306d67908625675f8e188d37a81fbfafdf5068b09d9aa52702b6fbe601c76797)
set(ORC_VERSION 0.4.25)
set(ORC_URI https://gstreamer.freedesktop.org/src/orc/orc-${ORC_VERSION}.tar.xz)
set(ORC_HASH c1b1d54a58f26d483f0b3881538984789fe5d5460ab8fab74a1cacbd3d1c53d1)
set(SCHROEDINGER_VERSION 1.0.11)
set(SCHROEDINGER_URI https://download.videolan.org/contrib/schroedinger/schroedinger-${SCHROEDINGER_VERSION}.tar.gz)
set(SCHROEDINGER_HASH 1e572a0735b92aca5746c4528f9bebd35aa0ccf8619b22fa2756137a8cc9f912)
set(X264_URI http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20160401-2245-stable.tar.bz2)
set(X264_HASH 1e9a7b835e80313aade53a9b6ff353e099de3856bf5f30a4d8dfc91281f786f5)
set(XVIDCORE_VERSION 1.3.4)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f)
#this has to be in sync with the version in blenders /extern folder
set(OPENJPEG_VERSION 1.5.2)
set(OPENJPEG_SHORT_VERSION 1.5)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d)
set(FAAD_VERSION 2-2.7)
set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.bz2)
set(FAAD_HASH 4c332fa23febc0e4648064685a3d4332)
set(FFMPEG_VERSION 3.2.1)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH cede174178e61f882844f5870c35ce72)
set(FFTW_VERSION 3.3.4)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 2edab8c06b24feeb3b82bbb3ebf3e7b3)
set(ICONV_VERSION 1.14)
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
set(ICONV_HASH e34509b1623cec449dfeb73d7ce9c6c6)
set(LAPACK_VERSION 3.6.0)
set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
set(LAPACK_HASH f2f6c67134e851fe189bb3ca1fbb5101)
set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
#set(HIDAPI_VERSION 0.8.0-rc1)
#set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
#set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
set(HIDAPI_UID 89a6c75dc6f45ecabd4ddfbd2bf5ba6ad8ba38b5)
set(HIDAPI_URI https://github.com/TheOnlyJoey/hidapi/archive/${HIDAPI_UID}.zip)
set(HIDAPI_HASH b6e22f6b514f8bcf594989f20ffc46fb)
set(WEBP_VERSION 0.5.1)
set(WEBP_URI https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_HASH 3d7db92ebba5b4f679413d25c6040881)
set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
set(JEMALLOC_VERSION 5.0.1)
set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
set(XML2_VERSION 2.9.4)
set(XML2_URI ftp://xmlsoft.org/libxml2/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)

View File

@@ -0,0 +1,41 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_vorbis
URL ${VORBIS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VORBIS_HASH}
PREFIX ${BUILD_DIR}/vorbis
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/vorbis
--disable-shared
--enable-static
--with-pic
--with-ogg=${LIBDIR}/ogg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vorbis/src/external_vorbis/ && make install
INSTALL_DIR ${LIBDIR}/vorbis
)
add_dependencies(
external_vorbis
external_ogg
)
if(MSVC)
set_target_properties(external_vorbis PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,60 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc)
else()
set(VPX_EXTRA_FLAGS --target=x86-win32-gcc)
endif()
else()
if(APPLE)
set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc)
else()
set(VPX_EXTRA_FLAGS --target=generic-gnu)
endif()
endif()
ExternalProject_Add(external_vpx
URL ${VPX_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${VPX_HASH}
PREFIX ${BUILD_DIR}/vpx
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/vpx/src/external_vpx/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/vpx
--disable-shared
--enable-static
--disable-install-bins
--disable-install-srcs
--disable-sse4_1
--disable-sse3
--disable-ssse3
--disable-avx
--disable-avx2
--disable-unit-tests
--disable-examples
${VPX_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install
INSTALL_DIR ${LIBDIR}/vpx
)
if(MSVC)
set_target_properties(external_vpx PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,50 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(WEBP_EXTRA_ARGS
-DWEBP_HAVE_SSE2=ON
-DWEBP_HAVE_SSE41=OFF
-DWEBP_HAVE_AVX2=OFF
)
if(WIN32)
set(WEBP_BUILD_DIR ${BUILD_MODE}/)
else()
set(WEBP_BUILD_DIR)
endif()
ExternalProject_Add(external_webp
URL ${WEBP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${WEBP_HASH}
PREFIX ${BUILD_DIR}/webp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp-build/${WEBP_BUILD_DIR}${LIBPREFIX}webp${LIBEXT} ${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/decode.h ${LIBDIR}/webp/include/webp/decode.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/encode.h ${LIBDIR}/webp/include/webp/encode.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/demux.h ${LIBDIR}/webp/include/webp/demux.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/extras.h ${LIBDIR}/webp/include/webp/extras.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/format_constants.h ${LIBDIR}/webp/include/webp/format_constants.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux.h ${LIBDIR}/webp/include/webp/mux.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/mux_types.h ${LIBDIR}/webp/include/webp/mux_types.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/webp/src/external_webp/src/webp/types.h ${LIBDIR}/webp/include/webp/types.h
INSTALL_DIR ${LIBDIR}/webp
)

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})
endif()
ExternalProject_Add(external_x264
URL ${X264_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic
--disable-lavf
${X264_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && make install
INSTALL_DIR ${LIBDIR}/x264
)
if(MSVC)
set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,36 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_xml2
URL ${XML2_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${XML2_HASH}
PREFIX ${BUILD_DIR}/xml2
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && ${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/xml2
--disable-shared
--enable-static
--with-pic
--with-python=no
--with-lzma=no
--with-zlib=no
--with-iconv=no
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xml2/src/external_xml2/ && make install
INSTALL_DIR ${LIBDIR}/xml2
)

View File

@@ -0,0 +1,44 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(XVIDCORE_EXTRA_ARGS --host=${MINGW_HOST})
endif()
ExternalProject_Add(external_xvidcore
URL ${XVIDCORE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${XVIDCORE_HASH}
PREFIX ${BUILD_DIR}/xvidcore
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/xvidcore ${XVIDCORE_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/* && # clean because re-installing fails otherwise
cd ${BUILD_DIR}/xvidcore/src/external_xvidcore/build/generic && make install
INSTALL_DIR ${LIBDIR}/xvidcore
)
ExternalProject_Add_Step(external_xvidcore after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
DEPENDEES install
)
if(MSVC)
set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw)
endif()

View File

@@ -0,0 +1,33 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib
)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_zlib_mingw
URL ${ZLIB_URI}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib_mingw
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/ && make -f win32/makefile.gcc -j${MAKE_THREADS}
INSTALL_COMMAND echo .
INSTALL_DIR ${LIBDIR}/zlib_mingw
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_zlib_mingw after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/zlib_mingw/src/external_zlib_mingw/libz.a ${LIBDIR}/zlib/lib/z.lib
DEPENDEES install
)
endif()
if(MSVC)
set_target_properties(external_zlib_mingw PROPERTIES FOLDER Mingw)
endif()

View File

@@ -25,8 +25,8 @@
ARGS=$( \
getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
with-all,with-opencollada,\
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
with-all,with-opencollada,with-jack,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
force-all,force-python,force-numpy,force-boost,\
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
@@ -104,11 +104,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--no-confirm
Disable any interaction with user (suitable for automated run).
--use-cxx11
Build all libraries in cpp11 'mode' (will be mandatory soon in blender2.8 branch).
NOTE: If your compiler is gcc-6.0 or above, you probably *want* to enable this option (since it's default
standard starting from this version).
--with-all
By default, a number of optional and not-so-often needed libraries are not installed.
This option will try to install them, at the cost of potential conflicts (depending on
@@ -118,6 +113,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--with-opencollada
Build and install the OpenCOLLADA libraries.
--with-jack
Install the jack libraries.
--ver-ocio=<ver>
Force version of OCIO library.
@@ -287,15 +285,15 @@ SUDO="sudo"
NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=false
USE_CXX11=true # Mandatory in blender2.8
PYTHON_VERSION="3.5.2"
PYTHON_VERSION_MIN="3.5"
PYTHON_VERSION="3.6.2"
PYTHON_VERSION_MIN="3.6"
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
NUMPY_VERSION="1.10.1"
NUMPY_VERSION="1.13.1"
NUMPY_VERSION_MIN="1.8"
NUMPY_FORCE_BUILD=false
NUMPY_FORCE_REBUILD=false
@@ -322,8 +320,8 @@ OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="1.7.13"
OIIO_VERSION_MIN="1.7.13"
OIIO_VERSION="1.7.15"
OIIO_VERSION_MIN="1.7.15"
OIIO_VERSION_MAX="1.9.0" # UNKNOWN currently # Not supported by current OSL...
OIIO_FORCE_BUILD=false
OIIO_FORCE_REBUILD=false
@@ -366,8 +364,7 @@ ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
# Version??
OPENCOLLADA_VERSION="1.3"
OPENCOLLADA_VERSION="1.6.51"
OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
@@ -499,15 +496,15 @@ while true; do
--no-confirm)
NO_CONFIRM=true; shift; continue
;;
--use-cxx11)
USE_CXX11=true; shift; continue
;;
--with-all)
WITH_ALL=true; shift; continue
;;
--with-opencollada)
WITH_OPENCOLLADA=true; shift; continue
;;
--with-jack)
WITH_JACK=true; shift; continue;
;;
--ver-ocio)
OCIO_VERSION="$2"
OCIO_VERSION_MIN=$OCIO_VERSION
@@ -711,6 +708,9 @@ done
if [ "$WITH_ALL" = true -a "$OPENCOLLADA_SKIP" = false ]; then
WITH_OPENCOLLADA=true
fi
if [ "$WITH_ALL" = true ]; then
WITH_JACK=true
fi
WARNING "****WARNING****"
@@ -731,13 +731,16 @@ PRINT ""
# This has to be done here, because user might force some versions...
PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
NUMPY_SOURCE=( "https://github.com/numpy/numpy/releases/download/v$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options"
OCIO_USE_REPO=true
OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
OCIO_SOURCE_REPO=( "https://github.com/imageworks/OpenColorIO.git" )
OCIO_SOURCE_REPO_UID="6de971097c7f552300f669ed69ca0b6cf5a70843"
OPENEXR_USE_REPO=false
OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
@@ -750,8 +753,8 @@ OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
LLVM_SOURCE=( "http://releases.llvm.org/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://releases.llvm.org/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
OSL_USE_REPO=false
OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
@@ -786,14 +789,14 @@ ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.
# ALEMBIC_SOURCE_REPO_BRANCH="master"
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
OPENCOLLADA_REPO_UID="0c2cdc17c22cf42050e4d42154bed2176363549c"
OPENCOLLADA_REPO_BRANCH="master"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
CXXFLAGS_BACK=$CXXFLAGS
if [ "$USE_CXX11" = true ]; then
WARNING "You are trying to use c++11, this *should* go smoothely with any very recent distribution
WARNING "C++11 is now mandatory for blender2.8, this *should* go smoothly with any very recent distribution.
However, if you are experiencing linking errors (also when building Blender itself), please try the following:
* Re-run this script with '--build-all --force-all' options.
* Ensure your gcc version is at the very least 4.8, if possible you should really rather use gcc-5.1 or above.
@@ -1149,7 +1152,7 @@ compile_Numpy() {
cd $_src
$_python/bin/python3 setup.py install --prefix=$_inst
$_python/bin/python3 setup.py install --old-and-unmanageable --prefix=$_inst
if [ -d $_inst ]; then
# Can't use _create_inst_shortcut here...
@@ -1251,7 +1254,11 @@ compile_Boost() {
#### Build OCIO ####
_init_ocio() {
_src=$SRC/OpenColorIO-$OCIO_VERSION
_git=false
if [ "$OCIO_USE_REPO" = true ]; then
_git=true
else
_git=false
fi
_inst=$INST/ocio-$OCIO_VERSION
_inst_shortcut=$INST/ocio
}
@@ -1268,7 +1275,7 @@ compile_OCIO() {
fi
# To be changed each time we make edits that would modify the compiled result!
ocio_magic=1
ocio_magic=2
_init_ocio
# Clean install if needed!
@@ -1285,14 +1292,27 @@ compile_OCIO() {
if [ ! -d $_src ]; then
INFO "Downloading OpenColorIO-$OCIO_VERSION"
mkdir -p $SRC
download OCIO_SOURCE[@] $_src.tar.gz
INFO "Unpacking OpenColorIO-$OCIO_VERSION"
tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
-xf $_src.tar.gz
if [ "$OCIO_USE_REPO" = true ]; then
git clone ${OCIO_SOURCE_REPO[0]} $_src
else
download OCIO_SOURCE[@] $_src.tar.gz
INFO "Unpacking OpenColorIO-$OCIO_VERSION"
tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
-xf $_src.tar.gz
fi
fi
cd $_src
if [ "$OCIO_USE_REPO" = true ]; then
# XXX For now, always update from latest repo...
git pull origin master
git checkout $OCIO_SOURCE_REPO_UID
git reset --hard
fi
# Always refresh the whole build!
if [ -d build ]; then
rm -rf build
@@ -1498,7 +1518,6 @@ compile_OPENEXR() {
if [ "$OPENEXR_USE_REPO" = true ]; then
# XXX For now, always update from latest repo...
git pull origin master
# Stick to same rev as windows' libs...
git checkout $OPENEXR_SOURCE_REPO_UID
git reset --hard
oiio_src_path="../OpenEXR"
@@ -1576,7 +1595,7 @@ compile_OIIO() {
fi
# To be changed each time we make edits that would modify the compiled result!
oiio_magic=16
oiio_magic=17
_init_oiio
# Clean install if needed!
@@ -1631,7 +1650,6 @@ compile_OIIO() {
cmake_d="$cmake_d -D LINKSTATIC=OFF"
cmake_d="$cmake_d -D USE_SIMD=sse2"
cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
cmake_d="$cmake_d -D OPENEXR_VERSION=$OPENEXR_VERSION"
if [ "$_with_built_openexr" = true ]; then
@@ -1640,6 +1658,9 @@ compile_OIIO() {
INFO "ILMBASE_HOME=$INST/openexr"
fi
# ptex is only needed when nicholas bishop is ready
cmake_d="$cmake_d -D USE_PTEX=OFF"
# Optional tests and cmd tools
cmake_d="$cmake_d -D USE_QT=OFF"
cmake_d="$cmake_d -D USE_PYTHON=OFF"
@@ -1647,6 +1668,7 @@ compile_OIIO() {
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
cmake_d="$cmake_d -D TXT2MAN="
#cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
#cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
@@ -1751,7 +1773,7 @@ compile_LLVM() {
cd $_src
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/llvm.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_llvm.diff"
cd $CWD
@@ -1857,7 +1879,7 @@ compile_OSL() {
git reset --hard
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/install_deps_patches/osl.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_osl.diff"
fi
# Always refresh the whole build!
@@ -2601,7 +2623,6 @@ install_DEB() {
fi
# These libs should always be available in debian/ubuntu official repository...
OPENJPEG_DEV="libopenjpeg-dev"
VORBIS_DEV="libvorbis-dev"
OGG_DEV="libogg-dev"
THEORA_DEV="libtheora-dev"
@@ -2609,16 +2630,24 @@ install_DEB() {
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
git libfreetype6-dev libx11-dev flex bison libtbb-dev libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
# libglewmx-dev (broken in deb testing currently...)
OPENJPEG_USE=true
VORBIS_USE=true
OGG_USE=true
THEORA_USE=true
PRINT ""
# New Ubuntu crap (17.04 and more) have no openjpeg lib!
OPENJPEG_DEV="libopenjpeg-dev"
check_package_DEB $OPENJPEG_DEV
if [ $? -eq 0 ]; then
_packages="$_packages $OPENJPEG_DEV"
OPENJPEG_USE=true
fi
PRINT ""
# Some not-so-old distro (ubuntu 12.4) do not have it, do not fail in this case, just warn.
YAMLCPP_DEV="libyaml-cpp-dev"
@@ -2631,7 +2660,7 @@ install_DEB() {
PRINT ""
fi
if [ "$WITH_ALL" = true ]; then
if [ "$WITH_JACK" = true ]; then
_packages="$_packages libspnav-dev"
# Only install jack if jack2 is not already installed!
JACK="libjack-dev"
@@ -2648,10 +2677,10 @@ install_DEB() {
install_packages_DEB $_packages
PRINT""
SNDFILE_DEV="libsndfile1-dev"
check_package_DEB $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile1-dev"
check_package_DEB $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_DEB $SNDFILE_DEV
install_packages_DEB $LIBSNDFILE_DEV
fi
PRINT ""
@@ -3168,7 +3197,7 @@ install_RPM() {
if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then
_packages="$_packages freetype-devel tbb-devel"
if [ "$WITH_ALL" = true ]; then
if [ "$WITH_JACK" = true ]; then
_packages="$_packages jack-audio-connection-kit-devel"
fi
@@ -3246,10 +3275,10 @@ install_RPM() {
fi
PRINT""
SNDFILE_DEV="libsndfile-devel"
check_package_RPM $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile-devel"
check_package_RPM $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_RPM $SNDFILE_DEV
install_packages_RPM $LIBSNDFILE_DEV
fi
if [ "$WITH_ALL" = true ]; then
@@ -3642,17 +3671,21 @@ install_ARCH() {
THEORA_USE=true
if [ "$WITH_ALL" = true ]; then
_packages="$_packages jack libspnav"
_packages="$_packages libspnav"
fi
if [ "$WITH_JACK" = true ]; then
_packages="$_packages jack"
fi
PRINT ""
install_packages_ARCH $_packages
PRINT""
SNDFILE_DEV="libsndfile"
check_package_ARCH $SNDFILE_DEV
LIBSNDFILE_DEV="libsndfile"
check_package_ARCH $LIBSNDFILE_DEV
if [ $? -eq 0 ]; then
install_packages_ARCH $SNDFILE_DEV
install_packages_ARCH $LIBSNDFILE_DEV
fi
PRINT ""
@@ -4304,6 +4337,14 @@ print_info() {
_buildargs="$_buildargs $_1"
fi
if [ "$WITH_JACK" = true ]; then
_1="-D WITH_JACK=ON"
_2="-D WITH_JACK_DYNLOAD=ON"
PRINT " $_1"
PRINT " $_2"
_buildargs="$_buildargs $_1 $_2"
fi
if [ "$ALEMBIC_SKIP" = false ]; then
_1="-D WITH_ALEMBIC=ON"
PRINT " $_1"

View File

@@ -0,0 +1,35 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e09c57..26565ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ IF (NOT ${ALEMBIC_LIB_USES_TR1} AND NOT ${ALEMBIC_LIB_USES_BOOST})
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
- IF (COMPILER_SUPPORTS_CXX1X)
+ IF (COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF (COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
--- a/lib/Alembic/AbcCoreOgawa/StreamManager.cpp
+++ b/lib/Alembic/AbcCoreOgawa/StreamManager.cpp
@@ -47,7 +47,18 @@
#define COMPARE_EXCHANGE( V, COMP, EXCH ) V.compare_exchange_weak( COMP, EXCH, std::memory_order_seq_cst, std::memory_order_seq_cst )
// Windows
#elif defined( _MSC_VER )
-#define COMPARE_EXCHANGE( V, COMP, EXCH ) InterlockedCompareExhange64( &V, EXCH, COMP ) == COMP
+#define COMPARE_EXCHANGE( V, COMP, EXCH ) InterlockedCompareExchange64( &V, EXCH, COMP ) == COMP
+int ffsll(long long value)
+{
+ if (!value)
+ return 0;
+
+ for (int bit = 0; bit < 63; bit++)
+ {
+ if (value & (1 << bit))
+ return bit + 1;
+ }
+}
// gcc 4.8 and above not using C++11
#elif defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8
#define COMPARE_EXCHANGE( V, COMP, EXCH ) __atomic_compare_exchange_n( &V, &COMP, EXCH, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST )

View File

@@ -0,0 +1,33 @@
diff -Naur src/blosc/CMakeLists.txt external_blosc/blosc/CMakeLists.txt
--- src/blosc/CMakeLists.txt 2016-02-03 10:26:28 -0700
+++ external_blosc/blosc/CMakeLists.txt 2017-03-03 09:03:31 -0700
@@ -61,6 +61,8 @@
set(SOURCES ${SOURCES} win32/pthread.c)
else(NOT Threads_FOUND)
set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
+ set(LIBS ${LIBS} ${PTHREAD_LIBS})
+ include_directories( ${PTHREAD_INCLUDE_DIR} )
endif(NOT Threads_FOUND)
else(WIN32)
find_package(Threads REQUIRED)
diff -Naur src/blosc/blosc.c external_blosc/blosc/blosc.c
--- src/blosc/blosc.c 2016-02-03 10:26:28 -0700
+++ external_blosc/blosc/blosc.c 2017-03-03 09:01:50 -0700
@@ -49,12 +49,12 @@
#include <inttypes.h>
#endif /* _WIN32 */
-#if defined(_WIN32) && !defined(__GNUC__)
- #include "win32/pthread.h"
- #include "win32/pthread.c"
-#else
+//#if defined(_WIN32) && !defined(__GNUC__)
+// #include "win32/pthread.h"
+ //#include "win32/pthread.c"
+//#else
#include <pthread.h>
-#endif
+//#endif
/* If C11 is supported, use it's built-in aligned allocation. */
#if __STDC_VERSION__ >= 201112L

View File

@@ -0,0 +1,37 @@
--- a/boost/config/compiler/visualc.hpp 2015-12-08 11:55:19 -0700
+++ b/boost/config/compiler/visualc.hpp 2018-03-17 10:29:52 -0600
@@ -287,12 +287,3 @@
# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
#endif
-//
-// last known and checked version is 19.00.23026 (VC++ 2015 RTM):
-#if (_MSC_VER > 1900)
-# if defined(BOOST_ASSERT_CONFIG)
-# error "Unknown compiler version - please run the configure tests and report the results"
-# else
-# pragma message("Unknown compiler version - please run the configure tests and report the results")
-# endif
-#endif
--- a/boost/type_traits/has_nothrow_assign.hpp 2015-12-13 05:49:42 -0700
+++ b/boost/type_traits/has_nothrow_assign.hpp 2018-05-27 11:11:02 -0600
@@ -24,7 +24,7 @@
#include <boost/type_traits/remove_reference.hpp>
#endif
#endif
-#if defined(__GNUC__) || defined(__SUNPRO_CC)
+#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__)
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_volatile.hpp>
#include <boost/type_traits/is_assignable.hpp>
--- a/boost/type_traits/has_nothrow_constructor.hpp 2015-12-13 05:49:42 -0700
+++ b/boost/type_traits/has_nothrow_constructor.hpp 2018-05-27 11:11:02 -0600
@@ -17,7 +17,7 @@
#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
#include <boost/type_traits/has_trivial_constructor.hpp>
#endif
-#if defined(__GNUC__ ) || defined(__SUNPRO_CC)
+#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__)
#include <boost/type_traits/is_default_constructible.hpp>
#endif

View File

@@ -0,0 +1,127 @@
--- cfe/trunk/lib/Serialization/ASTWriter.cpp
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp
@@ -56,14 +56,14 @@
using namespace clang::serialization;
template <typename T, typename Allocator>
-static StringRef bytes(const std::vector<T, Allocator> &v) {
+static StringRef data(const std::vector<T, Allocator> &v) {
if (v.empty()) return StringRef();
return StringRef(reinterpret_cast<const char*>(&v[0]),
sizeof(T) * v.size());
}
template <typename T>
-static StringRef bytes(const SmallVectorImpl<T> &v) {
+static StringRef data(const SmallVectorImpl<T> &v) {
return StringRef(reinterpret_cast<const char*>(v.data()),
sizeof(T) * v.size());
}
@@ -1385,7 +1385,7 @@
Record.push_back(INPUT_FILE_OFFSETS);
Record.push_back(InputFileOffsets.size());
Record.push_back(UserFilesNum);
- Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, bytes(InputFileOffsets));
+ Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, data(InputFileOffsets));
}
//===----------------------------------------------------------------------===//
@@ -1771,7 +1771,7 @@
Record.push_back(SOURCE_LOCATION_OFFSETS);
Record.push_back(SLocEntryOffsets.size());
Record.push_back(SourceMgr.getNextLocalOffset() - 1); // skip dummy
- Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, bytes(SLocEntryOffsets));
+ Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, data(SLocEntryOffsets));
// Write the source location entry preloads array, telling the AST
// reader which source locations entries it should load eagerly.
@@ -2087,7 +2087,7 @@
Record.push_back(MacroOffsets.size());
Record.push_back(FirstMacroID - NUM_PREDEF_MACRO_IDS);
Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record,
- bytes(MacroOffsets));
+ data(MacroOffsets));
}
void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {
@@ -2185,7 +2185,7 @@
Record.push_back(PPD_ENTITIES_OFFSETS);
Record.push_back(FirstPreprocessorEntityID - NUM_PREDEF_PP_ENTITY_IDS);
Stream.EmitRecordWithBlob(PPEOffsetAbbrev, Record,
- bytes(PreprocessedEntityOffsets));
+ data(PreprocessedEntityOffsets));
}
}
@@ -2548,7 +2548,7 @@
Record.push_back(CXX_BASE_SPECIFIER_OFFSETS);
Record.push_back(CXXBaseSpecifiersOffsets.size());
Stream.EmitRecordWithBlob(BaseSpecifierOffsetAbbrev, Record,
- bytes(CXXBaseSpecifiersOffsets));
+ data(CXXBaseSpecifiersOffsets));
}
//===----------------------------------------------------------------------===//
@@ -2623,7 +2623,7 @@
Decls.push_back(std::make_pair((*D)->getKind(), GetDeclRef(*D)));
++NumLexicalDeclContexts;
- Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, bytes(Decls));
+ Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, data(Decls));
return Offset;
}
@@ -2642,7 +2642,7 @@
Record.push_back(TYPE_OFFSET);
Record.push_back(TypeOffsets.size());
Record.push_back(FirstTypeID - NUM_PREDEF_TYPE_IDS);
- Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets));
+ Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, data(TypeOffsets));
// Write the declaration offsets array
Abbrev = new BitCodeAbbrev();
@@ -2655,7 +2655,7 @@
Record.push_back(DECL_OFFSET);
Record.push_back(DeclOffsets.size());
Record.push_back(FirstDeclID - NUM_PREDEF_DECL_IDS);
- Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets));
+ Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, data(DeclOffsets));
}
void ASTWriter::WriteFileDeclIDsMap() {
@@ -2680,7 +2680,7 @@
unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);
Record.push_back(FILE_SORTED_DECLS);
Record.push_back(FileSortedIDs.size());
- Stream.EmitRecordWithBlob(AbbrevCode, Record, bytes(FileSortedIDs));
+ Stream.EmitRecordWithBlob(AbbrevCode, Record, data(FileSortedIDs));
}
void ASTWriter::WriteComments() {
@@ -2893,7 +2893,7 @@
Record.push_back(SelectorOffsets.size());
Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS);
Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,
- bytes(SelectorOffsets));
+ data(SelectorOffsets));
}
}
@@ -3253,7 +3253,7 @@
Record.push_back(IdentifierOffsets.size());
Record.push_back(FirstIdentID - NUM_PREDEF_IDENT_IDS);
Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record,
- bytes(IdentifierOffsets));
+ data(IdentifierOffsets));
}
//===----------------------------------------------------------------------===//
@@ -4046,7 +4046,7 @@
Record.clear();
Record.push_back(TU_UPDATE_LEXICAL);
Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,
- bytes(NewGlobalDecls));
+ data(NewGlobalDecls));
// And a visible updates block for the translation unit.
Abv = new llvm::BitCodeAbbrev();

View File

@@ -0,0 +1,72 @@
# - Find BLOSC library
# Find the native BLOSC includes and library
# This module defines
# BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
# BLOSC is found.
# BLOSC_LIBRARIES, libraries to link against to use BLOSC.
# BLOSC_ROOT_DIR, The base directory to search for BLOSC.
# This can also be an environment variable.
# BLOSC_FOUND, If false, do not try to use BLOSC.
#
# also defined, but not for general use are
# BLOSC_LIBRARY, where to find the BLOSC library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If BLOSC_ROOT_DIR was defined in the environment, use it.
IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
ENDIF()
SET(_blosc_SEARCH_DIRS
${BLOSC_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/blosc
)
FIND_PATH(BLOSC_INCLUDE_DIR
NAMES
blosc.h
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(BLOSC_LIBRARY
NAMES
blosc
HINTS
${_blosc_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)
SET(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
SET(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
ELSE()
SET(BLOSC_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
BLOSC_INCLUDE_DIR
BLOSC_LIBRARY
)

View File

@@ -0,0 +1,72 @@
# - Find CPPUNIT library
# Find the native CPPUNIT includes and library
# This module defines
# CPPUNIT_INCLUDE_DIRS, where to find cppunit.h, Set when
# CPPUNIT is found.
# CPPUNIT_LIBRARIES, libraries to link against to use CPPUNIT.
# CPPUNIT_ROOT_DIR, The base directory to search for CPPUNIT.
# This can also be an environment variable.
# CPPUNIT_FOUND, If false, do not try to use CPPUNIT.
#
# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CPPUNIT library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If CPPUNIT_ROOT_DIR was defined in the environment, use it.
IF(NOT CPPUNIT_ROOT_DIR AND NOT $ENV{CPPUNIT_ROOT_DIR} STREQUAL "")
SET(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR})
ENDIF()
SET(_cppunit_SEARCH_DIRS
${CPPUNIT_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/cppunit
)
FIND_PATH(CPPUNIT_INCLUDE_DIR
NAMES
cppunit/Test.h
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(CPPUNIT_LIBRARY
NAMES
cppunit
HINTS
${_cppunit_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG
CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR)
IF(CPPUNIT_FOUND)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
SET(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR})
ELSE()
SET(CPPUNIT_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
CPPUNIT_INCLUDE_DIR
CPPUNIT_LIBRARY
)

View File

@@ -0,0 +1,264 @@
# Module to find IlmBase
#
# This module will first look into the directories defined by the variables:
# - ILMBASE_HOME, ILMBASE_VERSION, ILMBASE_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom IlmBase:
# - Set the variable ILMBASE_CUSTOM to True
# - Set the variable ILMBASE_CUSTOM_LIBRARIES to a list of the libraries to
# use, e.g. "SpiImath SpiHalf SpiIlmThread SpiIex"
# - Optionally set the variable ILMBASE_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable ILMBASE_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# ILMBASE_INCLUDE_DIR - where to find half.h, IlmBaseConfig.h, etc.
# ILMBASE_LIBRARIES - list of libraries to link against when using IlmBase.
# ILMBASE_FOUND - True if IlmBase was found.
# Other standarnd issue macros
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)
include(SelectLibraryConfigurations)
if( ILMBASE_USE_STATIC_LIBS )
set( _ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro(SET_STATE_VAR varname)
set(tmp_ilmbaselibs ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(tmp_ilmbaselibs)
set(tmp_lst
${ILMBASE_CUSTOM} | ${tmp_ilmbaselibs} |
${ILMBASE_HOME} | ${ILMBASE_VERSION} | ${ILMBASE_LIB_AREA}
)
set(${varname} "${tmp_lst}")
unset(tmp_ilmbaselibs)
unset(tmp_lst)
endmacro()
# To enforce that find_* functions do not use inadvertently existing versions
if(ILMBASE_CUSTOM)
set(ILMBASE_FIND_OPTIONS "NO_DEFAULT_PATH")
endif()
# Macro to search for an include directory
macro(PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string(TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${ILMBASE_FIND_OPTIONS}
)
if(${tmp_varname})
mark_as_advanced(${tmp_varname})
endif()
unset(tmp_varname)
endmacro()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string(TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${ILMBASE_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations(${tmp_prefix})
list(APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list(APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced(
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset(tmp_prefix)
endmacro()
# Encode the current state of the external variables into a string
SET_STATE_VAR(ILMBASE_CURRENT_STATE)
# If the state has changed, clear the cached variables
if(ILMBASE_CACHED_STATE AND
NOT ILMBASE_CACHED_STATE STREQUAL ILMBASE_CURRENT_STATE)
foreach(libvar ${ILMBASE_CACHED_VARS})
unset(${libvar} CACHE)
endforeach()
endif()
# Generic search paths
set(IlmBase_generic_include_paths
${ILMBASE_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/sw/include
/opt/local/include
)
set(IlmBase_generic_library_paths
${ILMBASE_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/sw/lib
/opt/local/lib
)
# Search paths for the IlmBase files
if(ILMBASE_HOME)
if(ILMBASE_VERSION)
set(IlmBase_include_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/include
${ILMBASE_HOME}/include/ilmbase-${ILMBASE_VERSION}
)
set(IlmBase_library_paths
${ILMBASE_HOME}/ilmbase-${ILMBASE_VERSION}/lib
${ILMBASE_HOME}/lib/ilmbase-${ILMBASE_VERSION}
)
endif()
list(APPEND IlmBase_include_paths ${ILMBASE_HOME}/include)
set(IlmBase_library_paths
${ILMBASE_HOME}/lib
${ILMBASE_HOME}/lib64
${ILMBASE_LIB_AREA}
${IlmBase_library_paths})
endif()
list(APPEND IlmBase_include_paths ${IlmBase_generic_include_paths})
list(APPEND IlmBase_library_paths ${IlmBase_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR(IlmBase
OpenEXR/IlmBaseConfig.h IlmBase_include_paths)
if(ILMBASE_INCLUDE_DIR)
# Get the version from config file, if not already set.
if(NOT ILMBASE_VERSION)
FILE(STRINGS "${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h" ILMBASE_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(ILMBASE_BUILD_SPECIFICATION)
if(NOT IlmBase_FIND_QUIETLY)
message(STATUS "${ILMBASE_BUILD_SPECIFICATION}")
endif()
string(REGEX REPLACE ".*#define[ \t]+ILMBASE_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()
endif()
endif()
if(ILMBASE_CUSTOM)
if(NOT ILMBASE_CUSTOM_LIBRARIES)
message(FATAL_ERROR "Custom IlmBase libraries requested but ILMBASE_CUSTOM_LIBRARIES is not set.")
endif()
set(IlmBase_Libraries ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(IlmBase_Libraries)
else()
#elseif(${ILMBASE_VERSION} VERSION_LESS "2.1")
set(IlmBase_Libraries Half Iex Imath IlmThread)
#else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries Half Iex-${_ilmbase_libs_ver} Imath-${_ilmbase_libs_ver} IlmThread-${_ilmbase_libs_ver})
endif()
# Locate the IlmBase libraries
set(IlmBase_libvars "")
set(IlmBase_cachevars "")
foreach(ilmbase_lib ${IlmBase_Libraries})
PREFIX_FIND_LIB(IlmBase ${ilmbase_lib}
IlmBase_library_paths IlmBase_libvars IlmBase_cachevars)
endforeach()
# Create the list of variables that might need to be cleared
set(ILMBASE_CACHED_VARS
ILMBASE_INCLUDE_DIR ${IlmBase_cachevars}
CACHE INTERNAL "Variables set by FindIlmBase.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set(ILMBASE_CACHED_STATE ${ILMBASE_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindIlmBase.cmake" FORCE)
# Link with pthreads if required
if(NOT WIN32 AND EXISTS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h)
file(STRINGS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h
ILMBASE_HAVE_PTHREAD
REGEX "^[ \\t]*#define[ \\t]+HAVE_PTHREAD[ \\t]1[ \\t]*\$"
)
if(ILMBASE_HAVE_PTHREAD)
find_package(Threads)
if(CMAKE_USE_PTHREADS_INIT)
set(ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
endif()
endif()
endif()
# Use the standard function to handle ILMBASE_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IlmBase DEFAULT_MSG
ILMBASE_INCLUDE_DIR ${IlmBase_libvars})
if(ILMBASE_FOUND)
set(ILMBASE_LIBRARIES "")
foreach(tmplib ${IlmBase_libvars})
list(APPEND ILMBASE_LIBRARIES ${${tmplib}})
endforeach()
list(APPEND ILMBASE_LIBRARIES ${ILMBASE_PTHREADS})
if(NOT IlmBase_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE(ILMBASE
"Found IlmBase: ${ILMBASE_LIBRARIES}"
"[${ILMBASE_INCLUDE_DIR}][${ILMBASE_LIBRARIES}][${ILMBASE_CURRENT_STATE}]"
)
endif()
endif()
# Restore the original find library ordering
if( ILMBASE_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ilmbase_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset(ILMBASE_CURRENT_STATE)
unset(IlmBase_include_paths)
unset(IlmBase_library_paths)
unset(IlmBase_generic_include_paths)
unset(IlmBase_generic_library_paths)
unset(IlmBase_libvars)
unset(IlmBase_cachevars)
unset(ILMBASE_PTHREADS)

View File

@@ -0,0 +1,72 @@
# - Find LOGC4PLUS library
# Find the native LOGC4PLUS includes and library
# This module defines
# LOGC4PLUS_INCLUDE_DIRS, where to find logc4plus.h, Set when
# LOGC4PLUS is found.
# LOGC4PLUS_LIBRARIES, libraries to link against to use LOGC4PLUS.
# LOGC4PLUS_ROOT_DIR, The base directory to search for LOGC4PLUS.
# This can also be an environment variable.
# LOGC4PLUS_FOUND, If false, do not try to use LOGC4PLUS.
#
# also defined, but not for general use are
# LOGC4PLUS_LIBRARY, where to find the LOGC4PLUS library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If LOGC4PLUS_ROOT_DIR was defined in the environment, use it.
IF(NOT LOGC4PLUS_ROOT_DIR AND NOT $ENV{LOGC4PLUS_ROOT_DIR} STREQUAL "")
SET(LOGC4PLUS_ROOT_DIR $ENV{LOGC4PLUS_ROOT_DIR})
ENDIF()
SET(_logc4plus_SEARCH_DIRS
${LOGC4PLUS_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/logc4plus
)
FIND_PATH(LOGC4PLUS_INCLUDE_DIR
NAMES
logc4plus.h
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LOGC4PLUS_LIBRARY
NAMES
logc4plus
HINTS
${_logc4plus_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LOGC4PLUS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LOGC4PLUS DEFAULT_MSG
LOGC4PLUS_LIBRARY LOGC4PLUS_INCLUDE_DIR)
IF(LOGC4PLUS_FOUND)
SET(LOGC4PLUS_LIBRARIES ${LOGC4PLUS_LIBRARY})
SET(LOGC4PLUS_INCLUDE_DIRS ${LOGC4PLUS_INCLUDE_DIR})
ELSE()
SET(LOGC4PLUS_LOGC4PLUS_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
LOGC4PLUS_INCLUDE_DIR
LOGC4PLUS_LIBRARY
)

View File

@@ -0,0 +1,246 @@
# Module to find OpenEXR.
#
# This module will first look into the directories defined by the variables:
# - OPENEXR_HOME, OPENEXR_VERSION, OPENEXR_LIB_AREA
#
# It also supports non-standard names for the library components.
#
# To use a custom OpenEXR
# - Set the variable OPENEXR_CUSTOM to True
# - Set the variable OPENEXR_CUSTOM_LIBRARY to the name of the library to
# use, e.g. "SpiIlmImf"
# - Optionally set the variable OPENEXR_CUSTOM_INCLUDE_DIR to any
# particularly weird place that the OpenEXR/*.h files may be found
# - Optionally set the variable OPENEXR_CUSTOM_LIB_DIR to any
# particularly weird place that the libraries files may be found
#
# This module defines the following variables:
#
# OPENEXR_INCLUDE_DIR - where to find ImfRgbaFile.h, OpenEXRConfig, etc.
# OPENEXR_LIBRARIES - list of libraries to link against when using OpenEXR.
# This list does NOT include the IlmBase libraries.
# These are defined by the FindIlmBase module.
# OPENEXR_FOUND - True if OpenEXR was found.
# Other standarnd issue macros
include(SelectLibraryConfigurations)
include(FindPackageHandleStandardArgs)
include(FindPackageMessage)
if(OPENEXR_USE_STATIC_LIBS)
set(_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
endif()
endif()
# Macro to assemble a helper state variable
macro(SET_STATE_VAR varname)
set(tmp_lst
${OPENEXR_CUSTOM} | ${OPENEXR_CUSTOM_LIBRARY} |
${OPENEXR_HOME} | ${OPENEXR_VERSION} | ${OPENEXR_LIB_AREA}
)
set(${varname} "${tmp_lst}")
unset(tmp_lst)
endmacro()
# To enforce that find_* functions do not use inadvertently existing versions
if(OPENEXR_CUSTOM)
set(OPENEXR_FIND_OPTIONS "NO_DEFAULT_PATH")
endif()
# Macro to search for an include directory
macro(PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
string(TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
find_path(${tmp_varname} ${includefile}
HINTS ${${libpath_var}}
PATH_SUFFIXES include
${OPENEXR_FIND_OPTIONS}
)
if(${tmp_varname})
mark_as_advanced(${tmp_varname})
endif()
unset(tmp_varname)
endmacro()
# Macro to search for the given library and adds the cached
# variable names to the specified list
macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
string(TOUPPER ${prefix}_${libname} tmp_prefix)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
find_library(${tmp_prefix}_LIBRARY_DEBUG
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
HINTS ${${libpath_var}}
PATH_SUFFIXES lib
${OPENEXR_FIND_OPTIONS}
)
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
select_library_configurations(${tmp_prefix})
list(APPEND ${liblist_var} ${tmp_prefix}_LIBRARIES)
# Add to the list of variables which should be reset
list(APPEND ${cachelist_var}
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
mark_as_advanced(
${tmp_prefix}_LIBRARY
${tmp_prefix}_LIBRARY_RELEASE
${tmp_prefix}_LIBRARY_DEBUG)
unset(tmp_prefix)
endmacro()
# Encode the current state of the external variables into a string
SET_STATE_VAR(OPENEXR_CURRENT_STATE)
# If the state has changed, clear the cached variables
if(OPENEXR_CACHED_STATE AND
NOT OPENEXR_CACHED_STATE STREQUAL OPENEXR_CURRENT_STATE)
foreach(libvar ${OPENEXR_CACHED_VARS})
unset(${libvar} CACHE)
endforeach()
endif()
# Generic search paths
set(OpenEXR_generic_include_paths
${OPENEXR_CUSTOM_INCLUDE_DIR}
/usr/include
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/include
/sw/include
/opt/local/include
)
set(OpenEXR_generic_library_paths
${OPENEXR_CUSTOM_LIB_DIR}
/usr/lib
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/usr/local/lib
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
/sw/lib
/opt/local/lib
)
# Search paths for the OpenEXR files
if(OPENEXR_HOME)
set(OpenEXR_library_paths
${OPENEXR_HOME}/lib
${OPENEXR_HOME}/lib64)
if(OPENEXR_VERSION)
set(OpenEXR_include_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/include
${OPENEXR_HOME}/include/openexr-${OPENEXR_VERSION})
list(APPEND OpenEXR_library_paths
${OPENEXR_HOME}/openexr-${OPENEXR_VERSION}/lib
${OPENEXR_HOME}/lib/openexr-${OPENEXR_VERSION})
endif()
list(APPEND OpenEXR_include_paths ${OPENEXR_HOME}/include)
if(OPENEXR_LIB_AREA)
list(INSERT OpenEXR_library_paths 2 ${OPENEXR_LIB_AREA})
endif()
endif()
if(ILMBASE_HOME AND OPENEXR_VERSION)
list(APPEND OpenEXR_include_paths
${ILMBASE_HOME}/include/openexr-${OPENEXR_VERSION})
endif()
list(APPEND OpenEXR_include_paths ${OpenEXR_generic_include_paths})
list(APPEND OpenEXR_library_paths ${OpenEXR_generic_library_paths})
# Locate the header files
PREFIX_FIND_INCLUDE_DIR(OpenEXR
OpenEXR/ImfArray.h OpenEXR_include_paths)
if(OPENEXR_INCLUDE_DIR)
# Get the version from config file, if not already set.
if(NOT OPENEXR_VERSION)
FILE(STRINGS "${OPENEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h" OPENEXR_BUILD_SPECIFICATION
REGEX "^[ \t]*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"[.0-9]+\".*$")
if(OPENEXR_BUILD_SPECIFICATION)
if(NOT OpenEXR_FIND_QUIETLY)
message(STATUS "${OPENEXR_BUILD_SPECIFICATION}")
endif()
string(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()
endif()
endif()
if(OPENEXR_CUSTOM)
if(NOT OPENEXR_CUSTOM_LIBRARY)
message(FATAL_ERROR "Custom OpenEXR library requested but OPENEXR_CUSTOM_LIBRARY is not set.")
endif()
set(OpenEXR_Library ${OPENEXR_CUSTOM_LIBRARY})
else()
#elseif(${OPENEXR_VERSION} VERSION_LESS "2.1")
set(OpenEXR_Library IlmImf)
#else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
# set(OpenEXR_Library IlmImf-${_openexr_libs_ver})
endif()
# Locate the OpenEXR library
set(OpenEXR_libvars "")
set(OpenEXR_cachevars "")
PREFIX_FIND_LIB(OpenEXR ${OpenEXR_Library}
OpenEXR_library_paths OpenEXR_libvars OpenEXR_cachevars)
# Create the list of variables that might need to be cleared
set(OPENEXR_CACHED_VARS
OPENEXR_INCLUDE_DIR ${OpenEXR_cachevars}
CACHE INTERNAL "Variables set by FindOpenEXR.cmake" FORCE)
# Store the current state so that variables might be cleared if required
set(OPENEXR_CACHED_STATE ${OPENEXR_CURRENT_STATE}
CACHE INTERNAL "State last seen by FindOpenEXR.cmake" FORCE)
# Always link explicitly with zlib
set(OPENEXR_ZLIB ${ZLIB_LIBRARIES})
# Use the standard function to handle OPENEXR_FOUND
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG
OPENEXR_INCLUDE_DIR ${OpenEXR_libvars})
if(OPENEXR_FOUND)
set(OPENEXR_LIBRARIES "")
foreach(tmplib ${OpenEXR_libvars})
list(APPEND OPENEXR_LIBRARIES ${${tmplib}})
endforeach()
list(APPEND OPENEXR_LIBRARIES ${ZLIB_LIBRARIES})
if(NOT OpenEXR_FIND_QUIETLY)
FIND_PACKAGE_MESSAGE(OPENEXR
"Found OpenEXR: ${OPENEXR_LIBRARIES}"
"[${OPENEXR_INCLUDE_DIR}][${OPENEXR_LIBRARIES}][${OPENEXR_CURRENT_STATE}]"
)
endif()
endif()
# Restore the original find library ordering
if( OPENEXR_USE_STATIC_LIBS )
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# Unset the helper variables to avoid pollution
unset(OPENEXR_CURRENT_STATE)
unset(OpenEXR_include_paths)
unset(OpenEXR_library_paths)
unset(OpenEXR_generic_include_paths)
unset(OpenEXR_generic_library_paths)
unset(OpenEXR_libvars)
unset(OpenEXR_cachevars)

View File

@@ -0,0 +1,72 @@
# - Find TBB library
# Find the native TBB includes and library
# This module defines
# TBB_INCLUDE_DIRS, where to find tbb.h, Set when
# TBB is found.
# TBB_LIBRARIES, libraries to link against to use TBB.
# TBB_ROOT_DIR, The base directory to search for TBB.
# This can also be an environment variable.
# TBB_FOUND, If false, do not try to use TBB.
#
# also defined, but not for general use are
# TBB_LIBRARY, where to find the TBB library.
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.
IF(NOT TBB_ROOT_DIR AND NOT $ENV{TBB_ROOT_DIR} STREQUAL "")
SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
ENDIF()
SET(_tbb_SEARCH_DIRS
${TBB_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/tbb
)
FIND_PATH(TBB_INCLUDE_DIR
NAMES
tbb/tbb.h
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(TBB_LIBRARY
NAMES
tbb
HINTS
${_tbb_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set TBB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
TBB_LIBRARY TBB_INCLUDE_DIR)
IF(TBB_FOUND)
SET(TBB_LIBRARIES ${TBB_LIBRARY})
SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
ELSE()
SET(TBB_TBB_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
TBB_INCLUDE_DIR
TBB_LIBRARY
)

View File

@@ -0,0 +1,82 @@
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose good
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
# library to be used for the given configuration. If no build type has been set
# or the generator in use does not support configuration types, then
# basename_LIBRARY and basename_LIBRARIES will take only the release values.
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com>
# Copyright 2005-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
# Utility macro to check if one variable exists while another doesn't, and set
# one that doesn't exist to the one that exists.
macro( _set_library_name basename GOOD BAD )
if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
endmacro( _set_library_name )
macro( select_library_configurations basename )
# if only the release version was found, set the debug to be the release
# version.
_set_library_name( ${basename} RELEASE DEBUG )
# if only the debug version was found, set the release value to be the
# debug value.
_set_library_name( ${basename} DEBUG RELEASE )
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
set( ${basename}_LIBRARIES
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
# If there are no configuration types or build type, just use
# the release version
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif( ${basename}_LIBRARY )
mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro( select_library_configurations )

View File

@@ -0,0 +1,2 @@
cmake_minimum_required (VERSION 2.4)
add_subdirectory(build/cmake)

View File

@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8)
project(hidapi)
set(SRC_FILES
windows/hid.c
)
set(HEADER_FILES
hidapi/hidapi.h
)
include_directories(hidapi)
add_definitions(-DHID_API_STATIC)
add_library(hidapi STATIC ${SRC_FILES} ${HEADER_FILES})
install(TARGETS hidapi DESTINATION lib)
INSTALL(FILES hidapi/hidapi.h
DESTINATION "include"
)

View File

@@ -0,0 +1,398 @@
# --------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8)
# --------------------------------------------------------------------------------
project(OpenVDB)
# --------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
# --------------------------------------------------------------------------------
set(CMAKE_BUILD_TYPE_INIT "Release")
# --------------------------------------------------------------------------------
# Options
option(WITH_BLOSC "Enable Blosc support for compression" OFF)
option(WITH_LOGC4PLUS "Enable logging" OFF)
option(WITH_OPENVDB_2_ABI "Enable building the library to be compability with the OpenVDB 2 ABI" OFF)
option(WITH_PRINTER "Enable building the OpenVDB print executable" OFF)
option(WITH_PYTHON "Enable building the OpenVDB python API" OFF)
option(WITH_RENDERER "Enable building the OpenVDB render executable" OFF)
option(WITH_UNITTEST "Enable building the unit tests" OFF)
option(WITH_VIEWER "Enable building the OpenVDB viewer executable" OFF)
# --------------------------------------------------------------------------------
# Find packages
#set(BOOST_LIBRARIES boost_iostreams boost_system boost_thread)
find_package(IlmBase)
find_package(OpenEXR)
find_package(TBB)
find_package(Boost)
if(WITH_BLOSC)
find_package(Blosc)
if(NOT BLOSC_FOUND)
set(WITH_BLOSC OFF)
endif()
endif()
# todo
if(WITH_VIEWER)
set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_PATH})
set(GLFW_LIBRARY_DIRS ${GLFW_LIBRARY_PATH})
endif()
if(WITH_LOGC4PLUS)
find_package(LogC4Plus)
if(NOT LOGC4PLUS_FOUND)
set(WITH_LOGC4PLUS OFF)
endif()
endif()
# todo
if(WITH_PYTHON)
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH})
set(PYTHON_LIBRARY_DIRS ${PYTHON_LIBRARY_PATH})
endif()
if(WITH_UNITTEST)
find_package(CppUnit)
if(NOT CPPUNIT_FOUND)
set(WITH_UNITTEST OFF)
endif()
endif()
# --------------------------------------------------------------------------------
message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
message (STATUS "Boost found ${Boost_FOUND} ")
message (STATUS "Boost version ${Boost_VERSION}")
message (STATUS "Boost include dirs ${Boost_INCLUDE_DIRS}")
message (STATUS "Boost library dirs ${Boost_LIBRARY_DIRS}")
message (STATUS "Boost libraries ${Boost_LIBRARIES}")
message (STATUS "ILMBase found ${ILMBASE_FOUND} ")
message (STATUS "ILMBase include dir ${ILMBASE_INCLUDE_DIR}")
message (STATUS "ILMBase libraries ${ILMBASE_LIBRARIES}")
message (STATUS "TBB found ${TBB_FOUND} ")
message (STATUS "TBB include dir ${TBB_INCLUDE_DIR}")
message (STATUS "TBB libraries ${TBB_LIBRARIES}")
if(MSVC)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
endif()
set(OPENVDB_LIBRARIES ${BLOSC_LIBRARIES} ${BOOST_LIBRARIES} ${OPENEXR_LIBRARIES} ${ILMBASE_LIBRARIES} ${TBB_LIBRARIES} ${ZLIB_LIBRARY} )
include_directories(. ${CMAKE_CURRENT_SOURCE_DIR}/../ ${Boost_INCLUDE_DIRS} ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR} ${TBB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS} ${OPENEXR_LIBRARY_DIRS} ${TBB_INCLUDE_DIRS})
add_definitions(-DNOMINMAX -D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB)
if(WITH_BLOSC)
add_definitions(-DOPENVDB_USE_BLOSC)
include_directories(${BLOSC_INCLUDE_DIRS})
link_directories(${BLOSC_LIBRARY_DIRS})
endif()
if(WITH_LOGC4PLUS)
add_definitions(-DOPENVDB_USE_LOG4CPLUS)
include_directories(${LOG4CPLUS_INCLUDE_DIRS})
link_directories(${LOG4CPLUS_LIBRARY_DIRS})
endif()
if(WITH_OPENVDB_2_ABI)
add_definitions(-DOPENVDB_2_ABI_COMPATIBLE)
endif()
# todo
if(WITH_OPENVDB_USE_GLFW_3)
add_definitions(-DOPENVDB_USE_GLFW_3)
endif()
if(WITH_UNITTEST)
include_directories(${CPPUNIT_INCLUDE_DIRS})
link_directories(${CPPUNIT_LIBRARY_DIRS})
endif()
# --------------------------------------------------------------------------------
set(SRC_FILES
openvdb/openvdb.cc
openvdb/io/Compression.cc
openvdb/io/File.cc
openvdb/io/Queue.cc
openvdb/io/Stream.cc
openvdb/io/TempFile.cc
openvdb/io/GridDescriptor.cc
openvdb/io/Archive.cc
openvdb/metadata/MetaMap.cc
openvdb/metadata/Metadata.cc
openvdb/math/Maps.cc
openvdb/math/Transform.cc
openvdb/math/QuantizedUnitVec.cc
openvdb/math/Proximity.cc
openvdb/Grid.cc
openvdb/util/Formats.cc
openvdb/util/Util.cc
)
set(HEADER_FILES
openvdb/openvdb.h
openvdb/version.h
openvdb/PlatformConfig.h
openvdb/Metadata.h
openvdb/Exceptions.h
openvdb/Grid.h
openvdb/Types.h
openvdb/Platform.h
openvdb/tree/ValueAccessor.h
openvdb/tree/NodeUnion.h
openvdb/tree/Tree.h
openvdb/tree/Iterator.h
openvdb/tree/LeafNodeBool.h
openvdb/tree/TreeIterator.h
openvdb/tree/LeafNode.h
openvdb/tree/NodeManager.h
openvdb/tree/LeafManager.h
openvdb/tree/InternalNode.h
openvdb/tree/RootNode.h
openvdb/tools/PointScatter.h
openvdb/tools/VolumeAdvect.h
openvdb/tools/LevelSetTracker.h
openvdb/tools/Composite.h
openvdb/tools/Morphology.h
openvdb/tools/ValueTransformer.h
openvdb/tools/ChangeBackground.h
openvdb/tools/GridTransformer.h
openvdb/tools/Prune.h
openvdb/tools/LevelSetUtil.h
openvdb/tools/VolumeToSpheres.h
openvdb/tools/LevelSetAdvect.h
openvdb/tools/Statistics.h
openvdb/tools/LevelSetMeasure.h
openvdb/tools/VectorTransformer.h
openvdb/tools/RayIntersector.h
openvdb/tools/PointPartitioner.h
openvdb/tools/Interpolation.h
openvdb/tools/VelocityFields.h
openvdb/tools/PointIndexGrid.h
openvdb/tools/LevelSetRebuild.h
openvdb/tools/Clip.h
openvdb/tools/SignedFloodFill.h
openvdb/tools/MeshToVolume.h
openvdb/tools/Dense.h
openvdb/tools/Filter.h
openvdb/tools/RayTracer.h
openvdb/tools/Diagnostics.h
openvdb/tools/VolumeToMesh.h
openvdb/tools/PoissonSolver.h
openvdb/tools/LevelSetFracture.h
openvdb/tools/GridOperators.h
openvdb/tools/DenseSparseTools.h
openvdb/tools/ParticlesToLevelSet.h
openvdb/tools/LevelSetSphere.h
openvdb/tools/LevelSetMorph.h
openvdb/tools/LevelSetFilter.h
openvdb/tools/PointAdvect.h
openvdb/io/Queue.h
openvdb/io/TempFile.h
openvdb/io/Stream.h
openvdb/io/GridDescriptor.h
openvdb/io/Archive.h
openvdb/io/io.h
openvdb/io/Compression.h
openvdb/io/File.h
openvdb/metadata/StringMetadata.h
openvdb/metadata/MetaMap.h
openvdb/metadata/Metadata.h
openvdb/math/DDA.h
openvdb/math/Vec2.h
openvdb/math/FiniteDifference.h
openvdb/math/Stencils.h
openvdb/math/BBox.h
openvdb/math/Mat3.h
openvdb/math/Mat.h
openvdb/math/Proximity.h
openvdb/math/Ray.h
openvdb/math/ConjGradient.h
openvdb/math/Quat.h
openvdb/math/Vec3.h
openvdb/math/Vec4.h
openvdb/math/QuantizedUnitVec.h
openvdb/math/Coord.h
openvdb/math/Operators.h
openvdb/math/Stats.h
openvdb/math/Math.h
openvdb/math/Tuple.h
openvdb/math/LegacyFrustum.h
openvdb/math/Mat4.h
openvdb/math/Maps.h
openvdb/math/Transform.h
openvdb/util/PagedArray.h
openvdb/util/CpuTimer.h
openvdb/util/Formats.h
openvdb/util/NullInterrupter.h
openvdb/util/Util.h
openvdb/util/Name.h
openvdb/util/MapsUtil.h
openvdb/util/NodeMasks.h
openvdb/util/logging.h
)
add_library(openvdb STATIC ${SRC_FILES} ${HEADER_FILES})
# --------------------------------------------------------------------------------
target_link_libraries(openvdb ${OPENVDB_LIBRARIES})
set(OPENVDB_VERSION_MAJOR 3)
set(OPENVDB_VERSION_MINOR 1)
set(OPENVDB_VERSION_PATCH 0)
set(OPENVDB_VERSION_STRING ${OPENVDB_VERSION_MAJOR}.${OPENVDB_VERSION_MINOR}.${OPENVDB_VERSION_PATCH})
set_target_properties(openvdb PROPERTIES VERSION ${OPENVDB_VERSION_STRING} SOVERSION ${OPENVDB_VERSION_MAJOR})
install(TARGETS openvdb DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include COMPONENT Development FILES_MATCHING PATTERN "*.h"
PATTERN ".git" EXCLUDE PATTERN "build" EXCLUDE PATTERN "cmake" EXCLUDE)
# --------------------------------------------------------------------------------
if(WITH_PRINTER)
set(PRINT_SRC
openvdb/cmd/openvdb_print/main.cc
)
add_executable(vdb_print ${PRINT_SRC})
target_link_libraries(vdb_print openvdb)
install(TARGETS vdb_print RUNTIME DESTINATION bin)
endif()
if(WITH_RENDER)
set(RENDER_SRC
openvdb/cmd/openvdb_render/main.cc
)
add_executable(vdb_render ${RENDER_SRC})
target_link_libraries(vdb_render openvdb)
install(TARGETS vdb_render RUNTIME DESTINATION bin)
endif()
# todo
if(WITH_VIEWER)
set(VIEWER_SRC
openvdb/viewer/Camera.cc
openvdb/viewer/ClipBox.cc
openvdb/viewer/Font.cc
openvdb/viewer/RenderModules.cc
openvdb/viewer/Viewer.cc
openvdb/viewer/Camera.h
openvdb/viewer/ClipBox.h
openvdb/viewer/Font.h
openvdb/viewer/RenderModules.h
openvdb/viewer/Viewer.h
openvdb/cmd/openvdb_viewer/main.cc
)
include_directories(${GLFW_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS})
add_executable(vdb_viewer ${VIEWER_SRC})
target_link_libraries(vdb_viewer openvdb)
install(TARGETS vdb_viewer RUNTIME DESTINATION bin)
endif()
# todo
if(WITH_PYTHON)
# add_library(pyopenvdb SHARED )
endif()
set(UNITTEST_SRC
openvdb/unittest/main.cc
openvdb/unittest/TestBBox.cc
openvdb/unittest/TestConjGradient.cc
openvdb/unittest/TestCoord.cc
openvdb/unittest/TestCpt.cc
openvdb/unittest/TestCurl.cc
openvdb/unittest/TestDense.cc
openvdb/unittest/TestDenseSparseTools.cc
openvdb/unittest/TestDiagnostics.cc
openvdb/unittest/TestDivergence.cc
openvdb/unittest/TestDoubleMetadata.cc
openvdb/unittest/TestExceptions.cc
openvdb/unittest/TestFile.cc
openvdb/unittest/TestFloatMetadata.cc
openvdb/unittest/TestGradient.cc
openvdb/unittest/TestGrid.cc
openvdb/unittest/TestGridBbox.cc
openvdb/unittest/TestGridDescriptor.cc
openvdb/unittest/TestGridIO.cc
openvdb/unittest/TestGridTransformer.cc
openvdb/unittest/TestInit.cc
openvdb/unittest/TestInt32Metadata.cc
openvdb/unittest/TestInt64Metadata.cc
openvdb/unittest/TestInternalOrigin.cc
openvdb/unittest/TestLaplacian.cc
openvdb/unittest/TestLeaf.cc
openvdb/unittest/TestLeafBool.cc
openvdb/unittest/TestLeafIO.cc
openvdb/unittest/TestLeafOrigin.cc
openvdb/unittest/TestLevelSetRayIntersector.cc
openvdb/unittest/TestLevelSetUtil.cc
openvdb/unittest/TestLinearInterp.cc
openvdb/unittest/TestMaps.cc
openvdb/unittest/TestMat4Metadata.cc
openvdb/unittest/TestMath.cc
openvdb/unittest/TestMeanCurvature.cc
openvdb/unittest/TestMeshToVolume.cc
openvdb/unittest/TestMetadata.cc
openvdb/unittest/TestMetadataIO.cc
openvdb/unittest/TestMetaMap.cc
openvdb/unittest/TestName.cc
openvdb/unittest/TestNodeIterator.cc
openvdb/unittest/TestNodeMask.cc
openvdb/unittest/TestParticlesToLevelSet.cc
openvdb/unittest/TestPointIndexGrid.cc
openvdb/unittest/TestPointPartitioner.cc
openvdb/unittest/TestPoissonSolver.cc
openvdb/unittest/TestPrePostAPI.cc
openvdb/unittest/TestQuadraticInterp.cc
openvdb/unittest/TestQuantizedUnitVec.cc
openvdb/unittest/TestQuat.cc
openvdb/unittest/TestRay.cc
openvdb/unittest/TestStats.cc
openvdb/unittest/TestStream.cc
openvdb/unittest/TestStringMetadata.cc
openvdb/unittest/TestTools.cc
openvdb/unittest/TestTransform.cc
openvdb/unittest/TestTree.cc
openvdb/unittest/TestTreeCombine.cc
openvdb/unittest/TestTreeGetSetValues.cc
openvdb/unittest/TestTreeIterators.cc
openvdb/unittest/TestTreeVisitor.cc
openvdb/unittest/TestUtil.cc
openvdb/unittest/TestValueAccessor.cc
openvdb/unittest/TestVec2Metadata.cc
openvdb/unittest/TestVec3Metadata.cc
openvdb/unittest/TestVolumeRayIntersector.cc
openvdb/unittest/TestVolumeToMesh.cc
)
# todo
if(WITH_UNITTEST)
add_executable(test ${UNITTEST_SRC} ${HEADER_FILES})
target_link_libraries(test openvdb ${CPPUNIT_LIBRARIES})
endif()

View File

@@ -0,0 +1,204 @@
cmake_minimum_required (VERSION 2.8)
project(tbb CXX)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
include_directories(include src src/rml/include )
option(TBB_BUILD_SHARED "Build TBB shared library" ON)
option(TBB_BUILD_STATIC "Build TBB static library" ON)
option(TBB_BUILD_TBBMALLOC "Build TBB malloc library" ON)
option(TBB_BUILD_TBBMALLOC_PROXY "Build TBB malloc proxy library" ON)
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
file(GLOB tbb_src "${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/old/*.cpp")
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/rml/client/rml_tbb.cpp)
file(GLOB to_remove "${CMAKE_CURRENT_SOURCE_DIR}/src/old/test*.cpp")
list(REMOVE_ITEM tbb_src ${to_remove})
set(tbbmalloc_static_src
src/tbbmalloc/backend.cpp
src/tbbmalloc/large_objects.cpp
src/tbbmalloc/backref.cpp
src/tbbmalloc/tbbmalloc.cpp
src/tbbmalloc/frontend.cpp
src/tbb/itt_notify.cpp)
set(tbbmalloc_src ${tbbmalloc_static_src})
set(tbbmalloc_proxy_src
src/tbbmalloc/proxy.cpp
src/tbbmalloc/tbb_function_replacement.cpp)
if (NOT APPLE)
add_definitions(-DDO_ITT_NOTIFY)
else()
# Disable annoying "has no symbols" warnings
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
endif()
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DUSE_PTHREAD")
if(NOT CMAKE_CXX_FLAGS MATCHES "-mno-rtm")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mrtm")
endif()
if (APPLE)
set(ARCH_PREFIX "mac")
else()
set(ARCH_PREFIX "lin")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_PREFIX "${ARCH_PREFIX}64")
else()
set(ARCH_PREFIX "${ARCH_PREFIX}32")
endif()
set(ENABLE_RTTI "-frtti -fexceptions ")
set(DISABLE_RTTI "-fno-rtti -fno-exceptions ")
elseif(WIN32)
cmake_minimum_required (VERSION 3.1)
enable_language(ASM_MASM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS- /Zc:wchar_t /Zc:forScope /DUSE_WINTHREAD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_DEPRECATE /D_WIN32_WINNT=0x0600 /volatile:iso")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4800 /wd4146 /wd4244 /wd4018")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND tbb_src src/tbb/intel64-masm/atomic_support.asm
src/tbb/intel64-masm/itsx.asm src/tbb/intel64-masm/intel64_misc.asm)
list(APPEND tbbmalloc_src src/tbb/intel64-masm/atomic_support.asm)
set(CMAKE_ASM_MASM_FLAGS "/DEM64T=1")
set(ARCH_PREFIX "win64")
else()
list(APPEND tbb_src src/tbb/ia32-masm/atomic_support.asm
src/tbb/ia32-masm/itsx.asm src/tbb/ia32-masm/lock_byte.asm)
list(APPEND tbbmalloc_src src/tbb/ia32-masm/atomic_support.asm)
set(ARCH_PREFIX "win32")
endif()
set(ENABLE_RTTI "/EHsc /GR ")
set(DISABLE_RTTI "/EHs- /GR- ")
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-flifetime-dse=1" SUPPORTS_FLIFETIME)
if (SUPPORTS_FLIFETIME)
add_definitions(-flifetime-dse=1)
endif()
endif()
# Linker export definitions
if (WIN32)
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)
add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} /TC /EP ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include > tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
else()
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def
COMMENT "Preprocessing tbb.def"
)
add_custom_command(OUTPUT tbbmalloc.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbbmalloc.def
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
endif()
add_custom_target(tbb_def_files DEPENDS tbb.def tbbmalloc.def)
# TBB library
if (TBB_BUILD_STATIC)
add_library(tbb_static STATIC ${tbb_src})
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
set_property(TARGET tbb_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_SOURCE_DIRECTLY_INCLUDED=1")
set_property(TARGET tbb_static APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
install(TARGETS tbb_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbb SHARED ${tbb_src})
set_property(TARGET tbb APPEND PROPERTY COMPILE_DEFINITIONS "__TBB_BUILD=1")
set_property(TARGET tbb APPEND_STRING PROPERTY COMPILE_FLAGS ${ENABLE_RTTI})
add_dependencies(tbb tbb_def_files)
if (APPLE)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(UNIX)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(WIN32)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
endif()
install(TARGETS tbb DESTINATION lib)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
# Quench a warning on GCC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/governor.cpp COMPILE_FLAGS "-Wno-missing-field-initializers ")
elseif(MSVC)
# Quench a warning on MSVC
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/scheduler.cpp COMPILE_FLAGS "/wd4458 ")
endif()
if(TBB_BUILD_TBBMALLOC)
# TBB malloc library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_static STATIC ${tbbmalloc_static_src})
set_property(TARGET tbbmalloc_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
install(TARGETS tbbmalloc_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc SHARED ${tbbmalloc_src})
set_property(TARGET tbbmalloc APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
add_dependencies(tbbmalloc tbb_def_files)
if (APPLE)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(UNIX)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
elseif(WIN32)
set_property(TARGET tbbmalloc APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbbmalloc.def")
endif()
install(TARGETS tbbmalloc DESTINATION lib)
endif()
endif()
if(TBB_BUILD_TBBMALLOC_PROXY)
# TBB malloc proxy library
if (TBB_BUILD_STATIC)
add_library(tbbmalloc_proxy_static STATIC ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy_static APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy_static APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy_static tbbmalloc)
install(TARGETS tbbmalloc_proxy_static ARCHIVE DESTINATION lib)
endif()
if (TBB_BUILD_SHARED)
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
link_libraries(tbbmalloc_proxy tbbmalloc)
install(TARGETS tbbmalloc_proxy DESTINATION lib)
endif()
endif()
install(DIRECTORY include/tbb DESTINATION include)

View File

@@ -0,0 +1,26 @@
--- CmakeLists.txt.orig 2015-12-31 03:46:41 -0700
+++ CMakeLists.txt 2016-04-01 13:28:33 -0600
@@ -22,3 +22,10 @@
add_executable(testcuew cuewTest/cuewTest.c include/cuew.h)
target_link_libraries(testcuew cuew ${CMAKE_DL_LIBS})
+
+install(TARGETS cuew
+ LIBRARY DESTINATION lib COMPONENT libraries
+ ARCHIVE DESTINATION lib/static COMPONENT libraries)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/cuew.h
+ DESTINATION include/)
\ No newline at end of file
--- src/cuew.c 2016-04-01 13:41:43 -0600
+++ src/cuew.c 2016-04-01 13:41:11 -0600
@@ -15,7 +15,9 @@
*/
#ifdef _MSC_VER
+#if _MSC_VER < 1900
# define snprintf _snprintf
+#endif
# define popen _popen
# define pclose _pclose
# define _CRT_SECURE_NO_WARNINGS

View File

@@ -0,0 +1,11 @@
--- _msvccompiler.py.orig 2017-01-17 00:57:48 -0700
+++ _msvccompiler.py 2017-05-20 09:47:26 -0600
@@ -237,7 +237,7 @@
ldflags.extend(('/nodefaultlib:libucrt.lib', 'ucrt.lib'))
ldflags_debug = [
- '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
+ '/nologo', '/INCREMENTAL:NO', '/LTCG'
]
self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']

View File

@@ -0,0 +1,32 @@
--- libavutil/common.h 2016-02-14 19:29:42 -0700
+++ libavutil/common.h 2016-03-30 09:50:29 -0600
@@ -99,6 +99,11 @@
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+//msvc helper
+#ifdef _MSC_VER
+#define inline __inline
+#endif
+
/* misc math functions */
#ifdef HAVE_AV_CONFIG_H
--- configure 2016-11-26 03:12:05.000000000 +0100
+++ configure 2017-04-05 03:24:35.000000000 +0200
@@ -1899,7 +1899,6 @@
access
aligned_malloc
arc4random
- clock_gettime
closesocket
CommandLineToArgvW
CoTaskMemFree
@@ -5494,7 +5493,6 @@
check_func access
check_func_headers stdlib.h arc4random
-check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
check_func fcntl
check_func fork
check_func gethrtime

View File

@@ -0,0 +1,25 @@
--- config.h.in 2014-03-04 11:44:58 -0700
+++ config.h.in 2016-03-30 11:42:49 -0600
@@ -142,9 +142,6 @@
/* Define to 1 if you have the `gethrtime' function. */
#undef HAVE_GETHRTIME
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
/* Define to 1 if hrtime_t is defined in <sys/time.h> */
#undef HAVE_HRTIME_T
--- kernel/assert.c 2014-03-04 11:41:03 -0700
+++ kernel/assert.c 2016-04-01 09:41:05 -0600
@@ -24,8 +24,10 @@
void X(assertion_failed)(const char *s, int line, const char *file)
{
+#if 0
fflush(stdout);
fprintf(stderr, "fftw: %s:%d: assertion failed: %s\n", file, line, s);
+#endif
#ifdef HAVE_ABORT
abort();
#else

View File

@@ -0,0 +1,11 @@
--- UserMacros.cmake
+++ UserMacros.cmake
@@ -16,6 +16,8 @@
if (BUILD_USER_DEFINED_LIBS)
MACRO_USER_DEFINED_LIBS ()
endif (BUILD_USER_DEFINED_LIBS)
+
+include(Config/cmake/usermacros/windows_mt.cmake)
#-----------------------------------------------------------------------------
#------------------- E X A M P L E E N D -----------------------------------
#-----------------------------------------------------------------------------

View File

@@ -0,0 +1,15 @@
--- hidapi/hidapi.h 2011-10-25 20:58:16 -0600
+++ hidapi/hidapi.h 2016-11-01 12:05:58 -0600
@@ -30,7 +30,11 @@
#include <wchar.h>
#ifdef _WIN32
- #define HID_API_EXPORT __declspec(dllexport)
+ #ifdef HID_API_STATIC
+ #define HID_API_EXPORT
+ #else
+ #define HID_API_EXPORT __declspec(dllexport)
+ #endif
#define HID_API_CALL
#else
#define HID_API_EXPORT /**< API export macro */

View File

@@ -0,0 +1,10 @@
--- frontend/main.c 2008-09-22 11:55:09 -0600
+++ frontend/main.c 2016-04-06 15:20:36 -0600
@@ -31,7 +31,6 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#define off_t __int64
#else
#include <time.h>
#endif

View File

@@ -0,0 +1,111 @@
Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp 2014-04-11 23:04:44.000000000 +0200
+++ lib/Target/X86/X86ISelLowering.cpp (working copy)
@@ -15493,12 +15493,36 @@
// non-trivial part is impdef of ESP.
if (Subtarget->isTargetWin64()) {
+ const char *StackProbeSymbol =
+ Subtarget->isTargetCygMing() ? "___chkstk" : "__chkstk";
+
+ MachineInstrBuilder MIB;
+
+ if (getTargetMachine().getCodeModel() == CodeModel::Large) {
+ // For large code model we need to do indirect call to __chkstk.
+
+ // R11 will be used to contain the address of __chkstk.
+ // R11 is a volotiale register and assumed to be destoyed by the callee,
+ // so there is no need to save and restore it.
+ BuildMI(*BB, MI, DL, TII->get(X86::MOV64ri), X86::R11)
+ .addExternalSymbol(StackProbeSymbol);
+ // Create a call to __chkstk function which address contained in R11.
+ MIB = BuildMI(*BB, MI, DL, TII->get(X86::CALL64r))
+ .addReg(X86::R11, RegState::Kill);
+
+ } else {
+
+ // For non-large code model we can do direct call to __chkstk.
+
+ MIB = BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
+ .addExternalSymbol(StackProbeSymbol);
+ }
+
if (Subtarget->isTargetCygMing()) {
// ___chkstk(Mingw64):
// Clobbers R10, R11, RAX and EFLAGS.
// Updates RSP.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("___chkstk")
+ MIB
.addReg(X86::RAX, RegState::Implicit)
.addReg(X86::RSP, RegState::Implicit)
.addReg(X86::RAX, RegState::Define | RegState::Implicit)
@@ -15507,8 +15531,7 @@
} else {
// __chkstk(MSVCRT): does not update stack pointer.
// Clobbers R10, R11 and EFLAGS.
- BuildMI(*BB, MI, DL, TII->get(X86::W64ALLOCA))
- .addExternalSymbol("__chkstk")
+ MIB
.addReg(X86::RAX, RegState::Implicit)
.addReg(X86::EFLAGS, RegState::Define | RegState::Implicit);
// RAX has the offset to be subtracted from RSP.
Index: lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- lib/Target/X86/X86FrameLowering.cpp 2013-10-24 01:37:01.000000000 +0200
+++ lib/Target/X86/X86FrameLowering.cpp (working copy)
@@ -635,25 +635,49 @@
.addReg(X86::EAX, RegState::Kill)
.setMIFlag(MachineInstr::FrameSetup);
}
+
+ MachineInstrBuilder MIB;
if (Is64Bit) {
+
// Handle the 64-bit Windows ABI case where we need to call __chkstk.
// Function prologue is responsible for adjusting the stack pointer.
BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64ri), X86::RAX)
.addImm(NumBytes)
.setMIFlag(MachineInstr::FrameSetup);
+
+ if (TM.getCodeModel() == CodeModel::Large) {
+ // For large code model we need to do indirect call to __chkstk.
+
+
+ // R11 will be used to contain the address of __chkstk.
+ // R11 is a volotiale register and assumed to be destoyed by the callee,
+ // so there is no need to save and restore it.
+ BuildMI(MBB, MBBI, DL, TII.get(X86::MOV64ri), X86::R11)
+ .addExternalSymbol(StackProbeSymbol);
+ // Create a call to __chkstk function which address contained in R11.
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::CALL64r))
+ .addReg(X86::R11, RegState::Kill);
+ } else {
+
+ // For non-large code model we can do direct call to __chkstk.
+
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::W64ALLOCA))
+ .addExternalSymbol(StackProbeSymbol);
+ }
} else {
// Allocate NumBytes-4 bytes on stack in case of isEAXAlive.
// We'll also use 4 already allocated bytes for EAX.
BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX)
.addImm(isEAXAlive ? NumBytes - 4 : NumBytes)
.setMIFlag(MachineInstr::FrameSetup);
+
+ MIB = BuildMI(MBB, MBBI, DL, TII.get(X86::CALLpcrel32))
+ .addExternalSymbol(StackProbeSymbol);
}
- BuildMI(MBB, MBBI, DL,
- TII.get(Is64Bit ? X86::W64ALLOCA : X86::CALLpcrel32))
- .addExternalSymbol(StackProbeSymbol)
- .addReg(StackPtr, RegState::Define | RegState::Implicit)
+
+ MIB.addReg(StackPtr, RegState::Define | RegState::Implicit)
.addReg(X86::EFLAGS, RegState::Define | RegState::Implicit)
.setMIFlag(MachineInstr::FrameSetup);

View File

@@ -0,0 +1,7 @@
@title MinGW-w64 32-bit GCC build environment
@echo Setting up environment for MinGW-w64 GCC 32-bit...
@set PATH=%CD%\bin;%CD%\msys\1.0\bin;%cd%\..\..\perl32\site\bin;%cd%\..\..\perl32\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,7 @@
@title MinGW-w64 64-bit GCC build environment
@echo Setting up environment for MinGW-w64 GCC 64-bit...
@set PATH=%CD%\bin;%CD%\msys\1.0\bin;%cd%\..\..\perl\site\bin;%cd%\..\..\perl\bin;%cd%\..\..\c\bin;%PATH%

View File

@@ -0,0 +1,23 @@
diff -Naur numpy-1.11.1/numpy/distutils/ccompiler.py numpy-1.11.1/numpy/distutils/ccompiler.py
--- numpy-1.11.1/numpy/distutils/ccompiler.py 2016-06-25 08:38:34 -0600
+++ numpy-1.11.1/numpy/distutils/ccompiler.py 2016-08-04 12:33:43 -0600
@@ -29,6 +29,7 @@
# Using customized CCompiler.spawn.
def CCompiler_spawn(self, cmd, display=None):
+ cmd = quote_args(cmd)
"""
Execute a command in a sub-process.
diff -Naur numpy-1.11.1/numpy/distutils/misc_util.py numpy-1.11.1/numpy/distutils/misc_util.py
--- numpy-1.11.1/numpy/distutils/misc_util.py 2016-06-25 08:38:34 -0600
+++ numpy-1.11.1/numpy/distutils/misc_util.py 2016-08-04 12:34:56 -0600
@@ -116,7 +116,7 @@
args = list(args)
for i in range(len(args)):
a = args[i]
- if ' ' in a and a[0] not in '"\'':
+ if ' ' in a and a[0] not in '"\'' and a[len(a)-1] not in '"\'':
args[i] = '"%s"' % (a)
return args

View File

@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fc9be5..5112ce6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,11 +254,11 @@
endif()
#adding PCRE
-find_package(PCRE)
+#find_package(PCRE)
if (PCRE_FOUND)
message(STATUS "SUCCESSFUL: PCRE found")
else () # if pcre not found building its local copy from ./Externals
- if (WIN32 OR APPLE)
+ if (1)
message("WARNING: Native PCRE not found, taking PCRE from ./Externals")
add_definitions(-DPCRE_STATIC)
add_subdirectory(${EXTERNAL_LIBRARIES}/pcre)
diff --git a/DAEValidator/library/include/no_warning_begin.orig b/DAEValidator/library/include/no_warning_begin
index 3fc9be5..5112ce6 100644
--- a/DAEValidator/library/include/no_warning_begin.orig 2017-05-31 16:56:39 -0600
+++ b/DAEValidator/library/include/no_warning_begin 2017-06-07 10:18:45 -0600
@@ -2,6 +2,9 @@
#if defined(_WIN32)
# pragma warning(push)
# pragma warning(disable:4668)
+# if _MSC_VER >=1900
+# pragma warning(disable:5031)
+# endif
# if defined(_MSC_VER) && defined(_DEBUG)
# pragma warning(disable:4548)
# endif

View File

@@ -0,0 +1,21 @@
diff -ru ./CMakeLists.txt ./CMakeLists.txt
--- ./CMakeLists.txt 2014-09-11 21:08:18.000000000 +0200
+++ ./CMakeLists.txt 2016-05-15 17:17:01.000000000 +0200
@@ -186,7 +186,7 @@
PATCH_COMMAND patch -f -p1 < ${CMAKE_SOURCE_DIR}/ext/tinyxml_${TINYXML_VERSION}.patch
BINARY_DIR ext/build/tinyxml
INSTALL_DIR ext/dist
- CMAKE_ARGS ${TINYXML_CMAKE_ARGS}
+ CMAKE_ARGS ${TINYXML_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
if(WIN32)
set(TINYXML_STATIC_LIBRARIES ${PROJECT_BINARY_DIR}/ext/dist/lib/tinyxml.lib)
@@ -254,7 +254,7 @@
BINARY_DIR ext/build/yaml-cpp
PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/ext/yaml-cpp-${YAML_CPP_VERSION}.patch
INSTALL_DIR ext/dist
- CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS}
+ CMAKE_ARGS ${YAML_CPP_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
)
set(YAML_CPP_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ext/dist/include)
set(YAML_CPP_LIBRARY_DIRS ${PROJECT_BINARY_DIR}/ext/dist/lib)

View File

@@ -0,0 +1,33 @@
--- IlmImf/CMakeLists.txt 2014-08-10 06:23:56.000000000 +0200
+++ IlmImf/CMakeLists.txt 2017-01-08 04:06:04.931723800 +0100
@@ -8,8 +8,8 @@
TARGET_LINK_LIBRARIES ( b44ExpLogTable
Half
- Iex${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB}
)
@@ -25,8 +25,8 @@
TARGET_LINK_LIBRARIES ( dwaLookups
Half
- Iex${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB}
)
@@ -138,9 +138,9 @@
TARGET_LINK_LIBRARIES ( IlmImf
Half
- Iex${ILMBASE_LIBSUFFIX}
Imath${ILMBASE_LIBSUFFIX}
IlmThread${ILMBASE_LIBSUFFIX}
+ Iex${ILMBASE_LIBSUFFIX}
${PTHREAD_LIB} ${ZLIB_LIBRARIES}
)

View File

@@ -0,0 +1,26 @@
Index: OpenImageIO/osdep.h
===================================================================
--- OpenImageIO/osdep.h (revision 61595)
+++ OpenImageIO/osdep.h (working copy)
@@ -34,6 +34,7 @@
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOMINMAX
+# define NOGDI
# include <windows.h>
#endif
Index: OpenImageIO/platform.h
===================================================================
--- OpenImageIO/platform.h (revision 61595)
+++ OpenImageIO/platform.h (working copy)
@@ -77,6 +77,9 @@
# ifndef NOMINMAX
# define NOMINMAX
# endif
+# ifndef NOGDI
+# define NOGDI
+# endif
# include <windows.h>
#endif

Some files were not shown because too many files have changed in this diff Show More