1
1

Compare commits

...

3272 Commits

Author SHA1 Message Date
Dalai Felinto
fbaf6e6fb3 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-06-26 16:07:39 +02:00
Dalai Felinto
c07f2bc891 Fix T55628: Crash when creating new material slots
We need to update the geometry when resizing the object material slots.
2018-06-26 16:00:04 +02:00
Vuk Gardašević
43d27095a3 UI: Make Mesh shading menu consistent with the other menus 2018-06-26 14:29:21 +02:00
William Reynish
25caedc4ba UI: Tweaks to Cycles Bake panel
-Correctly aligns bake options in the column
-Updated Metadata panel with right-aligned checkboxes for consistency
2018-06-26 14:17:02 +02:00
c1459a1e7f Fix T55630: update issue between Object and TexPaint modes.
Need to flush mesh DEG COW here, for some reason...
2018-06-26 12:36:38 +02:00
cdd915e9e9 UI: status bar cursor keymap display
Show mouse button actions in status bar, based on context,
modifiers and active tool.

See: T54861
2018-06-26 12:18:54 +02:00
4adf19e80b Icons: mouse buttons & drag
Monochrome icons from jendryzch
2018-06-26 12:15:39 +02:00
e17285a381 Tweak: Try to make the purpose of the collection/search fields clearer
Note: The labels in this panel are still WIP. There are probably clearer
names for some of these, including maybe even omitting some.
2018-06-26 21:44:14 +12:00
c0a8a29ae6 AnimEditors: Remove the toggles to enable name/collection-based filtering
Now the name/collection filters run when there's some text,
and don't run when the box is empty, thus reducing an extra
step that was needed before these options could be used.
2018-06-26 21:44:14 +12:00
5f545dbde8 AnimEditors UI: Move less frequently used filtering options to a "Filters" popovers
This commit is an experiment in using popovers as a place to house some
of the filtering options for animation editors, in line with what's taking
place in the Outliner with the filtering popover there too.

Right now, the most frequently used/changed options are still available
on the headers (i.e. the "Only Selected"/"Hidden"/search fields), while
everything else (i.e. the per-datablock filters, which were already hidden
behind a collapsed-toggle button before) now live in the popover.
2018-06-26 21:44:14 +12:00
c795505a2c Cleanup: dyntopo sculpt draw update: use same BM_face_as_array_vert_tri for indexbuf generation.
It's cleaner, and actually assert that BMFace is a triangle. Same code
as when generating vertexbuf for flat shading!
2018-06-26 11:43:17 +02:00
dad4703ec5 Fix T55320: Sculpt Mode with dyntopo and smooth shading drawing bug.
We have to discard the batch in smooth case, because we are modifying
the index buffer (flat shading don't need it, only changes vertex buffer
on redraw, which is safe).

Many thanks to @fclem for his help on debuging/understanding what was
wrong here!
2018-06-26 11:43:17 +02:00
42fde5d32b Fix memory leak when duplicating particles 2018-06-26 11:31:28 +02:00
a9ab0c1a7c Depsgraph: Tag relations for update when particle dupli-collection changes 2018-06-26 11:27:41 +02:00
Dalai Felinto
d6ac293bd4 Cleanup: comment 2018-06-26 11:07:29 +02:00
cfb50463be Free crash when freeing object caches from duplicator 2018-06-26 10:53:05 +02:00
ea339dc62c Merge branch 'master' into blender2.8 2018-06-26 09:34:13 +02:00
df237b964b PyAPI: add ImBuf.copy
DD348 by @kilon w/ edits.
2018-06-26 09:31:57 +02:00
a69f985f40 PyAPI: move deep-copy args check to py_capi_utils 2018-06-26 09:31:57 +02:00
e6825946d0 Cleanup: style, pep8 2018-06-26 08:45:13 +02:00
29182dd570 Cleanup: style 2018-06-26 08:35:35 +02:00
87f598fd3f Cycles: Fix wrong row count for World MIS CDF calculation 2018-06-26 05:35:30 +02:00
Stefan Werner
d53093953f Turned off clang warnings in third party includes.
The latest clang compiler (at least the one in Xcode 9.4.1) warns about the register keyword and macro expansions using defined().
Since these warnings come from third party code, we can't address them directly in Blender. Silencing them via #pramgas will
at least keep the warnings during a build down to the ones that are relevant to Blender code.
2018-06-25 23:02:01 +02:00
4aee554345 Fix crash with files saved with missing render slots. 2018-06-25 20:29:51 +02:00
9e88892f8f UI: Use background color for reports
At the moment it's using a hardcoded gray color that conflicts with
themes using gray for the header text. Instead use a slightly brighter
background color to make it stand, yet still use a theme setting.
2018-06-25 18:57:51 +02:00
25a223c3bd Draw: Use more proper particles index lookup 2018-06-25 18:22:27 +02:00
540b99bd28 Cycles: Free evaluated meshed when we are done with object 2018-06-25 17:28:46 +02:00
7cd86cd1fe Cycles: Fix memory leak with session
We didn't check for sync object being already allocated.
In fact, we simply need to use proper function to free
session.
2018-06-25 17:28:46 +02:00
c2110213ca Physics: update softbody and dynamic paint to get colliders from depsgraph.
Because looping over the scene is unsafe and slow.
2018-06-25 17:15:07 +02:00
2c9b32949b Cleanup: refactor depsgraph physics API functions. 2018-06-25 17:15:07 +02:00
William Reynish
26251282e0 UI: Single-column layout for Force Fields and Particles
Force Fields and Falloff are now simpler and more compact
by removing unnecesary labels (there was a text label just for one option)

Particle Force Fields Falloff is now a sub-panel of each effector type,
rather than just as a section with label.
2018-06-25 17:04:40 +02:00
William Reynish
51e077c5c0 UI: Single-column layout for View Layer, passes and World 2018-06-25 17:02:50 +02:00
William Reynish
153195da22 UI: Single-column layout for Texture Color 2018-06-25 17:01:54 +02:00
William Reynish
5ddba52029 UI: Single-column layout for Shape Keys and Geometry Data 2018-06-25 17:00:00 +02:00
eefe878660 Fix T55360: marker-based Camera switch focal length bug.
Scene was missing DEG tag update when its camera was changed based on
active 'camera marker'.
2018-06-25 16:21:24 +02:00
476b4c415c Fix T55493: Sculpting on smooth shaded bug.
Undo was not tagging PBVH to update normals too...
2018-06-25 14:15:08 +02:00
38d6e82d1a Fix use of non-evaluated collision and effector objects.
Only enabled objects in the view layer should be used, while temporarily
hidden objects should still have an effect.
2018-06-25 14:11:55 +02:00
817bf582c2 Cleanup: rename object base flags to be more clear. 2018-06-25 14:09:17 +02:00
a99dcab148 Depsgraph: cache collision relations, for performance and stability.
Same reasoning as effector relations in earlier commit.
2018-06-25 13:35:41 +02:00
5b3ff9f7d8 Cleanup: Move colorband handling from DM to mesh_runtime universe. 2018-06-25 13:04:24 +02:00
e10eb5bcb8 UI: In user preferences group Developers Extra and Python Tooltips
Move Navigation Manipulator toggle next to Mini Axis as they are related
(and in the future merged into one pulldown) and rename Manipulator
to "Transform Manipulator" to make it clear they're different kinds
of manipulators. Also move to the first column next to other viewport settings.
2018-06-25 12:58:28 +02:00
e97237892c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_image.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/space_view3d/view3d_view.c
	source/blender/gpu/GPU_draw.h
	source/blender/gpu/GPU_material.h
	source/blender/gpu/intern/gpu_draw.c
	source/blender/gpu/intern/gpu_material.c
	source/blender/makesrna/intern/rna_userdef.c
	source/blender/windowmanager/intern/wm_files_link.c
	source/blender/windowmanager/intern/wm_init_exit.c
	source/creator/creator_args.c
	source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
	source/gameengine/Ketsji/KX_PythonInit.cpp
	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
2018-06-25 12:50:32 +02:00
cdee53edfc Cycles: Cleanup, indentation 2018-06-25 12:39:44 +02:00
8a7f317666 Cleanup: Nuke most of G.main from GPU code. 2018-06-25 12:32:48 +02:00
Dalai Felinto
0145daa09b Outliner: Make search always work
This was a flag in early 2.8 to allow users to hide the entire search prop.
Now since we want it fully expanded at all times, it makes no more sense.
2018-06-25 12:15:12 +02:00
861b0ec417 UI: Right align check-box for extra text space
See: T54951
2018-06-25 12:06:51 +02:00
29c1069244 Cleanup: code style 2018-06-25 12:06:51 +02:00
f33cb522dd Cleanup: Few more validation of G_MAIN usages... 2018-06-25 12:02:20 +02:00
7a4d5b78ea Depsgraph: Add missing nodes and relations for speaker 2018-06-25 11:54:12 +02:00
c448c0a67f RigidBody: Replaced 'if' with 'switch' 2018-06-25 11:24:55 +02:00
eb56ca3119 Rigid body: compute looptris on original mesh instead of CoW copy 2018-06-25 11:20:06 +02:00
Dalai Felinto
1099ac1ed9 Silence warning for release builds 2018-06-25 11:02:19 +02:00
d864332085 Merge branch 'master' into blender2.8 2018-06-25 09:48:10 +02:00
b09387c388 Add back header needed win32 2018-06-25 09:46:03 +02:00
d32e4ca701 Merge branch 'master' into blender2.8 2018-06-25 07:43:51 +02:00
f3b9fa5393 CMake: correct remove_strict_cxx_flags_file
Was still using C-flags.
2018-06-25 07:30:00 +02:00
a5b7f1ef53 UI: internal changes to user-menu storage
- Use per context menu lists to support menu editing.
- Support for different kinds of menu items since this may be needed
  in the future. Only use operator types for now.
2018-06-24 20:06:30 +02:00
a59d7374ea Nuke DM out of collada code.
Also, now use out-of-main temp copy of mesh for export, and fixed a
potential memleak (return without freeing temp copy of mesh, tsst).
2018-06-24 18:40:52 +02:00
d0856d1d54 Fix most of 'disappearing' first letter in right-aligned labels.
BLF' blf_font_width_to_strlen() could easily generate strings with up to
nearly two pixels length over requested limit!

Note that the fiddling between floats and ints values make things really
confusing here... :/

There is still a few limit cases where, even though computed str length
is now always below reauested limit, we still get first letter
disappearing, no idea why currently.
2018-06-24 17:51:13 +02:00
6454319033 Lamps: Make default size more usable
This way the area light shapes are more visible (and usable) by default.

Changes were discussed with @venomgfx
2018-06-24 15:03:10 +02:00
a9bc880cf8 Object Mode: Add Shape visual for spot and point lamps
Since Eevee and Cycles both use lamp size for point lamps, displaying
the shape is now more relevant than before.
2018-06-24 15:03:10 +02:00
574c716f2d Cycles: change AO node color default to 1.0. 2018-06-24 12:24:30 +02:00
8f85cf033c Merge branch 'master' into blender2.8 2018-06-24 11:08:14 +02:00
e61bbc00b7 Cleanup: move UI context menus into own file 2018-06-24 10:43:09 +02:00
a3cb9c8238 Wireframe Overlay: Add back the per edge hiding
This method is a bit more optimized than the very first one
because it does not rely on the adjacent faces properties.

That said it's still a bit slower than the per vertex method.
2018-06-24 00:01:02 +02:00
12bd80fefd Eevee: Fix wrong depth test in main shading pass. 2018-06-23 21:26:21 +02:00
acb94b6c78 Typo in last commit 2018-06-23 20:57:09 +02:00
85c1e61375 UI: Add user defined context menu
- Add/Remove from RMB context menu.
- Stored in user preferences.
- Access from Q key.

See T55027.
2018-06-23 20:52:47 +02:00
2fa231a86b Ghost: Fix F12 render on windows.
createOffscreenContext left the new context bound to the calling thread
causing a race condition with the background thread doing the actual
rendering. see T55555 for a more detailed description of the problem.

this patch changes the behavior of createOffscreenContext to restore the
context to the calling context.

Reviewers: fclem

Differential Revision: https://developer.blender.org/D3499
2018-06-23 11:37:35 -06:00
4ddb03ba79 Keymap: Add F3 key back for search
Keeping tilder, adding back F3 since some platforms
still don't have hardware scan-codes for tilder key on non-US keyboards.
2018-06-23 16:25:29 +02:00
6328214ec8 Manipulator: fix issue refreshing transform tool
Changing manipulator types failed.
2018-06-23 15:02:27 +02:00
43872124f7 Merge branch 'master' into blender2.8 2018-06-23 10:46:09 +02:00
f8a3636374 UI: alternate fix for empty context menu
block and layout could be NULL and checking this everywhere
wasn't practical.

Instead of lazy initializing, add UI_popup_menu_end_or_cancel
which cancels empty popup menus.
2018-06-23 10:31:10 +02:00
0511cded25 UI: naming of cursor options 2018-06-23 09:46:18 +02:00
575c71b670 Blenfont: Fix texture not being initialized in recent refactor.
Caused some gpus to have issues with the font shadows.

thanks @fclem for helping tracking this one down.
2018-06-22 14:35:32 -06:00
2d7606daa5 Missed last commit 2018-06-22 19:25:38 +02:00
a997b5d17b Tool System: transform can now toggle loc/rot/scale 2018-06-22 19:23:27 +02:00
cc4dc2dce2 Depsgraph: cache effector relations, for performance and stability.
To find all effectors in the scene, we need to loop over all objects.
Doing this during depsgraph evaluation caused crashes because not all
objects are guaranteed to be evaluated yet.

To fix this, we now cache the relations as part of the dependency graph
build. As a bonus this also makes evaluation faster for big scenes,
since looping over all objects for each particle system is slow.

Fixes T55156.
2018-06-22 17:57:22 +02:00
79615c5adb Cleanup: nuke (nearly) all remaining usages of DM from RNA.
Only case remaining is a nasty ccgdm/opensubdiv update case, TBD once
subsurf case is addressed.
2018-06-22 17:55:48 +02:00
122e0105e2 Port DM_debug stuf to BKE_mesh_runtime. 2018-06-22 17:55:48 +02:00
8286cc8cd4 Fix crash reading toolsettings 2018-06-22 17:22:06 +02:00
bf0dc7ee19 Cleanup: use standard BKE_object_free_derived_caches in BKE_mesh_to_curve.
...Instead of doing own dirty/risky version of the same thing!
2018-06-22 16:59:38 +02:00
b1e86ff385 Cleanup: misc DrivedMesh stuff. 2018-06-22 16:59:38 +02:00
befd87ac62 StudioLights: API
- get spherical harmonics coefficients
2018-06-22 16:23:30 +02:00
6bfc961424 Cleanup: Moar DM busting from editor code area. 2018-06-22 16:10:29 +02:00
ccbe3bdd08 Cleanup: nuke another DM usage in paint code. 2018-06-22 16:03:16 +02:00
f51661fb66 Cleanup: useless BKE_cdderivedmesh includes... 2018-06-22 15:52:14 +02:00
c850fcc2c0 Modifiers: port shapekey modifier, some cleanup. 2018-06-22 15:45:46 +02:00
97c99fb034 Modifiers: port UV_unwarp from DM to Mesh.
Pretty trivial...
2018-06-22 15:32:41 +02:00
48e70ab848 Add depth and orientation options to 3D cursor tool 2018-06-22 15:23:56 +02:00
3c828c29b3 Cleanup: unused value 2018-06-22 15:23:56 +02:00
888fb065a4 Modifiers: Remove remaining parts of md->scene 2018-06-22 15:12:03 +02:00
a7ca8fe1dd Modifiers: Remove lots of usages of md->scene 2018-06-22 15:12:03 +02:00
7a4b784909 Subsurf: Move away from using scene from modifier data 2018-06-22 15:12:03 +02:00
fffe34531d Cloth: Move away from scene stored in cloth modifier data 2018-06-22 15:12:03 +02:00
c2fa82e7a4 Multires: Move away from using scene from modifier data 2018-06-22 15:12:03 +02:00
dfca352294 StudioLight: Better API
In stead of a single refresh function that re-init the whole system. The
API now supports adding and removing. Which will be much faster and less
flickering of missing icons when adding/removing lights
2018-06-22 14:49:49 +02:00
f4d6e66b25 Merge branch 'master' into blender2.8 2018-06-22 14:42:25 +02:00
6cd0484de8 CMake: Make language explicit for per-file strict flags removal 2018-06-22 14:40:00 +02:00
ec27776d8e CMake: Cleanup, add_cc_flag -> add_c_flag 2018-06-22 14:29:13 +02:00
38247fc80b CMake: Cleanup, rename CC_REMOVE_STRICT_FLAGS to C_REMOVE_STRICT_FLAGS 2018-06-22 14:25:42 +02:00
0d7e758c91 CMake: Tweaks to removal of strict flags
Silences the following strict flags from external libraries:

- -Wclass-memaccess
- -Wswitch
- -Wtype-limits
- -Wint-in-bool-context

Needed to tweak macro a bit, since the old logic was wrong:
we can not use CXX flags for C compiler, need way more strict
separation between what goes where.
2018-06-22 14:25:42 +02:00
6528310543 Cleanup: move cursor rotation into own function 2018-06-22 13:59:56 +02:00
Dalai Felinto
f4f6e5b665 Outliner: Aggregate ID types and object types together with numbers
We draw small numbers over the icon of multiple objects of the same type.
Also, we make all inlined elements to be non-clickabled.

For modifiers we still do it the old way. In this case it is more important
to see the order then the ammount.

Reviewers: brecht, campbellbarton
Subscribers: billreynish, venomgfx

Design task and mockup: T54707
Differential Revision: https://developer.blender.org/D3497
2018-06-22 13:57:04 +02:00
42344adcd4 Update theme Flatty Dark Blueberry 2018-06-22 13:45:36 +02:00
0b9cd0c88d Merge branch 'master' into blender2.8 2018-06-22 12:58:29 +02:00
a5f046f449 Cleanup: rename 3D cursor calculation vars 2018-06-22 12:55:15 +02:00
88158e4116 Cleanup: 2.8-new G.main in RNA code.
Again, essentially validating them, and adding assert check if needed.
2018-06-22 12:50:26 +02:00
646412004b Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesrna/intern/rna_image.c
	source/blender/makesrna/intern/rna_object.c
	source/blender/makesrna/intern/rna_object_force.c
	source/blender/makesrna/intern/rna_screen.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blender/makesrna/intern/rna_space.c
	source/blender/python/bmesh/bmesh_py_types.c
	source/blender/python/generic/bpy_internal_import.h
	source/blender/python/intern/bpy_rna_anim.c
	source/blender/python/intern/gpu_offscreen.c
2018-06-22 12:46:16 +02:00
b6b7c83dd8 StudioLight: Only apply windowing when SH level is 2
It does not make much sense for the other levels
2018-06-22 12:37:03 +02:00
2fe528424d Cleanup: remove last G.main from RNA.
Again, we cannot actually get rid of G_MAIN global access here, so in
most case just 'marked' them as valid, and added assert checks to ensure
we do only work with IDs in G_MAIN in those cases.
2018-06-22 12:35:41 +02:00
0427eca2a6 StudioLight: remove caches when removing studiolight
Cache files were not deleted and when uploading a new file with the same
name resulted in using the old cache file.
2018-06-22 12:31:20 +02:00
e402c36388 Studiolight: Spherical Harmonics Windowing
Apply Windowing on the Spherical Harmonics result. This would lead to
better results.
2018-06-22 12:31:19 +02:00
101fd7ec06 Tweak new BKE_id_is_in_global_main to accept NULL pointer (and consider them as valid). 2018-06-22 12:26:45 +02:00
bcdec63570 Fix harmless use of unintialized memory
Still nbice to avoid such access to keep valgrind output more sane.
2018-06-22 12:08:18 +02:00
e6e2e9c246 Cleanup, spelling 2018-06-22 12:08:18 +02:00
9921e10583 Math: Set matrix to zero when inversion fails
Avoids usage of uninitialized memory when inversion fails.

That uninitialized memory can cause object to become visible when
it is supposed not to or other artifacts like that.

Longer term solution would be to check every instance of invert_m#
function and to explicit fallback when needed (possibly, using
extra utility functions).
2018-06-22 12:08:18 +02:00
cbf5c738d6 Cleanup: get rid of last G.main's in bpy area.
Essentially 'validating' them as G_MAIN, and adding some asserts in
dubious places, that handled IDs are actually in G_MAIN.
2018-06-22 11:37:47 +02:00
1870a1adc7 BKE_library: Add func to check an ID is actually in G_MAIN database. 2018-06-22 11:37:08 +02:00
f3501a00e2 PaintMode: Full Shading Boolean => Slider
There was a Full Shading bool that was shared across the WP, VP and TP
modes. This commit makes some changes:

- Replace the bool with a factor. This gives the user more control on
the visibility.
- Also draw it on top of the Material and Rendered mode so the user can
control what he needs. In certain cases you don't want to see the final
rendered material, but the actual texture.
- Removed the skipping of objects when in paint modes. As now the paint
modes are blended.
2018-06-22 10:43:03 +02:00
c517778a8b Cleanup: style 2018-06-22 08:18:02 +02:00
61bed8768d Cleanup: suppress assert in recent GPU refactor 2018-06-22 08:11:17 +02:00
2e80279a75 Fix T55547: "Fit camera to selected" fails 2018-06-22 07:55:49 +02:00
84ae0fe3a5 GLRefactor: Refactor bf_blenfont to use GPUTexture instead of raw GL calls and types.
In an effort to centralize all opengl calls in the codebase, this patch replaces
the raw opengl calls in bf_blenfont with GPUTexture so it's no longer depended
on opengl headers.

reviewer: Brecht

Differential Revision: https://developer.blender.org/D3483
2018-06-21 18:36:05 -06:00
a0dce6810d Edit Mode: Bevel Op: Offset Soft Max to 100
This is consistent with the modifier
2018-06-21 13:46:11 -04:00
4f83fd4cf8 Merge branch 'master' into blender2.8 2018-06-21 19:29:22 +02:00
68f4a4641e Fix T55568: second click event ignored 2018-06-21 19:26:21 +02:00
51f6b25afd Revert "Fix T55568: second click event ignored"
This reverts commit 52aa963f0e.

Fixed for keyboards, broke mouse buttons.
2018-06-21 19:24:53 +02:00
c111eb0e99 Cleanup: get rid of dual DM/Mesh versions of mirror topology code.
Easy to switch to only use (evaluated) mesh instead!
2018-06-21 19:05:10 +02:00
d6eac9d787 Cleanup: ED_mesh_pick_vert: DM -> me_eval. 2018-06-21 18:38:37 +02:00
31d916210c Cleanup: remove DM from 'join as shape' operator.
Also deduplicated the 'mesh as shapekey' code, we had kind of two funcs
doing the same thing here...
2018-06-21 18:26:12 +02:00
6046d9f715 Fix own error making outliner rename not emboss 2018-06-21 18:15:17 +02:00
6427141f7b Modifiers: Stop using md->scene in isDisabled() callback
This is first commit in series of changes to get rid of md->scene.
2018-06-21 18:04:05 +02:00
991d4f1c6b Fix incorrect use of G.is_rendering for particles in some places. 2018-06-21 17:08:42 +02:00
318ad705ad Cleanup: nuke useless BKE_DerivedMesh.h includes. 2018-06-21 16:45:54 +02:00
78653cfb8c Merge branch 'master' into blender2.8 2018-06-21 16:43:39 +02:00
84dbf949d7 UI: don't show empty button context menu 2018-06-21 16:37:19 +02:00
c45a3b80e2 Fix T55555: Crash when select material properties
This error is only in Windows and Mac when select in properties the material tab.

This commit revert dc856be839 Preview: Add own opengl context to render preview images.
2018-06-21 16:11:29 +02:00
b350edc207 Depsgraph: Add missing relation from proxy group
Transform evaluation does depend on that matrix, but relation was never
in dependency graph. It was not even in the old dependency graph, which
makes me wonder how this thing worked reliably to begin with.

Should fix flickering issue in the render farm.
2018-06-21 15:57:24 +02:00
a0f1bd8ed1 Depsgraph: Re-hook duplicgroup relation to final transform operation
Transform evaluation doesn't not depend on objects which are being duplicated,
so should not be any regressions here.

The whole relation should probably be gone as it's kind of rooting back to
legacy times, but that would need more clear research and investigation and
regression testing.
2018-06-21 15:57:24 +02:00
ad42c358f8 Depsgraph: Walk into dupli_group object
That will help with cases when dupli_group object is not linked
directly to the scene.
2018-06-21 15:57:24 +02:00
b80cce2053 Cleanup: names: data transfer/mesh remap: dm -> me/mesh.
That area is now officially purged from the Devil.. errr... DerivedMesh!
2018-06-21 15:33:10 +02:00
ef90a8e12c Cleanup: data transfer: get rid of dual destination mesh.
Not needed anymore, we only actually need to know wether it's orig mesh
or eval one in a few places...
2018-06-21 15:33:10 +02:00
1859215576 Cleanup: some potentially critical changes in data transfer.
Removing that stuff should be valid with new depsgraph/modifiers stack
evaluation system... BUT it might not be, so rather have those in
separate own well-isolated commit.
2018-06-21 15:33:10 +02:00
fffff5a993 Cleanup: nuke DM out of data transfer code.
This was actually rather hairy, this code is huge and complicated, easy
to make mistakes...

Good thing is, it will allow for significant simplification and more
(name) cleanup in following commits ;)
2018-06-21 15:33:10 +02:00
cd6cb55ff3 Fix Cycles incorrect versioning for automatic sample world resolution. 2018-06-21 15:28:59 +02:00
4904eadc0f Fix T55525: "Only Keyframes from Selected Channels" option in Timeline was being ignored
I was originally going to just expose the filtering options fo the timeline
too (via popover), to provide full access to the filtering options here too.
However, investigating further, that would've caused problems when trying to
use the Next/Prev Keyframe operators in other editors (see comment in code).
For now, the simpler solution is to just sync the scene-level flag (used for
this option) back to the dopesheet settings (used for generating the summary
channel used for displaying keyframes), to buy some time to investigate more
carefully.
2018-06-22 01:26:06 +12:00
526392ab16 Workbench: Remove warning
When in forward rendering and Object outline was disabled every render
call created one console warning (uniform objectId not found)

this commit removes this warning
2018-06-21 15:17:05 +02:00
8534ce9384 Revert "Objects: when active object gets hidden, make it inactive."
This reverts commit fec97ec949, it's useful to be able to edit object
properties for hidden objects. The issue with mode locking that this
was meant to solve will be handled in another way.
2018-06-21 15:04:33 +02:00
c054a1a848 Merge branch 'master' into blender2.8 2018-06-21 15:02:38 +02:00
d5552a6d4b T55570: Moved Texture drawtype as to shading popover
the use of the texture drawtype is limited. so who should we have it
this prominent on the screen. By adding it as a shading.color_type
option we should save some screenspace.
2018-06-21 14:58:00 +02:00
a4f08297ed UI: preference for developer extras
Currently only used for "Edit Source" feature.
2018-06-21 14:54:21 +02:00
52aa963f0e Fix T55568: second click event ignored
Double-click handling caused the second click to be ignored
for keymaps that only handle click.
2018-06-21 14:04:43 +02:00
3584810fdd Python/BLF: add blf.color(r, g, b, a) method.
This is needed now that glColor() no longer works.
2018-06-21 13:37:02 +02:00
8d1ea6a767 Fix T55573: Mode rotate on local axis crashes 2018-06-21 12:53:58 +02:00
William Reynish
244cb8410e UI: Single column for Rigid Body World 2018-06-21 12:41:01 +02:00
a283333cd8 Fix Cycles CUDA render errors with CUDA 9.2.
Work around what might be a compiler bug.
2018-06-21 12:32:32 +02:00
d6313f47af Fix T55564: Cycles OpenCL build error on some scenes. 2018-06-21 11:46:52 +02:00
9b91e727be Merge branch 'master' into blender2.8 2018-06-21 11:10:37 +02:00
b681461c84 Fix T55568: second click event ignored
Double-click handling caused the second click to be ignored
for keymaps that only handle click.
2018-06-21 11:07:52 +02:00
66263905ae Merge branch 'master' into blender2.8 2018-06-21 10:32:16 +02:00
f1bc9331b1 Fix T55491: Double click fail in menu popups 2018-06-21 10:07:18 +02:00
3995b33a42 WM: don't make LMB a special case for double click 2018-06-21 09:49:30 +02:00
00d52376f7 CodeStyle: Comments 2018-06-21 09:22:34 +02:00
e60d4d6a0c Code cleanup: Added newline 2018-06-21 09:05:31 +02:00
54c4a107b1 Missed warning is previous commit 2018-06-21 09:04:03 +02:00
032c741214 Studiolight: Calculation of irradiance buffer
The calculation of the irradiance buffer was slow. Now it is only
calculated when it is being used (background_alpha > 0.0)
this solves the freeze when switching to LookDev mode.

Also changed the default calculation to use the Spherical Harmonics
calculation. This is able to generate the irradiance buffer fast, but is
less accurate. As the irradiance buffer is only used for visual
guidance speed is more important than accuracy.

Added compile directive to switch between the implementations.
(see STUDIOLIGHT_IRRADIANCE_METHOD)

Disabled caching the irradiance buffer when
STUDIOLIGHT_IRRADIANCE_METHOD_SPHERICAL_HARMONICS is used as it is not
needed.
2018-06-21 09:02:12 +02:00
636a690eb1 Fix: Ensure that summary channel is enabled when creating timeline 2018-06-21 17:56:11 +12:00
b081436d1c Graph Editor: Changing the display mode to "Drivers" mode now runs the Drivers-Editor UI setup code
This is a step towards being able to just choose the "Drivers Editor"
from the editor selector, and have everything displayed, ready to use.

Currently there are a few problems to resolve still:
1) This update callback doesn't run when changing the mode via the
   editors selector in the UI. (Note: This problem also affects the
   Timeline vs Dopesheet, causing a lot of initialisation work to be
   skipped)

2) There's some missing redraw/refresh here to cause the properties
   region to actually show. You need to resize the window for that to
   happen now.
2018-06-21 17:15:45 +12:00
876c73c9af Cleanup: Move logic for initialising a new Drivers editor into its own function
This shouldn't really be part of the windowmanager code. Pulling it out
now, so that we can reuse in RNA when switching display modes,
(and perhaps other places later)
2018-06-21 16:58:14 +12:00
3777918e5c Remove debug prints 2018-06-21 16:08:52 +12:00
417856dae5 Fix: Incorrect submodes being set in Dopesheet/Action Editor when changing modes
This commit fixes a number of problematic corner cases when switching between
editors after 2b5050a4cd

The root cause of these issues was that mode_prev was not being set in
many cases, resulting in mode changes to the Timeline and back (via other
editors) causing Dopesheet Editors to reset back to "Action Editor" mode.

1) Creating new Dopesheet Editors (e.g. change the default 3D view to
   a Dopesheet editor) would default to displaying the "Action Editor",
   since mode/mode_prev == 0 represents the "Action Editor" (for backwards
   compatability reasons), while mode == 3 is for the "Dopesheet"

2) If you set the Dopesheet Editor to another mode (e.g. "Grease Pencil" mode),
   change to another editor (e.g. Shaders), then come back, the mode would
   get reset to "Action Editor".
2018-06-21 16:07:47 +12:00
ed428b2c04 UI: Use Collection icon for New Collection in Outliner
Also temporarily bring back the toggle to search, since it's off by default.
2018-06-21 01:01:02 +02:00
f3bd5da7fc UI: button to create new collection in the Outliner
Expose search like in 2.7, we could make it pop on Ctrl+F to save space if needed.
Align Filter and the less used View menu to the right.

