1
1

Compare commits

...

6718 Commits

Author SHA1 Message Date
3edc6ece77 Write all non modal keymaps 2018-06-29 08:53: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
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
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
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
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
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
792eab8190 Merge remote-tracking branch 'origin/master' into blender2.8 2018-04-20 15:05:22 +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
3c524178bc Merge branch 'master' into blender2.8 2018-04-20 10:49:14 +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
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
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
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
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
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
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
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
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
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
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
2408a482c0 Merge branch 'master' into blender2.8 2018-04-17 12:12:35 +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
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
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
cf95267456 Merge branch 'master' into blender2.8 2018-04-16 16:17:03 +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
6ef5b422fc Merge remote-tracking branch 'origin' into blender2.8 2018-04-16 09:59:52 +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
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
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
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
9e2ea6c500 Merge branch 'master' into blender2.8 2018-04-15 12:03:09 +02:00
f3a8f97fcf Merge branch 'master' into blender2.8 2018-04-15 10:52:14 +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
35785ee7cb Merge branch 'master' into blender2.8 2018-04-14 14:10:27 +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
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
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
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
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
debe3011f6 Merge branch 'master' into blender2.8 2018-04-11 09:02:32 +02:00
1b78f05b1c Merge branch 'master' into blender2.8 2018-04-10 20:17:56 +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
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
a74e782f5b BLF: Fix broken shadows on certain hardware.
This was due to uninitialized texture space.
2018-04-10 10:26:09 +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
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
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
c1a2f973da Merge branch 'master' into blender2.8 2018-04-09 15:44:28 +02:00
d533b70b23 Fix build error with GCC, make depsgraph iterator compatible with C++. 2018-04-09 15:09:22 +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
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
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
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
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
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
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
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
57329304b0 Merge branch 'master' into blender2.8 2018-04-05 16:58:41 +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
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
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
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
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
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
d54a058f35 Merge branch 'master' into blender2.8 2018-04-04 10:16:38 +02:00
eaf8608ba5 Merge branch 'master' into blender2.8 2018-04-04 09:54:50 +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
c713e9c472 Draw Manager: Improve description of draw_frustum_boundbox_calc variables 2018-04-03 12:18:56 -03:00
6744c34a26 Merge branch 'master' into blender2.8 2018-04-03 16:13:13 +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
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
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
b49290be14 Partial fix for T54491: Use a more accurate solution to calculate the frustum boundbox 2018-04-02 12:21:09 -03: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
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
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
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
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
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
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
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
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
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
205fe8afd7 Clay: Remove warning. 2018-03-28 11:33:23 +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
90b7bcb48d Merge branch 'master' into blender2.8 2018-03-27 15:09:00 +02:00
ddecf23711 Merge branch 'master' into blender2.8 2018-03-27 07:08:58 +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
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
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
21f16bb93e Merge branch 'master' into blender2.8 2018-03-23 15:25:27 +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
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
0080878d67 Merge branch 'master' into blender2.8 2018-03-22 19:21:36 +01:00
18e2a5df1a Merge branch 'master' into blender2.8 2018-03-22 16:41:37 +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
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
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
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
e0388bc61a Merge branch 'master' into blender2.8 2018-03-20 16:55:16 +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
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
04b8b1a167 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/library_query.c
2018-03-20 11:33:59 +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
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
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
5e81d993af Merge branch 'master' into blender2.8 2018-03-19 18:14:05 +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
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
e95282e783 Merge branch 'master' into blender2.8 2018-03-18 16:05:02 +01: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
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
36e7de9eb3 Merge branch 'master' into blender2.8 2018-03-16 12:26:37 +01:00
5baf0de6e7 Merge branch 'master' into blender2.8 2018-03-16 11:24:41 +01: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
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
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
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
d430d12123 Merge branch 'master' into blender2.8 2018-03-14 18:08:37 +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
585208e0e9 Merge branch 'master' into blender2.8 2018-03-14 02:15:37 +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
028580fd1e Merge branch 'master' into blender2.8 2018-03-13 18:39:51 +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
733b9e4f99 Merge branch 'master' into blender2.8 2018-03-12 17:31:46 +01:00
8f4579affd Merge branch 'master' into 28 2018-03-12 16:38:41 +11:00
ba01cdc770 Merge branch 'master' into blender2.8 2018-03-12 15:01:22 +11:00
1d0077649d Merge branch 'master' into blender2.8 2018-03-12 14:25:20 +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
7ecc7c46af Merge branch 'master' into blender2.8 2018-03-11 16:11:56 +11:00
93e0e716f3 Merge branch 'master' into blender2.8 2018-03-10 19:06:28 +01:00
d27158aae9 Merge branch 'master' into blender2.8 2018-03-10 06:55:39 +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
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
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
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
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
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
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
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
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
84a154ac68 Merge branch 'master' into blender2.8 2018-03-05 16:14:46 +01:00
ae9beb1cea UI: rename panel 'Workspace Add-ons'
Show/Hide is limited to menus
2018-03-06 00:59:44 +11:00
2adece9fbb Merge branch 'master' into blender2.8 2018-03-03 14:58:14 +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
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
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
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
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
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
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
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
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
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
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
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
33b6f944c6 Merge branch 'master' into blender2.8 2018-02-28 21:34:09 +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
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
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
bd25e73c54 Null pointer check exiting sculpt mode
Needed for 2.8x, harmless here.
2018-03-01 00:39:42 +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
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
4d382e2564 DRW: Disable depth test when drawing statistics 2018-02-28 01:39:12 +01: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
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
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
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
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
aa592cc00c Merge branch 'master' into blender2.8 2018-02-27 20:45:33 +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
24f759ba5a Revert "F12 offline Freestyle rendering support in Eevee"
This reverts commit 8a7c0abc2d.
2018-02-27 13:02:58 +09: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
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
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
2b158861a3 merged collada rework from master into blender 2.8 2018-02-25 00:06:41 +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
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
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
5127910749 Merge branch 'master' into blender2.8 2018-02-23 17:12:55 +11:00
171c756f20 Merge branch 'master' into blender2.8 2018-02-23 13:10:39 +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
2f5f392453 Merge branch 'master' into blender2.8 2018-02-22 15:45: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
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
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
6e860bef28 Merge branch 'master' into blender2.8 2018-02-22 13:05:00 +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
6bac7c35e8 Merge branch 'master' into blender2.8 2018-02-22 10:47:40 +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
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
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
d4ee0cee51 Merge branch 'master' into blender2.8 2018-02-21 10:51:58 +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
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
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
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
264691e563 Merge branch 'master' into blender2.8 2018-02-19 17:46:42 +11:00
34e76c7162 Merge branch 'master' into blender2.8 2018-02-19 15:59:20 +11:00
569273c234 Merge branch 'master' into blender2.8 2018-02-18 19:59:27 +01:00
2bc952fdb6 Merge branch 'master' into blender2.8 2018-02-18 22:33:05 +11: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
c45f28ce95 New function to check if running opengl render 2018-02-16 16:52:27 +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
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
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
ca5fdd857b Merge branch 'master' into blender2.8 2018-02-16 01:17:43 +11:00
df1c88b652 Merge branch 'master' into blender2.8 2018-02-15 14:15:55 +01:00
2589f55a55 Merge branch 'master' into blender2.8 2018-02-15 12:33:44 +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
e6386ed286 Merge branch 'master' into blender2.8 2018-02-14 21:49:13 +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
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
88bd994a37 Merge branch 'master' into blender2.8 2018-02-14 16:04:07 +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
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
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
2c3d4f7e65 Merge branch 'master' into blender2.8 2018-02-12 17:39:58 +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
7978306cbb Merge branch 'master' into blender2.8 2018-02-09 17:24:23 +01:00
7e3e542aab Merge branch 'master' into blender2.8 2018-02-09 16:26:05 +01:00
be4ebb7fa6 Merge branch 'master' into blender2.8 2018-02-09 14:27:32 +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
37e53ca5f3 Missed opencollada edit in recent changes 2018-02-09 20:25:32 +11: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
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
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
bdc708762c Merge branch 'master' into blender2.8 2018-02-08 15:14:22 +01:00
c3e61cab8a Merge branch 'master' into blender2.8 2018-02-08 23:48:36 +11: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
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
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
b8d376174c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_files_link.c
2018-02-07 22:19:11 +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
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
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
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
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
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
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
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
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
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
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
a1c45a453f Merge branch 'master' into blender2.8 2018-02-05 17:58:31 +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
eeb621566a Merge branch 'master' into blender2.8 2018-02-04 10:46:34 +11:00
1bc0cd0071 Merge branch 'master' into blender2.8 2018-02-03 16:10:01 +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
c3eb22e2ab Merge branch 'master' into blender2.8 2018-02-02 14:15:29 +11: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
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
Dalai Felinto
a57063a432 Merge remote-tracking branch 'origin/master' into blender2.8 2018-02-01 13:13:44 -02: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
6ffc6b30aa Merge branch 'master' into blender2.8 2018-02-01 14:59:14 +11:00
e4c9cf7088 Merge branch 'master' into blender2.8 2018-02-01 14:02:33 +11:00
7b27b10fa6 Merge branch 'master' into blender2.8 2018-01-31 22:36:16 -02:00
11f9a23a28 Merge branch 'master' into blender2.8 2018-01-31 22:34:29 -02:00
4bd72586aa Merge branch 'master' into blender2.8
Apply Fix T50198 also in blender2.8
2018-02-01 00:43:01 +01:00
4b5ac3b768 Merge branch 'master' into blender2.8 2018-01-31 17:17:43 +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
6d55b522fe Merge branch 'master' into blender2.8 2018-01-31 19:03:45 +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
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
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
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
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
Dalai Felinto
d174f3bd60 Outliner: Remove Toggle options from object RMB
Task suggested by Pablo Vazquez (venomgfx).
2018-01-29 12:05:04 -02: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
045f3bda64 Merge branch 'master' into blender2.8 2018-01-28 17:49:58 +01:00
dfbe415372 Merge branch 'master' into blender2.8 2018-01-28 17:18:56 +11:00
1c905046d1 Merge branch 'master' into blender2.8 2018-01-28 16:40:23 +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
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
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
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
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
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
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
5836293990 Merge branch 'master' into blender2.8 2018-01-25 22:20:27 +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
38dafd5f44 Merge branch 'master' into blender2.8 2018-01-25 16:32:43 +11:00
032129ef35 Merge branch 'master' into blender2.8 2018-01-25 10:31:37 +11: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
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
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
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
41cc2ae626 Merge branch 'master' into blender2.8 2018-01-23 13:19:32 +01:00
4ebcdff873 Merge branch 'master' into blender2.8 2018-01-23 20:04:54 +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
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
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
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
51da664fa1 Fix broken merge in fb45821, was missing changes from cc64872. 2018-01-22 14:28:43 +01:00
f7c812e199 Merge branch 'master' into blender2.8 2018-01-22 14:14:33 +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
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
99efebd2dd Merge branch 'master' into blender2.8 2018-01-21 01:47:49 +11:00
a177d64213 Merge branch 'master' into blender2.8 2018-01-21 00:55:08 +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
4d0bb7de64 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-19 17:01:48 -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
Dalai Felinto
d9858d5897 Merge remote-tracking branch 'origin/master' into blender2.8 2018-01-19 12:46:23 -02:00
Dalai Felinto
7866870a9a Outliner: Fix unparenting poll (when drag'n'droping an object) 2018-01-19 12:28:16 -02: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
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
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
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
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
e8452cf0bc Merge branch 'master' into blender2.8 2018-01-18 14:11:38 +11:00
27dff3fbc1 Merge branch 'master' into blender2.8 2018-01-18 01:01:17 +01:00
8400b4b566 Merge branch 'master' into blender2.8 2018-01-17 18:03:08 +01:00
10e6da1f2d Merge branch 'master' into blender2.8 2018-01-17 17:47:38 +01: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
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
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
c02d428147 Eevee: Update lightprobes when deleting or linking a new world datablock 2018-01-17 00:23:31 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
9c91c75ea6 Merge branch 'master' into blender2.8 2018-01-11 13:24:41 +11:00
6112cde3f9 Merge branch 'master' into blender2.8 2018-01-11 10:19:00 +11: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
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
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
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
3c6e19b30b Curve/Surface Display: UV support 2018-01-10 10:11:32 +11: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
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
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
83e84b2c2c Merge branch 'master' into blender2.8 2018-01-09 12:52:13 +01:00
375d27f230 Curve Edit Mode: Use curve handle theme colors 2018-01-09 13:30:30 +11:00
c26da06ae6 Merge branch 'master' into blender2.8 2018-01-08 09:39:32 +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
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
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
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
be40389165 Merge branch 'master' into blender2.8 2018-01-03 23:44:47 +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
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
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
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
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
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
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
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
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
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
b38c083259 Merge branch 'master' into blender2.8 2017-12-21 12:17:48 +01:00
00062e08ee Merge branch 'master' into blender2.8 2017-12-21 12:00:06 +01:00
9f0d067c2e Merge branch 'master' into blender2.8 2017-12-21 11:17:34 +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
03a589125f Merge branch 'master' into blender2.8 2017-12-20 16:46:28 +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
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
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
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
f62de28972 Depsgraph: Fix nexted node trees being tagged with wrong flag 2017-12-19 12:37:57 +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
9d69b3d48b Merge branch 'master' into blender2.8 2017-12-19 19:42:11 +11:00
e288afe110 Merge branch 'master' into blender2.8 2017-12-19 08:57:34 +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
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
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
fbfb35741c Merge branch 'master' into blender2.8 2017-12-18 16:36:23 +01:00
c46a9d8117 Merge branch 'master' into blender2.8 2017-12-18 16:19:12 +01:00
1fb43dcd5a Fix bad merge happened at some point 2017-12-18 16:04:06 +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
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
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
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
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
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
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
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
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
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
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
52d33d6ab9 Merge branch 'master' into blender2.8 2017-12-12 18:00:36 +01:00
56f00db6c9 Correct error in recent merge 2017-12-12 23:19:41 +11:00
edd39f6da7 Merge branch 'master' into blender2.8 2017-12-12 16:13:06 +11:00
41fc0a0624 Merge branch 'master' into blender2.8 2017-12-12 13:55:09 +11: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
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
4737b95b65 Merge branch 'master' into blender2.8 2017-12-11 19:24:37 +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
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
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
087997f9eb Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/interface/interface_templates.c
2017-12-08 14:39:17 +01:00
d46305f741 Merge branch 'master' into blender2.8 2017-12-08 12:44:32 +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
82c779462d Merge branch 'master' into blender2.8 2017-12-08 12:59:51 +11:00
Dalai Felinto
dc848e9a8b Merge remote-tracking branch 'origin/master' into blender2.8 2017-12-07 15:00:03 -02:00
1c0905be0f Merge branch 'master' into blender2.8 2017-12-08 00:21:54 +11:00
1c7cfa025c Merge branch 'master' into blender2.8 2017-12-07 23:53:03 +11:00
46f518e927 Merge branch 'master' into blender2.8 2017-12-06 14:06:49 +01:00
6c49b4154b Merge branch 'master' into blender2.8 2017-12-06 12:27:44 +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
e9bbc10578 Merge branch 'master' into blender2.8 2017-12-06 11:55:30 +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
7ca8af4cc8 Merge branch 'master' into blender2.8 2017-12-06 16:51:37 +11:00
858b38f12c Merge branch 'master' into blender2.8 2017-12-05 22:38:13 +01:00
272973804e Merge branch 'master' into blender2.8 2017-12-05 19:04:34 +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
deaeee8e4d Merge branch 'master' into blender2.8 2017-12-05 11:48:37 +01:00
7d50f16869 drawobject: use float instead of int in glLineWidth 2017-12-04 16:00:21 -02: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
d37d6b5a4d Edit Mesh Selection: Fix wrong glPointSize position 2017-12-04 12:32:45 -02: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
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
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
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
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
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
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
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
03a5eccc94 Merge branch 'master' into blender2.8 2017-11-30 18:30:41 +11:00
84d39ab97b Merge branch 'master' into blender2.8 2017-11-29 18:13:06 +01:00
baaf81e13e Merge branch 'master' into blender2.8 2017-11-29 17:59:04 +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
aa2ecbf35b Merge branch 'master' into blender2.8 2017-11-29 16:01:07 +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
2e47d1a14c Merge branch 'master' into blender2.8 2017-11-29 14:59:48 +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
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
639d49b01f Merge branch 'master' into blender2.8 2017-11-29 16:15:21 +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
f89563a806 Merge branch 'master' into blender2.8 2017-11-29 13:44:59 +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
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
604de7cbe8 Merge branch 'master' into blender2.8 2017-11-28 20:35:24 +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
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
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
f54e076ae6 Merge branch 'master' into blender2.8 2017-11-27 14:32:19 +01:00
408515810e Merge branch 'master' into blender2.8 2017-11-27 14:08:35 +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
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
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
c546fb9e85 Merge branch 'master' into blender2.8 2017-11-24 15:40:53 +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
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
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
a786baa193 Merge branch 'master' into blender2.8 2017-11-23 21:36:27 +01:00
c947788830 Merge branch 'master' into blender2.8 2017-11-23 20:34:03 +01:00
4f8bffa7bf Merge branch 'master' into blender2.8 2017-11-23 19:16:11 +01:00
Dalai Felinto
b79b8478ee Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer 2017-11-23 14:58:01 -02:00
2f9df08aa8 Merge branch 'master' into blender2.8 2017-11-23 17:09:29 +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
35e8138c95 Merge branch 'master' into blender2.8 2017-11-23 15:26:53 +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
7ba1babc90 Merge branch 'master' into blender2.8 2017-11-23 11:47:47 +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
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
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
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
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
d3fc5919f8 Eevee: SSS: Fix error in profile computation. 2017-11-21 06:28:38 +01:00
0b413e406d Avoid passing context to motion path calculation 2017-11-20 22:33:16 +11:00
a8777f9058 Merge branch 'master' into blender2.8 2017-11-20 20:45:03 +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
Julian Eisel
7f96323cd0 Merge branch 'master' into blender2.8 2017-11-19 13:16:14 +01: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
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
44183a3535 Merge branch 'master' into blender2.8 2017-11-17 15:28:36 +01:00
2d89b43fd2 Merge branch 'master' into blender2.8 2017-11-17 15:00:55 +01: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
ae8130e287 Merge branch 'master' into blender2.8 2017-11-15 23:17:25 +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
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
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
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
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
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
1cb6cea71c Merge remote-tracking branch 'origin/master' into blender2.8 2017-11-13 11:48:48 -02:00
f30a2a7862 GPUFramebuffer: Add possibility to blit stencil buffer. 2017-11-11 16:23:55 +01: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
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
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
Dalai Felinto
f8a0754439 Object.layers no longer around, removing from ui 2017-11-09 11:53:18 -02: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
f30086b5b6 Merge branch 'master' into blender2.8 2017-11-09 08:32:20 -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
c99481b632 Merge branch 'master' into blender2.8 2017-11-09 10:59:15 +01: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
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
da4bfb8770 Merge branch 'master' into blender2.8 2017-11-08 01:11:43 +01:00
7b1d707481 Merge branch 'master' into blender2.8 2017-11-08 00:20:59 +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
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
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
Dalai Felinto
83de7c4094 Fix break on duplicated instances since IDNodes depsgraph iterator 2017-11-06 21:18:58 -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
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
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
58dc114615 Merge branch 'master' into blender2.8 2017-11-06 00:12:28 +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
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
0c4f69a2bf Merge branch 'master' into blender2.8 2017-11-03 16:17:01 +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
4c53f2000f Cleanup: move tool-bar checks into functions
Also support separator in tool-bar sub-menus
2017-11-03 16:30:51 +11: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
c1da6c9d7d Merge branch 'master' into blender2.8 2017-11-03 01:16:10 +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
7eb4ef6cac Merge branch 'master' into blender2.8 2017-11-03 00:31:47 +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
1ca3e1a91d UI: support nested tools in toolbar 2017-11-02 23:05:13 +11:00
08141260ff Merge branch 'master' into blender2.8 2017-11-02 18:25:47 +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
cf6e45b522 Eevee: Fix Black volumetrics.
Was caused by a division by 0.
2017-11-01 18:48:55 +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
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
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
Dalai Felinto
bbb4fa7e47 Workspace cleanup: engine_id is in ViewRender 2017-10-31 12:02:38 -02: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
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
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
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
34859b285a Merge branch 'master' into blender2.8 2017-10-29 17:31:55 +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
7530c54c3c Merge branch 'master' into blender2.8 2017-10-29 15:14:04 +01: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
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
Julian Eisel
a3313315ba Merge branch 'master' into blender2.8 2017-10-26 22:57:47 +02: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
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
Julian Eisel
f074a6dd2e Merge branch 'master' into blender2.8 2017-10-25 22:04:01 +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
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
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
d8da33d21c Merge branch 'master' into blender2.8 2017-10-25 11:48:20 +02:00
7771e0b474 Merge branch 'master' into blender2.8 2017-10-25 11:26:53 +02: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
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
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
f5456df095 Merge branch 'master' into blender2.8 2017-10-24 02:05:41 +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
c8edac617f Merge branch 'master' into blender2.8 2017-10-23 14:38:22 +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
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
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
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
c45b8a65b4 Merge branch 'master' into blender2.8 2017-10-20 14:14:44 +11:00
aa7e76b2e3 Merge branch 'master' into blender2.8 2017-10-20 09:40:08 +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
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
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
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
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
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
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
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
bb4c16ef94 Merge branch 'master' into blender2.8 2017-10-17 15:18:12 +11:00
0ffa64a45f Merge branch 'master' into blender2.8 2017-10-17 14:06:49 +11:00
dd91d7d09d Merge branch 'master' into blender2.8 2017-10-17 12:42:51 +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
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
a2758152e2 Merge branch 'master' into blender2.8 2017-10-16 22:28:24 +11:00
14af3e485f Merge branch 'master' into blender2.8 2017-10-16 14:31:19 +11:00
a1bb2ae0d7 Merge branch 'master' into blender2.8 2017-10-14 19:29:11 +11:00
0e35c900d8 Merge branch 'master' into blender2.8 2017-10-14 17:58:29 +11:00
b0fa10f880 Merge branch 'master' into blender2.8 2017-10-14 17:38:06 +11: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
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
dc95c79971 Merge branch 'master' into blender2.8 2017-10-11 13:14:16 +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
c90ec276b8 Manipulator: add cage3d scale widget
For now only show this when scale manipulator is active.
2017-10-10 03:08:53 +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
abcda06934 Eevee: Fix bad defines for volumetric shadowing 2017-10-08 18:23:45 +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
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
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
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
ea606a7847 Merge branch 'master' into blender28 2017-10-06 21:25:33 +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
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
31820d0109 Eevee : Fix T52991 2017-10-04 21:31:47 +02:00
63c472b4f9 Merge branch 'master' into blender2.8 2017-10-04 22:18:05 +05: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
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
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
8b1b7e8d10 Depsgraph: Fix/workarounf when tagging light probe for data update 2017-10-02 18:49:49 +05: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
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
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
18965905d0 Merge branch 'master' into blender2.8 2017-09-30 11:00:29 +10:00
e3fe8128e4 Merge branch 'master' into blender2.8 2017-09-29 19:55:00 +10: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
f6e71fe727 Merge branch 'master' into blender2.8 2017-09-28 16:19:23 +05:00
7fdb9e168d Merge branch 'master' into blender2.8 2017-09-28 16:13:09 +05: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
cc8c064f11 Merge branch 'master' into blender2.8 2017-09-28 03:05:46 +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
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
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
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
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
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
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
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
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
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
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
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
Stefan Werner
549c4bec9d Added extra "const" to satisfy the strict clang version in Xcode 9 2017-09-20 21:50:30 +02: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
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
869f0a840f Merge branch 'master' into blender2.8 2017-09-19 13:59:37 -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
2cdc2f2a25 Fix compiler warning 2017-09-19 16:20:51 +12: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
ad80bfdab9 Merge branch 'master' into blender2.8 2017-09-18 18:10:39 +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
4c1ee47707 Merge branch 'master' into blender2.8 2017-09-18 15:54:56 +05: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
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
4fae536f60 Merge branch 'master' into blender2.8 2017-09-15 22:44:07 +10:00
0c5ff0e558 GPUCodegen: Fix for loop overflow.
Fix asan error.
2017-09-15 11:42:53 +02:00
028c5592cd Merge branch 'master' into blender2.8 2017-09-15 12:35:20 +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
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
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
71c1bd1bd8 Manipulator: cage2d option to grab w/ a center handle 2017-09-13 21:42:13 +10: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
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
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
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
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
7d7741d25f Merge branch 'master' into blender2.8 2017-09-11 16:52:53 +10: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
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
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
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
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
b41d34040b Merge branch 'master' into blender2.8 2017-09-06 16:50:59 +10: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
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
572b1a644f Merge branch 'master' into blender2.8 2017-09-05 22:56:03 +10:00
7dfcbe01b0 Merge branch 'master' into blender2.8 2017-09-02 20:08:02 +10:00
39f8b245d4 Fixes to cage2d scaling in the node editor 2017-09-02 03:55:45 +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
a5cb23c441 Merge branch 'master' into blender2.8 2017-09-01 19:17:14 +10:00
c843e84892 Merge branch 'master' into blender2.8 2017-09-01 02:30:48 +10:00
323a7ab944 Merge branch 'master' into blender2.8 2017-08-31 21:57:38 +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
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
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
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
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
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
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
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
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
f9f4e20871 Merge branch 'master' into blender2.8 2017-08-28 11:27:50 +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
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
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
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
ca9801bd42 Merge branch 'master' into blender2.8 2017-08-27 16:35:51 +10:00
2ff7ba2c6c Correct matrix stack assert 2017-08-27 11:22:31 +10:00
79111f9246 Merge branch 'master' into blender2.8 2017-08-27 00:51:54 +10: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
52778ce625 Cleanup: missing break (harmless for now) 2017-08-25 22:53:37 +10: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
f8f6f8f26e Merge branch 'master' into blender2.8 2017-08-25 20:45:16 +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
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
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
Dalai Felinto
552656611b Merge remote-tracking branch 'origin/master' into blender2.8 2017-08-24 10:41:59 +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
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
cb4884f50b Merge branch 'master' into blender2.8 2017-08-23 20:16:47 +10: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
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
9cfb72ff81 Merge branch 'master' into blender2.8 2017-08-22 16:31:33 +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
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
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
3e555d3d78 Merge branch 'master' into blender2.8 2017-08-21 15:41:03 +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
1b79d323d9 Cleanup: move gawain header out of GPU_matrix
Avoids requiring glew headers in Python API.
2017-08-21 01:41:20 +10:00
4f881e0d97 CMake version bump: 3.5 2017-08-20 17:01:27 +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
2530ae6c74 Merge branch 'master' into blender2.8 2017-08-20 21:22:00 +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
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
64c7cf2036 PyAPI: correct int range checking 2017-08-20 10:34:21 +10: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
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
a702ff4c03 CMake: Boost no longer needed for Audaspace references either 2017-08-18 19:07:39 +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
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
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
264d0cc6a0 Merge branch 'master' into blender2.8 2017-08-16 19:10:18 -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
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
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
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
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
3ab46f4204 Merge branch 'master' into blender2.8 2017-08-14 17:07:30 +02:00
230be97284 Merge branch 'master' into blender2.8 2017-08-14 12:13:55 +10: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
22872857d4 Merge branch 'master' into blender2.8 2017-08-13 01:14:55 +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
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
673c9dce08 Merge branch 'master' into blender2.8 2017-08-12 19:08:49 +10: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
9567529b8f Merge branch 'master' into blender2.8 2017-08-12 00:23:49 +10: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
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
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
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
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
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
ba4ffe90cd Manipulator: add compositor corner-pin widgets 2017-08-10 21:07:06 +10:00
8c4ccab5fe Merge branch 'master' into blender2.8 2017-08-10 11:14:36 +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
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
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
b5e6a21f1d Cleanup: Quiet warning 2017-08-09 20:24:51 +10: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
fdb1c81117 Merge branch 'master' into blender2.8 2017-08-09 09:12:16 +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
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
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
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
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
b282716c3a Merge branch 'master' into blender2.8 2017-08-07 16:16:43 +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
48adef4444 Merge branch 'master' into blender2.8 2017-08-05 07:53:07 +10: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
d7905dab6a Manipulator: add compositor crop manipulator 2017-08-04 16:45:33 +10: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
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
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
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
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
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
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
8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10: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
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
361acb6991 Cleanup: multistatement-macros warning 2017-07-29 08:21:01 +10:00
0e26707bce Merge branch 'master' into blender2.8 2017-07-29 06:44:04 +10:00
c558763ef5 Merge branch 'master' into blender2.8 2017-07-29 01:46:27 +10:00
e39dc48bd5 Fix crash when duplicating object
This fixes null pointer check fiasco.
2017-07-28 13:02:20 +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
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
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
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
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
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
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
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
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
9bdd12d884 Merge branch 'master' into blender2.8 2017-07-25 17:36:49 +10: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
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
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
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
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
392b6a303e Manipulator: setup_keymap callback
Also remove manipulator_group argument, the info's in the class.
2017-07-24 03:27:57 +10: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
64fd45b1df Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/transform/transform_snap_object.c
2017-07-21 14:20:24 -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
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
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
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
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
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
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
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
abe0527e0f Manipulators: use nearest manipulator
Add utility function to get the nearest hit
2017-07-19 20:12:24 +10:00
dd64cedd0b Merge branch 'master' into blender2.8 2017-07-19 14:38:22 +10:00
Dalai Felinto
231d688219 Outliner: Use scene_layer from context 2017-07-18 17:14:43 +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
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
2475dbdc94 Merge branch 'master' into blender2.8 2017-07-18 13:09:36 +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
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
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
4c835b9168 Eevee: Fix double promotion. 2017-07-17 11:01:31 +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
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
a3d9ef2ea5 Merge branch 'master' into blender2.8 2017-07-14 17:26:46 -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
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
8f14b96f7b Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-14 10:42:59 -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
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
ad7f782e17 Merge branch 'master' into blender2.8 2017-07-13 18:05:20 +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
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
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
ffea77253e Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-12 20:45:02 -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
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
0837d19126 Merge branch 'master' into blender2.8 2017-07-12 13:59:13 +10:00
ac76a3caba Merge branch 'master' of git@git.blender.org:blender.git into blender2.8 2017-07-11 17:06:43 -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
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
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
Dalai Felinto
e5d74954bf RNA/UI: Always use capitalized words in the UI 2017-07-11 15:46:15 +02: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
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
64dd9a117d Merge branch 'master' into blender2.8 2017-07-11 14:21:05 +10: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
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
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
2bd908ca6e Merge branch 'master' into blender2.8 2017-07-10 16:35:56 +10: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
fdadb4829c Gawain: Add support for compressed index with instancing. 2017-07-08 18:21:49 +02:00
eb8c45508d Merge branch 'master' into blender2.8 2017-07-08 02:08:41 +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
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
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
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
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
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
91808a67e8 Eevee: Volumetrics: Fix enum flag. 2017-07-05 22:17:09 +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
bdeeb29482 Merge branch 'master' into blender2.8 2017-07-05 15:50:01 +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
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
fc8f6e8f7a Eevee: Fix Closure define. 2017-07-04 11:40:12 +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
Dalai Felinto
1ad0cc6bde Eevee: Hide lightprobe data when using "Only Render" 2017-07-03 16:16:24 +02:00
Dalai Felinto
d97c3bc7ad Merge branch 'master' into blender2.8 2017-07-03 15:18:46 +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
3de5370e9d Cleanup: unused defines 2017-07-01 20:19:12 +10: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Dalai Felinto
4ceb006706 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-21 15:14:42 +02:00
Dalai Felinto
2ae172ec32 Fix blenderplayer (tm) 2017-06-21 12:25:07 +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
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
c31f24c63b Manipulators: store operator type instead of id
Avoids lookups on each access.
2017-06-20 04:44:34 +10:00
56dea4b7cd Fix warning in view3d_draw. 2017-06-19 16:31:20 +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
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
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
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
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
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
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
24ec761bb4 Merge branch 'master' into blender2.8 2017-06-16 10:26:37 +02: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
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
60c5b3f76f Merge branch 'master' into blender2.8 2017-06-15 16:37:10 +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
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
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
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
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
7439919ac0 Merge branch 'master' into blender2.8 2017-06-14 22:39:33 +02: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
6656af2d11 Merge branch 'master' into blender2.8 2017-06-14 11:17:13 +02:00
48cd25a11a Merge branch 'master' into blender2.8 2017-06-14 10:54:58 +02:00
edad3076a9 Merge branch 'master' into blender2.8 2017-06-14 10:48:20 +02:00
07c7bbef0d Merge branch 'master' into blender2.8 2017-06-14 10:11:18 +02:00
26efc7bbd1 Merge branch 'master' into blender2.8 2017-06-14 17:17:00 +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
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
4577bda634 Merge branch 'master' into blender2.8 2017-06-13 14:16:43 +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
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
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
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
c2f6ca313e Draw Cache: fix probe vbo size 2017-06-10 13:57:39 +02: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
20572497a4 Eevee: Add parallax correction to probe reflections 2017-06-09 22:30:49 +02: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
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
16ecd0b79e Fix T51750: Group selection broken
Proper way, no base is involved.
2017-06-09 10:04:12 +02:00
Dalai Felinto
3a60b4511e Revert "Fix T51750: Group selection broken"
This reverts commit 484e3527d1.
2017-06-09 09:42:08 +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
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
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
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
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
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
00b009ca74 Merge branch 'master' into blender2.8 2017-06-07 12:18:07 +02:00
Dalai Felinto
6fee241db5 Merge remote-tracking branch 'origin/master' into blender2.8 2017-06-07 11:38:03 +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
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
4ee9016e62 DwM: skip background-set objects w/ selection 2017-06-05 15:02:47 +10: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
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
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
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
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
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
237e17a957 Merge branch 'master' into blender2.8 2017-06-01 16:31:56 +02: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
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
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
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
82276d6cf7 Fix bone selection (index can't skip hidden bones) 2017-05-31 23:29:04 +10: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
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
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
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
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
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
1fa216487d Gawain: update comments to match latest API 2017-05-29 13:37:02 -04: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
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
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
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
Dalai Felinto
05f9155902 Fix crash when setting sculpt settings 2017-05-29 10:54:36 +02:00
c0cf767460 Access node backdrop as vector
Minor change from 'custom-manipulators' branch, avoid conflicts.
2017-05-29 14:29:44 +10:00
8ead56c4c9 Merge branch 'master' into blender2.8 2017-05-28 17:48:59 +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
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
Dalai Felinto
3b24ece297 Depsgraph: Rename DAG > DEG functions from depsgraph_query.cc 2017-05-26 11:23:10 +02: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
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
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
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
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
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
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
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
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
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
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
Dalai Felinto
c0202c0d33 Fix T51578: Blender 2.8 crash when select Dopesheet->Grease Pencil 2017-05-22 12:25:40 +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
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
65aab6cdae Merge branch 'master' into blender2.8 2017-05-20 14:19:05 +10: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
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
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
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
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
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
321b98602d Remove use_display_lists option 2017-05-19 10:07:02 +10: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
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
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
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
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
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
f628cfd297 Fix T51535: View vector inverting in pespective/ortho 2017-05-17 16:42:38 +02:00
a56c80cd45 Eevee: fixed Material UI. 2017-05-17 15:06:26 +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
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
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
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
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
Dalai Felinto
e43597446e Fix hair width changing 2017-05-16 14:55:36 +02: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
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
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
5a90542d3d Fix memory leak with mesh cache 2017-05-16 11:45:23 +10: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
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
b43f66bcb6 Add show-weights to edit-mode UI 2017-05-15 17:56:22 +10:00
0d65dda147 Merge branch 'master' into blender2.8 2017-05-15 15:51:54 +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
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
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
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
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
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
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
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
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
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
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
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
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
Dalai Felinto
e5ec386803 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-10 17:03:27 +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
0722e41f9e DWM: Use Gawain for sculpt drawing
Currently only uses the simple shader.
2017-05-10 20:35:51 +10: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
Dalai Felinto
75ba1826c8 Merge remote-tracking branch 'origin/master' into blender2.8 2017-05-09 17:56:16 +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
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
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
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
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
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
Julian Eisel
9181f13af7 Merge branch 'master' into blender2.8 2017-05-08 00:19:22 +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
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
90ebf4832f Merge branch 'master' into blender2.8 2017-05-06 22:54:28 +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
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
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
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
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
ce04c7e9f6 Use immediate mode for back-buffer selection
Needed so selection works with core profile.
2017-05-05 10:37:12 +10:00
1c2b5430ca Merge branch 'master' into blender2.8 2017-05-05 08:23:59 +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
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
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
6ea45da05c Cleanup: rename ct -> len
Also use 'defgroup' instead of 'index' for passing weight arg.
2017-05-04 23:37:03 +10: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Dalai Felinto
de9e45a88b blenderplayer: fix warnings in stubs 2017-04-29 02:07:39 +02:00
Dalai Felinto
e702b391ed Draw manager: Style cleanups 2017-04-29 00:54:11 +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
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
886966aa38 Correct comment, we need wire_outline data in this case 2017-04-28 23:04:29 +10:00
0e94d91048 Draw Manager: pose-mode custom bone display 2017-04-28 22:31:58 +10: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
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
98b6c6f2c0 Merge branch 'master' into blender2.8 2017-04-27 21:42:08 +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
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
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
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
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
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
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
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
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
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
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
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
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
2010dbe8a5 Merge branch 'master' into blender2.8 2017-04-24 22:11:05 +10: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
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
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
Dalai Felinto
e6f073fe41 Re-enabling Alembic test
(disabled because of bug fixed on 19548040d9)
2017-04-21 16:07:53 +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
81011679dd Merge branch 'master' into blender2.8 2017-04-21 14:19:05 +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
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
2b9738b7f8 Merge branch 'master' into 28 2017-04-21 17:14:13 +10: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
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
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
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
d8bf090090 Merge branch 'master' into 28 2017-04-20 18:16:01 +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
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
a738e985c6 Fix update drawing curve editmode 2017-04-20 05:55:48 +10: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
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
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
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
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
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
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
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
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
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
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
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
554277986d Gawain: fix missing NULL check
Also shadowed variable warning
2017-04-18 15:04:01 +10: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
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
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
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
3488 changed files with 326929 additions and 439838 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"
}

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