Based on mockups and feedback session with William
2018-06-21 00:37:57 +02:00
0b7edf105d UI: Icons for Outliner display modes
We need a better icon for Orphan Data
2018-06-21 00:32:56 +02:00
4cfc54a5cb UI: adjust menu triangle
Was not centered for single icon buttons.
2018-06-20 21:34:27 +02:00
8d00d6d0bf UI: rename "NLA Editor" -> "Nonlinear Animation"
See: T54744
2018-06-20 20:16:47 +02:00
2b5050a4cd UI: expose Timeline as a space type
See: T54744
2018-06-20 20:11:41 +02:00
6991b477d7 UI: expose Driver as a space type
See: T54744
2018-06-20 18:46:48 +02:00
Dalai Felinto
2e66e5faca Silence warning in greasepencil-object branch
We don't have warnings in 2.8 because of include order.
But headers shouldn't depend on that for warnings, really.
2018-06-20 18:44:17 +02:00
7d3589e660 Cleanup: pep8, single quotes for enums 2018-06-20 18:22:52 +02:00
40e1e8ebed Despgraph: don't tag for transform/geometry update on relations rebuild.
This should already be happening elsewhere and was causing depsgraph
rebuild to be slower than it should.
2018-06-20 18:12:48 +02:00
e1dff01e29 Depsgraph: add some missing depsgraph tags when relations change. 2018-06-20 18:12:48 +02:00
0d0d8935a5 Fix outliner mixed collection/object visibility drag toggle not working. 2018-06-20 18:12:48 +02:00
73d0a3f142 Fix hide object operator to do nothing if no object is selected. 2018-06-20 18:12:48 +02:00
82dc5f91e8 UI: Style locks in Object Transform panel 2018-06-20 17:01:40 +02:00
54a0247f59 Cleanup: whitespace 2018-06-20 16:42:19 +02:00
William Reynish
b998ccefee UI: Single column, flow and sub-panel for collision physics 2018-06-20 16:34:27 +02:00
ab9e2dccd3 Cleanup: follow naming conventions
Using panels for presets printed warnings for classes named as menus.
2018-06-20 16:32:31 +02:00
1ccd70b7c1 Icons: update generation script 2018-06-20 16:15:58 +02:00
William Reynish
00fd2b57d1 UI: Single column layout for Force Fields 2018-06-20 16:11:18 +02:00
William Reynish
a8e132768a UI: Dynamic Paint panels into sub-panels 2018-06-20 16:11:18 +02:00
a3428131b6 Studiolight: Spherical harmonics
Compile time option to reduce the level of the SH
2018-06-20 16:08:11 +02:00
3414a16705 Merge branch 'master' into blender2.8 2018-06-20 16:01:30 +02:00
d312dbea2d Cleanup: naming (make it clear vars are squared) 2018-06-20 15:58:46 +02:00
e6609deba2 Merge branch 'master' into blender2.8 2018-06-20 15:50:54 +02:00
12e926781a Merge branch 'master' into blender2.8 2018-06-20 15:40:14 +02:00
372754c164 Screen: split ED_area_actionzone_find_xy
Add ED_area_actionzone_refresh_xy which can tag redraw
find no longer changes changes to the action zone.
2018-06-20 15:34:20 +02:00
5cad6afac6 Cleanup: rename is_in_area_actionzone 2018-06-20 15:34:20 +02:00
daaf315bf2 Cleanup: quiet warning 2018-06-20 15:34:20 +02:00
3df5625ae7 Cleanup: remove some useless Derivedmesh struct declarations. 2018-06-20 15:17:35 +02:00
b13585e782 Cleanup: remove last DM usages from datatransfer code. 2018-06-20 15:17:35 +02:00
0fb1093b14 Studiolight: fixed diffuse lighting
- Orientation of the cubemap were not conform cycles and eevee
- one side of the cubemap was flipped, so one side was overlit and the
other side was to dark.
2018-06-20 15:00:23 +02:00
c6ab911744 Merge branch 'master' into blender2.8 2018-06-20 14:16:22 +02:00
984a78e763 Fix crash opening some files, after recent changes. 2018-06-20 13:42:23 +02:00
4234cddda9 Objects: support for hiding all objects in a collection.
In the outliner there are now icons for it, Ctrl+Click isolates a
single collections.

In the 3D view, Ctrl+H key opens a menu that is more or less the
equivalent of the old layer buttons in the header. Regular Click isolates
the collection, Shift+Click toggle the collection visibility. Pressing
number keys and letters works in this menu, which can help for quickly
selecting a specific collection.

Shortcuts for quick switching by just pressing 1/2/3/.. keys are available
again. The order can be confusing with nested collections, but that seems
unavoidable. The first numbers control the top level collections, and then
sub collections if numbers are left.

Remaining design issues:

* The 3D view menu needs to be improved: support for sub collections,
  staying open on shift+click, access from the 3D view header somewhere,
  shortcut key display.
* Currently collection hiding just controls per-object hiding, we plan
  to separate this state still so alt+H doesn't affect collection hiding.
2018-06-20 13:04:51 +02:00
5e968a996a Objects: restore per object restrict view/render/select.
Note this is now separate from H key hiding, and meant for more persistent
ways to define which objects are relevant to the viewport or render.

This avoids some cases where you'd have to create collection specifically
to hide objects for viewport/render.
2018-06-20 12:35:25 +02:00
0619f960c2 Objects: restore H key per object hiding.
H hides selected objects, Shift+H hides unselected objects, and Alt+H
reveals hidden objects.

This hiding state is distinct from restrict viewport and render, and
meant for temporarily hiding objects without affecting more persistent
collection hiding.

Object hiding is per view-layer, same as selection. It affects the
viewport and any preview renders in there, but not final renders.

In the outliner, different icons are now used for temporary hiding, and
restrict viewport and render. Hidden objects are greyed out.

Remaining design issues:

* For lamps we probably still want to keep their effect on the scene,
  currently they are fully disabled by hiding. Arguably mesh lights or
  even objects being reflected or casting shadows are not that different
  but perhaps the special lamp exception from local view should remain.
* We need a feature still to disabled this hiding for specific viewports,
  for render or animation preview where you want to see the entire scene
  while working in another view.
* We need a new icon for restrict viewport, for now it uses a grid similar
  to the 2.4 icon.
* Hiding objects does not preserve selection state as it did in 2.7,
  it's probably convenient to support this again?
2018-06-20 12:35:25 +02:00
c17ba4a903 T55550: Workbench Shadows are incorrect in first draw cycle
Shadows uses the old location for light_direction. Maybe a merge
conflict.
2018-06-20 12:29:09 +02:00
fd48e685c3 Cleanup: remove some G.main from BKE's node.c
Validate some cases using G_MAIN instead (I don't think we want to work
on any other Main than G.main one when registering/unregistering nodes
etc.).

And when freeing, all ID not in Main shall now be tagged accordingly, so
we *should* not need to do that stupi search over all ntrees in G.main
to check wether we have to free it ourself or not!
2018-06-20 12:27:26 +02:00
84c2ef0eaf UI: Use chevrons for number sliders, pulldowns and popovers
In the future popovers/pulldowns should have different indicators

Patch by William Reynish and Clement Foucault
2018-06-20 12:24:24 +02:00
20788e1747 Cleanup: moar G.main removal.
Nice trick from blender2.8, we now can get active scene from active
window of windowmanager!
2018-06-20 11:53:30 +02:00
edb80a801d Fix crash activating the HUD w/o an active region 2018-06-20 11:43:10 +02:00
8b673fc75f Cleanup: get rid of last non-thread-safe BLI_frand random generator func. 2018-06-20 11:30:25 +02:00
d97ee0b06a Cleanup: get rid of last BLI_frand usage. 2018-06-20 11:30:25 +02:00
1b2a2e0862 Cleanup: use new BKE_mesh_iterator foreach_mapped helpers in WPaint gradient code. 2018-06-20 11:30:25 +02:00
f58fa57b83 UI: fix "Edit Source" operator 2018-06-20 11:13:07 +02:00
6d21450a61 Revert "UI: fix "Edit Source" operator"
This reverts commit 109dbab593.

Accidental changes applied
2018-06-20 11:12:18 +02:00
109dbab593 UI: fix "Edit Source" operator 2018-06-20 11:10:08 +02:00
b661a4d663 Merge branch 'master' into blender2.8 2018-06-20 11:09:07 +02:00
8763a8fd4b Particle edit: Fix missing hair in edit mode for new particle systems
Need to get away from thosae update flags in original datablocks.
2018-06-20 11:05:52 +02:00
bba0ad903c Cleanup: De-duplicate overrides properties apply loop 2018-06-20 10:50:18 +02:00
d4519f54b3 UI: only show "Edit Translations" when addon used 2018-06-20 10:45:03 +02:00
2acf4ace51 Cleanup: Create ID property only once
Avoids refining ID pointer for every property which is being applied.
2018-06-20 10:29:49 +02:00
570f3e6719 Object Mode: enable mode locking by default
This is meant to be default behavior for 2.8, see T55246
2018-06-20 10:18:53 +02:00
d8f5a68f63 Merge branch 'blender2.8' into temp-dynamic-overrides 2018-06-20 10:18:19 +02:00
df2d05b203 Outliner: add object mode switching to RMB menu 2018-06-20 10:14:04 +02:00
9f9756ec35 Cleanup: strip space 2018-06-20 10:14:04 +02:00
8b9712faeb Fix T55540 Add foreachMappedXXX equivalent API for evaluated meshes 2018-06-20 10:03:50 +02:00
e3052ecb0d Studiolight: removed raise condition
Happened when deleting many studiolights at the same time when the
previews were still beging calculated in the background.

Added a free function callback that is filled when the preview is being
generated. This free function will then kill the preview job

This patch also removes icons that are not valid anymore so the user
cannot accidentally render an icon where the studiolight is invalid.

In the end we should use a add/remove function in the studiolight as
currently icons are recalculated too much.
2018-06-20 09:29:40 +02:00
91c0f17a47 Missed last commit 2018-06-20 07:27:35 +02:00
dc13e0d7dc Cleanup: default emboss=off for outliner buttons
Also use use braces for code blocks and reduce right-shift.
2018-06-20 07:14:19 +02:00
d44c40d91c Cleanup: some more valid G.main usages moved to G_MAIN. 2018-06-19 19:30:47 +02:00
9c20de8998 Merge branch 'master' into blender2.8 2018-06-19 19:25:44 +02:00
0a8af46707 Final cleanup of G.mains in render area. 2018-06-19 19:25:06 +02:00
29d7358ff6 UI: fix ctrl wheel while over the opposite side 2018-06-19 19:22:23 +02:00
63f31e466a Cleanup: names of WPaint gradient data structs.
Those actually never had anything to do with DM... Just used WP prefix
instead!
2018-06-19 19:15:11 +02:00
cc3c91c27f Cleanup: remove DerivedMesh from WPaint Gradient tool code.
Name cleanup to follow.
2018-06-19 19:15:11 +02:00
db0563e995 Fix re-entrant calls in some cases of mesh_evaluated generation.
`mesh_get_eval_final` and friends could call `mesh_build_data`, which in
paint/sculpt mode would call `BKE_sculpt_update_mesh_elements` which
would call `mesh_get_eval_final`... ugly!
2018-06-19 19:15:11 +02:00
85f717fcda UI: tweak sequencer color space position, it's not related to display device. 2018-06-19 19:14:42 +02:00
44611ab860 UI: fix Ctrl-Wheel to change button values 2018-06-19 18:36:30 +02:00
1292aae5c0 Correction to previous commit.
There is no guarantee that given ob pointer is not also an evaluated one
here...
2018-06-19 18:29:40 +02:00
5372da0121 ModStack: Fix broken object_get_datamask helper.
Would compare evaluated ob pointer to original one...

Found while investigating some errors in incomming cleanup, but this was
probably generating lost of other issues in some cases...
2018-06-19 18:25:30 +02:00
5b227c420b Fix animation player drawing wrong size 2018-06-19 18:03:08 +02:00
61af6b83e6 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_image_proj.c
2018-06-19 16:49:54 +02:00
750a78be9c 3D View: improve selection locking
Locked selection would still occlude with objects which could not be
selected.
2018-06-19 16:43:01 +02:00
0116c95d4c Studiolight: Temp Mutex issue
This is a temp fix for a better system.
Currently the studiolights can be referenced by a WM_job and being freed
via the API. This can happen when removing a studiolight via the
interface.

As the studiolight has no relation with the job, it is hard to detect if
it is still being used. I tried with a Mutex and a Thread Queue but they
were failing.

So the current temp fix is to keep the studiolights in memory until you
close blender. This Must be fixed ASAP! I added this fix so normal cases
can workish.
2018-06-19 16:37:23 +02:00
Stefan Werner
9ff135d85d Cycles: Fixed crash when the camera was inside 16 volumes or more. It still won't render those volumes correctly, but at least the crash is addressed. 2018-06-19 16:35:18 +02:00
b5893b1ba3 Fix (unreported) passing CDLayer 'ID' instead of bitflag to a cdlayer mask!
Probably harmless, since I bet CD_ORIGINDEX is nearly always generated,
but still...
2018-06-19 16:25:24 +02:00
a7e66d89d0 Merge branch 'master' into blender2.8 2018-06-19 16:21:35 +02:00
86c1cad1cf Fix missing render slots bugs after recent changes. 2018-06-19 16:19:49 +02:00
7c3ecbf040 Correct rigidbody stub 2018-06-19 16:18:23 +02:00
1c6ca9dc90 Fix animation player 2018-06-19 16:13:23 +02:00
e49f6bb208 UI: Smoke panels as sub-panels
Remove suffix from name since they are sub-panels now.

Display Settings -> Viewport Display, and two sub-panels as well for less used settings.
2018-06-19 16:01:35 +02:00
fbae373db5 Cleanup: remove ref to dm in names in projpaint struct. 2018-06-19 15:55:45 +02:00
650bc17c1e Remove derivedmesh from 3DView texture/projection paint.
Pretty straightforward changes. Name cleanup to follow in a separated
commit.
2018-06-19 15:55:45 +02:00
34d9e9837a UI: Fluid physics panels as sub-panels
Also remove suffix from name since they are sub-panels now.
2018-06-19 15:48:21 +02:00
a2b79a21e1 UI: Soft Body panels as sub-panels
Also remove suffix from name since they are sub-panels now.
2018-06-19 15:48:21 +02:00
71b25e75c3 UI: Rigid body panels as sub-panels
Also remove suffix from name since they are sub-panels now.
2018-06-19 15:48:21 +02:00
96e6fd3b60 Remove rigid body from rbw->group when deleting
I moved some code from ED_rigidbody_object_remove() to
BKE_rigidbody_remove_object(), so that calling the latter doesn't leave
the object in rbw->group (causing a crash later on when rebuilding the
depsgraph).
2018-06-19 15:40:25 +02:00
ab1beb9744 UI: Cloth panels as sub-panels
Also remove Cloth suffix from name since they are sub-panels now.
2018-06-19 15:33:38 +02:00
d8f9ec1547 Particles: Support changing modifiers during particle edit mode
The idea is to only use pointers to particles in original object when
creating an edit structure. The derived mesh we get from evaluated
object.

The rest of the commit is just keeping pointers in sync.
2018-06-19 15:28:33 +02:00
95306a4d19 Particles: Use utility function to copy particles 2018-06-19 15:28:33 +02:00
aa3f0b0998 Particles: Add utility function to copy particles from one system to another 2018-06-19 15:28:33 +02:00
92c519ff17 Blender Version Bump
Without this, render slots aren't added.
2018-06-19 14:50:39 +02:00
ce0a87a208 Revert: EditMode Inactive edge drawing
Did it manually as there was some refactoring done that has value
2018-06-19 14:32:52 +02:00
92823275af Fixed rigid body simulation randomly stopping
This was caused by a floating point comparison using ==, instead of using
compare_ff_relative().
2018-06-19 14:22:48 +02:00
4b5f3690bb Missed warning in previous commit 2018-06-19 14:07:21 +02:00
1b972a38fe Lookdev: Renamed RNA
studiolight_background => studiolight_background_alpha
Removed "Show" from the label
2018-06-19 14:04:51 +02:00
de748bbedf Studiolight: Background Generation of icons 2018-06-19 14:04:51 +02:00
c564d847ef Show cached frames in timeline at correct height
The line was covered by the horizontal scrollbar instead of drawn above
it.
2018-06-19 11:49:56 +02:00
8f922b30b0 RigidBodyWorld: copy ptcache from evaluated scene back to original scene
This makes it possible to perform re-evaluation of the scene without
having to re-run the simulation.

The CoW → Orig copy is only performed when the depsgraph is active, so
as to not influence the current scene while rendering in the background.

Alternatively, we could have the CoW copy share the cache with the
original to prevent too much copying of cache data. This will be faster,
but I'm not sure whether we can reliably check the DEG_is_active()
status at CoW copy creation time.
2018-06-19 11:49:56 +02:00
668f39519c Fix T55528: Cycles AO node should default to 1 if radius is 0. 2018-06-19 11:45:05 +02:00
caaf4e5a37 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_image_proj.c
2018-06-19 10:52:01 +02:00
b09a8203e9 Cleanup DM generation code for ProjPaint.
Two branches were actually doing essentially the same thing here, no
need to artificially complicate things. ;)
2018-06-19 10:48:37 +02:00
64a2f98062 Fix (unreported) unauthorized relesing of derived_final DM in paint projection code.
NEVER free yourself DM returned by mesh_get_derived_final(), it's always
to one assigned to ob->derived_final!
2018-06-19 10:43:54 +02:00
816817011f Cleanup: rename mode -> object.mode in Py UI
Keep 'mode' only for 'context.mode'.
2018-06-19 09:25:05 +02:00
9025841a0a Error in last commit 2018-06-19 09:20:38 +02:00
2d2db18f0b UI: move object-mode lock out of the 3D header
Avoid obscure options here.
Move to the edit menu, although this may be temporary.
2018-06-19 09:14:31 +02:00
65b3c7b72c Studiolight: Add SH2 cache
- the result of the SH2-coeffiecients are stored in a bin file (3*9
floats). As the file is a local file we do not care about the
architecture.
- solved issue that also for internal lights the irradiance file were
stored. We don't want that as it could be in a not accessible location
2018-06-19 09:06:35 +02:00
7a3e037dc0 Merge branch 'master' into blender2.8 2018-06-19 08:56:45 +02:00
751189e9d6 Vertex Paint: set sculpt object mode immediately
SculptSession.mode_type wasn't initialized until painting,
making it unreliable for checks in other parts of the code.

Also remove unnecessary initialization,
matching sculpt mode more closely.
2018-06-19 08:50:35 +02:00
bd3fe54b0d Merge branch 'master' into blender2.8 2018-06-19 08:15:03 +02:00
f0c6f5ee77 editorconfig: correct C/C++ using space 2018-06-19 07:48:12 +02:00
8c77c36539 Ghost: Fix offline OGL render on windows.
rBe0c088f8fb5a introduced offline rendering support on windows, sadly it was trying to use the desktop window for getting a context, which given SetPixelFormat can only be called once for any given HDC was an unfortunate choice.

This patch uses a temporary hidden window for getting the opengl context.

Reviewers: mano-wii

Differential Revision: https://developer.blender.org/D3481
2018-06-18 18:10:45 -06:00
30c383fd35 Merge remote-tracking branch 'origin/master' into blender2.8 2018-06-18 13:40:39 -06:00
38b72fb64b make.bat: Fix msvc-2017 detection.
D3485 by @manung

Differential Revision: https://developer.blender.org/D3485
2018-06-18 13:39:12 -06:00
643370b10f Cleanup: code-style 2018-06-18 20:58:08 +02:00
0d8b92267d Object Mode: make mode locking optional
Design from T55246 is kept while allowing 2.7x behavior.
2018-06-18 20:43:26 +02:00
9fb5924446 Fix a very nasty and sneaky bug in lib remap / static override code.
Not sure why remap call for static override reference ID pointer was put
there, probably a mistake during some merge back in the days...

But this ended up with self_id of libquery data struct still being set
to previous ID pointer, which could randomly generate crap like falsly
reporting indirect data and such, leading to lost reference datablock at
writefile time...
2018-06-18 20:20:55 +02:00
176bbe3466 Merge branch 'master' into blender2.8 2018-06-18 18:55:12 +02:00
ab59f9e65d editorconfig: add rst 2018-06-18 18:53:49 +02:00
594bcf934e Cleanup: use DEG tag flags, instead of old OB ones.
Having those two in parallel is ratehr confusing... :/
2018-06-18 18:43:21 +02:00
4efe8fc806 Fix crash when making static override of an object from a collection.
Since we free collection caches when we remap one of their objects, we
also need to tell depsgraph to flush this into the COWs of that
collection, otherwise things like draw code can access freed memory...
2018-06-18 18:43:21 +02:00
e92d61797b 3D View: don't show manipulators when overlay is disabled 2018-06-18 18:33:02 +02:00
f0245a18d1 Merge branch 'master' into blender2.8 2018-06-18 18:22:06 +02:00
b7b7468bef editorconfig: add line length, glsl 2018-06-18 18:21:35 +02:00
b2fa20f6c9 Merge branch 'master' into blender2.8 2018-06-18 18:12:04 +02:00
ce7c87fbda Add .editorconfig file
This is a fairly well supported file-type configuration
for indentation and trailing space stripping.

See editorconfig.org for details.
2018-06-18 18:09:45 +02:00
f828355cd6 Avoid assert on startup 2018-06-18 17:39:51 +02:00
d7122825ec Cleanup: redundant greater than 2018-06-18 17:39:50 +02:00
bea779fd78 Particle: Add missing field initializaiton 2018-06-18 16:01:29 +02:00
762dec21f6 UI: decorators hid non-array buttons
Error in last commit.
2018-06-18 15:50:21 +02:00
7356cec0c6 Studiolights: Radiance icons were inverted. 2018-06-18 15:45:55 +02:00
7747d4cecf Workbench: increased Quality of the diffuse lighting model
- implemented Spherical Harmonics L2 for diffuse shading.

TODO: caching the precalculated harmonics so it won't take soo long to
open the popover
2018-06-18 15:32:53 +02:00
fec97ec949 Objects: when active object gets hidden, make it inactive. 2018-06-18 15:20:06 +02:00
7c836ac30a Cleanup: simplify some view layer code. 2018-06-18 15:20:06 +02:00
0365079676 Particles: Remove obsolete code for child particles in edit mode 2018-06-18 15:14:03 +02:00
55623368b4 UI: decorators weren't showing icon-only buttons 2018-06-18 15:11:10 +02:00
de4c81c153 Fix merge error in bpy_driver.c 2018-06-18 15:09:55 +02:00
c655c65987 UI: No decorators on render engine picker 2018-06-18 12:41:39 +02:00
088691254e Merge branch 'blender2.8' into temp-dynamic-overrides 2018-06-18 12:37:50 +02:00
324e10e76a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/makesrna/intern/rna_space.c
2018-06-18 12:32:12 +02:00
579631819f Fix T55503: File browser filter not working correctly.
There were two issues here, introduced by rB66aa4af836:
* Forgot to change length of some filter_glob var deep in filebrowser code.
* Truncating filter_glob in general can be dangerous, generating
unexpected patterns.

Last point was the root of the issue here, truncating to 63 chars string
left last group as 'match everything' `*` pattern.

To fix that to some extent, added a new BLI_path_extension_glob_validate
helper to BLI_path_util, which ensures we do not have last
wildcards-only group in our pattern, when there are more than one group.
2018-06-18 12:26:47 +02:00
5e47f365e1 UI: Start UIList with 2 rows for materials/particles
There is room for it anyway because of the 3 buttons on the right.
2018-06-18 12:21:17 +02:00
d5ec62a0c3 Multires: Remove unused function
It uses derived mesh, and relies on scene stored in modifier data.
So port is needed anyway.
2018-06-18 11:14:00 +02:00
4330027895 Depsgraph: Cleamup, reduce indentation level 2018-06-18 10:23:03 +02:00
35c02c08b8 3D View: support outline overlay option 2018-06-18 09:23:25 +02:00
04e2a5cef4 Refactor: Put ViewportAA as UserPref
By default users want AA in the viewport. For slower systems you want to
be able to turn it off. As in the future we would also like to support
TAA in the viewport we introduced it as a Max Viewport AA settings.

Also removed the drawoption to enable/disable AA per viewport
When rendering the AA is always turned on.
2018-06-18 08:54:08 +02:00
79546a4eb6 ShadingMenu: Splitted in SubPanels 2018-06-18 08:54:08 +02:00
b2f0803b5b Fix T55511: Decorator drag makes many undo steps
Each keyframe made a separate undo step.
2018-06-18 08:25:05 +02:00
af51ec3214 Cleanup: indentation 2018-06-18 08:10:23 +02:00
0d45074768 Cleanup: whitespace 2018-06-18 08:08:08 +02:00
a794da5200 Fix T55517: Property-split fails w/ expanded enum 2018-06-18 08:05:46 +02:00
05b99b763e UI: disable decorators for render output 2018-06-18 07:38:06 +02:00
9d57b5aa44 Merge branch 'master' into blender2.8 2018-06-18 07:34:31 +02:00
b66ae8259e RNA: disable animation for file output options 2018-06-18 07:31:21 +02:00
05dc109553 Merge branch 'master' into blender2.8 2018-06-17 20:37:10 +02:00
86e20a2e63 Cleanup: trailing space cmake, make.bat 2018-06-17 20:18:09 +02:00
e7a68ef843 Cleanup: trailing space in CMake files 2018-06-17 20:15:24 +02:00
195879a50d Edit Mesh: Fix buggy occlusion when in xray mode.
This mimics the behaviour of the old wireframe mode. When in Xray mode,
don't use the limit selection to visible option.

Also hide the option if Xray is enabled.
2018-06-17 20:11:37 +02:00
2ceff8bd63 Python: Allow untrusted py-drivers to run limited expressions
Limit to a restricted set of built-ins, as well as the math module.
Also restrict of op-codes, disallowing imports and attribute access.

This allows most math expressions to run
without any performance cost once the initial check is done.

See: D1862 for details.
2018-06-17 20:01:05 +02:00
06a1a66a9b Merge branch 'master' into blender2.8 2018-06-17 17:10:19 +02:00
a24b4e6090 Cleanup: trailing space for remaining source/ 2018-06-17 17:06:28 +02:00
76c2203f9c Cleanup: trailing space for blenloader 2018-06-17 17:06:07 +02:00
6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
a262ea8c47 Cleanup: trailing space for compositor 2018-06-17 17:05:29 +02:00
410880552b Cleanup: trailing space for freestyle 2018-06-17 17:05:14 +02:00
e74bd46ede Cleanup: trailing space for imbuf module 2018-06-17 17:04:54 +02:00
1eed46c788 Cleanup: trailing space for modifiers 2018-06-17 17:04:27 +02:00
78fbd146f3 Cleanup: trailing space for DNA headers 2018-06-17 17:04:09 +02:00
4be752a93c Cleanup: trailing space in source/gameengine/ 2018-06-17 17:03:10 +02:00
61d27db359 Merge branch 'master' into blender2.8 2018-06-17 16:36:30 +02:00
5513da65b2 Cleanup: trailing space for BLI 2018-06-17 16:32:54 +02:00
f19ecdeec6 Cleanup: remove unused BLI_rebase_path 2018-06-17 16:26:47 +02:00
56173e512c Merge branch 'master' into blender2.8 2018-06-17 16:18:15 +02:00
a0a1fc8938 Cleanup: BLI path extension API
Use BLI_path_extension_* prefix.
2018-06-17 16:13:24 +02:00
6855d537e3 Merge branch 'master' into blender2.8 2018-06-17 15:52:32 +02:00
6453814ec0 BLI_path: add string size debug define
Off by default, only for debugging.
2018-06-17 15:35:00 +02:00
c7ae7ccfb8 Driver: trailing zeros from expression 2018-06-17 14:50:42 +02:00
547e962bf6 3D View: 3D Cursor was not restoring GL state
Caused camera frame to be double width.
2018-06-17 14:43:31 +02:00
446a646551 UI: hide decorators in panels w/o animated buttons 2018-06-17 12:38:28 +02:00
529669fde7 Edit Mesh: tweak active face edge width
This rewinds a change from own commit e3d88b021c
The only took edge overlay into account (crease, seam.. etc)
Currently active-face also uses this width.

While the difference is subtle,
this makes the active-face stand out more clearly.
2018-06-17 12:31:01 +02:00
d53d78ac45 UI: correct decorator buttons 'enabled' flag 2018-06-17 12:15:32 +02:00
e960920f2f UI: decorator color button assert
Also set 'all' argument based on the RNA-index
(even though it worked, better set to correct value).
2018-06-17 12:15:32 +02:00
ab20901c9e Cleanup: codestyle 2018-06-17 12:03:22 +02:00
43ce201125 Merge branch 'master' into blender2.8 2018-06-17 11:57:49 +02:00
42103a3eb8 CMake: add missing headers 2018-06-17 11:56:20 +02:00
2f1e34cfcc Cleanup: use clamp_* from BLI_math (replace macro) 2018-06-17 11:50:56 +02:00
75188552a1 Merge branch 'blender2.8' of git.blender.org:blender into blender2.8 2018-06-16 21:49:40 -06:00
0a08c5cd36 Fix : Build error with uchar in intern_gawain.
error introduced by  D3483, intern_gawain has no access to bli_systypes.h
2018-06-16 21:49:11 -06:00
fe98124a98 Custom Hdri: Use same AntiAliasing as Matcaps 2018-06-16 23:28:39 +02:00
b503dd7747 StudioLights: Fix preview icon.
Use same antialiasing method as the matcaps and fix the normal computation.
2018-06-16 23:28:39 +02:00
48adf90367 Matcap: Make matcap preview the same size as the other StudioLights 2018-06-16 23:28:39 +02:00
224daf55ac Matcaps: Add AntiAlias alpha mask to icon preview. 2018-06-16 23:28:39 +02:00
0332d338ea Studio Light: Fix typo 2018-06-16 23:28:39 +02:00
4a2c58e077 Outlines: Don't draw Xray mode outlines in material or render mode 2018-06-16 23:28:39 +02:00
45591cc0df GLRefactor: Remove all GL types from gawains public headers.
In preparation for possible alternative back-ends, the dependency on glew.h needs to be confined to as few libraries as possible. This patch removes all gl types from the public gawain headers.

It'll need some more refactoring later on, but for now this will suffice.

Reviewer: brecht, fclem

Differential Revision: https://developer.blender.org/D3482
2018-06-16 12:44:20 -06:00
c90d348e04 Merge remote-tracking branch 'origin/master' into blender2.8 2018-06-16 12:30:56 -06:00
36e82b7759 make.bat: Fix make showhashes not working.
broke in recent refactor.
2018-06-16 12:29:38 -06:00
c21499ba4a UI: show decorator icon for static-override 2018-06-16 18:27:04 +02:00
3b7f630a54 Merge branch 'master' into blender2.8 2018-06-16 18:02:50 +02:00
dc1c820b2b Cleanup: remove BLI_frand from GreasePencil code. 2018-06-16 18:02:23 +02:00
0a8e6b48c4 Correct assert in recent changes 2018-06-16 17:31:37 +02:00
3cf239ccfa UI: support dragging to key-frame 2018-06-16 16:29:05 +02:00
d8c2c63c00 UI: Add property decorator buttons
When use_property_split is enabled, this template adds
buttons to set keyframes, (Alternative to showing color).

See: T54951
2018-06-16 16:28:42 +02:00
ace8ad861d Fix T55427: Removing Vertex Group used by Data Transfer Modifier results in crash.
Only fixing crash, proper handling (a.k.a remapping) of all
possible cases here, for all possible data layers, is rather involved...
2018-06-16 16:22:00 +02:00
8f2acda7d7 Merge branch 'master' into blender2.8 2018-06-16 16:16:53 +02:00
35c71aed25 UI: refactor drag-toggle for other button types 2018-06-16 16:04:26 +02:00
ce80e00a7c Edit Mesh: Simplify the overlay shader.
Remove all the clip cases and just pass the vertices screen position to the
fragment shader.

This does put a bit more pressure on the fragment shader but it seems to be
faster than before. And it simplify the code a lot.

It seems to fix some long standing issue on some intel GPU.
2018-06-16 15:49:16 +02:00
d45d094378 Edit Mode: Fix bad display of edges when limit selection mode is Off. 2018-06-16 15:49:16 +02:00
73abca1da0 UI: minor changes from 2.8
- Option to skip multi-data edits.
- Open hold buttons on drag.
- Utility function to set default value.
2018-06-16 15:44:13 +02:00
5600296c9d Merge branch 'master' into blender2.8 2018-06-16 15:28:57 +02:00
b955747875 Cycles Cleanup: Remove unneccessary color management call 2018-06-16 13:47:49 +02:00
9d876960e8 This option limits visibility of the glew.h header to just bf_gpu and intern_gawain
this is to highlight areas in the code that still directly do opengl calls or use
opengl types.

This is in preparation for supporting alternative rendering back-ends.

Reviewers: brecht, fclem

Differential Revision: https://developer.blender.org/D3304
2018-06-15 20:17:16 -06:00
01f576e87b Merge branch 'master' into blender2.8
The Eevee AO node supports the new Normal socket, but ignores Distance,
Samples, Inside and Only Local settings.
2018-06-15 23:16:49 +02:00
799779d432 Cycles: change Ambient Occlusion shader to output colors.
This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision: https://developer.blender.org/D3479
2018-06-15 22:16:06 +02:00
469408de72 UI: fix redundant scrolling in the redo panel 2018-06-15 21:05:49 +02:00
0ff87e3a60 Cleanup: code style 2018-06-15 20:55:37 +02:00
e3d88b021c Edit Mesh: tweak vertex size & edge width
- Vertex size now matches the theme setting.
- Edge width is closer to a single pixel line.
- Face dot was scaled up to be drawn as a circle,
  but is currently a square.
2018-06-15 20:11:35 +02:00
2291ce9f1f Merge branch 'master' into blender2.8 2018-06-15 19:12:44 +02:00
2b9edbc98b WM: suppress drag events if motion is handled 2018-06-15 19:09:43 +02:00
ecc57e7524 Merge branch 'master' into blender2.8 2018-06-15 17:43:18 +02:00
d645b1a78a Cleanup: some more G.main removal.
We are really starting to scratch the last bits here...
2018-06-15 17:42:17 +02:00
9c629b06bf Workbench OpenGL render: always render alpha on 1.0
Old implementation rendered alpha to 0.0 for background, but only during
deferred rendering. We should attach this to an DNA setting and also let
the forward shading respect this. But for now this is a better default
2018-06-15 17:42:11 +02:00
49915e3241 Cleanup: validate G.main's in creator code.
Using G_MAIN here is valid!
2018-06-15 17:36:44 +02:00
3e4bf31327 Cleanup: G.main removal from 2.8-only code. 2018-06-15 17:33:24 +02:00
5b6ae0523e Merge branch 'master' into blender2.8 2018-06-15 17:25:41 +02:00
ca2be6912d Hair editing: Use original object's particles for drawing
This allows to rely on brush to update children positions,
and avoid tag of object. Makes it way faster to comb with
children enabled.
2018-06-15 17:23:49 +02:00
5ac7068c5f Hair editing: Multi-thread various parts
Currently focused on making parts which are a bottleneck for Spring,
to make things fast as possible. There are surely lots of places
where threading is not currently done, but we can keep doing this,
maybe even with help from the community :)
2018-06-15 17:23:49 +02:00
acdbf71578 Hair editing: Only tag Copy-on-Write when children are enabled
Without children we only need to update batch cache. This way
we don't re-evaluate the whole modifier stack just to perform
child particles redistribution.
2018-06-15 17:23:49 +02:00
da9b1b14ed Cleanup: some more G.main removal/validation... 2018-06-15 17:21:07 +02:00
ed3d693cb1 Dependency graph fixes for RigidBodyWorld
- rbw->group added to the depsgraph.
- Mesh evaluation added when necessary.
- Prevent of double-free by freeing the scene before objects.
2018-06-15 17:15:42 +02:00
43d22d80e7 Keymap: use click event for tab-key
Checking release events would toggle edit-mode during alt-tab
cycling on X11.

Now both press and release events are needed.
2018-06-15 17:10:40 +02:00
d148514821 Workbench: Disable AA when doing opengl render.
- OpenGL uses linear space and has its own AA. So we don't calculate
when doing opengl rendering.
2018-06-15 16:50:34 +02:00
23b3901057 Merge branch 'master' into blender2.8 2018-06-15 16:32:31 +02:00
2e25a48b05 Fix more Cycles CUDA errors after recent changes. 2018-06-15 16:28:09 +02:00
Dalai Felinto
badb700161 Fix T55443: Manipulators not refreshing 2018-06-15 15:45:21 +02:00
0b8c2eed75 Merge branch 'master' into blender28 2018-06-15 15:42:42 +02:00
8166d0affd Cleanup: warning 2018-06-15 15:42:31 +02:00
e552247489 MeshEditMode: refactor
- added a lib for shaded functions
- decreased active face inner size
2018-06-15 15:37:13 +02:00
Dalai Felinto
86a2f4a34a Fix crash with x-ray and redo panel
Code was assuming any area with region data was the main one.
This is no longer the case.
2018-06-15 15:01:28 +02:00
b84fad2ba3 Fix T55490, intersect two triangles fails.
Need to use the 'use_partial_connect' option in island connect,
so changed signatures of various functions to pass that into and
then down from BM_mesh_intersect (making true for intersect, false
for boolean).
Then fix bm_face_split_edgenet_partial_connect to work when
input edges are not necessarily wire, but at least not in the
face they are being connected in. That caused generalization
of core BM_vert_separate_hflag_wire (which is only used in
this one place in all Blender).
2018-06-15 08:48:45 -04:00
6ee25c9d55 Fix broken multi-threaded concurrent access to same data.
Note that later we do can cache the non-data version of this path (i.e.
list of propnames), this will still save us the full RNA path parsing.

But the data side of path resolution has to be fully local, no way to
cache that since a same override can be applied to several objects!
2018-06-15 14:44:48 +02:00
84c91a87a9 Converted Rigid Body from DerivedMesh to Mesh 2018-06-15 14:33:11 +02:00
Dalai Felinto
a54079eecd Update DNA comment 2018-06-15 14:11:45 +02:00
5073ee0bb2 Workbench: FXAA
- do the FXAA pass after the color management. Be aware that during
rendering this is still being done in linear space
2018-06-15 14:05:49 +02:00
0276abbcf7 Workbench: FXAA
FXAA implementation in the deferred renderpass of the workbench.
Can be enabled per 3dview. Eventually this will also be a user setting
as it is more a system/performance setting than a scene setting.
2018-06-15 13:02:16 +02:00
15c340293f T55486: use GPU_R11F_G11F_B10F for target of Xray compo 2018-06-15 13:02:15 +02:00
64bfa4b300 T55486: use GPU_R11F_G11F_B10F for Matcaps 2018-06-15 13:02:15 +02:00
Dalai Felinto
20d5fd36a1 Depsgraph: Link scene cow with object cow
For dynamic override we need to be sure the object cow is not updated before
the scene cow.

In fact we need this to any datablock that is potentially dynamic overridable.

That said this patch makes the relationship (fix the arrows) yet it doesn't
fix the underlying problem.
2018-06-15 12:58:47 +02:00
b7338463a7 Tool System: workaround click conflicting w/ add brush 2018-06-15 12:29:30 +02:00
Dalai Felinto
344c2d4674 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-06-15 12:18:36 +02:00
995a1815f5 Fix T55408: Double transforms on parents/children.
object.base_flag was not synced back from evaluated ID to original one.
Similar thing as copying back to original transform matrix, avoids
having to get data from evaluated one in lots of cases.
2018-06-15 12:17:26 +02:00
76bc8669a0 Merge branch 'master' into blender2.8 2018-06-15 10:44:33 +02:00
284e0ea756 Fix (unreported) Text Editor: scrollbar exiting early
caused by recent clickdrag changes
2018-06-15 10:27:30 +02:00
8148d549bb Fix Cycles CUDA error after recent changes. 2018-06-15 10:26:28 +02:00
3a2a10e3a6 Merge branch 'master' into blender2.8 2018-06-15 10:25:41 +02:00
cbc7ee28d7 WM: 2.8 screen compatibility
Without these minor changes loading files from 2.8 will crash.

Manually applied edits from 26786a2b87
2018-06-15 10:24:53 +02:00
7c16739c75 Fix mouse input overwriting transform redo values
Redo trackball rotate and edge slide weren't working.

Caused by re-ordering of initialization 47de0321bf
2018-06-15 08:48:53 +02:00
e2c87c7e94 Cleanup: unused var 2018-06-15 08:03:19 +02:00
27de412ca8 Merge remote-tracking branch 'origin/master' into blender2.8 2018-06-14 22:54:42 +02:00
525be2f579 Image: Refactor render slots to a dynamic list
Previously, render slots were hardcoded to a fixed amount.

With this change, render slots now are stored in a list. Therefore, users can add and/or remove as many slots as they want.

Credit to brecht for the UI part.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3474
2018-06-14 22:46:30 +02:00
51f1ed8221 Cleanup: style 2018-06-14 22:44:53 +02:00
928d31d94a WM: fix redo region setting the context 2018-06-14 22:32:01 +02:00
26786a2b87 WM: add support for temporary region data 2018-06-14 22:27:58 +02:00
3ee606621c Cycles: Query XYZ to/from Scene Linear conversion from OCIO instead of assuming sRGB
I've limited it to just the RGB<->XYZ stuff for now, correct image handling is the next step.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3478
2018-06-14 22:21:37 +02:00
064e701472 Cycles: Connect value inputs to Strength instead of Color when inserting an Emission node
Same result, but saves an additional ConvertNode.
2018-06-14 22:16:42 +02:00
716e138a1b Cycles: Automatically detect HDRI resolution by default and use non-square sampling map
The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution.
If there are no Enviroment Textures, it just uses the old default.

Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size,
the manual UI option now halves the value to get the height.

A default aspect ratio of 2:1 makes sense since this is what most HDRIs use.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3477
2018-06-14 22:07:07 +02:00
1adfabc8c6 WM: revert part of Top-Bar inclusion
This removes OperatorRepeatContextHandle, from 5f6c45498c
since we now only have redo in the area an operator is executed in.

These values could be invalid and crashed in some cases.
2018-06-14 21:58:11 +02:00
7afa59e37a Edit Mesh: Fix blending function of edges
This fix the ugly (usually) dark outline that was around selected edges.
2018-06-14 21:45:16 +02:00
dc25e69c2d Fix motion paths not updating correctly for bones in some cases.
Sometimes the evaluated pose channel pointers can change during depsgraph
evaluation, so we can't store them ahead of time. The object pointer
should be ok since evaluated ID memory is reused.
2018-06-14 20:58:14 +02:00
2e09b277d5 Revert "GHOST: GLX: Remove XInitThreads"
This reverts commit 7529690df3.

I tried to put manually add threading protection to GHOST around
Xlib calls but that did not fix the crashes. So reverting that
for now despite the performance implication on some system.
2018-06-14 18:17:28 +02:00
dc856be839 Preview: Add own opengl context to render preview images. 2018-06-14 18:17:28 +02:00
a8e8808d58 Give RigidBodyWorld collection a fake user
This prevents it from disappearing when the blend file is saved.
2018-06-14 17:35:46 +02:00
8dc883052c UI: redo panel would still start zoomed in at times 2018-06-14 16:48:31 +02:00
59bb5d3a89 Cleanup: some remaining G.main's in COllada in 2.8... 2018-06-14 16:43:11 +02:00
a03fb42841 Workbench: Code cleanup: Double assignment 2018-06-14 16:28:16 +02:00
b9c9b87fa6 Cleanup: remove BLI_frand ugly global random generator usage from compositor. 2018-06-14 16:25:39 +02:00
3a36cbdfde Transform: Suppress assert w/ vertex paint 2018-06-14 16:14:51 +02:00
00eeb05f4c Depsgraph: Make certain components NOT tag copy-on-write when they are tagged
Currently done for mesh batch cache update, and for base flags sync.
Those components do not need anything from original object, and hence
can skip CoW tag and have faster update after them used.
2018-06-14 16:04:09 +02:00
42d8872014 Depsgraph: Use dedicated ocmponent for object's base flags flush 2018-06-14 16:04:09 +02:00
87b2444270 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/AnimationExporter.cpp
	source/blender/collada/AnimationExporter.h
	source/blender/collada/ArmatureImporter.cpp
	source/blender/collada/ArmatureImporter.h
	source/blender/collada/ControllerExporter.cpp
	source/blender/collada/ControllerExporter.h
	source/blender/collada/DocumentExporter.cpp
	source/blender/collada/DocumentImporter.cpp
	source/blender/collada/GeometryExporter.cpp
	source/blender/collada/GeometryExporter.h
	source/blender/collada/MeshImporter.cpp
	source/blender/collada/MeshImporter.h
	source/blender/collada/SkinInfo.cpp
	source/blender/collada/SkinInfo.h
	source/blender/collada/collada_utils.cpp
	source/blender/collada/collada_utils.h
2018-06-14 15:55:51 +02:00
0626de2033 GPU: consistenly use mipmap on/off in all draw modes.
This is important for good texture paint performance.
2018-06-14 15:50:22 +02:00
14db989e73 Cleanup: remove legacy GPU pass binding code. 2018-06-14 15:46:43 +02:00
39142103d9 T55479: Tag for update when active texture changes 2018-06-14 15:30:06 +02:00
fd19069999 Cleanup: remove last G.main's from Collada code. 2018-06-14 15:15:51 +02:00
277d901274 T55456 EditMeshMode
- see the face selection color when face is active
- test different masks for active face, finally chosen for no mask at
all.
2018-06-14 14:18:52 +02:00
158930228d Improved two tooltips
Tooltips shouldn't just repeat the information from the label.
2018-06-14 13:55:24 +02:00
f4dc4bd275 Fix crash on startup in after recent G.main changes. 2018-06-14 13:45:15 +02:00
3eba5c0079 Cleanup: remove last G.main's in WM code of 2.8.
Again, just validating ther usage and using G_MAIN instead.
2018-06-14 12:42:30 +02:00
4bf751be70 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_normal_edit.c
	source/blender/windowmanager/intern/wm_files.c
2018-06-14 12:39:52 +02:00
66407e15cb Cleanup: Remove last G.main's from WM code.
Was mostly validating valid usages of G.main -> G_MAIN actually.
2018-06-14 12:34:13 +02:00
a671aa922a Workbench: Material colors + settings during sculpting 2018-06-14 12:12:27 +02:00
d64cd6f7ee Move call to drw_state_ensure_not_reused() inside the region locked by DST.gl_context_mutex.
Currently with a debug build there is a race condition where the mutex is released before the DST structure is reset to 0xFF, meaning when multiple threads are using the DRWManager it can get cleared when the main thread is using it, causing crashes.

Reviewers: fclem, brecht

Reviewed By: fclem

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3476
2018-06-14 12:03:40 +02:00
17b029d80e T55406: Flip Matcap
- Icon represent the flipped matcap in the shading menu
- Added template_icon to display any icon in scale.
2018-06-14 11:44:36 +02:00
0eb3246713 Fix T55470: Add option to not fix polygons' winding to Edit Normals modifier.
this is actually adding option to add buggy behavior, but.. NPR often
expects buggy behaviors, and its one of the main targets for normal editing.
So think it's reasonable to add that option (disabled by default of
course).

Note that am not really happy with UI, but:
* Not sure where to put it, it's kind of own self-contained area option.
* Don't to make it too much visible, using this should be the exception!
2018-06-14 11:41:12 +02:00
fecec7dd68 3D View: Show view-aligned rotation manipulators 2018-06-14 11:37:47 +02:00
f35572ae9e Cleanup: style 2018-06-14 11:37:47 +02:00
62f594ca7b UI: Make spacers align blocks on area divisions
This solves the problem of blocks jumping around when changing modes and
center them to the area (in case of only 2 spacers).
Which is (in my own opinion) more aestetically pleasing.
2018-06-14 11:29:44 +02:00
7449dc8d13 3D View: Tweak transform plane manipulator fading
The threshold to fade out and hide was too small.
2018-06-14 10:39:36 +02:00
4ee97c9a1c WM: increase hot-spot of 3D manipulators
Larger hot-spot was disabled for performance,
however without this - clicking on them is too difficult.
2018-06-14 09:55:58 +02:00
ba2c10c1f7 3D View: increase size of view aligned rotation
Minor changes based on user feedback.

- View aligned rotation manipulator overlapped too often
  with axis aligned widgets. Increase size (matching 2.79)
- Offset arrow-heads when combining rotate & translate,
  don't draw the stem since it overlaps with scale.
2018-06-14 09:46:11 +02:00
22ac20a705 WM: option not to draw arrow manipulator stem 2018-06-14 09:25:55 +02:00
eeca206e76 Cleanup: rename arrow manipulator 'draw_options'
Rename to 'transform' since this controls interaction.
2018-06-14 09:17:03 +02:00
b839d67f3e UI: correct HUD zoom resetting 2018-06-14 08:30:46 +02:00
2f3e890b94 DRW: Fix crash caused by hair transform feedback
Seem to be cause by the lack of proper FBO bound.
2018-06-13 22:20:48 +02:00
8d2309f94f 3D View: make navigation buttons smaller
Keep orbit large, other buttons are now closer to other icons buttons.
2018-06-13 21:00:05 +02:00
711a50c5ea Merge branch 'master' into blender2.8
This includes making Eevee match Cycles behavior of inserting an emission
node when linking colors to closures.
2018-06-13 19:26:52 +02:00
4d58fac1b4 Fix undo group to use human readable name, since this shows in the UI. 2018-06-13 18:39:30 +02:00
3102833962 Fix undo of transform after frame change undoing too much.
For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.
2018-06-13 18:39:30 +02:00
90e6323ed8 Cycles: auto insert emission node when linking color to closure.
This is convenient for previewing the output of a node, and we agreed
to support this behavior in both Eevee and Cycles.
2018-06-13 18:39:30 +02:00
a3c630aebb Merge branch 'master' into blender2.8 2018-06-13 18:25:23 +02:00
57cd52a4ab WM: check release event for particle edit mode
Caused by drag event.
2018-06-13 18:23:09 +02:00
2e23385c35 T55456: EditDrawMode
reorganized shader compilation
2018-06-13 16:47:38 +02:00
645c918825 T55456: EditDrawMode
use darker defaults for not active selection mode elements
2018-06-13 16:47:38 +02:00
4943739b89 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/mesh/editmesh_utils.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-13 16:42:56 +02:00
b8015ece51 Revert "T55456: EditDrawMode"
This reverts commit da6ed54569.
2018-06-13 16:34:20 +02:00
f61c30f804 Cleanup: get rid of last G.main in BMesh code. 2018-06-13 16:29:12 +02:00
cd0a4836d4 Cleanup: unused var 2018-06-13 16:17:07 +02:00
9c65227061 Tag object/scene for selection update from operators
Before that depsgraph tagging was done from inside notifier listener in
viewport. This had the following issues:

- If there are no viewports, selection tag was not done. Causing possible
  issues when object becomes visible.

- Required special trickery to detect which data to tag for update.

- Was causing crash when transforming/selecting markers in clip editor.
  This is because selecting marker needed to poke viewport to redraw, since
  selected bundles will be displayed differently in viewport.
2018-06-13 16:07:55 +02:00
Dalai Felinto
c1e503e89a Silence false positive warning on boolean modifier 2018-06-13 16:04:31 +02:00
1bcf9217eb Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_pointcache.h
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/pointcache.c
	source/blender/editors/include/ED_particle.h
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/physics/particle_edit_undo.c
	source/blender/editors/physics/particle_object.c
	source/blender/editors/physics/physics_intern.h
	source/blender/editors/physics/physics_pointcache.c
	source/blender/editors/space_time/space_time.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_generics.c
	source/blender/editors/transform/transform_manipulator.c
	source/blender/makesrna/intern/rna_object.c
	source/blender/makesrna/intern/rna_object_force.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-13 15:36:24 +02:00
7a10cfe7fe UI: preset popover buttons in panel headers.
Moves the preset into a menu for the panel header, so it can be changed
without opening the panel and takes up less space. Two remaining issues:

* For long lists the add new preset button can be scrolled off screen.
* We should support showing the name of the chosen preset in the panel
  header, but the current preset system does not support detecting which
  preset is used.

Differential Revision: https://developer.blender.org/D3366
2018-06-13 15:22:34 +02:00
Dalai Felinto
1664ccb675 Fix flexible spacer distance
Introduced on 0bce173bc7.
2018-06-13 15:17:56 +02:00
Dalai Felinto
8f8205584d UI: Make NLA header consistent with dopesheet 2018-06-13 15:07:25 +02:00
1a6b2650fa Cleanup: double quotes for non-enum strings 2018-06-13 15:06:58 +02:00
eed9458c22 UI: center align 3D view header snap, pivot etc 2018-06-13 15:04:13 +02:00
Dalai Felinto
6b6c86d1f7 UI: Fix clip editor double text-less icon situation 2018-06-13 15:04:07 +02:00
5ff1d845ea Cleanup: moar ugly G.main removal...
Note that due to RNA get/setters issue, that one may actually add some
G.main usages to the total... But at least it's not hidden anymore in a
very low-level, dark corner of BKE pointcache code!
2018-06-13 14:28:05 +02:00
da6ed54569 T55456: EditDrawMode
- removed the dithering from the active face
2018-06-13 14:21:38 +02:00
57fe9767f4 Merge branch 'master' into blender2.8 2018-06-13 14:19:57 +02:00
f7083b00ee Cleanup: tool settings access 2018-06-13 14:12:21 +02:00
2002fe27d9 Fix T55467: nodes cant be resized after recent clickdrag change 2018-06-13 14:03:46 +02:00
Dalai Felinto
64ecd3d2e7 Set minimum blender version as 2.80
Technically we probably need to do for the current subversion (17).
But the entirely 2.80 series is known to be experimental.

The most important part is to notify people that if they open the 2.80
file in master it will loose data.
2018-06-13 13:01:16 +02:00
710f1f2232 UI: add back pivot point
Was accidentally removed after recent changes.
2018-06-13 12:55:57 +02:00
23c24cead5 T55456: EditMode Drawing
- Hide facedots, except when in V3D_ZBUF_SELECT mode
`use_occluded_geometry`
- Different theme (wire_inactive) when not in edge selection mode
2018-06-13 12:38:53 +02:00
c0926d536f Manipulator: Skip redundant transform updates
Partially address T55458
2018-06-13 11:59:48 +02:00
ca7a93953a Error in recent popover width 2018-06-13 11:57:52 +02:00
0bce173bc7 UI: remove empty space at the end of headers, tweak start/end spacing. 2018-06-13 11:43:10 +02:00
dcf70dc181 Fix 3D view header panning not working with region overlap. 2018-06-13 11:43:09 +02:00
e4ab04b8bb Fix pop-over buttons always getting space for icon 2018-06-13 11:22:15 +02:00
2a5d4d7573 Merge branch 'master' into blender2.8 2018-06-13 11:11:23 +02:00
5788f24337 Cleanup: swapped X/Y UI_UNIT 2018-06-13 11:10:55 +02:00
1a79c6d360 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/blendfile.c
	source/blender/blenkernel/intern/node.c
	source/blender/blenkernel/intern/particle.c
2018-06-13 11:02:48 +02:00
67e8c1e1c7 Cleanup: remove more G.main from BKE area. 2018-06-13 10:57:10 +02:00
f234adf65c UI: adjust view navigation layout
Button layout now matches T54723.
2018-06-13 10:57:09 +02:00
edd0522e8f UI: HUD now follows region theming 2018-06-13 09:50:41 +02:00
64aadc7c7d Depsgraph: Avoid use of 0 tag flag on build finish
Use all the explicit tagging. Solves characters being in T-pose after
opening specific scene files.
2018-06-13 09:49:14 +02:00
813a538a57 UI: show HUD when region overlap is disabled 2018-06-13 09:27:40 +02:00
0ab8f9c74a UI: fix hud panel refresh glitch 2018-06-13 09:21:09 +02:00
679eefae74 UI: shorten proportional edit name
Didn't fit in panel.
2018-06-13 09:16:26 +02:00
a03eadaec8 UI: redo panel layout tweaks
- Don't use compact layout (enum titles were hidden).
- Split-properties to use less vertical space.
- Make panel wider, half width when collapsed.
2018-06-13 08:26:16 +02:00
fc0b21ff73 Fix region expanding on refresh 2018-06-13 00:30:16 +02:00
0c0811829f UI: adjust header alignment
- User preferences header at the bottom.
- Action header at the top.

Now all editors accessible from the menu have their header at the top,
default layout for the timeline remains at the bottom.
2018-06-12 22:59:15 +02:00
958d24ae0f UI: Name N-Key toggle to Sidebar 2018-06-12 22:57:03 +02:00
77879ac038 Fix T55376: instanced collection render visibility ignored.
For physics simulation it's still fuzzy though, but this needs bigger
design for how it works with view layers and visibility.
2018-06-12 22:36:43 +02:00
6700c02e53 WM: don't show redo hud when unsupported 2018-06-12 22:33:58 +02:00
98e0bd90f4 WM: hide internal operator settings
These are set in the interface and aren't useful to show to users.

Other minor changes

- Rename 'Ruler/Protractor' -> 'Ruler'
- Rename Subdivide 'Quad/Tri Mode' -> 'Create N-Gons' (and invert).
2018-06-12 22:00:22 +02:00
94e0abda75 UI: move auto-merge option to mesh options panel
This can be used even w/o snap.
2018-06-12 21:16:50 +02:00
81f24dd781 UI: re-arrange object mode and 3D view buttons
After some consideration we're moving 3D view settings
that impact the 3D view back.

See T55386 for details.
2018-06-12 21:10:31 +02:00
18cc8809c3 Fix T55457: Crash after merge faces 2018-06-12 20:43:46 +02:00
e65d20e7dc Cleanup: add ED_region_panels_layout
Only had the '_ex' (extended) version.
2018-06-12 18:39:18 +02:00
9b9b943e0c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_anim.h
	source/blender/blenkernel/intern/anim.c
	source/blender/blenkernel/intern/scene.c
	source/blender/editors/armature/pose_edit.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/armature/pose_utils.c
	source/blender/editors/include/ED_armature.h
	source/blender/editors/object/object_edit.c
	source/blender/editors/transform/transform_conversions.c
2018-06-12 18:26:50 +02:00
2788202417 Cleanup: moar G.main removal from BKE area. 2018-06-12 17:57:24 +02:00
f27ecd56ef Cleanup: BKE_scene_free should not have to worry about cleaning its usages.
This is supposed to be handled by calling code! Henceforce, no need to
call BKE_sequencer_clear_scene_in_allseqs() here, and... no need for
that ugly G.main case. ;)
2018-06-12 17:46:16 +02:00
a76cfe2c22 Cleanup: no need for extra HUD type check now 2018-06-12 17:38:04 +02:00
031416c559 Merge branch 'master' into blender2.8 2018-06-12 17:36:24 +02:00
b00d840359 WM: remove sloppy region type access
Avoid accidentally operating on the wrong region type.
2018-06-12 17:34:44 +02:00
760e79d809 WM: rename BKE_regiontype_from_id
This returns the first as a fallback, causing confusing usage.
Renamed and added a version of the function that doesn't.
2018-06-12 17:26:38 +02:00
e8dd4cd9ca Cleanup: warning, spaces 2018-06-12 17:20:12 +02:00
2af7c38682 Cleanup: get rid of global RNG usage in paint stroke code. 2018-06-12 17:13:47 +02:00
376bc88dc0 Fix leak of manipulator tooltip timers.
This was causing performance degradation over time in posing, as the
manipulator recomputes the center locations for every event.

Ref T55442.
2018-06-12 17:07:18 +02:00
3801736b89 Depsgraph: remove object tagging hack for render.
With copy-on-write it should now all be evaluated correctly in render
resolution, without needing to switch the original data resoluton.
2018-06-12 17:07:18 +02:00
a9cfd8c910 Cleanup: get rid of global RNG usage in transform code. 2018-06-12 17:00:31 +02:00
8826a00482 WM: HUD was disappearing on redo 2018-06-12 16:59:37 +02:00
97cac69739 Fix redo panels being added to non-hud regions 2018-06-12 16:55:00 +02:00
2a3e7fe656 UI: improve HUD ensure/clear logic
Running operators w/o redo now clears the HUD immediately.
2018-06-12 16:50:27 +02:00
deb3d73eea Particle: Use loclaized RNG for physics simulation
Avoids threading conflicts between multiple particle systems being simulated.
2018-06-12 16:37:40 +02:00
7d36408b82 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/python/intern/gpu_offscreen.c
2018-06-12 16:29:07 +02:00
866127d9f2 StudioLight: Use texel size as input size
Bettter light distribution for diffuse shading
2018-06-12 16:18:50 +02:00
ec4ce908db Fix T55452: Crash on saving with visible particle system.
Missing Main pointer in recent refactor/cleanup of G.main usages...
2018-06-12 16:17:05 +02:00
b236400ff5 Math: Remove unused functions which are not safe for threading
All areas are toy use "local" number generator, in order to keep
behavior predictable and threadable. This is what BLI_rng_() API
is for.

There are still lots of usages of BLI_frand(), which are to be
ported to BLI_rng_get_float(). but that is somewhat involved.

For the time being, remove unsafe API, so new areas have zero
chance using it.
2018-06-12 15:51:43 +02:00
6231a077ac Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_group.h
	source/blender/blenkernel/BKE_object.h
	source/blender/blenkernel/intern/group.c
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenloader/intern/readfile.c
	source/blender/editors/object/object_group.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/physics/rigidbody_constraint.c
	source/blender/editors/physics/rigidbody_object.c
	source/blender/makesrna/intern/rna_group.c
2018-06-12 15:41:32 +02:00
1b5e3e1c01 Use evaluated objects in Alembic unit tests
This at least makes sure the tests don't fail any more. Possibly there
should be more evaluation happening there.
2018-06-12 15:39:54 +02:00
39e050af40 Fix T55409: Can't animated keyframed material node value after moving keyframe on timeline
Completely ignore animation for legacy zero update tag.

If one needs animation to be evaluated, tag with proper update tag, stop relying
on direct assignment of adt->>recalc with zero update tag for DEG.

This commit might cause missing updates when needed, those needs to be looked
into once they happen.
2018-06-12 15:39:11 +02:00
8204261ede Particle: Remove global RNG usage from distribution 2018-06-12 15:38:29 +02:00
53a9cde038 Particle: Use local RNG during initialization 2018-06-12 15:38:29 +02:00
46cb64917d Render: Remove global RNG usage
We shouldn't be using BI textures anyway. But in any case, adding noise
texture to compositor is doing proper seed updates already, so probably
was already ported to a proper RNG usage.
2018-06-12 15:38:29 +02:00
b6b1e0f56c T55454: removal of clay engine
The ClayEngine was introduced to test the blender2.8 architecture during
development. As currently we have the wanted features implemented with
matcaps we are going to remove the clay engine as it was never intended
to be an official releasable engine

Note: The test cases are never run. But when enabled will be skipped as
they were implemented over the Clay Engine
2018-06-12 15:32:31 +02:00
d72ddb81ae Studiolight: add rim lighting to the default light setup 2018-06-12 15:17:01 +02:00
a6585fa4b1 Cleanup: moar removal of G.main in BKE area... 2018-06-12 15:16:45 +02:00
1d8279fd8d Alembic: made bl_alembic_import_test.py run again
Two tests are still failing, but at least the API changes in 2.8 have been
applied now.
2018-06-12 15:10:15 +02:00
d617a6c85b Cleanup/simplify G.main usages.
Using G.main only to get main bled filepath, or built-in fonts, is OK.
So now using the 'valid' G_MAIN macro here instead.
2018-06-12 15:03:51 +02:00
4bfc7b9e7d Fix crahs using ndof 2018-06-12 14:50:57 +02:00
18ae64858b Cleanup: Indentation 2018-06-12 14:43:40 +02:00
c2abb6d3fc Particles: Use local RNG
Currently only obvious cases, but is already a progress.
2018-06-12 14:30:50 +02:00
49b39ea851 Duplication: Use local RNG
Makes generation safe for threading.
2018-06-12 14:30:50 +02:00
cb409bb219 Add utility function to help debugging concurrent usage of global RNG
Checks are disabled by default, but we need to make them enabled by
porting all required areas, or by removing API which uses global RNG.
2018-06-12 14:30:50 +02:00
3b2e19cb4c Depsgraph: Ensure modifiers evaluation doesn't happen on top evaluated mesh 2018-06-12 14:30:50 +02:00
c279592123 Depsgraph: Don't update derived mesh for particles on render
Render depsgraph is evaluated from scratch, so it should not be needed
to do such a call.