@@ -66,21 +66,12 @@ endif()
# 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
@@ -165,7 +156,6 @@ option_defaults_init(
_init_OPENCOLORIO
_init_SDL
_init_FFTW3
_init_GAMEENGINE
_init_OPENSUBDIV
)
@@ -235,15 +225,10 @@ option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke, ocean sim, and
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)
@@ -325,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)
@@ -388,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)
@@ -472,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)
@@ -519,11 +495,10 @@ if(APPLE)
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)
set(_cxx11_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)
@@ -536,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)
@@ -591,15 +601,17 @@ 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)
@@ -609,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)
@@ -619,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()
@@ -650,15 +655,10 @@ 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_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
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO)
# Keep enabled
else()
@@ -727,30 +727,9 @@ 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()
@@ -831,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
@@ -1003,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
@@ -1075,6 +1055,9 @@ elseif(WITH_GL_PROFILE_ES20)
endif()
else()
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
endif()
if(WITH_GL_EGL)
@@ -1122,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)
@@ -1168,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)
@@ -1181,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")
@@ -1193,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)
@@ -1235,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
@@ -1543,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)
@@ -1577,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")
@@ -1631,7 +1607,7 @@ if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER OR WITH_PLAYER)
if(WITH_BLENDER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1656,13 +1632,6 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
add_subdirectory(source/blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
@@ -1677,9 +1646,6 @@ include(build_files/cmake/packaging.cmake)
if(WITH_BLENDER)
openmp_delayload(blender)
endif()
if(WITH_PLAYER)
openmp_delayload(blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Print Final Configuration
@@ -1713,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)
@@ -1783,10 +1747,7 @@ if(FIRST_RUN)
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)

View File

@@ -236,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."
@@ -423,8 +424,12 @@ 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 \
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 \

View File

@@ -103,6 +103,7 @@ ExternalProject_Add(external_ffmpeg
--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

View File

@@ -25,7 +25,7 @@
ARGS=$( \
getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,use-cxx11,\
--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,\
@@ -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
@@ -290,7 +285,7 @@ SUDO="sudo"
NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=false
USE_CXX11=true # Mandatory in blender2.8
PYTHON_VERSION="3.6.2"
PYTHON_VERSION_MIN="3.6"
@@ -501,9 +496,6 @@ while true; do
--no-confirm)
NO_CONFIRM=true; shift; continue
;;
--use-cxx11)
USE_CXX11=true; shift; continue
;;
--with-all)
WITH_ALL=true; shift; continue
;;
@@ -804,7 +796,7 @@ 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.
@@ -2685,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 ""
@@ -3283,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
@@ -3690,10 +3682,10 @@ install_ARCH() {
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 ""

View File

@@ -13,3 +13,25 @@
-# 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

@@ -8,7 +8,7 @@ project(OpenVDB)
# --------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
# --------------------------------------------------------------------------------

View File

@@ -88,6 +88,14 @@ elseif(WIN32)
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

View File

@@ -10,3 +10,29 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o
MAIN_DEPENDENCY ${flexsrc}
DEPENDS ${${compiler_headers}}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
--- a/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
+++ b/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600
@@ -44,12 +44,18 @@
// same if another packages is compiling against OSL and using these headers
// (OSL may be C++11 but the client package may be older, or vice versa --
// use these two symbols to differentiate these cases, when important).
-#if (__cplusplus >= 201402L)
-# define OSL_CPLUSPLUS_VERSION 14
-#elif (__cplusplus >= 201103L)
-# define OSL_CPLUSPLUS_VERSION 11
+
+// Force C++03 for MSVC in blender since svn the libraries are build with that
+#if !defined(_MSC_VER)
+ #if (__cplusplus >= 201402L)
+ # define OSL_CPLUSPLUS_VERSION 14
+ #elif (__cplusplus >= 201103L)
+ # define OSL_CPLUSPLUS_VERSION 11
+ #else
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
+ #endif
#else
-# define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
+ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */
#endif
// Symbol export defines

View File

@@ -21,9 +21,8 @@ else()
message(FATAL_ERROR "Unknown build environment")
endif()
# Default to only build Blender, not the player
# Default to only build Blender
set(WITH_BLENDER ON CACHE BOOL "" FORCE)
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
# ######## Linux-specific build options ########
# Options which are specific to Linux-only platforms
@@ -74,7 +73,7 @@ set(SNDFILE_LIBRARY "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILI
# OpenAL libraries
set(OPENAL_ROOT_DIR "/opt/lib/openal" CACHE STRING "" FORCE)
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include" CACHE STRING "" FORCE)
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
set(OPENAL_LIBRARY
${OPENAL_ROOT_DIR}/lib/libopenal.a
${OPENAL_ROOT_DIR}/lib/libcommon.a
@@ -140,6 +139,10 @@ set(ZLIB_LIBRARY "/usr/lib${MULTILIB}/libz.a" CACHE STRING "" FORCE)
# OpenVDB
set(OPENVDB_LIBRARY
/opt/lib/openvdb/lib/libopenvdb.a
CACHE BOOL "" FORCE
)
set(BLOSC_LIBRARY
/opt/lib/blosc/lib/libblosc.a
CACHE BOOL "" FORCE
)

View File

@@ -1,12 +0,0 @@
# This is applied as an override on top of blender_linux.config
# Disables all the areas which are not needed for the player.
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)

View File

@@ -60,7 +60,6 @@ if 'cmake' in builder:
# Config file to be used (relative to blender's sources root)
cmake_config_file = "build_files/cmake/config/blender_full.cmake"
cmake_player_config_file = None
cmake_cuda_config_file = None
# Set build options.
@@ -101,14 +100,13 @@ if 'cmake' in builder:
elif glibc == 'glibc211':
deb_name = "squeeze"
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
cmake_player_config_file = "build_files/buildbot/config/blender_linux_player.cmake"
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
targets = ['player', 'blender']
targets = ['blender']
elif builder.endswith('i686_cmake'):
bits = 32
chroot_name = 'buildbot_' + deb_name + '_i686'
targets = ['player', 'blender']
targets = ['blender']
cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7",
"-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"])
@@ -159,9 +157,7 @@ if 'cmake' in builder:
os.chdir(target_build_dir)
# Tweaking CMake options to respect the target
target_cmake_options = cmake_options[:]
if target == 'player':
target_cmake_options.append("-C" + os.path.join(blender_dir, cmake_player_config_file))
elif target == 'cuda':
if target == 'cuda':
target_cmake_options += cuda_cmake_options
target_chroot_prefix = cuda_chroot_prefix[:]
target_name = 'cycles_kernel_cuda'