This also prevents modifier stack from being evaluated on top of already
evaluated mesh
2018-06-12 14:30:50 +02:00
0d817e68ef Depsgraph: Add debug option to invalidate data tagged for update
See comment for INVALIDATE_ON_FLUSH.
2018-06-12 14:30:50 +02:00
3263e5e881 Depsgraph: Set temp object to invalid state as soon as it becomes inaccessible 2018-06-12 14:30:50 +02:00
abdea5754e Depsgraph: Cleanup, wrap private functions to an anonymous namespace 2018-06-12 14:30:50 +02:00
Dalai Felinto
c303f2a19b Use proper UI name 2018-06-12 14:26:43 +02:00
Dalai Felinto
b173b96c09 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-06-12 14:17:35 +02:00
43eebdfebd Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/DocumentImporter.cpp
	source/blender/editors/include/ED_object.h
	source/blender/editors/object/object_modifier.c
2018-06-12 12:58:31 +02:00
be57cf9b2a Cleanup: remove moar G.main from BKE area. 2018-06-12 12:53:27 +02:00
c98b2e74df Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
2018-06-12 12:38:54 +02:00
5508b572ea Cleanup: remove some G.main from ED's animsys.
The easy ones - there some much, much trickier to tackle there...
2018-06-12 12:28:14 +02:00
fdd26faa49 LookDev: Move lookdev balls when menu switches 2018-06-12 12:24:05 +02:00
ab0daa1866 Studiolight: Disabled irradiance icons 2018-06-12 11:53:34 +02:00
8cca1abcb1 Studiolight: Bumped the radiance buffer to RGBA16F
Fixes issue reported at
https://devtalk.blender.org/t/lookdev-ibl-result/890/3
2018-06-12 11:51:04 +02:00
e1f24a8615 Studiolight: cache irradiance buffer 2018-06-12 11:51:04 +02:00
75bcb70c60 Cleanup: remove some G.main from BKE area. 2018-06-12 11:21:54 +02:00
d2e691b91a UI: fix crash with HUD panel size
There can be no panels in the region.
2018-06-12 11:18:52 +02:00
Dalai Felinto
f30056d512 Update the UI to use bl_parent_id
Also remove the DNA/RNA settings that were added for that.
2018-06-12 11:11:13 +02:00
b06deeca25 Merge branch 'blender2.8' into temp-dynamic-overrides
Conflicts:
	source/blender/makesrna/intern/rna_access.c
2018-06-12 11:00:50 +02:00
6d152c5997 UI: remove redo popover from topbar
See: T55039
2018-06-12 10:52:27 +02:00
7bf4023689 Fix T55448: Typo in Cycles CUDA debug output
Reviewers: sergey, lukasstockner97

Reviewed By: lukasstockner97

Tags: #cycles, #bf_blender

Differential Revision: https://developer.blender.org/D3472
2018-06-12 10:45:32 +02:00
4bf331c0fc UI: Initial persistent floating redo panel
This is the first step to moving redo out of the top-bar, see: T55039

- Support for floating panels in the ScrArea has been added.
- A new region type RGN_TYPE_HUD is used for floating settings input.
- Only one HUD should be visible at a time.
- Currently HUD regions are only visible
  for 3D view and image space types.
- There are currently some remaining glitches with hide/show
  that need further investigation.
2018-06-12 10:42:49 +02:00
3937e8fbc3 UI: non editable template_icon_views are rendered as label
This is also a way to render an large preview icon without the selection
control. This is used by the studiolights in the userprefs that only
displays the preview of the light.
2018-06-12 08:45:38 +02:00
a2027c6587 UI: replace ui_draw_search_back w/ general code
Useful for drawing any kind of region-background.
2018-06-12 08:14:13 +02:00
35da1afa09 Cleanup: remove unused context args 2018-06-12 07:59:27 +02:00
1dc93f90a0 Cleanup: remove image->bindcode, always wrap in GPUTexture.
This simplifies code, and will hopefully make UDIM usage of GPUTexture
a little easier.
2018-06-11 23:24:04 +02:00
1d111cd046 Revert "Cleanup: remove image->bindcode, always wrap in GPUTexture."
This reverts commit 8242a5bc85. This isn't
quite ready to use yet.
2018-06-11 22:35:09 +02:00
8242a5bc85 Cleanup: remove image->bindcode, always wrap in GPUTexture. 2018-06-11 22:30:59 +02:00
0054dff67e Fix part of T55439: don't add indirectly linked objects to the scene on link. 2018-06-11 21:51:21 +02:00
3816502b7c Drivers: ensure Python expressions are cached with copy-on-write.
Store the compiled expressions on the original driver.

Ref T55442.
2018-06-11 21:34:21 +02:00
2bbe0c4ef4 Cleanup: fix compiler warnings. 2018-06-11 21:21:41 +02:00
76c7c66b02 Fix accidental addons submodule change in previous commit. 2018-06-11 21:13:02 +02:00
Edmund Kapusniak
c08716d3ee Fix crash with OpenGL rendering in multiple threads on macOS.
On macOS we must always go through BLI_thread_local_get/set().

Differential Revision: https://developer.blender.org/D3470
2018-06-11 21:10:24 +02:00
9520fc0ff7 Pose: optimize pose rebuild for copy-on-write.
Ref T55442.
2018-06-11 20:48:18 +02:00
691471fe22 Cleanup: add simplified panel callbacks 2018-06-11 19:31:56 +02:00
d4b4504260 Improve/partially fix overriding of Object material pointers.
Basic workflow shall now work, still lots to do in the UI (ID template
needs some love to reflect overriden status ;) ).
2018-06-11 19:29:15 +02:00
aca403c819 GHOST: Fix uninitialized values. 2018-06-11 17:07:52 +02:00
4ffd153dbf Fix crash when doing Sculpt->Edit->Sculpt switch.
We actually get fully rid of BKE_object_free_derived_mesh_caches usages,
now always using BKE_object_free_derived_caches (bad name, btw, should
be 'evaluated_caches ;) )...
2018-06-11 18:58:21 +02:00
3df809958b WM: use layout/draw callbacks for buttons space 2018-06-11 18:39:46 +02:00
3e1f83a1dc WM: split panel drawing into layout and draw
This matches changes made to the header.
2018-06-11 18:39:46 +02:00
1f1ca74476 Outlines: Make Xray outlines 2px thick instead of 3px 2018-06-11 18:04:00 +02:00
638590078c Outlines: Make outlines in xray mode not occluded.
This is visually too distracting (flickering). Until we have a better
solution, just disable occlusion fading.
2018-06-11 18:04:00 +02:00
c31bc465ea Revert previous commit and do proper fix for missing typeinfo in nodes. 2018-06-11 17:39:39 +02:00
7529690df3 GHOST: GLX: Remove XInitThreads
This was needed because we were sharing opengl contexts across multiple
threads. With the recent refactor this should be no longer needed.
2018-06-11 17:23:06 +02:00
faf7453b45 Fix crash in loading/applying static overrides of some nodal material.
No real idea why node's typeinfo is NULL here... but think we do not
care much in that case, so just adding some NULL checks for now.
2018-06-11 17:12:47 +02:00
05111d79d0 Cleanup: remove unused DAG_EVAL_PREVIEW mode. 2018-06-11 17:06:28 +02:00
2abb156b9f Cleanup: remove object.is_visible.
Depsgraph already iterates over visible objects, and since this was only
valid for objects evaluated with the depsgraph it was confusing.
2018-06-11 17:06:28 +02:00
73b9531dcf Fix incorrect object selection test in outliner and rigid body. 2018-06-11 17:06:28 +02:00
0461f45e5e Fix T55436: crash with point density and shader tweaking.
With copy-on-write we can no longer assumes the point density data is
available after Cycles synchronization with Blender data is done. So
force it to be loaded earlier, even if it's not great for interactivity.
2018-06-11 17:06:28 +02:00
84692844a3 Fix merge error in 908b696, removed files were accidentally added back. 2018-06-11 17:06:28 +02:00
27b6734022 GHOST: Fix uninitialized var
Was causing crash on startup.
2018-06-11 17:04:59 +02:00
a753c6e11a UI: split left/right header buttons
- Added flexible separators to
  Clip, Graph, Dopesheet, Image, Node, Timeline, 3D View.
- Added graying out for Proportional Editing
  menus to avoid popping when right-aligned.
- Slightly re-arranged some controls,
  so they can be on correct side of the separators.

Patch by @billreynish
2018-06-11 17:01:10 +02:00
17ee4836ab Fix: Remove UI_BLOCK_MOVEMOUSE_QUIT from popovers
This was causing driver editing popovers to just keep disappearing
whenever you accidentally moved the mouse away, making the popovers
there nearly useless.

After testing with the other popovers we have in other places, I don't
really see why we needed this flag enabled in the first place. You can
still switch between popovers in the topbar by mousing over the others,
and if you want to dismiss without clicking to escape, you can go over a
standard menu instead OR just move back towards the button that spawned it.

Let's just test this out for a while and see how it goes. Maybe we don't
need a more invasive solution here...
2018-06-12 02:49:12 +12:00
204c167c72 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_mesh.h
	source/blender/blenkernel/intern/mesh_convert.c
	source/blender/editors/interface/interface_eyedropper_color.c
	source/blender/editors/object/object_add.c
	source/blender/editors/space_image/image_ops.c
	source/blender/makesrna/intern/rna_image.c
	source/blender/windowmanager/intern/wm_draw.c
2018-06-11 16:02:46 +02:00
9e439197ed Workbench: API Changes
- merged matcap and studioLight api
2018-06-11 15:54:24 +02:00
78a8d3685b Cleanup: remove moar ugly G.main usages...
BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)
2018-06-11 15:40:37 +02:00
Dalai Felinto
9b39a5142f Fix T55440: Pose Mode Crash 2018-06-11 15:29:13 +02:00
800c3c5ca5 GHOST: WGL: Delay context initialization for offscreen contexts.
Same as 128926a41b but for windows.
2018-06-11 13:06:54 +02:00
b763c34e80 Cycles: Cleanup, silence strict compiler warning
There is one legit place in the code where memcpy was used as an
optimization trick. Was needed for older version of GCC, but now
it should be re-evaluated and checked if it still helps to have
that trick.

In other places it's somewhat lazy programming to zero out all
object members. That is absolutely unsafe, at the moment when
less trivial class is used as a member in that object things
will break.

Other cases were using memcpy into an object which comes from
an external library. We don't control that object, and we can
not guarantee it will always be safe for such memory tricks
and debugging bugs caused by such low level access is far fun.

Ideally we need to use more proper C++, but needs to be done with
big care, including benchmarks of each change, For now do
annoying but simple cast to void*.
2018-06-11 13:02:10 +02:00
a6e582164f Libmv: Cleanup, make strict compiler more happy
In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.
2018-06-11 13:02:10 +02:00
5ad7bda45f Render: Fix build problem with missing GL/glew.h 2018-06-11 13:00:21 +02:00
Dalai Felinto
070830c62d Fix separator element for headers with multiple directions 2018-06-11 14:54:04 +02:00
Dalai Felinto
d90fc119c2 UI: Separator spacer
This support layout.separator_spacer() to be used by headers as a way to
dynamically separate the ui buttons.

Right now no UI file is changed, though we can use this right away in the
timeline, and shortly after in the viewport header (moving settings from
the topbar to it).

Original design by William Reynish.

Review: Campbell Barton
D3468
2018-06-11 14:46:35 +02:00
74051111eb Merge branch 'master' into blender2.8 2018-06-11 14:44:03 +02:00
160cb9a284 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_object.cpp
	source/blender/alembic/intern/abc_exporter.cc
	source/blender/alembic/intern/abc_mball.cc
	source/blender/alembic/intern/abc_mball.h
	source/blender/blenkernel/BKE_anim.h
	source/blender/blenkernel/BKE_displist.h
	source/blender/blenkernel/BKE_dynamicpaint.h
	source/blender/blenkernel/BKE_group.h
	source/blender/blenkernel/BKE_mball.h
	source/blender/blenkernel/BKE_mball_tessellate.h
	source/blender/blenkernel/BKE_object.h
	source/blender/blenkernel/BKE_scene.h
	source/blender/blenkernel/intern/anim.c
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/displist.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/group.c
	source/blender/blenkernel/intern/mball.c
	source/blender/blenkernel/intern/mball_tessellate.c
	source/blender/blenkernel/intern/mesh_convert.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/object_dupli.c
	source/blender/blenkernel/intern/object_update.c
	source/blender/blenkernel/intern/pointcache.c
	source/blender/blenkernel/intern/scene.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
	source/blender/editors/include/ED_object.h
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_edit.c
	source/blender/editors/object/object_modifier.c
	source/blender/editors/physics/dynamicpaint_ops.c
	source/blender/editors/sculpt_paint/paint_vertex.c
	source/blender/editors/sculpt_paint/sculpt_uv.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_snap_object.c
	source/blender/editors/util/ed_util.c
	source/blender/gpu/intern/gpu_material.c
	source/blender/makesrna/intern/rna_meta.c
	source/blender/makesrna/intern/rna_object_api.c
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-11 14:39:38 +02:00
b7bf8b3757 Render: Create a separate gl context for rendering.
This should take care of all the threading stability issues some people
are reporting.
2018-06-11 13:55:02 +02:00
128926a41b GHOST: Delay opengl context initialization
This way they can be init in their owner thread. Contexts should not be
shared accross threads. Once you make a context active on a thread it is
owned by the thread.

This commit only have the GLX backend updated but should not break orther
platform.
2018-06-11 13:55:02 +02:00
1463ec6896 DRW: Rename ogl_context to gl_context
We might not use opengl forever :)
2018-06-11 13:55:02 +02:00
228ba8475a DRW: Add cache reset.
This is a temporary solution to the use of the shared cache.

Ideally this cache should be per gl drawing context.
2018-06-11 13:55:02 +02:00
0ec2e7ad53 Shading: Change icon of userpreference in Shading popover 2018-06-11 12:48:01 +02:00
d0956e9cb3 Cleanup: Moar G.main removal of Hell.
This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)
2018-06-11 12:15:14 +02:00
8055ed2741 Cleanup: remove some G.main usages... 2018-06-11 12:15:14 +02:00
a67cc72232 MetaBall support for Workbench + EEVEE
Note: Metaballs only support the first material slot. Splicing it per
material would create empty Batches. In order to overcome this we set
the batch for other materials to NULL. We added extra checks in EEVEE
and Workbench to not draw when the geom is NULL.
2018-06-11 11:52:41 +02:00
5aa8d981ec Workbench: Flipping MatCaps for forward shading 2018-06-11 11:52:41 +02:00
f2e60b53a7 Fix pchan head/tail original values not being set 2018-06-11 11:37:22 +02:00
13d238729b Fix bad level stubs 2018-06-11 11:36:22 +02:00
Dalai Felinto
df72101631 Revert unintended changes to depsgraph
This partially reverts f8d7df6f16.
I committed this bit by mistake.
2018-06-11 11:33:09 +02:00
4ac87d58eb Merge branch 'master' into blender2.8 2018-06-11 11:06:43 +02:00
28c34ae7e2 Cleanup: Use BLI_strncpy
It has behavior which we expect, and silences strict compiler warning.
2018-06-11 11:06:15 +02:00
4d339f56fe Fix T55278: Lightmap Pack > New Image broken when active object is None
thanx bblanimation (Christopher Gearhart) for spotting the issue and
providing the fix!

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3449
2018-06-11 11:02:07 +02:00
b6be8c0394 Merge branch 'master' into blender2.8 2018-06-11 10:46:33 +02:00
9e8bd3a072 path_util: avoid overflow w/ strtoll use
Also style cleanup.
2018-06-11 10:46:02 +02:00
ca36364a6a 3D View: move screen overlays to the top
- Frame & object name now top left.
- Axis now top right (when view navigation disabled).

This is needed so we can use the lower area for redo popup, see T55386.
2018-06-11 10:37:56 +02:00
91958436fb Merge branch 'master' into blender2.8 2018-06-11 10:28:36 +02:00
1d8d4e03f5 Fix PyConsole: Drag events finished early in modal text selection 2018-06-11 10:18:51 +02:00
0ec6196ae3 Merge branch 'master' into blender2.8 2018-06-11 10:03:42 +02:00
7ac0272b77 Fix T55140: opened image doesn't show up in movie clip editor
atoi usage in BLI_stringdec could overflow, use strtoll instead and
check
valid range with INT_MIN and INT_MAX

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3452
2018-06-11 09:57:16 +02:00
05e7802a97 WIP: Add driver eyedropper operator button beside the "add input" button
This doesn't work currently. Needs more investigation why.
2018-06-11 19:43:28 +12:00
21c24c0423 Drivers UI: Introduce more whitespace, to make the sections clearer 2018-06-11 19:43:28 +12:00
5843de3251 Merge branch 'master' into blender2.8 2018-06-11 09:34:04 +02:00
7c10ed7e72 Cleanup: Remove the "all" parameter from "ANIM_OT_driver_button_edit"
This won't ever be used for this operator, as the "edit" operator should
only ever be used for dealign with a single driver - the one under the
cursor.
2018-06-11 19:27:53 +12:00
3122366b28 Overlays: Reserve space for a "Onion Skins" overlay
While we probably won't be getting a general purpose "Onion Skinning"
overlay anytime soon for meshes, etc. (at least not before the
depsgraph stabilises, and we also get geometry caching working),
for the Grease Pencil integration at least, it makes sense to move
GP objects to using a more general/future-proof solution, instead
of continuing to use a special/dedicated button in the header.

Currently the UI part of this is commented out. Also, the GP branch
doesn't need to move to this pre-merge. But, since 2.8 changes move
fast, it's better to reserve the space now to have it next to motionpaths,
than introduce it later.
2018-06-11 19:15:05 +12:00
4d67655348 Drivers UI: Don't show the Copy/Paste driver dvars buttons in the popovers
The copy/paste driver variables buttons currently only work when used in the
Graph Editor as they rely on being able to have the "active F-Curve" context
info that's only present in the Graph Editor (in Drivers Editor mode).
Instead of having them constantly greyed out in the popover, it's easier
to just hide them for now. Besides, this is probably more of an "advanced"
feature that we don't need to expose in the simple UI.
2018-06-11 19:15:05 +12:00
474a145d78 Fix T55349: crash adding paint slot when object is on hidden layer
use better poll and get ob with 'ED_object_active_context' (instead of
'CTX_data_active_object')

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D3467
2018-06-11 09:12:29 +02:00
d7373f6c49 Cleanup: warnings 2018-06-11 09:03:39 +02:00
1ff28c2650 Drivers UI Fix: Use uiLayoutSetContextFromBut() so that operators will work in the panel
This fixes the problem where the "Show in Drivers Editor" button would
not actually select and highlight the driver under the mouse.

(TODO: The channels still aren't getting selected properly in the
channels list, but at least the properties show correctly)
2018-06-11 18:55:29 +12:00
9ab26bec27 Driver Workflow (T55145): Tweak to default expression used for new drivers created from UI
Previously, newly created drivers were set to "Scripted Expression"
mode and had their 'expression' field set to the pre-driver value of the
property, so that adding a driver didn't cause the property to immediately
lose its old value (and potentially causing havok in the scene).
However, this had the unintended consequence of making the driver setup
workflow more cumbersome, as you first had to replace that value with
the name of the driver variable before your driver would work.

This commit works around this issue by trying to combine the best of both
worlds (quite literally):  Now, the driver expression for drivers created
using Ctrl-D will be "var + <old value>".

Thus, in the simplest case, the driver will do something as soon as you fill
out the driver variable settings (e.g. just filling out the Target Object field
will do it), meaning you get your drivers working faster. Of course, it may now
be necessary to edit out the old-value, and/or it might be a bit more confusing
what/why it's there for newbies. However, the improved ease of setup, and/or
a more tangible example of how an expression may be constructed outweigh the
downsides IMO.
2018-06-11 17:44:08 +12:00
4605e57b0f Drivers Workflow (T55145): Improvements to "Add Driver" workflow
This commit implements a new behaviour for the "Add Driver" functionality
(invoked from the RMB menu on a property, or by pressing Ctrl-D).

Instead of spawning a context menu asking you to pick the way
you want to create a driver, it will now just create a driver on the
property under the mouse and then show the "Edit Drivers" popover so
that you can immediately start editing the properties of this driver.
This way, the whole process is more visual and feels less blocking /
constrained, with less upfront decisions needed immediately.

Notes:
* The new behaviour is equivalent to choosing the "Manually Create (Single)"
  and then doing a "Edit Driver" on the property
* Renamed the old "ANIM_OT_driver_button_add" operator to
  "ANIM_OT_driver_button_add_menu". It will probably go away
  in the near future, but it's better to keep it around for a
  while longer still until the new workflow settles down.
2018-06-11 17:35:13 +12:00
f1e3e50294 Sub-panels for Cycles Depth of Field 2018-06-10 21:27:43 +02:00
865acd9247 Sub-panel for camera DoF for EEVEE 2018-06-10 21:06:49 +02:00
5290882bd5 Workbench: Xray: Fix hairs with matcaps. 2018-06-10 20:28:04 +02:00
20b0194cd3 Workbench: Xray: Make dithered depth dependant on alpha.
The range is 0.25 to 0.75 opacity when the Xray opacity is between 0.0 to 1.0.

This is to avoid loosing completely the sense of occlusion when having no
other solid drawing than the wireframe and loosing the transparency when
xray alpha is at 1.0.

Also replace Bayer (checkerboard) method by interlieved gradient noise to
minimize the chance to loose an occluded line completely.

Other noise function could be tested in the future.
2018-06-10 20:06:26 +02:00
542462d35c Workbench: Xray: Add selected/active non-occluded outlines
This Fix the problem when multiple objects are selected and one of them
occlude the others. You cannot see clearly what is selected.

With this option, selection is more clear when Xray mode is enabled.
2018-06-10 20:06:26 +02:00
e321fc4a7c Workbench: Xray: Make nearest surfaces more clear
By using equation 7 from the paper, we make the surfaces nearest to the
viewpoint appear more "opaque". This gives better sense of ordering than
the previous weighting function that was really not doing anything.
2018-06-10 20:06:26 +02:00
15862e1990 Workbench: Xray: Lower hairs opacity
Since hairs are very likely to owerflow the weight buffer, we divide their
alpha value by 3.

This might become a particle system setting if needed.
2018-06-10 20:06:26 +02:00
95894421cb Workbench: Xray: Optimize and fix implementation.
There was a method explained in the Weighted Blended Order-Independent
Transparency paper to support hardware that does not support per render
target blending function.

So now only 2 geometry passes are required instead of 3 (one being the
outline/depth fill pass).

This also fix how the blending is done. There was some premult confusion
in the implementation.
2018-06-10 20:06:26 +02:00
b23d5132a9 UI: Add redo last to edit-menu 2018-06-10 17:15:40 +02:00
9129319647 Experimental Tweak: Only show relationship lines between objects when either the parent/child object is selected
As in Pose Mode, the idea here it to try to reduce viewport complexity
without requiring users to turn off the overlay completely all the time.
For example, a background prop (e.g. a tree with a tyre hanging off it,
or a branch with hand-placed leaves) won't be cluttering the viewport with
its relationship lines all the time, when you're trying to do something else.

When you really do need to see these lines, you can still select the object
in question, and you'll see the lines for which objects are its children
or what its parent is. And to see all lines, you can still always select all
objects.
2018-06-11 02:49:38 +12:00
ca16c74e87 Viewport: "Show Relationship Lines" overlay toggle is now respected by Object Mode & Armatures (Edit/Pose) 2018-06-11 02:49:38 +12:00
937e4fb49a UI: change toolbar icon size from 38 -> 32 2018-06-10 16:42:19 +02:00
a978654977 UI: use property split for UV mask panel 2018-06-10 16:29:55 +02:00
4d1193feb3 UI: correct jitter button 2018-06-10 16:08:19 +02:00
87a71f36fc UI: use split property for tool settings
Patch by @billreynish w/ edits
2018-06-10 15:58:39 +02:00
c10f1379cd UI: remove tab use in the tool-settings 2018-06-10 15:40:02 +02:00
e5a0cf730a UI: use two columns for the overlay popover
Also use sub-panels.

Patch by @billreynish w/ edits.
2018-06-10 15:24:04 +02:00
afa45fb858 UI: Use flow layout for object properties context
Mainly as a proof of concept and test to use in other contexts.
2018-06-10 13:56:28 +02:00
a68bed06f6 Merge branch 'master' into blender2.8 2018-06-10 12:11:16 +02:00
d0a16772ad WM: add macros to check mouse button/gesture/wheel
Use to check click/drag,
fixes issue with mouse wheel triggering pie menu.
2018-06-10 12:08:09 +02:00
8314be7c89 Fix T55423: GLSL compilation error Flat + XRay 2018-06-10 11:51:07 +02:00
a52152c59f Merge branch 'master' into blender2.8 2018-06-10 08:21:50 +02:00
ae01df5779 Cleanup: trailing space in CMake files 2018-06-10 08:19:03 +02:00
dd67d703a7 Workbench: Fix material compilation. 2018-06-09 21:11:03 +02:00
147eef9741 Eevee: Improve compilation time (reduce branching).
This patch reduce the branching in the lamp loop, improving compilation time
noticeably (2372ms to 1785ms for the default shader).

This should not change the appearance of the shader.

Performance impact is negligeable.
2018-06-09 21:11:03 +02:00
45a5ddb57b Merge branch 'master' into blender2.8 2018-06-09 18:58:14 +02:00
2e14b7fb97 RNA: remove Layout.introspect
This was added as an experiment to extract information for docs
but this was never all that useful for its intended purpose.
2018-06-09 18:55:51 +02:00
419a813938 Merge branch 'master' into blender2.8 2018-06-09 18:48:11 +02:00
83cb34ccd1 Cleanup: unused functions 2018-06-09 18:47:39 +02:00
726ed7244e UI: always show popover subpanel header text 2018-06-09 18:15:08 +02:00
2ae404252d UI: fix popover subpanel header display 2018-06-09 18:03:22 +02:00
7fdde7fd86 UI: use draw_header function for popover buttons
Add 'is_popover' for panel draw functions to check if they're in a popup.
This puts dyntopo toggle next to the popover.
2018-06-09 17:38:32 +02:00
ec8a20fec0 Add new GridFlow layout.
This mimics the 'spreadsheet' behavior. Columns and/or rows can have
equal sizes, or adapt to their content - but always in a grid way (i.e.
all items in a same column will always have same available width, and
all items in a same row will always have same available height).
Also, you can fill (order) the grid in a row- or column-major way.

Not used anywhere for now.

Differential: https://developer.blender.org/D2395
2018-06-09 16:54:26 +02:00
5159ce640f Cleanup: style 2018-06-09 16:39:40 +02:00
70f8eaf1b7 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2018-06-09 15:18:21 +02:00
638de72277 Cleanup: remove some G.main usages. 2018-06-09 15:17:04 +02:00
2ca8230f67 Merge branch 'master' into blender2.8 2018-06-09 14:43:01 +02:00
fb565ddb68 Cleanup: trailing space in RNA 2018-06-09 14:40:09 +02:00
56a47e58f4 Cleanup: style 2018-06-09 14:30:32 +02:00
09ce794dc8 UI: initial support for parent panels in popovers
Currently this just includes the panels, no support for collapsing yet.
2018-06-09 14:21:39 +02:00
8f40af6dcd RNA: revert object mode re-order
This was done so numbered shortcuts made sense.
Now order matches master.
2018-06-09 12:57:15 +02:00
964c5421df Merge branch 'master' into blender2.8 2018-06-09 12:56:37 +02:00
9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
3bbef95747 Workbench: Fix xray normal not being normalized. 2018-06-09 12:44:56 +02:00
337aab59e9 Workbench: Matcaps: Fix matcap under perspective.
This fixes the problem that matcaps have when using a very larg FOV in
perspective view.

This was because it was stupidly using the normal direction which can not
aligned with the view vector under perspective.

So to workaround this problem we don't use the normal as is, but compute
how much it's facing the camera.

This changes how matcaps looks in perspective because they now always use
the full range of the matcap (which is expected).
2018-06-09 12:44:56 +02:00
a1b42b79b3 Workbench: Fix incident vector calculation.
This fixes specular in perspective view.
2018-06-09 12:44:56 +02:00
7ce81484f8 Merge branch 'master' into blender2.8 2018-06-09 12:06:33 +02:00
6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
b492a0e767 Merge branch 'master' into blender2.8 2018-06-09 11:27:22 +02:00
f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
03f0ecca93 GHOST/X11: Map unknown us.intl key to accentgrave 2018-06-09 09:10:04 +02:00
86660aa294 Layout for materials closer to single column 2018-06-08 23:56:39 +02:00
dd2e187344 Audaspace: add support for latest ffmpeg. 2018-06-08 23:11:16 +02:00
528dc6440b Merge branch 'master' into blender2.8 2018-06-08 22:19:39 +02:00
5165d62931 WM: correct recent change to click/drag detection
fb1915d870 - caused click/drag events not to be detected.

Now check a key is a mouse or keyboard event.
2018-06-08 22:17:21 +02:00
d1ab958fd4 Merge branch 'master' into 28 2018-06-08 19:03:37 +02:00
4f2eac3b39 WM: fix panel drag event handling 2018-06-08 19:03:29 +02:00
bf77efb684 WM: fix node link & background drag 2018-06-08 19:03:29 +02:00
1857823839 WM: fix panel drag event handling 2018-06-08 18:58:41 +02:00
2dc7555522 WM: fix node link & background drag 2018-06-08 18:55:47 +02:00
Dalai Felinto
f8d7df6f16 Depsgraph: Remove no longer needed nodetree values copying on eval
Note: Depsgraph still calls the nodetree eval function that doesn't
nothing in turn. We can remove it, but it is harmless though.
2018-06-08 17:52:49 +02:00
f2fd5987d0 UI: clear properties color when empty 2018-06-08 17:30:00 +02:00
3e86bb2d0b Sculpt/Paint: move PBVH building to use evaluated mesh instead of deprecated Derivedmesh.
Pretty straightforward changes, merely mimicking dm-related code,
which was already essentially using either Mesh or BMesh data to
build the PBVH...

Note that we "lose" the subsurf (a.k.a. grid) PBVH case here, but that
one was already dead code in current blender2.8, since final dm is
always a cddm built from evaluated mesh.