View File

@@ -126,7 +126,6 @@ if builder.find('cmake') != -1:
elif builder.startswith('linux_'):
blender = os.path.join(install_dir, 'blender')
blenderplayer = os.path.join(install_dir, 'blenderplayer')
buildinfo_h = os.path.join(build_dir, "source", "creator", "buildinfo.h")
blender_h = os.path.join(blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
@@ -149,7 +148,7 @@ if builder.find('cmake') != -1:
# Strip all unused symbols from the binaries
print("Stripping binaries...")
chroot_prefix = ['schroot', '-c', chroot_name, '--']
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender, blenderplayer])
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender])
print("Stripping python...")
py_target = os.path.join(install_dir, blender_version)

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 2018 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_BLOSC_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
BLOSC_INCLUDE_DIR
BLOSC_LIBRARY
)

View File

@@ -9,7 +9,6 @@
#
# also defined,
# GLEW_LIBRARY, where to find the Glew library.
# GLEW_MX_LIBRARY, where to find the GlewMX library.
#=============================================================================
# Copyright 2014 Blender Foundation.
@@ -50,16 +49,6 @@ FIND_LIBRARY(GLEW_LIBRARY
lib64 lib
)
FIND_LIBRARY(GLEW_MX_LIBRARY
NAMES
GLEWmx
HINTS
${_glew_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
@@ -73,7 +62,6 @@ ENDIF(GLEW_FOUND)
MARK_AS_ADVANCED(
GLEW_INCLUDE_DIR
GLEW_LIBRARY
GLEW_MX_LIBRARY
)
UNSET(_glew_SEARCH_DIRS)

View File

@@ -1,15 +1,15 @@
# - Find SndFile library
# Find the native SndFile includes and library
# This module defines
# SNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
# SNDFILE_INCLUDE_DIR is found.
# SNDFILE_LIBRARIES, libraries to link against to use SndFile.
# SNDFILE_ROOT_DIR, The base directory to search for SndFile.
# LIBSNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
# LIBSNDFILE_INCLUDE_DIR is found.
# LIBSNDFILE_LIBRARIES, libraries to link against to use SndFile.
# LIBSNDFILE_ROOT_DIR, The base directory to search for SndFile.
# This can also be an environment variable.
# SNDFILE_FOUND, If false, do not try to use SndFile.
# LIBSNDFILE_FOUND, If false, do not try to use SndFile.
#
# also defined, but not for general use are
# SNDFILE_LIBRARY, where to find the SndFile library.
# LIBSNDFILE_LIBRARY, where to find the SndFile library.
#=============================================================================
# Copyright 2011 Blender Foundation.
@@ -22,26 +22,26 @@
# See the License for more information.
#=============================================================================
# If SNDFILE_ROOT_DIR was defined in the environment, use it.
IF(NOT SNDFILE_ROOT_DIR AND NOT $ENV{SNDFILE_ROOT_DIR} STREQUAL "")
SET(SNDFILE_ROOT_DIR $ENV{SNDFILE_ROOT_DIR})
# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.
IF(NOT LIBSNDFILE_ROOT_DIR AND NOT $ENV{LIBSNDFILE_ROOT_DIR} STREQUAL "")
SET(LIBSNDFILE_ROOT_DIR $ENV{LIBSNDFILE_ROOT_DIR})
ENDIF()
SET(_sndfile_SEARCH_DIRS
${SNDFILE_ROOT_DIR}
${LIBSNDFILE_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
)
FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h
FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h
HINTS
${_sndfile_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(SNDFILE_LIBRARY
FIND_LIBRARY(LIBSNDFILE_LIBRARY
NAMES
sndfile
HINTS
@@ -50,18 +50,18 @@ FIND_LIBRARY(SNDFILE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
IF(SNDFILE_FOUND)
SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
ENDIF(SNDFILE_FOUND)
IF(LIBSNDFILE_FOUND)
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
ENDIF(LIBSNDFILE_FOUND)
MARK_AS_ADVANCED(
SNDFILE_INCLUDE_DIR
SNDFILE_LIBRARY
LIBSNDFILE_INCLUDE_DIR
LIBSNDFILE_LIBRARY
)

View File

@@ -16,7 +16,6 @@ set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
@@ -24,7 +23,6 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
@@ -51,7 +49,6 @@ set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)

View File

@@ -6,7 +6,6 @@
#
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.

View File

@@ -21,7 +21,6 @@ set(WITH_CYCLES_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)
@@ -29,7 +28,6 @@ set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)

View File

@@ -16,7 +16,6 @@ set(WITH_CYCLES_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
@@ -24,7 +23,6 @@ set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
@@ -51,7 +49,6 @@ set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61 CACHE STRING "" FORCE)

View File

@@ -12,9 +12,6 @@ set(WITH_INSTALL_PORTABLE OFF CACHE BOOL "" FORCE)
# no point int copying python into python
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
# dont build the game engine
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)

View File

@@ -6,7 +6,6 @@
# disable Blender
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_BLENDER OFF CACHE BOOL "" FORCE)
# build Cycles

View File

@@ -326,7 +326,7 @@ function(SETUP_LIBDIRS)
link_directories(${JACK_LIBPATH})
endif()
if(WITH_CODEC_SNDFILE)
link_directories(${SNDFILE_LIBPATH})
link_directories(${LIBSNDFILE_LIBPATH})
endif()
if(WITH_FFTW3)
link_directories(${FFTW3_LIBPATH})
@@ -407,7 +407,7 @@ function(setup_liblinks
target_link_libraries(${target} ${JACK_LIBRARIES})
endif()
if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
target_link_libraries(${target} ${LIBSNDFILE_LIBRARIES})
endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
@@ -425,7 +425,7 @@ function(setup_liblinks
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
endif()
if(WITH_OPENVDB)
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES})
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
@@ -555,6 +555,12 @@ function(SETUP_BLENDER_SORTED_LIBS)
endif()
endif()
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
list(APPEND BLENDER_LINK_LIBS
audaspace
audaspace-py)
endif()
# Sort libraries
set(BLENDER_SORTED_LIBS
bf_windowmanager
@@ -575,8 +581,10 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_space_outliner
bf_editor_space_script
bf_editor_space_sequencer
bf_editor_space_statusbar
bf_editor_space_text
bf_editor_space_time
bf_editor_space_topbar
bf_editor_space_userpref
bf_editor_space_view3d
bf_editor_space_clip
@@ -587,6 +595,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_curve
bf_editor_gpencil
bf_editor_interface
bf_editor_manipulator_library
bf_editor_mesh
bf_editor_metaball
bf_editor_object
@@ -594,6 +603,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_editor_armature
bf_editor_physics
bf_editor_render
bf_editor_scene
bf_editor_screen
bf_editor_sculpt_paint
bf_editor_sound
@@ -606,6 +616,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_python
bf_python_ext
bf_python_mathutils
bf_python_gawain
bf_python_bmesh
bf_freestyle
bf_ikplugin
@@ -613,11 +624,14 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_alembic
bf_bmesh
bf_gpu
bf_draw
bf_blenloader
bf_blenkernel
bf_physics
bf_nodes
bf_rna
bf_editor_manipulator_library # rna -> manipulator bad-level calls
bf_python
bf_imbuf
bf_blenlib
bf_depsgraph
@@ -658,6 +672,8 @@ function(SETUP_BLENDER_SORTED_LIBS)
bf_blenfont
bf_blentranslation
bf_intern_audaspace
audaspace
audaspace-py
bf_intern_mikktspace
bf_intern_dualcon
bf_intern_cycles
@@ -669,6 +685,7 @@ function(SETUP_BLENDER_SORTED_LIBS)
cycles_util
cycles_subd
bf_intern_opencolorio
bf_intern_gawain
bf_intern_eigen
extern_rangetree
extern_wcwidth
@@ -745,10 +762,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
endif()
if(WITH_GAMEENGINE_DECKLINK)
list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
endif()
if(WIN32)
list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
endif()
@@ -1510,6 +1523,7 @@ function(find_python_package
NAMES
${package}
HINTS
"${PYTHON_LIBPATH}/"
"${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
"${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
PATH_SUFFIXES

View File

@@ -23,6 +23,8 @@
# Libraries configuration for Apple.
set(MACOSX_DEPLOYMENT_TARGET "10.9")
macro(find_package_wrapper)
# do nothing, just satisfy the macro
endmacro()
@@ -43,7 +45,7 @@ if(WITH_OPENAL)
find_package(OpenAL)
if(OPENAL_FOUND)
set(WITH_OPENAL ON)
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include/AL")
else()
set(WITH_OPENAL OFF)
endif()
@@ -79,10 +81,10 @@ if(WITH_JACK)
endif()
if(WITH_CODEC_SNDFILE)
set(SNDFILE ${LIBDIR}/sndfile)
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
set(SNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
set(SNDFILE_LIBPATH ${SNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
set(LIBSNDFILE ${LIBDIR}/sndfile)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
set(LIBSNDFILE_LIBRARIES sndfile FLAC ogg vorbis vorbisenc)
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib ${LIBDIR}/ffmpeg/lib) # TODO, deprecate
endif()
if(WITH_PYTHON)
@@ -356,7 +358,7 @@ if(WITH_LLVM)
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})
string(REPLACE ".a /" ".a;/" LLVM_LIBRARY ${LLVM_LIBRARY})
else()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4")
endif()
@@ -416,7 +418,7 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
endif()
# Get rid of eventually clashes, we export some symbols explicite as local
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker ${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map"
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")

View File

@@ -148,7 +148,7 @@ endif()
# Codecs
if(WITH_CODEC_SNDFILE)
find_package_wrapper(SndFile)
if(NOT SNDFILE_FOUND)
if(NOT LIBSNDFILE_FOUND)
set(WITH_CODEC_SNDFILE OFF)
endif()
endif()
@@ -237,10 +237,14 @@ endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
find_package_wrapper(Blosc)
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
elseif(NOT BLOSC_FOUND)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "Blosc not found, disabling it")
endif()
endif()

View File

@@ -29,7 +29,15 @@ if(NOT MSVC)
message(FATAL_ERROR "Compiler is unsupported")
endif()
# Libraries configuration for Windows when compiling with MSVC.
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(MSVC_CLANG On)
set(MSVC_REDIST_DIR $ENV{VCToolsRedistDir})
if (DEFINED MSVC_REDIST_DIR)
file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR)
else()
message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.")
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
@@ -119,8 +127,18 @@ set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(InstallRequiredSystemLibraries)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
remove_cc_flag("/MDd" "/MD")
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings.
set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
@@ -532,22 +550,21 @@ set(WINTAB_INC ${LIBDIR}/wintab/include)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
set(OPENALDIR ${LIBDIR}/openal)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
set(OPENAL_LIBPATH ${OPENAL}/lib)
if(MSVC)
set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
else()
set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/wrap_oal.lib)
endif()
endif()
if(WITH_CODEC_SNDFILE)
set(SNDFILE ${LIBDIR}/sndfile)
set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
set(SNDFILE_LIBRARIES ${SNDFILE_LIBPATH}/libsndfile-1.lib)
set(LIBSNDFILE ${LIBDIR}/sndfile)
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib) # TODO, deprecate
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
endif()
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)

View File

@@ -0,0 +1,17 @@
echo No explicit msvc version requested, autodetecting version.
call "%~dp0\detect_msvc2013.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2015.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2017.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
echo Compiler Detection failed. Use verbose switch for more information.
exit /b 1
:DetectionComplete
echo Compiler Detection successfull, detected VS%BUILD_VS_YEAR%
exit /b 0

View File

@@ -0,0 +1,26 @@
if "%NOBUILD%"=="1" goto EOF
echo %TIME% > %BUILD_DIR%\buildtime.txt
msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:build ^
/property:Configuration=%BUILD_TYPE% ^
/maxcpucount:2 ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% ^
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log
if errorlevel 1 (
echo Error during build, see %BUILD_DIR%\Build.log for details
exit /b 1
)
msbuild ^
%BUILD_DIR%\INSTALL.vcxproj ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM%
if errorlevel 1 (
echo Error during install phase
exit /b 1
)
echo %TIME% >> %BUILD_DIR%\buildtime.txt
:EOF

View File

@@ -0,0 +1,16 @@
if "%NOBUILD%"=="1" goto EOF
set HAS_ERROR=
cd %BUILD_DIR%
echo %TIME% > buildtime.txt
ninja install
if errorlevel 1 (
set HAS_ERROR=1
)
echo %TIME% >>buildtime.txt
cd %BLENDER_DIR%
if "%HAS_ERROR%" == "1" (
echo Error during build
exit /b 1
)
:EOF

View File

@@ -0,0 +1,54 @@
if "%BUILD_VS_YEAR%"=="2013" set BUILD_VS_LIBDIRPOST=vc12
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_ARCH%"=="x64" (
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
) else if "%BUILD_ARCH%"=="x86" (
set BUILD_VS_SVNDIR=windows_%BUILD_VS_LIBDIRPOST%
)
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
if NOT "%verbose%" == "" (
echo Library Directory = "%BUILD_VS_LIBDIR%"
)
if NOT EXIST %BUILD_VS_LIBDIR% (
rem libs not found, but svn is on the system
echo
if not "%SVN%"=="" (
echo.
echo The required external libraries in %BUILD_VS_LIBDIR% are missing
echo.
set /p GetLibs= "Would you like to download them? (y/n)"
if /I "!GetLibs!"=="Y" (
echo.
echo Downloading %BUILD_VS_SVNDIR% libraries, please wait.
echo.
:RETRY
"%SVN%" checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/%BUILD_VS_SVNDIR% %BUILD_VS_LIBDIR%
if errorlevel 1 (
set /p LibRetry= "Error during donwload, retry? y/n"
if /I "!LibRetry!"=="Y" (
cd %BUILD_VS_LIBDIR%
"%SVN%" cleanup
cd %BLENDER_DIR%
goto RETRY
)
echo.
echo Error: Download of external libraries failed.
echo This is needed for building, please manually run 'svn cleanup' and 'svn update' in
echo %BUILD_VS_LIBDIR% , until this is resolved you CANNOT make a successfull blender build
echo.
exit /b 1
)
)
)
)
if NOT EXIST %BUILD_VS_LIBDIR% (
echo.
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
echo This is needed for building, aborting!
echo.
exit /b 1
)

View File

@@ -0,0 +1,6 @@
set BLENDER_DIR_NOSPACES=%BLENDER_DIR: =%
if not "%BLENDER_DIR%"=="%BLENDER_DIR_NOSPACES%" (
echo There are spaces detected in the build path "%BLENDER_DIR%", this is currently not supported, exiting....
exit /b 1
)

View File

@@ -0,0 +1,20 @@
if NOT exist "%BLENDER_DIR%/source/tools" (
echo Checking out sub-modules
if not "%GIT%" == "" (
"%GIT%" submodule update --init --recursive --progress
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git checkout master
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git pull --rebase origin master
if errorlevel 1 goto FAIL
goto EOF
) else (
echo Blender submodules not found, and git not found in path to retrieve them.
goto FAIL
)
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -0,0 +1,67 @@
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS%
if "%BUILD_ARCH%"=="x64" (
set MSBUILD_PLATFORM=x64
) else if "%BUILD_ARCH%"=="x86" (
set MSBUILD_PLATFORM=win32
if "%WITH_CLANG%"=="1" (
echo Clang not supported for X86
exit /b 1
)
)
if "%WITH_CLANG%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
)
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
if "%MUST_CLEAN%"=="1" (
echo Cleaning %BUILD_DIR%
msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:clean ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM%
)
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
if "%MUST_CONFIGURE%"=="1" (
if NOT "%verbose%" == "" (
echo %CMAKE% %BUILD_CMAKE_ARGS% -H%BLENDER_DIR% -B%BUILD_DIR%
)
cmake ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)
)
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
echo "%CMAKE%" . >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
echo msbuild ^
%BUILD_DIR%\Blender.sln ^
/target:build ^
/property:Configuration=%BUILD_TYPE% ^
/maxcpucount:2 ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% ^
/flp:Summary;Verbosity=minimal;LogFile=%BUILD_DIR%\Build.log >> %BUILD_DIR%\rebuild.cmd
echo msbuild ^
%BUILD_DIR%\INSTALL.vcxproj ^
/property:Configuration=%BUILD_TYPE% ^
/verbosity:minimal ^
/p:platform=%MSBUILD_PLATFORM% >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd

View File

@@ -0,0 +1,64 @@
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%WITH_CLANG%" == "1" (
set LLVM_DIR=
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
if DEFINED LLVM_DIR (
if NOT "%verbose%" == "" (
echo LLVM Detected at "%LLVM_DIR%"
)
goto DetectionComplete
)
REM Check 32 bits
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
if DEFINED LLVM_DIR (
if NOT "%verbose%" == "" (
echo LLVM Detected at "%LLVM_DIR%"
)
goto DetectionComplete
)
echo LLVM not found
exit /b 1
:DetectionComplete
set CC=%LLVM_DIR%\bin\clang-cl
set CXX=%LLVM_DIR%\bin\clang-cl
rem build and tested against 2017 15.7
set CFLAGS=-m64 -fmsc-version=1914
set CXXFLAGS=-m64 -fmsc-version=1914
)
if NOT "%verbose%" == "" (
echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
)
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
if "%MUST_CLEAN%"=="1" (
echo Cleaning %BUILD_DIR%
cd %BUILD_DIR%
%CMAKE% cmake --build . --config Clean
)
if NOT EXIST %BUILD_DIR%\Blender.sln set MUST_CONFIGURE=1
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
if "%MUST_CONFIGURE%"=="1" (
cmake ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)
)
echo call "%VCVARS%" %BUILD_ARCH% > %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
echo ninja install >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd

View File

@@ -0,0 +1,16 @@
if "%BUILD_ARCH%"=="" (
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set WINDOWS_ARCH= Win64
set BUILD_ARCH=x64
) else if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
set WINDOWS_ARCH= Win64
set BUILD_ARCH=x64
) else (
set WINDOWS_ARCH=
set BUILD_ARCH=x86
)
) else if "%BUILD_ARCH%"=="x64" (
set WINDOWS_ARCH= Win64
) else if "%BUILD_ARCH%"=="x86" (
set WINDOWS_ARCH=
)

View File

@@ -0,0 +1,3 @@
set BUILD_VS_VER=12
set BUILD_VS_YEAR=2013
call "%~dp0\detect_msvc_classic.cmd"

View File

@@ -0,0 +1,3 @@
set BUILD_VS_VER=14
set BUILD_VS_YEAR=2015
call "%~dp0\detect_msvc_classic.cmd"

View File

@@ -0,0 +1,70 @@
if NOT "%verbose%" == "" (
echo Detecting msvc 2017
)
set BUILD_VS_VER=15
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
goto FAIL
)
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio 2017 is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -0,0 +1,69 @@
if NOT "%verbose%" == "" (
echo Detecting msvc %BUILD_VS_YEAR%
)
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win64 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
REM Check 32 bits
set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\%BUILD_VS_VER%.0\Setup\VC"
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v ProductDir 2^>nul`) DO set MSVC_VC_DIR=%%C
if DEFINED MSVC_VC_DIR (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% on Win32 detected at "%MSVC_VC_DIR%"
)
goto msvc_detect_finally
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% not found.
)
goto FAIL
:msvc_detect_finally
set VCVARS=%MSVC_VC_DIR%\vcvarsall.bat
if not exist "%VCVARS%" (
echo "%VCVARS%" not found.
goto FAIL
)
call "%vcvars%" %BUILD_ARCH%
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
goto DetectionComplete
:FAIL
exit /b 1
:DetectionComplete
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% Detected successfuly
)
exit /b 0

View File

@@ -0,0 +1,13 @@
REM find all dependencies and set the corresponding environement variables.
for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
if NOT "%verbose%" == "" (
echo svn : %SVN%
echo cmake : %CMAKE%
echo git : %GIT%
)
if "%CMAKE%" == "" (
echo Cmake not found in path, required for building, exiting...
exit /b 1
)

View File

@@ -0,0 +1,82 @@
set BUILD_DIR=%BLENDER_DIR%..\build_windows
set BUILD_TYPE=Release
:argv_loop
if NOT "%1" == "" (
REM Help Message
if "%1" == "help" (
set SHOW_HELP=1
goto EOF
)
REM Build Types
if "%1" == "debug" (
set BUILD_TYPE=Debug
REM Build Configurations
) else if "%1" == "noge" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
set BUILD_NGE=_noge
) else if "%1" == "builddir" (
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
shift /1
) else if "%1" == "with_tests" (
set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
) else if "%1" == "full" (
set TARGET=Full
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
-C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake"
) else if "%1" == "lite" (
set TARGET=Lite
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake"
) else if "%1" == "cycles" (
set TARGET=Cycles
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake"
) else if "%1" == "headless" (
set TARGET=Headless
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake"
) else if "%1" == "bpy" (
set TARGET=Bpy
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
) else if "%1" == "clang" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
set WITH_CLANG=1
) else if "%1" == "release" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_release.cmake"
set TARGET=Release
) else if "%1" == "x86" (
set BUILD_ARCH=x86
) else if "%1" == "x64" (
set BUILD_ARCH=x64
) else if "%1" == "2017" (
set BUILD_VS_YEAR=2017
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "2013" (
set BUILD_VS_YEAR=2013
) else if "%1" == "packagename" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DCPACK_OVERRIDE_PACKAGENAME="%2"
shift /1
) else if "%1" == "nobuild" (
set NOBUILD=1
) else if "%1" == "showhash" (
SET BUILD_SHOW_HASHES=1
REM Non-Build Commands
) else if "%1" == "update" (
SET BUILD_UPDATE=1
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1
) else if "%1" == "clean" (
set MUST_CLEAN=1
) else if "%1" == "verbose" (
set VERBOSE=1
) else (
echo Command "%1" unknown, aborting!
exit /b 1
)
shift /1
goto argv_loop
)
:EOF
exit /b 0

View File

@@ -0,0 +1,24 @@
rem reset all variables so they do not get accidentally get carried over from previous builds
set BUILD_DIR_OVERRRIDE=
set BUILD_CMAKE_ARGS=
set BUILD_ARCH=
set BUILD_VS_VER=
set BUILD_VS_YEAR=
set BUILD_VS_LIBDIRPOST=
set BUILD_VS_LIBDIR=
set BUILD_VS_SVNDIR=
set BUILD_NGE=
set KEY_NAME=
set MSBUILD_PLATFORM=
set MUST_CLEAN=
set NOBUILD=
set TARGET=
set VERBOSE=
set WINDOWS_ARCH=
set TESTS_CMAKE_ARGS=
set VSWHERE_ARGS=
set BUILD_UPDATE=
set BUILD_SHOW_HASHES=
set SHOW_HELP=
set BUILD_WITH_NINJA=
set WITH_CLANG=

View File

@@ -0,0 +1,4 @@
set BUILD_DIR=%BUILD_DIR%_%TARGET%%BUILD_NGE%_%BUILD_ARCH%_vc%BUILD_VS_VER%_%BUILD_TYPE%
if NOT "%BUILD_DIR_OVERRRIDE%"=="" (
set BUILD_DIR=%BUILD_DIR_OVERRRIDE%
)

View File

@@ -0,0 +1,12 @@
if "%GIT%" == "" (
echo Git not found, cannot show hashes.
goto EOF
)
cd "%BLENDER_DIR%"
for /f "delims=" %%i in ('%GIT% rev-parse HEAD') do echo Branch_hash=%%i
cd "%BLENDER_DIR%/release/datafiles/locale"
for /f "delims=" %%i in ('%GIT% rev-parse HEAD') do echo Locale_hash=%%i
cd "%BLENDER_DIR%/release/scripts/addons"
for /f "delims=" %%i in ('%GIT% rev-parse HEAD') do echo Addons_Hash=%%i
cd "%BLENDER_DIR%"
:EOF

View File

@@ -0,0 +1,29 @@
echo.
echo Convenience targets
echo - release ^(identical to the official blender.org builds^)
echo - full ^(same as release minus the cuda kernels^)
echo - lite
echo - headless
echo - cycles
echo - bpy
echo.
echo Utilities ^(not associated with building^)
echo - clean ^(Target must be set^)
echo - update
echo - nobuild ^(only generate project files^)
echo - showhash ^(Show git hashes of source tree^)
echo.
echo Configuration options
echo - verbose ^(enable diagnostic output during configuration^)
echo - with_tests ^(enable building unit tests^)
echo - noge ^(disable building game enginge and player^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - buildir [newdir] ^(override default build folder^)
echo - x86 ^(override host auto-detect and build 32 bit code^)
echo - x64 ^(override host auto-detect and build 64 bit code^)
echo - 2013 ^(build with visual studio 2013^)
echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL]
echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL]
echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL]
echo.

View File

@@ -0,0 +1,16 @@
if "%SVN%" == "" (
echo svn not found, cannot update libraries
goto UPDATE_GIT
)
"%SVN%" up "%BLENDER_DIR%/../lib/*"
:UPDATE_GIT
if "%GIT%" == "" (
echo Git not found, cannot update code
goto EOF
)
"%GIT%" pull --rebase
"%GIT%" submodule foreach git pull --rebase origin master
:EOF

View File

@@ -36,62 +36,6 @@
/* ================================ */
/** \defgroup bge Game Engine */
/** \defgroup gamelogic Game Logic
* \ingroup bge
*/
/** \defgroup bgeconv Converter
* \ingroup bge
*/
/** \defgroup blroutines Blender Routines
* \ingroup bge
*/
/** \defgroup expressions Expressions
* \ingroup bge
*/
/** \defgroup player Game Player
* \ingroup bge
*/
/** \defgroup ketsji Ketsji
* \ingroup bge
* \todo check all headers and code files for proper licenses
*/
/** \defgroup ketsjinet Ketsji Network
* \ingroup ketsji
*/
/** \defgroup bgenet Network
* \ingroup bge
*/
/** \defgroup bgenetlb Loopback Network
* \ingroup bgenet
*/
/** \defgroup phys Physics
* \ingroup bge
*/
/** \defgroup physbullet Bullet Physics
* \ingroup phys
*/
/** \defgroup physdummy Dummy Physics (none)
* \ingroup phys
*/
/** \defgroup bgerast Rasterizer
* \ingroup bge
*/
/** \defgroup bgerastoglfilters OpenGL Filters
* \ingroup bgerast
*/
/** \defgroup bgerastogl OpenGL Rasterizer
* \ingroup bgerast
*/
/** \defgroup bgesg BGE SceneGraph
* \ingroup bge
*/
/** \defgroup bgevideotex BGE Video Texture
* \ingroup bge
*/
/* ================================ */
/** \defgroup blender Blender */
/** \defgroup blt BlenTranslation
@@ -224,6 +168,10 @@
* \ingroup editors
*/
/** \defgroup edscene scene
* \ingroup editors
*/
/** \defgroup edsculpt sculpt and paint
* \ingroup editors
*/
@@ -264,10 +212,6 @@
* \ingroup editors
*/
/** \defgroup splogic game logic editor
* \ingroup editors
*/
/** \defgroup spnla NLA editor
* \ingroup editors
*/

View File

@@ -1,37 +0,0 @@
"""
Basic Physics Constraint
++++++++++++++++++++++++
Example of how to create a hinge Physics Constraint between two objects.
"""
from bge import logic
from bge import constraints
# get object list
objects = logic.getCurrentScene().objects
# get object named Object1 and Object 2
object_1 = objects["Object1"]
object_2 = objects["Object2"]
# want to use Edge constraint type
constraint_type = 2
# get Object1 and Object2 physics IDs
physics_id_1 = object_1.getPhysicsId()
physics_id_2 = object_2.getPhysicsId()
# use bottom right edge of Object1 for hinge position
edge_position_x = 1.0
edge_position_y = 0.0
edge_position_z = -1.0
# rotate the pivot z axis about 90 degrees
edge_angle_x = 0.0
edge_angle_y = 0.0
edge_angle_z = 90.0
# create an edge constraint
constraints.createConstraint(physics_id_1, physics_id_2,
constraint_type,
edge_position_x, edge_position_y, edge_position_z,
edge_angle_x, edge_angle_y, edge_angle_z)

View File

@@ -1,40 +0,0 @@
"""
Texture Replacement
+++++++++++++++++++
Example of how to replace a texture in game with an external image.
``createTexture()`` and ``removeTexture()`` are to be called from a
module Python Controller.
"""
from bge import logic
from bge import texture
def createTexture(cont):
"""Create a new Dynamic Texture"""
obj = cont.owner
# get the reference pointer (ID) of the internal texture
ID = texture.materialID(obj, 'IMoriginal.png')
# create a texture object
object_texture = texture.Texture(obj, ID)
# create a new source with an external image
url = logic.expandPath("//newtexture.jpg")
new_source = texture.ImageFFmpeg(url)
# the texture has to be stored in a permanent Python object
logic.texture = object_texture
# update/replace the texture
logic.texture.source = new_source
logic.texture.refresh(False)
def removeTexture(cont):
"""Delete the Dynamic Texture, reversing back the final to its original state."""
try:
del logic.texture
except:
pass

View File

@@ -1,237 +0,0 @@
"""
Video Capture with DeckLink
+++++++++++++++++++++++++++
Video frames captured with DeckLink cards have pixel formats that are generally not directly
usable by OpenGL, they must be processed by a shader. The three shaders presented here should
cover all common video capture cases.
This file reflects the current video transfer method implemented in the Decklink module:
whenever possible the video images are transferred as float texture because this is more
compatible with GPUs. Of course, only the pixel formats that have a correspondant GL format
can be transferred as float. Look for fg_shaders in this file for an exhaustive list.
Other pixel formats will be transferred as 32 bits integer red-channel texture but this
won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here.
However, it should not be necessary to use any of them as the list below covers all practical
cases of video capture with all types of Decklink product.
In other words, only use one of the pixel format below and you will be fine. Note that depending
on the video stream, only certain pixel formats will be allowed (others will throw an exception).
For example, to capture a PAL video stream, you must use one of the YUV formats.
To find which pixel format is suitable for a particular video stream, use the 'Media Express'
utility that comes with the Decklink software : if you see the video in the 'Log and Capture'
Window, you have selected the right pixel format and you can use the same in Blender.
Notes: * these shaders only decode the RGB channel and set the alpha channel to a fixed
value (look for color.a = ). It's up to you to add postprocessing to the color.
* these shaders are compatible with 2D and 3D video stream
"""
import bge
from bge import logic
from bge import texture as vt
# The default vertex shader, because we need one
#
VertexShader = """
#version 130
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
"""
# For use with RGB video stream: the pixel is directly usable
#
FragmentShader_R10l = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color;
float tx, ty;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
color = texture(tex, vec2(tx,ty));
color.a = 0.7;
gl_FragColor = color;
}
"""
# For use with YUV video stream
#
FragmentShader_2vuy = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color;
float tx, ty, width, Y, Cb, Cr;
int px;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
width = float(textureSize(tex, 0).x);
color = texture(tex, vec2(tx, ty));
px = int(floor(fract(tx*width)*2.0));
switch (px) {
case 0:
Y = color.g;
break;
case 1:
Y = color.a;
break;
}
Y = (Y - 0.0625) * 1.168949772;
Cb = (color.b - 0.0625) * 1.142857143 - 0.5;
Cr = (color.r - 0.0625) * 1.142857143 - 0.5;
color.r = Y + 1.5748 * Cr;
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
color.b = Y + 1.8556 * Cb;
color.a = 0.7;
gl_FragColor = color;
}
"""
# For use with high resolution YUV
#
FragmentShader_v210 = """
#version 130
uniform sampler2D tex;
// stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above)
uniform float stereo;
// eye = 0.0 for the left eye, 0.5 for the right eye
uniform float eye;
void main(void)
{
vec4 color, color1, color2, color3;
int px;
float tx, ty, width, sx, dx, bx, Y, Cb, Cr;
tx = gl_TexCoord[0].x;
ty = eye+gl_TexCoord[0].y*stereo;
width = float(textureSize(tex, 0).x);
// to sample macro pixels (6 pixels in 4 words)
sx = tx*width*0.25+0.01;
// index of display pixel in the macro pixel 0..5
px = int(floor(fract(sx)*6.0));
// increment as we sample the macro pixel
dx = 1.0/width;
// base x coord of macro pixel
bx = (floor(sx)+0.01)*dx*4.0;
color = texture(tex, vec2(bx, ty));
color1 = texture(tex, vec2(bx+dx, ty));
color2 = texture(tex, vec2(bx+dx*2.0, ty));
color3 = texture(tex, vec2(bx+dx*3.0, ty));
switch (px) {
case 0:
case 1:
Cb = color.b;
Cr = color.r;
break;
case 2:
case 3:
Cb = color1.g;
Cr = color2.b;
break;
default:
Cb = color2.r;
Cr = color3.g;
break;
}
switch (px) {
case 0:
Y = color.g;
break;
case 1:
Y = color1.b;
break;
case 2:
Y = color1.r;
break;
case 3:
Y = color2.g;
break;
case 4:
Y = color3.b;
break;
default:
Y = color3.r;
break;
}
Y = (Y - 0.0625) * 1.168949772;
Cb = (Cb - 0.0625) * 1.142857143 - 0.5;
Cr = (Cr - 0.0625) * 1.142857143 - 0.5;
color.r = Y + 1.5748 * Cr;
color.g = Y - 0.1873 * Cb - 0.4681 * Cr;
color.b = Y + 1.8556 * Cb;
color.a = 0.7;
gl_FragColor = color;
}
"""
# The exhausitve list of pixel formats that are transferred as float texture
# Only use those for greater efficiency and compatiblity.
#
fg_shaders = {
'2vuy' :FragmentShader_2vuy,
'8BitYUV' :FragmentShader_2vuy,
'v210' :FragmentShader_v210,
'10BitYUV' :FragmentShader_v210,
'8BitBGRA' :FragmentShader_R10l,
'BGRA' :FragmentShader_R10l,
'8BitARGB' :FragmentShader_R10l,
'10BitRGBXLE':FragmentShader_R10l,
'R10l' :FragmentShader_R10l
}
#
# Helper function to attach a pixel shader to the material that receives the video frame.
#
def config_video(obj, format, pixel, is3D=False, mat=0, card=0):
if pixel not in fg_shaders:
raise('Unsuported shader')
shader = obj.meshes[0].materials[mat].getShader()
if shader is not None and not shader.isValid():
shader.setSource(VertexShader, fg_shaders[pixel], True)
shader.setSampler('tex', 0)
shader.setUniformEyef("eye")
shader.setUniform1f("stereo", 0.5 if is3D else 1.0)
tex = vt.Texture(obj, mat)
tex.source = vt.VideoDeckLink(format + "/" + pixel + ("/3D" if is3D else ""), card)
print("frame rate: ", tex.source.framerate)
tex.source.play()
obj["video"] = tex
#
# Attach this function to an object that has a material with texture
# and call it once to initialize the object
#
def init(cont):
# config_video(cont.owner, 'HD720p5994', '8BitBGRA')
# config_video(cont.owner, 'HD720p5994', '8BitYUV')
# config_video(cont.owner, 'pal ', '10BitYUV')
config_video(cont.owner, 'pal ', '8BitYUV')
#
# To be called on every frame
#
def play(cont):
obj = cont.owner
video = obj.get("video")
if video is not None:
video.refresh(True)

View File

@@ -1,46 +0,0 @@
"""
Basic Video Playback
++++++++++++++++++++
Example of how to replace a texture in game with a video.
It needs to run everyframe.
To avoid any confusion with the location of the file,
we will use ``GameLogic.expandPath()`` to build an absolute file name,
assuming the video file is in the same directory as the blend-file.
"""
import bge
from bge import texture
from bge import logic
cont = logic.getCurrentController()
obj = cont.owner
# the creation of the texture must be done once: save the
# texture object in an attribute of bge.logic module makes it persistent
if not hasattr(logic, 'video'):
# identify a static texture by name
matID = texture.materialID(obj, 'IMvideo.png')
# create a dynamic texture that will replace the static texture
logic.video = texture.Texture(obj, matID)
# define a source of image for the texture, here a movie
movie = logic.expandPath('//trailer_400p.ogg')
logic.video.source = texture.VideoFFmpeg(movie)
logic.video.source.scale = True
# Note that we can change the ``Texture`` source at any time.
# Suppose we want to switch between two movies during the game:
logic.mySources[0] = texture.VideoFFmpeg('movie1.avi')
logic.mySources[1] = texture.VideoFFmpeg('movie2.avi')
#And then assign (and reassign) the source during the game
logic.video.source = logic.mySources[movieSel]
# quick off the movie, but it wont play in the background
logic.video.source.play()
# Video playback is not a background process: it happens only when we refresh the texture.
# So you need to call this function every frame to ensure update of the texture.
logic.video.refresh(True)

View File

@@ -20,6 +20,6 @@ The execution context is one of:
'EXEC_SCREEN')
"""
# group add popup
# collection add popup
import bpy
bpy.ops.object.group_instance_add('INVOKE_DEFAULT')
bpy.ops.object.collection_instance_add('INVOKE_DEFAULT')

View File

@@ -52,6 +52,7 @@ class OffScreenDraw(bpy.types.Operator):
@staticmethod
def _update_offscreen(context, offscreen):
scene = context.scene
render_layer = context.render_layer
render = scene.render
camera = scene.camera
@@ -65,6 +66,7 @@ class OffScreenDraw(bpy.types.Operator):
offscreen.draw_view3d(
scene,
render_layer,
context.space_data,
context.region,
projection_matrix,

View File

@@ -1,49 +0,0 @@
Application Data (bge.app)
==========================
Module to access application values that remain unchanged during runtime.
.. module:: bge.app
.. data:: version
The Blender/BGE version as a tuple of 3 ints, eg. (2, 75, 1).
.. note::
Version tuples can be compared simply with (in)equality symbols;
for example, ``(2, 74, 5) <= (2, 75, 0)`` returns True (lexical order).
:type: tuple of three ints
.. data:: version_string
The Blender/BGE version formatted as a string, eg. "2.75 (sub 1)".
:type: str
.. data:: version_char
The Blender/BGE version character (for minor releases).
:type: str
.. data:: has_texture_ffmpeg
True if the BGE has been built with FFmpeg support,
enabling use of :class:`~bge.texture.ImageFFmpeg` and :class:`~bge.texture.VideoFFmpeg`.
:type: bool
.. data:: has_joystick
True if the BGE has been built with joystick support.
:type: bool
.. data:: has_physics
True if the BGE has been built with physics support.
:type: bool

View File

@@ -1,356 +0,0 @@
Physics Constraints (bge.constraints)
=====================================
Bullet Physics provides collision detection
and rigid body dynamics for the Blender Game Engine.
Features:
- Vehicle simulation.
- Rigid body constraints: hinge and point to point (ball socket).
- Access to internal physics settings,
like deactivation time, and debugging features
.. module:: bge.constraints
.. note:: Note about parameter settings
Since this API is not well documented, it can be unclear what kind of values to use for setting parameters.
In general, damping settings should be in the range of 0 to 1 and
stiffness settings should not be much higher than about 10.
Examples
--------
.. seealso::
For more examples of Bullet physics and how to use them
see the `pybullet forum <https://pybullet.org/Bullet/phpBB3/viewforum.php?f=17>`__.
.. include:: __/examples/bge.constraints.py
:start-line: 1
:end-line: 4
.. literalinclude:: __/examples/bge.constraints.py
:lines: 6-
Functions
---------
.. function:: createConstraint( \
physicsid_1, physicsid_2, constraint_type, \
pivot_x=0.0, pivot_y=0.0, pivot_z=0.0, \
axis_x=0.0, axis_y=0.0, axis_z=0.0, flag=0)
Creates a constraint.
:arg physicsid_1: The physics id of the first object in constraint.
:type physicsid_1: int
:arg physicsid_2: The physics id of the second object in constraint.
:type physicsid_2: int
:arg constraint_type: The type of the constraint, see `Create Constraint Constants`_.
:type constraint_type: int
:arg pivot_x: Pivot X position. (optional)
:type pivot_x: float
:arg pivot_y: Pivot Y position. (optional)
:type pivot_y: float
:arg pivot_z: Pivot Z position. (optional)
:type pivot_z: float
:arg axis_x: X axis angle in degrees. (optional)
:type axis_x: float
:arg axis_y: Y axis angle in degrees. (optional)
:type axis_y: float
:arg axis_z: Z axis angle in degrees. (optional)
:type axis_z: float
:arg flag: 128 to disable collision between linked bodies. (optional)
:type flag: int
:return: A constraint wrapper.
:rtype: :class:`~bge.types.KX_ConstraintWrapper`
.. function:: exportBulletFile(filename)
Exports a file representing the dynamics world (usually using ``.bullet`` extension).
See `Bullet binary serialization <http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization>`__.
:arg filename: File path.
:type filename: str
.. function:: getAppliedImpulse(constraintId)
:arg constraintId: The id of the constraint.
:type constraintId: int
:return: The most recent applied impulse.
:rtype: float
.. function:: getVehicleConstraint(constraintId)
:arg constraintId: The id of the vehicle constraint.
:type constraintId: int
:return: A vehicle constraint object.
:rtype: :class:`~bge.types.KX_VehicleWrapper`
.. function:: getCharacter(gameobj)
:arg gameobj: The game object with the character physics.
:type gameobj: :class:`~bge.types.KX_GameObject`
:return: Character wrapper.
:rtype: :class:`~bge.types.KX_CharacterWrapper`
.. function:: removeConstraint(constraintId)
Removes a constraint.
:arg constraintId: The id of the constraint to be removed.
:type constraintId: int
.. function:: setCcdMode(ccdMode)
.. note::
Very experimental, not recommended
Sets the CCD (Continous Colision Detection) mode in the Physics Environment.
:arg ccdMode: The new CCD mode.
:type ccdMode: int
.. function:: setContactBreakingTreshold(breakingTreshold)
.. note::
Reasonable default is 0.02 (if units are meters)
Sets tresholds to do with contact point management.
:arg breakingTreshold: The new contact breaking treshold.
:type breakingTreshold: float
.. function:: setDeactivationAngularTreshold(angularTreshold)
Sets the angular velocity treshold.
:arg angularTreshold: New deactivation angular treshold.
:type angularTreshold: float
.. function:: setDeactivationLinearTreshold(linearTreshold)
Sets the linear velocity treshold.
:arg linearTreshold: New deactivation linear treshold.
:type linearTreshold: float
.. function:: setDeactivationTime(time)
Sets the time after which a resting rigidbody gets deactived.
:arg time: The deactivation time.
:type time: float
.. function:: setDebugMode(mode)
Sets the debug mode.
:arg mode: The new debug mode, see `Debug Mode Constants`_.
:type mode: int
.. function:: setGravity(x, y, z)
Sets the gravity force.
:arg x: Gravity X force.
:type x: float
:arg y: Gravity Y force.
:type y: float
:arg z: Gravity Z force.
:type z: float
.. function:: setLinearAirDamping(damping)
.. note::
Not implemented
Sets the linear air damping for rigidbodies.
.. function:: setNumIterations(numiter)
Sets the number of iterations for an iterative constraint solver.
:arg numiter: New number of iterations.
:type numiter: int
.. function:: setNumTimeSubSteps(numsubstep)
Sets the number of substeps for each physics proceed. Tradeoff quality for performance.
:arg numsubstep: New number of substeps.
:type numsubstep: int
.. function:: setSolverDamping(damping)
.. note::
Very experimental, not recommended
Sets the damper constant of a penalty based solver.
:arg damping: New damping for the solver.
:type damping: float
.. function:: setSolverTau(tau)
.. note::
Very experimental, not recommended
Sets the spring constant of a penalty based solver.
:arg tau: New tau for the solver.
:type tau: float
.. function:: setSolverType(solverType)
.. note::
Very experimental, not recommended
Sets the solver type.
:arg solverType: The new type of the solver.
:type solverType: int
.. function:: setSorConstant(sor)
.. note::
Very experimental, not recommended
Sets the successive overrelaxation constant.
:arg sor: New sor value.
:type sor: float
.. function:: setUseEpa(epa)
.. note::
Not implemented
Constants
+++++++++
.. attribute:: error
Symbolic constant string that indicates error.
:type: str
Debug Mode Constants
^^^^^^^^^^^^^^^^^^^^
Debug mode to be used with :func:`setDebugMode`.
.. data:: DBG_NODEBUG
No debug.
.. data:: DBG_DRAWWIREFRAME
Draw wireframe in debug.
.. data:: DBG_DRAWAABB
Draw Axis Aligned Bounding Box in debug.
.. data:: DBG_DRAWFREATURESTEXT
Draw features text in debug.
.. data:: DBG_DRAWCONTACTPOINTS
Draw contact points in debug.
.. data:: DBG_NOHELPTEXT
Debug without help text.
.. data:: DBG_DRAWTEXT
Draw text in debug.
.. data:: DBG_PROFILETIMINGS
Draw profile timings in debug.
.. data:: DBG_ENABLESATCOMPARISION
Enable sat comparision in debug.
.. data:: DBG_DISABLEBULLETLCP
Disable Bullet LCP.
.. data:: DBG_ENABLECCD
Enable Continous Collision Detection in debug.
.. data:: DBG_DRAWCONSTRAINTS
Draw constraints in debug.
.. data:: DBG_DRAWCONSTRAINTLIMITS
Draw constraint limits in debug.
.. data:: DBG_FASTWIREFRAME
Draw a fast wireframe in debug.
Create Constraint Constants
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Constraint type to be used with :func:`createConstraint`.
.. data:: POINTTOPOINT_CONSTRAINT
.. to do
.. data:: LINEHINGE_CONSTRAINT
.. to do
.. data:: ANGULAR_CONSTRAINT
.. to do
.. data:: CONETWIST_CONSTRAINT
.. to do
.. data:: VEHICLE_CONSTRAINT
.. to do
.. data:: GENERIC_6DOF_CONSTRAINT
.. to do