Proper fix is pending new code for subsurf/multires area.
2018-06-08 17:23:25 +02:00
1ce55693f5 UI: remove tools space type, use properties context
We've decieded to use tools context in properties editor.
2018-06-08 16:35:05 +02:00
Dalai Felinto
9d59d20957 DRW: Fix animated material not refreshing
This introduces a garbage collection system similar to gpu_texture.
2018-06-08 16:29:33 +02:00
0417f205f5 Fix crash with wertex and weight modes
Similar to recent sculpt mode.
2018-06-08 16:24:07 +02:00
Dalai Felinto
f638ad61b8 Rename: GPU_material_get_uniform_buffer > GPU_material_uniform_buffer_get 2018-06-08 16:20:34 +02:00
Dalai Felinto
856a79e1fb Rename: GPU_texture_orphans 2018-06-08 16:20:34 +02:00
cbbf8bbbb4 Workbench: XFlip Matcap per 3D View
Note: Icons are not yet updated.
2018-06-08 16:13:49 +02:00
Julian Eisel
fc85096dc8 Fix T55387: Render fullscreen from top menu crashes Blender
Would try to use data from global area for the newly created fullscreen area.
This should not happen, so instead of a global area use first area from layout.
2018-06-08 15:59:34 +02:00
4df45e18dc Alembic: replaced BLI_assert() with comment why the assert is wrong
The comment also hints at what should be fixed, instead.
2018-06-08 15:51:49 +02:00
249a41bc7c Alembic: slight clarifications 2018-06-08 15:51:49 +02:00
ba31c4d684 Alembic export: get evaluated object when exporting shape 2018-06-08 15:51:49 +02:00
2a771cbc58 Alembic: Moved a BLI_assert
The assert should only be triggered when assigning a pointer, and not
simply when checking the pointer.
2018-06-08 15:51:49 +02:00
335e030753 mesh_get_eval_final() should check ob->runtime.mesh_eval
It has nothing to do with ob->derivedFinal, which it checked before.
2018-06-08 15:51:49 +02:00
934b9e80d0 Add check in BKE_pbvh_apply_vertCos that number of deforming cos matches number of pbvh vertices.
This shall help catching issues in future.
2018-06-08 15:43:57 +02:00
06357b23a2 Fix T55404: Auto key with only-available doesn't work 2018-06-08 15:43:04 +02:00
9f2447cbd8 Code cleanup 2018-06-08 15:35:25 +02:00
70b3fb3781 Workbench: Custom StudioLight UI 2018-06-08 15:34:46 +02:00
6739bb195e Merge branch 'master' into blender2.8 2018-06-08 15:22:28 +02:00
540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
0dd9a9e66a Alembic: fixed MSVC incompatibility 2018-06-08 15:09:10 +02:00
f504306671 Workbench: Default specular settings when no materials are used 2018-06-08 15:07:30 +02:00
97e7d9f90b Merge branch 'master' into blender2.8 2018-06-08 14:57:17 +02:00
d97df0d0e6 Cleanup: unused var, trailing space 2018-06-08 14:56:09 +02:00
4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
e36ecb8a66 Alembic unit tests: fixed compiler errors
This doesn't mean the code is correct, but at least it builds.
2018-06-08 14:48:50 +02:00
94aa4d1657 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_sequencer.h
	source/blender/blenkernel/intern/sequencer.c
	source/blender/editors/curve/editcurve_paint.c
	source/blender/editors/gpencil/gpencil_edit.c
	source/blender/editors/gpencil/gpencil_paint.c
	source/blender/editors/gpencil/gpencil_utils.c
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_view3d.h
	source/blender/editors/interface/interface_eyedropper_depth.c
	source/blender/editors/render/render_opengl.c
	source/blender/editors/sculpt_paint/paint_image_proj.c
	source/blender/editors/sculpt_paint/sculpt.c
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_draw.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_intern.h
	source/blender/editors/space_view3d/view3d_select.c
	source/blender/editors/space_view3d/view3d_utils.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/editors/transform/transform_snap.c
	source/blender/python/intern/gpu_offscreen.c
	source/blender/windowmanager/intern/wm_files.c
2018-06-08 14:38:57 +02:00
ae3e59fb61 Fix T55380: Crash when getting out of EditMode in some cases
Derived meshes are to be dead, so soon this code will be removed as well.
2018-06-08 14:38:01 +02:00
aff6cc9cf1 Workbench: Lights user pref 2018-06-08 14:30:32 +02:00
fb1915d870 Prevent wheel causing spurious click/drag events 2018-06-08 14:09:45 +02:00
33437719c1 Alembic import: fixed memory management for CoW copies of CacheFile blocks
When a CacheFile datablock is copied to an in-main datablock, it means that
the new copy should be independent of the old copy. In this case certain
properties are reset/duplicated. When it is copied to a no-main datablock,
we assume this is a copy-on-write copy that's used for evaluating things,
in which case the handle and object paths are referenced instead of
reset/ duplicated. This prevents us from re-opening the Alembic file every
time a new CoW copy is made.

The same approach is taken when freeing data (only when an in-main datablock
is freed do we actually free the data).
2018-06-08 13:52:53 +02:00
0c7fc3a961 Alembic import: assign cache_file handle to original datablock 2018-06-08 13:52:53 +02:00
7b6af843c2 Cleanup: getting rid of G.main.
Sometimes one needs a *lot* of changes for a single G.main... :/
2018-06-08 12:17:22 +02:00
c5904574cb Fix T55391: Anim render only shows scene state at current frame (no animation) 2018-06-08 12:12:52 +02:00
3926ec6aa1 Studiolight: Segment when using float based matcaps 2018-06-08 12:11:05 +02:00
1f1e26f1ab Depsgraph: Fix missing relations when camera has drivers 2018-06-08 12:04:53 +02:00
d38c7db5e1 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
4017b48331 Depsgraph: Don't optimize out collections used by duplication system
This makes evaluated objects to point to a non-evaluated collection,
which is already really bad. What is even more worse, objects in those
collections are not evaluated either.

Proper solution would be to implement visibility flag for nodes, which
will be set to 0 for transform/geometry components, but which will be
1 for copy-on-write components.

This way we will guarantee consistency of dependency graph.

For now this change is good enough and unlocks production.

Fixes T55375: Crash when changing visibility of instanced collection
Fixes T55357: Particle geometry crash
2018-06-08 11:57:16 +02:00
378e42e119 Depsgraph: Cleanup, indentation 2018-06-08 11:57:16 +02:00
9600c7cb05 Depsgraph: Cleanup, make conditions more clear and less indented 2018-06-08 11:57:16 +02:00
691282e571 Alembic export: create render-evaluated depsgraph for exporting
Previously the context depsgraph was used, which (most likely) uses
viewport evaluation instead of render evaluation.
2018-06-08 11:53:03 +02:00
55606dbdbc CMake: disable WITH_COMPILER_ASAN for CMAKE_BUILD_TYPE Release 2018-06-08 11:45:53 +02:00
346a1d445e Cleanup: redundant check 2018-06-08 11:28:42 +02:00
0297274720 Merge branch 'master' into blender2.8 2018-06-08 10:54:51 +02:00
dff8a7db73 Fix regression in grease pencil drawing
Drag events finished drawing early.
2018-06-08 10:52:49 +02:00
b3c8ffcb3e Workbench: UI for custom studio lights/matcaps
- all known image types are supported
- BpyAPI for studiolights added
- added open user pref operator in shading menu
- possible to add multiple files in a single run

For now refreshing studio lights will free all studiolights and reinit
the whole mechanism. This can be improved by only freeing deleted, reset
updated and add new custom studiolights.

details to show currently only shows the path we perhaps want to add
other information also
2018-06-08 10:41:24 +02:00
4d16d00154 Keymap: continued testing/development (search key)
Use Accent/Grave for search, to be more convenient than F-Keys.

This sets F3 back to what it was before.
2018-06-08 10:07:41 +02:00
3d681108bf Merge branch 'master' into blender2.8 2018-06-08 08:50:13 +02:00
20367898fe Fix T55301: Transform confirm on release fails w/ MMB 2018-06-08 08:48:21 +02:00
e3fe8ce00b WM: backport event/keymap type util from 2.8 2018-06-08 08:46:31 +02:00
908b6960c0 Merge branch 'master' into blender2.8 2018-06-08 08:10:35 +02:00
a25c11fd8d Cleanup: trailing space
Remove from blender/nodes, collada, blenfont & render.
2018-06-08 08:07:48 +02:00
d352a0adc5 Merge branch 'master' into blender2.8 2018-06-08 08:02:50 +02:00
009c38df53 Fix recently added drag events closing menus 2018-06-08 08:01:43 +02:00
8b5ce6e843 Transform: fix non-3D view editmode assert 2018-06-08 06:31:40 +02:00
30cd35a37b Keymap: continued testing/development
After testing in the studio and extending the event system for
drag events, we've agreed on adjustments to the new keymap,
see: T55162

- Tab: Edit-mode toggle.
- Tab + Cursor Drag: mode switching pie menu.
- Accent/Grave: for 3D view pie menu.
- F3: Search
- 1..3, Shift-1..3: Edit mesh vertex/edge/face toggle.

Other minor changes were made, however they aren't part of the design.

- Ctrl-Shift-S: Image editor Save-As (was F3)
- Ctrl-Alt-R: Repeat history (was F3)
2018-06-07 20:46:12 +02:00
cfc4805455 Merge branch 'master' into blender2.8 2018-06-07 20:41:10 +02:00
8f49299134 WM: fix drag events applying after release 2018-06-07 20:39:17 +02:00
cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
Dalai Felinto
18e316bcb9 Uniform Buffer Objects: Simplification refactor
Since we are only creating this and never updating, there is no need for
the original approach with the individual data to be updated.

Note we only populate the GPU data when binding the UBO, so we can in the
future easily create the UBOs in a separate thread than the main drawing one.

Also at the moment animated materials are not working. To fix that we need
to free/tag for free the GPUMaterials in BKE_material_eval.
2018-06-07 20:34:00 +02:00
Dalai Felinto
57da454872 Uniform Buffer Object: No more dirty tagging calls/check 2018-06-07 19:42:03 +02:00
Dalai Felinto
1962ae69b1 Rename GPU_material_create_uniform_buffer > GPU_material_uniform_buffer_create 2018-06-07 19:40:47 +02:00
Dalai Felinto
56f2293a51 GLSL: No need to extract the UBO dynamic inputs 2018-06-07 19:40:08 +02:00
Dalai Felinto
e5bc37eb5e Don't tag UBO as dirty anymore otherwise it still crashes on render 2018-06-07 19:19:39 +02:00
Dalai Felinto
d17094b256 BKE_world_eval: cleanup 2018-06-07 19:16:26 +02:00
Dalai Felinto
85e2871382 No more need to tag sss as dirty for EEVEE
And for the records, this shoudn't have been added to the
GPU_material_uniform_buffer_tag_dirty function since they are unrelated.
2018-06-07 19:13:23 +02:00
d32b59fc18 Remove more printfs .... 2018-06-07 19:06:56 +02:00
630019d5f8 Alembic export: use depsgraph to get evaluated mesh/object 2018-06-07 19:01:45 +02:00
28817c82f1 Alembic export: no need to check particle's mesh_final on export
Hair writing is still not working properly, though, but at least now
samples are written at all.
2018-06-07 19:01:45 +02:00
9a873d0ab2 Alembic import: don't crash Blender when reading invalid samples 2018-06-07 19:01:45 +02:00
5852c66125 Alembic hair writer: avoid double-free 2018-06-07 19:01:45 +02:00
20d3ce57d0 Alembic export: cleaned up multiply-passed depsgraph & scene
Those can now solely be found in the ExportSettings object.
2018-06-07 19:01:45 +02:00
ef7b7efd11 Eevee: Fix hair not rendering. 2018-06-07 18:58:13 +02:00
3b556a477d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_vertex.c
	source/blender/editors/sculpt_paint/sculpt.c
	source/blender/editors/sculpt_paint/sculpt_undo.c
2018-06-07 18:45:45 +02:00
5593baea1b Remove printfs
... it's getting late here.
2018-06-07 18:44:37 +02:00
0859492c75 Fix crash cause by SSS referencing Material Nodetree data. 2018-06-07 18:43:43 +02:00
a3773dcc4f Fix memleak with GPUhairs. 2018-06-07 18:43:10 +02:00
80dcb2ced8 Cleanup: typo, and 0 -> false for booleans. 2018-06-07 18:36:16 +02:00
00233f5f78 Wireframe: Fix edges or non manifold meshes not showing.
This will show the associated edges to the vertices but that's the only
workaround I can think of right now.
2018-06-07 18:01:36 +02:00
f9ca750bdf Wireframe: Change / Optimize the limited wireframe visibility option.
This make the limited wireframe not a performance problem anymore.

However, this does change the number of edges displayed as the threshold
is now computed per vertex instead of per edges.

For this reason we extended (internaly) the range of the slider so that the
users can hide more edge.
2018-06-07 18:01:36 +02:00
3823287179 Merge branch 'master' into blender2.8 2018-06-07 17:08:55 +02:00
d274c64d22 WM: add support for drag events
This allows for a single key to be mapped to both release and drag,
useful for pie menus to share a key with a different action.
2018-06-07 17:06:01 +02:00
8dc33a81b0 Merge branch 'master' into blender2.8 2018-06-07 16:53:31 +02:00
df4525d1d9 Fix key repeat events resetting the click timer 2018-06-07 16:52:40 +02:00
f0815b1322 Merge branch 'master' into blender2.8 2018-06-07 16:45:34 +02:00
863e395ad8 Cleanup: trailing space for windowmanager 2018-06-07 16:43:52 +02:00
fcc5d7c29e Draw: Fix crash when tryign to get procedural textures with modifier disabled
Maybe disabled modifier check should be done higher in the call hierarchy.
2018-06-07 16:40:15 +02:00
64e0ab6a00 Merge branch 'master' into blender2.8 2018-06-07 16:32:40 +02:00
86aaa3efba Fix T55126: COW problem: there is an active object even if unselectable 2018-06-07 16:31:10 +02:00
e19686a35a WM: check for release instead of not pressed
Makes reasoning about events more predictable.
2018-06-07 16:19:59 +02:00
819ad49d29 Cleanup: typo. 2018-06-07 16:02:55 +02:00
1e4722eeab Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/transform/transform_generics.c
2018-06-07 15:41:57 +02:00
8a2db3ed21 Fix crash due to missing init of new bAnimContext bmain member in transform code.
From own previous G.main-busting commit.
2018-06-07 15:38:31 +02:00
d9d3e7778c Fix sculpt mode undo (COW update needed) 2018-06-07 15:15:54 +02:00
a3f520170c Merge branch 'master' into blender2.8 2018-06-07 14:58:57 +02:00
6242940639 Fix double free in dyntopo-sculpt mode undo 2018-06-07 14:54:09 +02:00
a16d835f7b Wireframe: Frustum cull them. 2018-06-07 14:50:01 +02:00
8366c3ecd8 Depsgraph: Ensure collections are up to date after modifications
Before that copied collection in copy-on-write were running out
of sync with original ones. This was causing crash with the
following scenario:

- Delete some objects from scene
- Add particle system to an object
- Change particle mode to Hair

Thanks Dalai for debug session! Pair programming ftw!
2018-06-07 14:41:29 +02:00
30ec94561c Depsgraph: Use more proper relations for scene relation 2018-06-07 14:41:29 +02:00
da8d33e2e3 Merge branch 'master' into blender2.8 2018-06-07 13:41:32 +02:00
5330f1c5d1 Fix sculpt assert on initialization 2018-06-07 13:39:49 +02:00
c63f804222 Armature: Fix flickering outline on planar custom bones. 2018-06-07 13:38:17 +02:00
508e34d0bf Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/animation/anim_deps.c
	source/blender/editors/animation/keyframing.c
	source/blender/editors/animation/keyingsets.c
	source/blender/editors/armature/pose_edit.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/gpencil/gpencil_convert.c
	source/blender/editors/include/ED_anim_api.h
	source/blender/editors/include/ED_keyframing.h
	source/blender/editors/interface/interface_anim.c
	source/blender/editors/space_action/action_edit.c
	source/blender/editors/space_graph/graph_edit.c
	source/blender/editors/space_outliner/outliner_draw.c
	source/blender/editors/transform/transform_conversions.c
	source/blender/makesrna/intern/rna_armature.c
	source/blender/makesrna/intern/rna_pose.c
	source/blender/python/intern/bpy_rna_anim.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
	source/gameengine/Converter/KX_BlenderSceneConverter.cpp
2018-06-07 13:04:16 +02:00
4e014727f6 Armature: Fix missing loose edges on custom bone shapes. 2018-06-07 12:58:23 +02:00
Dalai Felinto
3126f85d26 Fix T55062: Depsgraph: Crash with COW with EEVEE viewport
We now remove the shader for every update.

So at the moment the whole point of UBO (Uniform Buffer Objects) is that they
are more efficient than individual uniforms.

Next steps is a harmless refactor to stopping UBO from referring to original
data in the UBO, and simply copying it.

It would also be interesting to make the final shader more granular as far as
the library and required functions are concerned. Even if this doesn't impact
performance, it should give us smaller easy to debug shaders
(a simple shader now has > 5k lines!).

If performance for animated values is measureable slower after this commit we
can port the shader creation CPU side to the depsgraph - localizing the tree,
hashing, lookup, ...

Additionally we can stick to update the UBO when the material changes but not
its topology. This is very trick because of localized trees. So we will only
re-visit this if profiling hints at any benefit from it.
2018-06-07 12:56:34 +02:00
b3a7a75a26 Cleanup: remove moar G.main usages.
Notes:
* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)
2018-06-07 12:48:29 +02:00
d1474371fa Fixed deadlock on viewlayer update when there are drivers
When calling the bpy.ops.poselib.apply_pose() operator from Python, Blender
would deadlock when the rig has drivers.

Similar BPy_{BEGIN,END}_ALLOW_THREADS calls were already in place in the
rna_Scene_update_tagged() function.
2018-06-07 12:37:55 +02:00
a867e63dd6 Rename "Viewport Display SSAO" sub-panel name to Screen Space Ambient Occlusion
Since it is already a sub-panel of Viewport Display anyway
2018-06-07 12:08:40 +02:00
cdbda1c3d8 GPUPass: Refactor gpupass caching system to allow fast gpumaterial creation.
This is part of the work needed to refactor the material parameters update.

Now the gpupass cache is polled before adding the gpumaterial to the
deferred compilation queue.

We store gpupasses in a single linked list grouped based on their hashes.
This is not the most efficient way but it can be improved upon later.
2018-06-07 12:02:42 +02:00
366ac88d68 Merge branch 'master' into blender2.8 2018-06-07 12:01:09 +02:00
16017178b2 Revert "Cycles: Cleanup: Don't use return on function returning void"
Not sure why exactly it is called a cleanup, the code was much more clear
and robust against possible missing return statements which are MANDATORY.

Missing return statement will:

- Cause two different BVH traversals to be run.

  Not is happening currently, but if more BVH layouts are added, it will
  become a problem.

- It is already causing assert() statements to fail, since functions are
  no longer returning when they are supposed to.

If there is any measurable reason to keep this change, let me know.
Otherwise just stick to reliable/tested/robust code.

This reverts commit ba65f7093b.
2018-06-07 11:57:57 +02:00
a54235e0c6 Particle mode: Support children drawing
The issue is that children drawing is done by object mode,
which operates with data from evaluated context. But that
data needs edit mode's cache to be properly updated first.
2018-06-07 11:31:56 +02:00
613faa0987 Draw: Don't take cache existence into account for draw type 2018-06-07 11:31:56 +02:00
72cfd5134b Draw: Use proper continue when psys is disabled 2018-06-07 11:31:56 +02:00
1aa89d9a1c Particle edit: Simplify code by benefiting from single edit context
Makes ADD brush to work.

At some point children particles draw got broken, children are not
visible for until first stroke is done. Still looking into it.
2018-06-07 11:31:56 +02:00
df0253be33 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/ArmatureExporter.cpp
	source/blender/collada/ArmatureExporter.h
	source/blender/collada/DocumentExporter.cpp
	source/blender/collada/DocumentExporter.h
	source/blender/collada/SceneExporter.cpp
	source/blender/collada/SceneExporter.h
	source/blender/collada/collada.cpp
	source/blender/collada/collada.h
	source/blender/editors/armature/armature_edit.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/include/ED_armature.h
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_screen.h
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/screen/screen_ops.c
	source/blender/windowmanager/intern/wm.c
	source/blender/windowmanager/intern/wm_files.c
	source/blender/windowmanager/intern/wm_window.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-07 11:23:26 +02:00
54f9cd5283 Cleanup: Nuke moar G.main usages... 2018-06-07 11:11:46 +02:00
e27759152a Minor comment on possible TODO while validating paint ops for CoW... 2018-06-07 10:59:21 +02:00
e43065596b Alembic export: CoW/Depsgraph fixes 2018-06-07 10:48:52 +02:00
d88314ee5b Alembic export: port DerivedMesh → Mesh 2018-06-07 10:48:52 +02:00
5b0f96f97c Alembic import: port DerivedMesh → Mesh 2018-06-07 10:48:52 +02:00
f447411a82 Bone selection: user control contrast
Experiment: let the user be in control of the alpha channel as some rigs
are hard too see during bone selection. Especially rigs that were
designed for 2.79 wireframe mode.
2018-06-07 09:26:06 +02:00
7fb216d800 Workbench: respect the duplication visibility flag 2018-06-07 09:26:06 +02:00
2d2f23de10 Fix T55348: Renaming a marker can't cancel
Regression in a14005c070
2018-06-07 08:54:47 +02:00
a60d4f33c6 Merge branch 'master' into blender2.8 2018-06-07 08:15:11 +02:00
409cfba1a3 Python API: Initial 'imbuf' API
Support only basic operations new/load/write & resize.

Add now so we can extend as needed & more easily accept patches.
2018-06-07 08:00:13 +02:00
ba80d8440f Cleanup: style 2018-06-06 22:17:06 +02:00
1c4b04f1fd Merge branch 'master' into blender2.8 2018-06-06 19:52:20 +02:00
0e68751b8a Fix BLI_ASSERT_UNIT macro w/ non-finite numbers 2018-06-06 19:49:27 +02:00
70b705b5fe UI: NLA: Influence should be a factor (RNA) 2018-06-06 12:09:13 -04:00
4165a57a66 Fix broken auto-keying after copy/paste of poses.
That bug was also likely affecting other cases - basically it was making
auto-keying always key from evaluated ('visual') values, never base,
data values... Added a flag, in some cases we do want evaluated values
here, obviously.
2018-06-06 17:19:13 +02:00
Dalai Felinto
f818ff411a Cycles: use viewport duplicator visibility on preview 2018-06-06 16:44:51 +02:00
Dalai Felinto
04dfca5b9d Depsgraph: Expose (evaluation) mode in rna 2018-06-06 16:44:51 +02:00
Dalai Felinto
4e213d4216 Depsgraph iterator: Remove explicit mode
We can get the mode from the depsgraph itself.
2018-06-06 16:44:51 +02:00
Dalai Felinto
9a0506ea18 Fix T55350: Cycles: instanced hair with hidden emitter is invisible when rendering 2018-06-06 16:44:07 +02:00
36000e6da3 Cleanup: unused function 2018-06-06 16:36:00 +02:00
c44acc7fb8 Fix view_layer update function
This was no longer working, now this works the same way as
scene.update(), only it applied to the current view layer.

Caused crash running alembic export from Python.
2018-06-06 16:33:34 +02:00
0ee4785675 Cleanup: get rid of just-added G.main usage.
Was just added to ease merging of master, proper code now!
2018-06-06 16:32:09 +02:00
bb7202495a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/collada/ArmatureExporter.cpp
	source/blender/collada/ArmatureExporter.h
	source/blender/collada/DocumentExporter.cpp
	source/blender/collada/DocumentExporter.h
	source/blender/collada/SceneExporter.cpp
	source/blender/collada/SceneExporter.h
	source/blender/collada/collada.cpp
	source/blender/collada/collada.h
	source/blender/editors/armature/armature_edit.c
	source/blender/editors/armature/editarmature_retarget.c
	source/blender/editors/armature/pose_transform.c
	source/blender/editors/include/ED_armature.h
	source/blender/editors/include/ED_object.h
	source/blender/editors/include/ED_screen.h
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/screen/screen_edit.c
	source/blender/editors/screen/screen_ops.c
	source/blender/windowmanager/intern/wm.c
	source/blender/windowmanager/intern/wm_files.c
	source/blender/windowmanager/intern/wm_window.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-06 16:25:28 +02:00
19d651ca9a View3DShading popover: Naming + alignment 2018-06-06 16:17:07 +02:00
d706101559 Depsgraph: remove legacy code for dupli group updates.
This caused crashes in some cases, and should be fully handled by
the depsgraph now.
2018-06-06 16:00:25 +02:00
bb09556be5 UI: sub panel titles draw smaller and indented. 2018-06-06 16:00:25 +02:00
f55f418867 Fix incorrect double checked lock in collection object cache. 2018-06-06 16:00:25 +02:00
f884ba02a2 Merge branch 'master' into blender2.8 2018-06-06 15:58:18 +02:00
de702a4803 Alembic export: only free duplilists when not NULL 2018-06-06 15:54:03 +02:00
48e871ab1d Cleanup: Nuke moar G.main usages... 2018-06-06 15:50:24 +02:00
fcf720a135 View3D: Shading Popup
- layout so cavity options are better visible
- fixed issues showing wrong options in Material mode
- added labels + seperators
2018-06-06 15:44:00 +02:00
89042f576e LookDev: When HDRI could not be reloaded we should switch to world
Thanks for reporting sergey!
2018-06-06 15:26:09 +02:00
7fee5f5643 Fix object-dupli selection w/ COW 2018-06-06 15:24:27 +02:00
f1fd5ed74f T55333 Workbench: Cavity Shader
A cavity shader based on SSAO. Works on all workbench deferred passes.

Per 3d viewport the cavity shader options can be set as different
shading needed different options. Some global options are in the
Viewport Display of the scene like num samples and distance.

Experimental: Naming of Ridges and Valleys
2018-06-06 14:51:18 +02:00
4a52531a11 Alembic: Fix double-free of mutex
The mutex was shared between CoW copies of the CacheFile datablock, and
as a result also freed multiple times. It is now only freed when the
original datablock is freed; the CoW copies share the same mutex.
2018-06-06 14:38:17 +02:00
4c4fa3d49b Fix double-free of custom data
This causes a temporary spike in memory usage when creating a copy; the
entire copy will be removed anyway when DerivedMesh is removed.
2018-06-06 14:38:17 +02:00
3b8ae85e3d Move Time Remapping into a sub-panel 2018-06-06 14:28:35 +02:00
a8ae68aa5c Fix crash when file is saved in particle edit mode
Depsgraph is not available on file load yet.
2018-06-06 14:13:46 +02:00
2088bb0d49 UI: add particle brush to topbar 2018-06-06 14:06:45 +02:00
b58e5d4f2c Particle edit: Fix missing hair with new oarticle system added 2018-06-06 13:54:39 +02:00
1295e85de0 Particle edit: Fix crash when trying to edit particles without cache
Particles in EMITTER mode needs to have cache.
2018-06-06 13:54:39 +02:00
528cdf9b50 Fix update issue in VPaint mode.
Need to flush the changes through DEG CoW, otherwise drawing code would
not see them in some cases...
2018-06-06 12:42:01 +02:00
e3324c3a8e Depsgraph: Silence relations builder errors
Were caused by depsgraph trying to create relations between objects
which are coming from restricted collection.
2018-06-06 12:36:52 +02:00
22370929fe Depsgraph: Expand object data datablocks for drivers
Drivers can reference object data datablock directly, and if there
was no object in the scene with that datablock, blender will crash.
2018-06-06 12:36:52 +02:00
7810c60fe3 Depsgraph: Handle key->object relations from object builder 2018-06-06 12:36:51 +02:00
695747aad1 Depsgraph: Object data separation, armature 2018-06-06 12:36:51 +02:00
5a14af62d0 Depsgraph: Object data separation, geometry 2018-06-06 12:36:51 +02:00
82ec06cbfa Depsgraph: Object data separation, camera 2018-06-06 12:36:51 +02:00
ca7de1ff22 Depsgraph: Object data separation, lamp 2018-06-06 12:36:51 +02:00
1a0cb28ae2 Depsgraph: Object data separation, light probes
This is a beginning of series of commits which will clearly separate
building IDs which are used as object data from object building.

The goal is to be able to always build whatever ID. Required to make
driver targets to work reliably with copy-on-write concept.
2018-06-06 12:36:51 +02:00
180e8f8bfb Depsgraph: Remove confusing metaball logic
DATA datablock must evaluation must never depend on object it is
used for. If there is something what depends on an object, it must
be done on object level.

At least the actual callback was empty.
2018-06-06 12:36:51 +02:00
9f255db4fe Wireframe: Fix do_version. 2018-06-06 12:32:30 +02:00
7a76223f1f Ensure BKE_mesh_new_nomain_from_template() always has valid mxxx pointers
When the source mesh doesn't have the primary layers (CD_VERT for vdata,
etc.) the returned mesh also didn't have those layers, even when non-zero
elements were requested (for example requesting 4 vertices would still
result in mvert = NULL).
2018-06-06 12:27:25 +02:00
8a0e6a3143 Consolidated custom data layer initialisation
Code shared between BKE_mesh_new_nomain() and
BKE_mesh_new_nomain_from_template() is now in separate functions, instead
of copy-pasted.
2018-06-06 12:27:25 +02:00
5e180ebffc Set mesh->totface in nomain-mesh creation
The totxxx fields should match the number of elements in their respective
custom data layers.
2018-06-06 12:27:25 +02:00
c4ce4034e6 Fix T55344: linked collection instance has user count 0. 2018-06-06 11:22:17 +02:00
3e87c039ba UI: tweak for Cycles panels. 2018-06-06 11:22:17 +02:00
1d86bdf16b Cleanup: fix compiler warning. 2018-06-06 11:22:17 +02:00
03b8e4f608 Fix importing temporary screens
Apparently Blender 2.79 could save temporary screens; those should not be
converted to workspaces.
2018-06-06 11:13:11 +02:00
23db3a5ade Renamed BKE_nomain_mesh_xxx → BKE_mesh_nomain_xxx
This maintains the `BKE_mesh_` prefix for the mesh-related BKE functions.
2018-06-06 10:30:24 +02:00
783d31c3a3 DerivedMesh deprecation: Removed some functions in displist.c
Those functions were using DerivedMesh but are not called from anywhere.
As a result, they cannot be tested after porting DerivedMesh to Mesh.
2018-06-06 10:11:31 +02:00
abccde4d68 DerivedMesh deprecation: marked no-longer-in-use function
Functions that are no longer in use can be marked as such, so that later
we can easily remove them.
2018-06-06 10:11:31 +02:00
5f543915e8 Modifiers: ported curve_calc_modifiers_post() internals from DerivedMesh → Mesh
The function still returns a DerivedMesh, but internally it uses Mesh
now.
2018-06-06 10:11:31 +02:00
274453ef73 Error in recent popover keep_open option 2018-06-06 09:43:03 +02:00
a9f9236670 Merge branch 'master' into blender2.8 2018-06-06 09:39:35 +02:00
bfbd85e9d6 Fix error using freed bmain
Regression in 481cdb08ed
2018-06-06 09:36:50 +02:00
ab375079df Cleanup: rename WITH -> USE for internal defines 2018-06-06 09:29:54 +02:00
6ff89166a8 Cleanup: USE_UI_* prefix for UI defines
Otherwise there is no quick way to see where this comes from.
2018-06-06 09:27:23 +02:00
52502ad0a4 UI: WM_OT_call_panel option to keep popovers open 2018-06-06 09:24:51 +02:00
14251d4615 Workbench: Speed up fo scene with many duplis
The ObjectID pass was generating per material per dupli a specific
number for the outline what results in a GPU context switch. In spring scene
01-050 a scene with many trees (duplis) generated 28000 GPU materials.

Now only new materials are created when objectid pass is enabled. Also
added a hard limit to the number of objects for the objectid pass (255)
Basically the outline between objects will not be drawn, but it will be
very hard to detect them also.

Also fixed for XRay mode.
2018-06-06 08:50:12 +02:00
1889eec918 UI: use regular size icons for toolbar popup
Test this since the popup feels disruptive/flashing when its too large
when set smaller it looks closer to a menu w/ key-accelerators which is
the intention in this case.

It's also more likely the active tool can be placed under the cursor.
2018-06-06 08:32:25 +02:00
c1a880bc5e Fix object selection w/ COW 2018-06-06 08:20:05 +02:00
3c9e2e82fa Cleanup: style 2018-06-05 21:32:49 +02:00
851829c1fb Eevee: Improve load time.
Only generate shadow store shaders on demand and create a simpler shader
for small blur radius.
2018-06-05 21:02:57 +02:00
e394a78b4c Fix compilation issue due to last commit. 2018-06-05 19:49:12 +02:00
d5ce40a5ed Wireframe: Add slider to hide edges from coplanar faces
The default behaviour is to show the same amount of edges as 2.7.
The slider makes it possible to show all edges or even less.
2018-06-05 19:35:36 +02:00
713027b832 make.bat : move all experimental options to their own section in the help. 2018-06-05 11:29:03 -06:00
983811607d make.bat : bring the help up to date with recent additions to the build script. 2018-06-05 10:40:14 -06:00
cd58ce85c2 make.bat : check for existence of ninja before using it. 2018-06-05 10:39:39 -06:00
5e44324b79 make.bat: change the way the vs buildtools are detected.
The recent change also used the buildtools instead of the regular compiler, you now have to explicitly state what you want to use :