View File

@@ -1,250 +0,0 @@
Game Keys (bge.events)
======================
*****
Intro
*****
This module holds key constants for the SCA_KeyboardSensor.
.. module:: bge.events
.. code-block:: python
# Set a connected keyboard sensor to accept F1
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
sensor.key = bge.events.F1KEY
code-block:: python
# Do the all keys thing
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
for key,status in sensor.events:
# key[0] == bge.events.keycode, key[1] = status
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
if key == bge.events.WKEY:
# Activate Forward!
if key == bge.events.SKEY:
# Activate Backward!
if key == bge.events.AKEY:
# Activate Left!
if key == bge.events.DKEY:
# Activate Right!
code-block:: python
# The all keys thing without a keyboard sensor (but you will
# need an always sensor with pulse mode on)
import bge
# Just shortening names here
keyboard = bge.logic.keyboard
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
print("Activate Forward!")
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
print("Activate Backward!")
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
print("Activate Left!")
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
print("Activate Right!")
*********
Functions
*********
.. function:: EventToString(event)
Return the string name of a key event. Will raise a ValueError error if its invalid.
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
:type event: int
:rtype: string
.. function:: EventToCharacter(event, shift)
Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
:type event: int
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
:type shift: bool
:arg shift: set to true if shift is held.
:rtype: string
****************
Keys (Constants)
****************
.. _mouse-keys:
==========
Mouse Keys
==========
.. data:: LEFTMOUSE
.. data:: MIDDLEMOUSE
.. data:: RIGHTMOUSE
.. data:: WHEELUPMOUSE
.. data:: WHEELDOWNMOUSE
.. data:: MOUSEX
.. data:: MOUSEY
.. _keyboard-keys:
=============
Keyboard Keys
=============
-------------
Alphabet keys
-------------
.. data:: AKEY
.. data:: BKEY
.. data:: CKEY
.. data:: DKEY
.. data:: EKEY
.. data:: FKEY
.. data:: GKEY
.. data:: HKEY
.. data:: IKEY
.. data:: JKEY
.. data:: KKEY
.. data:: LKEY
.. data:: MKEY
.. data:: NKEY
.. data:: OKEY
.. data:: PKEY
.. data:: QKEY
.. data:: RKEY
.. data:: SKEY
.. data:: TKEY
.. data:: UKEY
.. data:: VKEY
.. data:: WKEY
.. data:: XKEY
.. data:: YKEY
.. data:: ZKEY
-----------
Number keys
-----------
.. data:: ZEROKEY
.. data:: ONEKEY
.. data:: TWOKEY
.. data:: THREEKEY
.. data:: FOURKEY
.. data:: FIVEKEY
.. data:: SIXKEY
.. data:: SEVENKEY
.. data:: EIGHTKEY
.. data:: NINEKEY
--------------
Modifiers Keys
--------------
.. data:: CAPSLOCKKEY
.. data:: LEFTCTRLKEY
.. data:: LEFTALTKEY
.. data:: RIGHTALTKEY
.. data:: RIGHTCTRLKEY
.. data:: RIGHTSHIFTKEY
.. data:: LEFTSHIFTKEY
----------
Arrow Keys
----------
.. data:: LEFTARROWKEY
.. data:: DOWNARROWKEY
.. data:: RIGHTARROWKEY
.. data:: UPARROWKEY
--------------
Numberpad Keys
--------------
.. data:: PAD0
.. data:: PAD1
.. data:: PAD2
.. data:: PAD3
.. data:: PAD4
.. data:: PAD5
.. data:: PAD6
.. data:: PAD7
.. data:: PAD8
.. data:: PAD9
.. data:: PADPERIOD
.. data:: PADSLASHKEY
.. data:: PADASTERKEY
.. data:: PADMINUS
.. data:: PADENTER
.. data:: PADPLUSKEY
-------------
Function Keys
-------------
.. data:: F1KEY
.. data:: F2KEY
.. data:: F3KEY
.. data:: F4KEY
.. data:: F5KEY
.. data:: F6KEY
.. data:: F7KEY
.. data:: F8KEY
.. data:: F9KEY
.. data:: F10KEY
.. data:: F11KEY
.. data:: F12KEY
.. data:: F13KEY
.. data:: F14KEY
.. data:: F15KEY
.. data:: F16KEY
.. data:: F17KEY
.. data:: F18KEY
.. data:: F19KEY
----------
Other Keys
----------
.. data:: ACCENTGRAVEKEY
.. data:: BACKSLASHKEY
.. data:: BACKSPACEKEY
.. data:: COMMAKEY
.. data:: DELKEY
.. data:: ENDKEY
.. data:: EQUALKEY
.. data:: ESCKEY
.. data:: HOMEKEY
.. data:: INSERTKEY
.. data:: LEFTBRACKETKEY
.. data:: LINEFEEDKEY
.. data:: MINUSKEY
.. data:: PAGEDOWNKEY
.. data:: PAGEUPKEY
.. data:: PAUSEKEY
.. data:: PERIODKEY
.. data:: QUOTEKEY
.. data:: RIGHTBRACKETKEY
.. data:: RETKEY (Deprecated: use bge.events.ENTERKEY)
.. data:: ENTERKEY
.. data:: SEMICOLONKEY
.. data:: SLASHKEY
.. data:: SPACEKEY
.. data:: TABKEY

File diff suppressed because it is too large Load Diff

View File