2017 - the standard msvc compiler
2017pre - the msvc compiler from the preview installation
2017b - the msvc compiler from the buildtools installation
2018-06-05 10:38:48 -06:00
7ff07ddd01 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/windowmanager/intern/wm_files.c
2018-06-05 17:56:18 +02:00
1628a6858e Fix crash in owmn previous commit. 2018-06-05 17:54:53 +02:00
f0d9dbae0d Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/blendfile.c
	source/blender/blenloader/intern/readfile.h
	source/blender/blenloader/intern/versioning_250.c
	source/blender/blenloader/intern/versioning_260.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/blenloader/intern/versioning_legacy.c
	source/blender/editors/render/render_shading.c
	source/blender/makesrna/intern/rna_movieclip.c
	source/blender/render/intern/source/pipeline.c
	source/blender/render/intern/source/voxeldata.c
2018-06-05 17:02:50 +02:00
ce6db959c7 Moved function declarations from BKE_DerivedMesh.h to BKE_mesh_runtime.h
The function definitions still reside in DerivedMesh.c. Once we're done
porting all the DerivedMesh use to Mesh, we'll move the still-relevant
functions to mesh_runtime.c. This move is now cumbersome due to shared
statically-declared utility functions in DerivedMesh.c
2018-06-05 16:59:25 +02:00
a9ed50514c Moved function declarations from BKE_mesh.h → BKE_mesh_runtime.h 2018-06-05 16:59:18 +02:00
7436fb2ef1 Merge branch 'master' into 28 2018-06-05 16:36:13 +02:00
481cdb08ed Cleanup: use new accessors to blendfile path (Main.name). 2018-06-05 16:33:46 +02:00
1d97e948d2 Cleanup: add hleper functions to get filepath from Main.
This helps making things clearer and cleaner. Func returning filepath of
G.main is separate, so that we can easily track its usages, and
hopefully deprecate it at some point. Though that usage of G.main is
likely the less evil one, you nearly always want current blendfile path
in those cases anyway.
2018-06-05 16:33:46 +02:00
c68429bc03 Cleanup: pep8
Use 'autopep8 --ignore E721,E722' on our UI code, only minor changes.
2018-06-05 16:32:11 +02:00
d94df18550 Cleanup: doxy grouping for mesh runtime API 2018-06-05 15:55:16 +02:00
7a612c3799 LookDev: Fix crash when no world 2018-06-05 15:49:54 +02:00
60aee3943f UI: move 3D view display options into popover
- Moved Mesh Display, Mesh Analysis & Motion Tracking
  display panels to Overlays.
- Removed Item panel from sidebar (buttons available elsewhere).

Patch by @billreynish w/ edits
2018-06-05 15:35:57 +02:00
d860d23e1a make.bat: cache the vcredist directory.
When run from make.bat the environment is setup correctly and the VCToolsRedistDir environment variable exists, on later invocations of cmake this may no longer be the case and a warning was emitted about the missing runtime. we can't rely on InstallRequiredSystemLibraries.cmake here since it uses the compiler version to figure out the correct location and it doesn't know how to deal with clang.
2018-06-05 07:25:37 -06:00
2cc6e06bdb Error in last commit 2018-06-05 15:21:04 +02:00
b6d920bbd5 Depsgraph: Fix bug with broken tweak of animated node tree settings
With single editing context we can have expected and correct evaluation order
of animation and material update.
2018-06-05 15:11:34 +02:00
2891fb645b 3D View: disable manipulators & text w/o overlay
Manipulators which aren't explicitly activated via tools are now hidden.

Tool manipulators are kept because it doesn't make sense to interact
with a tool with hidden manipulators.
2018-06-05 14:54:52 +02:00
24bd483ee1 Object Modes: Flush COW on mode switching
Caused glitch w/ sculpt mode not updating.
2018-06-05 12:48:25 +02:00
09f780c1b0 Preserve unkeyed changes on undo and file open
This partially reverts 5975d6581c.

With single editing context it is more predictable what is unkeyed change is.
2018-06-05 12:35:19 +02:00
6d7327f607 Cleanup: simplify studiolight/matcap enum code, remove limit. 2018-06-05 12:23:55 +02:00
0d47a4d2fe T55291: Matcaps were reset when loading file 2018-06-05 12:21:41 +02:00
df1d319a79 Static Override: Fix order of operations issue in material slots.
*Really* not happy with that kind of constraint, but no choice for
now...
2018-06-05 12:08:18 +02:00
856d36e4b8 Static Override: progresses towards full support for material slots.
Material slots are a real pain to get working, due to all the black
magic they do to hide object vs. obdata storage of the material...

Currently hitting an order problem - we need to always set 'link' (to
object or obdata) property of the slot first, before we set its
material... *super-sigh*
2018-06-05 12:08:18 +02:00
cb42ad8c75 Fix compilation error after recent matcap changes 2018-06-05 12:02:08 +02:00
cd8613c6e7 Fix T55319: Keyframing issues
The issue was that keyframing from menu would tag object for animation
update, which was making object to loose unkeyed changes.
2018-06-05 11:56:46 +02:00
342dd5a771 Workbench: remove the soft limit for the xray_alpha 2018-06-05 11:45:22 +02:00
a3815f8777 Workbench: Matcaps T55291
- users can use their own matcaps
.config/blender/2.80/datafiles/studiolights/matcap/ folder
- upto 100 matcaps can be loaded
- color of the matcap is influenced by the color of the material/single
color etc. To show the plain matcap use single color at 1.0
- chosing a matcap is at lighting level (flat/studio/matcap)
- matcap only possible in solid mode
- also works for X-Ray mode

As the old matcaps are still in used by the clay engine I didn't remove
it yet.
2018-06-05 11:38:33 +02:00
ade710500d UI: set cursor line width 2018-06-05 11:37:30 +02:00
f1a3b68e76 Transform: avoid assert in wpaint mode 2018-06-05 11:31:17 +02:00
b9db470636 Fix stupid mistake in previous commit. 2018-06-05 11:22:43 +02:00
0be9d8db65 RNA/Override: Move override-related property flags to own variable.
We are already running out of available flags in main, generic int, and
everytime I work on static override I find new special cases that will
need new specific propflag, so...
2018-06-05 11:11:43 +02:00
99dd3b0156 Baby step towards making overridable materials for objects.
Naughty Collections RNACollection of objects is still to be tamed, but
for individual objects should work now....
2018-06-05 11:11:42 +02:00
5d628c519b Transform: improve pose trans/rot/scale guessing
Switching the mode was being done per object,
where it should first check all pose bones from all objects.

This also removes code that changes the transform mode
from within the counting function.
This was only needed on transform initialization.
2018-06-05 11:04:12 +02:00
0941b8b672 Missing from last commit 2018-06-05 10:13:55 +02:00
83db7a0070 Transform: revert use of evaluated objects
This is no longer needed.
2018-06-05 09:48:38 +02:00
1df228a416 UI: context menu for other editor types
D3458 by @billreynish w/ edits.

- Context menu for dope-sheet, graph, image & node editors.
- Add type to contenxt menu header.
- Access with W-Key.
- Change UV-editor weld key binding to Shift-W.
2018-06-05 09:18:00 +02:00
80d86f303a UI: support property split for 'prop_search' 2018-06-05 08:56:14 +02:00
88b46a6ce9 make.bat : Fix clang+asan msbuild project generation 2018-06-04 22:35:57 -06:00
Dalai Felinto
17e9870221 DRW: Fix crashes with instanced data
Problem introduced on 101c277e3d.
2018-06-04 19:17:29 +02:00
6fee105943 Cleanup: correct menu name 2018-06-04 19:09:52 +02:00
da53c3f020 Merge branch 'master' into blender2.8 2018-06-04 18:50:14 +02:00
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
f6740993f7 Cleanup: strip tests trailing space 2018-06-04 18:47:31 +02:00
c8af234f85 Fix T55325: Revert "Always get a reference point when snapping with the projected elements option enabled."
This reverts commit 0864a4c1ea.

That way it's best for retopology.
2018-06-04 13:33:19 -03:00
84becb870f Merge branch 'master' into blender2.8 2018-06-04 17:58:07 +02:00
747534af00 Particle System: move data creation into RNA update
Relying on evaluation to initialize data causes issues w/ 2.8.
2018-06-04 17:55:19 +02:00
William Reynish
2b4d2de253 UI: more subpanels for Cycles and Eevee. 2018-06-04 17:36:03 +02:00
ce5e9b599c Fix Python UI error with Eevee and hemi lamps. 2018-06-04 17:36:02 +02:00
784a3ccf79 Fix hang rendering with motion blur. 2018-06-04 17:36:02 +02:00
101c277e3d Workbench: Shadows: Fix cap being clipped by far plane.
This was the last remaining problem with shadow volumes (that I know of).

Only extrude until we hit the far plane.
2018-06-04 17:33:34 +02:00
349d416949 Tool System: refresh tools after undo 2018-06-04 16:41:03 +02:00
18e8350cd1 Cleanup: Hopefully more clear name 2018-06-04 16:22:36 +02:00
bda0175984 DRW: Fix leak from the wireframe drawing. 2018-06-04 16:04:18 +02:00
570804882d Wireframe: Lower line thickness and front color blending. 2018-06-04 16:04:18 +02:00
4b5670ac11 Cleanup: redundant headers 2018-06-04 16:03:52 +02:00
3b4c7a8c9b Weight paint: Use helper function to get original mesh
Makes it one line to get needed mesh, no code duplication. And can easily
update asserts and tighten the nuts.
2018-06-04 15:49:11 +02:00
0e8edbbc01 Add utility functions to get different "levels" of evaluated/original mesh 2018-06-04 15:48:37 +02:00
2b22a61152 Depsgraph: Only store original mesh pointer for mesh object 2018-06-04 15:24:41 +02:00
52f9023fbf Fix weight paint crash
The PBVH was referencing runtime custom data which was freed on refresh.
2018-06-04 15:18:48 +02:00
07f0046203 Fix crash when making objects to share same mesh
Make it more reliable and predictable way of getting pointer to
an original mesh which came from copy-on-write engine.

Related change: made it (hopefully) more clear name for flags.
2018-06-04 15:17:16 +02:00
1dc31f5b98 GPU: Fix missing case of new radeon on xorg.
This was causing issue with shader compilation.
2018-06-04 15:15:00 +02:00
e47e60a9b9 Workbench: Shadows: Fix the remaining fail case.
Non-manifold geom was producing inverted result when the camera was inside
the shadow volume.

When rendering non manifold geometry with the depth fail method, we need to
emit the cap as if it was the same geometry with a virtual thickness.

Another way to view it is to imagine having a set of non-manifold geometry
all facing the light.

So for every tri we emit a front cap oriented toward the light and the
back cap pointing away from it (whatever the actual orientation of the tri).