@@ -1,425 +0,0 @@
Rasterizer (bge.render)
=======================
*****
Intro
*****
.. module:: bge.render
Example of using a :class:`bge.types.SCA_MouseSensor`,
and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
.. note::
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
.. code-block:: python
# To use a mouse movement sensor "Mouse" and a
# motion actuator to mouse look:
import bge
# scale sets the speed of motion
scale = 1.0, 0.5
co = bge.logic.getCurrentController()
obj = co.owner
mouse = co.sensors["Mouse"]
lmotion = co.actuators["LMove"]
wmotion = co.actuators["WMove"]
# Transform the mouse coordinates to see how far the mouse has moved.
def mousePos():
x = (bge.render.getWindowWidth() / 2 - mouse.position[0]) * scale[0]
y = (bge.render.getWindowHeight() / 2 - mouse.position[1]) * scale[1]
return (x, y)
pos = mousePos()
# Set the amount of motion: X is applied in world coordinates...
wmotion.useLocalTorque = False
wmotion.torque = ((0.0, 0.0, pos[0]))
# ...Y is applied in local coordinates
lmotion.useLocalTorque = True
lmotion.torque = ((-pos[1], 0.0, 0.0))
# Activate both actuators
co.activate(lmotion)
co.activate(wmotion)
# Centre the mouse
bge.render.setMousePosition(int(bge.render.getWindowWidth() / 2), int(bge.render.getWindowHeight() / 2))
*********
Constants
*********
.. data:: KX_TEXFACE_MATERIAL
Materials as defined by the texture face settings.
.. data:: KX_BLENDER_MULTITEX_MATERIAL
Materials approximating blender materials with multitexturing.
.. data:: KX_BLENDER_GLSL_MATERIAL
Materials approximating blender materials with GLSL.
.. DATA:: VSYNC_OFF
Disables vsync
.. DATA:: VSYNC_ON
Enables vsync
.. DATA:: VSYNC_ADAPTIVE
Enables adaptive vsync if supported.
Adaptive vsync enables vsync if the framerate is above the monitors refresh rate.
Otherwise, vsync is diabled if the framerate is too low.
.. data:: LEFT_EYE
Left eye being used during stereoscopic rendering.
.. data:: RIGHT_EYE
Right eye being used during stereoscopic rendering.
.. data:: RAS_OFS_RENDER_BUFFER
The pixel buffer for offscreen render is a RenderBuffer. Argument to :func:`offScreenCreate`
.. data:: RAS_OFS_RENDER_TEXTURE
The pixel buffer for offscreen render is a Texture. Argument to :func:`offScreenCreate`
*****
Types
*****
.. class:: RASOffScreen
An off-screen render buffer object.
Use :func:`offScreenCreate` to create it.
Currently it can only be used in the :class:`bge.texture.ImageRender`
constructor to render on a FBO rather than the default viewport.
.. attribute:: width
The width in pixel of the FBO
:type: integer
.. attribute:: height
The height in pixel of the FBO
:type: integer
.. attribute:: color
The underlying OpenGL bind code of the texture object that holds
the rendered image, 0 if the FBO is using RenderBuffer.
The choice between RenderBuffer and Texture is determined
by the target argument of :func:`offScreenCreate`.
:type: integer
*********
Functions
*********
.. function:: getWindowWidth()
Gets the width of the window (in pixels)
:rtype: integer
.. function:: getWindowHeight()
Gets the height of the window (in pixels)
:rtype: integer
.. function:: setWindowSize(width, height)
Set the width and height of the window (in pixels). This also works for fullscreen applications.
.. note:: Only works in the standalone player, not the Blender-embedded player.
:arg width: width in pixels
:type width: integer
:arg height: height in pixels
:type height: integer
.. function:: setFullScreen(enable)
Set whether or not the window should be fullscreen.
.. note:: Only works in the standalone player, not the Blender-embedded player.
:arg enable: ``True`` to set full screen, ``False`` to set windowed.
:type enable: bool
.. function:: getFullScreen()
Returns whether or not the window is fullscreen.
.. note:: Only works in the standalone player, not the Blender-embedded player; there it always returns False.
:rtype: bool
.. function:: getDisplayDimensions()
Get the display dimensions, in pixels, of the display (e.g., the
monitor). Can return the size of the entire view, so the
combination of all monitors; for example, ``(3840, 1080)`` for two
side-by-side 1080p monitors.
:rtype: tuple (width, height)
.. function:: makeScreenshot(filename)
Writes an image file with the current displayed frame.
The image is written to *'filename'*.
The path may be absolute (eg. ``/home/foo/image``) or relative when started with
``//`` (eg. ``//image``). Note that absolute paths are not portable between platforms.
If the filename contains a ``#``,
it will be replaced by an incremental index so that screenshots can be taken multiple
times without overwriting the previous ones (eg. ``image-#``).
Settings for the image are taken from the render settings (file format and respective settings,
gamma and colospace conversion, etc).
The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
When running from the standalone player, instead of the embedded player, only PNG files are supported.
Additional color conversions are also not supported.
:arg filename: path and name of the file to write
:type filename: string
.. function:: enableVisibility(visible)
Deprecated; doesn't do anything.
.. function:: showMouse(visible)
Enables or disables the operating system mouse cursor.
:arg visible:
:type visible: boolean
.. function:: setMousePosition(x, y)
Sets the mouse cursor position.
:arg x: X-coordinate in screen pixel coordinates.
:type x: integer
:arg y: Y-coordinate in screen pixel coordinates.
:type y: integer
.. function:: setBackgroundColor(rgba)
Deprecated and no longer functional. Use :py:meth:`bge.types.KX_WorldInfo.backgroundColor` instead.
.. function:: setEyeSeparation(eyesep)
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
:arg eyesep: The distance between the left and right eye.
:type eyesep: float
.. function:: getEyeSeparation()
Gets the current eye separation for stereo mode.
:rtype: float
.. function:: setFocalLength(focallength)
Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
:arg focallength: The focal length.
:type focallength: float
.. function:: getFocalLength()
Gets the current focal length for stereo mode.
:rtype: float
.. function:: getStereoEye()
Gets the current stereoscopy eye being rendered.
This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback
function to customize the camera projection matrices for each
stereoscopic eye.
:rtype: LEFT_EYE, RIGHT_EYE
.. function:: setMaterialMode(mode)
Set the material mode to use for OpenGL rendering.
:arg mode: material mode
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. note:: Changes will only affect newly created scenes.
.. function:: getMaterialMode(mode)
Get the material mode to use for OpenGL rendering.
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. function:: setGLSLMaterialSetting(setting, enable)
Enables or disables a GLSL material setting.
:arg setting:
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:arg enable:
:type enable: boolean
.. function:: getGLSLMaterialSetting(setting)
Get the state of a GLSL material setting.
:arg setting:
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:rtype: boolean
.. function:: setAnisotropicFiltering(level)
Set the anisotropic filtering level for textures.
:arg level: The new anisotropic filtering level to use
:type level: integer (must be one of 1, 2, 4, 8, 16)
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getAnisotropicFiltering()
Get the anisotropic filtering level used for textures.
:rtype: integer (one of 1, 2, 4, 8, 16)
.. function:: setMipmapping(value)
Change how to use mipmapping.
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getMipmapping()
Get the current mipmapping setting.
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. function:: drawLine(fromVec,toVec,color)
Draw a line in the 3D scene.
:arg fromVec: the origin of the line
:type fromVec: list [x, y, z]
:arg toVec: the end of the line
:type toVec: list [x, y, z]
:arg color: the color of the line
:type color: list [r, g, b]
.. function:: enableMotionBlur(factor)
Enable the motion blur effect.
:arg factor: the ammount of motion blur to display.
:type factor: float [0.0 - 1.0]
.. function:: disableMotionBlur()
Disable the motion blur effect.
.. function:: showFramerate(enable)
Show or hide the framerate.
:arg enable:
:type enable: boolean
.. function:: showProfile(enable)
Show or hide the profile.
:arg enable:
:type enable: boolean
.. function:: showProperties(enable)
Show or hide the debug properties.
:arg enable:
:type enable: boolean
.. function:: autoDebugList(enable)
Enable or disable auto adding debug properties to the debug list.
:arg enable:
:type enable: boolean
.. function:: clearDebugList()
Clears the debug property list.
.. function:: setVsync(value)
Set the vsync value
:arg value: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
:type value: integer
.. function:: getVsync()
Get the current vsync value
:rtype: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE
.. function:: offScreenCreate(width,height[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
Create a Off-screen render buffer object.
:arg width: the width of the buffer in pixels
:type width: integer
:arg height: the height of the buffer in pixels
:type height: integer
:arg samples: the number of multisample for anti-aliasing (MSAA), 0 to disable MSAA
:type samples: integer
:arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default),
:data:`RAS_OFS_RENDER_TEXTURE` to render on texture.
The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`).
Otherwise the default is preferable as it's more widely supported by GPUs and more efficient.
If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled.
:type target: integer
:rtype: :class:`RASOffScreen`

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +0,0 @@
Game Types (bge.types)
======================
.. module:: bge.types
************
Introduction
************
This module contains the classes that appear as instances in the Game Engine. A
script must interact with these classes if it is to affect the behaviour of
objects in a game.
The following example would move an object (i.e. an instance of
:class:`KX_GameObject`) one unit up.
.. code-block:: python
# bge.types.SCA_PythonController
cont = bge.logic.getCurrentController()
# bge.types.KX_GameObject
obj = cont.owner
obj.worldPosition.z += 1
To run the code, it could be placed in a Blender text block and executed with
a :class:`SCA_PythonController` logic brick.
*****
Types
*****
.. toctree::
:glob:
bge.types.*

View File

@@ -1,75 +0,0 @@
BL_ActionActuator(SCA_IActuator)
================================
base class --- :class:`SCA_IActuator`
.. class:: BL_ActionActuator(SCA_IActuator)
Action Actuators apply an action to an actor.
.. attribute:: action
The name of the action to set as the current action.
:type: string
.. attribute:: frameStart
Specifies the starting frame of the animation.
:type: float
.. attribute:: frameEnd
Specifies the ending frame of the animation.
:type: float
.. attribute:: blendIn
Specifies the number of frames of animation to generate when making transitions between actions.
:type: float
.. attribute:: priority
Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
:type: integer
.. attribute:: frame
Sets the current frame for the animation.
:type: float
.. attribute:: propName
Sets the property to be used in FromProp playback mode.
:type: string
.. attribute:: blendTime
Sets the internal frame timer. This property must be in the range from 0.0 to blendIn.
:type: float
.. attribute:: mode
The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
:type: integer
.. attribute:: useContinue
The actions continue option, True or False. When True, the action will always play from where last left off,
otherwise negative events to this actuator will reset it to its start frame.
:type: boolean
.. attribute:: framePropName
The name of the property that is set to the current frame number.
:type: string

View File

@@ -1,58 +0,0 @@
BL_ArmatureActuator(SCA_IActuator)
==================================
base class --- :class:`SCA_IActuator`
.. class:: BL_ArmatureActuator(SCA_IActuator)
Armature Actuators change constraint condition on armatures.
.. attribute:: type
The type of action that the actuator executes when it is active.
Can be one of :ref:`these constants <armatureactuator-constants-type>`
:type: integer
.. attribute:: constraint
The constraint object this actuator is controlling.
:type: :class:`BL_ArmatureConstraint`
.. attribute:: target
The object that this actuator will set as primary target to the constraint it controls.
:type: :class:`KX_GameObject`
.. attribute:: subtarget
The object that this actuator will set as secondary target to the constraint it controls.
:type: :class:`KX_GameObject`.
.. note::
Currently, the only secondary target is the pole target for IK constraint.
.. attribute:: weight
The weight this actuator will set on the constraint it controls.
:type: float.
.. note::
Currently only the IK constraint has a weight. It must be a value between 0 and 1.
.. note::
A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`)
.. attribute:: influence
The influence this actuator will set on the constraint it controls.
:type: float.

View File

@@ -1,103 +0,0 @@
BL_ArmatureBone(PyObjectPlus)
=============================
base class --- :class:`PyObjectPlus`
.. class:: BL_ArmatureBone(PyObjectPlus)
Proxy to Blender bone structure. All fields are read-only and comply to RNA names.
All space attribute correspond to the rest pose.
.. attribute:: name
bone name.
:type: string
.. attribute:: connected
true when the bone head is struck to the parent's tail.
:type: boolean
.. attribute:: hinge
true when bone doesn't inherit rotation or scale from parent bone.
:type: boolean
.. attribute:: inherit_scale
true when bone inherits scaling from parent bone.
:type: boolean
.. attribute:: bbone_segments
number of B-bone segments.
:type: integer
.. attribute:: roll
bone rotation around head-tail axis.
:type: float
.. attribute:: head
location of head end of the bone in parent bone space.
:type: vector [x, y, z]
.. attribute:: tail
location of head end of the bone in parent bone space.
:type: vector [x, y, z]
.. attribute:: length
bone length.
:type: float
.. attribute:: arm_head
location of head end of the bone in armature space.
:type: vector [x, y, z]
.. attribute:: arm_tail
location of tail end of the bone in armature space.
:type: vector [x, y, z]
.. attribute:: arm_mat
matrix of the bone head in armature space.
:type: matrix [4][4]
.. note::
This matrix has no scale part.
.. attribute:: bone_mat
rotation matrix of the bone in parent bone space.
:type: matrix [3][3]
.. attribute:: parent
parent bone, or None for root bone.
:type: :class:`BL_ArmatureBone`
.. attribute:: children
list of bone's children.
:type: list of :class:`BL_ArmatureBone`

View File

@@ -1,275 +0,0 @@
BL_ArmatureChannel(PyObjectPlus)
================================
base class --- :class:`PyObjectPlus`
.. class:: BL_ArmatureChannel(PyObjectPlus)
Proxy to armature pose channel. Allows to read and set armature pose.
The attributes are identical to RNA attributes, but mostly in read-only mode.
.. attribute:: name
channel name (=bone name), read-only.
:type: string
.. attribute:: bone
return the bone object corresponding to this pose channel, read-only.
:type: :class:`BL_ArmatureBone`
.. attribute:: parent
return the parent channel object, None if root channel, read-only.
:type: :class:`BL_ArmatureChannel`
.. attribute:: has_ik
true if the bone is part of an active IK chain, read-only.
This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
:type: boolean
.. attribute:: ik_dof_x
true if the bone is free to rotation in the X axis, read-only.
:type: boolean
.. attribute:: ik_dof_y
true if the bone is free to rotation in the Y axis, read-only.
:type: boolean
.. attribute:: ik_dof_z
true if the bone is free to rotation in the Z axis, read-only.
:type: boolean
.. attribute:: ik_limit_x
true if a limit is imposed on X rotation, read-only.
:type: boolean
.. attribute:: ik_limit_y
true if a limit is imposed on Y rotation, read-only.
:type: boolean
.. attribute:: ik_limit_z
true if a limit is imposed on Z rotation, read-only.
:type: boolean
.. attribute:: ik_rot_control
true if channel rotation should applied as IK constraint, read-only.
:type: boolean
.. attribute:: ik_lin_control
true if channel size should applied as IK constraint, read-only.
:type: boolean
.. attribute:: location
displacement of the bone head in armature local space, read-write.
:type: vector [X, Y, Z].
.. note::
You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
.. note::
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
.. attribute:: scale
scale of the bone relative to its parent, read-write.
:type: vector [sizeX, sizeY, sizeZ].
.. note::
An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
.. note::
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: rotation_quaternion
rotation of the bone relative to its parent expressed as a quaternion, read-write.
:type: vector [qr, qi, qj, qk].
.. note::
This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
.. note::
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: rotation_euler
rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
:type: vector [X, Y, Z].
.. note::
This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation.
.. note::
Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
.. attribute:: rotation_mode
Method of updating the bone rotation, read-write.
:type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
.. attribute:: channel_matrix
pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
This field is updated after the graphic render, it represents the current pose.
:type: matrix [4][4]
.. attribute:: pose_matrix
pose matrix in armature space, read-only,
This field is updated after the graphic render, it represents the current pose.
:type: matrix [4][4]
.. attribute:: pose_head
position of bone head in armature space, read-only.
:type: vector [x, y, z]
.. attribute:: pose_tail
position of bone tail in armature space, read-only.
:type: vector [x, y, z]
.. attribute:: ik_min_x
minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
:type: float
.. attribute:: ik_max_x
maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
:type: float
.. attribute:: ik_min_y
minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
:type: float
.. attribute:: ik_max_y
maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
:type: float
.. attribute:: ik_min_z
minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
:type: float
.. attribute:: ik_max_z
maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
:type: float
.. attribute:: ik_stiffness_x
bone rotation stiffness in X axis, read-only.
:type: float between 0 and 1
.. attribute:: ik_stiffness_y
bone rotation stiffness in Y axis, read-only.
:type: float between 0 and 1
.. attribute:: ik_stiffness_z
bone rotation stiffness in Z axis, read-only.
:type: float between 0 and 1
.. attribute:: ik_stretch
ratio of scale change that is allowed, 0=bone can't change size, read-only.
:type: float
.. attribute:: ik_rot_weight
weight of rotation constraint when ik_rot_control is set, read-write.
:type: float between 0 and 1
.. attribute:: ik_lin_weight
weight of size constraint when ik_lin_control is set, read-write.
:type: float between 0 and 1
.. attribute:: joint_rotation
Control bone rotation in term of joint angle (for robotic applications), read-write.
When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
* 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
* 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
* 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
* 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
:type: vector [x, y, z]
.. note::
The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
.. note::
[0, 0, 0] always corresponds to the rest pose.
.. note::
You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
.. note::
You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.

View File

@@ -1,126 +0,0 @@
BL_ArmatureConstraint(PyObjectPlus)
===================================
base class --- :class:`PyObjectPlus`
.. class:: BL_ArmatureConstraint(PyObjectPlus)
Proxy to Armature Constraint. Allows to change constraint on the fly.
Obtained through :class:`BL_ArmatureObject`.constraints.
.. note::
Not all armature constraints are supported in the GE.
.. attribute:: type
Type of constraint, (read-only).
Use one of :ref:`these constants<armatureconstraint-constants-type>`.
:type: integer, one of CONSTRAINT_TYPE_* constants
.. attribute:: name
Name of constraint constructed as <bone_name>:<constraint_name>. constraints list.
:type: string
This name is also the key subscript on :class:`BL_ArmatureObject`.
.. attribute:: enforce
fraction of constraint effect that is enforced. Between 0 and 1.
:type: float
.. attribute:: headtail
Position of target between head and tail of the target bone: 0=head, 1=tail.
:type: float.
.. note::
Only used if the target is a bone (i.e target object is an armature.
.. attribute:: lin_error
runtime linear error (in Blender units) on constraint at the current frame.
This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
:type: float
.. attribute:: rot_error
Runtime rotation error (in radiant) on constraint at the current frame.
:type: float.
This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver.
It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint.
.. attribute:: target
Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint.
:type: :class:`KX_GameObject`.
.. attribute:: subtarget
Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint.
:type: :class:`KX_GameObject`.
Currently this is only used for pole target on IK constraint.
.. attribute:: active
True if the constraint is active.
:type: boolean
.. note::
An inactive constraint does not update lin_error and rot_error.
.. attribute:: ik_weight
Weight of the IK constraint between 0 and 1.
Only defined for IK constraint.
:type: float
.. attribute:: ik_type
Type of IK constraint, (read-only).
Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`.
:type: integer.
.. attribute:: ik_flag
Combination of IK constraint option flags, read-only.
Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`.
:type: integer
.. attribute:: ik_dist
Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE.
:type: float
.. attribute:: ik_mode
Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`.
Additional mode for IK constraint. Currently only used for Distance constraint:
:type: integer

View File

@@ -1,31 +0,0 @@
BL_ArmatureObject(KX_GameObject)
================================
base class --- :class:`KX_GameObject`
.. class:: BL_ArmatureObject(KX_GameObject)
An armature object.
.. attribute:: constraints
The list of armature constraint defined on this armature.
Elements of the list can be accessed by index or string.
The key format for string access is '<bone_name>:<constraint_name>'.
:type: list of :class:`BL_ArmatureConstraint`
.. attribute:: channels
The list of armature channels.
Elements of the list can be accessed by index or name the bone.
:type: list of :class:`BL_ArmatureChannel`
.. method:: update()
Ensures that the armature will be updated on next graphic frame.
This action is unecessary if a KX_ArmatureActuator with mode run is active
or if an action is playing. Use this function in other cases. It must be called
on each frame to ensure that the armature is updated continously.

View File

@@ -1,227 +0,0 @@
BL_Shader(PyObjectPlus)
=======================
base class --- :class:`PyObjectPlus`
.. class:: BL_Shader(PyObjectPlus)
BL_Shader GLSL shaders.
TODO - Description
.. method:: setUniformfv(name, fList)
Set a uniform with a list of float values
:arg name: the uniform name
:type name: string
:arg fList: a list (2, 3 or 4 elements) of float values
:type fList: list[float]
.. method:: delSource()
Clear the shader. Use this method before the source is changed with :data:`setSource`.
.. method:: getFragmentProg()
Returns the fragment program.
:return: The fragment program.
:rtype: string
.. method:: getVertexProg()
Get the vertex program.
:return: The vertex program.
:rtype: string
.. method:: isValid()
Check if the shader is valid.
:return: True if the shader is valid
:rtype: boolean
.. method:: setAttrib(enum)
Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
:arg enum: attribute location value
:type enum: integer
.. method:: setNumberOfPasses( max_pass )
Set the maximum number of passes. Not used a.t.m.
:arg max_pass: the maximum number of passes
:type max_pass: integer
.. method:: setSampler(name, index)
Set uniform texture sample index.
:arg name: Uniform name
:type name: string
:arg index: Texture sample index.
:type index: integer
.. method:: setSource(vertexProgram, fragmentProgram)
Set the vertex and fragment programs
:arg vertexProgram: Vertex program
:type vertexProgram: string
:arg fragmentProgram: Fragment program
:type fragmentProgram: string
.. method:: setUniform1f(name, fx)
Set a uniform with 1 float value.
:arg name: the uniform name
:type name: string
:arg fx: Uniform value
:type fx: float
.. method:: setUniform1i(name, ix)
Set a uniform with an integer value.
:arg name: the uniform name
:type name: string
:arg ix: the uniform value
:type ix: integer
.. method:: setUniform2f(name, fx, fy)
Set a uniform with 2 float values
:arg name: the uniform name
:type name: string
:arg fx: first float value
:type fx: float
:arg fy: second float value
:type fy: float
.. method:: setUniform2i(name, ix, iy)
Set a uniform with 2 integer values
:arg name: the uniform name
:type name: string
:arg ix: first integer value
:type ix: integer
:arg iy: second integer value
:type iy: integer
.. method:: setUniform3f(name, fx, fy, fz)
Set a uniform with 3 float values.
:arg name: the uniform name
:type name: string
:arg fx: first float value
:type fx: float
:arg fy: second float value
:type fy: float
:arg fz: third float value
:type fz: float
.. method:: setUniform3i(name, ix, iy, iz)
Set a uniform with 3 integer values
:arg name: the uniform name
:type name: string
:arg ix: first integer value
:type ix: integer
:arg iy: second integer value
:type iy: integer
:arg iz: third integer value
:type iz: integer
.. method:: setUniform4f(name, fx, fy, fz, fw)
Set a uniform with 4 float values.
:arg name: the uniform name
:type name: string
:arg fx: first float value
:type fx: float
:arg fy: second float value
:type fy: float
:arg fz: third float value
:type fz: float
:arg fw: fourth float value
:type fw: float
.. method:: setUniform4i(name, ix, iy, iz, iw)
Set a uniform with 4 integer values
:arg name: the uniform name
:type name: string
:arg ix: first integer value
:type ix: integer
:arg iy: second integer value
:type iy: integer
:arg iz: third integer value
:type iz: integer
:arg iw: fourth integer value
:type iw: integer
.. method:: setUniformDef(name, type)
Define a new uniform
:arg name: the uniform name
:type name: string
:arg type: uniform type
:type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
.. method:: setUniformMatrix3(name, mat, transpose)
Set a uniform with a 3x3 matrix value
:arg name: the uniform name
:type name: string
:arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
:type mat: 3x3 matrix
:arg transpose: set to True to transpose the matrix
:type transpose: boolean
.. method:: setUniformMatrix4(name, mat, transpose)
Set a uniform with a 4x4 matrix value
:arg name: the uniform name
:type name: string
:arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
:type mat: 4x4 matrix
:arg transpose: set to True to transpose the matrix
:type transpose: boolean
.. method:: setUniformiv(name, iList)
Set a uniform with a list of integer values
:arg name: the uniform name
:type name: string
:arg iList: a list (2, 3 or 4 elements) of integer values
:type iList: list[integer]
.. method:: setUniformEyef(name)
Set a uniform with a float value that reflects the eye being render in stereo mode:
0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform
is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures
containing the left and right eye images in a top-bottom order.
:arg name: the uniform name
:type name: string
.. method:: validate()
Validate the shader object.

View File

@@ -1,68 +0,0 @@
BL_ShapeActionActuator(SCA_IActuator)
=====================================
base class --- :class:`SCA_IActuator`
.. class:: BL_ShapeActionActuator(SCA_IActuator)
ShapeAction Actuators apply an shape action to an mesh object.
.. attribute:: action
The name of the action to set as the current shape action.
:type: string
.. attribute:: frameStart
Specifies the starting frame of the shape animation.
:type: float
.. attribute:: frameEnd
Specifies the ending frame of the shape animation.
:type: float
.. attribute:: blendIn
Specifies the number of frames of animation to generate when making transitions between actions.
:type: float
.. attribute:: priority
Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers.
:type: integer
.. attribute:: frame
Sets the current frame for the animation.
:type: float
.. attribute:: propName
Sets the property to be used in FromProp playback mode.
:type: string
.. attribute:: blendTime
Sets the internal frame timer. This property must be in the range from 0.0 to blendin.
:type: float
.. attribute:: mode
The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`.
:type: integer
.. attribute:: framePropName
The name of the property that is set to the current frame number.
:type: string

View File

@@ -1,69 +0,0 @@
CListValue(CPropValue)
======================
base class --- :class:`CPropValue`
.. class:: CListValue(CPropValue)
This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``)
Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported.
.. method:: append(val)
Add an item to the list (like pythons append)
.. warning::
Appending values to the list can cause crashes when the list is used internally by the game engine.
.. method:: count(val)
Count the number of instances of a value in the list.
:return: number of instances
:rtype: integer
.. method:: index(val)
Return the index of a value in the list.
:return: The index of the value in the list.
:rtype: integer
.. method:: reverse()
Reverse the order of the list.
.. method:: get(key, default=None)
Return the value matching key, or the default value if its not found.
:return: The key value or a default.
.. method:: from_id(id)
This is a funtion especially for the game engine to return a value with a spesific id.
Since object names are not always unique, the id of an object can be used to get an object from the CValueList.
Example:
.. code-block:: python
myObID=id(gameObject)
ob= scene.objects.from_id(myObID)
Where ``myObID`` is an int or long from the id function.
This has the advantage that you can store the id in places you could not store a gameObject.
.. warning::
The id is derived from a memory location and will be different each time the game engine starts.
.. warning::
The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups.

View File

@@ -1,8 +0,0 @@
CPropValue(CValue)
==================
base class --- :class:`CValue`
.. class:: CPropValue(CValue)
This class has no python functions

View File

@@ -1,15 +0,0 @@
CValue(PyObjectPlus)
====================
base class --- :class:`PyObjectPlus`
.. class:: CValue(PyObjectPlus)
This class is a basis for other classes.
.. attribute:: name
The name of this CValue derived object (read-only).
:type: string

View File

@@ -1,34 +0,0 @@
KX_ArmatureSensor(SCA_ISensor)
==============================
base class --- :class:`SCA_ISensor`
.. class:: KX_ArmatureSensor(SCA_ISensor)
Armature sensor detect conditions on armatures.
.. attribute:: type
The type of measurement that the sensor make when it is active.
Can be one of :ref:`these constants <armaturesensor-type>`
:type: integer.
.. attribute:: constraint
The constraint object this sensor is watching.
:type: :class:`BL_ArmatureConstraint`
.. attribute:: value
The threshold used in the comparison with the constraint error
The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver
The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver
The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone
The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations
The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller.
:type: float

View File

@@ -1,182 +0,0 @@
KX_BlenderMaterial(PyObjectPlus)
================================
base class --- :class:`PyObjectPlus`
.. class:: KX_BlenderMaterial(PyObjectPlus)
This is the interface to materials in the game engine.
Materials define the render state to be applied to mesh objects.
The example below shows a simple GLSL shader setup allowing to dynamically mix two texture channels
in a material. All materials of the object executing this script should have two textures using
separate UV maps in the two first texture channels.
The code works for both Multitexture and GLSL rendering modes.
.. code-block:: python
from bge import logic
vertex_shader = """
void main(void)
{
// simple projection of the vertex position to view space
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// coordinate of the 1st texture channel
gl_TexCoord[0] = gl_MultiTexCoord0;
// coordinate of the 2nd texture channel
gl_TexCoord[1] = gl_MultiTexCoord1;
}
"""
fragment_shader ="""
uniform sampler2D texture_0;
uniform sampler2D texture_1;
uniform float factor;
void main(void)
{
vec4 color_0 = texture2D(texture_0, gl_TexCoord[0].st);
vec4 color_1 = texture2D(texture_1, gl_TexCoord[1].st);
gl_FragColor = mix(color_0, color_1, factor);
}
"""
object = logic.getCurrentController().owner
for mesh in object.meshes:
for material in mesh.materials:
shader = material.getShader()
if shader is not None:
if not shader.isValid():
shader.setSource(vertex_shader, fragment_shader, True)
# get the first texture channel of the material
shader.setSampler('texture_0', 0)
# get the second texture channel of the material
shader.setSampler('texture_1', 1)
# pass another uniform to the shader
shader.setUniform1f('factor', 0.3)
.. attribute:: shader
The material's shader.
:type: :class:`BL_Shader`
.. attribute:: blending
Ints used for pixel blending, (src, dst), matching the setBlending method.
:type: (integer, integer)
.. attribute:: material_index
The material's index.
:type: integer
.. method:: getShader()
Returns the material's shader.
:return: the material's shader
:rtype: :class:`BL_Shader`
.. method:: getTextureBindcode(textureslot)
Returns the material's texture OpenGL bind code/id/number/name.
:arg textureslot: Specifies the texture slot number
:type textureslot: integer
:return: the material's texture OpenGL bind code/id/number/name
:rtype: integer
.. attribute:: alpha
The material's alpha transparency.
:type: float between 0.0 and 1.0 inclusive
.. attribute:: hardness
How hard (sharp) the material's specular reflection is.
:type: integer between 1 and 511 inclusive
.. attribute:: emit
Amount of light to emit.
:type: float between 0.0 and 2.0 inclusive
.. attribute:: specularIntensity
How intense (bright) the material's specular reflection is.
:type: float between 0.0 and 1.0 inclusive
.. attribute:: diffuseIntensity
The material's amount of diffuse reflection.
:type: float between 0.0 and 1.0 inclusive
.. attribute:: specularColor
The material's specular color.
:type: :class:`mathutils.Color`
.. attribute:: diffuseColor
The material's diffuse color.
:type: :class:`mathutils.Color`
.. method:: setBlending(src, dest)
Set the pixel color arithmetic functions.
:arg src: Specifies how the red, green, blue, and alpha source blending factors are computed, one of...
* :data:`~bgl.GL_ZERO`
* :data:`~bgl.GL_ONE`
* :data:`~bgl.GL_SRC_COLOR`
* :data:`~bgl.GL_ONE_MINUS_SRC_COLOR`
* :data:`~bgl.GL_DST_COLOR`
* :data:`~bgl.GL_ONE_MINUS_DST_COLOR`
* :data:`~bgl.GL_SRC_ALPHA`
* :data:`~bgl.GL_ONE_MINUS_SRC_ALPHA`
* :data:`~bgl.GL_DST_ALPHA`
* :data:`~bgl.GL_ONE_MINUS_DST_ALPHA`
* :data:`~bgl.GL_SRC_ALPHA_SATURATE`
:type src: int
:arg dest: Specifies how the red, green, blue, and alpha destination blending factors are computed, one of...
* :data:`~bgl.GL_ZERO`
* :data:`~bgl.GL_ONE`
* :data:`~bgl.GL_SRC_COLOR`
* :data:`~bgl.GL_ONE_MINUS_SRC_COLOR`
* :data:`~bgl.GL_DST_COLOR`
* :data:`~bgl.GL_ONE_MINUS_DST_COLOR`
* :data:`~bgl.GL_SRC_ALPHA`
* :data:`~bgl.GL_ONE_MINUS_SRC_ALPHA`
* :data:`~bgl.GL_DST_ALPHA`
* :data:`~bgl.GL_ONE_MINUS_DST_ALPHA`
* :data:`~bgl.GL_SRC_ALPHA_SATURATE`
:type dest: int
.. method:: getMaterialIndex()
Returns the material's index.
:return: the material's index
:rtype: integer

View File

@@ -1,300 +0,0 @@
KX_Camera(KX_GameObject)
========================
base class --- :class:`KX_GameObject`
.. class:: KX_Camera(KX_GameObject)
A Camera object.
.. data:: INSIDE
See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
.. data:: INTERSECT
See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
.. data:: OUTSIDE
See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum`
.. attribute:: lens
The camera's lens value.
:type: float
.. attribute:: fov
The camera's field of view value.
:type: float
.. attribute:: ortho_scale
The camera's view scale when in orthographic mode.
:type: float
.. attribute:: near
The camera's near clip distance.
:type: float
.. attribute:: far
The camera's far clip distance.
:type: float
.. attribute:: shift_x
The camera's horizontal shift.
:type: float
.. attribute:: shift_y
The camera's vertical shift.
:type: float
.. attribute:: perspective
True if this camera has a perspective transform, False for an orthographic projection.
:type: boolean
.. attribute:: frustum_culling
True if this camera is frustum culling.
:type: boolean
.. attribute:: projection_matrix
This camera's 4x4 projection matrix.
.. note::
This is the identity matrix prior to rendering the first frame (any Python done on frame 1).
:type: 4x4 Matrix [[float]]
.. attribute:: modelview_matrix
This camera's 4x4 model view matrix. (read-only).
:type: 4x4 Matrix [[float]]
.. note::
This matrix is regenerated every frame from the camera's position and orientation. Also, this is the identity matrix prior to rendering the first frame (any Python done on frame 1).
.. attribute:: camera_to_world
This camera's camera to world transform. (read-only).
:type: 4x4 Matrix [[float]]
.. note::
This matrix is regenerated every frame from the camera's position and orientation.
.. attribute:: world_to_camera
This camera's world to camera transform. (read-only).
:type: 4x4 Matrix [[float]]
.. note::
Regenerated every frame from the camera's position and orientation.
.. note::
This is camera_to_world inverted.
.. attribute:: useViewport
True when the camera is used as a viewport, set True to enable a viewport for this camera.
:type: boolean
.. method:: sphereInsideFrustum(centre, radius)
Tests the given sphere against the view frustum.
:arg centre: The centre of the sphere (in world coordinates.)
:type centre: list [x, y, z]
:arg radius: the radius of the sphere
:type radius: float
:return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
:rtype: integer
.. note::
When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. code-block:: python
from bge import logic
cont = logic.getCurrentController()
cam = cont.owner
# A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0]
if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE):
# Sphere is inside frustum !
# Do something useful !
else:
# Sphere is outside frustum
.. method:: boxInsideFrustum(box)
Tests the given box against the view frustum.
:arg box: Eight (8) corner points of the box (in world coordinates.)
:type box: list of lists
:return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT`
.. note::
When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. code-block:: python
from bge import logic
cont = logic.getCurrentController()
cam = cont.owner
# Box to test...
box = []
box.append([-1.0, -1.0, -1.0])
box.append([-1.0, -1.0, 1.0])
box.append([-1.0, 1.0, -1.0])
box.append([-1.0, 1.0, 1.0])
box.append([ 1.0, -1.0, -1.0])
box.append([ 1.0, -1.0, 1.0])
box.append([ 1.0, 1.0, -1.0])
box.append([ 1.0, 1.0, 1.0])
if (cam.boxInsideFrustum(box) != cam.OUTSIDE):
# Box is inside/intersects frustum !
# Do something useful !
else:
# Box is outside the frustum !
.. method:: pointInsideFrustum(point)
Tests the given point against the view frustum.
:arg point: The point to test (in world coordinates.)
:type point: 3D Vector
:return: True if the given point is inside this camera's viewing frustum.
:rtype: boolean
.. note::
When the camera is first initialized the result will be invalid because the projection matrix has not been set.
.. code-block:: python
from bge import logic
cont = logic.getCurrentController()
cam = cont.owner
# Test point [0.0, 0.0, 0.0]
if (cam.pointInsideFrustum([0.0, 0.0, 0.0])):
# Point is inside frustum !
# Do something useful !
else:
# Box is outside the frustum !
.. method:: getCameraToWorld()
Returns the camera-to-world transform.
:return: the camera-to-world transform matrix.
:rtype: matrix (4x4 list)
.. method:: getWorldToCamera()
Returns the world-to-camera transform.
This returns the inverse matrix of getCameraToWorld().
:return: the world-to-camera transform matrix.
:rtype: matrix (4x4 list)
.. method:: setOnTop()
Set this cameras viewport ontop of all other viewport.
.. method:: setViewport(left, bottom, right, top)
Sets the region of this viewport on the screen in pixels.
Use :data:`bge.render.getWindowHeight` and :data:`bge.render.getWindowWidth` to calculate values relative to the entire display.
:arg left: left pixel coordinate of this viewport
:type left: integer
:arg bottom: bottom pixel coordinate of this viewport
:type bottom: integer
:arg right: right pixel coordinate of this viewport
:type right: integer
:arg top: top pixel coordinate of this viewport
:type top: integer
.. method:: getScreenPosition(object)
Gets the position of an object projected on screen space.
.. code-block:: python
# For an object in the middle of the screen, coord = [0.5, 0.5]
coord = camera.getScreenPosition(object)
:arg object: object name or list [x, y, z]
:type object: :class:`KX_GameObject` or 3D Vector
:return: the object's position in screen coordinates.
:rtype: list [x, y]
.. method:: getScreenVect(x, y)
Gets the vector from the camera position in the screen coordinate direction.
:arg x: X Axis
:type x: float
:arg y: Y Axis
:type y: float
:rtype: 3D Vector
:return: The vector from screen coordinate.
.. code-block:: python
# Gets the vector of the camera front direction:
m_vect = camera.getScreenVect(0.5, 0.5)
.. method:: getScreenRay(x, y, dist=inf, property=None)
Look towards a screen coordinate (x, y) and find first object hit within dist that matches prop.
The ray is similar to KX_GameObject->rayCastTo.
:arg x: X Axis
:type x: float
:arg y: Y Axis
:type y: float
:arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other
:type dist: float
:arg property: property name that object must have; can be omitted => detect any object
:type property: string
:rtype: :class:`KX_GameObject`
:return: the first object hit or None if no object or object does not match prop
.. code-block:: python
# Gets an object with a property "wall" in front of the camera within a distance of 100:
target = camera.getScreenRay(0.5, 0.5, 100, "wall")

View File

@@ -1,44 +0,0 @@
KX_CameraActuator(SCA_IActuator)
================================
base class --- :class:`SCA_IActuator`
.. class:: KX_CameraActuator(SCA_IActuator)
Applies changes to a camera.
.. attribute:: damping
strength of of the camera following movement.
:type: float
.. attribute:: axis
The camera axis (0, 1, 2) for positive ``XYZ``, (3, 4, 5) for negative ``XYZ``.
:type: int
.. attribute:: min
minimum distance to the target object maintained by the actuator.
:type: float
.. attribute:: max
maximum distance to stay from the target object.
:type: float
.. attribute:: height
height to stay above the target object.
:type: float
.. attribute:: object
the object this actuator tracks.
:type: :class:`KX_GameObject` or None

View File

@@ -1,42 +0,0 @@
KX_CharacterWrapper(PyObjectPlus)
=================================
base class --- :class:`PyObjectPlus`
.. class:: KX_CharacterWrapper(PyObjectPlus)
A wrapper to expose character physics options.
.. attribute:: onGround
Whether or not the character is on the ground. (read-only)
:type: boolean
.. attribute:: gravity
The gravity value used for the character.
:type: float
.. attribute:: maxJumps
The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc.
:type: int in [0, 255], default 1
.. attribute:: jumpCount
The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump.
:type: int
.. attribute:: walkDirection
The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
:type: Vector((x, y, z))
.. method:: jump()
The character jumps based on it's jump speed.

View File

@@ -1,76 +0,0 @@
KX_ConstraintActuator(SCA_IActuator)
====================================
base class --- :class:`SCA_IActuator`
.. class:: KX_ConstraintActuator(SCA_IActuator)
A constraint actuator limits the position, rotation, distance or orientation of an object.
.. attribute:: damp
Time constant of the constraint expressed in frame (not use by Force field constraint).
:type: integer
.. attribute:: rotDamp
Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well.
:type: integer
.. attribute:: direction
The reference direction in world coordinate for the orientation constraint.
:type: 3-tuple of float: (x, y, z)
.. attribute:: option
Binary combination of :ref:`these constants <constraint-actuator-option>`
:type: integer
.. attribute:: time
activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time.
:type: integer
.. attribute:: propName
the name of the property or material for the ray detection of the distance constraint.
:type: string
.. attribute:: min
The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant.
:type: float
.. attribute:: distance
the target distance of the distance constraint.
:type: float
.. attribute:: max
the upper bound of the constraint. For rotation and orientation constraints, it represents radiant.
:type: float
.. attribute:: rayLength
the length of the ray of the distance constraint.
:type: float
.. attribute:: limit
type of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>`
:type: integer.

View File

@@ -1,140 +0,0 @@
KX_ConstraintWrapper(PyObjectPlus)
==================================
base class --- :class:`PyObjectPlus`
.. class:: KX_ConstraintWrapper(PyObjectPlus)
KX_ConstraintWrapper
.. method:: getConstraintId(val)
Returns the contraint ID
:return: the constraint ID
:rtype: integer
.. method:: setParam(axis, value0, value1)
Set the contraint limits
:arg axis:
:type axis: integer
.. note::
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
axis = 3 is a constraint limit, with low/high limit value
* 3: X axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
For PHY_CONE_TWIST_CONSTRAINT = 4:
axis = 3..5 are constraint limits, high limit values
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
For PHY_GENERIC_6DOF_CONSTRAINT = 12:
axis = 0..2 are constraint limits, with low/high limit value
* 0: X axis position
* 1: Y axis position
* 2: Z axis position
axis = 3..5 are relative constraint (Euler) angles in radians
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
axis = 6..8 are translational motors, with value0=target velocity, value1 = max motor force
* 6: X axis position
* 7: Y axis position
* 8: Z axis position
axis = 9..11 are rotational motors, with value0=target velocity, value1 = max motor force
* 9: X axis angle
* 10: Y axis angle
* 11: Z axis angle
:arg value0 (speed): Set the linear velocity of the axis
:type value0: float Range: -10,000.00 to 10,000.00
:arg value1 (force): Set the maximum force limit of the axis
:type value1: float Range: -10,000.00 to 10,000.00
axis = 12..14 are for linear springs on each of the position of freedom
* 12: X axis position
* 13: Y axis position
* 14: Z axis position
axis = 15..17 are for angular springs on each of the angle of freedom in radians
* 15: X axis angle
* 16: Y axis angle
* 17: Z axis angle
:arg value0 (stiffness): Set the stiffness of the spring
:type value0: float
:arg value1 (damping): Tendency of the spring to return to it's original position
:type value1: float
1.0 = springs back to original position (no damping)
0.0 = don't springs back
.. method:: getParam(axis)
Get the contraint position or euler angle of a generic 6DOF constraint
:arg axis:
:type axis: integer
axis = 0..2 are linear constraint values
* 0: X axis position
* 1: Y axis position
* 2: Z axis position
:return: position
:rtype: float
axis = 3..5 are relative constraint (Euler) angles in radians
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:return: angle
:rtype: float
.. attribute:: constraint_id
Returns the contraint ID (read only)
:type: integer
.. attribute:: constraint_type
Returns the contraint type (read only)
:type: integer
- :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
- :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
- :class:`~bge.constraints.ANGULAR_CONSTRAINT`
- :class:`~bge.constraints.CONETWIST_CONSTRAINT`
- :class:`~bge.constraints.VEHICLE_CONSTRAINT`
- :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`

View File

@@ -1,29 +0,0 @@
KX_FontObject(KX_GameObject)
============================
base class --- :class:`KX_GameObject`
.. class:: KX_FontObject(KX_GameObject)
A Font object.
.. code-block:: python
# Display a message about the exit key using a Font object.
import bge
co = bge.logic.getCurrentController()
font = co.owner
exit_key = bge.events.EventToString(bge.logic.getExitKey())
if exit_key.endswith("KEY"):
exit_key = exit_key[:-3]
font.text = "Press key '%s' to quit the game." % exit_key
.. attribute:: text
The text displayed by this Font object.
:type: string

View File

@@ -1,20 +0,0 @@
KX_GameActuator(SCA_IActuator)
==============================
base class --- :class:`SCA_IActuator`
.. class:: KX_GameActuator(SCA_IActuator)
The game actuator loads a new .blend file, restarts the current .blend file or quits the game.
.. attribute:: fileName
the new .blend file to load.
:type: string
.. attribute:: mode
The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
:type: Int

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +0,0 @@
KX_LibLoadStatus(PyObjectPlus)
==============================
base class --- :class:`PyObjectPlus`
.. class:: KX_LibLoadStatus(PyObjectPlus)
An object providing information about a LibLoad() operation.
.. code-block:: python
# Print a message when an async LibLoad is done
import bge
def finished_cb(status):
print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))
bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb
.. attribute:: onFinish
A callback that gets called when the lib load is done.
:type: callable
.. attribute:: finished
The current status of the lib load.
:type: boolean
.. attribute:: progress
The current progress of the lib load as a normalized value from 0.0 to 1.0.
:type: float
.. attribute:: libraryName
The name of the library being loaded (the first argument to LibLoad).
:type: string
.. attribute:: timeTaken
The amount of time, in seconds, the lib load took (0 until the operation is complete).
:type: float

View File

@@ -1,161 +0,0 @@
KX_LightObject(KX_GameObject)
=============================
base class --- :class:`KX_GameObject`
.. class:: KX_LightObject(KX_GameObject)
A Light object.
.. code-block:: python
# Turn on a red alert light.
import bge
co = bge.logic.getCurrentController()
light = co.owner
light.energy = 1.0
light.color = [1.0, 0.0, 0.0]
.. data:: SPOT
A spot light source. See attribute :data:`type`
.. data:: SUN
A point light source with no attenuation. See attribute :data:`type`
.. data:: NORMAL
A point light source. See attribute :data:`type`
.. attribute:: type
The type of light - must be SPOT, SUN or NORMAL
.. attribute:: layer
The layer mask that this light affects object on.
:type: bitfield
.. attribute:: energy
The brightness of this light.
:type: float
.. attribute:: shadowClipStart
The shadowmap clip start, below which objects will not generate shadows.
:type: float (read only)
.. attribute:: shadowClipEnd
The shadowmap clip end, beyond which objects will not generate shadows.
:type: float (read only)
.. attribute:: shadowFrustumSize
Size of the frustum used for creating the shadowmap.
:type: float (read only)
.. attribute:: shadowBindId
The OpenGL shadow texture bind number/id.
:type: int (read only)
.. attribute:: shadowMapType
The shadow shadow map type (0 -> Simple; 1 -> Variance)
:type: int (read only)
.. attribute:: shadowBias
The shadow buffer sampling bias.
:type: float (read only)
.. attribute:: shadowBleedBias
The bias for reducing light-bleed on variance shadow maps.
:type: float (read only)
.. attribute:: useShadow
Returns True if the light has Shadow option activated, else returns False.
:type: boolean (read only)
.. attribute:: shadowColor
The color of this light shadows. Black = (0.0, 0.0, 0.0), White = (1.0, 1.0, 1.0).
:type: :class:`mathutils.Color` (read only)
.. attribute:: shadowMatrix
Matrix that converts a vector in camera space to shadow buffer depth space.
Computed as:
mat4_perspective_to_depth * mat4_lamp_to_perspective * mat4_world_to_lamp * mat4_cam_to_world.
mat4_perspective_to_depth is a fixed matrix defined as follow:
0.5 0.0 0.0 0.5
0.0 0.5 0.0 0.5
0.0 0.0 0.5 0.5
0.0 0.0 0.0 1.0
.. note:
There is one matrix of that type per lamp casting shadow in the scene.
:type: Matrix4x4 (read only)
.. attribute:: distance
The maximum distance this light can illuminate. (SPOT and NORMAL lights only).
:type: float
.. attribute:: color
The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
:type: list [r, g, b]
.. attribute:: lin_attenuation
The linear component of this light's attenuation. (SPOT and NORMAL lights only).
:type: float
.. attribute:: quad_attenuation
The quadratic component of this light's attenuation (SPOT and NORMAL lights only).
:type: float
.. attribute:: spotsize
The cone angle of the spot light, in degrees (SPOT lights only).
:type: float in [0 - 180].
.. attribute:: spotblend
Specifies the intensity distribution of the spot light (SPOT lights only).
:type: float in [0 - 1]
.. note::
Higher values result in a more focused light source.

View File