Extrusion pass stay the same as the depth pass method (double the increment
if it's a manifold edge).
2018-06-04 15:15:00 +02:00
736a84ec66 Cleanup: Use proper type for original ID pointer
Helps debugging, no need to cast in a debugger.
2018-06-04 14:14:14 +02:00
William Reynish
acb5bbf9b2 UI: use subpanels for Cycles, render, scene, object, particle, curves. 2018-06-04 13:44:23 +02:00
a46ced5076 Fix missing collection instance motion blur settings. 2018-06-04 13:41:27 +02:00
f430f14df4 Merge branch 'master' into blender2.8 2018-06-04 12:48:03 +02:00
7277f8973b Fix T55260: load Text File with Python from GUI Button results in 0 User
Let's just always ensure user_one when loading text from operator...
2018-06-04 12:46:59 +02:00
c2ff37455e Fix selecting bones
Own error w/ recent USE_OBJECT_MODE_STRICT
2018-06-04 12:39:10 +02:00
95011f6d48 Merge branch 'master' into blender2.8 2018-06-04 09:39:04 +02:00
44505b38df Cleanup: strip trailing space in editors 2018-06-04 09:31:30 +02:00
0911acb5cf Merge branch 'master' into blender2.8 2018-06-04 09:11:45 +02:00
6654e109df Cleanup: strip trailing space in GPU module 2018-06-04 09:09:12 +02:00
5b64301834 Merge branch 'master' into blender2.8 2018-06-04 09:06:14 +02:00
2d3d76693a Cleanup: newlines at EOF for Python modules 2018-06-04 08:54:40 +02:00
7719c11006 Cleanup: strip trailing space in Python module 2018-06-04 08:54:40 +02:00
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
ba65f7093b Cycles: Cleanup: Don't use return on function returning void 2018-06-04 00:07:17 +02:00
f6743fcaa4 UI: use subpanel for particle emission source, as an example. 2018-06-03 21:36:12 +02:00
d7c2b78822 UI: add subpanel support.
In the Python API, any panel becomes a subpanel by setting bl_parent_id
to the name of the parent panel. These subpanels can contain advanced or
less commonly used settings.
2018-06-03 21:30:35 +02:00
9b01e7bc27 UI: move Cycles device to Performance panel. 2018-06-03 19:01:18 +02:00
81dbf08eb4 Merge branch 'master' into blender2.8 2018-06-03 17:09:07 +02:00
38eb91c848 Cleanup: correct variable name, doxy sections 2018-06-03 17:06:13 +02:00
25ff7a4f2a DRW: Hair: Add additionnal subdivision smoothing support.
Only use catmull-rom interpolation for now. It's smoother and does not
exhibit artifacts.
2018-06-03 16:45:03 +02:00
06dd89b0ca GPUTexture: Fix memleak in orphaned texture management. 2018-06-03 16:45:03 +02:00
e657a4af13 Merge branch 'master' into blender2.8 2018-06-03 15:20:11 +02:00
4c4eb1ce20 Workbench: Fix memleaks. 2018-06-03 15:26:53 +02:00
d0f7ab27a8 Wireframe: Optimization for intel GPUs.
Intel GPU take more advantage of the geometry shader than other vendors.

Using a simple geom shader approach in this case is more performant.
2018-06-03 15:26:37 +02:00
335b193336 Cleanup: add argument names to screen callbacks 2018-06-03 15:11:31 +02:00
778a19a13a DRW: Fix hair disapearing if emitter is culled. 2018-06-03 12:36:03 +02:00
32c5972653 Workbench: Rework hair support.
Now hairs are shaded properly in workbench and support texturing.

I also added a 10% random normal direction per hair to have a bit more
variation in the shading. This is hardcoded for now.
2018-06-03 12:36:03 +02:00
38bf3b8d23 Merge branch 'master' into blender2.8 2018-06-03 11:24:57 +02:00
6221180963 Cleanup: remove blockscale & handler
Replace with link_flag, currently unused,
needed for dynamic space types which is planned.
2018-06-03 11:12:50 +02:00
18a4553838 Edit menu: add Repeat Last and Repeat History 2018-06-02 23:13:03 +02:00
815b1f24fa build_environment: support for msvc2017 and newer cmake.
-expanded build_deps.cmd with 2017 support, it can't locate msvc2017 so needs to be run from developer prompt.
-Newer cmake was unhappy with openal's cmakelists.txt
-collada has warning as error on and errored out on new msvc2017 warnings.
2018-06-02 13:59:56 -06:00
04d9316cf3 UI: use single column layout for particles
Also minor changes to other panels.

Patch by @billreynish
2018-06-02 21:52:52 +02:00
c55e90da4c Cleanup: -Wswitch warning 2018-06-02 21:38:31 +02:00
2ef695fabf build_environment: fix paths in osl.diff 2018-06-02 13:18:22 -06:00
6c6c4da718 GPU: Fix texture being freed in threads without ogl context bound.
This is a dirty fix. A bit more cleaner approach would be to check if a
context is bound and delay the deletion only in this case.
Also we may want to do this orphan deletion at some other places than
wm_window_swap_buffers.
2018-06-02 21:16:40 +02:00
bc6358a580 DRW: Add uniform name recording in debug mode. 2018-06-02 21:16:40 +02:00
f25e459f8f DRW: Make the Procedural hair update part of the drawmanager.
Instead of relying on the engine integration which is redundant.
2018-06-02 21:16:40 +02:00
98e4d548a1 Eevee: Hair: Make SSR works with hairs. 2018-06-02 21:16:40 +02:00
119423b252 Eevee: Cleanup unused Ghash 2018-06-02 21:16:40 +02:00
8ace49dedc Eevee: Add shadow support for hairs. 2018-06-02 21:16:40 +02:00
1de73fc6c3 Eevee: Hair: Make hairs visible even if the show emitter option is disabled. 2018-06-02 21:16:40 +02:00
08a2c5f224 Eevee: Add support for hair random property.
Do note that it does not match cycles implementation.

Also we could precompute the hash per strand before rendering but that would
suggest it's not per engine specific.

If we make the random value internal to blender then it won't be a matter
because other renderers will have access to the same value.
2018-06-02 21:16:40 +02:00
4430bd3644 Eevee: CodeStyle: Fix naming and confusion about the hairs vectors. 2018-06-02 21:16:40 +02:00
Dalai Felinto
0736460dfb Merge remote-tracking branch 'origin/master' into blender2.8 2018-06-02 20:34:25 +02:00
Dalai Felinto
fec317de8d --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.

(ported over from blender2.8)
2018-06-02 20:29:27 +02:00
6de656b4f2 transform_snap_object: Do not use occlusion test when X-Ray is enabled. 2018-06-02 13:11:51 -03:00
58efa7d686 Fix inaccuracy of SCREEN_OT_area_split when snap to midpoint and adjacent.
By default when moving a edge of the screen it always snaps to an invisible grid with unit of 4 pixels.
This was also affecting the snap to the midpoint and adjacent.
The solution was to make the snap to areagrid optional and use values of `origmin` and `origsize` that match the transformations in screen_edit.c.
2018-06-02 12:19:49 -03:00
0de0cee9a2 Fix crash running in background mode 2018-06-02 14:53:07 +02:00
9cd2e4fa3f Cleanup: quiet warnings w/o Python 2018-06-02 13:10:27 +02:00
b608133075 Fix crash if no tool is set 2018-06-02 13:10:15 +02:00
a08a8aa928 Merge branch 'master' into blender2.8 2018-06-02 13:09:12 +02:00
c140f11946 Cleanup: warning 2018-06-02 11:58:01 +02:00
Dalai Felinto
bb8770b976 Fix UI for camera data
The fix bit is the split.

But since we are using col.separator() left and right we need this as well.
I still don't think the separators are the way to go, yet may as well be
consistent with the current design in place, thus the extra separator here too.
2018-06-02 11:22:44 +02:00
8433ed76b2 UI: re-order navigate manipulator
Looked as if size applied to navigation too.
2018-06-01 22:37:27 +02:00
d18cd768bb UI: use single column properties for object data
patch by @billreynish w/ minor edits
2018-06-01 19:26:07 +02:00
bfe1d0e0dc Merge branch 'master' into blender2.8 2018-06-01 18:26:42 +02:00
75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
297bf7235b Cleanup: whitespace 2018-06-01 18:10:43 +02:00
c0dd355926 Modifiers: ported applying modifier from DerivedMesh → Mesh 2018-06-01 17:35:26 +02:00
4fccb8a023 Boolean modifier: fixed crash when applying the modifier 2018-06-01 17:35:26 +02:00
e44743736f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/io/io_collada.c
	source/blender/editors/object/object_bake.c
	source/blender/editors/object/object_edit.c
	source/blender/editors/render/render_internal.c
	source/blender/makesrna/intern/rna_object_api.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-06-01 17:26:36 +02:00
e4a727626e X-Ray: Added a slider for the alpha
- will not render when set to 0.0 for speed reasons. so when user sets
transparency to hide everything the bigger passes will be skipped.
2018-06-01 17:15:35 +02:00
56dc2bf0c5 Workbench: Updated the internal light to have a bit of back lighting 2018-06-01 17:15:35 +02:00
9e09900a30 Fix wrong colors for workbench World Background option. 2018-06-01 17:14:06 +02:00
William Reynish
15e5dbc2c3 UI: tweaks to viewport shading and overlay panel layouts. 2018-06-01 17:14:06 +02:00
0706b410bd UI: use same "Viewport Display" name for scene/object/material panels. 2018-06-01 17:14:06 +02:00
eef18d39cb Fix broken set collection offset from cursor operator. 2018-06-01 17:14:06 +02:00
051e186d5c Cleanup: some more G.main removal from editor code. 2018-06-01 17:08:38 +02:00
b3be71e07a Mesh Batch Cache: Fix memory leak. 2018-06-01 17:07:45 +02:00
72a360827b T54991: Restore support for Motion Path drawing in 2.8
This commit restores support for Motion Path drawing in 2.8 (as it wasn't ported over
to the new draw engines earlier, and the existing space_view3d/drawanimviz.c code was
removed during the Blender Internal removal).

Notes:
* Motion Paths are now implemented as an overlay (enabled by default).
  Therefore, you can turn all of them on/off from the "Overlays" popover

* By and large, we have kept the same draw style as was used in 2.7
  Further changes can happen later following further design work.

* One change from 2.7 is that thicker lines are used by default (2px vs 1px)


Todo's:
* There are some bad-level calls introduced here (i.e. the actgroup_to_keylist() stuff).
  These were introduced to optimise drawing performance (by avoiding full keyframes -> keylist
  conversion step on each drawcall). Instead, this has been moved to the calculation step
  (in blenkernel).  Soon, there will be some cleanups/improvements with those functions,
  so until then, we'll keep the bad level calls.


Credits:
* Clément Foucault (fclem) - Draw Engine magic + Shader Conversion/Optimisation
* Joshua Leung (Aligorith) - COW fixes, UI integration, etc.


Revision History:
See "tmp-b28-motionpath_drawing" branch (rBa12ab5b2ef49ccacae091ccb54d72de0d63f990d)
2018-06-01 16:38:21 +02:00
44a8070db3 Cleanup: fix incorrect contributor information. 2018-06-01 15:47:00 +02:00
06c4106d03 Fix for fix, indentation was accidental 2018-06-01 15:42:00 +02:00
75b2729488 Fix missing braces 2018-06-01 15:37:53 +02:00
50afc430fd Update Flatty themes with the new pulldown background and minor tweaks. 2018-06-01 15:32:46 +02:00
Vuk Gardašević
27881e9948 Fix Add menu issue when there are no collections to instance
Differential Revision: https://developer.blender.org/D3453
2018-06-01 15:27:18 +02:00
13ca63d2ad Draw background on pulldown widgets if the header is transparent.
Since the viewport header now supports transparency, text on pulldowns
can be hard to read if their color matches the viewport content.

Background is drawn using the 'inner' theme color, that was unused until now.
2018-06-01 15:11:38 +02:00
3b05034935 Fix broken logic in make static override operators for Collections.
Was pretty sure I already fixed that some weeks ago... but look like it
was not committed or somehow lost...
2018-06-01 14:31:29 +02:00
ddf2a58282 Mesh: Replace DM for mesh w/ wpaint vertex picking 2018-06-01 14:29:22 +02:00
82b8fd8eaf UI: don't show XYZ text w/ direction buttons 2018-06-01 14:10:43 +02:00
32c12d057f Cleanup: rename vars 2018-06-01 14:01:46 +02:00
be8016908d Mesh: Replace DM for mesh -> curve conversion 2018-06-01 14:01:44 +02:00
4faf9bfbe9 Mesh versions of DerivedMesh access API calls
Add mesh_get_eval_final & mesh_get_eval_deform

Note: these will eventually need to be renamed & moved into BKE.
2018-06-01 13:58:53 +02:00
b85d5b6d52 Cleanup: quiet warning, don't set unused alpha 2018-06-01 13:58:53 +02:00
83a41ccd0a LookDev: make sure lookdev balls are still visible after 'N' 2018-06-01 12:52:10 +02:00
cfdadc7d61 Edit Mode: Fix Edit Object renderability with multi objects edit. 2018-06-01 12:28:32 +02:00
4eb47c303d Fix: raytrace_mirror does not exist anymore
Eevee default material settings were not showing.
2018-06-01 12:14:08 +02:00
0c18024a8d Fix error 2018-06-01 12:04:24 +02:00
c771bbc27e Code cleanup: Compiler warning 2018-06-01 12:01:31 +02:00
01c75c3765 Math: optimizations for 4x4x matrix inverse, multiplications.
In some heavy rigs matrix inverse can be 10% of computation time. This
reduces it to 2% by using Eigen's optimized 4x4 matrix inverse and SSE
matrix multiplication.
2018-06-01 12:00:11 +02:00
719e782f2c Modifiers: tiny optimizations for mesh deform, lattice, kdop. 2018-06-01 12:00:11 +02:00
bcbee4b9a3 Fix missing animation updates when the proxy object is not visible.
The relation was inverted here, for a long time already. The reason is
unclear and in principle it should work fine in the right direction.
2018-06-01 12:00:11 +02:00
1bc801e020 Fix use of uninitialized value in depsgraph. 2018-06-01 12:00:11 +02:00
14c55a5828 Cleanup: long lines 2018-06-01 11:59:15 +02:00
Dalai Felinto
e35dab0fec Fix building for workbench in windows (BLI_INLINE) 2018-06-01 11:55:50 +02:00
0bddf5315f Fix T55282: Modifiers: Removed unnecessary object evaluation 2018-06-01 11:50:53 +02:00
8f24d404fe Removed old mention of CDDerivedMesh 2018-06-01 11:50:53 +02:00
e614a8290c Fix/Workaround T55272: Sculpt/VPaint removes mesh 2018-06-01 11:49:10 +02:00
e8142ad7dc Cleanup: quiet warnings 2018-06-01 11:49:10 +02:00
4683091369 Object Mode: Display loose edges if overlays are enables.
This fix T55280 Loose edges not visible in object mode
2018-06-01 11:36:01 +02:00
d5a359b1d4 Fix: overlays are reset when selection is being performed
/me hits myself in the head. In selection code the flags were not tested
but set directly.
2018-06-01 11:31:30 +02:00
c450966e95 Workbench: Material specific settings for the specular
- Uses the roughness setting of the basic eevee material
- renamed gloss_mir to roughness
- set default of roughness to 0.25
- renamed ray_mirror to metallic
- cleaned up material rna (BI mirror struct)
- use BLINN phong model
- normalize incoming/outgoing specular light
- when using camera oriented studiolight, the SolidLight will be used
for specular highlights
- EXPERIMENT: when in world oriented studiolight only the shadow direction will be used.
- change the settings of the internal light to make scenes more
readable
2018-06-01 11:01:55 +02:00
3b2d3a3cd1 Fix crash switching sculpt/vpaint -> edit mode 2018-06-01 10:34:00 +02:00
7bdc67f5f3 Fix broken 'make single user' operator UI.
Texture option was removed, since BI engine removal...
2018-06-01 10:27:27 +02:00
fe09aa602a 3D View: hide orbit navigation in camera view
Typically for camera views it's nicer not to overlay large widgets,
only include the button to exit camera view.
2018-06-01 10:17:07 +02:00
c338ac9454 Modifiers: ported Soft Body DerivedMesh → Mesh
The simulation doesn't seem to update properly yet.
2018-06-01 10:04:46 +02:00
3cefb27830 Partial Revert of COW/Camera manipulator changes
d64fbe9456 3e26b84397
2018-06-01 09:48:40 +02:00
266fc1c1ff Revert "COW Fix: Lamp manipulators"
This reverts commit 33e45658eb.

No longer needed.
2018-06-01 09:25:24 +02:00
5736157b5e 3D View: respect text option for edit-mode info 2018-06-01 09:22:08 +02:00
a6395cebb7 Error in last commit 2018-06-01 08:31:32 +02:00
c87cfcc8de 3D View: make text overlay optional 2018-06-01 08:26:55 +02:00
63785a889c 3D View: support world background color 2018-06-01 08:16:24 +02:00
35efa1d3d3 Add 'Toggle Header' to header context menu.
Also disable collapsing the header by dragging it up/down. This prevents
accidentally hiding the header when resizing areas.
2018-06-01 02:55:16 +02:00
Dalai Felinto
a63b55f642 Cycles UI: Show pause button only when in rendered mode 2018-05-31 23:58:49 +02:00
Dalai Felinto
a4bb1a5881 Fix render engine info region when overlap and header on bottom
Note there is some talk about changing the position of this (which would be strange in the image editor by the way,
since there we use the bottom for the result of the current pixel when dragging the mouse).

However first I wanted to fix this regardless.
2018-05-31 23:58:48 +02:00
995fa1f4c0 UI: new tool properties space type
This currently shows panels that were in the 2.79 3D view toolbar
which are now popovers.

In some cases it's useful for these to stay open.
This commit adds a space type to do this.

Note this is currently empty in object mode.
2018-05-31 21:45:26 +02:00
Dalai Felinto
07bf151062 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-31 21:44:21 +02:00
14dee6d7a5 UI: support drawing panels from multiple contexts 2018-05-31 21:42:02 +02:00
7c75c2db4f Add Asan support for clang on windows.
This will currently only work for the RelWithDebInfo configuration since asan
does not support the debug crt. for source line information in the reports,
you need a copy of llvm-symbolizer in the blender folder or set the
ASAN_SYMBOLIZER_PATH environment variable to point to it. Currently (as of
6.0.0) llvm-symbolizer does not ship with the binary clang/llvm distribution.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3446
2018-05-31 11:50:30 -06:00
Dalai Felinto
e51cbce646 Cleanup: Fix indentation 2018-05-31 19:19:27 +02:00
bf4ce5755f Overlay: Add Wireframe overlay.
This overlay is showing mesh topology. It is usable with transparency
even if the mesh order can mess up with the expected result (some object
more prominent than others).

Edge thickness and alpha values are hardcoded for now but can easily be
added to theme or object settings.
2018-05-31 19:09:20 +02:00
712885c30e DRW: Add wireframe buffer texture generation for wireframe drawing.
Only OB_MESH is supported for now.

Creates a simple index buffer with negative indices if the edges is not a
real edge.

Also create the buffer texture representation of this buffer along with the
pos_in_order buffer texture.
2018-05-31 19:09:20 +02:00
f43e3d0b6b DRW: Fix DRW_shgroup_call_procedural_* vertex count. 2018-05-31 19:09:20 +02:00
494470ba23 GPUTexture: Expose GPU_texture_create_buffer and add GL_R32I support. 2018-05-31 19:09:20 +02:00
8789490f96 LoopTri: Fix example code.
For real guys! Test your example code!
2018-05-31 19:09:20 +02:00
71c904433c DRW: Fix stick bones memory leak. 2018-05-31 19:09:20 +02:00
2feed9bdef Fix Collada building... 2018-05-31 18:37:33 +02:00
f71efafe8f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/sculpt_paint/paint_image.c
	source/blender/editors/space_image/image_edit.c
	source/blender/editors/space_image/image_ops.c
	source/blender/makesrna/intern/rna_material.c
	source/blender/makesrna/intern/rna_sculpt_paint.c
	source/blender/makesrna/intern/rna_space.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-05-31 18:35:14 +02:00
cfea9c261c Cleanup: Remove G.main from some editor files. 2018-05-31 18:23:20 +02:00
df22cd9ce1 Depsgraph: Fixes to prevent object duplicate to jump
This includes:

- Skip OB_RECALC_TIME tag from object duplicate operator
  not sure why it is needed: even if original object was
  animated, duplicating it will copy evaluated values.

- Don't tag whole ID for update when updating it after
  relations rebuilt. Use the same trickery to detect
  whether animation is to be re-evaluated or not as is
  done for update flag=0.

- Don't tag datablocks which are expanded for update
  of copy-on-write.

- Avoid flush along relation from copy-on-write
  operation in action. This will not invalidate any
  pointers in the copied datablock since we don't
  reference anything in the action.
2018-05-31 18:07:55 +02:00
3352dd3a3f Depsgraph: Remove unused flags
They are no longer needed after the active depsgraph concept is here.
2018-05-31 18:07:55 +02:00
126e6c8e1d Transform: Read all data from original objects
This is now guaranteed to be in sync with evaluated state for an active
dependency graph.

Solves issue with duplicating animated object.
2018-05-31 18:07:55 +02:00
59a516913e Depsgraph: Copy evaluated data to original datablock
Only do it for active dependency graph.

Currently covers animation, drivers, object and pose channel matricies.
2018-05-31 18:07:55 +02:00
b5b1f9d11c Depsgraph: Consider depsgraphs used by workspace as active
Will cause some bad behavior when object is shared across multiple
visible view layers with different overrides. Accept it for now,
and possibly force single view layer later.
2018-05-31 18:07:55 +02:00
7a4b0ff358 Depsgraph: Begin concept of active dependency graph
When active dependency graph is evaluated, it will apply animation,
drivers and scalar evaluation data (such as object matrix) to an
original datablock. This way operators and tools can easily read
data from original datablock.

This will simplify porting them to copy-on-write, and solve issues
when some operator will allocate new datablock based on original one,
and will want to read data from it.
2018-05-31 18:07:55 +02:00
d4daf9c00d Depsgraph: Forbid update flush to go from copy-on-write to animation 2018-05-31 18:07:55 +02:00
cd702db338 Animation: Pass dependency graph to animation system
This way we allow animation system to make decisions based on which
context dependency graph is coming from, and whether it belongs to
an active edit window or not.
2018-05-31 18:07:55 +02:00
48ea2131aa Sequencer: Make dependency graph part of sequencer context
Currently unused, but will be needed soon to deal with active edit
window context.
2018-05-31 18:07:55 +02:00
cb614107d3 UI: fix own error switching fake space types 2018-05-31 18:00:17 +02:00
5a82aee9e6 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/alembic/intern/abc_exporter.cc
	source/blender/blenkernel/BKE_mball.h
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/mball.c
	source/blender/editors/object/object_add.c
	source/blender/render/intern/source/convertblender.c
2018-05-31 16:57:39 +02:00
8d53e8cd02 UI: hide user preferences from space menu
See T54744
2018-05-31 16:46:24 +02:00
da11e33b26 Cleanup: remove G.main from BKE mball code. 2018-05-31 16:44:05 +02:00
361b3eb88e Cleanup: warning 2018-05-31 16:36:24 +02:00
eb1feb9f4a Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_select.c
	source/blender/editors/space_outliner/outliner_edit.c
2018-05-31 16:21:47 +02:00
0b396bc15b Minor tweaks to labels 2018-05-31 16:05:47 +02:00
16100f8261 Cleanup: get rid of last G.main usages in BKE library code. 2018-05-31 16:04:04 +02:00
b809340960 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/modifier.c
	source/blender/blenkernel/intern/object_update.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/editors/object/object_modifier.c
	source/blender/editors/physics/physics_fluid.c
	source/blender/makesrna/intern/rna_particle.c
	source/blender/modifiers/intern/MOD_particlesystem.c
2018-05-31 15:37:15 +02:00
b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
3248ac5e83 Cleanup: Remove unused variable 2018-05-31 15:02:12 +02:00
Dalai Felinto
25e5ec245c Support Move / Link to collection in the outliner as well 2018-05-31 14:52:05 +02:00
Dalai Felinto
d0af8edcd1 Outliner: Expose collections editors poll in ED_outliner.h 2018-05-31 14:52:05 +02:00
Dalai Felinto
eaad4caa56 Link to Collection - Add shortcut (Shift + M) 2018-05-31 14:52:05 +02:00
54e92bbd29 Fix: View All in Action Editor zoomed in far enough to enter "crazy mode" with a single keyframe
Now, when there's just a single keyframe, pressing HomeKey will instead
just center the view instead of trying to do "frame range" + margin.
2018-05-31 14:51:28 +02:00
4e96bff938 Update CoW when adding/removing pose in pose library 2018-05-31 13:53:40 +02:00
f56a9fbad5 Depsgraph: Remove the "disable-copy-on-write" option completely
After discussion with Sergey and Dalai, we have decided to remove
this option completely. We're getting to the point where it is almost
impossible to really use 2.8 without COW, and keeping the old option
running ends up diverting dev resources away towards tracking down
and fixing problems with a parallel system that will be going away.
2018-05-31 13:43:00 +02:00
9b4e56c091 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_camera.h
	source/blender/blenkernel/BKE_dynamicpaint.h
	source/blender/blenkernel/BKE_object.h
	source/blender/blenkernel/intern/camera.c
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/smoke.c
	source/blender/editors/object/object_transform.c
	source/blender/editors/physics/dynamicpaint_ops.c
	source/blender/editors/space_view3d/view3d_edit.c
	source/blender/editors/space_view3d/view3d_view.c
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blenderplayer/bad_level_call_stubs/stubs.c
2018-05-31 12:57:24 +02:00
d41bf6b8e8 Edit last commit
Better check if the property is set in case others want to use this
property w/o SKIP_SAVE set.
2018-05-31 12:54:44 +02:00
46508430f8 Fix tool-system re-using last space type
Even though the regression is somehow caused by 03a80facfc
this value shouldn't be reused so apply an unrelated fix.
2018-05-31 12:51:47 +02:00
28369f725c Cleanup: remove G.main from BKE object
Had to add some G.main to modifiers, but in 2.8 we do not need that
anymore, so it's not that bad! ;)
2018-05-31 12:27:47 +02:00
23e375a281 Revert "Tag COW when applying pose from pose library"
This reverts commit 24b03729ae5ba4561ace8cbfb2d56cdbde781589; committed
too soon.
2018-05-31 12:00:18 +02:00
24b03729ae Tag COW when applying pose from pose library
Related to T55232
2018-05-31 11:59:04 +02:00
9948e26e14 Fix depsgrah copying and evaluating hidden collections. 2018-05-31 11:43:29 +02:00
1e6108e972 OpenColorIO: cache multiple shaders instead of just one.
Fixes constant shader and texture rebuilding when doing animation playback
with multiple editors that use different view transforms.
2018-05-31 11:21:19 +02:00
46cfa605c3 Cleanup: Reduce indentation level 2018-05-31 11:17:57 +02:00
17f458ff32 Merge branch 'master' into blender2.8 2018-05-31 11:08:02 +02:00
24d1829243 Cleanup: nuke G.main out of BKE PackedFile code. 2018-05-31 11:07:14 +02:00
fcfe1963a6 Fix depsgraph copying and evaluating hidden objects. 2018-05-31 10:37:13 +02:00
5cbad89637 Cleanup: unused defines 2018-05-31 10:15:48 +02:00
12ab59a2d6 Merge branch 'master' into blender2.8 2018-05-31 10:03:15 +02:00
84a9647f22 Cleanup: use doxy sections for space types
Also use struct names in enum/define comments.
2018-05-31 09:49:58 +02:00
d9324b61d5 Cleanup: return types in stubs 2018-05-31 09:49:44 +02:00
e4afccf388 Depsgraph: optimization of driver evaluation with many drivers. 2018-05-31 09:46:21 +02:00
e910765ad0 WM: Use tool-system for setting brushes
This sets the tool instead of the brush, with cycling support.
2018-05-31 09:04:15 +02:00
81bf9a41e1 Tool System: Utility to set the tool by name
Wrapper for the Python operator.
2018-05-31 09:02:43 +02:00
Hristo Gueorguiev
6c0705009e Fix OpenCL compilation error - BPT without SSS. 2018-05-31 00:08:56 +02:00
Dalai Felinto
d341b62351 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-31 00:01:48 +02:00
fbd614f1fa Workbench: Highlights
Made the highlights darker (using the defaults of blender 2.7
- sharpness = 50
- spec color = 0.025 (I bumped it to 0.1)
- added a log2 to the frontal camera light to reveal more details of the
mesh
2018-05-30 22:19:10 +02:00
16d3f4db4c Tool System: optionally cycle tools in a group
Add the ability for key bindings to set a tool-group,
which cycles to the next tool when the tool is already active.
2018-05-30 22:17:37 +02:00
264a4a8f97 RNA: add tool index access
Needed for changing the active tool from Python.
2018-05-30 22:16:13 +02:00
84e5c981dc UI: toolbars now redraw on tool change 2018-05-30 22:16:13 +02:00
f5f25b843e Removed Object color from workbench. Added Highlights to FLAT shading. 2018-05-30 20:34:29 +02:00
eb0fcd4574 Generic Viewport Panel for Materials
Is enabled for all render engines as workbench will be rendering
SOLID/Texture modes and uses these settings.
2018-05-30 19:57:51 +02:00
1f693aefca Cleanup: style/whitespace
Also use 'uint'.
2018-05-30 19:49:33 +02:00
61fc9fcffa Cleanup: redundant check 2018-05-30 19:49:33 +02:00
0b6603d9b6 Fix selection randomly failing with border render.
We no longer user scissor for 3D viewport drawing, and some selection
code assumed it still. This also cleans up unnecessary scissor test
switching, we only have it temporarily enabled now.
2018-05-30 19:34:12 +02:00
c0f42a7526 make.bat: fix support for building with just the build tools installed. 2018-05-30 11:11:35 -06:00
c86437cc83 Fix Cycles UI script error with denoising. 2018-05-30 18:22:00 +02:00
cce16df10f Fix Cycles viewport render stuck with curve objects.
We should solve this better by making the depsgraph convert all curves to
meshes, for now ensure we don't to depsgraph tags during export.
2018-05-30 18:17:49 +02:00
17ce968c59 Depsgraph API: renaming, more granular update information.
* depsgraph.ids: all evaluated datablocks in the depsgraph
* depsgraph.objects: all evaluated objects in the depsgraph
* depsgraph.object_instances: all object instances to display or render
* depsgraph.updates: list of updates to datablocks
2018-05-30 18:17:49 +02:00
08862b8246 Render API: rename some API functions back to earlier names.
Their purpose is the same, no reason to break API compatibility here.
2018-05-30 18:17:49 +02:00
85ce4d957c UI: use split property layout for some panels
Object, render, scene properties now use split-property layout,
also cycles interface.

Patch by @billreynish w/ minor edits.
2018-05-30 18:00:11 +02:00
9fabe3ef53 Cleanup: quiet warning 2018-05-30 17:38:07 +02:00
efd0333a9c UI: fix property split w/ color buttons & empty text 2018-05-30 17:29:20 +02:00
1272936773 Tweak for previous commit: Just group all bone properties under the bone name
After more testing, I realised that bendy bone properties should also be grouped,
but probably all other per-bone settings too. Now, just group all of them, since
it's easier for everyone this way.
2018-05-30 17:05:37 +02:00
7661f8a65b Modifiers: Bring back custom data referencing logic
Brings dependency graph evaluation time to similar time than 2.79
for file reported in T55228.
2018-05-30 17:00:47 +02:00
41fac4fa76 Modifiers: Make input of modifier stack referencing copied CD layers
The idea is to allow modifier stack to reference custom data layers
from copied version of mesh datablock.
2018-05-30 17:00:47 +02:00
25d4d43491 Modifiers: Restore duplication of referenced layers
Was no reason to remove those calls, it was always a plan to bring
referenced layers back eventually.
2018-05-30 17:00:47 +02:00
cdfa517760 Insert Keyframe: Change default behaviour for how F-Curves get grouped
For many years, animators have been complaining about how keyframing a (transform)
property directly would leave them ungrouped, while keyframing them using a Keying Set
would put them into a group based on the name of the keyingset.

This commit attempts to improve (unify + make consistent) the default behaviour:
* All object transforms now get added to an "Object Transforms" group,
  regardless of whether they were added individually via buttons or keyingset
* All bone transforms now get added to a group corresponding to the name of the bone
  instead of only the ones added via keyingset
2018-05-30 16:46:12 +02:00
23b455a891 Cleanup: Reuse existing scene pointer 2018-05-30 16:46:11 +02:00
92e3b3839b Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_intern.h
2018-05-30 16:32:49 +02:00
10a2562bc5 Fix missing movieclip ID type in allowed ones for Outliner... 2018-05-30 16:14:55 +02:00
f1f1c32849 Object Modes: don't de-select others when activating 2018-05-30 15:51:49 +02:00
Dalai Felinto
5b8fe8324b Fix render info not working with overlap regions 2018-05-30 15:45:40 +02:00
38957c1838 Object Modes: stay in object mode when setting active
When activating an object from the 3D view or outliner,
keep the newly selected object in object mode.
2018-05-30 15:33:05 +02:00
5954a5c465 Object Modes: pose support for generic mode exit 2018-05-30 15:33:05 +02:00
375c1eab65 Cleanup: RNA naming, use highlight as suffux
This is whats done already elsewhere.
2018-05-30 15:33:05 +02:00
d0d2fc9819 Cleanup: whitespace 2018-05-30 15:26:57 +02:00
30fb455977 Initial 'fix' for Sculpt & COW - shallow copy sculpt data into COWed object.
Still a lot to fix here, right now you can get sculpt drawing updating
when you come from Edit mode, not from Object mode... Go figure...
2018-05-30 15:15:35 +02:00
35a6d9ec55 ID copy: Add flag which allows custom data to reference original datablock 2018-05-30 15:07:59 +02:00
acaf46db0e Workbench: Specular Highlights
Added specular highlights for:
 - Solid studio shading
 - Texture studio shading
2018-05-30 14:42:07 +02:00
29f9a19708 Modifier stack: Avoid roundtrip from mesh to DM back to mesh
Saves quite a bit of CPU ticks per mesh update, giving measurable
speedup for file from T55228.

Memory usage goes up a it, most likely due to evaluated mesh having
more custom data layers than corresponding DM does.
2018-05-30 14:29:05 +02:00
da16cb1511 Eevee: Keep track on whether orco was allocated or not
If it's coming from vertex data, we must not free that pointer.
2018-05-30 14:29:05 +02:00
f03953ae06 Object Mode: Add Texture space visualization. 2018-05-30 14:27:40 +02:00
ccb7f1d4f1 Fix T55256: Animation Noise modifier does not update on value change
Animation needs tagging in depsgraph (for animation refresh), instead of only
tagging AnimData->recalc
2018-05-30 14:22:25 +02:00
26f42a1928 Fix: Toggling "mute" toggle in animation editors didn't work with copy-on-write
Tested on Autumn run cycle by muting master bone animation - when working, the
dog should run forwards when the master bone animation is being muted.
2018-05-30 14:22:25 +02:00
5c17dbd991 Fix missing Cycles 3D viewport updates when editing materials, lamps.
This introduces a new depsgraph API for getting updated datablocks,
rather than getting it from bpy.data.

* depsgraph.ids_updated gives a list of all datablocks in the depsgraph
  which have been updated.
* depsgraph.id_type_updated('TYPE') is true if any datablock of the given
  type has been added, removed or modified.

More API updates are coming to properly handle multiple depsgraphs and
finer update granularity, but this should make Cycles work again.
2018-05-30 14:07:23 +02:00
8ed723745e Fix unnecessary Cycles render updates when selecting objects. 2018-05-30 14:07:22 +02:00
292125bfd3 Fix broken meshdeform modifier after recent cleanup. 2018-05-30 14:02:28 +02:00
9c2db1455f Keymap: group paint modes, reorder enum
Menu now matches the keymap.
2018-05-30 13:47:24 +02:00
eb24c9a1e1 Keymap: Pose/Weight-Paint modes now co-exist
Use the same key for pose & weight paint mode (instead of texture paint)

This makes more sense since pose/weight paint modes
are often used in combination.
2018-05-30 12:56:38 +02:00
03ec3a6141 Cleanup: remove '.' 2018-05-30 12:56:38 +02:00
48ceeead10 DRW: Instance Data: Replace with static allocation that can be referenced.
This mean you can store data used for drawing inside the object engine
data.

Also fixes T55243 Crash in ASAN debug builds due to use-after-free memory in draw code - instances issue?
2018-05-30 12:25:20 +02:00
10c0bba28e Eevee: Hair: Fix hair strip view Position. 2018-05-30 12:25:20 +02:00
7e8fd563c6 DRW: Add compile option to disable deferred compilation.
This maybe usefull for debugging.
2018-05-30 12:25:20 +02:00
93de6ca2db DRW: Instance selection id: use Batch buffers instead of DRWInstanceData
This is motivated by the refactor of DRWInstanceData to be actual non
contiguous mempools.
2018-05-30 12:25:20 +02:00
0488b728eb Eevee: Add support for the Hair info node.
Only the random output is not supported for the moment.
2018-05-30 12:25:20 +02:00
10f6450ef2 Eevee: Add support for new Hair geometry system.
This now can shade actual poly strips that mimics cylinders.
This makes hair coverage exact compared to the line method and result in
smoother fading hair.

This does make the sampling a bit more exact but needs more samples to
converge properly.
2018-05-30 12:25:20 +02:00
501c0b1df8 GPUMaterial: Add support for hair vertex color, uvs and orco. 2018-05-30 12:25:20 +02:00
328f8dc21c DRW: Add new GPU hair system.
This new system use transform feedback to compute subdivided hair points
position. For now no smoothing is done between input points.

This new system decouple the strands data (uv, mcol) with the points
position, requiring less update work if only simulation is running.

In the future, we can have compute shader do the work of the feedback
transform pass since it's really what it's meant to. Also we could generate
the child particles during this pass, releasing some CPU time.

draw_hair.c has been created to handle all of the Shading group creations
as well as subdivision shaders.

We store one final batch per settings combination because multiple viewport
or render could use the same particle system with a different subdivision
count or hair shape type.
2018-05-30 12:25:20 +02:00
2faef3473c Cycles: Use new internal hair shape properties.
The do_version actually copy the existing custom properties to the internal
ones, because theses properties are straight port from cycles.
2018-05-30 12:25:20 +02:00
e0e3038b1e Hair Particles: DNA: Add properties for new GPU hairs.
Hair Particles shape properties are ported from cycles. Thoses properties
have the same defaults and have a do_version of their own. Cycles will use
theses properties instead of its custom ones.

Some realtime engine specific settings are also added to scene->r because
it's much easier to control as global values.

Bumping Version number so cycles can do its own do_version on top of the
default settings.
2018-05-30 12:25:20 +02:00
ec6da3d72e DRW: Add new per drawcall option to bypass culling. 2018-05-30 12:25:20 +02:00
201952aed2 GPUTexture: Add support for GL_RGBA16 texture format. 2018-05-30 12:25:20 +02:00
3bc0cb08b8 DRW: Add DRW_CALL_PROCEDURAL DRWCall type.
This mimics the behaviour of DRW_shgroup_empty_tri_batch_create and will
replace it eventually.

The advantage is that it's compatible with transform feedback.
2018-05-30 12:25:20 +02:00
7b9a0ed8c4 BLI: Utils: Add Macro that compute the number of digits in integers type.
Usefull if you want to create char chains to contains hashes of a certain
type.
2018-05-30 12:25:20 +02:00
08d325805f Keymap: add back sculpt keys
Shouldn't have been removed in recent keymap edits.
2018-05-30 12:18:26 +02:00
72f4ac99c7 Cleanup/fix wrong modifiers targets handling in COW context.
Modifiers stack only get COW/evaluated IDs, so no need to go auery again
DEG for those. Further more, now unified handling of EditBMesh case (was
done on case-by-case basis in a few modifiers, not all for some reason).

We are still missing the ability to get final and cage deformed meshes
when in Edit mode though, this is to be defined/implemented in depsgraph.
2018-05-30 12:04:06 +02:00
e55c1a9b5a Depsgraph: Add TODO about backing up evaluated state of ID 2018-05-30 12:02:32 +02:00
edc1e65809 Add deformed evaluated mesh to object
This is a first step to have correspondence of legacy derivedDeform
within a new formulation. Only base ground for now to support file
reading, copy-on-write remapping and such.
2018-05-30 11:49:45 +02:00
6afa0a7a50 Fix T55253: Camera lens can't be edited after keyframing it
Bring back animation channel exception for tag flag=0.
2018-05-30 11:26:19 +02:00
9abbf73d3f Cleanup: Wrap object runtime eval members into own struct 2018-05-30 11:11:03 +02:00
a01244cade Outliner: support toggling non-active edit/pose mode objects
Support switching non-active objects in/out of a mode from the outliner.

- This allows users to change which objects are in a mode w/o
  having to exit the mode and change seleciton.
- Changing the mode of the active object applies to all other objects.
- By convention setting a mode selects, removing de-selects,
  this is done for convenience so switching to a mode from object mode
  maintains the set of objects in the current mode.

See: T55246
2018-05-30 10:29:41 +02:00
47a8d3b880 UI: Show outliner icon highlight w/ non-active edit-mode objects 2018-05-30 10:29:41 +02:00
e054b7f251 BKE_object: Add BKE_object_data_is_in_editmode 2018-05-30 10:29:41 +02:00
01f9e13c30 Cleanup: use 'e' prefix for enum types 2018-05-30 10:29:41 +02:00
d709705203 Cleanup: Naming, match policy with rest of copy-on-write design 2018-05-30 10:24:54 +02:00
301a27187c Cleanup: More typed allocation type enum usage
Majority of the code is EOL, but still handy for debug purposes.
2018-05-30 10:22:28 +02:00
b54cc68365 Cleanup: Use typed allocation type enum in custom data API 2018-05-30 10:20:22 +02:00
0ed2e254bb Use enum for custom data allocation type
Allows to easily see human readable value in debugger.
2018-05-30 10:17:09 +02:00
cb22caa8c7 Merge branch 'master' into blender2.8 2018-05-30 08:49:34 +02:00
18c12803bd Edit Mode: add success return value
Also remove fix for T6614, since BKE_object_obdata_is_libdata
no longer checks proxy.
2018-05-30 08:41:06 +02:00
0e0502cbdf Merge branch 'master' into blender2.8 2018-05-30 07:34:22 +02:00
2c03d6a12b DNA: add OB_DATA_SUPPORT_EDITMODE macro 2018-05-30 07:31:35 +02:00
9992079d59 EEVEE: LookDev, reset camera settings 2018-05-29 22:02:36 +02:00
36e6d44c90 Fix last commit. 2018-05-29 15:58:56 -03:00
00dc1c08aa Fix T55223: Crash when changing lattice resolution. 2018-05-29 15:39:44 -03:00
f8908f0d43 Correct last commit
Left unneeded code in space_context_cycle_invoke
2018-05-29 18:18:36 +02:00
e9cd2fb23b Keymap: partially implement changes from T55162
- Use Tab key for search.
- Number keys switch modes.
- The number of the current mode can open a submode menu
  (currently only works for edit-mode)
- Ctrl-Tab, Ctrl-Shift-Tab - cycle workspaces.
2018-05-29 17:52:27 +02:00
929c78e33c EEVEE: LookDev blurred background 2018-05-29 17:50:51 +02:00
Dalai Felinto
08b8fa0863 Cleanup 2018-05-29 17:33:14 +02:00
Dalai Felinto
85d845ef98 Fix crash when moving object parented to a curve
Note, we can probably remove scene from BKE_object_where_is_calc
and force to always use it from depsgraph.
2018-05-29 17:33:07 +02:00
Dalai Felinto
5eda9732b3 Use the correct time to evaluate object in BKE_object_where_is_calc functions 2018-05-29 17:05:32 +02:00
Dalai Felinto
e2bac484e0 Use correct time for curve parent evaluation
Time should alwaus come from depsgraph, not scene.
2018-05-29 17:05:32 +02:00
36e9ed98e7 StudioLight: Calculate Specular irradiance 2018-05-29 16:29:11 +02:00
f98c838b71 EEVEE: LookDev reversed the background fadeout 2018-05-29 16:22:53 +02:00
d5889f57ae EEVEE: LookDev fadeout to the world horizon color 2018-05-29 16:22:53 +02:00
8f670dd855 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_material.h
	source/blender/blenkernel/BKE_mesh.h
	source/blender/blenkernel/intern/library_remap.c
	source/blender/blenkernel/intern/material.c
	source/blender/editors/object/object_relations.c
	source/blender/editors/render/render_preview.c
	source/blender/makesrna/intern/rna_object.c
2018-05-29 16:02:53 +02:00
f7af08b5fe Cleanup: Get rid of G.main in BKE_material.
Note that in some cases, this only moves the G.main case to somne other
places - in particular, RNA getters/setters are becoming annoying here...
2018-05-29 15:49:21 +02:00
9d037153f7 Object Modes: disable mode switching on selection
See T55246
2018-05-29 15:47:08 +02:00
44b99d1052 For 2.8, bring back debug mode indices display. 2018-05-29 09:31:00 -04:00
43584f4a41 Missed own last commit 2018-05-29 15:17:34 +02:00
Dalai Felinto
bc54823376 Fix T55244: Parenting object(s) to curve crashes blender
There is a chance parts of Blender call BKE_object_workob_calc_parent
with ob->parent objects that are outside the depsgraph.

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

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

The reason for this is that with the multi-object editing support added into the transform
system, this code would now get run for all the other objects that were being included
in Pose Mode, even if no bones from those armatures were selected. Since no valid translatable
bones were found in those other armatures, the transform mode would get reset upon
encountering one of those other bones.
2018-05-29 12:27:04 +02:00
756b70c6c3 UI: Expand space sub-types into the menu
Initial support for expanding editors, see: T54744
2018-05-29 12:15:26 +02:00
d4ac65d003 Cleanup: use same 'depsgraph' name everywhere outside of DEG space.
'graph' is waaaayyyyy too generic name outside of DEG context, and
better try to use same name everywhere!
2018-05-29 12:07:48 +02:00
643259415d EEVEE: LookDev fade out background option 2018-05-29 12:06:48 +02:00
a0b08e7b66 EEVEE: LookDev use_scene_light draw option
Scene lights are rendered when
 - v3d is not available
 - or shading type is other then OB_MATERIAL
 - or shading type is OB_MATERIAL and use_scene_light is true
2018-05-29 11:01:25 +02:00
2bb4977c4a Fix T55203: Particle hair weights are not preserved 2018-05-29 10:36:19 +02:00
77e32e8819 EEVEE: LookDev overlays enabling
The mirror ball and diffuse ball are only rendered when overlays are
turned on and the lookdev overlay is turned on.
2018-05-29 09:08:32 +02:00
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
55d611ad5e Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-28 21:57:02 +02:00
Dalai Felinto
dd5f69e251 Fix readfile for affected collections 2018-05-28 21:56:32 +02: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
Dalai Felinto
e20ec83765 Fixup for LinkData > AffectedCollection 2018-05-28 01:58:27 +02:00
Dalai Felinto
3e946a6f13 Tag COW when link/unlinking collections
In theory we can tag only the objects that are in the corresponding colletction
and its children.
2018-05-28 01:48:14 +02:00
Dalai Felinto
fc4c3fc35c Use affected collections to determine objects to override
Note: It is done now as a cache system, although right now
this runs for all the objects.

But the logic should be decoupable once we integrate this with
the depsgraph properly.

Note: I seem to be getting a crash on saving/writing because
AffectedCollection->collection is NULL sometimes.
2018-05-28 01:37:53 +02:00
Dalai Felinto
83e068f5df New Affected Collection struct
No point in using anonymous LinkData structs.
2018-05-28 00:42:17 +02:00
dc0eed178a Fix Cycles + OSL build error, pass main to node editing functions. 2018-05-28 00:04:14 +02:00
Dalai Felinto
f319e0081b Cleanup 2018-05-27 21:39:40 +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
Dalai Felinto
8655ed28fe Update the viewport when changing dynamic override properties 2018-05-27 19:23:46 +02:00
Dalai Felinto
c9172b65db Util function to find view layer by dynamic property 2018-05-27 19:23:20 +02:00
Dalai Felinto
dcb18ab6c9 Extra make sure view3d updates for dynamic override
Without this we do not get updates when deleting/adding override
sets and affected collections.

We should probably replace this by manually publishin RNA updates though.
2018-05-27 19:22:27 +02:00
Dalai Felinto
f7301293b9 Make sure viewport updates on dynamic override and override set changes 2018-05-27 19:21:18 +02:00
Dalai Felinto
7265f6c25c Depsgraph: Tag depsgraph id based on id type 2018-05-27 19:20:32 +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
Dalai Felinto
8fb93aebe7 BKE_idtype_to_main_data
Function to map ID_Type to bmain-> listbases.
2018-05-27 18:33:08 +02:00
bab887fbfe Fix 'broken' Multiply operation for Dynamic Overrides.
No reason to store operands of Multiply op in a separate property! Let's
keep things simple ;)
2018-05-27 18:23:14 +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
e7e792f0f4 Fix broken RNA override apply in Dynamic case.
Was accessing some pointers it should not access in Dynamic case.
Typical stupid mistakes that happen when you code without being able to
test your changes... ;)

Also made code a bit clear by using a global bool is_dynamic_override,
instead of using crappy NULL-pointer check.
2018-05-27 16:34:14 +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
a5ca6d752e Hacky code just to try RNA_struct_dynamic_override_apply
It is crashing now, I tried either adding a scene setting (EEVEE AO), or
object settings (ob.color).

This also shows a few problems:
* We can't simply tag Scene to update when changing an override set, we need
  the tagging to flush down to the scene objects.

* For scene settings we may want to do at this moment in COW evaluation, however
  for objects the implementation is a bit more tricky. Because we need to change
  the data owned by the object as well. For example, the material.