@@ -1,131 +0,0 @@
KX_MeshProxy(SCA_IObject)
=========================
base class --- :class:`SCA_IObject`
.. class:: KX_MeshProxy(SCA_IObject)
A mesh object.
You can only change the vertex properties of a mesh object, not the mesh topology.
To use mesh objects effectively, you should know a bit about how the game engine handles them.
#. Mesh Objects are converted from Blender at scene load.
#. The Converter groups polygons by Material. This means they can be sent to the renderer efficiently. A material holds:
#. The texture.
#. The Blender material.
#. The Tile properties
#. The face properties - (From the "Texture Face" panel)
#. Transparency & z sorting
#. Light layer
#. Polygon shape (triangle/quad)
#. Game Object
#. Vertices will be split by face if necessary. Vertices can only be shared between faces if:
#. They are at the same position
#. UV coordinates are the same
#. Their normals are the same (both polygons are "Set Smooth")
#. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
The correct method of iterating over every :class:`KX_VertexProxy` in a game object
.. code-block:: python
from bge import logic
cont = logic.getCurrentController()
object = cont.owner
for mesh in object.meshes:
for m_index in range(len(mesh.materials)):
for v_index in range(mesh.getVertexArrayLength(m_index)):
vertex = mesh.getVertex(m_index, v_index)
# Do something with vertex here...
# ... eg: color the vertex red.
vertex.color = [1.0, 0.0, 0.0, 1.0]
.. attribute:: materials
:type: list of :class:`KX_BlenderMaterial` type
.. attribute:: numPolygons
:type: integer
.. attribute:: numMaterials
:type: integer
.. method:: getMaterialName(matid)
Gets the name of the specified material.
:arg matid: the specified material.
:type matid: integer
:return: the attached material name.
:rtype: string
.. method:: getTextureName(matid)
Gets the name of the specified material's texture.
:arg matid: the specified material
:type matid: integer
:return: the attached material's texture name.
:rtype: string
.. method:: getVertexArrayLength(matid)
Gets the length of the vertex array associated with the specified material.
There is one vertex array for each material.
:arg matid: the specified material
:type matid: integer
:return: the number of verticies in the vertex array.
:rtype: integer
.. method:: getVertex(matid, index)
Gets the specified vertex from the mesh object.
:arg matid: the specified material
:type matid: integer
:arg index: the index into the vertex array.
:type index: integer
:return: a vertex object.
:rtype: :class:`KX_VertexProxy`
.. method:: getPolygon(index)
Gets the specified polygon from the mesh.
:arg index: polygon number
:type index: integer
:return: a polygon object.
:rtype: :class:`KX_PolyProxy`
.. method:: transform(matid, matrix)
Transforms the vertices of a mesh.
:arg matid: material index, -1 transforms all.
:type matid: integer
:arg matrix: transformation matrix.
:type matrix: 4x4 matrix [[float]]
.. method:: transformUV(matid, matrix, uv_index=-1, uv_index_from=-1)
Transforms the vertices UV's of a mesh.
:arg matid: material index, -1 transforms all.
:type matid: integer
:arg matrix: transformation matrix.
:type matrix: 4x4 matrix [[float]]
:arg uv_index: optional uv index, -1 for all, otherwise 0 or 1.
:type uv_index: integer
:arg uv_index_from: optional uv index to copy from, -1 to transform the current uv.
:type uv_index_from: integer

View File

@@ -1,100 +0,0 @@
KX_MouseActuator(SCA_IActuator)
====================================
base class --- :class:`SCA_IActuator`
.. class:: KX_MouseActuator(SCA_IActuator)
The mouse actuator gives control over the visibility of the mouse cursor and rotates the parent object according to mouse movement.
.. method:: reset()
Undoes the rotation caused by the mouse actuator.
.. attribute:: visible
The visibility of the mouse cursor.
:type: boolean
.. attribute:: use_axis_x
Mouse movement along the x axis effects object rotation.
:type: boolean
.. attribute:: use_axis_y
Mouse movement along the y axis effects object rotation.
:type: boolean
.. attribute:: threshold
Amount of movement from the mouse required before rotation is triggered.
:type: list (vector of 2 floats)
The values in the list should be between 0.0 and 0.5.
.. attribute:: reset_x
Mouse is locked to the center of the screen on the x axis.
:type: boolean
.. attribute:: reset_y
Mouse is locked to the center of the screen on the y axis.
:type: boolean
.. attribute:: object_axis
The object's 3D axis to rotate with the mouse movement. ([x, y])
:type: list (vector of 2 integers from 0 to 2)
* KX_ACT_MOUSE_OBJECT_AXIS_X
* KX_ACT_MOUSE_OBJECT_AXIS_Y
* KX_ACT_MOUSE_OBJECT_AXIS_Z
.. attribute:: local_x
Rotation caused by mouse movement along the x axis is local.
:type: boolean
.. attribute:: local_y
Rotation caused by mouse movement along the y axis is local.
:type: boolean
.. attribute:: sensitivity
The amount of rotation caused by mouse movement along the x and y axis.
:type: list (vector of 2 floats)
Negative values invert the rotation.
.. attribute:: limit_x
The minimum and maximum angle of rotation caused by mouse movement along the x axis in degrees.
limit_x[0] is minimum, limit_x[1] is maximum.
:type: list (vector of 2 floats)
.. attribute:: limit_y
The minimum and maximum angle of rotation caused by mouse movement along the y axis in degrees.
limit_y[0] is minimum, limit_y[1] is maximum.
:type: list (vector of 2 floats)
.. attribute:: angle
The current rotational offset caused by the mouse actuator in degrees.
:type: list (vector of 2 floats)

View File

@@ -1,81 +0,0 @@
KX_MouseFocusSensor(SCA_MouseSensor)
====================================
base class --- :class:`SCA_MouseSensor`
.. class:: KX_MouseFocusSensor(SCA_MouseSensor)
The mouse focus sensor detects when the mouse is over the current game object.
The mouse focus sensor works by transforming the mouse coordinates from 2d device
space to 3d space then raycasting away from the camera.
.. attribute:: raySource
The worldspace source of the ray (the view position).
:type: list (vector of 3 floats)
.. attribute:: rayTarget
The worldspace target of the ray.
:type: list (vector of 3 floats)
.. attribute:: rayDirection
The :data:`rayTarget` - :class:`raySource` normalized.
:type: list (normalized vector of 3 floats)
.. attribute:: hitObject
the last object the mouse was over.
:type: :class:`KX_GameObject` or None
.. attribute:: hitPosition
The worldspace position of the ray intersecton.
:type: list (vector of 3 floats)
.. attribute:: hitNormal
the worldspace normal from the face at point of intersection.
:type: list (normalized vector of 3 floats)
.. attribute:: hitUV
the UV coordinates at the point of intersection.
:type: list (vector of 2 floats)
If the object has no UV mapping, it returns [0, 0].
The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping.
.. attribute:: usePulseFocus
When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set).
:type: boolean
.. attribute:: useXRay
If enabled it allows the sensor to see through game objects that don't have the selected property or material.
:type: boolean
.. attribute:: propName
The property or material the sensor is looking for.
:type: string
.. attribute:: useMaterial
Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
:type: boolean

View File

@@ -1,44 +0,0 @@
KX_NavMeshObject(KX_GameObject)
===============================
base class --- :class:`KX_GameObject`
.. class:: KX_NavMeshObject(KX_GameObject)
Python interface for using and controlling navigation meshes.
.. method:: findPath(start, goal)
Finds the path from start to goal points.
:arg start: the start point
:arg start: 3D Vector
:arg goal: the goal point
:arg start: 3D Vector
:return: a path as a list of points
:rtype: list of points
.. method:: raycast(start, goal)
Raycast from start to goal points.
:arg start: the start point
:arg start: 3D Vector
:arg goal: the goal point
:arg start: 3D Vector
:return: the hit factor
:rtype: float
.. method:: draw(mode)
Draws a debug mesh for the navigation mesh.
:arg mode: the drawing mode (one of :ref:`these constants <navmesh-draw-mode>`)
:arg mode: integer
:return: None
.. method:: rebuild()
Rebuild the navigation mesh.
:return: None

View File

@@ -1,20 +0,0 @@
KX_NearSensor(KX_TouchSensor)
=============================
base class --- :class:`KX_TouchSensor`
.. class:: KX_NearSensor(KX_TouchSensor)
A near sensor is a specialised form of touch sensor.
.. attribute:: distance
The near sensor activates when an object is within this distance.
:type: float
.. attribute:: resetDistance
The near sensor deactivates when the object exceeds this distance.
:type: float

View File

@@ -1,32 +0,0 @@
KX_NetworkMessageActuator(SCA_IActuator)
========================================
base class --- :class:`SCA_IActuator`
.. class:: KX_NetworkMessageActuator(SCA_IActuator)
Message Actuator
.. attribute:: propName
Messages will only be sent to objects with the given property name.
:type: string
.. attribute:: subject
The subject field of the message.
:type: string
.. attribute:: body
The body of the message.
:type: string
.. attribute:: usePropBody
Send a property instead of a regular body message.
:type: boolean

View File

@@ -1,34 +0,0 @@
KX_NetworkMessageSensor(SCA_ISensor)
====================================
base class --- :class:`SCA_ISensor`
.. class:: KX_NetworkMessageSensor(SCA_ISensor)
The Message Sensor logic brick.
Currently only loopback (local) networks are supported.
.. attribute:: subject
The subject the sensor is looking for.
:type: string
.. attribute:: frameMessageCount
The number of messages received since the last frame. (read-only).
:type: integer
.. attribute:: subjects
The list of message subjects received. (read-only).
:type: list of strings
.. attribute:: bodies
The list of message bodies received. (read-only).
:type: list of strings

View File

@@ -1,126 +0,0 @@
KX_ObjectActuator(SCA_IActuator)
================================
base class --- :class:`SCA_IActuator`
.. class:: KX_ObjectActuator(SCA_IActuator)
The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement,
velocity, or angular velocity to an object.
Servo control allows to regulate force to achieve a certain speed target.
.. attribute:: force
The force applied by the actuator.
:type: Vector((x, y, z))
.. attribute:: useLocalForce
A flag specifying if the force is local.
:type: boolean
.. attribute:: torque
The torque applied by the actuator.
:type: Vector((x, y, z))
.. attribute:: useLocalTorque
A flag specifying if the torque is local.
:type: boolean
.. attribute:: dLoc
The displacement vector applied by the actuator.
:type: Vector((x, y, z))
.. attribute:: useLocalDLoc
A flag specifying if the dLoc is local.
:type: boolean
.. attribute:: dRot
The angular displacement vector applied by the actuator
:type: Vector((x, y, z))
.. note::
Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed.
.. attribute:: useLocalDRot
A flag specifying if the dRot is local.
:type: boolean
.. attribute:: linV
The linear velocity applied by the actuator.
:type: Vector((x, y, z))
.. attribute:: useLocalLinV
A flag specifying if the linear velocity is local.
:type: boolean
.. note::
This is the target speed for servo controllers.
.. attribute:: angV
The angular velocity applied by the actuator.
:type: Vector((x, y, z))
.. attribute:: useLocalAngV
A flag specifying if the angular velocity is local.
:type: boolean
.. attribute:: damping
The damping parameter of the servo controller.
:type: short
.. attribute:: forceLimitX
The min/max force limit along the X axis and activates or deactivates the limits in the servo controller.
:type: list [min(float), max(float), bool]
.. attribute:: forceLimitY
The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller.
:type: list [min(float), max(float), bool]
.. attribute:: forceLimitZ
The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller.
:type: list [min(float), max(float), bool]
.. attribute:: pid
The PID coefficients of the servo controller.
:type: list of floats [proportional, integral, derivate]
.. attribute:: reference
The object that is used as reference to compute the velocity for the servo controller.
:type: :class:`KX_GameObject` or None

View File

@@ -1,35 +0,0 @@
KX_ParentActuator(SCA_IActuator)
================================
base class --- :class:`SCA_IActuator`
.. class:: KX_ParentActuator(SCA_IActuator)
The parent actuator can set or remove an objects parent object.
.. attribute:: object
the object this actuator sets the parent too.
:type: :class:`KX_GameObject` or None
.. attribute:: mode
The mode of this actuator.
:type: integer from 0 to 1.
.. attribute:: compound
Whether the object shape should be added to the parent compound shape when parenting.
Effective only if the parent is already a compound shape.
:type: boolean
.. attribute:: ghost
Whether the object should be made ghost when parenting
Effective only if the shape is not added to the parent compound shape.
:type: boolean

View File

@@ -1,136 +0,0 @@
KX_PolyProxy(SCA_IObject)
=========================
base class --- :class:`SCA_IObject`
.. class:: KX_PolyProxy(SCA_IObject)
A polygon holds the index of the vertex forming the poylgon.
Note:
The polygon attributes are read-only, you need to retrieve the vertex proxy if you want
to change the vertex settings.
.. attribute:: material_name
The name of polygon material, empty if no material.
:type: string
.. attribute:: material
The material of the polygon.
:type: :class:`KX_BlenderMaterial`
.. attribute:: texture_name
The texture name of the polygon.
:type: string
.. attribute:: material_id
The material index of the polygon, use this to retrieve vertex proxy from mesh proxy.
:type: integer
.. attribute:: v1
vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
:type: integer
.. attribute:: v2
vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
:type: integer
.. attribute:: v3
vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy.
:type: integer
.. attribute:: v4
Vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
Use this to retrieve vertex proxy from mesh proxy.
:type: integer
.. attribute:: visible
visible state of the polygon: 1=visible, 0=invisible.
:type: integer
.. attribute:: collide
collide state of the polygon: 1=receives collision, 0=collision free.
:type: integer
.. method:: getMaterialName()
Returns the polygon material name with MA prefix
:return: material name
:rtype: string
.. method:: getMaterial()
:return: The polygon material
:rtype: :class:`KX_BlenderMaterial`
.. method:: getTextureName()
:return: The texture name
:rtype: string
.. method:: getMaterialIndex()
Returns the material bucket index of the polygon.
This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
:return: the material index in the mesh
:rtype: integer
.. method:: getNumVertex()
Returns the number of vertex of the polygon.
:return: number of vertex, 3 or 4.
:rtype: integer
.. method:: isVisible()
Returns whether the polygon is visible or not
:return: 0=invisible, 1=visible
:rtype: boolean
.. method:: isCollider()
Returns whether the polygon is receives collision or not
:return: 0=collision free, 1=receives collision
:rtype: integer
.. method:: getVertexIndex(vertex)
Returns the mesh vertex index of a polygon vertex
This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`.
:arg vertex: index of the vertex in the polygon: 0->3
:arg vertex: integer
:return: mesh vertex index
:rtype: integer
.. method:: getMesh()
Returns a mesh proxy
:return: mesh proxy
:rtype: :class:`MeshProxy`

View File

@@ -1,41 +0,0 @@
KX_RadarSensor(KX_NearSensor)
=============================
base class --- :class:`KX_NearSensor`
.. class:: KX_RadarSensor(KX_NearSensor)
Radar sensor is a near sensor with a conical sensor object.
.. attribute:: coneOrigin
The origin of the cone with which to test. The origin is in the middle of the cone. (read-only).
:type: list of floats [x, y, z]
.. attribute:: coneTarget
The center of the bottom face of the cone with which to test. (read-only).
:type: list of floats [x, y, z]
.. attribute:: distance
The height of the cone with which to test.
:type: float
.. attribute:: angle
The angle of the cone (in degrees) with which to test.
:type: float
.. attribute:: axis
The axis on which the radar cone is cast.
:type: integer from 0 to 5
KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z

View File

@@ -1,75 +0,0 @@
KX_RaySensor(SCA_ISensor)
=========================
base class --- :class:`SCA_ISensor`
.. class:: KX_RaySensor(SCA_ISensor)
A ray sensor detects the first object in a given direction.
.. attribute:: propName
The property the ray is looking for.
:type: string
.. attribute:: range
The distance of the ray.
:type: float
.. attribute:: useMaterial
Whether or not to look for a material (false = property).
:type: boolean
.. attribute:: useXRay
Whether or not to use XRay.
:type: boolean
.. attribute:: hitObject
The game object that was hit by the ray. (read-only).
:type: :class:`KX_GameObject`
.. attribute:: hitPosition
The position (in worldcoordinates) where the object was hit by the ray. (read-only).
:type: list [x, y, z]
.. attribute:: hitNormal
The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only).
:type: list [x, y, z]
.. attribute:: hitMaterial
The material of the object in the face hit by the ray. (read-only).
:type: string
.. attribute:: rayDirection
The direction from the ray (in worldcoordinates). (read-only).
:type: list [x, y, z]
.. attribute:: axis
The axis the ray is pointing on.
:type: integer from 0 to 5
* KX_RAY_AXIS_POS_X
* KX_RAY_AXIS_POS_Y
* KX_RAY_AXIS_POS_Z
* KX_RAY_AXIS_NEG_X
* KX_RAY_AXIS_NEG_Y
* KX_RAY_AXIS_NEG_Z

View File

@@ -1,52 +0,0 @@
KX_SCA_AddObjectActuator(SCA_IActuator)
=======================================
base class --- :class:`SCA_IActuator`
.. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
Edit Object Actuator (in Add Object Mode)
.. warning::
An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.
.. code-block:: none
Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)
.. attribute:: object
the object this actuator adds.
:type: :class:`KX_GameObject` or None
.. attribute:: objectLastCreated
the last added object from this actuator (read-only).
:type: :class:`KX_GameObject` or None
.. attribute:: time
the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
:type: integer
.. attribute:: linearVelocity
the initial linear velocity of added objects.
:type: list [vx, vy, vz]
.. attribute:: angularVelocity
the initial angular velocity of added objects.
:type: list [vx, vy, vz]
.. method:: instantAddObject()
adds the object without needing to calling SCA_PythonController.activate()
.. note:: Use objectLastCreated to get the newly created object.

View File

@@ -1,26 +0,0 @@
KX_SCA_DynamicActuator(SCA_IActuator)
=====================================
base class --- :class:`SCA_IActuator`
.. class:: KX_SCA_DynamicActuator(SCA_IActuator)
Dynamic Actuator.
.. attribute:: mode
:type: integer
the type of operation of the actuator, 0-4
* KX_DYN_RESTORE_DYNAMICS(0)
* KX_DYN_DISABLE_DYNAMICS(1)
* KX_DYN_ENABLE_RIGID_BODY(2)
* KX_DYN_DISABLE_RIGID_BODY(3)
* KX_DYN_SET_MASS(4)
.. attribute:: mass
the mass value for the KX_DYN_SET_MASS operation.
:type: float

View File

@@ -1,10 +0,0 @@
KX_SCA_EndObjectActuator(SCA_IActuator)
=======================================
base class --- :class:`SCA_IActuator`
.. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
Edit Object Actuator (in End Object mode)
This actuator has no python methods.

View File

@@ -1,86 +0,0 @@
KX_SCA_ReplaceMeshActuator(SCA_IActuator)
=========================================
base class --- :class:`SCA_IActuator`
.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator)
Edit Object actuator, in Replace Mesh mode.
.. warning::
Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist.
This will generate a warning in the console
.. code-block:: none
Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object
.. code-block:: python
# Level-of-detail
# Switch a game object's mesh based on its depth in the camera view.
# +----------+ +-----------+ +-------------------------------------+
# | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh |
# +----------+ +-----------+ +-------------------------------------+
from bge import logic
# List detail meshes here
# Mesh (name, near, far)
# Meshes overlap so that they don't 'pop' when on the edge of the distance.
meshes = ((".Hi", 0.0, -20.0),
(".Med", -15.0, -50.0),
(".Lo", -40.0, -100.0)
)
cont = logic.getCurrentController()
object = cont.owner
actuator = cont.actuators["LOD." + obj.name]
camera = logic.getCurrentScene().active_camera
def Depth(pos, plane):
return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3]
# Depth is negative and decreasing further from the camera
depth = Depth(object.position, camera.world_to_camera[2])
newmesh = None
curmesh = None
# Find the lowest detail mesh for depth
for mesh in meshes:
if depth < mesh[1] and depth > mesh[2]:
newmesh = mesh
if "ME" + object.name + mesh[0] == actuator.getMesh():
curmesh = mesh
if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh:
# The mesh is a different mesh - switch it.
# Check the current mesh is not a better fit.
if curmesh == None or curmesh[1] < depth or curmesh[2] > depth:
actuator.mesh = object.name + newmesh[0]
cont.activate(actuator)
.. attribute:: mesh
:class:`MeshProxy` or the name of the mesh that will replace the current one.
Set to None to disable actuator.
:type: :class:`MeshProxy` or None if no mesh is set
.. attribute:: useDisplayMesh
when true the displayed mesh is replaced.
:type: boolean
.. attribute:: usePhysicsMesh
when true the physics mesh is replaced.
:type: boolean
.. method:: instantReplaceMesh()
Immediately replace mesh without delay.

Some files were not shown because too many files have changed in this diff Show More