* In this case it is almost as if we want a cow-cow ID (the OVERRIDEN id should be
  shared by all the objects that are being overridden.

* Also the affected collections thing is to be handled somehow.
2018-05-25 20:59:04 +02:00
Dalai Felinto
e6128bd177 Tag depsgraph COW for update when changing dynamic overrides 2018-05-25 20:40:09 +02:00
Dalai Felinto
f837bd1f76 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-25 19:52:10 +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
Dalai Felinto
7bd6590594 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides
Big merge, this addresses all the conflicts due to the Group > Collection change.
2018-05-25 18:03:45 +02: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
5165ab5877 Dynamic override: add RNA callback to apply an override.
Theoritical code for now, since we still miss the depsgraph part to hook
it up to actual evaluation.
2018-05-17 18:11:52 +02:00
35716a8f46 Merge branch 'blender2.8' into temp-dynamic-overrides
Conflicts:
	source/blender/makesrna/intern/rna_rna.c
2018-05-17 17:14:48 +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
f1b10fa29d Initial step to support dynoverride eval in RNA code.
Using as much as possible static override code. Againm ideally we'll
merge back both into a fully single system after everything is working.

Also found a way to reduce a bit verbosity of code here...
2018-05-17 16:43:26 +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
f5cada3f7d Dynamic Override: Add support for arrays of bools and ints, check array size! 2018-05-17 14:16:47 +02:00
773a60d8f8 Modifiers: ported Particle Instance DerivedMesh → Mesh 2018-05-17 13:45:47 +02:00
e3d6d9d3ac Dynamic Override: Share a tiny bit more code betzeen dynamic and static overrides.
Renamed dynamic's override_mode to 'operation' (same as with static) and
made it use same enum values.

Note that ultimately/ideally both would only use one data structure,
this should be manageable and will simplify RNA apply code (which is to
be shared by both), but that kind of cleanup/refactor we can do once we
have a working system, just before merging into blender2.8.
2018-05-17 12:56:32 +02:00
ca1f1043d3 Particle System: fixed dupliobject drawing by getting time from depsgraph 2018-05-17 11:42:24 +02:00
c69ed97473 Merge branch 'blender2.8' into temp-dynamic-overrides 2018-05-17 11:38:08 +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
68e861059f Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-16 23:21:45 +02:00
Dalai Felinto
50771589a7 Fix building
It was broken since rB666a3b6161af, shame on me.
2018-05-16 23:20:40 +02: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
Dalai Felinto
814fc6aafc Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-16 15:26:27 +02:00
Dalai Felinto
666a3b6161 Fix warning + cleanup 2018-05-16 15:26:21 +02: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
Dalai Felinto
a278a97232 Dynamic length for color arrays 2018-05-16 00:43:24 +02:00
Dalai Felinto
0441110c86 Split dynamic override into its own rna file 2018-05-16 00:29:06 +02:00
Dalai Felinto
612d78712c Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-15 23:50: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
Dalai Felinto
ba1d1a6923 Hard-coded support for arrays, color works 2018-05-14 22:21:34 +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
Dalai Felinto
2b92e40e03 UI: Show override mode only for compatible properties 2018-05-14 11:59:40 +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
42f6406d4f Dynamic overrides: Add support to retrieve type of property from rna path.
Also added proper value accessor for booleans, so now
Object.display.show_shadows shall work nicely.
2018-05-13 19:14:05 +02:00
17a209ea02 Fix 'add new dynamic override' func, could store NULL rna path string.
Do not generate the dynamic override data in case a valid RNA path
cannot be built.
2018-05-13 19:14:05 +02:00
ddbfe00827 New no-data RNA path sover: add another helper func.
That one is more helpful, allows to directly build the runtime list of
RNA items.
2018-05-13 19:14:05 +02:00
35bdc45bbd Fix missing path callback for new Object.display struct. 2018-05-13 19:14:05 +02:00
70673c6a6b 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 19:14:05 +02:00
c046771ecb Icons: updated transform icons 2018-05-13 19:14:05 +02:00
1ec126887e UI: fix popovers not properly working with scroll arrows for long menus. 2018-05-13 19:14:05 +02:00
05f8453496 Build deps: avoid ffmpeg external crystalhd library dependency. 2018-05-13 19:14:05 +02:00
df32088b95 Fix typo in previous commit. 2018-05-13 19:14:05 +02:00
5d6950a49a Icons: fix z-sorting
Was depth sorting per mesh.
2018-05-13 19:14:05 +02:00
Julian Eisel
bba8f86558 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 19:14:05 +02:00
Julian Eisel
2d82574494 Fix invisible scroll-bars after file read
Own mistake from 51efeb6834.
2018-05-13 19:14:05 +02:00
2e802e56c5 Icons: optionally use material color
The RGB node is used if it exists,
this is multiplied by the vertex color.
2018-05-13 19:14:05 +02:00
Nick Milios
0b3200cb43 Fix build error with Visual Studio / Windows.
Differential Revision: https://developer.blender.org/D3363
2018-05-13 19:14:05 +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
ffee223857 Attempt to make limited resolution of RNA paths possible without any data.
Note that while code is essentially the same with or without a valid
PointerRNA, 'public' API is clearly separated. Existing code should
hence exhibit no change in behaviour.

Also, no-data case is essentially not tested yet.
2018-05-13 17:06:13 +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
61dc857877 Merge branch 'blender2.8' into temp-dynamic-overrides 2018-05-13 15:45:01 +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
Dalai Felinto
c532c4fc25 Expose root ID* to rna
Note: We should only store root when relevante (e.g., modifiers).
And remove this dyn property when root is deleted in these cases.
2018-05-11 16:07:21 +02:00
Dalai Felinto
7e9d2fd984 ID Type needs to be stored 2018-05-11 16:06:40 +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
Dalai Felinto
543bed5b85 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-11 10:32:00 +02:00
Dalai Felinto
4b40ed48c2 Implement copy_data for dynamic properties 2018-05-11 10:25:28 +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
Dalai Felinto
107a457891 Add multiplication factor
Also tagged a few TODOs in the UI.
2018-05-10 14:00:56 +02:00
Dalai Felinto
8a27c1c8a6 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-10 13:34:34 +02:00
Dalai Felinto
b0332b8490 Finish the operator to add overrides
You now can create a new override set, or pick an existent one.
2018-05-10 13:07:28 +02:00
27da2db0ca 3D View: utility to get matrix from cursor 2018-05-10 12:24:07 +02:00
Dalai Felinto
cd52967d1c Set new override set as the active one 2018-05-10 11:44:30 +02:00
Dalai Felinto
1dd9396ced Handle library query for dynamic overrides 2018-05-10 10:45:14 +02:00
Dalai Felinto
e2346f7378 Dynamic Override Property: Mode
ID props won't have these options showing in the UI, but there is no need
to have them stored in the DNA since we need to know the prop type to know
which rna prop to show in the UI.

Also more UI changes.
2018-05-10 00:56:40 +02:00
Dalai Felinto
76c9d4db2e Dynamic Override Property: Remove Operator 2018-05-10 00:20:46 +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
Dalai Felinto
a4a5f4b1e5 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-09 18:55:38 +02:00
Dalai Felinto
33c3e293be Dynamic Override Properties
TODO:
 * Final UI
 * Operator to delete them.
 * Depsgraph.
 * Copy properties (copy data).
 * Handle arrays (e.g., ob.color).
 * Data path.
 * Create default override set or let user pick existent one.
 * Get name from data path (rna).
 * Get icon.
 * Set different override_modes based on property type.

Done together with Bastien Montagne.
2018-05-09 18:55:03 +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
5978102ec5 Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-09 16:18: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
fc54b5034a Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides 2018-05-09 15:58:38 +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
Dalai Felinto
7f808eb601 No need to store the name of the Dynamic Properties 2018-05-09 09:51:47 +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
Dalai Felinto
189b31c937 View Layer overrides
TODO:
* Properties (all)

Notes:
* UI settings, stored per scene so it does not change based on view layer
* Link collection menu can leak memory (like Move to Collection).

The design for this task is: T54792
2018-05-08 20:10:21 +02:00
4f213c1495 Cleanup: naming (prefer len over num for new code) 2018-05-08 19:36:02 +02:00
305c455ffe Cleanup: mesh_runtime naming
- BKE_mesh_get_looptri_num        -> BKE_mesh_runtime_looptri_len
- BKE_mesh_runtime_recalc_looptri -> BKE_mesh_runtime_looptri_recalc
- BKE_mesh_get_looptri_array      -> BKE_mesh_runtime_looptri_ensure
2018-05-08 19:26:36 +02:00
65ae4e27b0 Missed last commit 2018-05-08 19:16:33 +02:00
6e88075618 Merge branch 'master' into blender2.8 2018-05-08 19:15:58 +02:00
9a055d1abc Modifier stack: partial port of ShrinkWrap to new Mesh-based system.
Partial only, complete depends on BVHTree helper updates, and subsurf
updates.
2018-05-08 19:04:12 +02:00
f7727b5366 Modifier stack: Port Warp to new Mesh-based system. 2018-05-08 18:41:43 +02:00
8f7e4b314b Modifier stack: port Mask to new Mesh-based system. 2018-05-08 18:19:28 +02:00
e0a436fcff Cleanup: includes 2018-05-08 18:01:47 +02:00
0012082c10 Cleanup: move mesh conversion into own function 2018-05-08 17:54:25 +02:00
5f2a2e048d Modifier stack: Port Caqst to new Mesh-based system. 2018-05-08 17:52:53 +02:00
e6d11c6ce6 Collections: remove per collection and view layer engine overrides.
This will be handled by the new view layer override system which will
store data elsewhere, removing the code already for easier refactoring.
2018-05-08 17:46:20 +02:00
03dd109a84 Cleanup: consistent BKE_mesh naming 2018-05-08 17:28:43 +02:00
00127d03f1 Cleanup: use bool for BKE_mesh_new_from_object 2018-05-08 17:17:40 +02:00
7522af49a3 Cleanup: rename variables
DerivedMesh had some odd conventions, remove from BKE_mesh.
2018-05-08 17:15:23 +02:00
0e964afaa4 Cleanup: use 'nomain' when not in library data
Rename only.
2018-05-08 17:06:30 +02:00
fa69ce9e3a Cleanup: whitespace, duplicate includes 2018-05-08 16:57:07 +02:00
5b3559576d Modifier stack: Port Smooth to new Mesh-based system. 2018-05-08 16:42:01 +02:00
43be434310 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/modifiers/intern/MOD_dynamicpaint.c
	source/blender/modifiers/intern/MOD_uvproject.c
2018-05-08 16:06:32 +02:00
4e4a93bc45 Fix building with latest versions of ffmpeg.
Some years-old deprecated stuff has now been removed.

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

Intended for use by tools too.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: aligorith, sergey

Reviewed By: aligorith

Maniphest Tasks: T54812

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

mentioned in T54942

Reviewed By: campbellbarton

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

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

Reviewed By: campbellbarton

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

mentioned in T54942

Reviewed By: campbellbarton

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

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

Reviewed By: campbellbarton

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

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

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

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

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

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

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

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

With changes by Campbell Barton.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: fclem

Reviewed By: fclem

Tags: #code_quest

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

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

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

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

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

Test plan:

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

This relies on the following factors:

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

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

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

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

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

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

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

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

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

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

Also do the color samples only if needed.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: campbellbarton, sergey, mont29

Subscribers: sybren

Tags: #bf_blender_2.8

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

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

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

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

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

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

Reviewers: fclem

Tags: #code_quest

Maniphest Tasks: T54894

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

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

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

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

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

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

This affects several areas:

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

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

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

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

Reviewers: fclem

Subscribers: billreynish

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

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

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

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

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

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

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

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

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

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

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

Proposed solution is to:

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

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

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

  If the value is the same, we apply animation.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: fclem, brecht

Reviewed By: fclem

Subscribers: sergey

Tags: #code_quest

Maniphest Tasks: T54726

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

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

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

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

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

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

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

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

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

Reviewers: brecht, mont29, campbellbarton, dfelinto

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

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

Reviewed By: brecht

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

The function to see is EEVEE_lightprobes_obj_visibility_cb.

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

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

This callback returns the final visibility for this object.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

== Technical Features/Changes

* Adds initial support for global areas

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

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

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

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

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

== ToDo's

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Includes following obvious changes:

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

Changes comparing to the Gooseberry branch:

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

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

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

Reviewers: brecht, campbellbarton

Reviewed By: brecht

Subscribers: eyecandy

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Indentation will be done separately.

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

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

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

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

Reviewers: mont29

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

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

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

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

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

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

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

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

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

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

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

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

This is a step towards making EvaluationContext obsolete.

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

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

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

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

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

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

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

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

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

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

- Need to pass view layer by index.

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

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

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

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

Reviewers: dfelinto

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

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

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

thanx @dingto for review

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

Adding lots of shaders were recreating as many ogl context which was very
slow.
2018-04-10 19:30:23 +02:00
1bc8ebaa26 Formatting 2018-04-10 18:27:49 +02:00
48dc5c14d4 Fix crashing of EEVEE/Clay engines when importing an Alembic file
The dependency graph still isn't updated properly, so animated meshes don't
move in EEVEE/Clay, but at least Blender doesn't crash.
2018-04-10 18:24:24 +02:00
3dce5b2ef9 UI: Fix some drawing order issues. 2018-04-10 17:42:45 +02:00
04e363376b WM: Fix a crash (assert) when creating a new window.
This happened when creating a window with the cursor over the timeline area.
I still don't know exactly what happened but for a reason batches were not
reset in this case.
2018-04-10 17:42:45 +02:00
3cfca15b50 DRW: Hair: Use GWN_PRIM_LINE_STRIPS instead of LINES
This means fewer indices to store. That being said, it seems to be a little
slower because of the restart index. But that's in the case we would be
vertex bound, which is mostly never going to happen.
2018-04-10 17:42:45 +02:00
21a57ec29e BLF: Style: Fix bad casts.
This could have caused overflow issue.
2018-04-10 17:42:45 +02:00
3586 changed files with 141798 additions and 386502 deletions

View File

@@ -2,5 +2,6 @@
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/blender2.8",
"arc.land.update.default" : "rebase"
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "blender2.8"
}

44
.editorconfig Normal file
View File

@@ -0,0 +1,44 @@
# C/C++
[*.{c,cc,h,hh,inl,glsl}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# CMake & Text
[*.{cmake,txt}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# Python
[*.py]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# Shell
[*.sh]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# reStructuredText
[*.rst]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 3
max_line_length = 120

4
.gitmodules vendored
View File

@@ -3,22 +3,18 @@
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
branch = master
ignore = all
branch = master
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
branch = master
ignore = all
branch = master
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
branch = master
ignore = all
branch = master

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
)
@@ -206,7 +196,7 @@ mark_as_advanced(WITH_BLENDER)
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
@@ -235,17 +225,8 @@ 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)
@@ -327,7 +308,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)
@@ -478,11 +458,13 @@ endif()
# OpenGL
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
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_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
mark_as_advanced(
WITH_OPENGL
WITH_GLEW_ES
WITH_GL_EGL
WITH_GL_PROFILE_ES20
@@ -529,6 +511,53 @@ 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=nonnull-attribute \
-fsanitize=returns-nonnull-attribute \
-fsanitize=signed-integer-overflow \
-fsanitize=undefined \
-fsanitize=vla-bound \
-fno-sanitize=alignment \
")
if(NOT MSVC) # not all sanitizers are supported with clang-cl, these two however are very vocal about it
set(_asan_defaults "${_asan_defaults} -fsanitize=leak -fsanitize=object-size" )
endif()
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)
if(NOT MSVC)
find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
else()
find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
)
endif()
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)
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -580,17 +609,13 @@ 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")
endif()
if(NOT WITH_CXX11)
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
@@ -604,9 +629,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)
@@ -614,10 +636,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()
@@ -788,7 +806,8 @@ set(C_WARNINGS)
set(CXX_WARNINGS)
# for gcc -Wno-blah-blah
set(CC_REMOVE_STRICT_FLAGS)
set(C_REMOVE_STRICT_FLAGS)
set(CXX_REMOVE_STRICT_FLAGS)
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
@@ -800,6 +819,21 @@ set(PLATFORM_LINKLIBS "")
set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "")
if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
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}")
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS};${COMPILER_ASAN_LIBRARY}")
set(PLATFORM_LINKFLAGS "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
set(PLATFORM_LINKFLAGS_DEBUG "${COMPILER_ASAN_LIBRARY} ${COMPILER_ASAN_LINKER_FLAGS}")
endif()
endif()
#-----------------------------------------------------------------------------
#Platform specifics
@@ -972,6 +1006,10 @@ endif()
find_package(OpenGL)
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
if(WITH_OPENGL)
add_definitions(-DWITH_OPENGL)
endif()
if(WITH_SYSTEM_GLES)
find_package_wrapper(OpenGLES)
endif()
@@ -1174,7 +1212,7 @@ else()
list(APPEND GL_DEFINITIONS -DGLEW_STATIC)
# This won't affect the non-experimental glew library,
# This won't affect the non-experimental glew library,
# but is used for conditional compilation elsewhere.
list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
@@ -1378,16 +1416,22 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS -Wno-type-limits)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT -Wno-int-in-bool-context)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT -Wno-format)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
endif()
if(NOT APPLE)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -1416,23 +1460,23 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
# flags to undo strict flags
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_VARIABLE_DECLARATIONS -Wno-missing-variable-declarations)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INCOMPAT_PTR_DISCARD_QUAL -Wno-incompatible-pointer-types-discards-qualifiers)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION -Wno-unused-function)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_TO_VOID_POINTER_CAST -Wno-int-to-void-pointer-cast)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_PROTOTYPES -Wno-missing-prototypes)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_DUPLICATE_ENUM -Wno-duplicate-enum)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNDEF -Wno-undef)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_MISSING_NORETURN -Wno-missing-noreturn)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_PRIVATE_FIELD -Wno-unused-private-field)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CXX11_NARROWING -Wno-c++11-narrowing)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1464,7 +1508,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4267" # conversion from 'size_t' to 'type', possible loss of data
"/wd4305" # truncation from 'type1' to 'type2'
"/wd4800" # forcing value to bool 'true' or 'false'
"/wd4828" # The file contains a character that is illegal
"/wd4828" # The file contains a character that is illegal
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
@@ -1529,7 +1573,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")
@@ -1583,7 +1632,7 @@ if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER OR WITH_PLAYER)
if(WITH_BLENDER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1608,13 +1657,6 @@ if(WITH_BLENDER)
endif()
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
add_subdirectory(source/blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Testing
add_subdirectory(tests)
@@ -1629,9 +1671,6 @@ include(build_files/cmake/packaging.cmake)
if(WITH_BLENDER)
openmp_delayload(blender)
endif()
if(WITH_PLAYER)
openmp_delayload(blenderplayer)
endif()
#-----------------------------------------------------------------------------
# Print Final Configuration
@@ -1665,8 +1704,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)

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

@@ -33,8 +33,8 @@ set(NUMPY_POSTFIX)
if(WIN32)
set(NUMPY_INSTALL
${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
)
set(NUMPY_PATCH ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff )
else()

View File

@@ -39,5 +39,6 @@ if(BUILD_MODE STREQUAL Release)
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
)
endif()

View File

@@ -46,7 +46,7 @@ if(MSVC)
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc
)
if(BUILD_MODE STREQUAL Release)

View File

@@ -56,24 +56,27 @@ if(WIN32)
# For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
# TODO FIXME highly MSVC specific
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MT ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MT /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MT ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS)

View File

@@ -25,7 +25,7 @@ ExternalProject_Add(external_x264
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic
--disable-lavf

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

@@ -75,7 +75,7 @@ macro(PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
# Handle new library names for OpenEXR 2.1 build via cmake
string(REPLACE "." "_" _ILMBASE_VERSION ${ILMBASE_VERSION})
string(SUBSTRING ${_ILMBASE_VERSION} 0 3 _ILMBASE_VERSION )
find_library(${tmp_prefix}_LIBRARY_RELEASE
NAMES ${libname} ${libname}-${_ILMBASE_VERSION}
HINTS ${${libpath_var}}
@@ -177,7 +177,7 @@ if(ILMBASE_INCLUDE_DIR)
"\\1" XYZ ${ILMBASE_BUILD_SPECIFICATION})
set("ILMBASE_VERSION" ${XYZ} CACHE STRING "Version of ILMBase lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("ILMBASE_VERSION" "2.0" CACHE STRING "Version of ILMBase lib")
endif()

View File

@@ -175,7 +175,7 @@ if(OPENEXR_INCLUDE_DIR)
"\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
set("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
else()
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
# Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
message(WARNING "Could not determine ILMBase library version, assuming 2.0.")
set("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
endif()

View File

@@ -6,7 +6,7 @@
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
# and basename_LIBRARY_RELEASE will be set to the release value. If only
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
#
# If the generator supports configuration types, then basename_LIBRARY and
# basename_LIBRARIES will be set with debug and optimized flags specifying the
@@ -53,10 +53,10 @@ macro( select_library_configurations basename )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY
set( ${basename}_LIBRARY
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
set( ${basename}_LIBRARIES
set( ${basename}_LIBRARIES
optimized ${${basename}_LIBRARY_RELEASE}
debug ${${basename}_LIBRARY_DEBUG} )
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
@@ -67,14 +67,14 @@ macro( select_library_configurations basename )
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
"The ${basename} library" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif( ${basename}_LIBRARY )
mark_as_advanced( ${basename}_LIBRARY
mark_as_advanced( ${basename}_LIBRARY
${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)

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

@@ -0,0 +1,13 @@
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
@@ -885,7 +885,8 @@
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
# Check MMSystem backend
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
IF(HAVE_LIBWINMM)

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} )
--- osl/src/external_osl/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600
+++ osl/src/external_osl/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

@@ -14,10 +14,18 @@ if NOT "%1" == "" (
set BuildDir=VS14
goto par2
)
if "%1" == "2017" (
echo "Building for VS2017"
set VSVER=15.0
set VSVER_SHORT=15
set BuildDir=VS15
goto par2
)
)
:usage
Echo Usage build_deps 2013/2015 x64/x86
Echo Usage build_deps 2013/2015/2017 x64/x86
goto exit
:par2
if NOT "%2" == "" (
@@ -31,6 +39,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017
)
goto start
)
if "%2" == "x64" (
@@ -43,6 +55,10 @@ if NOT "%2" == "" (
if "%1" == "2015" (
set CMAKE_BUILDER=Visual Studio 14 2015 Win64
)
if "%1" == "2017" (
set CMAKE_BUILDER=Visual Studio 15 2017 Win64
)
goto start
)
)

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
@@ -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

@@ -51,7 +51,7 @@ FIND_LIBRARY(ALEMBIC_LIBRARY
lib64 lib lib/static
)
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALEMBIC DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)

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

@@ -40,7 +40,7 @@ FIND_PATH(EIGEN3_INCLUDE_DIR
include/eigen3
)
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(FFTW3_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG

View File

@@ -49,7 +49,7 @@ FIND_LIBRARY(GLEW_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG

View File

@@ -115,7 +115,7 @@ if(Boost_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_icu_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Icu DEFAULT_MSG

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(JACK_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set JACK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jack DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(JEMALLOC_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(LZO_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG

View File

@@ -1,7 +1,7 @@
# - Find OpenCOLLADA library
# Find the native OpenCOLLADA includes and library
# This module defines
# OPENCOLLADA_INCLUDE_DIRS, where to find COLLADABaseUtils/ and
# OPENCOLLADA_INCLUDE_DIRS, where to find COLLADABaseUtils/ and
# COLLADAFramework/, Set when OPENCOLLADA_INCLUDE_DIR is found.
# OPENCOLLADA_LIBRARIES, libraries to link against to use OpenCOLLADA.
# OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
@@ -129,7 +129,7 @@ FOREACH(COMPONENT ${_opencollada_FIND_STATIC_COMPONENTS})
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set OPENCOLLADA_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENCOLLADA_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCOLLADA DEFAULT_MSG

View File

@@ -68,7 +68,7 @@ FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS})
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenColorIO DEFAULT_MSG

View File

@@ -106,7 +106,7 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
HINTS
${_openexr_SEARCH_DIRS}
PATH_SUFFIXES
@@ -117,7 +117,7 @@ ENDFOREACH()
UNSET(_openexr_libs_ver)
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG

View File

@@ -64,7 +64,7 @@ FIND_FILE(OPENIMAGEIO_IDIFF
bin
)
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(OPENJPEG_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set OPENJPEG_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(PCRE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG

View File

@@ -53,7 +53,7 @@ FIND_LIBRARY(PUGIXML_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG

View File

@@ -175,7 +175,7 @@ UNSET(_IS_INC_CONF_DEF)
UNSET(_IS_LIB_DEF)
UNSET(_IS_LIB_PATH_DEF)
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(LIBSNDFILE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_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

View File

@@ -52,7 +52,7 @@ FIND_LIBRARY(SPACENAV_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SPACENAV_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set SPACENAV_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Spacenav DEFAULT_MSG

View File

@@ -50,7 +50,7 @@ FIND_LIBRARY(XML2_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set XML2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XML2 DEFAULT_MSG

View File

@@ -32,6 +32,7 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
${EXTRA_LIBS}
${PLATFORM_LINKLIBS}
bf_testing_main
bf_intern_eigen
bf_intern_guardedalloc
extern_gtest
extern_gmock

View File

@@ -13,7 +13,7 @@ if(NOT DEFINED RPMBUILD)
if(RPMBUILD)
message(STATUS "RPM Build Found: ${RPMBUILD}")
else()
else()
message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
endif()
@@ -21,6 +21,6 @@ endif()
if(RPMBUILD)
set(RPMBUILD_FOUND TRUE)
else()
else()
set(RPMBUILD_FOUND FALSE)
endif()
endif()

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

@@ -5,8 +5,7 @@
# cmake -C../blender/build_files/cmake/config/blender_headless.cmake ../blender
#
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE OFF CACHE BOOL "" FORCE)
set(WITH_HEADLESS ON 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

@@ -51,7 +51,7 @@ endmacro()
function(list_assert_duplicates
list_id
)
# message(STATUS "list data: ${list_id}")
list(LENGTH list_id _len_before)
@@ -242,7 +242,7 @@ function(blender_add_lib__impl
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${sources}")
#if enabled, set the FOLDER property for visual studio projects
#if enabled, set the FOLDER property for visual studio projects
if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
@@ -352,6 +352,11 @@ function(SETUP_LIBDIRS)
endif()
endfunction()
macro(setup_platform_linker_flags)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
endmacro()
function(setup_liblinks
target
)
@@ -425,7 +430,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})
@@ -581,8 +586,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
@@ -760,10 +767,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()
@@ -1051,13 +1054,19 @@ macro(remove_cc_flag
endmacro()
macro(add_cc_flag
macro(add_c_flag
flag)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endmacro()
macro(add_cxx_flag
flag)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
endmacro()
macro(remove_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
@@ -1080,7 +1089,8 @@ macro(remove_strict_flags)
)
# negate flags implied by '-Wall'
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -1092,7 +1102,8 @@ macro(remove_strict_flags)
)
# negate flags implied by '-Wall'
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
add_c_flag("${C_REMOVE_STRICT_FLAGS}")
add_cxx_flag("${CXX_REMOVE_STRICT_FLAGS}")
endif()
if(MSVC)
@@ -1122,28 +1133,39 @@ endmacro()
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
macro(remove_strict_flags_file
macro(remove_strict_c_flags_file
filenames)
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
(CMAKE_C_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${CC_REMOVE_STRICT_FLAGS}"
COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
macro(remove_strict_cxx_flags_file
filenames)
remove_strict_c_flags_file(${filenames} ${ARHV})
foreach(_SOURCE ${ARGV})
if(CMAKE_COMPILER_IS_GNUCC OR
(CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set_source_files_properties(${_SOURCE}
PROPERTIES
COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}"
)
endif()
if(MSVC)
# TODO
endif()
endforeach()
unset(_SOURCE)
endmacro()
# External libs may need 'signed char' to be default.

View File

@@ -358,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()
@@ -418,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

@@ -51,9 +51,9 @@ string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate
if(${CMAKE_GENERATOR} MATCHES "Xcode")
# earlier xcode has no bundled developer dir, no sense in getting xcode path from
if(${XCODE_VERSION} VERSION_GREATER 4.2)
if(${XCODE_VERSION} VERSION_GREATER 4.2)
# reduce to XCode name without dp extension
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME)
if(${DP_NAME} MATCHES Xcode5)
set(XCODE_VERSION 5)
endif()
@@ -64,7 +64,7 @@ if(${CMAKE_GENERATOR} MATCHES "Xcode")
message(FATAL_ERROR "Xcode 4.3 and higher must be used with cmake 2.8-8 or higher")
endif()
### end cmake incompatibility with xcode 4.3 and higher ###
if(${XCODE_VERSION} VERSION_EQUAL 4 OR ${XCODE_VERSION} VERSION_GREATER 4 AND ${XCODE_VERSION} VERSION_LESS 4.3)
# Xcode 4 defaults to the Apple LLVM Compiler.
# Override the default compiler selection because Blender only compiles with gcc up to xcode 4.2
@@ -85,7 +85,7 @@ if(${XCODE_VERSION} VERSION_LESS 4.3)
else()
# note: xcode-select path could be ambigous,
# cause /Applications/Xcode.app/Contents/Developer or /Applications/Xcode.app would be allowed
# so i use a selfcomposed bundlepath here
# so i use a selfcomposed bundlepath here
set(OSX_SYSROOT_PREFIX ${XCODE_BUNDLE}/Contents/Developer/Platforms/MacOSX.platform)
message(STATUS "OSX_SYSROOT_PREFIX: " ${OSX_SYSROOT_PREFIX})
set(OSX_DEVELOPER_PREFIX /Developer/SDKs/MacOSX${OSX_SYSTEM}.sdk) # use guaranteed existing sdk

View File

@@ -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,16 @@ 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(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables")
set(MSVC_REDIST_DIR ${VC_TOOLS_DIR})
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 +128,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")
@@ -131,7 +150,7 @@ set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT")
set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib ")
# Ignore meaningless for us linker warnings.
@@ -144,7 +163,7 @@ else()
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
if(NOT DEFINED LIBDIR)
@@ -406,7 +425,7 @@ if(WITH_OPENIMAGEIO)
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
@@ -455,7 +474,7 @@ if(WITH_OPENVDB)
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include ${TBB_INCLUDE_DIR})
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
endif()
if(WITH_ALEMBIC)

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,74 @@
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 CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
if "%WITH_ASAN%"=="1" (
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
)
) else (
if "%WITH_ASAN%"=="1" (
echo ASAN is only supported with clang.
exit /b 1
)
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS%
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,80 @@
ninja --version 1>NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo "Ninja not detected in the path"
exit /b 1
)
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 "%WITH_ASAN%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
)
)
if "%WITH_ASAN%"=="1" (
if "%WITH_CLANG%" == "" (
echo ASAN is only supported with clang.
exit /b 1
)
)
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,76 @@
if NOT "%verbose%" == "" (
echo Detecting msvc 2017
)
set BUILD_VS_VER=15
set BUILD_VS_YEAR=2017
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
)
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
)
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,88 @@
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" == "asan" (
set WITH_ASAN=1
) 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
set BUILD_VS_YEAR=2017
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) 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,27 @@
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=
set WITH_ASAN=
set CLANG_CMAKE_ARGS=
set ASAN_CMAKE_ARGS=

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,35 @@
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.
echo Experimental options
echo - 2015 ^(build with visual studio 2015^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo - clang ^(enable building with clang^)
echo - asan ^(enable asan when building with clang^)
echo - ninja ^(enable building with ninja instead of msbuild^)
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
@@ -268,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

@@ -2,43 +2,44 @@
Hello World Text Example
++++++++++++++++++++++++
Blender Game Engine example of using the blf module. For this module to work we
Example of using the blf module. For this module to work we
need to use the OpenGL wrapper :class:`~bgl` as well.
"""
# import game engine modules
from bge import render
from bge import logic
# import stand alone modules
import bgl
import blf
import bpy
font_info = {
"font_id": 0,
"handler": None,
}
def init():
"""init function - runs once"""
# create a new font object, use external ttf file
font_path = logic.expandPath('//Zeyada.ttf')
# store the font indice - to use later
logic.font_id = blf.load(font_path)
import os
# Create a new font object, use external ttf file.
font_path = bpy.path.abspath('//Zeyada.ttf')
# Store the font indice - to use later.
if os.path.exists(font_path):
font_info["font_id"] = blf.load(font_path)
else:
# Default font.
font_info["font_id"] = 0
# set the font drawing routine to run every frame
scene = logic.getCurrentScene()
scene.post_draw = [write]
font_info["handler"] = bpy.types.SpaceView3D.draw_handler_add(
draw_callback_px, (None, None), 'WINDOW', 'POST_PIXEL')
def write():
"""write on screen"""
width = render.getWindowWidth()
height = render.getWindowHeight()
# OpenGL setup
bgl.glMatrixMode(bgl.GL_PROJECTION)
bgl.glLoadIdentity()
bgl.gluOrtho2D(0, width, 0, height)
bgl.glMatrixMode(bgl.GL_MODELVIEW)
bgl.glLoadIdentity()
def draw_callback_px(self, context):
"""Draw on the viewports"""
# BLF drawing routine
font_id = logic.font_id
blf.position(font_id, (width * 0.2), (height * 0.3), 0)
font_id = font_info["font_id"]
blf.position(font_id, 2, 80, 0)
blf.size(font_id, 50, 72)
blf.draw(font_id, "Hello World")
if __name__ == '__main__':
init()

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

@@ -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,336 +0,0 @@
Physics Constraints (bge.constraints)
=====================================
.. module:: bge.constraints
Examples
--------
.. 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,38 +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,78 +0,0 @@
BL_ActionActuator(SCA_IActuator)
================================
.. module:: bge.types
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,61 +0,0 @@
BL_ArmatureActuator(SCA_IActuator)
==================================
.. module:: bge.types
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,105 +0,0 @@
BL_ArmatureBone(PyObjectPlus)
=============================
.. module:: bge.types
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,278 +0,0 @@
BL_ArmatureChannel(PyObjectPlus)
================================
.. module:: bge.types
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,129 +0,0 @@
BL_ArmatureConstraint(PyObjectPlus)
===================================
.. module:: bge.types
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,34 +0,0 @@
BL_ArmatureObject(KX_GameObject)
================================
.. module:: bge.types
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,230 +0,0 @@
BL_Shader(PyObjectPlus)
=======================
.. module:: bge.types
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,70 +0,0 @@
BL_ShapeActionActuator(SCA_IActuator)
=====================================
.. module:: bge.types
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,72 +0,0 @@
CListValue(CPropValue)
======================
.. module:: bge.types
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.

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