1
1

Compare commits

..

2627 Commits

Author SHA1 Message Date
3aaf9521b9 Experimental support for select tool fallback actions
Differential Revision: https://developer.blender.org/D6301
2019-11-27 20:42:34 +11:00
b6d8746e30 Initial working tool + selection 2019-11-27 20:42:30 +11:00
4fd99c9495 Cleanup: spelling, clang-format 2019-11-27 14:54:53 +11:00
b9e10273e0 Cleanup: warnings 2019-11-27 14:50:37 +11:00
7af5604389 Fix T69530: Do Not Refresh Bookmarks While Moving File Browser
Improve laggy performance while moving File Browser by not refreshing fsMenu lists in its init.

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

Reviewed by Bastien Montagne
2019-11-26 15:53:07 -08:00
b213d82c19 Cleanup/CMake: Remove dormant windows codesign code
This was added years ago to prepare for code-signing the executable
but was never used, buildbots use a different mechanism now to sign
so no need to keep this around.
2019-11-26 15:13:22 -07:00
Julian Eisel
b16018f637 Fix preview Template-ID broken in vertical layouts
Old code worked pure "by luck". I fixed an error in rB5bcb0c993503 that
made this "luck" go away. Special handling is needed for the preview
layout.
2019-11-26 19:47:13 +01:00
2bbdf586d5 Gpencil: Fix unreported memory leak duplicating Brush
When the brush is duplicated, the grease pencil settings doesn't need to be recreated.
2019-11-26 19:05:07 +01:00
Robert Guetzkow
98dfb4dd1c Allow deletion of directories in the file browser
This diff allows to delete directories in the file browser. The commit https://developer.blender.org/rB8825250f5a85c0c16e74ed144dd2b4a7d752042f did not include this feature.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D6083
2019-11-26 18:54:24 +01:00
bf9c2e6fde Anim: added BKE_object_moves_in_time(object) function
This function exposes the already-existing static `object_moves_in_time()`
function, and optionally recursively checks the parent object for
animatedness as well.

I also added checking `AnimData::overrides` to
`BKE_animdata_id_is_animated()`. This ensures that, apart from the optional
recursion to the parent object, the function has the same functionality.
2019-11-26 17:59:27 +01:00
b21648ab36 Anim: made object param of BKE_animdata_id_is_animated() const
No functional changes.
2019-11-26 17:56:59 +01:00
f18ad385df Alembic export: don't assume transform is always animated
Instead of always writing the transform on every frame, it's now checked
whether the object is animated at all. This could be made stricter to
reduce false positives, for example by checking FCurves and drivers to
see whether translation/rotation/scale is animated. However, this
approach is already better than the `return true` we had before.

This commit adds the BKE_animdata_id_is_animated(id) function, which
returns true if the ID datablock has non-empty animation data. This is
determined by checking the the active action's fcurves, the drivers, and
NLA tracks.
2019-11-26 16:26:52 +01:00
a018a7fb0d Removed BKE_object_is_animated()
The function isn't used anywhere, and it's deceptively returning false
negatives. For example, `modifier_dependsOnTime()` will return `false`
for hook modifiers, even when the hook target is animated. Querying the
depsgraph for dependency on the time source would be a better approach.
2019-11-26 16:26:52 +01:00
75808620ce Made ob param of modifiers_getVirtualModifierList const
The `modifiers_getVirtualModifierList()` function previously took a non-
const `Object *ob` parameter, preventing it from being called from more
restrictive functions. Since the function doesn't modify the passed
object, it could easily be made const.

No functional changes.
2019-11-26 16:26:52 +01:00
354bc1297e Clarified comment about modifiers_getVirtualModifierList()
The old comment was outdated and incorrect.

No functional changes.
2019-11-26 16:26:52 +01:00
b214e06b02 Clip Editor: Remove Image label from selector
Unfortunately, it didn't turn out to be as great as I've hoped to it
will.

The issue is: the label eats too much space, making selector buttons
and image name to be barely readable. Initial idea of making the panel
somewhat wider didn't work either: due to the sizing policy of label
it takes a lot of panel width to make image name readable.
2019-11-26 16:14:04 +01:00
9467c0dcf9 Fix T71924: Baking quaternion keyframes gives discontinuous values 2019-11-27 02:00:14 +11:00
2dac0c9179 PyAPI: add Quaternion.make_compatible 2019-11-27 02:00:14 +11:00
d29cf49e9a Fix quaternion compatibility function
Use closest quaternion instead of only checking w sign flipping,
which didn't catch all cases.

T
2019-11-27 02:00:14 +11:00
97dff0ca76 Clip Editor: Fix uninitialized plane track grabbing points
Was happening when there was an image assigned to the track.

Another pair programming session with Clement.
2019-11-26 15:55:28 +01:00
630cb1bb1d Clip Editor: Fix visualization of plane track image
Pair programming with Clement.
2019-11-26 15:55:28 +01:00
a01ba66cf6 Clip Editor: Allow opening and creating images from Plane Track panel
Differential Revision: https://developer.blender.org/D6170
2019-11-26 15:55:28 +01:00
939e4030b1 Fix T64655: Quad view toggle conflicts on macOS
Cmd-Alt-Q is a system shortcut on macOS, use Ctrl-Alt-Q.
2019-11-27 00:43:33 +11:00
fcbec6e97e BLI_task: Add pooled threaded index range iterator, Take II.
This code allows to push a set of different operations all based on
iterations over a range of indices, and then process them all at once
over multiple threads.

This commit also adds unit tests for both old un-pooled, and new pooled
task_parallel_range family of functions, as well as some basic
performances tests.

This is mainly interesting for relatively low amount of individual
tasks, as expected.

E.g. performance tests on a 32 threads machine, for a set of 10
different tasks, shows following improvements when using pooled version
instead of ten sequential calls to BLI_task_parallel_range():

| Num Items | Sequential | Pooled  | Speed-up |
| --------- | ---------- | ------- | -------- |
|       10K |     365 us |  138 us |   2.5  x |
|      100K |     877 us |  530 us |   1.66 x |
|     1000K |    5521 us | 4625 us |   1.25 x |

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

Note: Compared to previous commit yesterday, this reworks atomic handling in
parallel iter code, and fixes a dummy double-free bug.

Now we should only use the two critical values for synchronization from
atomic calls results, which is the proper way to do things.

Reading a value after an atomic operation does not guarantee you will
get the latest value in all cases (especially on Windows release builds
it seems).
2019-11-26 14:30:41 +01:00
9ecc30250a Fix T71909: Any keyframed GPLayer property is not updated when render animation
By error, the original datablock was used while rendering. Actually, only while the user is drawing the original data must be used because when we tested, the time the system uses to copy the datablock created a very bad "lag" feeling while drawing. Maybe the lag was half second only, but it ruined the pencil feeling.

I talked some time ago with Sergey about that and we decided use this approach.

Now, only the original datablock is used while the user is "moving" the pen, but not in any other situation.

Thanks @sergey for help me with this bug and sorry for thinking it was a depsgraph issue.
2019-11-26 14:05:00 +01:00
14da2b18fc Fix T71860: No versioning for drivers in Mapping node.
The new Mapping node was missing versioning code for drivers.
This patch refactors existing code and add versioning for drivers.

Reviewed By: Sergey Sharybin, Bastien Montagne

Differential Revision: https://developer.blender.org/D6302
2019-11-26 13:45:40 +02:00
2d7effc27d Fix segfault when polling MESH_OT_paint_mask_extract
`CTX_data_active_object(C)` returns `NULL` when there is no active object,
and this was not tested for in the code.
2019-11-26 12:12:29 +01:00
fa1a946d4f Fix memory leak, closing a window didn't free gestures
Exposed by test file in T71718
2019-11-26 20:58:26 +11:00
1fbca07634 Buildbot: Increaser codesign timelimit
It was possible that it would exceed when signing all the DLLs if the machine
is busy with some background tasks or when internet is slow.
2019-11-26 10:08:33 +01:00
75e85f1c9f Fix T71806: BMElem.copy_from(other) failed
Don't modify the Python reference when copying custom-data.
2019-11-26 16:28:58 +11:00
7782936977 BMesh: support copying & freeing layers by type 2019-11-26 16:19:56 +11:00
0a3f0e64c9 fix: T71718 Collada: importer does not release intermediate fcurves when importing matrix animations 2019-11-25 21:19:25 +01:00
bd5e3941de Bevel Modifier: Reset default width to 0.1 from 1.0 2019-11-25 14:06:41 -05:00
3f87ac3684 Revert "BLI_task: Add pooled threaded index range iterator."
This reverts commit f9028a3be1.

This is giving weird heisenbug crash on only Windows release builds...
Reverting until we understand to issue.
2019-11-25 19:54:40 +01:00
52f0d685ba Revert "Cleanup: Unused variable in release build mode"
This reverts commit e0cada9519.
2019-11-25 19:54:40 +01:00
Julian Eisel
5bcb0c9935 UI: Allow label for Template-ID (respecting property split layout)
Adds a `text` parameter to `bpy.types.uiLayout.template_ID()` which
causes a label to be added, as usual. Adding the label also makes the
template respect the `bpy.types.uiLayout.use_property_split` option.

Also fixes wrong layout being used in the template-ID, although I think
that didn't cause issues in practice.

Sergey requested this for usage in the Movie Clip Editor.
2019-11-25 19:50:34 +01:00
03cdfc2ff6 Fix potential access to deleted memory in OptiX kernel loading code
Calling "OptiXDevice::load_kernels" multiple times would call "optixPipelineDestroy" on a pipeline
pointer that may have already been deleted previously (since the PIP_SHADER_EVAL pipeline is only
created conditionally).
This change also avoids a CUDA kernel reload every time this is called. The CUDA kernels are
precompiled and don't change, so there is no need to reload them every time.
2019-11-25 18:36:55 +01:00
b374b24f1b UI: Widget Text Cursor Color
Adds a theme setting to specify color of widget text insertion cursor (caret).

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

Reviewed by Campbell Barton
2019-11-25 08:36:05 -08:00
78071d0cdf Fix T71892: Typo error - Distorsion to Distortion 2019-11-25 16:12:36 +01:00
e0cada9519 Cleanup: Unused variable in release build mode
Thanks Bastien for code review!
2019-11-25 15:22:21 +01:00
62ba16d7c4 Fix for the Python console not setting the cursor 2019-11-25 22:51:20 +11:00
dc9b05df22 Fix API docs build after recent changes in BMesh operators.
Note: not sure what 'type' to give for that new
`BMO_OP_SLOT_SUBTYPE_PTR_STRUCT`, name sounds generic so used
`bpy_struct` for now... :/
2019-11-25 12:33:51 +01:00
f9028a3be1 BLI_task: Add pooled threaded index range iterator.
This code allows to push a set of different operations all based on
iterations over a range of indices, and then process them all at once
over multiple threads.

This commit also adds unit tests for both old un-pooled, and new pooled
`task_parallel_range` family of functions, as well as some basic
performances tests.

This is mainly interesting for relatively low amount of individual
tasks, as expected.

E.g. performance tests on a 32 threads machine, for a set of 10
different tasks, shows following improvements when using pooled version
instead of ten sequential calls to `BLI_task_parallel_range()`:

    | Num Items | Sequential | Pooled  | Speed-up |
    | --------- | ---------- | ------- | -------- |
    |       10K |     365 us |  138 us |   2.5  x |
    |      100K |     877 us |  530 us |   1.66 x |
    |     1000K |    5521 us | 4625 us |   1.25 x |

Differential Revision: https://developer.blender.org/D6189
2019-11-25 11:58:09 +01:00
Julian Eisel
85cf56ecbc UI: Reduce width of UI-List scrollbars
When scrollbars were redesigned, the size of UI-List scrollbars wasn't
updated. Those were still huge.
This makes their size consistent with other scrollbars and frankly,
non-rediculous.
2019-11-25 11:48:59 +01:00
693d891703 Cleanup: used BKE_mesh_ prefix
Missed in recent BKE_remesh renaming.
2019-11-25 15:49:25 +11:00
bb0708a483 CMake: support building without Python
Resolve linking issues, warnings.
2019-11-25 15:45:49 +11:00
b2d940250c Cleanup: remove unused CMake WITH_MOD_CLOTH_ELTOPO option 2019-11-25 14:52:44 +11:00
00ca7a03da Fix WITH_INPUT_IME breakage in last commit 2019-11-25 13:46:48 +11:00
b92ac3e2cb UI: scale widget cursor by pixel size 2019-11-25 12:20:51 +11:00
249f4423ee Cleanup: doxygen comments
Also correct some outdated symbol references,
add missing 'name' commands.
2019-11-25 01:51:11 +11:00
ace5677ef0 Cleanup: spelling, repeated words 2019-11-25 00:55:11 +11:00
f67a685ad9 Cleanup: move console scrollback initialization into versioning 2019-11-24 23:03:07 +11:00
660f0c6a0e Preferences: disable changing 'U' on blend file versioning
Would have prevented T71612
2019-11-24 23:03:01 +11:00
8cb55f8d16 Fix T71612: Viewport rotate doesn't work
Error in version patching.
2019-11-24 22:49:26 +11:00
9af0cdcd93 Cleanup: remove unused text.selection_set select option
This was meant to set the selection end instead of the cursor
however it hasn't been working for years and seems quite obscure.
2019-11-24 22:05:59 +11:00
aa6fcabad1 Cleanup: text editor variable names 2019-11-24 22:03:57 +11:00
3106ca8f63 Text Editor: smooth scrolling
Add smooth scrolling support for vertical scrolling.

This is only active while scrolling so we don't need to support
pixel-level offsets for operators, interactions.
2019-11-24 20:19:24 +11:00
44f18ce0a6 Windows: Disable tbbmalloc for debug builds.
TBBMalloc seems to have a race condition somewhere on shutdown
that seems to show up in debug builds only, ideally we find the
issue and send a patch upstream but due to its racy nature it
has eluded capture so far. This patch disables TBBMalloc for
debug builds so that developers that actually need to get some
work done can work without being bothered by this misbehaviour.
2019-11-23 09:21:34 -07:00
373e936e3e Fixed rest of bevel regression tests.
The calculation of pro_super_r rounded to a non-exact float,
so put in rounding code for the special cases.
2019-11-22 13:14:37 -05:00
71ddcf1a08 Paint: Smoother curve preset
This implements a 5th-order equation smoothstep, which produces a flat
surface at the brush center. Some users find that our current grab brush
is too sharp, so now we have both options.
This also improves the behavior of the new clay brushes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6265
2019-11-22 18:21:44 +01:00
2ff1919b45 Fix make BUILD_CMAKE_ARGS not combining with targets like ninja and lite
Previously make BUILD_CMAKE_ARGS="" on Linux and macOS would override any cmake
arguments that come from the targets. Now they are concatenated.
2019-11-22 17:38:15 +01:00
59aef0ad5d Fix T71255: Particle hair not showing in viewport with OptiX after scaling
The OptiX intersection program for curves uses "optixGetObjectRayDirection"
to get the ray direction in object space (which was inverse transformed
with the current transformation matrix). OptiX does no additional operations
on it, so if there is a scaling transform, the direction is not normalized.
But the curve intersection routine expects that. In addition, the distances
used in "optixGetRayTmax()" and "optixReportIntersection()" are in world
space, so need to adjust them accordingly.
2019-11-22 17:30:22 +01:00
aadbb794cd Fix T71741: Crash showing the object relations menu 2019-11-23 03:04:57 +11:00
Julian Eisel
b037ba2665 UI: Changes to Graph Editor selection and transform
When introducing "drag-all-selected" support all over Blender, we
figured this wouldn't work well with the Graph Editor
selection/transform behavior.
Hence, William and I worked on the following changes, although we used
this chance to improve the behavior in general too.
For more info see T70634.

* Handles now always move with the key, regardless if they are selected
  or not.
* Selecting the key doesn't select the handles anymore, their selection
  is separate.
* Multiple keys and handles can now be dragged.
* Dragging a handle moves all selected handles **on the same side**.
* Tweak-dragging any handle can never affect any keyframe location,
  only handles.
* G/R/S should behave as before.
* Changing the handle type with a key selected always applies the change
  to both handles.
* Box selection with Ctrl+Drag now allows deselecting handles (used to
  act on entire triple only).
* Box selection //Include Handles// option now only acts on visible
  handles, wasn't the case with Only Selected Keyframes Handles enabled.
* Box selection //Include Handles// is now enabled by default in all
  bundled keymaps.

The changes have been tested for some days by the animators here in the
Blender Animation Studio. Some changes are based on their feedback.

Also, this improves/adds comments for related code.

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

Reviewed by: Sybren Stüvel, William Reynish
2019-11-22 16:54:43 +01:00
177dfc6384 Fix T71273: Bad encoding of utf-8 for Text objects
`BLI_strncpy_wchar_from_utf8` internally assumes `wchar_t` is 32 bits
which is not the case on windows.

The solution is to replace `wchar_t` with `char32_t`.

Thanks to @robbott for compatibility on macOS.

Differential Revision: https://developer.blender.org/D6198
2019-11-22 12:27:34 -03:00
1304cee920 Fix some of the bevel regression tests.
The code changes for custom bevels did not recalculated profiles
in certain non-custom-profile cases after projection plane moves.
2019-11-22 09:30:10 -05:00
27127bf533 Depsgraph: Ignore action time dependency if it's not needed
It is possible to have action which is not nullptr but which have no
f-curves in it (for example, animate cube's location, then delete all
f-curves).

Such situation should not add time dependency as it could slow down
scene evaluation on frame change.
2019-11-22 14:02:59 +01:00
2a38b857f7 LibOverride: Make diffing several times faster.
Diffing on undo steps is a critical performance point of override
system, although not required for override itself, it gives user
immediate feedback ove what is overridden.

Profiling showed that rna path text search over overrides operations was
by far the most costly thing here, so now using a runtime temp ghash
mapping for this search instead.

Seems to give at least 5 times speedup on big production rig.
2019-11-22 12:26:36 +01:00
cfb7f508ce Fix T69332: 'Reset to Default Value' on a custom string property crashes
Thx @campbellbarton for the heads up!

Maniphest Tasks: T69332

Differential Revision: https://developer.blender.org/D6284
2019-11-22 12:13:10 +01:00
e98d27fd8d Keymap: use tab key for indent or auto-complete
Only indent when there aren't characters before the cursor.

This resolves the conflict with Ctrl-Space for view maximize.

D6239 by @wbrbr for text editor, based console support on this.
2019-11-22 20:53:40 +11:00
e93aa9c0fc Fix T71621: VSE crashes when playing last frame of audio
Porting bug fix from audaspace upstream.
2019-11-22 10:34:01 +01:00
3d015c71cc Gizmo: show extrude gizmos with dark '+' instead of negative space 2019-11-22 17:23:24 +11:00
66297cc26b Gizmo: support drawing contrasting shapes a generic backdrop
Previously the only way to draw polygon shapes from buttons
was to use a polygon that included the circular outline
with negative space for the un-filled areas.

This didn't always have visibility, especially when the gizmo was
overlaying colors that didn't contrast much.

Support drawing a generic backdrop with a polygon shape over it.
2019-11-22 17:18:52 +11:00
35f2e4a35c Cleanup: BKE_suggestions -> BKE_text_suggestions
The term suggestions on it's own is too ambiguous, use BKE_text prefix.
2019-11-22 13:32:57 +11:00
3403645575 Missed header guard update last commit 2019-11-22 13:32:57 +11:00
2ecb664520 Cleanup: rename mirror -> mesh_mirror
The term mirror on it's own is too ambiguous, use BKE_mesh prefix.
2019-11-22 13:15:04 +11:00
e3204db747 Cleanup: warnings, set but unused vars 2019-11-22 13:10:01 +11:00
f903835370 Fix Windows Build
I forgot to change the old BLI_task functions for the new BKE_pbvh
functions in Topology Slide/Relax.
2019-11-21 20:22:03 +01:00
a482d940bc Sculpt: Invert Scrape to Fill
After adding normal radius, the main use of the Scrape brush is to create flat surfaces with sharp edges. In that case, it does not make sense to have our current "Peaks" version of the brush as its inverted version.
The correct inverted version of Scrape for this use case is the Fill brush. This way you can use this tool to crease both concave and convex sharp edges and to fix the artifacts one version produces with its inverted version.
I think we should merge these two tools into one, but for now, this solution keeps compatibility with the old behavior.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6022
2019-11-21 19:06:42 +01:00
a47f694b86 Sculpt: Topology Slide/Relax
This commit implements the Topology Slide/Relax brush and the Relax mesh filter.
These tools are designed to move the topology on top of the mesh without affecting the volume.
The Topology Slide/Relax brush slides the topology of the mesh in the direction of the stroke. When pressing shift, it has an alternative smooth mode similar to the Relax Brush in the sculpt branch. It should be way more stable and produce fewer artifacts.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6059
2019-11-21 18:58:48 +01:00
186bd1759f Pose brush: Smooth Iterations Brush Property
The smooth iterations of the pose factor were hardcoded to 4. This works fine in most situations when you are posing a low poly mesh, which is the main use case of this tool. I added the smooth iterations as a brush property in case you need to pose a high poly mesh directly without producing artifacts.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6157
2019-11-21 18:41:58 +01:00
470fe59f7e Sculpt: Mask Slice
This operator is similar to Mask Extract, but it deletes the masked points on the original mesh and fills the holes. This can be useful for quickly trimming or splitting an object.
This is not meant to be the main trimming tool of sculpt mode. I plan to have a set of trimming tools based on geometry booleans (trim box, lasso, line, bisect...) but in some cases doing a mask selection is more convenient.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6160
2019-11-21 18:27:30 +01:00
c3279be222 Sculpt: Multiplane Scrape Brush
The Multiplane Scrape brush creates sharp edges with a given fixed angle by trimming the mesh with two planes in local space at the same time.  When working with stylized or hard surface models, this brush produces way better results and is more predictable than any other crease/flatten brush based on curves and alphas.
It is also the first brush we have than can produce hard surface concave creases.
The Multiplane Scrape Brush also has a dynamic mode where it samples the surface to fit the angle and scrape planes during a stroke. With this mode enabled you can sculpt multiple times over the same edge without creating artifacts.
It can also create creases that change between concave and convex during the same stroke.

The behavior of this brush will improve after merging patches like D5993 and its behavior in concave creases can still be improved, so I will keep tweaking its parameters and default values once we have all brush properties available.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6174
2019-11-21 18:16:42 +01:00
c23dbcf37d Bones: implement a new Aligned Inherit Scale mode.
Implement one more way of inheriting scale from the parent
bone, as an addition to the choices introduced in D5588.

This new mode inherits parent scale as if the parent and child
were not rotated relative to each other, always applying parent
X scale to child X scale and so forth. It is quite natural for
connected bone chains with coherent roll, like limbs or tentacles,
falling roughly between Average and Fix Shear in how closely
the parent scaling is followed.

Currently this can be achieved by using Inherit Scale: None plus
a Copy Scale with Offset from parent on the child; however, this
is cumbersome, and loses the distinction between true local and
inherited scale in the child's Local space.

This new mode also matches how the Before/After Original mix
modes work in the Copy Transforms constraint.

On the technical side this mode requires adding a right side
scale matrix multiplication into the Local<->Pose conversion,
in addition to the existing two left side matrices used for
location and orientation.

Differential Revision: https://developer.blender.org/D6099
2019-11-21 20:10:07 +03:00
6c9be3b27c Sculpt: Enable symmetrize operator with Dyntopo disabled
After refactoring the mirror modifier and supporting geometry modifications with PBVH_FACES this operator can be easily implemented without Dyntopo.
i
The symmetrize button and options are still in the Dyntopo pannel. There are patches like doing multiple modifications in the Sculpt mode UI, so we need to find a way to organize this better.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6180
2019-11-21 18:07:04 +01:00
316107d4cd Sculpt: New Clay Brush
The previous Clay brush was similar to flatten. Now it has a different plane calculation and falloff, based on the position of the vertices before deforming them, so it feels more like adding clay to the model.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6228
2019-11-21 18:04:46 +01:00
c7ade50dee Clay Strips: Input pressure curve and new defaults
By squaring the pen pressure and disabling BRUSH_SPACE_ATTEN the brush
feels like it has a bigger strength range, wich makes it easier to
control when applying less pressure in order to smooth sculpted
surfaces.

Each brush should have a custom input pressure curve by default to get
an optimal behaviour and make all brushes consistent, but that is going
to take some time to get it right.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6214
2019-11-21 18:02:33 +01:00
15f82278d5 Sculpt/Paint: Dash Ratio and Dash Samples
Dash Ratio and Dash Samples are brush properties to modify the strength of the brush during a stroke. This is useful to create dashed lines in texture paint or stitches in sculpt mode.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5949
2019-11-21 17:55:36 +01:00
2ec9aa3b71 Cleanup: spelling
One of the corrections from last cleanup was wrong.
2019-11-21 23:30:51 +11:00
cee9478985 Fix T68499: weight paint gradient is broken with generative modifiers
Caused by rBac442da4a14d.

Above commit tweaked the logic to not only early out, but also set the
WPGradient_vertStore screen coord to FLT_MAX in case this original index
was visited before [gradientVertInit__mapFunc].
For generative modifiers though, we might get here multiple times for the
same orig index, resulting in a valid orig index being made invalid for
gradientVertUpdate__mapFunc [which would early out in case of FLT_MAX].

Restored original logic, so that setting FLT_MAX only really happens
when it should: when ED_view3d_project_float_object fails...

Maniphest Tasks: T68499

Differential Revision: https://developer.blender.org/D6282
2019-11-21 13:20:04 +01:00
1fbb86654a Cleanup: spelling 2019-11-21 23:15:11 +11:00
7c18fcbe03 Cleanup: clang-format
Also remove unused vars.
2019-11-21 23:15:02 +11:00
355905cb02 Fix T67873: View Selected in Graph Editor (Only Selected Curve
Keyframes) takes hidden keys into account when calculating zoom

Note that with the 'View Only Selected Curve Keyframes' option enabled,
it is also possible to select [box/circle/lasso] hidden/non-visible
keyframes. Think this should never happen, but that is for a later
commit (along some deduplication of animdata filtering code)

Reviewed By: Severin, Sybren

Maniphest Tasks: T67873

Differential Revision: https://developer.blender.org/D6237
2019-11-21 13:08:33 +01:00
c637290a6e Cleanup: remove unused value2d gizmo 2019-11-21 23:00:04 +11:00
616c2d7531 Missed last commit 2019-11-21 23:00:04 +11:00
f4a4ec8425 Tool System: make smooth & randomize modal operators
Previously these used a gizmo to redo the operator however this
complicated having on-screen gizmos to access tools (see T66304).

Replace this with a generic way to make an operator that only has an
execute function into a modal operator.

This is used for smooth and randomize tools.

Unlike operator gestures, this handles storing and resetting the data.

Currently this only handles edit-mode data, however it's can be
extended to other kinds of data.
2019-11-21 22:45:15 +11:00
20620afc33 Object: edit-mode data support for object vertex coordinate access
Allows to access/transform/restore edit-mode
coordinates in a generic way.
2019-11-21 22:45:15 +11:00
d98d4fce93 Fix T62631: Cloth vertex mass capped to a very low number on scaled scenes.
Removed the weight limit and made the setting more clear in what it actually does.
IE, it controlls the weight of the vertices of the cloth mesh

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5450
2019-11-21 12:31:40 +01:00
f1518d0f28 Fix T71412: Add transform component to deforming modifier
Dynamically bound mesh deform modifiers failed to update the viewport on
object transformation of deformer. The TODO by Sergey, which suggested
adding the transform component to the depsgraph, was already there, and
worked to fix T71412.
2019-11-21 12:24:07 +01:00
8bc57e5b91 Add curve decimate in the graph editor
Added a animation curve decimate operator in the graph editor

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D4841
2019-11-21 11:58:35 +01:00
122ba774e0 Fix T71621: VSE crashes when playing last frame of audio
Due to some floating point errors the last frame of a VSE audio strip can
cause integer overflow and crash Blender. This overflow was caused by a
cast from `int64_t` to `int` without prior check. The crash is fixed by
keeping the variable as `int64_t` for as long as possible.
2019-11-21 10:01:12 +01:00
ba1e9ae473 Bevel: Custom Profile and CurveProfile Widget
Custom profiles in bevel allows the profile curve to be controlled by
manually placed control points. Orientation is regularized along
groups of edges, and the 'pipe case' is updated. This commit includes
many updates to comments and changed variable names as well.

A 'cutoff' vertex mesh method is added to bevel in addition to the
existing grid fill option for replacing vertices.

The UI of the bevel modifier and tool are updated and unified.

Also, a 'CurveProfile' widget is added to BKE for defining the profile
in the interface, which may be useful in other situations.

Many thanks to Howard, my mentor for this GSoC project.

Reviewers: howardt, campbellbarton

Differential Revision: https://developer.blender.org/D5516
2019-11-20 16:25:28 -05:00
8c6ce74239 UI: Text Editor Visual Changes
Various small changes to Text Editor, mostly to do with scaling, alignment, and theme support.

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

Reviewed by Campbell Barton
2019-11-20 12:59:19 -08:00
0418e28944 New splash screen for master branch!
This way we can tell master from previous releases apart.

Splash by Gleb Alexandrov, Aidy Burrows and the Blender community
2019-11-20 14:58:10 +01:00
66bec8c25d Alembic: clean up exporter metadata code
The Alembic file metadata object was created in one place, a bit of
metadata was added, then it was passed along with other properties which
were then injected as metadata in another function. This is now cleaned up.

No functional changes.
2019-11-20 10:26:59 +01:00
dfdbb237bb Alembic: Upgrade from 1.7.8 to 1.7.12
Alembic 1.7.12 introduces a 'DCC FPS' hint, allowing Blender to write
the scene frame rate to the Alembic file. This will make it possible for
importers and converters to properly deal with situations where 'frame
number' is the only reference to time.

Writing this new DCC FPS hint will be done in a separate commit. Here
only the Alembic library is upgraded from 1.7.8 to 1.7.12.
2019-11-20 10:19:00 +01:00
2defd81b5e Cleanup: comments 2019-11-20 18:12:50 +11:00
43eb34ec81 Fix T71680: _PyObject_LookupAttr memory leak 2019-11-20 17:53:22 +11:00
9d8af29267 Cleanup: remove WITH_RAYOPTIMIZATION
This is redundant as WITH_CPU_SSE adds these flags
when they're supported.
2019-11-20 14:54:50 +11:00
858bd1d4d0 Fix assert running remesh with OpenVDB disabled 2019-11-20 14:54:50 +11:00
Dalai Felinto
3b16578fb4 Outliner: Fixup for previous commit on tooltip/crash fix
The issue was actually in Python extras (where it shows the ENUM option).

I got a bit distracted by the "(undocumented operator)" message.
It made me miss the missing ENUM once the crash was gone.
2019-11-20 00:42:30 -03:00
Dalai Felinto
bc66810064 Outliner: Fix crash for tooltips on ID operations
This was introduced on 9ca2cbdcea.
2019-11-20 00:29:28 -03:00
Dalai Felinto
9ca2cbdcea Outliner: Don't show id operations (make single user) when not supported
For the make single user operation to work we expect a parent of the
datablock to be around. However this is often not the case when not
accessing the data from Scenes or Viewlayer display modes.

For now we simply not show them in the other cases. They can be added
later though, by testing the outliner tree parent compatibility with the
expected parent id.

Fix T71673
Differential Revision: https://developer.blender.org/D6276
2019-11-19 14:28:59 -03:00
83e8765562 Subdiv: Tweak threading settings
Ensure that all threads on a multi-core system are used.

The issue was that BLI_task module was trying to be smart and
used heuristic to find optimal number of iterations per thread.
This heuristic assumes that tasks are light-weight, which is
not a case for subdivision surface.

On a higher subdivision level with a file from T70826 the
evaluation time goes down from 0.25 to 0.17 seconds per modifier
evaluation.

When D6189 is finalized we can being some extra performance
improvement.
2019-11-19 16:58:58 +01:00
6fea251e01 Use mutex for lock in image.c
Usage of spinlock during heavy IO gave reduced performance
see D6267 for details.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D6267
2019-11-19 07:37:16 -07:00
Dalai Felinto
12915aad65 Fix T69798: Pinning empty image objects
We have no dedicated image context tab, so for now making sure we don't
end up passing its ID as the pinned one.

If we ever get one, we then will need a different solution here, like
changing the ID that owns the data to be the object, instead of the
empty image datablock.

Differential Revision: https://developer.blender.org/D6273
2019-11-19 10:26:31 -03:00
08588d06e8 Fix T71554: 'Hide Unselected' not working for certain selections
rBc6cbcf83d015 caused to early out e.g when not all faces were selected
(but surrounding faces were, so implicitly all vertices were selected).
Now take (mixed also) selection mode into account.

Maniphest Tasks: T71554

Differential Revision: https://developer.blender.org/D6254
2019-11-19 09:51:06 +01:00
04272613a7 Python API: assume that a crashed Python operator returned FINISHED.
The CANCELLED return value from an operator is intended for
signaling that the operator aborted execution without changing
anything, and an Undo stack entry should not be created.

When a Python operator crashes, it is not safe to assume that
it did nothing, so it should interpret it as FINISHED instead.
Otherwise, the undo system behavior after an operator failure
feels broken.

Differential Revision: https://developer.blender.org/D6241
2019-11-18 22:03:40 +03:00
Alessio Monti di Sopra
64c27b9690 WM: remove view operators from the undo stack 2019-11-19 00:56:07 +11:00
Matias Mendiola
d66bc3807f GPencil: Layers and Materials Specials menu updates
Rename and separate Layers and Materials Specials menu from other buttons for better consistency

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D6271
2019-11-18 14:33:25 +01:00
71d65e881f Merge branch 'blender-v2.81-release' 2019-11-18 23:58:02 +11:00
c2a251d655 Build deps: Actually tweak EOL style
Seems that `git am` will force native EOL.
2019-11-18 13:55:55 +01:00
115a5bf65a Correct error in last commit 2019-11-18 23:53:34 +11:00
14882c4bed Build deps: Fix compilaiton of OpenCollada
Was caused by "wrong" EOL characters used in the patch: the file is
actuallyu saved using CRLF EOL style.

The patch was using CRLF as well for until recent change in the C
runtime.
2019-11-18 13:52:49 +01:00
995b98aee2 Merge branch 'blender-v2.81-release' 2019-11-18 23:36:16 +11:00
1cb07530a9 Fix T71564: Undo stroke lags after entering sculpt mode
Regression since 2.80, see: T71434
2019-11-18 23:35:25 +11:00
d124545013 Fix wrong name for QuadriFlow undo step 2019-11-18 22:43:30 +11:00
8d4460b6c4 GHOST: Only spam about X11 errors when using --debug-ghost
This commit adds a new command line argument --debug-ghost and
makes it so X11 errors happening during context initialization
are only printed when this new flag is sued.

There is no need to flood users with errors when their GPU is
not supporting latest OpenGL version. Or, at a very minimum,
the error must be more meaning full.

Differential Revision: https://developer.blender.org/D6057
2019-11-18 09:28:17 +01:00
dc8be23234 Merge branch 'blender-v2.81-release' 2019-11-18 16:39:16 +11:00
11549098ea Merge branch 'blender-v2.81-release' 2019-11-18 16:39:10 +11:00
dfc232f892 Merge branch 'blender-v2.81-release' 2019-11-18 16:39:01 +11:00
99640d0622 Fix building on NetBSD 2019-11-18 16:27:06 +11:00
047d2b0559 CMake: GLEW_INCLUDE_PATH wasn't set for system glew 2019-11-18 16:26:32 +11:00
321afe0cd6 Fix building on 32bit systems 2019-11-18 16:25:59 +11:00
6d9d24e3d4 msvc: Use debug versions of tbb malloc for debug builds
Using the release versions gave unpredictable results when
the msvc debugger was attached for some developers.
2019-11-17 14:26:29 -07:00
67fa8d2307 Fix: Build error with msvc
std::min requires the algorithm header
2019-11-17 09:09:58 -07:00
fb1cbbaf46 Fix T71322: Crash in Audaspace with some video file
Getting upstream audaspace fixes for audio files with more than 8
channels.
2019-11-17 09:02:18 +01:00
e385bdb228 Fix a bug in the T34039 hack in case when a modifier key is not mapped.
In order to recover from a transient Focus Out - Focus In disruption
in the middle of a shortcut, which can be caused by certain window
managers, Blender has code that checks which modifier keys are pressed
after Focus In and restores the modifier state based on that.

If one of the Ctrl, Shift, Alt, Super keys is not mapped anywhere
in the active keyboard layout, XKeysymToKeycode returns the invalid
zero keycode, and reading the key state produces garbage, which can
cause an invalid modifier state. Check the return value to avoid this.
2019-11-16 11:56:38 +03:00
e5b788bad8 Fix T68191: Make-instances-real doesn't select the new instances
2.79 also did this [select the new instances] which was useful.
2.79 also kept the instancer selected [this patch deselects]

Reviewed By: mont29

Maniphest Tasks: T68191

Differential Revision: https://developer.blender.org/D6233
2019-11-15 21:45:52 +01:00
17cb32c7bc Merge branch 'blender-v2.81-release' 2019-11-16 03:34:19 +11:00
eba4a4bd73 Fix active bone flip not activating the wpaint vertex group 2019-11-16 03:32:23 +11:00
554321c6fb Merge branch 'blender-v2.81-release' 2019-11-16 02:49:45 +11:00
b266b1034f Cleanup: quiet warnings 2019-11-16 02:49:15 +11:00
d61f2cac18 Merge branch 'blender-v2.81-release' 2019-11-16 02:42:33 +11:00
69b587eb3e Merge branch 'blender-v2.81-release' 2019-11-16 02:42:27 +11:00
eb23c7660b Merge branch 'blender-v2.81-release' 2019-11-16 02:42:19 +11:00
4cf24c10e2 Merge branch 'blender-v2.81-release' 2019-11-16 02:42:07 +11:00
0384cc6f78 API Docs: don't show functions in 'bpy.app.handlers'
This shows the function and it's memory location,
it's not useful for docs so remove it.
2019-11-16 02:41:17 +11:00
4ca87085e0 API Docs: only document built-in types
Some types were documented in bpy.types aren't accessible there.

For now, disable documenting types from add-ons and some types from
bl_operators, bl_ui... since these are mostly for internal use.
2019-11-16 02:39:51 +11:00
dc726fed82 PyAPI: add class and module attributes to rna_info.InfoStructRNA
Module access is needed for documentation generation to exclude
non built-in modules.

This also fixes a bug creating references to non built-in types.
2019-11-16 02:39:51 +11:00
f64064e4b1 Docs: correct indent for to_swing_twist docstring 2019-11-16 02:39:51 +11:00
Dalai Felinto
ef71668ac5 Merge remote-tracking branch 'origin/blender-v2.81-release' 2019-11-15 12:10:55 -03:00
Julian Eisel
97f3626533 Merge branch 'blender-v2.81-release' 2019-11-15 16:34:46 +01:00
Julian Eisel
f641c60530 Fix T70991: Maximized file browser hides file name bar on Windows
`WS_CHILD` is a different kind of child window that what we define as
child window. See http://forums.codeguru.com/showthread.php?491604.

Setting this style flag seems to mess things up a bit in our
configuration. The name bar is actually being overlapped by the Windows
task bar then. Not totally sure why this happens, but I think it's
because windows with the `WS_CHILD` style are positioned relative to the
parent, not the desktop (screen without taskbar). So it uses the full
space available when maximized, which isn't clipped by the taskbar
anymore.
2019-11-15 16:34:09 +01:00
Dalai Felinto
49db3f6bf1 Fix: Filebrowser saving dialog size when maximized
Reviewed By: Severin

Differential Revision: https://developer.blender.org/D6260
2019-11-15 12:10:16 -03:00
f8354d492d Fix crash when freeing Blender after GTests
This only frees brush_rng and random_tex_array when they were actually
previously allocated.

In a unit test (see D6246) I want to be able to partially start Blender
so that I can load a blend file. To prevent memory leaks, I also want to
be able to release memory, which currently requires calling
`BKE_blender_free()`. This unconditionally calls `RE_texture_rng_exit()`
and `BKE_brush_system_exit()`, which now crash on freeing `NULL`. This
patch fixes that.

Allocation (`BKE_brush_system_init()`) and freeing
(`BKE_brush_system_exit()`) are done asymmetrically. The allocation
functions are called from `main()` in the creator module, but the
freeing is done by `BKE_blender_free()` the Window Manager. Ideally we
symmetrise this and initialise Blender from outside the window manager
(so that the initialisation can be done without WM and Python too), but
for now I'm happy when things don't crash.

Reviewed by: sergey via pair programming
2019-11-15 15:13:18 +01:00
b6973ed760 Keymap: pressing leader key (Alt) again closes tool prompt
Provides a convenient way to close
if the tool prompt is opened by accident.
2019-11-15 14:36:16 +11:00
8863fc65ca Cleanup: unused argument, variable warnings 2019-11-15 14:36:16 +11:00
Julian Eisel
96ce32dca6 Fix T71590: Closing file browser reopens previously closed render view
The render view window was never closed actually, just moved behind the
main window. It's properly closed now.

It should also behave more like expected when there already is a
temporary window open (e.g. Preferences).
2019-11-15 00:23:52 +01:00
YimingWu
91248876e5 GPencil MultiStroke modifier
This patch includes a modifiers that developed for NPR rendering.

- MultiStroke modifier that generates multiple strokes around the original ones.

Differential Revision: https://developer.blender.org/D5795
2019-11-14 19:24:49 +01:00
8ff9eb97fb Merge branch 'blender-v2.81-release' 2019-11-14 10:44:27 +01:00
c25a910e4e Buildbot: Explicitly disable code signer on Linux and macOS
The script requires Python 3.7 as a very minimum, and CentOS is
only 3.6.

On macOC there was an access to a None object, due to missing
implementation of code signer on this platform.
2019-11-14 10:40:28 +01:00
92953fdefd Merge branch 'blender-v2.81-release' 2019-11-14 19:53:26 +11:00
cdca094224 Merge branch 'blender-v2.81-release' 2019-11-14 19:52:52 +11:00
9fff74f144 Sculpt: disable undo from any UI elements in sculpt mode
Causes undo push in sculpt mode, see: T71434
2019-11-14 19:50:48 +11:00
bcff803712 Paint: disable undo when changing the brush or it's size
Causes undo push in sculpt mode, see: T71434
2019-11-14 19:48:08 +11:00
079fd1579c Merge branch 'blender-v2.81-release' 2019-11-14 17:34:56 +11:00
47da01a4db Fix T70211: Brush keybindings failed with non-brush tool active 2019-11-14 17:29:42 +11:00
11198ce48a Merge branch 'blender-v2.81-release' 2019-11-14 16:58:49 +11:00
f16f2f8762 Fix macOS using conflicting key binding Cmd-.
Used for toggle origins, conflicts on macOS, use Ctrl-. instead.
2019-11-14 16:55:31 +11:00
9b6d31fa69 Merge branch 'blender-v2.81-release' 2019-11-13 17:27:18 +01:00
9bd0d8b550 Sculpt: Sculpt template defaults
This commit includes all changes listed in T71366 except for the 2 column toolbar layout.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6225
2019-11-13 17:25:49 +01:00
9462d911ea Merge branch 'blender-v2.81-release' 2019-11-13 17:20:18 +01:00
fe86375d1c Force sculpting on highest multires level
This is a workaround for T58473 to avoid likely event of ruining
sculpted data.

Differential Revision: https://developer.blender.org/D6244
2019-11-13 17:15:54 +01:00
d7b3b3b22f Merge branch 'blender-v2.81-release' 2019-11-14 00:59:44 +11:00
c7b7722254 Fix T71434: Sculpt lags changing brush size
Add a check to wm.radial_control so undo steps are only added
to properties that have undo enabled (as is done with number buttons).
2019-11-14 00:57:26 +11:00
5ff7827980 Cleanup: correct mul_v4_v4fl declaration 2019-11-14 00:09:39 +11:00
2179f314a6 Cleanup: use int for operator return argument 2019-11-14 00:08:02 +11:00
Jeroen Bakker
e527544b76 Cycles: OpenCL Performance
When using OpenCL with Cycles the rendering time increased substantial.
After doing some tests the bottleneck was found in 4d voronoi and 2d and
3d smooth voronoi.

This change will hide these behind a specific compile directive so the
speed will improve.

AMD RX480 + BMW scene

    2.80 (3:10)
    2.81 (5:48)
    2.81 excluding 4d voronoi+2d/3d smooth (3:50)

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D6231
2019-11-13 12:55:44 +01:00
97d79ca844 Merge branch 'blender-v2.81-release' 2019-11-13 11:49:09 +01:00
ca1721270a Fix T71503: Wrap + displace + multires + Sculpt crash
The root of the issue goes to the discontinuity between the way how
mesh_calc_modifiers() and BKE_sculpt_multires_active() works.

At some point detection of original data usage by a modifier got
broken: the mesh_final based check is unreliable because deform-only
modifiers will create mesh_final for the connectivity information.

This made it so modifier stack evaluation would skip multires
evaluation, but the sculpt code will assume the multires is properly
applied.

This change makes it an explicit check about whether there are any
non-deform-only modifiers applied.

Pair programming and review together with Bastien, thanks!
2019-11-13 11:29:19 +01:00
5fde907fd3 Modifiers: Correct deform-only modifiers
There was a discontinuity between how deform-only modifiers are applied
for the case when result deform mesh is requested and when it is not.

Namely, the input mesh will always be guaranteed to present in the
former case, but not in the latter.

This change makes it so input mesh to deform-only modifiers is always
at consistent state.

Pair programming and review together with Bastien, thanks!
2019-11-13 11:29:00 +01:00
c73a99ef90 Initial implementation of code signing routines
This changes integrates code signing steps into a buildbot worker
process.

The configuration requires having a separate machine running with
a shared folder access between the signing machine and worker machine.

Actual signing is happening as a "POST-INSTALL" script run by CMake,
which allows to sign any binary which ends up in the final bundle.
Additionally, such way allows to avoid signing binaries in the build
folder (if we were signing as a built process, which iwas another
alternative).
Such complexity is needed on platforms which are using CPack to
generate final bundle: CPack runs INSTALL target into its own location,
so it is useless to run signing on a folder which is considered INSTALL
by the buildbot worker.

There is a signing script which can be used as a standalone tool,
making it possible to hook up signing for macOS's bundler.

There is a dummy Linux signer implementation, which can be activated
by returning True from mock_codesign in linux_code_signer.py.
Main purpose of this signer is to give an ability to develop the
scripts on Linux environment, without going to Windows VM.

The code is based on D6036 from Nathan Letwory.

Differential Revision: https://developer.blender.org/D6216
2019-11-13 09:24:41 +01:00
b09498700c Merge branch 'blender-v2.81-release' 2019-11-13 15:08:43 +11:00
c98b062f87 Merge branch 'blender-v2.81-release' 2019-11-13 15:08:29 +11:00
d60a60f0cb Add support for the TBB allocator on windows.
The heap on windows is single threaded causing it to lag behind linux in performance in allocation heavy multithreaded scenarios, BVH building is a prime example.

See https://developer.blender.org/D6218 for benchmark results

for testing with the allocator enabled/disabled you can set the environment variable TBB_MALLOC_DISABLE_REPLACEMENT=1 to disable the TBB allocator.

Reviewed By: @sergey

Differential Revision: https://developer.blender.org/D6218
2019-11-12 20:55:39 -07:00
d32520932f Fix sculpt + undo curve crash
PaintCurve data ID data wasn't being remapped.
Error in initial undo refactor.
2019-11-13 14:04:18 +11:00
4782e941c8 Fix T71494: brush curve transform crash in sculpt mode
Error in 309cd047ef
2019-11-13 13:33:46 +11:00
c69872bd2f Merge branch 'blender-v2.81-release' 2019-11-12 14:30:22 +01:00
1252577580 Safer fix for make_update.py on buildbot
Makes it so compilation doesn't fail when the SVN updating
stumbles upon checkout which doesn't have correspondence in
a tag, but which isn't so risky as previous change.
2019-11-12 14:28:39 +01:00
1e19ff8bfd Revert "Fix issues with make_update.py when run from release branch"
This reverts commit 8e9e58895b.

The change broke behavior when typing `make update` from the root of
the sources: tests folder wouldn't be updated anymore.

Getting quite close to release now, so will revert to a safer change.
2019-11-12 14:27:47 +01:00
5fcbec9fce Merge branch 'blender-v2.81-release' 2019-11-12 14:06:54 +01:00
8e9e58895b Fix issues with make_update.py when run from release branch
The issue was rooting to the fact that the script was iterating into
every directory inside of blender.git/../lib/ and attempted to switch
them to the desired path. This doesn't work in an environment where
both master and release branch are built (or any environment where
non-needed SVN directories are not automatically removed).

This change makes it so script explicitly generates a list of
directories which are required for the build. For example, the script
now stores an exact folder with ABI such as win64_vc14.

Only those explicitly listed directories will be updated.

This allows to:

- Solve compilation failure of 2.81 branch after checkout for
  win64_vc15 libraries has been created.

- Fail compilation if actually expected tag is missing (for example,
  when trying to build release branch prior to libraries tag).

Now, there was a confusing logic about possible .svn folder in
lib_dirpath (effectively, blender.git/../lib/.svn) which is not
something what is supposed to happen with the setup of buildbot we are
using for quite some time now. This logic has been removed now.

This change includes old-style string format(), mainly because it is
not know that the buidlbot scripts are run using python3 on CentOS
builder.

Differential Revision: https://developer.blender.org/D6230
2019-11-12 14:01:06 +01:00
5b5dccbc80 Merge branch 'blender-v2.81-release' 2019-11-12 12:24:19 +01:00
65bc5041c3 Fix T71508: wrong gravity settings in scene defaults
Typo in rBf5e0dfe59c7e.
Showed when creating a new default scene.

Maniphest Tasks: T71508

Differential Revision: https://developer.blender.org/D6229
2019-11-12 12:20:17 +01:00
Dalai Felinto
7afec5bea1 Merge remote-tracking branch 'origin/blender-v2.81-release' 2019-11-11 15:30:57 -03:00
Kevin Buhr
8c9e6f123a Fix T71461: Add IN_PLACE_INSTANCES to part_prim and part_axis object mode particle shaders
For `Particle Properties -> Viewport Display -> Display As` set to
circle/cross/axis, particle instances are associated with a single
resource handle (and, in particular, a single model matrix), so define
`IN_PLACE_INSTANCES` to get the right index for `ModelMatrix` and
`ModelInverseMatrix` in the shader.

Differential Revision: https://developer.blender.org/D6220
2019-11-11 15:30:27 -03:00
37bfb1fe17 Merge branch 'blender-v2.81-release' 2019-11-11 17:38:07 +01:00
a97cc5389a Fix T71452: instance collection to scene from outliner not incrementing collection usercount
Maniphest Tasks: T71452

Differential Revision: https://developer.blender.org/D6222
2019-11-11 17:32:43 +01:00
Dalai Felinto
fc79d27951 Merge remote-tracking branch 'origin/blender-v2.81-release' 2019-11-11 12:20:36 -03:00
Dalai Felinto
c1af9ef031 Fix T71487: Crashes When Calling Texture Space Operators
Issue introduced on 69ad44d5b4.

Differential Revision: https://developer.blender.org/D6224
2019-11-11 11:39:20 -03:00
Dalai Felinto
982bffa69f Merge branch 'blender-v2.81-release' 2019-11-11 11:26:24 -03:00
Dalai Felinto
3e4e346e59 Fix T71489: Video editor crash
Bug introduced on rBb77da65e8c4d.

Differential Revision: https://developer.blender.org/D6223
2019-11-11 10:56:07 -03:00
Alessio Monti di Sopra
9a60bdbf07 VSE: open file browser sidebar by default when adding external strips
Open the file browser sidebar by default when adding Movie/Sound/Image Sequence Strips, to show the operator options.

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

Reviewed by: William Reynish, Julian Eisel
2019-11-11 13:39:32 +01:00
Julian Eisel
b962253ed1 Fix T71474: Temporary image editor cancels to file editor after file operation 2019-11-11 12:43:20 +01:00
19c44ae087 Merge branch 'blender-v2.81-release' 2019-11-11 20:09:21 +11:00
f44f09534b Merge branch 'blender-v2.81-release' 2019-11-11 10:07:37 +01:00
c3dab45510 Fix lattice deform after undo and edit-mode exit
Follow up on T71414
2019-11-11 20:07:12 +11:00
3316610785 Revert "Fix T71126: add old hotkeys to set start/end frame in the timeline to"
This caused T71483.
Having timeline and dopesheet merged in 2.8 makes using S/E keys in timeline not work well.
2.7x keymap needs to fit with 2.8x internals, so probably 2.7x keymap will have to live with Ctrl+Home / Ctrl+End here.

This reverts commit 4fbcbbfb96.
2019-11-11 09:59:41 +01:00
25002739c2 Merge branch 'blender-v2.81-release' 2019-11-11 13:17:32 +11:00
df4f29b928 Fix T71414: Undoing change of lattice resolution deforms mesh 2019-11-11 13:07:37 +11:00
4c5477a8dc Windows: Fix build errors during deps build on windows. 2019-11-10 15:45:30 -07:00
b720c0f6aa Fix T71436: proportional_edit_objects turns off when translating cursor in edit mode 2019-11-09 16:12:42 -03:00
dca32f2b4f Fluid Particles: fix threading crash with viscoelastic springs.
As correctly pointed out by a comment in the code, adding
new springs wasn't thread safe, and caused crashes.

Fix by buffering new springs in intermediate thread-local
arrays, which are flushed on the main thread. This is valid
because the new springs are not used until the next sim step.

Differential Revision: https://developer.blender.org/D6133
2019-11-09 13:44:43 +03:00
6f1237b2eb make_update.py: update windows library folder 2019-11-08 19:09:59 -07:00
3ed7ff1f9f Merge branch 'blender-v2.81-release' 2019-11-09 10:05:30 +11:00
0a0d735acd Fix T71379: Even edge slide shows random points on screen 2019-11-09 09:59:10 +11:00
4b229f9e2d Fix T69799: Glitches when moving object camera is locked to
The idea is to indicate that the view3d matrix is being transformed too
and this avoids cyclic dependencies.
2019-11-08 17:58:00 -03:00
bcf008516f UI: Graph Editor Insert Keyframes Menu
Fixes alignment issues on Graph Editor menus used to insert keyframes.

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

Reviewed by Campbell Barton
2019-11-08 08:49:16 -08:00
f0bee88443 Merge branch 'blender-v2.81-release' 2019-11-08 17:48:30 +01:00
8c695404a4 Fix T70778: Library Override dissabled after re-instancing same collection in different scene.
Very stupid mistake in own new generic ID lib_link function, that would try
to link ID pointers for all data-blocks, not only those actually needing it.
2019-11-08 17:47:48 +01:00
a67aa11b12 Windows: Switch to the dynamic C runtime
This change switches windows to the dynamic C runtime
avoiding issues coming from mixing the static and dynamic
runtime like the ones outlined in [1]

[1] https://developer.blender.org/D5387#122165

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

Reviewed by: @Sergey
2019-11-08 09:01:00 -07:00
e408a62c2a Merge branch 'blender-v2.81-release' 2019-11-08 14:53:19 +01:00
76be5b5bf5 Fix T70789: Using Remove Single Override breaks file loading (crash).
We only need to refine rna pointer for actual collection properties,
other arrays we handle directly the the appy callback.
2019-11-08 14:52:57 +01:00
f47c469e90 Merge branch 'blender-v2.81-release' 2019-11-08 14:38:43 +01:00
3b66d2ed21 Fix T71405: Trying to Ctrl-C on many buttons crashes Blender
Usually Ctrl+C copies the operator name to the clipboard
["bpy.ops.material.new()", "bpy.ops.object.material_slot_remove()"]
Crash happens for all buttons of UI_BTYPE_BUT without associated
operator [some are defined with callbacks only, often these are created
with e.g uiDefIconBut (instead of e.g. uiDefIconButO)]

Other examples that crash with Ctrl+C:
- animation decorators next to animatable properties
- button to show a modifier texture in the texture tab
- ...

2.79 survived here (result in the clipboard was just not changed hitting
Ctrl+C on these buttons), this is what happens with this patch as well.

Maniphest Tasks: T71405

Differential Revision: https://developer.blender.org/D6208
2019-11-08 14:34:25 +01:00
2e39f6b230 Merge branch 'blender-v2.81-release' 2019-11-08 14:30:22 +01:00
e8cd2269b4 Fix T71199: Child-parent relationships arent kept after you make instances real.
Comparison function of the of the parent ghash was not fully correct,
could lead to some false positives in some cases...
2019-11-08 14:30:00 +01:00
31f8c9159d Merge branch 'blender-v2.81-release' 2019-11-08 14:28:45 +01:00
6900187092 Fix T71372: view layer is not maintained when area is duplicated into new window
Maniphest Tasks: T71372

Differential Revision: https://developer.blender.org/D6205
2019-11-08 14:23:45 +01:00
fb71bb991b Merge branch 'blender-v2.81-release' 2019-11-08 14:18:04 +01:00
fe2b92d789 Fix T55632: USE_DRAG_MULTINUM and USE_ALLSELECT not working well together
'is_copy' was not set correctly on all uiButMultiState (it was done once
for uiHandleButtonData), resulting in 'delta' being used on some indices
of the array and not others in `ui_selectcontext_apply`.

Maniphest Tasks: T55632

Differential Revision: https://developer.blender.org/D6201
2019-11-08 14:03:40 +01:00
1e4dbc84a7 Merge branch 'blender-v2.81-release' 2019-11-08 22:19:51 +11:00
5cf5dfcfad Fix T71194: UV Face centers wrong location with sub-surface mesh 2019-11-08 22:16:25 +11:00
7f17ac71e1 Merge branch 'blender-v2.81-release' 2019-11-08 19:18:51 +11:00
7b9f4320cc Merge branch 'blender-v2.81-release' 2019-11-08 19:18:25 +11:00
326b25ae8e Fix T66124: Gizmo orientation doesn't refresh when making face 2019-11-08 19:17:27 +11:00
73b9e86b49 EditMesh: avoid undo push on face creation if no action is made 2019-11-08 19:16:27 +11:00
45a03057fa Fix tool leader-key consuming mouse wheel events 2019-11-08 17:41:04 +11:00
0a42d0c566 Cleanup: adjust layout for example experimental UI
- Use a separate split for each feature,
  since two top-level splits can become un-aligned.
- Only show the task instead of the entire URL.
2019-11-08 16:45:18 +11:00
Dalai Felinto
a7fcd78d2d User Preference Experimental Tab
Experimental tab in User Preferences for experimental features.
The tab option is only visible when "Developer Extras" is on.

Included here is a (commented out) example panel to be used as a
template for the new experimental panels. Since these panels will come
and go it is nice to have a reference in the code.

Differential Revision: https://developer.blender.org/D6203
2019-11-08 01:31:01 -03:00
3ecb1056c9 Merge branch 'blender-v2.81-release' 2019-11-08 12:17:42 +11:00
e9d7fddeb4 Fix dyntopo sculpt not setting vertex indices dirty
This is an old bug exposed by new cursor drawing
which uses vertex indices.
2019-11-08 12:13:23 +11:00
72351aec72 Cleanup: clang-format 2019-11-08 11:50:16 +11:00
8d8c4562cc Merge branch 'blender-v2.81-release' 2019-11-08 11:45:39 +11:00
5b936f03f5 Merge branch 'blender-v2.81-release' 2019-11-08 11:45:15 +11:00
5c2670ca39 Cleanup: spelling 2019-11-08 11:44:23 +11:00
bda58b8a89 Cleanup: clang-format 2019-11-08 11:44:23 +11:00
23e1fb365b Merge branch 'blender-v2.81-release' 2019-11-07 21:36:23 +01:00
eefd806afc Fix in addition to T61432: Sampling Subframes not working 2.8
As mentioned in the discussion, emission from particles did not make use of subframes. This commit resolves this issue.
2019-11-07 21:33:56 +01:00
aadc90d0fc Stretch To: implement a mode similar to Damped Track for rotation.
Most of the time Stretch To is used in actual rigs, like BlenRig
or Rigify, in combination with Damped Track to handle rotation
before the stretch, because it produces rotations more appropriate
for organic deformation, and doesn't flip because of internal
gimbal lock.

The prevalence of this pattern suggests that Stretch To should
support that kind of rotation directly as an option.

Differential Revision: https://developer.blender.org/D6134
2019-11-07 19:03:03 +03:00
4e5768b2a7 Stretch To: clean up the math code in the implementation.
Combine computing `size` and normalizing the matrix, invert the
direction of `vec` to avoid negating it later, use `rescale_m4`
instead of matrix multiplication to scale the final result.

Differential Revision: https://developer.blender.org/D6134
2019-11-07 18:39:17 +03:00
50dc5648f5 Merge branch 'blender-v2.81-release' 2019-11-07 16:20:00 +01:00
74af698769 Fix T70875: Library Override: Clicking an Library Overriden Object crashes Blender.
We also need to rebuild the whole collection/viewlayer object cache
thing when we relink an objector collection in a collection (since it
might be part of a view layer).

Again, usual disclaimer about how inneficient this is currently, needs a
serious refactor to only tag caches as dirty, and actually rebuild the
whole thing on access.
2019-11-07 16:14:11 +01:00
c37ee984a3 Cleanup: remove debugging prints for bpy.msgbus 2019-11-07 22:38:22 +11:00
4ab0b2b5aa Merge branch 'blender-v2.81-release' 2019-11-07 11:12:44 +01:00
aa2904ea13 Cycles: Fix strict compiler warning
Pointer used for math arithmetics in assert().
CUDA device pointer is actually an integer type, not a pointer.
2019-11-07 11:06:41 +01:00
322cec8e4d Merge branch 'blender-v2.81-release' 2019-11-07 17:02:09 +11:00
79b703bb63 Fix T69822: Switching sculpt objects breaks undo
This introduces object mode tagging for data which hasn't yet been
written back to the ID data.

Now when selecting other sculpt objects, the original objects data is
flushed back to the ID before writing a memfile undo step.
2019-11-07 16:56:21 +11:00
Dalai Felinto
af33dbd714 Merge remote-tracking branch 'origin/blender-v2.81-release' 2019-11-06 17:49:17 -03:00
Dalai Felinto
85637311c2 Viewport: Fix stereo 3d camera framings when pivot is not center
As reported by Clément Foucault. This is a small thing but since we
are refactoring the draw manager for the next blender is nice to
have it fully working before the refactor for comparison.

Note: Camera volume and render were both fine, the camera frame is the
one thing that was not working.

Also in toe-in the convergence plane is always facing the original
camera orientation. It is a known small annoyance.
2019-11-06 17:48:09 -03:00
5abd006c78 Fix T70279: crash loading certain old, possibly corrupt files with nodes
This test should not be needed and the cause is unclear, but better to avoid
the crash. Possibly caused by files saved with development versions that had
different node type IDs.
2019-11-06 20:06:33 +01:00
6528fcaeea Fix T69845: OSL wrong texture node output for fixed vector value 2019-11-06 19:29:04 +01:00
Julian Eisel
3ed4097292 Fix broken selection behavior in multiple editors right after saving
Steps to recreate were:
* Open a Node Editor, add some nodes
* Save the file
* Select all nodes (A)
* Save it again, but with Ctrl+S
* Try to select an already selected node
It's supposed to deselect other nodes now, but for as long as the report
banner is shown in the status-bar ('Saved "foo.blend"'), this doesn't
work.

Also happened in the VSE, Dopesheet, NLA or everywhere else we recently
added drag-all-selected support to.

Issue was in there since 2.80. Basically the timer event sent by the
report banner broke assumptions in the selection operator.

Hope this fix doesn't have any side effects. Checked with Bastien
(initial author of this logic), but seems things are fine.
2019-11-06 19:28:53 +01:00
0faed98da1 Merge branch 'blender-v2.81-release' 2019-11-06 19:26:45 +01:00
a58c1d4497 Fix 2D paint antialiasing offset
The AA offset should be substracted, not added. I think this was
introduced when I refactored the code in a code review.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6186
2019-11-06 19:25:42 +01:00
9243c77e43 Merge branch 'blender-v2.81-release' 2019-11-06 19:22:44 +01:00
265295e6a6 Fix Voxel Remesher preserve volume artifacts
Should Fix T70326

This implements the shrinkwrap options suggested in D5933. I did a few
test and it seems much more stable than the previous options.

Reviewed By: jbakker

Maniphest Tasks: T70326

Differential Revision: https://developer.blender.org/D6176
2019-11-06 19:21:43 +01:00
ee66059ac5 Merge branch 'blender-v2.81-release' 2019-11-06 19:15:48 +01:00
9b944e530e Clay Strips: Set default normal radius to 1.55
The previous default was 1.7, so the brush was more stable on surface
normal changes, but softer. I don't think users expect this brush to be
that stable, so by using 1.55 we make the brush a little bit stronger on
curved surfaces by default.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6187
2019-11-06 19:14:04 +01:00
d52ddfa6cc Merge branch 'blender-v2.81-release' 2019-11-06 18:26:53 +01:00
7ef03eae20 Fix T71336: GPencil: Wrong mouse cursor 2019-11-06 16:53:36 +00:00
64cd9a079b Fix T70952: EXR files bigger than 2GB don't open on Windows 2019-11-06 17:16:46 +01:00
46aeffc5b6 Merge branch 'blender-v2.81-release' 2019-11-06 15:09:55 +00:00
65b414cfb2 Fix T71319, T71015: crash in edit mode with out of range material assignments 2019-11-06 16:08:10 +01:00
Charlie Jolly
3a65ea3b2d Fix: Forward compatibility issue in shader nodes
Raised in https://developer.blender.org/rBe5618725fd1e

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6102
2019-11-06 14:20:00 +00:00
a3d5758902 Merge branch 'blender-v2.81-release' 2019-11-06 13:54:41 +01:00
e71963a37e Buildbot: Ensure proper ABI is used
This wasn't an issue in the real buildbot environment since the
precompiled libraries are compiled with same ABI as the compiler
used for Blender build. But it was causing issues when building
Blender using buildbot scripts (for troubleshooting purposes)
on a machine with different default compiler ABI.

Usually ABI detection is happening in platform_unix.cmake when
detecting whether there are any precompiled libraries folder
available. This detection is not happening when library folder
is provided explicitly, expecting ABI to be setup explicitly
as well.
2019-11-06 13:50:43 +01:00
7728bfd4c4 Constraints: remove special meaning of Local Space for parentless Objects.
In 2011 special handling was introduced, apparently for no other
reason than to address a complaint in T25707 that World and Local
space are equivalent for objects without parent. This causes issues
and confusion, as mentioned in rB599c8a2c8e4.

This special meaning of Local Space is not documented in the manual,
and is not known to experienced riggers, so removing it should not
be a problem.

Differential Revision: https://developer.blender.org/D6095
2019-11-06 15:36:05 +03:00
e3f1f5bd00 Fix crash when adding Scene variable to a driver
When a Scene variable is added to a driver, and the RNA path is still NULL,
it no longer crashes Blender.
2019-11-06 11:53:23 +01:00
b0e7a1d4b4 Alembic: improved import/export of mesh normals
This commit implements the change in behaviour described in T71246.
In short:

For export, per mesh:
    - Custom loop normals are defined → loop normals are exported.
    - One or more polys are marked flat → loop normals are exported.
    - Otherwise, no normals are exported.

For import, when the Alembic mesh contains:
    - loop normals (kFacevaryingScope) → use as custom loop normals, and
      enble Auto Smooth to have Blender actually use them.
    - vertex normals (kVertexScope or kVaryingScope) → convert to loop
      normals, and handle as above.
    - no normals → mark mesh as smooth.
    - unsupported normal types (kConstantScope, kUniformScope,
      kUnknownScope) → handle as 'no normals'.

This also fixes T71130: Alembic split normal export issue

Previously the mesh flag `ME_AUTOSMOOTH` was used in conjunction with
the poly flag `ME_SMOOTH` to determine whether loop normals or vertex
normals were exported. This behaviour was hard to predict for artists,
and hard to describe in the manual. Instead, Blender now only exports
loop normals, computing them if necessary. This way, the mesh in Alembic
should always have the same loop normals as in Blender.

Maniphest Tasks: T71130

Differential Revision: https://developer.blender.org/D6197
2019-11-06 10:45:36 +01:00
4f5086b6dc Mathutils: expose the utility to find the closest point of a triangle.
This computation is complex and useful enough to expose the existing
C math utility used by BVH nearest to Python. Otherwise this requires
the use of intersect_point_tri and multiple intersect_point_line calls
with some added vector math.

Differential Revision: https://developer.blender.org/D6200
2019-11-06 11:15:11 +03:00
b617cf69f3 Merge branch 'blender-v2.81-release' 2019-11-06 13:07:46 +11:00
863ca3dd76 Cleanup: remove unused game engine variable 2019-11-06 13:06:04 +11:00
3e44b0ed6c Merge branch 'blender-v2.81-release' 2019-11-06 12:49:44 +11:00
7168dfd005 Cleanup: remove EditNurb from DNA 2019-11-06 12:46:25 +11:00
9d1031b011 Fixed delaunay check, was causing 'desperation' messages.
Check was losing precision -- adjust by translating points
before calculating circumcircle.
Also, needed to check for flippability of edges before flipping.
2019-11-05 13:23:20 -05:00
0bee94f920 Fixed delaunay check, was causing 'desperation' messages.
Check was losing precision -- adjust by translating points
before calculating circumcircle.
Also, needed to check for flippability of edges before flipping.
2019-11-05 13:12:34 -05:00
3c161fb82c Merge branch 'blender-v2.81-release' 2019-11-05 17:45:31 +01:00
9ea661f47a Alembic import: fix incorrect 'topology changed' error
When importing subdivision surfaces a 'Topology Changed' error was shown
even though the topology didn't change at all. The code was comparing to
`totpoly` where `totloop` should have been used.
2019-11-05 17:44:37 +01:00
af9a50bfe6 Merge branch 'blender-v2.81-release' 2019-11-05 17:35:27 +01:00
Ha Hyung-jin
9a9e93e804 Fix T71071: errors when using multiple CUDA/Optix GPUs and host mapped memory
The multi device code did not correctly handle cases where some GPUs store a
resource in device memory and others store it in host mapped memory.

Differential Revision: https://developer.blender.org/D6126
2019-11-05 16:40:55 +01:00
f5e98a0fa7 Merge branch 'blender-v2.81-release' 2019-11-05 15:39:01 +01:00
1b46b7c42f Fix build errors in GHOST SDL 2019-11-05 15:38:03 +01:00
8c2672db0d Fix T71093: fluid settings not visible for workbench engine 2019-11-05 15:38:02 +01:00
909de57afb Fix compositor Denoise node showing Normal value buttons
Any values typed in here manually would not be used, it needs an image.
2019-11-05 15:38:02 +01:00
Jim Eckerlein
b85e93b24e Fix bug in Draco encoding for glTF, files are now smaller
Data was not quantified properly. It also lets the library choose the suitable
encoding method rather than forcing it to use the edgebreaker method.

Differential Revision: https://developer.blender.org/D6183
2019-11-05 15:38:02 +01:00
2412451595 Merge branch 'blender-v2.81-release' 2019-11-05 15:26:39 +01:00
a1747b058d Fix T71259: Array Modifier Performance is slow
Was happening when object transform is animated.

Caused by overly aggressive dependency construction introduced a
while back in 9d4129eee6: we shouldn't add dependencies unless
we really need them.

This change removes unneeded transform dependency for cap objects
(since only their geometry is used), and also removes own transform
dependency if there is no offset object (which is the only case when
own transform is needed).

Differential Revision: https://developer.blender.org/D6184
2019-11-05 14:48:44 +01:00
16767c4e22 Merge branch 'blender-v2.81-release' 2019-11-05 14:34:07 +01:00
8dfe2801ac Fix T71356: Motion Paths no longer update 2019-11-05 14:31:24 +01:00
63b9f8394f Motionpath: Fix memory leak on early output
This is a part of T71356.
2019-11-05 14:23:01 +01:00
3d5d7cff30 Merge branch 'blender-v2.81-release' 2019-11-05 14:20:00 +01:00
7a93abb264 Fix Cycles failing to compile when "WITH_CYCLES_LOGGING" is off 2019-11-05 14:19:33 +01:00
ea7e161e18 Merge branch 'blender-v2.81-release' 2019-11-05 10:05:06 +01:00
bb69e62710 Fix T68396: Unable to change any Collision input value after it has been keyframed
'rna_CollisionSettings_update' has a history of tagging ob for update:
rB79312c1912b4 ID_RECALC_TRANSFORM |ID_RECALC_GEOMETRY |
ID_RECALC_ANIMATION
rBf90a2123eedc OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME
rBfaf1c9a4bb27 OB_RECALC_ALL
rB7df35db1b136 OB_RECALC

Since the meaning of OB_RECALC_TIME/ID_RECALC_ANIMATION changed a bit
historically (from "please update my animation if the animation
datablock is tagged for update" to "update animation of this datablock")
this was now always overwriting user edit with animated values, making
it impossible to change those values once animated.

Thx @sergey for guidance!

Maniphest Tasks: T68396

Differential Revision: https://developer.blender.org/D6113
2019-11-05 09:57:43 +01:00
cc601e0eac Merge branch 'blender-v2.81-release' 2019-11-05 17:50:53 +11:00
bfa761d046 Cleanup: remove redundant pivot popover 2019-11-05 17:47:35 +11:00
1ef2cbb3d9 Merge branch 'blender-v2.81-release' 2019-11-05 14:12:59 +11:00
490d5bb750 Fix T68130: Over sensitive number button dragging
When continuous grab, cursor motion was mapped to the min/max.
This caused problems when int/float max values were used.

Now the range is clamped by a value derived from the click-step
so dragging numbers never increases it to an impractically large value.
2019-11-05 14:10:53 +11:00
f4e081ea3f Merge branch 'blender-v2.81-release' 2019-11-05 09:17:15 +11:00
95a60fe84d Fix errors in fix for T68018 2019-11-05 09:14:47 +11:00
Julian Eisel
ef7fd50f8a UI: Rewrite stacked full-screen logic, fixing issues
To recreate the main issue:
* Set render and file browser to show in full-screen in the preferences
* Default scene, press F12 in 3D View
* Press Alt+S to save the image
* Escape the file browser
* Escape the image editor
The former 3D View would now show the image editor. This is a common
use-case that should work.

Full-screen code is a hassle to get to work as expected. There are
reports from 2.5, I did lots of work years ago to get these kind of
use-cases to work fine. But apparently I broke this one with a fix for
another common use-case in March (0a28bb1422).
This now stores hints in the space, rather than the area, which should
make things much more controlable and hopefully help us fix issues like
this.
Here are a few references describing further common issues (all should
work fine now): 0a28bb1422, e61588c5a5, T19296

Checked over this with Bastien, we agreed that at some point we should
do a big rewrite of all of this, for now this is acceptable.
2019-11-04 21:01:38 +01:00
4b337a86f1 Merge branch 'blender-v2.81-release' 2019-11-04 18:10:56 +01:00
b45828ebe9 Fix T71123: OptiX error in Cycles viewport when adding HDRI
Cycles did not update the "is_enabled" flag on lights when they were synchronized again, which caused all lights disabled by "LightManager::disable_ineffective_light" to be disabled indefinitely. As a result the OptiX kernels were not reloaded with correct features when a change to a light was made. This fixes that by updating the "is_enabled" flag during synchronization.

Differential Revision: https://developer.blender.org/D6141
2019-11-04 18:09:56 +01:00
ece4515fc8 Fix T71250: ID user decrement error with ID properties in ViewLayer
Credit for the original patch goes to @scorpion81.
2019-11-04 15:02:03 +01:00
Robert Guetzkow
3f3d1ad480 Correct naming of cryptomatte output sockets on the render layers node
The cryptomatte sockets were incorrectly numbered using a step size of two. While the increment by two is necessary to get the correct number of render passes, they should be numbered consecutively matching the socket names of the cryptomatte node.

Reviewed By: lukasstockner97

Differential Revision: https://developer.blender.org/D6185
2019-11-04 14:53:09 +01:00
9fac6765c8 Nasking: Toggle cyclic on Ctrl-Click on initial vertex
This change replaces old behavior when spline was toggled as cyclic
on double-click.

Doing so was tricky on a tablet and is rather non-intuitive in general.

Differential Revision: https://developer.blender.org/D6162
2019-11-04 10:54:59 +01:00
e236f5b574 Masking: Cleanup, limit variable scope 2019-11-04 10:54:59 +01:00
3d55d80c59 Masking: Cleanup, indentation level 2019-11-04 10:54:59 +01:00
a81108ae74 Masking: Cleanup, naming of mask layer 2019-11-04 10:54:59 +01:00
Henrik Dick
e45cfb574e Solidify Modifier: support non-manifold input
This adds a new mode to solidify to support non-manifold geometry
with edges using 3 or more faces as input, resulting in a manifold mesh.

Since the differences between these methods don't translate well
into short terms, they're named "Simple" and "Complex" in the UI.

This also adds clamp with respect to angles
to the existing solidify modifier calculation.
2019-11-04 10:35:21 +11:00
b5244cd5dc Fix errors in fix for T68018 2019-11-03 17:56:05 +11:00
Alessio Monti di Sopra
d4bef6a215 VSE: add a Set frame range to Strips operator
Add operator that sets the frame range, with an option to choose the regular or the preview one, around the selected strips.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6078
2019-11-02 22:53:48 -07:00
Alessio Monti di Sopra
b9c2f8f3c8 UI: Fix preview frame range drawing in sequencer and driver editors
Draw preview range overlay in the video sequencer in the same way as in the other animation editors
Add color control in the theme.
Prevent overlay to be drawn in the driver editor.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6074
2019-11-02 22:52:22 -07:00
7ddbc7b031 Merge branch 'blender-v2.81-release' 2019-11-02 21:53:14 -07:00
8ab6ef30ab Fix T68018: Crash on building movie proxy
Skip building proxy if directory can not be created.

Crash happens, when setting custom dir to location of source file itself.
This results in attempt to create directory with the same name as source file.

Differential Revision: https://developer.blender.org/D6148
Reviewed By: sergey
2019-11-02 20:57:11 -07:00
6db9b443bb Merge branch 'blender-v2.81-release' 2019-11-03 14:19:48 +11:00
93f93e6b45 Fix T71284: batch rename escape's dashes 2019-11-03 11:28:49 +11:00
07e335e79d Merge branch 'blender-v2.81-release' 2019-11-02 11:51:23 +01:00
07968604ab GPencil: Some NULL checks missing in previous T71260 fix 2019-11-02 11:50:44 +01:00
dfe40c9594 Merge branch 'blender-v2.81-release' 2019-11-02 11:14:13 +01:00
1c8d76772a GPencil: Fix unreported visual problem for short strokes
When the stroke has less than 3 points, but only the fill material is enabled, the stroke is invisible and makes the shaders to remove any fill because the shader start and end pointers are not correct.

Now, if the stroke has only fill, but it is not fillable, it is drawn with the stroke color to avoid the errors and these ghost strokes.
2019-11-02 11:13:44 +01:00
9c275e26f9 Merge branch 'blender-v2.81-release' 2019-11-02 10:29:12 +01:00
782f36d6a8 Fix T71260: GPencil crash when drawing very long lines
There were two problems:

1) When the buffer was reallocate, the pointer was corrupted.
2) Short variables were too small to hold long lines.
2019-11-02 10:28:37 +01:00
018b754fb6 GPencil: Show selection in Stroke mode for single points 2019-11-02 10:28:37 +01:00
9da7a0f8bf Merge branch 'blender-v2.81-release' 2019-11-02 12:33:54 +11:00
52e3688beb Merge branch 'blender-v2.81-release' 2019-11-02 12:31:09 +11:00
effe047318 Cleanup: rename undo tile x/y members
Avoid mixing up pixel/tile location.
2019-11-02 12:29:46 +11:00
5b18997543 T71094: anchored & drag-dot brushes paint continuously
Error from 151cc02b6f
2019-11-02 12:22:51 +11:00
e83a23acb2 Merge branch 'blender-v2.81-release' 2019-11-02 09:10:13 +11:00
4fec2b0660 Fix T48034: Camera image offsets were scaled by image aspect
Offset now matches Blender 2.7x.
2019-11-02 09:07:44 +11:00
e9da7a5b8d Merge branch 'blender-v2.81-release' 2019-11-02 04:40:49 +11:00
0dd9e55d21 Fix T71247: Outliner pose toggle looses bone selection
The outliner didn't account for weight-paint + pose-mode,
making it consider all pose bones unselected.
When syncing selection, bones were unselected.

This adds a context argument to passed to drawing functions since
finding the weight-paint pose-object in the drawing loop isn't efficient.
2019-11-02 04:32:50 +11:00
89e2a8f17a Windows: Replace deprecated SHGetFolderPathW
No functional change.

Differential Revision: https://developer.blender.org/D6172
2019-11-01 14:23:32 -03:00
ca56fe6d91 Fix python error when trying to delete presets
In some cases the default data paths for blender does not exist.
For example on windows when using the portable install.

This would lead to errors when trying to lookup default paths in
is_path_builtin. Now we handle cases like this gracefully.
2019-11-01 17:58:29 +01:00
88833170f2 UI: Disk to Disc Spelling Change
Identifiers for icons representing optical drives should use 'disc', not 'disk'.

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

Reviewed by Julian Eisel
2019-11-01 09:02:50 -07:00
5840c17970 Fix T70725: Frame Symmetry Stroke
Frame Selected centers around the last valid stroke.
When Symmetry is enabled the last mirrored `location` was added to the
`average_stroke_accum` in stead of the original stroke location.

This patch will add the `true_location` to the `average_stroke_accum`.
This contains the original stroke location.

Issue happened in Vertex and Weight paint.

Reviewed By:
	Pablo Dobarro

Differential Revision: https://developer.blender.org/D6161
2019-11-01 15:10:44 +01:00
f5b09ae034 Merge branch 'blender-v2.81-release' 2019-11-01 14:31:35 +01:00
1121e1f1a6 Fix T71251: Move Strokes to Layer slider gets wonky
This parameter must be hidden.
2019-11-01 14:30:55 +01:00
c1f8268734 Fix T60607: Spin tool duplicates after Spin Duplicate 2019-11-01 11:24:36 +11:00
61bf51acb5 Cleanup: pep8 for examples 2019-11-01 10:53:47 +11:00
c11d3c1b92 Cleanup: correct logical error in last commit
Worked because: -INT_MIN == INT_MIN
2019-11-01 10:45:24 +11:00
ddf20fae4c Sequencer: use all selected strips for select side operator
D6127 by @a.monti with edits.
2019-11-01 08:52:20 +11:00
e1c9c0106c Merge branch 'blender-v2.81-release' 2019-11-01 07:33:31 +11:00
78ad368d12 Fix inability to toggle pose-mode without sync-selection
- There was no way to select some kinds of data without activating them.
- Pose mode could not be activated at all.

No change to behavior with sync-selection enabled.
2019-11-01 06:29:48 +11:00
44d67b6dc8 Transform: Add option to exclude back facing geometry from snapping
Add new `Backface Culling` option to the snapping properties.
This option has nothing to do with the view3d display or the
workbench `Backface Culling` option.

Limitation:
- In edit mode, this option only affects snap to faces.

Maniphest Tasks: T71217

Differential Revision: https://developer.blender.org/D6155
2019-10-31 14:09:53 -03:00
3c32c5c2dd make.bat: Warn user about missing svn.exe 2019-10-31 09:45:56 -06:00
eb95e28635 Merge branch 'blender-v2.81-release' 2019-10-31 15:57:55 +01:00
8c6c46469c Fix T71172: Cycles preferences.get_devices() not refreshing Optix devices 2019-10-31 15:54:44 +01:00
4f3913db9f Merge branch 'blender-v2.81-release' 2019-11-01 01:51:06 +11:00
6df0bfad67 Fix oso extension detection in the text editor 2019-11-01 01:48:35 +11:00
a45113a119 Merge branch 'blender-v2.81-release' 2019-10-31 14:53:12 +01:00
0bd51f4fc0 Fix T70687: Deleting sculpting mask extraction causes crash
Reviewed By: jbakker

Maniphest Tasks: T70687

Differential Revision: https://developer.blender.org/D6042
2019-10-31 14:51:42 +01:00
cca61a0fe2 Merge branch 'blender-v2.81-release' 2019-10-31 14:46:47 +01:00
cd827194f7 Paint: Option to disable antialiasing
You may want to disable antialiasing if you are working with pixel art
or low resolution textures. It is enabled by default.

Reviewed By: jbakker, campbellbarton

Differential Revision: https://developer.blender.org/D6044
2019-10-31 14:45:26 +01:00
26e454eec3 Merge branch 'blender-v2.81-release' 2019-10-31 14:41:14 +01:00
be2bdaf6aa Fix EEVEE sculpt mask rendering
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6080
2019-10-31 14:39:41 +01:00
2de5b48649 Merge branch 'blender-v2.81-release' 2019-10-31 14:35:50 +01:00
90fd75c869 Fix T70866: Missing PBVH updates after mask undo
With the latest changes, the PBVH needs extra flags each time the mask is
modified to keep the internal fully_masked and fully_unmasked node flags
updated.

Reviewed By: jbakker

Maniphest Tasks: T70866

Differential Revision: https://developer.blender.org/D6088
2019-10-31 14:34:41 +01:00
09e8b0ee7a Merge branch 'blender-v2.81-release' 2019-10-31 14:33:07 +01:00
c6180c2249 Fix T71053: Poly Build tool crashes blender when deleting wire vertices
Dissolve the vertex when it is wire instead of trying to collapse the
edge. When collapsing the edge, ##v_kill->e## was not NULL, so the
assert in ##bmesh_kernel_join_vert_kill_edge## fails.

Reviewed By: jbakker

Maniphest Tasks: T71053

Differential Revision: https://developer.blender.org/D6159
2019-10-31 14:32:09 +01:00
Julian Eisel
f069f5be7f UI: Only show render result in image editors in view mode
Previously, with the render display mode set to "Image Editor", we'd use
any image editor that doesn't already show a (non-render-result) image,
even if they weren't set to view mode (but UV, paint or mask mode).
It could be confusing or annoying when using an Image Editor for a
purpose that the mode wasn't created for.
Note that with the introduction of a UV sub-Editor, the old behavor was
even more confusing. Changing a UV Editor to show the render result was
weird.
2019-10-31 11:56:10 +01:00
501a3e93ec GPencil: Display dot icon for active material in Assign menu
Now, a dot icon is displayed in front of the current object active material.
2019-10-31 11:49:46 +01:00
2e2fd12a55 Cleanup: comments for is_path_builtin
Also reduce scope of import.
2019-10-31 18:01:58 +11:00
3252ef4aca Cleanup: import functions from bpy.props
Some instances used bpy.props when the convention is to import them.
2019-10-31 18:00:18 +11:00
59b16e28d9 Fix tool leader-key in image space
- This wasn't working for tool-systems that use the space data.
- Don't activate when the keymap is empty.
2019-10-31 10:03:42 +11:00
8126b9f8a8 Merge branch 'blender-v2.81-release' 2019-10-30 22:42:46 +01:00
ed079850cb GPencil: Fix unreported missing stroke color for 1st popover material 2019-10-30 22:42:16 +01:00
b1b0e56a72 Fix T59065: Blender default keyset is deletable by user!
Previously, you could delete presets that were part of the blender
default install. Now we check if the preset file resides in the bundled
file paths. If so, prevent deletion of the preset.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D4522
2019-10-30 19:23:36 +01:00
ace7ec785d Merge branch 'blender-v2.81-release' 2019-10-31 03:19:04 +11:00
d9bce6bcf5 Fix image paint showing project-paint settings
Also make projpaint a keyword-only argument to avoid copy-paste errors
like this re-occurring in the future.
2019-10-31 03:16:48 +11:00
20881bcffd Fix T71212: Drivers using scene.frame_current don't refresh on playback
Need to make such drivers explicitly dependent on time.
2019-10-30 15:15:56 +01:00
0f9757b12d Depsgraph: Cleanup, use anonymous nsamespace
Jeeps overall line lengths with function definition shorter.
2019-10-30 15:15:56 +01:00
f305972377 OpenSubdiv: Initial implementation of batched evaluation
The idea is to give multiple coordinates to evaluator and evaluate them
all at once, avoiding any possible overhead.
2019-10-30 15:15:56 +01:00
05ee67a7c8 OpenSubdiv: Make internal evaluator aware of batched evaluation
Allows to pass multiple patch coordinates for evaluation.
2019-10-30 15:15:55 +01:00
ca3a96c243 OpenSubdiv: Use more generic access to patch coordinates
Saves another unnecessary temporary data copy during evaluation.
2019-10-30 15:15:55 +01:00
d3c87876c9 OpenSubdiv: Cleanup, remove old compatibility code
Consider that all builders have face-varying evaluation now.
2019-10-30 15:15:55 +01:00
5843827fb9 OpenSubdiv: Cleanup, remove unused class 2019-10-30 15:15:55 +01:00
4227a35b32 OpenSubdiv: Avoid unnecessary memory copies
Make evaluator itself to write directly to the output buffer.

Brings unmeasurable speedup and makes it possible to simplify
some buffer class logic.
2019-10-30 15:15:55 +01:00
31873218b2 OpenSubdiv: Use smaller buffer sizes and strides
We currently don't support interleaved varying data, so can make
some buffer smaller.
2019-10-30 15:15:55 +01:00
b4fb3db559 OpenSubdiv: Cleanup, remove unused PatchBuffer class 2019-10-30 15:15:55 +01:00
8e470033ab OpenSubdiv: Cleanup, remove unused evaluator member 2019-10-30 15:15:55 +01:00
7dda8f7faf OpenSubdiv: Cleanup, remove unused static methods 2019-10-30 15:15:55 +01:00
622aedb78a Merge branch 'blender-v2.81-release' 2019-10-31 00:52:12 +11:00
5043003584 GNUmakefile: avoid using group/owner for source_archive
Thanks to @JRottm for pointing out this issue.
2019-10-31 00:51:15 +11:00
03be16026a Merge branch 'blender-v2.81-release' 2019-10-31 00:27:27 +11:00
60d0446db3 GNUmakefile: use tar.xz instead of tar.gz
Also rename "make tgz" to "make source_archive" as it wasn't clear
this only archived the source, not binaries.

D6153 by @JRottm with minor edits
2019-10-31 00:19:05 +11:00
8fe4d9c002 Merge branch 'blender-v2.81-release' 2019-10-30 14:19:05 +01:00
068c6a6f15 Fix T71182: Object Parenting - 'Without Inverse' option missing in menu
Maniphest Tasks: T71182

Differential Revision: https://developer.blender.org/D6150
2019-10-30 14:14:18 +01:00
Bastien Montagne
29433da4c6 BLI_task: Add new generic BLI_task_parallel_iterator().
This new function is part of the 'parallel for loops' functions. It
takes an iterator callback to generate items to be processed, in
addition to the usual 'process' func callback.

This allows to use common code from BLI_task for a wide range of custom
iteratiors, whithout having to re-invent the wheel of the whole tasks &
data chuncks handling.

This supports all settings features from `BLI_task_parallel_range()`,
including dynamic and static (if total number of items is knwon)
scheduling, TLS data and its finalize callback, etc.

One question here is whether we should provide usercode with a spinlock
by default, or enforce it to always handle its own sync mechanism.
I kept it, since imho it will be needed very often, and generating one
is pretty cheap even if unused...

----------

Additionaly, this commit converts (currently unused)
`BLI_task_parallel_listbase()` to use that generic code. This was done
mostly as proof of concept, but performance-wise it shows some
interesting data, roughly:
 - Very light processing (that should not be threaded anyway) is several
   times slower, which is expected due to more overhead in loop management
   code.
 - Heavier processing can be up to 10% quicker (probably thanks to the
   switch from dynamic to static scheduling, which reduces a lot locking
   to fill-in the per-tasks chunks of data). Similar speed-up in
   non-threaded case comes as a surprise though, not sure what can
   explain that.

While this conversion is not really needed, imho we should keep it
(instead of existing code for that function), it's easier to have
complex handling logic in as few places as possible, for maintaining and
for improving it.

Note: That work was initially done to allow for D5372 to be possible... Unfortunately that one proved to be not better  than orig code on performances point of view.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D5371
2019-10-30 12:23:45 +01:00
3e7af19bf1 GPencil: Replace eyedropper toolbar icon 2019-10-30 11:11:26 +01:00
58f378817c UI: Add new toolbar icons for polyline & eyedropper
These are meant for use in Grease Pencil Draw mode.
2019-10-30 10:53:01 +01:00
367def2f16 Merge branch 'blender-v2.81-release' 2019-10-30 10:19:41 +01:00
ff7be96322 Toggle 'PLAY' <> 'PAUSE' icons for pausing preview rendering
mentioned in T70974

Maniphest Tasks: T70974

Differential Revision: https://developer.blender.org/D6119
2019-10-30 10:09:51 +01:00
84386c45d8 Merge branch 'blender-v2.81-release' 2019-10-30 09:57:19 +01:00
d45c7c997f Fix T71026: Outliner - Show Hierarchy (Home Hotkey) Not Working Correctly
In 2.8, code would not enter the new 'Objects' and Collections'
'folders'.

Maniphest Tasks: T71026

Differential Revision: https://developer.blender.org/D6123
2019-10-30 09:44:00 +01:00
dff7abf061 UI: Hover States
Hover (active) widget states now affecting more elements and in a more consistent way.

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

Reviewed by Campbell Barton
2019-10-29 18:11:19 -07:00
5207b977f7 UI: Correct prvicons
Correct source, output, and formatting of prvicons - larger icons used for file browser.

Not Reviewed
2019-10-30 09:27:12 +11:00
01171c3380 Merge branch 'blender-v2.81-release' 2019-10-30 07:50:11 +11:00
aff6446e06 UI: remove text alignment icons for sequencer text
This implied paragraph alignment, when the alignment defines
the origin of the text relative to the X,Y coordinates.

Resolves T71082
2019-10-30 07:49:22 +11:00
09e813f303 Merge branch 'blender-v2.81-release' 2019-10-30 06:15:38 +11:00
7ae187c5d4 UI: make color strip 'Only Boost' readable in glow panel
D6115 by @tintwotin
2019-10-30 06:13:32 +11:00
48d1928798 Merge branch 'blender-v2.81-release' 2019-10-30 06:08:38 +11:00
3ec23f619a Merge branch 'blender-v2.81-release' 2019-10-30 06:08:30 +11:00
cff00f6b04 Cleanup: pep8, remove redundant parenthesis 2019-10-30 05:50:17 +11:00
10b83a94d9 Cleanup: use "use_" prefix for booleans 2019-10-30 05:50:17 +11:00
3d40121370 Merge branch 'blender-v2.81-release' 2019-10-29 19:49:37 +01:00
8e6882a70d Fix T69468 EEVEE: Collections Holdout Button in Outliner Is Ignored
Not the cleanest implementation but the simplest.

This doubles the number of default shader variations.
2019-10-29 19:44:02 +01:00
638e0e520f Merge branch 'blender-v2.81-release' 2019-10-30 05:19:15 +11:00
1907081f0e Sequencer: add missing Show Seconds in View Menu
D6106 by @tintwotin
2019-10-30 05:18:04 +11:00
dfaaf50538 Cleanup: remove icon files committed by accident 2019-10-30 03:51:35 +11:00
77acda6fd0 Merge branch 'blender-v2.81-release' 2019-10-30 03:40:03 +11:00
f20cd49c30 Fix bones without parents missing head vertex
When the connected was enabled for a parentless bone the head vertex
wasn't displayed and couldn't be selected.
2019-10-30 03:37:50 +11:00
81cc09b78a Merge branch 'blender-v2.81-release' 2019-10-29 17:16:35 +01:00
cf95d7f10e UI: Icons update.
Updated icon set from Andrzej Ambroż.

  - Includes new icons for Top Bar, Status Bar, CD/DVD drives, Home, Documents, Temp, Memory, Options.
  - Includes small tweaks to many icons throughout Blender
  - Also adds a large CD/DVD drive icon for the file browser

This does not add the new icons in the interface yet.
2019-10-29 16:55:56 +01:00
87ac3d14b2 Fix T70905: Image Editor header hides mask, cache and keyframe info if
flipped to bottom

While flipping the header to bottom works in the MCE (because MCE doesnt
allow overlapping UI) we need to take the regions visible rect into
account for the Image Editor.

Also correct clickable scubbing area (poll for frame_change) in the
Image Editor and the MovieClip Editor not taking UI_DPI_FAC into
account.

Maniphest Tasks: T70905

Differential Revision: https://developer.blender.org/D6090
2019-10-29 16:51:55 +01:00
0e45ca2e70 Merge branch 'blender-v2.81-release' 2019-10-30 02:12:09 +11:00
aa841e2bd5 Fix T62116: Delete ruler ignored on edit-mode toggle
D6129 by @smramsay
2019-10-30 02:10:32 +11:00
de56d69689 Merge branch 'blender-v2.81-release' 2019-10-29 15:40:24 +01:00
f17aac33a1 Fix strict compiler warning
Implicit function declaration caused by missing include
in the recent fix.
2019-10-29 15:37:19 +01:00
2b133ee78c Merge branch 'blender-v2.81-release' 2019-10-29 15:18:33 +01:00
d0d57f1712 Fix T70091 EEVEE: volumetric broken, not refresh
Thanks @mano-wii for finding the fix.
2019-10-29 15:16:47 +01:00
883e22a92c Fix T71050 EEVEE: Light Path Node broken in 2.81
Also fixes the sampling of hashed shadows.
2019-10-29 15:16:47 +01:00
d758a79557 Fix T71062 EEVEE: Holdout shader is broken in 2.81 2019-10-29 15:16:47 +01:00
c43183bcc9 Merge branch 'blender-v2.81-release' 2019-10-29 14:32:28 +01:00
9efe12d77a Fix T71171: Problems removing texture packing (without writing anything)
using image.unpack() or bpy.ops.image.unpack()

If we offer this in the UI, also expose this to .unpack

Maniphest Tasks: T71171

Differential Revision: https://developer.blender.org/D6152
2019-10-29 14:30:22 +01:00
e2240d9fc1 Merge branch 'blender-v2.81-release' 2019-10-29 10:29:59 -03:00
8a5f3d38af Fix T71124: UV Editor – Proportional Editing Falloff misses some Options
This mimics the same solution for proportional edit in the 3D View.

Maniphest Tasks: T71124

Differential Revision: https://developer.blender.org/D6142
2019-10-29 10:28:41 -03:00
9e48cb1049 Merge branch 'blender-v2.81-release' 2019-10-30 00:17:01 +11:00
8ffacda786 Merge branch 'blender-v2.81-release' 2019-10-30 00:16:15 +11:00
455ccac5b8 Merge branch 'blender-v2.81-release' 2019-10-30 00:15:29 +11:00
9389ad3736 Fix Proxy folder not getting deleted
D6145 by @Eitan
2019-10-30 00:14:08 +11:00
4fbcbbfb96 Fix T71126: add old hotkeys to set start/end frame in the timeline to
Blender 27X keymap

Maniphest Tasks: T71126

Differential Revision: https://developer.blender.org/D6151
2019-10-29 14:03:03 +01:00
a05be009a5 Cleanup: remove unused object_image_guess
This made sense when we had tex-face feature,
since it's removed & unused, remove this function too.

D6079 by @alm
2019-10-29 23:41:17 +11:00
bcac0ed977 Fix T70913: OpenCL Compiler Errors
Reverting part of a clean up that was done 6 months ago. The
consequence was that OpenCL compositing wasn't working since
then.
2019-10-29 09:40:29 +01:00
51ac654b3f Merge branch 'blender-v2.81-release' 2019-10-29 19:30:24 +11:00
7cc489a2c8 Error in last commit 2019-10-29 19:29:38 +11:00
7d7bd02ea7 Cleanup: quiet TBB deprecation warning 2019-10-29 19:25:08 +11:00
Stefan Werner
2dab4393b0 macOS: Allow NSView subclasses to accept first mouse event.
This brings the behavior in line with Windows and Linux. Going between
multiple windows now doesn't use the first click only to change focus
but also allows Blender to process those events.
2019-10-28 22:19:00 +01:00
Julian Eisel
fb3add54d9 Merge branch 'blender-v2.81-release'
Had conflicting changes from b546263642 and 7c1fbe24ca, but the
changes from the former have to be used.
2019-10-28 19:43:59 +01:00
Julian Eisel
7c1fbe24ca Fix T71019: Disappearing file thumbnails & crash on area split
When opening the file browser as regular editor, the ID filter flags
as stored in FileSelectParams were not set explicitly, so they were 0.
Since 9100982e80, the value actually passed to the filtering could
differ from that, causing the file list cache to be constantly updated
on every redraw.

Caused by 9100982e80.

Note that this "accidentially" got fixed in master with b546263642,
which is why the issue only showed up in the release branch from that
point.
2019-10-28 19:34:41 +01:00
1ed46bf727 Keymap: use Alt, Spacebar to set the cursor tool
There were no shortcuts for setting the 3D cursor.
2019-10-29 05:30:14 +11:00
5a481e41ce Merge branch 'blender-v2.81-release' 2019-10-29 04:51:35 +11:00
43a8fdb6ad UI: add icon for drawing space key
Drawing was already added, only the icon was missing.
2019-10-29 04:50:04 +11:00
e38a00f981 Merge branch 'blender-v2.81-release' 2019-10-29 03:47:10 +11:00
c050247edc CMake: update cmake_consistency_check
Support for listing files which are known not to exist
(needed by standalone cycles).
2019-10-29 03:46:50 +11:00
9267e6275c PyAPI: change behavior of bpy.path.module_names
Instead of checking for names that contain ".", only skip files
that start with a "." (since they're used for ".git" & ".arcconfig").

While other path names may fail to import, it's not the purpose of this
function to validate the path, have the caller must raise an error
instead of silently skipping them.

See D6140.
2019-10-29 02:14:53 +11:00
d310cbfa0f Merge branch 'blender-v2.81-release' 2019-10-29 01:38:34 +11:00
312075e688 CMake: add missing headers, use space before comments 2019-10-29 01:33:44 +11:00
Julian Eisel
74c9a4769e Fix: Some ID-Filters not enabled on Link/Append
Caused by 9100982e80.
2019-10-28 15:19:26 +01:00
1bde6c04f9 Merge branch 'blender-v2.81-release' 2019-10-29 00:46:59 +11:00
f5ebe8395d Cleanup: correct argument type mismatch
Add transform_snap.h header which includes DNA enum.
2019-10-29 00:45:05 +11:00
9cd0e75fff Merge branch 'blender-v2.81-release' 2019-10-28 09:54:35 -03:00
ce0db668ec Fix T50148: Header: Wrong rounding when moving frames
Deduplicate the code and use the same logic used to
calculate individual elements in `t->values_final[0]`.

Differential revision: https://developer.blender.org/D6135
2019-10-28 09:51:53 -03:00
a83bbefec6 Cleanup: use doxy sections for transform_snap 2019-10-28 09:32:59 -03:00
de152d0724 Tool System: Use tapping Alt as a leader key to switch tools
Now tapping Alt prompts for a second input to switch tools.

Initial implementation of T69992
2019-10-28 22:59:59 +11:00
df9f1d91da UI: use zero box-spacing when used in headers
Without this, boxes are unusable in header layouts as they
add vertical space which shifts the items out of the header.
2019-10-28 22:40:12 +11:00
23f4c3b126 Merge branch 'blender-v2.81-release' 2019-10-28 21:42:53 +11:00
88911e4664 Keymap: use Ctrl-F2 for batch rename
Alt-F2 conflicted for Gnome on Linux,
change the keymap since it doesn't conflict on macOS or Windows.

Resolves T70480
2019-10-28 21:38:56 +11:00
c2870e157e Merge branch 'blender-v2.81-release' 2019-10-28 11:05:04 +01:00
a2bfd28d5e Fix T71150: GPencil: Wrong Naming of Convert GP object to Meshes
The problem was the real menu text must be: `Convert to Polygon Curve` as is Object menu.

A GPencil object cannot be converted to mesh in one step. The conversion must be GPencil to Curve and Curve to Mesh.
2019-10-28 11:03:53 +01:00
d4a67fa87b Merge branch 'blender-v2.81-release' 2019-10-28 10:31:52 +01:00
9f388c1646 Fix T71037: batch rename bones in pose mode throws exceptions
Maniphest Tasks: T71037

Differential Revision: https://developer.blender.org/D6122
2019-10-28 10:27:06 +01:00
dd904f6761 WM: add utility to lookup a keymap item from an event
Useful for modal operators to be able to match events
against regular keymaps.
2019-10-28 04:59:35 +11:00
ae55523013 UI: add utility to show icons for the keymap item
This is useful for drawing keymap items into the header or status bar

While these icons are available directly,
mapping them from the keymap item isn't trivial.
2019-10-28 02:57:56 +11:00
c036db9f57 Merge branch 'blender-v2.81-release' 2019-10-28 00:44:31 +11:00
9b6aa740be Cleanup: remove redundant NULL checks 2019-10-28 00:40:51 +11:00
1e630d79fb Merge branch 'blender-v2.81-release' 2019-10-27 10:05:43 +01:00
f1824e6ec4 Cleanup: Fix tooltip text 2019-10-27 10:05:08 +01:00
1aa1716924 Merge branch 'blender-v2.81-release' 2019-10-25 21:50:48 +11:00
7137d89daa Preferences: remove keymap items created with invalid data path
Before T65397 was fixed, invalid "(null)" data paths were being created.

Remove these keymap items from preferences.
2019-10-25 21:47:16 +11:00
2a3b5dc730 Merge branch 'blender-v2.81-release' 2019-10-25 06:11:47 +11:00
892c3891ed UI: partial revert of renaming Normal -> Regular
These instances refer to winding/direction.
2019-10-25 06:00:46 +11:00
e50b4d7de4 UI: Incorrect Cursor Used in Split Area Operator
Incorrect cursor shown for horizontal split when selected from edge context menu.

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

Reviewed by Campbell Barton
2019-10-24 09:17:55 -07:00
0c66039cfd Merge branch 'blender-v2.81-release' 2019-10-25 01:27:20 +11:00
ad3f9c6dfe Fix crash drawing the paint cursor over the redo region
Also fix CTX_wm_region_view3d which didn't check the region type.
2019-10-25 01:25:23 +11:00
b35c14f015 Merge branch 'blender-v2.81-release' 2019-10-25 00:53:42 +11:00
ce6e7a0941 Fix T60689: Flip Active/Selected bone fails in weight paint mode
Multiple selection operations failed with weight-paint + pose mode.

Weight-paint + pose mode is a special case that doesn't support
multi-pose mode, so we need to use this instead of the generic
function.
2019-10-25 00:49:39 +11:00
e6c6db9af4 Merge branch 'blender-v2.81-release' 2019-10-24 13:48:54 +02:00
88a346420b Fix T71063: GPencil - Numpad return key cannot be used to confirm primitive 2019-10-24 13:48:16 +02:00
672f6b79fb Merge branch 'blender-v2.81-release' 2019-10-24 19:37:44 +11:00
5fa7d8643f Cleanup: comment unused duplicate flags 2019-10-24 19:36:23 +11:00
040eb18837 Merge branch 'blender-v2.81-release' 2019-10-24 18:36:16 +11:00
bf3c382c47 Cleanup: comments, formatting 2019-10-24 18:15:08 +11:00
1afdea624c Transform: reverse absolute, ratio vertical motion
This only impacts push-pull & shrink-fatten.

Flipping this matches zoom where moving the mouse cursor up
increases the zoom-level.

Previous behavior felt unnatural when adding gizmos to these tools.
2019-10-24 17:56:40 +11:00
ac788b3d6d Merge branch 'blender-v2.81-release' 2019-10-24 15:30:58 +11:00
9be3ef6c72 Fix T71036: Separate loose parts crashes in object mode
Error in own recent optimization.
2019-10-24 15:29:09 +11:00
Dalai Felinto
9aa1bb6388 Fix T70439: Local view always including new objects
The same issue is valid for objects from a recently re-enabled
collection.
2019-10-23 13:40:12 -03:00
d212fb774f Cleanup: add back comment that was removed when moving code
Keep comments when moving code between files.

Also wrap lines over 120 width.
2019-10-24 00:42:53 +11:00
976a2ce58b Merge branch 'blender-v2.81-release' 2019-10-23 15:03:37 +11:00
b9dd87f0cb Doxygen: update configuration
Quiet warnings when generating docs.
2019-10-23 15:02:52 +11:00
3e3e5fd9c8 Merge branch 'blender-v2.81-release' 2019-10-23 14:59:44 +11:00
Richard Antalik
0d8df07232 Fix T70845: Crash when switching scene of scene strip.
Crash on assert in `sound_verify_evaluated_id()`

Reviewed By: sergey

Maniphest Tasks: T70845

Differential Revision: https://developer.blender.org/D6104
2019-10-23 14:58:48 +11:00
4dc443908c CMake: disable OpenMP on macOS bpy_module config
This gives linking errors on build.
2019-10-23 14:50:42 +11:00
Richard Antalik
15d27c1ae5 Fix T70845: Crash when switching scene of scene strip.
Crash on assert in `sound_verify_evaluated_id()`

Reviewed By: sergey

Maniphest Tasks: T70845

Differential Revision: https://developer.blender.org/D6104
2019-10-22 17:34:14 -07:00
6c1cc08da3 Merge branch 'blender-v2.81-release' 2019-10-23 02:36:21 +11:00
ac18c3c28d Cleanup: unused variables, enums, spelling 2019-10-23 02:34:30 +11:00
0a38352588 Cleanup: clang-format, trailing space 2019-10-23 01:06:15 +11:00
dc0ce14316 Merge branch 'blender-v2.81-release' 2019-10-22 11:24:10 +02:00
f8e8f4ee0f GPencil: Calculate inverse matrix only once
Instead to do it for each action, do it only in init.
2019-10-22 11:23:40 +02:00
a0d675d88f Merge branch 'blender-v2.81-release' 2019-10-22 17:42:09 +11:00
bfa9ead12a Cleanup: quiet unknown escape warnings
Auto-complete showed errors.
2019-10-22 17:38:55 +11:00
b5f77973a7 Cleanup: remove BLI_dynstr use in py_capi_utils
Needed for standalone mathutils module.
2019-10-22 17:38:48 +11:00
2c6e95bb57 Merge branch 'blender-v2.81-release' 2019-10-22 15:26:23 +11:00
6f779218fb BLI_math: support MATH_STANDALONE without Eigen 2019-10-22 15:22:45 +11:00
502f01cc47 Merge branch 'blender-v2.81-release' 2019-10-21 20:07:45 +02:00
388c954cb5 Fix T70888: GPencil Sculpt tools don't work properly in a particular situation
Thanks to @charlie for his help fixing this bug.
2019-10-21 20:07:09 +02:00
200267eb96 Merge branch 'blender-v2.81-release' 2019-10-21 15:53:29 +02:00
d0cba5caf4 Fix T70937: Cycles fails in viewport when rendering with OptiX
Was caused by D6068, which did not handle "MEM_PIXELS" memory
when not in background mode. Before that it always fell back to using
generic device memory, so restoring that behavior. In future this
should be changes to use OpenGL interop for optimal performance.
2019-10-21 14:23:45 +02:00
42eef8f81a Merge branch 'blender-v2.81-release' 2019-10-21 20:03:08 +11:00
6a1118092a Fix invalid property shortcuts being created
When there was no way to find the data-path from context
the shortcut was still being created.
It would evaluate to "context.(null)".

Now adding shortcuts will be disabled if the path can't be computed.
2019-10-21 19:57:43 +11:00
3af8f88539 Merge branch 'blender-v2.81-release' 2019-10-21 19:20:35 +11:00
34c835cbd1 Fix project from view crash before the GPU is initialized 2019-10-21 19:19:04 +11:00
95fddf1452 Merge branch 'blender-v2.81-release' 2019-10-21 15:07:22 +11:00
41ec25d27b Cleanup: style 2019-10-21 15:05:56 +11:00
7fa8c41693 Merge branch 'blender-v2.81-release' 2019-10-21 14:51:29 +11:00
3ceff8b7bc CMake: fix building as a Python module on macOS
Caused by c553b790fc
2019-10-21 14:48:17 +11:00
7242d79072 Merge branch 'blender-v2.81-release' 2019-10-21 02:58:45 +11:00
71538eaad6 Fix T70864: Separate loose parts runs indefinitely
Large objects with many separate pieces became unstably slow
(run for hours and not finish).

The entire original mesh was being duplicated twice per loose part.

In own tests, millions of vertices and thousands of loose parts
now run in around 5-15 seconds.
2019-10-21 02:47:07 +11:00
47d7f5e200 Shrinkwrap: improve numerical stability of Target Normal Project.
* Add proper adjustment for scale in the solver epsilon computation.
* Run at least one full iteration of the solver, even if the initial
  state meets the epsilon requirement.
* When applying offset, blend normal into the offset direction
  as the initial point moves very close to the target mesh.

Also random improvements to debug trace output in the console.
2019-10-20 16:53:21 +03:00
fed27c25aa Merge branch 'blender-v2.81-release' 2019-10-20 18:26:11 +11:00
98ab0f173c Mesh: add API functions for poly & loop removal
These existed for verts & edges, add for API completeness.
Also add ED_mesh_geometry_clear,
needed to reduce memory for edit-mesh separate.
2019-10-20 18:25:17 +11:00
b72a3146eb Merge branch 'blender-v2.81-release' 2019-10-20 16:43:57 +11:00
047c66279a Cleanup: missing declaration warnings 2019-10-20 16:42:49 +11:00
Charlie Jolly
c2a2cd13be GPencil: Primitive: Polyline Tool
T70927

Maniphest Tasks: T70927

Differential Revision: https://developer.blender.org/D6097
2019-10-19 12:27:40 +01:00
3de4446959 Merge branch 'blender-v2.81-release' 2019-10-18 16:43:09 +02:00
970d7ed860 Fix T70790: Crash in sculpt mode switching from two meshes after reload saved file
This fixes the crash, but it does not fix the core issue. The PBVH should
always be available when an object is in sculpt mode and tools should
not need to check for that.

Reviewed By: jbakker

Maniphest Tasks: T70790

Differential Revision: https://developer.blender.org/D6063
2019-10-18 16:41:41 +02:00
b13a2b8253 Merge branch 'blender-v2.81-release' 2019-10-18 16:26:34 +02:00
082fb6603d Fix T70839: Sculpt brushes stop affecting after using move, rotate or scale tools
Reviewed By: jbakker

Maniphest Tasks: T70839

Differential Revision: https://developer.blender.org/D6071
2019-10-18 16:24:50 +02:00
045256a554 Merge branch 'blender-v2.81-release' 2019-10-18 16:09:39 +02:00
6183688c35 Fix T70919: Proxies crash after building motion path
Was cause by recent fix for T65134 which assigned original object's
proxy_from to an evaluated pointer.

This is because motion path depsgraph does not include proxies, so
the pointer in an evaluated object was kept pointing to an original
object.
2019-10-18 16:06:23 +02:00
8148bf8cf0 Merge branch 'blender-v2.81-release' 2019-10-18 13:33:20 +02:00
725b59d9b4 Fix T70903: Opening splash screen from named app_template crashes
Caused by rB46102cf4e0c4 [which removed the check if the image can
actually be loaded].

Maniphest Tasks: T70903

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D6089
2019-10-18 13:29:54 +02:00
8378db40c7 Cycles: Fix out of memory when rendering some scenes with OptiX that work with CUDA
The OptiX implementation wasn't trying to allocate memory on the host if device allocation failed, while the CUDA implementation did. This copies the implementation over to OptiX to remedy that.

Differential Revision: https://developer.blender.org/D6068
2019-10-18 12:23:27 +02:00
959b40c2a8 Merge branch 'blender-v2.81-release' 2019-10-18 19:17:55 +11:00
16665ad753 Cleanup: remove unused viewport fx_settings 2019-10-18 19:10:25 +11:00
eb559f2b24 Merge branch 'blender-v2.81-release' 2019-10-18 18:51:46 +11:00
acd98599ff Fix T65397: Assigning shortcut to editor properties gives errors 2019-10-18 18:50:18 +11:00
3a3da6baa3 Merge branch 'blender-v2.81-release' 2019-10-17 17:41:55 +02:00
382e7ce9ec Fix T70678 Workbench: Smoke Sim display has incorrect offset
Fix the ray direction computation.
2019-10-17 17:40:30 +02:00
4142f3993c Fix T70811 EEVEE: Alpha clip/hashed cause wrong alpha values
Was caused by division not giving a fully opaque alpha value.
2019-10-17 17:40:30 +02:00
9378d46c4d Merge branch 'blender-v2.81-release' 2019-10-17 16:20:28 +02:00
ade2129f14 Fix T70901: Pose bone with Armature Constraint moves in wrong direction
A regression since previous fix for proxy. Restore old code for copying
values to an original pose channel.
2019-10-17 16:20:14 +02:00
77e38160fe Merge branch 'blender-v2.81-release' 2019-10-17 13:17:36 +02:00
9054b83402 Cleanup depsgraph access in particle_edit.c
'PE_set_data' / 'PE_set_view3d_data' would give us a depsgraph already,
so use it.

Also fix access to PEData->depsgraph without calling 'PE_set_data' prior.

Addresses concern raised in rBcf2c09002fae.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D6067
2019-10-17 13:17:05 +02:00
78f8270ad3 Volumetric: Debug Voxel Size and Location
When displaying the voxel size for an adaptive domain the resolution of the adaptive domain was used to calculate the world size of the voxel.
This patch changes this to use the initial size of the domain.

When using adaptive domain the overlay was not rendered in the right
place.

Thanks to sebbas for part of the patch!

Reviewed By: sebbas, fclem

Differential Revision: https://developer.blender.org/D6076
2019-10-17 12:19:30 +02:00
9d228c688d Volumetric: Debug Voxel Size and Location
When displaying the voxel size for an adaptive domain the resolution of the adaptive domain was used to calculate the world size of the voxel.
This patch changes this to use the initial size of the domain.

When using adaptive domain the overlay was not rendered in the right
place.

Thanks to sebbas for part of the patch!

Reviewed By: sebbas, fclem

Differential Revision: https://developer.blender.org/D6076
2019-10-17 12:16:03 +02:00
81cc57d90d Merge branch 'blender-v2.81-release' 2019-10-17 12:01:42 +02:00
f45127c6cb Fix T70740: Clicking on proxy bone makes original one jump to initial location
Caused by what appears to be a missing flush from evaluated bone back to
original, which then makes it so copy-on-write operation happening after
click (to synchronize selection flags) pushes original bone to its initial
position.

Differential Revision: https://developer.blender.org/D6051
2019-10-17 11:59:48 +02:00
d2b900e715 Merge branch 'blender-v2.81-release' 2019-10-17 11:59:22 +02:00
5115759fdd Cleanup: Fix naming of a function 2019-10-17 11:51:02 +02:00
bc42312100 Merge branch 'blender-v2.81-release' 2019-10-17 11:43:40 +02:00
d89b65cc91 Node shader wrapper: use 'Non-Color' profile for BW textures inputs.
All the single-value texture inputs of Principled BSDF node should use
non-color colorspace profile, not sRGB one (issue raised in
https://blender.stackexchange.com/questions/155617, thanks).

That also revealed another issue - since those color space settings are
stored at the image level itself, not the node one, we need to
duplicate those image data-blocks when we use same picture for e.g. base
color (sRGB) and specular (non-color) inputs...

For now using a basic mechanism for that, might generate several extra,
uneeded copies of the image ID, but that’s better than breaking custom
settings and such.

Note that while this will modify the behavior of the impporters using
that node wrapper, no change should be needed in IO add-ons themselves.
2019-10-17 11:43:11 +02:00
f9f507f9d8 Merge branch 'blender-v2.81-release' 2019-10-17 11:27:16 +02:00
dffe702d78 Fix T69182: Auto-Smooth does not work on Alembic meshes without normals
The auto-smoothing flag can now be used by artists when the Alembic file
does not contain custom loop normals.

- Auto-smoothing disabled: mesh is flat-shaded.
- Auto-smoothing enabled: works as usual; set angle to 180° to ensure
  a 100% smoothed mesh.
2019-10-17 11:26:33 +02:00
78cd3f7db9 Merge branch 'blender-v2.81-release' 2019-10-17 11:16:12 +02:00
2afbd14c59 Fix T70887: GPencil edit lines are not displayed in the right place
The lines were not using the matrix to calc the tarnsformation.
2019-10-17 11:15:22 +02:00
707d40e627 Merge branch 'blender-v2.81-release' 2019-10-17 10:23:17 +02:00
74db523a52 Fix T70739: Make Library Override doesn't re-target Armature constraints.
Missing one step (collection prop itself) in RNA hierarchy of properties
leading to those armature object pointers...
2019-10-17 10:21:52 +02:00
76e6d2f19d Cleanup: spelling
Also remove historic bftgl reference.
2019-10-17 12:40:36 +11:00
e7c02f14c7 Merge branch 'blender-v2.81-release' 2019-10-17 12:39:23 +11:00
85ddaaa16e Fix invalid flag check
Cast occurs first, making any flag enable this option.
2019-10-17 12:34:20 +11:00
dccf3acede Merge branch 'blender-v2.81-release' 2019-10-17 12:29:41 +11:00
3a51b27734 Cleanup: shadow warning 2019-10-17 12:28:35 +11:00
0c57373e2c Merge branch 'blender-v2.81-release' 2019-10-16 21:59:26 +02:00
812b30daf5 GPencil: Fix unreported performance issue with relative onion mode
When the relative mode was used, the calculation of the total number of vertices was not done and it was using the total number of vertices in the datablock. This worked for small files, but with complex files the time to allocate all the data was too long and the performance was very bad.

Now, for relative mode the real number of vertex is calculated.

Also fixed the same problem when onion and multiedit is enabled.
2019-10-16 21:56:25 +02:00
51429343a5 Merge branch 'blender-v2.81-release' 2019-10-16 20:18:17 +02:00
7e78fbf2de Fix assert and memleak in recent Skin Root Display patch
Caused by 4ddf3215a7
2019-10-16 20:16:53 +02:00
bb890d4f65 Merge branch 'blender-v2.81-release' 2019-10-16 19:06:22 +02:00
131ac2ec82 Fix T70249 EEVEE: Light bleeding on SSS translucency
This was caused by 2 things: Shadow map bias and aliasing.

It made the expected depth of the shadowmap further than the surface
itself in some cases. In normal time this leads to light leaking on normal
shadow mapping but here we need to always have the shadowmap depth above
the shading point.

To fix this, we use a 5 tap inflate filter using the minimum depth of all
5 samples. Using these 5 taps, we can deduce entrance surface derivatives
and there orientation towards the light ray. We use these derivatives to
bias the depth to avoid wrong depth at depth discontinuity in the shadowmap.

This bias can lead to some shadowleaks that are less distracting than the
lightleaks it fixes.

We also add a small bias to counteract the shadowmap depth precision.
2019-10-16 18:58:20 +02:00
4ddf3215a7 Fix T68380 Skin modifier root not displayed 2019-10-16 18:58:12 +02:00
8956666899 Fix T70543 Rigid Body Collision Shape Not Displayed In Viewport 2019-10-16 18:58:05 +02:00
Dalai Felinto
5da9ae9c0b Merge remote-tracking branch 'origin/blender-v2.81-release' 2019-10-16 12:37:03 -03:00
Dalai Felinto
3ff25fa80a Fix multi-object edit mode and local view/collections
Before this patch you could go to a local view with a single object,
while you had other objects also in edit mode, and your operators would
affect all objects even the ones outside your local view (same for local
collection).

Differential Revision: https://developer.blender.org/D6064
2019-10-16 12:31:27 -03:00
Jeroen Bakker
b0476f0631 Workbench: Background Dithering
Background dithering was introduced to solve banding issues on gradient backgrounds.
This patch will enable dithering based on the texture that is used for drawing.
Only when using a GPU_RGBA8 texture the dithering will be enabled.

This disables dithering for final rendering, vertex and texture paint modes.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D6056
2019-10-16 15:40:25 +02:00
e413b39a93 PyAPI: use public API's for module & builtin access
D6038 by @Dormouse
2019-10-16 23:16:51 +11:00
87539172ed Cleanup: warnings 2019-10-16 23:16:51 +11:00
Julian Eisel
b546263642 UI: Remember ID-Filter in-between File Browser calls
This adds the ID-Filters visible on append/link to the settings the file
browser remembers, potentially storing them in the Preferences.

Artists in the studio here requested this. They typically have to set up
the same or similar settings every time, so this saves them from that.
2019-10-16 14:06:48 +02:00
Julian Eisel
a3f7ae1b96 UI: Add missing workspace icon to link/append ID-Filters 2019-10-16 11:29:27 +02:00
Julian Eisel
a6b9e1dfdb Fix: Some ID-Filters not enabled on Link/Append
Caused by 9100982e80.
2019-10-16 11:26:04 +02:00
dcf57e34f3 GPencil: Fix unreported problem when use Onion Skin in several windows
The onion skin was nos displayed in secondary screens when disable the Onion switch or the Overlay in the main window.

Added a check to verify if the main overlay and onion switches are enabled in any screen in order to generate the cache data.

This is required to generate the onion skin and limit the times the cache is updated because the cache is generated only in the first screen and if the first screen has the onion disabled the cache for onion skin is not generated. The loop adds time, but always is faster than regenerate the cache all the times.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D6049
2019-10-16 10:33:39 +02:00
Stefan Werner
35a545b752 Cycles: Allow PTX targets for CUDA kernel build.
This is intended for developers on Windows primarily:
Now, CUDA architectures of type compute_xx are supported. This allows for quicker builds,
at the expense of the CUDA driver running ptxas the first time a kernel is loaded.

Differential Revision: https://developer.blender.org/D5953
2019-10-16 10:29:04 +02:00
76e8d2cc17 Merge branch 'blender-v2.81-release' 2019-10-16 19:15:52 +11:00
80f0bc99a9 Fix T70850: Scene.frame_set doesn't update camera from markers 2019-10-16 19:10:28 +11:00
4a77ddf146 Merge branch 'blender-v2.81-release' 2019-10-16 09:40:56 +02:00
0dcc5572d6 Fix (unreported) VSE scene strip should not be able to set the scene to
self

Spotted while looking into T70845

Reviewers: sergey, ISS, campbellbarton

Differential Revision: https://developer.blender.org/D6073
2019-10-16 09:38:48 +02:00
519f79e111 Merge branch 'blender-v2.81-release' 2019-10-16 15:59:06 +11:00
9dd5e3b6e8 Cleanup: define PY_SSIZE_T_CLEAN for Python
Silence deprecation warnings running with Python 3.8.
2019-10-16 15:58:32 +11:00
cc2bc3370b Merge branch 'blender-v2.81-release' 2019-10-16 15:02:46 +11:00
36b6fb5cd6 Cleanup: warnings building with Python 3.8 2019-10-16 14:44:36 +11:00
0e7fe872de Merge branch 'blender-v2.81-release' 2019-10-16 14:16:12 +11:00
01e2786bdd Fix incorrect limit check in button drawing
Regression in d617466d87
2019-10-16 14:13:34 +11:00
20b0bedb8b Merge branch 'blender-v2.81-release' 2019-10-16 14:10:23 +11:00
1094c3f276 RNA: region_to_view took int's instead of floats
Internally the function uses float's, RNA exposed args as int's.

Python3.8 warns about int/float conversion in toolbar drawing code.
2019-10-16 14:07:37 +11:00
8eb98392df Merge branch 'blender-v2.81-release' 2019-10-16 13:42:01 +11:00
a7cf7b114f Fix for building with Python 3.8 2019-10-16 13:39:29 +11:00
a8d001fef5 Merge branch 'blender-v2.81-release' 2019-10-15 15:02:45 -03:00
cfb6ffd48f Fix T70386: Crash when snapping to edges in specific situations
The callbacks get elements through indexes,
so make sure they're not "dirty".
2019-10-15 14:59:30 -03:00
e3282fecae Merge branch 'blender-v2.81-release' 2019-10-15 17:37:35 +02:00
2a9b162d94 Fix T70605: incorrect darken and lighten rgb mix mode
Differential Revision: https://developer.blender.org/D6058

Reviewers: brecht, fclem
2019-10-15 17:31:44 +02:00
4ace593196 Merge branch 'blender-v2.81-release' 2019-10-15 17:08:20 +02:00
c2a7e79047 Fix T70771: Texture nodes in Compositor causes infinite update 2019-10-15 17:07:53 +02:00
Dalai Felinto
622324f717 Merge remote-tracking branch 'origin/blender-v2.81-release'
Silly merge just to test new server-side git hook.
2019-10-15 10:55:18 -03:00
Dalai Felinto
cb4fa01fcf Fix GPL block in CMake file
(using this to test the new server-side git hook)
2019-10-15 10:54:13 -03:00
Dalai Felinto
6d8f5679db Merge branch 'blender-v2.81-release' 2019-10-15 10:42:42 -03:00
Dalai Felinto
7df7a8f3f1 Fix T70838: crash on cycles render after recent fix
My bad for not figuring out how to run our unittests since I got back to
Windows.
2019-10-15 10:18:11 -03:00
Julian Eisel
6934688f2c Merge branch 'blender-v2.81-release' 2019-10-15 14:59:59 +02:00
Julian Eisel
4d3a317258 Fix T70815: Missing tool settings redraw when using Annotate Tool 2019-10-15 14:56:50 +02:00
3db7f145df Merge branch 'blender-v2.81-release' 2019-10-15 20:30:11 +11:00
871845b979 Fix T70433: No shortcut in tooltip for viewport X-Ray
While not a bug exactly, it's useful to show the shortcut,
expose the operator in the UI instead of the property.
2019-10-15 20:27:04 +11:00
51750168f7 Merge branch 'blender-v2.81-release' 2019-10-15 11:18:29 +02:00
391b652be4 Cleanup: clang format for rBb77da65e8c4d 2019-10-15 11:16:55 +02:00
0473815d48 Merge branch 'blender-v2.81-release' 2019-10-15 11:03:32 +02:00
d54ccb90ab Fix T70667: crash playing animation (after deleting rigid body obj)
Was crashing due to RBW mssing shared->physics_world [which can happen
when undoing the deletion of the last object in the world].
This can be gained back by BKE_rigidbody_validate_sim_world.

Reviewed By: mont29

Maniphest Tasks: T70667

Differential Revision: https://developer.blender.org/D6037
2019-10-15 10:57:59 +02:00
3cdcd1fa9f Merge branch 'blender-v2.81-release' 2019-10-15 19:27:59 +11:00
171a47421d Fix T70590: Python Gizmo API misses opacity & anti-aliasing
Thanks to @mano-wii for finding root cause.
2019-10-15 19:24:40 +11:00
8bab53f5a0 Merge branch 'blender-v2.81-release' 2019-10-15 10:07:12 +02:00
b77da65e8c Fix T68700: Incorrect 'absolute' timing of animated masks in the Video
Sequence Editor

Code in 'seq_render_mask' will effectively do
BKE_mask_evaluate(mask_temp, mask->sfra + (cfra - fra_offset), true)
where 'fra_offset' is zero for absolute and seq->start for relative.

If we really want the scene's current frame (as advertised) if Mask Time
is set to Absolute (effectively ignoring the Mask Settings start/end) we
need to change the fra_offset from zero to mask->sfra.

Also BKE_animsys_evaluate_animdata should take mask->sfra into account
as well (otherwise mask animation [points] and other animation [e.g.
opacity] will run out of sync)

Reviewers: campbellbarton, ISS

Maniphest Tasks: T68700

Differential Revision: https://developer.blender.org/D5495
2019-10-15 10:06:14 +02:00
fba127619d Merge branch 'blender-v2.81-release' 2019-10-15 09:48:54 +02:00
fa76f08db5 Fix T70560: Large cones are created with double vertices (even though
the radius is zero)

Merge threshold for remove_doubles was hardcoded, now scaled by depth.

Reviewed By: campbellbarton

Maniphest Tasks: T70560

Differential Revision: https://developer.blender.org/D6001
2019-10-15 09:46:59 +02:00
23b3b5bc76 Merge branch 'blender-v2.81-release' 2019-10-15 18:29:42 +11:00
7fb12536b7 UI: increase precision for fps-base value
The default precision displayed 1.001 as 1.00,
leading to confusing final FPS values.

Fixes T70827
2019-10-15 18:25:49 +11:00
e2e95d56ff Merge branch 'blender-v2.81-release' 2019-10-15 17:30:07 +11:00
0500dcd711 Fix scan-fill normal flipping for displist & mask filling
Missed from fix for T70594 which reversed the normals,
Resolves T70809
2019-10-15 17:23:23 +11:00
364c1f4222 Merge branch 'blender-v2.81-release' 2019-10-15 15:21:09 +11:00
4fcdcbe38d Cleanup: pep8 for templates 2019-10-15 15:20:15 +11:00
52ccfdb953 Merge branch 'blender-v2.81-release' 2019-10-15 14:22:52 +11:00
46102cf4e0 Fix T70812: AppTemplate Splash image is not loading
Allow different splash heights, without this changes the the
default splash would stop app templates splash screen from loading.

This also allows the default splash height to change without
manually editing the layout.
2019-10-15 14:19:25 +11:00
Dalai Felinto
a4ef7a27d2 Merge branch 'blender-v2.81-release' 2019-10-14 22:47:07 -03:00
Dalai Felinto
abd7ad01b8 Cleanup: Fix warnings 2019-10-14 22:45:34 -03:00
Dalai Felinto
dc5fa12bd3 Cleanup: Use BKE_object_is_visible elsewhere 2019-10-14 22:45:33 -03:00
Dalai Felinto
280d6b03a7 Fix T70670: Hidden collections are still rendered by Cycles in the Viewport
Now local collections are fully working with cycles preview, while the
collection visibility bug is fixed.

Local collections were not working with cycles viewport even before the recent
commit to allow users to show collections that are hidden in the view layer.

It just got worse with said commit (0812949bbc).

Differential Revision: https://developer.blender.org/D6034
2019-10-14 22:45:33 -03:00
Dalai Felinto
af5cc8cbd4 Fix T69644 / T68586: objects flag unsynced when drag hidden collections
That would lead to crashes and other issues. The solution is not elegant
though, it involves resyncing all the collections again.

Differential Revision: https://developer.blender.org/D6043
2019-10-14 22:45:33 -03:00
Dalai Felinto
9100982e80 Fix Filebrowser Blender ID filter
When the filtering option was disable we should see all the datablock types.

Differential Revision: https://developer.blender.org/D6033
2019-10-14 22:45:33 -03:00
b2d83a0697 Merge branch 'blender-v2.81-release' 2019-10-15 12:29:45 +11:00
a9fbd05e7d Fix image undo restoring float/byte tiles into the wrong buffer type
This also resolves the (unlikely) issue of undo having uninitialized
zbuf data, now it's cleared instead.
2019-10-15 12:24:26 +11:00
c1db52def2 Merge branch 'blender-v2.81-release' 2019-10-15 12:06:11 +11:00
c412a54123 Docs: clarify writefile.c file format info 2019-10-15 12:04:59 +11:00
100af18955 Docs: clarify writefile.c format text 2019-10-15 12:02:40 +11:00
695cbf5eef Fix incorrect brush falloff flag use
Harmless currently since they're the same value,
would fail if other options were added.
2019-10-15 10:04:34 +11:00
Julian Eisel
9a85592dde Fix: First item in File Browser can't be renamed
Stupid mistake in 5edfde58fe.
2019-10-14 21:07:24 +02:00
519891c669 Merge branch 'blender-v2.81-release' 2019-10-14 18:48:16 +02:00
879d269e87 Py API doc generator: more tweaks to adapt to new release process.
Now we also create a 'version' symlink for master.
2019-10-14 18:46:50 +02:00
Julian Eisel
f55a5478e8 Merge branch 'blender-v2.81-release' 2019-10-14 18:16:54 +02:00
5ba41bea8a Fix autokeyframe not working on bones mirrored bones
The previous code for this didn't work as the MIRROR bone flag would be
cleared before the autokeyframe code was run.
2019-10-14 18:16:21 +02:00
Julian Eisel
760481518b UI: Add renaming to Node and VSE strip context menu
We should have that consistently everywhere the operation is available.
2019-10-14 18:13:58 +02:00
b8ca806b77 Fix autokeyframe not working on bones mirrored bones
The previous code for this didn't work as the MIRROR bone flag would be
cleared before the autokeyframe code was run.
2019-10-14 17:48:08 +02:00
2cdc187142 Merge branch 'blender-v2.81-release' 2019-10-14 17:40:06 +02:00
15539f7b6d Py API doc generator: tweak to handle new release process.
We need to handle beta stage in a specific way, since it's no longer
master, but not yet 'real' rc/release stage...

For now, only point to version dir of the API doc, but no need to create
any symlink (that way, 'current' remain pointing to 2.80 release, while
'2.81' is no longer a symlink to 'master', but its own actual doc).
2019-10-14 17:39:17 +02:00
6b6b27fd13 Update Py API link in help menu to point to version dir also in beta.
Now that we have beta and master in parallel, we cannot point to API doc
from master in beta builds of incoming release anymore.
2019-10-14 17:39:17 +02:00
Julian Eisel
5edfde58fe File Browser: Add F2 shortcut to rename files
Previously, we used Ctrl+Click for renaming, but since that shortcut is
now consistently used to add items to the selection, we can't use that.
In other cases we switched to F2 now, so it makes sense for the File
Browser too.
Further, AFAIK renaming was only possible through the context menu,
which makes it hard to discover in the right click select keymap (have
to press W).

Note that I had to do some internal changes to ensure the context menu
always acts on the clicked/hovered item, while the shortcut operates on
the active item. William and I agreed that this is likely the behavior
expected by most users.
2019-10-14 16:32:18 +02:00
ac52a53628 Merge branch 'blender-v2.81-release' 2019-10-14 15:56:58 +02:00
841e969580 GPencil: Fix unreported duplicated brushes
The eraser and fill brushes were duplicated due a bug introduced by versioning code.
2019-10-14 15:53:39 +02:00
df0ec670fb Merge branch 'blender-v2.81-release' 2019-10-14 15:46:52 +02:00
Julian Eisel
80fe0ac7ff Fix T70581: Node Wrangler output switching broken
When executing the node selection operator through Python, or in fact
any similar select operator with drag-all-selected support, the operator
was enabling modal execution, which should not be done in this case.
Reason was simply a wrong default for an internal property.
2019-10-14 12:11:13 +02:00
0fb55ff845 Fix T70787: Duplicating objects with custom property of type ID creates bogus links.
Note that the issue also affected animdata handling...

Checked all usages of the `BKE_libblock_copy_ex()` function, and
think never handling user count here is valid, although a bit risky
maybe. But other solution would be to add yet another copy flag, so
would rather go with that one for now.
2019-10-14 11:12:13 +02:00
e7367c607e Cleanup: Fix naming of a function 2019-10-14 10:45:35 +02:00
e8220dea60 GPU: prevent assert for zero length arrays
This could happen with the build modifier.
2019-10-14 18:39:16 +11:00
95f020c853 macOS: add opus to FFMPEG_LIBRARIES 2019-10-12 18:33:34 +03:00
bde328352b Cleanup: pep8 2019-10-12 10:26:37 +11:00
d105b620fa Cleanup: clang-format 2019-10-12 09:46:44 +11:00
5d7195ab8e Cleanup: warnings 2019-10-12 09:45:20 +11:00
60d02b336e Build: also use release branch for source/tools module 2019-10-11 21:43:45 +02:00
3842519a38 Revert "Merge branch 'master' into blender-v2.81-release"
This reverts commit 20b2acf336, reversing
changes made to f185cc0ca5.

Merges should only go form the release branch to master. For backporting
commits, use cherry-pick.
2019-10-11 21:31:58 +02:00
20b2acf336 Merge branch 'master' into blender-v2.81-release 2019-10-11 16:12:11 -03:00
f185cc0ca5 Fix T70729: Multi-object edit UV not transform all meshes
Detail that went unnoticed in rBbfc9d426bb95
2019-10-11 16:11:57 -03:00
4e3f186a8c Fix T70729: Multi-object edit UV not transform all meshes
Detail that went unnoticed in rBbfc9d426bb95
2019-10-11 15:55:35 -03:00
4bb8a3c111 Merge branch 'blender-v2.81-release' 2019-10-11 18:55:26 +02:00
1c2a20c84d Fix T70714: Crash when using OBJECT_OT_material_slot_assign op without UI.
There is no guarantee we can get any valid UI from the context, and that
operator can work without it.
2019-10-11 18:54:43 +02:00
1e5e65fa9f Fix T70695: Scene crashes Blender on open.
Note that this commit fixes the crash itself, but actual issue is *how*
that situation could happen (having insert override operation with local
'source' overriding data-block with an empty bone constraints stack...).
2019-10-11 18:54:15 +02:00
Alessio Monti di Sopra
ecd86c0587 UI: Fix grid scale text not having shadows in the 3d view infos
This commit adds a shadow to the grid scale info text in the 3d View,
to make it more visible like the rest of that section.

{F7798605}

Differential Revision: https://developer.blender.org/D6025
2019-10-11 12:28:35 -03:00
c5ecfd526e Cleanup: Remove unused variable 2019-10-11 15:50:42 +02:00
46e9fc9362 Cleanup: Strict compiler warnings 2019-10-11 15:01:34 +02:00
533a7e25db Add Probot Stale configuration file
This is a configuration of Blender mirror on Github which automatically
closes Pull requests and gives developers instructions how to submit patch
to an official code review.

Differential Revision: https://developer.blender.org/D6027
2019-10-11 14:13:29 +02:00
b57a89f062 Buildbot: don't add branch prefix when building release branches 2019-10-11 13:46:24 +02:00
Antonio Vazquez
5adb3b6882 GPencil: New Eyedropper tool for Material creation.
This patch is only for the eyedropper to create materials.

Options:
Click: Create Stroke Material
Shift+Click: Create Fill Material.
Shift+Ctrl+Click: Create Stroke and Fill Material.

Toolbar:

{F7718606}

Reviewed By: brecht, mendio

Differential Revision: https://developer.blender.org/D5688
2019-10-11 13:33:13 +02:00
ec295c1168 Merge branch 'blender-v2.81-release' 2019-10-11 13:29:43 +02:00
7d3ea8f12b Fix T69964: GPencil: Fill options are not shown on a properties editor
Differential Revision: https://developer.blender.org/D6041
2019-10-11 12:26:57 +01:00
74f9b9d144 GPencil: Remove curve objects after converting to strokes (unreported)
This was detected fixing T69459

Part of Differential Revision: https://developer.blender.org/D6045

Note: done in a separated commit to keep track of changes done not directly related to bug reported in T69459.
2019-10-11 13:18:39 +02:00
15ffa3e7db Fix T69459: Convert Curve to Grease Pencil clears Transform
Also changed to create a grease pencil object for each curve.

Part of differential revision: https://developer.blender.org/D6045
2019-10-11 13:13:43 +02:00
2b35ee3ea2 Fix issue in "make update" checking out submodule branch on buildbot 2019-10-11 13:11:10 +02:00
3f97d62072 Version bump to 2.81 Beta 2019-10-11 12:25:26 +02:00
67b1a15b3f Version bump to 2.82 alpha, master is now open for new features and changes 2019-10-11 12:23:15 +02:00
41d9cf225d Fix "make update" not using the right branch for source/tools 2019-10-11 12:22:28 +02:00
4b570f5b57 Version bump to 2.81.15 2019-10-11 12:17:32 +02:00
057c180c67 Docs: 2.81 release description for Linux appdata 2019-10-11 12:13:26 +02:00
88ba97558f Depsgraph: Inform when update or tag happens during evaluation
It is not allowed to do tagging or updates while dependency graph is
in the middle of evaluation.

This is something what is simple to violate from python code. This
change adds some sanity checks.

The request to update view layer or dependency graph will raise an
exception in Python now, so it's easy for scripters to notice.

Tagging for update will do silent return unless running with debug
command line argument. This is because it's a bit tricky to know
which exact dependency graph corresponds to a context from which
an update tag was triggered.

Differential Revision: https://developer.blender.org/D6035
2019-10-11 10:42:45 +02:00
c9d6eb4fb4 Depsgraph: Cleanup, promote is_evaluating query
This way it might be used for sanity checks in RNA API as well.
2019-10-11 10:42:45 +02:00
f9b7f3e930 Depsgraph: Don't use push-from-thread when scheduling graph
This isn't guaranteed that graph is scheduled from main thread,
so it is actually a miracle how it all worked.
2019-10-11 10:42:45 +02:00
2251c6e046 Fix T70191: Text button in popup doesn't work
F2 rename didn't work with mouse input.
2019-10-11 19:36:51 +11:00
f9cc51788b Cleanup: remove unused variable 2019-10-11 01:31:28 +02:00
00b6f8ef90 Fix T70715: sculpt brush jitter after recent TBB changes
Fix error in the splitting constructor, and some refactoring.
2019-10-11 01:26:56 +02:00
Dalai Felinto
b8f769fee8 Fix T64901: Nesting collection instances could clutter object display 2019-10-10 17:49:46 -03:00
b50b91c25d Cleanup: Fix wrong assert introduced by rBd98ae27f02c7 2019-10-10 20:16:22 +02:00
02f3014ec6 GPencil: Change Paint cursor to DOT
After doing some test, the cross cursor is too intrusive when you are drawing in grease pencil, so we decided to change by Dot cursor.

Reviewers: @brecht @mendio @pepeland @pablovazquez @billreynish
2019-10-10 20:04:39 +02:00
91a26ee745 Fix build error on macOS after recent changes for file delete 2019-10-10 18:30:47 +02:00
f3d9ea0a8a Fix build error on Windows after recent changes 2019-10-10 18:04:40 +02:00
6c302d6529 Sculpt: use TBB instead of BLI_task for multithreading
This solves performance issues on some computers where there is significant
threading overhead. Rather than doing the complicated work of optimizing our
own task scheduler, use TBB which appears to work well. The downside is that
we have another thread pool, but it is already there when using OpenVDB voxel
remesh.

For future releases we can switch to using TBB to replace our task scheduler
implementation entirely, and use the same thread pool for BLI_task, Cycles,
Mantaflow, etc.

Differential Revision: https://developer.blender.org/D6030
2019-10-10 17:36:12 +02:00
86042b7ced Build: add WITH_TBB option, in preparation of sculpt using it
It should no longer be tied to OpenVDB and OpenImageDenoise then.

Differential Revision: https://developer.blender.org/D6029
2019-10-10 17:35:35 +02:00
Robert Guetzkow
8825250f5a File Browser: add back Delete, which now moves files to the trash
In Blender 2.7 delete would permanently delete files, now this function is back
but using more standard behavior.

This patch includes code contributed by Kris (Metricity).

Differential Revision: https://developer.blender.org/D4585
2019-10-10 17:30:57 +02:00
826db891ab Node Shader wrapper: add access to the Emission color of Principled BSDF node.
This did not exist when that wrapper was created, but is supported by
many formats, so worth supporting it now. See also T70666.
2019-10-10 17:21:06 +02:00
8ada685581 Fix T70644 EEVEE: Bump issue with geometry node normal coordinate
Was caused by non-normalized coordinates (normals). Note this is not 100%
correct as the dFdx functions can be the same for packs of 4 pixels and the
derivated value can only be correct for one pixels.

This is because smoothed normals are a non-linear function (because of the
normalization).

The correct fix would be to do the dFdx offset BEFORE any normalization.
2019-10-10 16:57:28 +02:00
eac0f35845 Fix T65134: Duplicated proxies in several scenes don't work
This is something which worked in Blender 2.79.
Need to do special trickery to ensure peoxy_from points to a
proper object.

Differential Revision: https://developer.blender.org/D6040
2019-10-10 16:13:54 +02:00
Julian Eisel
1857aa32bd UI: Only hide locked transform manipulator axes for matching spaces
The manipulator would hide axes that were locked, even if the lock was
applied to a different space. That would lead to confusing behavior of
the manipulator. E.g.:
* Add armature
* Enter Pose Mode and select the bone
* Lock X and Y location in the Sidebar
* Enable the Move tool
* Only the Y axis is visible, but doesn't do anything on dragging
The manipulator would only show the Y axes, even though the lock is
applied to the bone's local Y axis, which matches the manipulators Z
axis.

Differential Revision: D6021

Reviewed by: Brecht van Lommel, William Reynish
2019-10-10 15:17:08 +02:00
Julian Eisel
cf192bdd43 Fix missing manipulator update when toggling bone lock 2019-10-10 15:08:35 +02:00
Julian Eisel
7c88d84515 Fix: Manipulator visible if root or tip of locked bone is selected
When an edit-bone was locked, we hid the transform manipulator for it.
But only if the bone itself was selected, not when the root or tip were
selected, even though they are locked then too. So this makes sure the
manipulator is shown in neither case.
2019-10-10 15:06:11 +02:00
e15ab630c6 Added little explanation of eModifierTypeType_(Non)Constructive
Thanks to @campbellbarton for the explanation.
2019-10-10 13:25:54 +02:00
35c707684b CMake: Allow to use pre-compiled CentOS libraries
The goal is to make it able to use pre-compiled CentOS libraries on a
more modern system. Main issue was that it's possible that the compiler
on a newer version is defaulting to different C++11 ABI.

This change makes it so that if there is NO native libraries in the
lib folder and there IS pre-compiled CentOS folder, it will be used and
compiler will be forced to old ABI.

Differential Revision: https://developer.blender.org/D6031
2019-10-10 10:39:53 +02:00
Antonio Vazquez
ea1174bde9 Annotations: Use flag to determine if the layer is a Ruler
Proposed fix for T70141.

Before, the ruler was using the name of the layer as key, but this is very weak because if the layer name changes, the layer gets an annotation layer.

Now, the layer is marked using a flag and now it's possible to rename it.

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D6028
2019-10-10 08:13:32 +02:00
7e020e70d9 Fix T70691: Crash picking object from eyedropper
Caused by 828905190e
2019-10-10 16:41:34 +11:00
b548b3d57e Fix crash versioning file-selector tool region
Loading the file from T69967 was crashing.
2019-10-10 13:55:00 +11:00
3c5bf7d1dc PyAPI: update for change in tessellate_polygon 2019-10-10 11:30:50 +11:00
5910f9f9e9 Fix T70617: mesh.from_pydata() misses first edge if there are faces 2019-10-10 11:16:51 +11:00
dc2cd2d0dc Cleanup: clang-format, spelling 2019-10-10 10:29:50 +11:00
f61a8a2abd Fix T70614 EEVEE: Bump with texture connected to other branches don't work
Was caused by the bump node not being evaluated because the other branch
was evaluated before.

To fix this, we use fromnode instead of tonode.

Also we fix a potential issue with recursiveness because
ntree_shader_copy_branch() also use nodeChainIterBackwards() which would
reset the iter_flag in the middle of the parent iteration. Use iter_flag
as a bitflag for each iteration to fix this.
2019-10-10 00:31:47 +02:00
8163fda9fb Fix T70609 EEVEE: Shader using lots of nodegroups are slow to update 2019-10-09 23:47:56 +02:00
9bd62379d6 Fix T70659 Warning, Regression, slow vertex selection
This changes the fix for T70302 by reducing the number of things we discard.
2019-10-09 23:47:56 +02:00
fb46d273f8 Fix "make update" not working on buildbot after recent changes
The submodules don't have remote branches configured, skip that test since
we assume pulling from the "origin" remote anyway.
2019-10-09 21:48:43 +02:00
d95bb087d0 Sculpt: Fix wireframe drawing
With this commit sculpt mode draws the real mesh wireframe instead of the
triangulated version by ignoring non real edges when building the PBVH GPU buffers

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6032
2019-10-09 21:23:11 +02:00
e846852862 Fix T70596: Wrong default scale value for node wrapper tool.
This affected all exporter add-ons using that wrapper to handle the node
shaders... sigh...
2019-10-09 20:33:22 +02:00
bbd6ebf423 Fix T70677: Annotation converted to grease pencil remains unselectable
The problem was the new object was created byt the tag for update objects in depsgraph was not tagged.
2019-10-09 19:09:01 +02:00
b8e34355c1 GPU: Consider softpipe as software renderer 2019-10-09 16:47:16 +02:00
bc6f439e94 CUDA Wrangler: Fix strict compiler warning
Namely addresses -Wstringop-truncation

Not sure if there is anything to be done for strncpy.

Differential Revision: https://developer.blender.org/D6006
2019-10-09 16:27:27 +02:00
a630e46a58 Fix T70544: Mesh extracted from Mask crash Blender when using Dyntopo
This commit fixes an assert in mesh_runtime_check_normals_valid

Reviewed By: jbakker

Maniphest Tasks: T70544

Differential Revision: https://developer.blender.org/D6013
2019-10-09 16:20:03 +02:00
e79fc33fda Fix multires cursor not displaying the active vertex
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6026
2019-10-09 15:47:37 +02:00
06c5520bda Fix T70554: Snake Hook + Ctrl does not set the brush stroke in its normal direction
This commit also fixes the same issue in elastic deform

Reviewed By: jbakker

Maniphest Tasks: T70554

Differential Revision: https://developer.blender.org/D6014
2019-10-09 15:44:56 +02:00
ec9044e2b2 Fix Delaunay 2d valid bmesh mode bug.
Wasn't checking for repeated vertices.
Also, made choices of edges to keep more aesthetically pleasing.
2019-10-09 09:26:55 -04:00
7e7b205137 Build: prepare "make update" to work for new release cycle branching
Checking out release branches in submodules, and printing some more
informative messages when that fails.
2019-10-09 15:09:53 +02:00
6c9178b183 Fix T61432: Sampling Subframes not working 2.8
Uncommented subframe logic and added correct time getter function (with subframe part in frame) to subframe update function
2019-10-09 15:00:25 +02:00
4aabea8b87 Fix T70640 EEVEE: Alpha hashed material is darker when alpha is not 1.0
Predivide all radiance components as the alpha effect comes from the hashed
transparency (pixel rejection).
2019-10-09 14:56:21 +02:00
7790298f61 GPU: show one-time startup warnings for old Intel drivers with known issues
This is pretty conservative. We do not show warnings for e.g. HD 4000 with the
latest drivers as they appear to be working mostly fine even if unsupported,
and there is nothing the user can do to improve things.

Ref T70520
2019-10-09 13:41:26 +02:00
cf682b9dab GPU: show more descriptive labels on unsupported GPU dialog
Thanks to Ray Molenkamp for the help with the Windows implementation.

Fixes T70521

Differential Revision: https://developer.blender.org/D6023
2019-10-09 13:41:26 +02:00
26b1216629 CMake: Move software-gl to generic install procedure
Removes custom logic from buildbot's packing step.

This also removes icons/ folder, but CMake was already copying the
icons to the root of the install folder.
2019-10-09 13:07:40 +02:00
e0231b14d5 Deps: Fix wrong LLVM prefix used for Mesa
It made it Mesa to be compiled with swrast rather than with llvmpipe.
2019-10-09 12:51:31 +02:00
decdd70dfd Deps: Add libraries needed for Software GL
Only compiled on Linux.
2019-10-09 12:37:04 +02:00
0ae6a8570b Cleanup: typo, style 2019-10-09 20:14:29 +11:00
22996f3dbe Fix make deps libtool detection on macOS 2019-10-09 10:54:55 +02:00
2fd2bced56 Buildbot: Correction to previous commit
Off-by-one calculating parent folders.
2019-10-09 10:37:09 +02:00
06ff734d48 Buildbot: Attempt to point precompiled libraries to a correct folder
The CMAKE_SOURCES variable is not yet initialized when the buildbot
configuration is read. This is similar to the include of full release
configuration happening earlier in the file.
2019-10-09 10:34:12 +02:00
62a7e8d429 Buildbot: Point to pre-compiled CentOS 7 libraries 2019-10-09 09:50:58 +02:00
40a55be82c Buildbot: Checkout precomiled CentOS libraries 2019-10-09 09:42:42 +02:00
340b9c1dfc Fix missing clear of ID types tags
Got lost in previous optimization commit.
2019-10-09 09:38:56 +02:00
d3d6cd2e09 PyAPI: drop Vector requirement for tessellate_polygon
Use mathutils_array_parse which converts any sequence of numbers.
2019-10-09 17:28:49 +11:00
6ff60d9982 PyAPI: avoid normal calculation for tessellate_polygon
Use fixed normal for 2D input, no need to calculate it.
2019-10-09 17:08:51 +11:00
b718d659c9 Fix T70594: mathutils.geometry.tessellate_polygon flips triangles
Some scripts will need to be updated to support this.
2019-10-09 16:56:54 +11:00
95199dca1f Fix T70662: Batch rename adds "\" before "." 2019-10-09 15:13:58 +11:00
d77afcffa3 UI: hide text character options when out of edit-mode
These are overwritten when entering edit-mode so there is no use
in showing them in object mode.

Addresses T70566
2019-10-09 13:55:09 +11:00
8f210f0475 Fix text edit-mode character info initialization
Using EditFont.pos before it was set.
2019-10-09 13:52:30 +11:00
7468227aea Docs: clarify Mesh.from_pydata edges argument usage
Addresses T70617
2019-10-09 12:12:53 +11:00
Dalai Felinto
0812949bbc Local Collections: Allow users to show hidden collections
Users now can turn on in a viewport collections that are temporarily
hidden (eye) in the view layer.

Design task: T61327

As for the implementation, I had to decouple the visibility in the
depsgraph from the visibility in the view layer.

Also there is a "bug" that in a way was there before which is some
operators (e.g., writing a text inside of a text object, tab into edit
mode) run regardless of the visibility of the active object. The bug was
present already (with object type visibility restriction) in 2.80 so if
we decide to tackle it, can be done separately (I have a patch for it
though P1132).

Reviewed by: brecht (thank you)

Differential Revision: D5992
2019-10-08 19:16:05 -03:00
Richard Antalik
6d3c34fe9d Fix T69682: Render Audio ignores animation.
`sound_update_animation_flags_exec` didn't tag depsgraph to update.

Reviewed By: sergey

Maniphest Tasks: T69682

Differential Revision: https://developer.blender.org/D6000
2019-10-08 13:10:37 -07:00
234f346c2f Fix T70601: Lasso select not functioning correctly in Armature Edit Mode
This solution mimics the one used for pose by ignoring the bone line if either end is clipped.
2019-10-08 16:45:32 -03:00
576c782b11 Fix T70586 EEVEE: principled shader alpha bleeding issues
Avoid double multiplication by alpha on ssr/sss data.
2019-10-08 20:29:35 +02:00
47b95a2957 Fix T70561: bad custom normals in mirrored geometry.
Original code from rB1a9e698099b5 used a rather naive approach, now use
proper transpose of inverse of geometry transform for the normals.
2019-10-08 20:19:13 +02:00
d98ae27f02 Fix T68857 EditUV: Crash on Remesh modifier with 'Display in Edit Mode' 2019-10-08 18:42:26 +02:00
656228945e Fix T69363 EEVEE: Blender crash when using Edit mode for Ocean
Use same Mesh* as extraction. We always use the final mesh for shaded geom.
2019-10-08 18:37:38 +02:00
ed9f8bd956 CTest: Fix failing test BLI_expr_pylike_eval_test on clang/windows
clang got a little to aggressive discarding unused variables
see D6012 for details.

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

Reviewers: brecht, sergey, angavrilov
2019-10-08 09:46:09 -06:00
10ec207a6b Sculpt: support automasking, pose and mask expand for multires
These were the last remaining new sculpt tools that did not support multires.
Performance could be improved still, but it should work.

Fixes T68899
2019-10-08 17:44:46 +02:00
52c02dc311 Fix multires sculpt not setting the active vertex correctly
Also cleanup code to remove duplicated min_depth tracking, ray intersection
already does it.
2019-10-08 17:41:52 +02:00
899b7ff1de Cleanup: avoid converting from CCGElem to SubdivCCGCoord
The other direction is faster.
2019-10-08 17:41:52 +02:00
333293cad7 Cleanup: minor refactoring of mask expand and floodfill 2019-10-08 17:41:52 +02:00
7a1847f0e9 Fix T70585: Walk Navigation keyframe tweaks (still frame)
Walk Navigation was missing rotation keyframes on confirm (when animation
wasnt playing) after rB22bdd08dfd0.

Because for walk [in contrast to fly], the cursor is constantly warped
(WM_cursor_warp in walkEvent), we cant do something reasonable with
comparing mouse positions (to detect rotation) when mouse comes to rest.

Now remember if rotation changed at any time.

Also tweaked the insertion for location keyframes (which was always
happening even if the camera did not move), now checking the real dvec
(instead on relying on speed)

Reviewed By: dfelinto

Maniphest Tasks: T70585

Differential Revision: https://developer.blender.org/D6018
2019-10-08 16:26:37 +02:00
054ab92f8b Depsgraph: Avoid threading for trivial operations
Found this while looking into T70463, solves the high spinning times
mentioned in T70463#791026.

Sounds logical that iterating over an array to modify a single property
is faster than doing it in threads. But strangely, doing it for both
nodes and its components is still faster in threads here.

Gives extra speedup with a file mentioned in the report.

Reviewed By: brecht, mont29

Differential Revision: https://developer.blender.org/D6017
2019-10-08 16:06:46 +02:00
abc36cad83 Sculpt: Fix projection artifacts by changing the voxel remesh isovalue
This should fix most of the shrinkwrap artifacts when the preserve volume option is active. After this commit the default voxel remehser settings should not fail in the default cube.

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D6010
2019-10-08 15:58:16 +02:00
31a4566685 Fix "make update" error with old git versions, for the buildbot
Just skip convenience test that checks if a rebase/merge is in progress.
2019-10-08 15:13:33 +02:00
df08fcebe8 Cleanup/fix for fix (c).
Sorry for the noise... For once building with everything hid the issue
instead of revealing it.
2019-10-08 14:45:50 +02:00
0b983169da Fix T70626: VSE: Slip Strip Operator doesn't refresh audio on confirm
Maniphest Tasks: T70626

Reviewed By: ISS, sergey

Differential Revision: https://developer.blender.org/D6016
2019-10-08 14:16:48 +02:00
Dalai Felinto
1ba4e472cd Fix build error (missing BKE_global.h) 2019-10-08 09:16:19 -03:00
270562fe12 Fix T70588: Playing animation (after deleting rigid body obj) crashes blender.
Fixing/working around another weakness of current RBW model... This is
not really nice, but it should work for now, and we cannot really do
anything else but that kind of monkey patching here anyway.
2019-10-08 11:53:44 +02:00
Julian Eisel
b1f1c8c33f Fix: region toggle operator being able to toggle regions it shouldn't
Only regions with alignment set should be toggle-able. If this is not
set, then the region is likely either a main region, or entirely hidden
by the user (not just collapsed).
2019-10-08 11:35:24 +02:00
ad876e728c Depsgraph: Cleanup, spelling in comment 2019-10-08 11:12:30 +02:00
9d13321831 Depsgraph: Perform early exit check prior to time tag
Evaluation is not entirely cheap even in the case when there is nothing tagged
in the scene. This is because of all the calculation of pending operations,
cleating runtime flags and so on.

This commit makes it so time operation is tagged for update prior to early exit
check. Improves playback speed in a scene without anything animated.

Maniphest Tasks: T70463

Differential Revision: https://developer.blender.org/D6002
2019-10-08 11:02:22 +02:00
fda1db5ba4 Depsgraph: Cleanup, de-duplicate time source tagging 2019-10-08 11:02:22 +02:00
ae777b0764 Depsgraph: Don't force time update when legacy flag 0 is used 2019-10-08 11:02:22 +02:00
Julian Eisel
95749f5d54 Fix T70522: Sidebars in Clip Editor work incorrectly in Dopesheet mode
Actually, in Dopesheet mode, the regions shouldn't be toggle-able at
all. For the user they should appear to not exist.
Previously the Movie Clip Editor archieved this by setting the region
alignments to NONE, which this restores.

Introduced in 6aef124e7d.
2019-10-08 10:33:48 +02:00
7f52eb287c Keymap: use right mouse for console context menu
Was using 'w' which doesn't work with text entry.
This matches the text editor.
2019-10-08 14:33:50 +11:00
f9a266a226 UI: support passing a function to WorkSpace.status_text_set()
This allows Python operators to draw icons and other UI elements
into the status bar.
2019-10-08 14:21:41 +11:00
a856c5eccf Fix T67753 EEVEE: Crash using transparent shadows with default material 2019-10-07 22:16:53 +02:00
da9ac42588 Cleanup: Change comment 2019-10-07 20:44:55 +02:00
b403b8196b Fix T70610: GPencil Remove Vertex Group don't reassign other groups
When removing a vertex group, the next groups were not reassigned because the loop upper limit was wrong.
2019-10-07 20:40:03 +02:00
Julian Eisel
7dea058546 UI: Move all Selected NLA-Strips when Dragging
Part of T57918. Selecting and dragging items were conflicting actions
previously when both were using the same mouse button. This avoids the
conflict.

See be2cd4bb53 for details on behavior.
2019-10-07 20:34:15 +02:00
ce22efb425 Paint: 2D paint brush stroke antialiasing
This commit enables antialiasing in 2D painting.
It also includes some fixes related to line drawing in the stroke spacing code.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5833
2019-10-07 19:47:40 +02:00
dccdc5df10 Fix T69933: Blender 2.81 doesn't import 2.80 preferences from quick setup screen 2019-10-07 19:41:58 +02:00
Ulysse Martin
e284654fbf Fix T70537: Documentation: bpygpu_offscreen_draw_view3d_doc not up to date 2019-10-07 14:39:27 -03:00
e5858cc5be Fix T70302 Crash on entering solid view after some specific steps 2019-10-07 19:22:41 +02:00
d2e4b13b9c CMake: Add support for building with OpenMP support for clang on windows.
mostly minor c/cxx/linker flags, only tested with clang 9.0.0

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

Reviewers: brecht, jesterking
2019-10-07 10:24:13 -06:00
fc9e921495 Simplify the quadriflow manifold mesh function for loops
No need to iterate over all polygons if we just want to iterate over all
face loops anyways.
2019-10-07 18:14:30 +02:00
0c0d2f3581 Fix T70406: crash editing keyframes while in sculpt mode 2019-10-07 18:04:35 +02:00
b91290fd2a Fix T70591: missing letters in statusbar keymap display after recent changes 2019-10-07 17:55:14 +02:00
d7465c23c7 Fix T70564: sculpt mask display missing with shape keys or deforming modifiers 2019-10-07 17:38:07 +02:00
e00a00db52 Cleanup: rename some sculpt variables for clarity 2019-10-07 17:38:07 +02:00
ad84f22628 Fix T70602: error baking with Cycles OpenCL after recent changes 2019-10-07 16:53:46 +02:00
78c0be9987 Fix T70452: Crash when clicking "Solve Camera Motion" in Motion Tracking 2019-10-07 15:41:52 +02:00
525a8bdf1d Sculpt/Paint: Invert curve alpha overlay
Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D5998
2019-10-07 15:26:05 +02:00
afb9bdc320 Sculpt: Update only modified grids on multires undo
This makes multires undo much faster and fixes the viewport lag after and undo operation.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5994
2019-10-07 15:24:25 +02:00
29707e3437 Fix T70387: Sculpting with Original Normal rips edges
Reviewed By: brecht

Maniphest Tasks: T70387

Differential Revision: https://developer.blender.org/D5982
2019-10-07 15:22:32 +02:00
4761028fc7 Fix T70508: Wrong snapping default in Node Editor 2019-10-07 10:02:12 -03:00
7a100a3f60 Fix T70555: Crash when attempting to create an override for an object with a cloth modifier.
Was not taking into account the case where pointer RNA prop is valid,
but has no data (i.e. is a 'null' pointer)...
2019-10-07 13:17:56 +02:00
2cb5078ce2 Update NUMA API library to latest version
Brings support of PPC and S390 platforms, which are required to have
Blender compiled on all ports of Debian.
2019-10-07 12:59:51 +02:00
cc1614123e Fix T70476: Sculpting with Subsurf on top produces artifacts
The issue was caused by crazy space distortion orientation happening
for subsurf modifier.

Solved by making it so subsurf only deforms the surface but keeps
matrices as-is. This is not fully mathematically correct, but is better
that the fall-back solution which was doing wrong matrices anyway.
Also, this is closer to have subsurf was handled prior to the
related changes.

Reviewed By: brecht, pablodp606

Differential Revision: https://developer.blender.org/D5991
2019-10-07 12:43:57 +02:00
d4c452ff39 Fix T70573: Crash on enter Cycles render preview with 'Scene world'
disabled and no world assigned to scene

BlenderSync::sync_world still relied on a blender world (mixes the world
viewport color with the studio light), for now just take black if no
world is present.

Maybe we should we use the theme color in the future here (seems eevee
does this in that case) -- we'd have to pass down `b_userpref` from
`BlenderSession::render` down to `sync_data > sync_shaders > sync_world`
then afaics.

Reviewed By: jbakker, brecht

Maniphest Tasks: T70573

Differential Revision: https://developer.blender.org/D6005
2019-10-07 12:26:25 +02:00
60f0a94ab2 Cleanup: clang-format 2019-10-07 15:22:22 +11:00
805ba9fc81 CMake: add GCC 9.2 -Wabsolute-value warning 2019-10-07 12:22:05 +11:00
fae0685113 Cleanup: quiet warnings 2019-10-07 12:22:05 +11:00
54a9649e26 Fix T70582: Gpencil crash when use Shift+Alt+LMB
This keymap was the old polygon mode for old grease pencil and now this have been replaced with Line tool. As this code was not ready for this keymap, the code gets out of control and fails. The solution is to remove this deprecated keymap.
2019-10-06 16:05:42 +02:00
4707f1982d Fix T70568, T70570: wrong AMD driver warning dialog
Remove this entry for now until we have more carefully verified the list.
2019-10-05 22:51:59 +02:00
0905af68ec Fix T70539: file folder color preference not saved
Please always bump the subversion for cases like this.
2019-10-05 22:51:59 +02:00
a498a5494c UI: Split sculpt mask operators into own menu
Differential Revision: https://developer.blender.org/D5997

Reviewers: Brecht van Lommel, Pablo Dobarro
2019-10-05 22:17:22 +02:00
Jeroen Bakker
0bdf4e2f2d Show Background Image Beneath Transparent Objects (Cycles only)
Camera background images were not shown under transparent objects.
This patch performs an alpha under for background images for cycles.

In order to see the difference the Film transparency needs to be turned on.

Note that workbench and EEVEE still needs to be adapted as they don't
write store alpha value in the viewport.

Side note. This implementation is already an improvement of the current behavior, what users are requesting. (Show background images underneath cycles viewport rendering.) It is clear that this patch still needs to be extended to workbench and eevee. For now that should be marked as a known limitation.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5437
2019-10-05 17:18:53 +02:00
629a1c1639 Fix T70418: Text Underline stays Flat on TextCurve Extrude
Underline was implemented in rBa07394ef2cfd.
It seems that the extrude feature never worked.

Ref T70418

Reviewed By: mont29

Maniphest Tasks: T70418

Differential Revision: https://developer.blender.org/D5972
2019-10-05 11:35:57 -03:00
ab519b91b2 Make this link again; needs more work for orbis to work. 2019-10-04 18:33:20 -04:00
1f6a34161d make_deps: Fix building ffmpeg on windows
I have no explanation on why this is needed, but it refused to
find opus without it.
2019-10-04 14:09:50 -06:00
7c2affd350 Fix: Headless build 2019-10-04 13:23:26 -06:00
Dalai Felinto
5287eaac5b Small cleanup 2019-10-04 14:11:13 -03:00
f35bfbb25e Sculpt: mesh filter, mask filter and dirty mask now work with multires
Thanks to Sergey's neighbor access functions.

Mesh filter still needs some improvements to handle open boundaries better.
2019-10-04 19:01:03 +02:00
8f1f756b83 Subdiv CCG: add utility functions for accessing multires vertex neighbors
This is to be used by the new sculpting tools.
2019-10-04 19:00:57 +02:00
bebdb6c824 Fix assert when deleting a RBW constraint object.
Side-reported in T70505.

Code did not ensure deleted object was removed from the RBW constraints
collection, leading to some invalid status (object in constraints
collection but without relevant contraints data).

Also fixed another issue - code deleting RBW objects would try to remove
any constraint one using it as target, in a very bad and broken way,
since you cannot iterate over objects of a collection while removing
some... Now instead just NULLify relevant pointers... I hope it works,
otherwise we'll have to take a different approach.

Needless to stress again how weak the whole RBW code is in general, and
regarding same object being used by RBW in more than one scene in particular,
that is known broken situation anyway.
2019-10-04 18:57:14 +02:00
3c14628381 Cleanup: make context menu last in keymaps 2019-10-05 02:45:37 +10:00
fc517cb079 Cleanup: formatting for text highlighter 2019-10-05 02:43:03 +10:00
dfcda05242 Fix T70467: large cursors option on Linux not showing clear crosshair
Not a great solution, but reverting back to what we had before the recent
changes for this specific case.
2019-10-04 18:02:55 +02:00
Julian Eisel
db66c33efe Fix T70462: Shift+Click on neighbour folder enters it
In fact, the operator implementation seems to have some issues, which is
why this behaved so glitchy. But for properly set up keymaps it should
work fine.
2019-10-04 17:28:45 +02:00
1fa56e72ec Fixed copy-paste error in install_deps.sh 2019-10-04 17:11:23 +02:00
Pedro Reis
eeba31e2ca Fix T69910: crash when using a hotkey for a new or open recent file
Differential Revision: https://developer.blender.org/D5839
2019-10-04 16:57:48 +02:00
Julian Eisel
809ab298f1 UI: Move all Selected Markers when Dragging
Part of T57918. Selecting and dragging items were conflicting actions
previously when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.
2019-10-04 16:46:32 +02:00
Julian Eisel
d4d036ae14 UI: Move all Selected Dopesheet Keys when Dragging
Part of T57918. Selecting and dragging items were conflicting actions
previously when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.
2019-10-04 16:46:32 +02:00
Julian Eisel
1f5ae1a5a5 UI: Move all Selected Strips and Strip Handles when Dragging
Part of T57918. Selecting and dragging items were previously conflicting
actions when both were using the same mouse button. This avoids the
conflict.

See 056fcdfe7bbed3 for details on behavior.
2019-10-04 16:46:32 +02:00
Julian Eisel
5f51e78172 Node Editor: Use new operator utilities for node selection and dragging
Previous commit moved most of this code into more general/generic
utility functions, so we can use that in the Node Editor now.
2019-10-04 16:46:32 +02:00
Julian Eisel
be2cd4bb53 WM: Utilities for select operators to work with click-dragging items
Based on work by Bastien and Brecht in the Node Editor, this adds more
generalized support for selecting items so that click+drag actions on
items (nodes, makers, dopesheet keys, etc.) works as wanted.
Note that this only adds the barebones to support this in other editors,
it's not used yet (will be done in followup commits).

The behavior is supposed to work as follows:
* Clicking an unselected item immediately selects it, and deselects
  other items (doesn't wait for release events).
* Click+drag on an unselected item immediately selects it, deselects
  others and drags it in one go (don't require selecting it first!).
* Click+drag on a selected item won't change the selection state (and
  won't send an undo push) and start dragging all selected items as soon
  as the drag event is recognized.
* Clicking on a selected item will still deselect others, but that will
  only happen on mouse release, when we know the intention is not to drag
  the item.

Included in: https://developer.blender.org/D5979

Reviewed by: Brecht van Lommel, William Reynish
2019-10-04 16:46:32 +02:00
0bcada85b3 Fix T67212: No smooth blending in "Push Pose from Breakdown" and "Relax Pose to Breakdown"
The previous method produced non smooth interpolation results and it was
very hard to control. (At least for me it seemed to be broken until I
actually took a look at what the code actually did)

Now we simply linearly interpolate between the breakdown position and
the current bone data.

Reviewed By: Sybren, Hjalti

Differential Revision: http://developer.blender.org/D5892
2019-10-04 16:40:09 +02:00
b9736e8e12 Add Opus audio library and configure FFmpeg to use it
Opus support was enabled in 2ddfd51810. This commit adds the Opus
library and configures FFmpeg to be compiled with Opus support.

NOTE: It may be required to run `cmake -U '*FFMPEG_LIBRARIES*' .` in
your Blender build directory in order to refresh the `FFMPEG_LIBRARIES`
setting and add libopus.
2019-10-04 16:30:01 +02:00
6d8c053187 Fix T70514: VP9 not working
This issue was two-fold:

- In the VPX library build script: missing `--enable-vp8` and
  `--enable-vp9` meant that the choice to enable these codecs or not was
  left to the library's `configure` script, rather than an explicit choice.
  On the build-bot it chose to not enable them.
- Missing pkgconfig paths passed to the FFmpeg build script

Thanks @brecht for helping out.
2019-10-04 16:30:01 +02:00
663d23dd9d Fix T70463 GPU: Very Slow Workbench/Eevee Performance 2019-10-04 16:29:51 +02:00
56dd7feb06 GPU: Platform Support Level
Adds a check when starting blender if your platform is supported. We use a blacklist
as drivers are updated more regular then blender (stable releases).

The mechanism detects if the support level changed or has been validated by the user previously.
Changes can happen due to users updating their drivers, but also when we change the support
level in our code base.

When the user has seen the limited support level message it is saved in the user config.
It would be better to have a system specific config section, but currently not clear
what could benefit from that.

When the platform is unsupported or has limited support a dialog box will appear including a link
to our user manual describing what to do.

**Windows**
Windows uses the MessageBox that is provided by the windows kernel.

**X11**
We use a very lowlevel messagebox for X11. It is very limited in use and can be fine tuned when needed.

**SDL/APPLE**
There is no implementation for SDL or APPLE at this moment as the platform support feature targets mostly Windows users.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5955
2019-10-04 16:23:39 +02:00
OmarSquircleArt
45745f7862 Fix: Gain socket is not available in ridged multifractal.
The gain socket in the Musgrave node should be available in the ridged
multifractal mode. The logic for the availability was incorrect.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5989
2019-10-04 16:07:28 +02:00
295f888433 Fix T70504: Moving nodes in the node editor stops after hotkey is lifted
This basically reverts 540eb2dc1e for an alternative solution that
only enforforces release_confirm [ignoring the preference] on mouse for
the node editor.

Approved by @brecht in T70504.
2019-10-04 15:55:08 +02:00
40492251f2 Fix T70454: Environment Texture Node Properties "reload" and "packing" not working
The bug was basically just caused by a missing 'edit_image' and
'edit_image_user' pointer in context for
'node_shader_buts_tex_environment_ex'.
So adding the following there would be enough to fix the bug:
uiLayoutSetContextPointer(layout, "edit_image", &imaptr);
uiLayoutSetContextPointer(layout, "edit_image_user", &iuserptr);

However, I would suggest using the full-flegged uiTemplateImage (just as
'node_shader_buts_tex_image_ex' does -- instead of a "handmade" subset)
for the following consistency reasons:
- Layout was using single column for image textures, but not environment
textures
- Save / Discard feature on editing the image was there for image
textures, but not environment textures
- Environment textures: Color Space was displayed on node (but not
properties)
- Environment textures: Animation / Sequence settings were displayed on
node (but not properties)

Cant think of a reason for _not_ displaying the whole set for
environment textures (just as for regular image textures)?

Maniphest Tasks: T70454

Differential Revision: https://developer.blender.org/D5988
2019-10-04 15:31:54 +02:00
d590db8370 Sculpt: Clay Strips brush tweaks
- Fix accumulate by allowing normal radius greater than one. Now it works as it should and it should be enabled by default
- Make the square test sharper. This gives a lot more definition to the brush, even when working with fewer polygons

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5984
2019-10-04 15:28:00 +02:00
2b55a1da50 Fix T70499: Can't change Brush Texture Rotation without holding the Shift key.
Reviewed By: brecht

Maniphest Tasks: T70499

Differential Revision: https://developer.blender.org/D5985
2019-10-04 15:24:40 +02:00
OmarSquircleArt
8afa93d82d Fix: Clamping in Map Range node works incorrectly.
The clamp option in the Map Range node doesn't work correctly when the
inputs are linked. The code didn't put that into considration.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5987
2019-10-04 15:21:46 +02:00
f025b625f4 Fix T70095: Quadriflow crash running on a messy mesh
Quadriflow does not support non manifold meshes. (Edges with > 3
connected faces and discontinuous face normal directions)

While it does sometimes "work" in these configurations, the results are
not good and in most cases it just flat out will crash.

Added a sanity check to make sure that the input mesh is manifold.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5877
2019-10-04 14:25:34 +02:00
19b0f69009 Fix T70481: Segfault printing 'private data' evaluated IDs.
This commit solves the bug itself (code was broken when real_id owner of
the private data ID could not be found), and generates a more sensible
representation for all evaluated IDs, makes no sense to display them as
being part of `bpy.data....`!
2019-10-04 12:27:10 +02:00
ba10cd4922 LibOverride: Fix last main issue with overriding custom properties.
Now, custom props defined as overriddable can be overridden, saved,
reloaded, etc. That fixes the last main issue with them.

Note that custom props still have a lot of glitches and weirdness in
their overriding behavior, but for now the most important is finally
achieved, will let them rest and settle a bit, those have been
incredibly painful to tame... :(
2019-10-04 12:27:10 +02:00
837653d735 LibOverride: Fix bad handling of 'store' callback in IDProps case.
We need same kind of default handling for IDProps as we already have for
the diff callback.
2019-10-04 12:27:10 +02:00
03bf290eae GPencil: Reduce VBO memory footprint when using modifiers
Before, the modifiers were evaluated in Draw Engine and this required to calculate a factor to increase the VBO size.

Now, the modifiers are evaluated in Depsgraph and the Draw Engine receives the evaluated stroke with the final number of vertices. As the number of vertices is the final value already, if Draw Manager increases the number with the modifiers only increases the memory with empty space because never would be used. This commit removes this double calculation, reducing the memory usage and removes a loop to calculate the size by modifier too.

Also, the function getDuplicationFactor() has been removed because is not required anymore.
2019-10-04 10:20:15 +02:00
fbc096cf07 Fix expanding paths ignoring data-block libraries
- Image views.
- Sequencer text strip font.
- Text check for modified/reload.
- Collada image export.
- Brush icons.
2019-10-04 07:03:53 +10:00
Kai Jægersen
8096190d11 Text: make selection and cursor editable from RNA 2019-10-04 06:31:32 +10:00
e54747a18c Correct error in last commit 2019-10-04 06:12:27 +10:00
Kai Jægersen
d289a2d4a9 Text: add Text.cursor_set(...)
Place the cursor, optionally set selection.
2019-10-04 06:10:43 +10:00
Kai Jægersen
bf2d92b277 Text: add Text.select_set(...)
Support setting the selection for a text buffer
with support for negative indices, select_set(1, 1, -1, -1)
selects the entire buffer.
2019-10-04 06:00:08 +10:00
2ba8adca4f CMake: quiet warning in quad reflow 2019-10-04 06:00:08 +10:00
6ac2a2061f Fix: Unit tests on windows.
Problem was twofold

1) `GENERATOR_IS_MULTI_CONFIG` is a property not a variable so
the test for it would always be false, unless you set a custom
CMAKE_INSTALL_PREFIX (like the buildbot does) the unit tests
would have a wrong working directory and complain about missing
dlls or blender executable

2) Tests added outside of `/test` (like libmv) would have no working
folder set since the variable would not be visible for them.

consulted @sergey who voiced the opinion that duplicating the code
to the test macro was slightly less evil than moving it to the main
CMakeLists.txt
2019-10-03 11:34:04 -06:00
79ca5ad368 Fix T70484: GPencil particles crash when original stroke is hidden
Due the internal design of the drawing engine and the special requirements for 2D inside 3D, it's required to keep the original stroke visible in order to display the particles. If the original stroke is hidden, the particles are hidden too.

This commit only fix the segmentation fault. Make visible the particles when the original is hidden would require a complete redesign and maybe would break some 2D features.
2019-10-03 19:03:40 +02:00
Julian Eisel
edffb0e9b1 UI: Register File Browser as Child/Dialog-Window for the OS
For many users, this will make the File Browser window behave more like
what they would expect. It addresses the issue of the File Browser
becoming hidden behind the main window by clicking anywhere in the
latter. It communicates the interruptive, but temporary nature of the
operation a bit better.
Further, on tiling window managers the File Browser now opens as
floating by default, like in other applications.

Note that this also makes sure the File Browser is always opened as
separate window, so it doesn't re-use the Preferences, or any other
temporary window anymore. This seems to have been a common annoyance.

More concretely, this makes the File Browser window behave as follows:
* Stays on top of its parent Blender window, but not on top of
  non-Blender windows.
* Minimizes with its parent window
* Can be moved independently
* Doesn't add an own item in task bars
* Doesn't block other Blender windows (we may want to have this though)
* Opens as floating window for tiling window managers (e.g. i3wm/Sway)

Further notes:
* When opening a file browser from the Preference window (or any
  temporary window), the main window, as the file browsers parent is
  moved on top of the Preferences, which makes it seem like the
  Preferences were closed. This is the general issue of bad secondary
  window handling as window activation changes. I made it so that the
  window is moved back once the file browser is closed.
  This behavior is confusing and would be nice to avoid. It's a separate
  issue though.
* On most window managers on Linux the temporary window can not be
  minimized and maximized, they disable that for dialog windows.
* On Windows and macOS, only minimizing is disabled, as there is no
  decent way yet to restore a window if it's not shown in the taskbar.

Reviewed By: Brecht van Lommel, Campbell Barton, William Reynish
Edits and macOS implementation by Brecht.

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

Part of T69652.
2019-10-03 17:50:27 +02:00
35ae1da16c Mesh: simple extract mask optimizations
- Avoid per-vertex custom-data lookup
- Break once a face has a mask vertex.
2019-10-04 01:14:25 +10:00
1e273dbc3c Fix extract mask freed memory use & leak 2019-10-04 01:14:25 +10:00
67f9b94291 Fix sculpt normal update in SculptDraw brush
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5981
2019-10-03 16:57:27 +02:00
8c991bf63a UI: Add Buttons to Shader Editor Slots Popover
Assign, select, deselect buttons added when in edit mode to complete the functionality
of the shader editor vs. the properties panel.

Reviewed by: brecht

Differential Revision: https://developer.blender.org/D5768
2019-10-03 10:29:25 -04:00
a6ad80d9e8 Fix T70125: crash on startup in Linux with some tablet types connected 2019-10-03 15:36:50 +02:00
3bbe01dad3 Fix T70299: Grab brush not working as expected when Ctrl is press
Reviewed By: brecht

Maniphest Tasks: T70299

Differential Revision: https://developer.blender.org/D5920
2019-10-03 15:34:54 +02:00
ae7bea265d Fix T66312: Undo does not restore normals correctly in sculpt mode
Reviewed By: brecht

Maniphest Tasks: T66312

Differential Revision: https://developer.blender.org/D5895
2019-10-03 15:31:24 +02:00
6db6267d85 Sculpt: Disable remesh operators with Multires
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5964
2019-10-03 15:28:35 +02:00
d6c440bd7a Fix T69227: Ignore inbetween mouse events in Snake Hook
Reviewed By: brecht

Maniphest Tasks: T69227

Differential Revision: https://developer.blender.org/D5977
2019-10-03 15:26:50 +02:00
8a1f4fc8a7 Fix T70102: Mask Extract bad solution
Reviewed By: brecht

Maniphest Tasks: T70102

Differential Revision: https://developer.blender.org/D5978
2019-10-03 15:25:19 +02:00
11768d1c9f Fix T70466 Rendering error when drawing multi-material meshes 2019-10-03 14:44:43 +02:00
9a4042bed8 Subdiv CCG: Cleanup, remove unused data from adjacency storage
Makes it easier to initialze adjacency, avoid extra re-allocations during
initialization, reduces memory footprint.
2019-10-03 12:36:01 +02:00
0cc45eaac4 OpenSubdiv: Add accessor to vertex edges via refiner C-API 2019-10-03 12:36:01 +02:00
f6a90f018c i18n: Add Slovak language. 2019-10-03 11:11:37 +02:00
514c9d14e4 Fix T68945: VSE - Improper audio on frame 1
This has already been fixed in 8d207cdc3b
as fix for T52472: VSE Audio Volume not set immediately, but I failed to
backport it to upstream audaspace which is the reason the problem was
back.
2019-10-03 10:26:48 +02:00
Anthony Eriksson
4ccf02764c Fix T69216: "assert" not highlighted in text editor
Workaround limitations of formatting code by putting longest names first.

Differential Revision: https://developer.blender.org/D5613
2019-10-03 03:11:55 +02:00
540eb2dc1e Fix T69288: release confirms preference should not affect node editor
Was missing from new macro operators.
2019-10-03 03:11:55 +02:00
93e8c962fc Cleanup: unused structs, struct members 2019-10-03 07:39:45 +10:00
c07eaa3384 Cleanup: argument naming, redundant NULL checks 2019-10-03 07:32:28 +10:00
fcdd851858 Fix memory leak in loop-cut error case 2019-10-03 07:32:28 +10:00
d1d21dac51 Fix assert in image crop 2019-10-03 07:32:28 +10:00
6002e2f061 Fix incorrect flag check in gpencil subdiv modifier 2019-10-03 07:32:28 +10:00
14114b37e7 Fix pointer assignment 2019-10-03 07:32:28 +10:00
b87123cf2f Fix F-Key icon display 2019-10-03 07:32:28 +10:00
fb9024bded Fix error in opensubdiv topology refiner face matching check 2019-10-03 07:32:28 +10:00
Richard Antalik
2b29bf25fc Fix T69924: Prefetch stops when moving playhead
Fix T70194: Prefetch freezes Blender in some cases

- Initialize depsgraph in isolated bmain struct.
- Fix prefetching range (forgot in initial prefetch commit).
- Fix crash - Add check if prefetch job is initialized and running.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5899
2019-10-02 13:48:39 -07:00
aabd8701e9 Implement a user preference for the default Auto Handle Smoothing mode.
The default was changed with an initial implementation of the feature.

With the feedback from animators, having a behavior which affects curves
outside of a changing range is not convenient for professional animators
working on high quality character animation. On the other hand, automatic
smoothing is better for casual animation of object motion.

This change adds an ability to change the default via User Preferences.

Differential Revision: https://developer.blender.org/D5875
2019-10-02 20:42:37 +03:00
d1a1302b01 UI: add NLA track and channel theme color
Patch contributed by Paul (Thirio).

Differential Revision: https://developer.blender.org/D5967
2019-10-02 18:56:34 +02:00
03506ee4d1 UI: use consistent text box theme colors in search popups
This solves an issues where these text fields would use menu background colors,
making it difficult to create a correct theme.

Default theme looks the same, only Blender Light now shows a dark text field.

Patch contributed by Paul (Thirio).

Differential Revision: https://developer.blender.org/D5906
2019-10-02 18:56:32 +02:00
de4ebcbe43 Fix T70390: dyntopo smooth shading broken after recent changes
Made the code fully thread safe now.
2019-10-02 18:28:26 +02:00
a1f16ba67f Use PBVH_FullyMasked flag in mesh filter
We don't need to filter the fully masked nodes here after adding the flag

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5973
2019-10-02 16:58:53 +02:00
02ad256f9a Fix T70414 EEVEE: Crash with 2 viewports, UV edit and sync selection 2019-10-02 16:56:22 +02:00
3734ae5d54 Fix T70331 Node group passthrough is broken 2019-10-02 16:56:22 +02:00
f8f28dc784 Workaround for NVidia broken driver
This disable the indirect drawcall on all Nvidia hardware.

This has to be until nvidia fixes their drivers or instruct us
how to correctly fix the issue.

Related to T70011 Various display issues on NVIDIA
after draw call batching.
2019-10-02 16:56:22 +02:00
d596a6368c Preference: option to use OS-Key to emulate MMB
Alt-LMB is used in quite a few areas now, see T69323
using OS-Key allows these conflicts to be avoided.

Currently disabled for WIN32, since it conflicts with the start menu.
2019-10-03 00:25:06 +10:00
2e97d50d2d Fix T70409: Propagate Pose not updating correctly
The Action was changed without tagging it as such in the depsgraph.
Thanks @sergey for the sanity check!
2019-10-02 16:08:56 +02:00
3052229264 Fix T70358: Use face count in Quadriflow by default
Reviewed By: brecht

Maniphest Tasks: T70358

Differential Revision: https://developer.blender.org/D5958
2019-10-02 16:04:48 +02:00
606af693fb Fix T70310: Difficult to change brush size from big to small
Changing this values should only support horizontal movement as we are no longer trying to match the size of the cursor and the size of the circle preview in the widget.

Reviewed By: brecht

Maniphest Tasks: T70310

Differential Revision: https://developer.blender.org/D5931
2019-10-02 16:00:10 +02:00
29f25da769 Fix T70324: Layer Brush has bad behaviours and create artifacts
Reviewed By: brecht

Maniphest Tasks: T70324

Differential Revision: https://developer.blender.org/D5934
2019-10-02 15:58:35 +02:00
fb62c578bc Fix default cursor blue color
The previous one was too light

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D5959
2019-10-02 15:57:00 +02:00
ed59c32b0c Fix bug in nearest_vertex_get_finalize
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5965
2019-10-02 15:55:11 +02:00
Antonio Vazquez
ddd40985e7 Fix T70399: Grease Pencil Canvas Grid Overlay Broken after DRW refactor
Now the grid matrix is calculated when the shading group is created.

Also, the grid pass is only created when needed and reduce memory usage when the scene is not using grease pencil objects.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5966
2019-10-02 15:33:20 +02:00
31473070b3 Fix T70443: Crash on sculpting with 'Curve' Stroke Method
Caused by rBc31a849a1474.

Reviewed By: brecht

Maniphest Tasks: T70443

Differential Revision: https://developer.blender.org/D5970
2019-10-02 14:59:11 +02:00
6b38c8a1ac Fix T70441: crash after deleting a material output node
Caused by 5c79f2d0fb.
If no valid node_start is provided, we can just skip (e.g.
'ntree_shader_bump_branches' is not done then, but this is not
neccessary without a valid eevee output node anyways...).

Maniphest Tasks: T70441

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5969
2019-10-02 14:01:07 +02:00
9b034355e4 Fix T70405: Geometry node not linking manual derivatives
Maniphest Tasks: T70405

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5954
2019-10-02 13:55:59 +02:00
0091b84df0 Fix T70268: Render failures with Vector pass active with OptiX in Cycles
Rendering would produce invalid results or crash if the Vector pass was active but motion blur was inactive. This caused the OptiX BVH to be built with motion (because objects reported motion available), but the pipeline to be built without motion support (since with disabled motion blur this is not in the list of requested features). The two are not compatible and therefore caused issues. This patch fixes that by not building the BVH with motion if motion blur is not active (which makes sense).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5968
2019-10-02 13:23:29 +02:00
Yevgeny Makarov
97ba7f3c32 UI: use consistent names and menu organization for blending modes
The Python API is unchanged and remains compatible.

Differential Revision: https://developer.blender.org/D5830
2019-10-02 13:03:27 +02:00
02877bdf39 Python API: remove unnecessary ELASTIC_DEFORM_ prefix from enum identifiers 2019-10-02 13:01:36 +02:00
01c824ac88 Revert "UI: use correct singular and plural nouns in report messages"
Convention is to use (s) postfix for cases where there can be one or multiple,
so stay consistent with that.

This reverts commit 3e8276311e.
2019-10-02 12:54:56 +02:00
a434b30667 Fix building QuadriFlow with Clang on Windows
Boost 1.68 has a bug in its type_traits where it does not include the right
header for the is_assignable macro when building with Clang. Temporarily work
around it until we upgrade to a newer Boost version that fixes it.

Differential Revision: https://developer.blender.org/D5962
2019-10-02 12:40:55 +02:00
Stefan Werner
f97a64aa9b Fix T70252: Reverting to macOS 10.11 compatible API. 2019-10-02 10:22:26 +02:00
3b23685c7d Cleanup: simplify node modal select implementation
Ref T63994
2019-10-01 21:51:21 +02:00
Dalai Felinto
ec85f0e6a5 Silence remesh building warning 2019-10-01 15:46:28 -03:00
34bd23dbb7 MSVC: Support Building clang+ninja+VS2019
1) Clang was given the wrong VS version to emulate when used in
combination with VS2019 causing build issues.

2) The erroneous supplied parameter `-std::c++11`caused CMake to
fail running its compiler detection scripts.
2019-10-01 12:36:11 -06:00
Yevgeny Makarov
c06350d8a7 UI: "text not found" message in text editor, change type from ERROR to WARNING
Differential Revision: https://developer.blender.org/D5736
2019-10-01 20:32:16 +02:00
Yevgeny Makarov
6348ca9da0 UI: tweak layout of boid brain panel
Differential Revision: https://developer.blender.org/D5684
2019-10-01 20:29:33 +02:00
Sebastian Koenig
32d778a773 Keymap: make plane track corners draggable with lmb
Previously when clicking and dragging with LMB you would only move the entire
plane track. In order to move the corners independently you would have to use
your right mouse button. This would also prevent the context menu to show up.

Now LMB click and drag on corners moves them. If you LMB click and drag one of
the 4 edges of the plane track you would move the entire plane track.

Differential Revision: https://developer.blender.org/D5519
2019-10-01 20:23:24 +02:00
Miguel Porces
cca1649b20 Nodes: discard hidden sockets when grouping a single node.
At the moment, grouping a single node that has hidden sockets, exposes all
sockets in the node group. This patch just filters hidden sockets, so that
the node group's interface remains the same as the node being grouped.

Differential Revision: https://developer.blender.org/D5533
2019-10-01 20:21:17 +02:00
Yevgeny Makarov
b196c42d4a UI: use full width for ID blocks in lattice properties
Differential Revision: https://developer.blender.org/D5722
2019-10-01 20:18:48 +02:00
Yevgeny Makarov
3e8276311e UI: use correct singular and plural nouns in report messages
Differential Revision: https://developer.blender.org/D5729
2019-10-01 20:18:48 +02:00
Jean Da Costa
17f6b4d0f8 Sculpt: slight topology rake performance inprovement.
Produces almost the same result but takes in account all the edges instead
of only four, which gets rid of the need to select specific edges. Also,
added a check to prevent it from destroying boundaries.

Differential Revision: https://developer.blender.org/D5763
2019-10-01 20:18:48 +02:00
Yevgeny Makarov
cd9da385b0 UI: fix misaligned popover arrow near the region edge
Differential Revision: https://developer.blender.org/D5872
2019-10-01 20:10:46 +02:00
Colin Basnett
f0f189de76 Fix ImBuf.load failure showing filename as garbage bytes
Differential Revision: https://developer.blender.org/D5879
2019-10-01 20:10:46 +02:00
Yevgeny Makarov
9cda01caf7 UI: don't align popover buttons with opened popovers
Differential Revision: https://developer.blender.org/D5890
2019-10-01 20:10:46 +02:00
b1b4e00076 Fix T70315: Blender exit with code -6 with message Attempt to free NULL pointer.
This is not actually fixing the real issue here, PackedFile structs are
never supposed to have a NULL pointer - and in that monster .blend file,
the pointer is not NULL, but the actual data chunk has been lost
somehow, so it gets NULL during read process.

Very unlikely we ever know how such corrupted .blend was created though
(there's probably a fair chance that this is not even due to a bug in
Blender, but rather a glitch in filesystem or something).

So for now, ensure at read time that we get a coherent state (i.e.
remove any read PackedFile that would have a NULL data field), and add a
few asserts in relevant code to check we never get NULL data pointer
here.
2019-10-01 20:08:04 +02:00
8dd9172aa2 Fix "motion_blur" tests with OptiX in Cycles
Curves with motion blur produced wrong results with OptiX (T69801). This is because the AABBs for the motion steps were calculated from incorrect attribute data because the offset into the attribute data array was incorrect.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5961
2019-10-01 20:01:51 +02:00
6700027863 Fix T70328: Crash when editing loopcuts with AutoMerge & Split option 2019-10-01 14:54:32 -03:00
72666ae3e7 Brush: default the strength to 1.0
This applies to all paint modes except sculpt and grease pencil brushes.

When painting color or weight it's best to paint the color
the user has selected, without them having to make multiple strokes.
2019-10-02 03:37:29 +10:00
710e4847a0 Cleanup: remove redundant id lookups in versioning code 2019-10-02 03:37:29 +10:00
9f4dca8963 Fix mismatch in brush default versioning
Assign a variable to avoid repetition and having this happen again.
2019-10-02 03:37:28 +10:00
Stefan Werner
5eebd7cc1f Cycles: Fixed Camera inside volumes with Embree turned on.
The Embree backend did not properly recognize when the camera was
inside a volume and ended up ignoring those.
2019-10-01 19:35:56 +02:00
a513586cd2 Cleanup: remove ED_image_paint_tile_remove_masks_all
Masks are now temporary, not part of the persistent undo tiles.
Now they're always freed after the stroke.
2019-10-02 02:13:50 +10:00
8ce14aa21f Cleanup: rename image undo_tile to paint_tile
Clearer because they're no longer the same as undo tiles.
2019-10-02 02:04:37 +10:00
7aff48add0 Cleanup: move image undo into space_image/
This isn't just used for painting.
2019-10-02 01:45:37 +10:00
cc092e9ab0 Cleanup: name of image poll function 2019-10-02 01:45:37 +10:00
825a93d7cd Fix T70317: Equal clip range crashing in Hue Correct & RGB Curves Nodes
It takes many changes to support the drawing of zero-sized curves.
Best skip these cases to avoid crash.
Blender 2.79 had no support either.
2019-10-01 12:26:47 -03:00
b155ece0c0 Image: add resize operator
Now possible with new image undo,
was added for testing but seems generally useful.
2019-10-02 00:44:17 +10:00
151cc02b6f Image: support storing full image buffers for each undo step
Update image undo to store buffers for each step:

- Undo buffers share tiles to avoid using too much memory.
- Undo support for different sized buffers
  allowing operations such as crop or resize.
- Paint tiles have been split into separate API/storage.
- Painting speed wont be impacted significantly
  since storing the extra tiles is done after the stroke & only
  for the first undo step.

Resolves T61263, see D5939 for details.
2019-10-02 00:44:17 +10:00
bdd142bc02 Cleanup: convert some macros to functions 2019-10-01 16:36:29 +02:00
2bddf44b11 Cleanup: avoid multiple active vertex loops 2019-10-01 16:21:10 +02:00
96561dbdf0 Sculpt: enable 3D paint cursor for multires 2019-10-01 16:10:38 +02:00
2090b3e5ac Cleanup: internal sculpt refactoring related to multires, no user visible changes 2019-10-01 16:10:38 +02:00
6b3887da4d Cleanup: slightly more efficient access to PBVH multires grid key 2019-10-01 16:10:38 +02:00
b1baebd022 Cleanup: abstract sculpt floodfill code 2019-10-01 16:10:38 +02:00
8a23657f0f Cleanup: avoid accessors, reduce memory usage, multithread dirty mask 2019-10-01 16:10:38 +02:00
5e98187ddb Cleanup: make sculpt vertex random access API read-only 2019-10-01 16:10:38 +02:00
d3c88336cd Cleanup: prefer PBVH iterator over random vertex access in some places 2019-10-01 16:10:38 +02:00
0230148fb7 Cleanup: avoid unnecessary brush radius test in mask expand 2019-10-01 16:10:38 +02:00
81cc2fd1c1 Cleanup: don't go through sculpt accessor functions multiple times 2019-10-01 16:10:38 +02:00
46285e36e9 Cleanup: compiler warning 2019-10-01 16:10:38 +02:00
1524f414db BLI: optimize GSQueue implementation to allocate in chunks, like BLI_Stack 2019-10-01 16:10:38 +02:00
574265f52f Fix T70206 Texture Paint: UV shadow doesnt show up 2019-10-01 16:02:14 +02:00
5c79f2d0fb Fix T70325 EEVEE: Performance regression with large nodetrees
This was caused by nodeChainIter which is not linear complexity.
Introduce nodeChainIterBackwards to iterate backwards faster.
2019-10-01 16:02:14 +02:00
cba1bdc400 Fix T66641: Certain drivers fail to copy when copying a full scene.
The core of the issue here is that 'make single user' functions still
does its own, manual and quite partial, remapping of IDs, which covers
all most common cases but cannot consider *all* possible ID usages
(especially when it comes to drivers or custom properties, that can
essentially point to any kind of data-blocks).

This fix is merely a band-aid, there is no way to fully solve this
without a complete rewrite of that area of code to make use of modern ID
management code.
2019-10-01 14:48:33 +02:00
f983606063 Cleanup: remove unused variables 2019-10-01 12:55:25 +02:00
e82ac9e596 Fix T70376: Lattice point looses state on modeswitch when shape keys are
present

Selection state of lattice points as well as their weight were not kept
when going in and out of editmode, code would just copy positions.
Now copy the whole BPoint instead.

Reviewers: campbellbarton

Maniphest Tasks: T70376

Differential Revision: https://developer.blender.org/D5948
2019-10-01 12:53:23 +02:00
c9b9803a77 RNA: add check for zero step arguments
Avoids errors like T70281 slipping through.
2019-10-01 20:30:18 +10:00
ba798e0412 Image/Clip Space: Add view center to cursor operators
D5932 by @a.monti with edits
2019-10-01 20:20:53 +10:00
3370af2dc1 Fix T70281: Changing Default interpolation also changes curve of new drivers
Having a constant FCurve doesn't make sense for drivers; either linear
or Bezier should be used. Since the code is already creating a Bezier
curve, I just added the flag to not look at the user preferences in this
case.

Reviewed by: angavrilov

Differential Revision: https://developer.blender.org/D5921
2019-10-01 11:56:32 +02:00
2746fbc935 Fix T70397: Dilate/Erode 'distance' increment/decrement arrows not
working

Since rB78b56fa7d973 we always have to specify a valid step value.
2019-10-01 10:24:07 +02:00
b0e7108eda Cleanup: use doxy sections for clip_ops.c 2019-10-01 18:03:33 +10:00
4101d3e400 UI: Changes to Paint Cursors
Changes to cursors that can be used for painting and sculpting.

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

Reviewed by Brecht Van Lommel
2019-09-30 16:46:05 -07:00
60a827a2a9 UI: Update paint crosshair for Mac
This is based on feedback from users.
Only affects Mac for now, Windows will be committed separately.
2019-10-01 00:00:06 +02:00
9411b0a3c7 Cleanup: use PyC_StringEnum to path access functions
This gives better error messages, simplify code.
2019-10-01 05:19:38 +10:00
aba6fc8208 ImBuf Py API: implement resize method argument 2019-10-01 05:18:30 +10:00
07feb6e814 PyC API: utility to parse a string as an RNA like enum
More convenient than comparing strings,
with the advantage that errors don't need to repeat expected values.
2019-10-01 05:18:25 +10:00
Julian Eisel
ddb157999e UI: Remember File Browser Display Options in Preferences
This makes it so that some display related properties of the file
browser state are remembered in the Preferences. Otherwise, users often
end up doing the same set up work over and over again, so this is a
nice way to save users some work.
It's typical for other file browsers to remember their state too, so
another benefit is having a more conventional behavior, meeting user
expectations better.

Some points:
 * We currently store: Window size, display type, thumbnail size,
   enabled details-columns, sort options, "Show Hidden" option. More can
   be added easily.
 * No changes are stored to the Preferences if "Auto-save Preferences"
   is disabled. This is how Quick Favorites behave too and it's a
   reasonable way to make this behavior optional.
 * The Preferences are only saved to permanent memory upon closing
   Blender, following existing convention of Preferences and Quick
   Favorites.
 * If settings weren't actually changed, Preference saving is skipped.
 * Only temporary file browsers save their state (invoked through
   actions like open or save), not regular file browser editors. These
   are usually used for different purposes and workflows.
 * Removes "Show Thumbnails" Preferences option. It would need some
   special handling, possibly introducing bugs. For users, this
   simplifies behavior and should make things more predictable.
   Left in DNA data in case we decide to bring it back.

Reviewers: brecht, #user_interface, billreynish, campbellbarton

Reviewed By: #user_interface, William Reynish, Campbell Barton, Brecht
             van Lommel (quick first pass review in person)

Maniphest Tasks: T69460

Differential Revision: https://developer.blender.org/D5893
2019-09-30 19:27:02 +02:00
5940f6b3d9 Fix T58683: Reload Scripts breaks toolbar button formatting
Add a function which clears internal cached operator pointers,
run before reloading scripts.
2019-10-01 01:59:31 +10:00
68c2f7a2d0 Revert "Fix T58683: Reload Scripts breaks toolbar button formatting."
This reverts commit ba90d2efa5.

This can be resolved without adding a boolean to all operator types
to check if it's "WM_OT_tool_set_by_id".
2019-10-01 01:57:51 +10:00
6a6ac502f2 Cleanup: unused arguments 2019-10-01 01:57:51 +10:00
bb0b46f78c GPU: Make sure workaround is supported
`context_local_shaders_workaround` is only supported on OpenGL 4.1 or higher.
2019-09-30 12:15:31 -03:00
7dc70feb63 GPencil: Fix unreported keymap missing for Extrude tool
For some reason this keymap was removed and is required to avoid console warnings.
2019-09-30 17:13:31 +02:00
fae5348307 Fix T70375: Typo in label (Height used instead of High).
Also, use Title Caps for labels...
2019-09-30 16:03:21 +02:00
e8f6f70846 PBVH: PBVH_FullyMasked and PBVH_FullyUnmasked flags
This commit introduces flags to tag the PBVH nodes as fully masked or unmasked. This is used in do_brush_actions to filter fully masked nodes during a stroke. Other tools can also be updated to use this flags.
Sculpt updates now require a flag to update the mask or the vertex coordinates.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5935
2019-09-30 15:58:03 +02:00
3dc027add3 Fix T70385: Pose brush breaks when using pose origin offset
Reviewed By: jbakker

Maniphest Tasks: T70385

Differential Revision: https://developer.blender.org/D5945
2019-09-30 15:45:27 +02:00
b89a1687ce Fix "denoise_animation" tests with OptiX in Cycles
The OptiX device only loads the denoising kernels when the "use_denoising" feature is active. This was not set by the calling code however and therefore they were never loaded and attempting to launch them failed (see T69801).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5946
2019-09-30 15:38:07 +02:00
61efeb6df9 Fix PBVH search callback in pose and elastic deform
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5947
2019-09-30 14:58:22 +02:00
6b419c18b0 Sculpt: Only redraw nodes where the mask changed
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5923
2019-09-30 14:37:19 +02:00
91f6aa6a57 Fix memory leak after using OptiX in Cycles
The "optix_devices" array was not freed on exit, which caused a memory leak (see T69801).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5944
2019-09-30 14:05:40 +02:00
04ef62177f UI: Use paint crosshair cursor in all paint & sculpt modes
Currently, we use the crosshair cursor in Sculpt mode, but not in the other paint modes.

  - Sculpt Mode: This crosshair cursor is too weighty.
  - Texture, Weight, Vertex Paint: Using the arrow cursor for painting is not right.

This commit makes the following changes:

  - Use the new special paint crosshair instead
  - Use this cursor in all paint modes, not just Sculpt

Reviewed by: Brecht

Differential Revision: https://developer.blender.org/D5940
2019-09-30 13:33:54 +02:00
56854bd177 Fix RNA's "editable" func regarding IDProps and override.
`RNA_property_overridable_get()` need the original RNA property (i.e.
the actual IDProp in case it is one), not the 'proxy' type property
returned by `rna_ensure_property()` for IDProps.

Makes custom properties of library overrides editable at last, now we
only have to keep them overridden values!
2019-09-30 11:01:29 +02:00
64c8e9a219 macOS: don't require python3 to be installed to run "make update"
And fall back to python3 from our libraries for other commands, once checked
out with make update.
2019-09-30 10:51:17 +02:00
a6a0a09197 Cleanup: spelling 2019-09-30 17:07:05 +10:00
Stefan Werner
04133ee863 Revert "macOS: Replaced OSSpinLock with os_unfair_lock."
This reverts commit 9d282d7a8d.
os_unfair_lock requires macOS 10.12 or newer.
2019-09-30 08:29:17 +02:00
64c222ff58 Fix T69334: VSE Very low framerate
Revert "Sequencer: use Alpha Over blend mode by default"

This reverts commit 7c6c5b40ca.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5943
2019-09-29 16:17:56 -07:00
cdcb844d27 Fix T69684: Sound Strip "Pan" function is misleading
Gray-out pan property when sound mono property is unset.

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D5806
2019-09-29 16:14:42 -07:00
ff10ff782b Fix wrong sculpt flat shaded normals after recent optimizations 2019-09-29 23:43:16 +02:00
24be998b98 Fix T70345: wrong transforms of objects after recent NVIDIA workaround
This reverts commit 44d042094e and adds a
simpler workaround for just the node links display issue. There are other
issues though so this is not a full workaround.
2019-09-29 21:10:12 +02:00
56fe8239ab Fix T70320: View clipping doesn't hide extra wireframe 2019-09-30 04:50:22 +10:00
3a3e5fb365 Fix T69935: Silence Win32 OS Error Dialogs
Call SetErrorMode() at startup to prevent error mode dialogs.

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

Reviewed by Brecht Van Lommel
2019-09-29 11:43:24 -07:00
Julian Eisel
98c0d16da5 UI: Use responive layout for upper bar in file browser
The upper bar (containing file path, navigation and display buttons) may
now be split into two rows as horizontal space is reduced.
The first row contains the navigation related buttons, the lower one the
filter and display related ones.

Mainly solves the issue where the file path and search buttons became
barely usable in tight layouts, but generally makes things better for
such cases.
2019-09-29 20:37:51 +02:00
Julian Eisel
57519f237a UI: Let file browser tool/bookmarks region push upper bar in
Main reason for doing this is that the navigation buttons are very
close to the file list now, making them much faster to reach.

Initially we let the upper bar (the one with the file path, navigation
and display buttons) use full area width, because designs back then had
more horizontal space problems. The designs have changed meanwhile, and
horizontal space is less of an issue.

However, when the file browser is shrunk horizontally, or if it's open
in a small area (e.g. see "Shading" workspace), having the tool region
open brings back the space issues. But even the file list layout becomes
problematic then, and the same issue was present before the new file
browser design, so we've decided this is an acceptable tradeoff.
2019-09-29 20:37:51 +02:00
02c4410a37 Cleanup: use doxy sections for image_ops.c 2019-09-30 03:47:54 +10:00
Julian Eisel
f8b57dbb81 Keymaps: Don't show confirm prompt when creating directories
* We don't show the prompt when invoked through the button either
* Creating directories isn't a destructive action and it's not dangerous
* The prompt is annoying and users often requested getting rid of it

This change is applied to both, the default and the industry compatible
keymap.
2019-09-29 18:45:52 +02:00
860854b07f Fix (workaround) memory leak cancelling sculpt mask expand 2019-09-29 16:22:09 +02:00
0fd3723b95 Fix small memory leaks in some sculpt tools
Also use MEM_SAFE_FREE to simplify code.
2019-09-29 16:22:09 +02:00
0ffb96f701 Sculpt: minor optimizations for GPU draw buffer filling
Ref T70295
2019-09-29 16:22:09 +02:00
9b0fd5ef2a Sculpt: only update draw buffers for visible nodes during paint stroke
Also applies to some other sculpt tools like filter and mask expand.

The full update happens after the paint stroke is finished, so it does not
happen on view navigation, which would cause a delay.

Ref T70295

Differential Revision: https://developer.blender.org/D5922
2019-09-29 16:22:09 +02:00
f6fc863acd Sculpt: multithread GPU draw buffer filling for workbench
This improves performance of some sculpt tools, particularly those that modify
many vertices like filter and mask tools, or use brushes with large radius.

For mask expand it can make updates up to 2x faster on heavy meshes, but for
most tools it's more on the order of 1-1.1x. There are bigger bottlenecks to
solve, like normal updates.

Ref T70295

Differential Revision: https://developer.blender.org/D5926
2019-09-29 15:28:15 +02:00
c931a0057f Sculpt: use dynamic scheduling and chunk size 1 for multithreading
This is under the assumptions that each node has enough work to avoid
the threading overhead, while also having a possible variable amount of
work. For example most of the vertices being masked or outside of the
brush radius.

Improves performance by about 10% for tools like mesh filter on an
entire 3 million poly mesh, tested on a quad core.

Ref T68873
2019-09-29 15:27:37 +02:00
8b00a73620 Cleanup: move sculpt parallel range threading test into function
Easier to experiment with different settings this way.
2019-09-29 15:27:37 +02:00
1ca105ebdc Sculpt: disable workbench anti-aliasing during stroke painting
This mostly happens automatically anyway since there is usually not enough
time left over for it. But when it does it happen it breaks partial redraw,
and may also have a negative impact on responsiveness.

Ref T70295
2019-09-29 15:27:37 +02:00
c31a849a14 Fix wrong sculpt cursor drawing when using "ignore_background_click"
Not all the necessary state got restored.
2019-09-29 15:04:10 +02:00
ba90d2efa5 Fix T58683: Reload Scripts breaks toolbar button formatting.
Assuming it's actually necessary to do this check very efficiently,
replace the hack based on caching a pointer, with a different one
that caches the string comparison result in the operator object.
2019-09-29 09:28:02 +03:00
44d042094e GPU: Workaround for broken node links on NVidia drivers
Related to T70011 and T70008
2019-09-29 01:19:45 +02:00
2c7365aec7 Fix unnecessary use of atomics in PBVH normal update 2019-09-28 12:29:52 +02:00
5bace9f5dd Cleanup: compiler warnings 2019-09-28 12:29:52 +02:00
b192c01254 Fix build error on Windows 2019-09-28 12:29:07 +02:00
7ea1b8451e Drivers: fix transform channel panel for W rotation and quaternions. 2019-09-28 10:31:51 +03:00
775a13dea0 RNA: fix the name of the parent inverse matrix in Data API Outliner view. 2019-09-28 10:14:46 +03:00
a2457dd7bb Debug: add 888 and 889 debug values for redraw and PBVH node visualizatons
More convenient to use the debug menu than having to modify code every time.
2019-09-28 01:35:53 +02:00
1c1a3198af EEVEE: Speedup: Don't request orco layer if not needed
Should speed up eevee mesh update a tiny bit in certain particular cases
(deform modifier + (shader using texcoord (but not generated output) OR
principled bsdf OR geometry node (except tangent output))).
2019-09-28 00:44:16 +02:00
ad22d3111f Fix T70226 EEVEE: Crash/Assert entering edit mode with instanced meshes...
... and modifiers.

This was caused by wrong mesh being taken into account when in edit mode.
2019-09-28 00:44:16 +02:00
6cbfa8d511 GPencil: Fix compiler warning 2019-09-27 23:23:25 +02:00
1b36c91831 Cleanup: Remove // comments 2019-09-27 23:15:09 +02:00
972edc93d7 Cleanup: Remove blank at the end of tooltip 2019-09-27 23:05:29 +02:00
8ac21cb40a fix:wrong python pdb copied for Windows-VS when building for pydebug 2019-09-27 22:59:08 +02:00
50931192aa UI: small tweaks to sculpt tool icons
Snake Hook: make it more clearly different from Grab, and also better communicate what it can do
Pose: remove arrow, which was hard to see anyway
Pinch: make arrows larger and more visible
2019-09-27 21:12:13 +02:00
387fe3607d UI: Add high quality cursors on macOS
This adds the same high quality cursors on macOS as we have on Windows.

These are stored as 32*32 pt PDFs, same as the built-in OS cursors

Reviewed by: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D5907
2019-09-27 20:41:22 +02:00
e51b93473a Fix T70247 Crash on enter edit mode with UV editor opened 2019-09-27 19:45:27 +02:00
be985bdde2 Sculpt: Sculpt cursor UX improvements
This commit introduces the following changes:
- Invert the direction of the brush strength WM control. It was working in the opposite direction to any other control in Blender. Now dragging to the right increases the strength.
- Increase the alpha of the cursor
- Remove the font shadow of the numbers in the WM control. It was adding too much visual noise when rendered on top of the brush alpha
- Add a second circle to preview the strength in the cursor
- Increase the resolution of the cursor circles. Now they look smooth even when working with large brush sizes.
- Add a line preview to display the brush curve
- Don't offset the cursor preview when changing size and strength

Reviewed By: billreynish, brecht

Differential Revision: https://developer.blender.org/D5889
2019-09-27 19:16:03 +02:00
c372318165 Voxel remesh: Enable adaptivity
This commit enables OpenVDB adaptivity in the voxel remesher. It can be useful to reduce the polygon count if you want to switch to dyntopo after using the voxel remesher workflow.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5918
2019-09-27 19:12:51 +02:00
82136bb36e Sculpt: Use func_finalize instead of mutex
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5905
2019-09-27 18:41:24 +02:00
6a74b7c14b Sculpt: Pose brush origin offset
With the previous behavior, it was impossible to manipulate areas with a lot of complex shapes like fingers, as the pose origin was calculated only with the topology inside the radius.
With pose offset, the previous method is used to calculate the direction of the "bone", and an extra offset is added on top of it. This way you can set the pose origin in the correct place in this kind of situations. The pose factor grows to fit the new rotation origin.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5841
2019-09-27 18:35:42 +02:00
7ae549448e Fix T70291: Sculpt remesh inverts normal when fix poles is activated
Reviewed By: brecht

Maniphest Tasks: T70291

Differential Revision: https://developer.blender.org/D5916
2019-09-27 17:50:12 +02:00
9df9fb3324 Fix T56497: Snake hook sculpt brush slips off and affects the part of the mesh behind
We should not be updating the cache true location there.
This commit also fixes the snake hook default alpha.

Reviewed By: brecht

Maniphest Tasks: T56497

Differential Revision: https://developer.blender.org/D5915
2019-09-27 17:48:28 +02:00
97f4d4c66e Fix T70280: QuadriFlow remesh with "Use Paint Symmetry" and "Smooth Normals" may give wrong normals
Reviewed By: jbakker

Maniphest Tasks: T70280

Differential Revision: https://developer.blender.org/D5904
2019-09-27 17:46:56 +02:00
2bef8c5ea8 Sculpt: Enable accumulate in scrape brush
This fixes some artifacts when working on curved surfaces. Previous
behavior was with accumulate on, so that is now the default.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5826
2019-09-27 17:45:13 +02:00
7bbdc6996a Fix T69941 Assert selecting UVs
Was caused by DRW_mesh_batch_cache_get_edituv_faces_stretch_area called
after DRW_mesh_batch_cache_create_requested. So it was created on the wrong
object/mesh.
2019-09-27 17:19:00 +02:00
b22afef72c Cleanup: Replace 'add mode' short for driver FCurve creation with an enum
The 'add mode' was a `short` between -1 and 2 inclusive, and magic numbers
sprinkled throughout the code. It's now an enum with descriptive names.

No functional changes.
2019-09-27 17:02:39 +02:00
3c7707b49f GPencil: New Brush default settings
This patch replaces D5787. Now instead to replace the startup.blend file, all the changes are done in versioning and moved to shared module to be reused by Brush reset.

Reviewers: brecht, mendio

Reviewed By: brecht

Subscribers: pepeland, mendio

Differential Revision: https://developer.blender.org/D5913
2019-09-27 16:52:50 +02:00
c69a771851 GPencil: Simplify smooth average factor calculation
As always uses 4 points, don't need to do calculations for that and also it was wrong with 3 points.
2019-09-27 16:43:31 +02:00
df3891ed81 Fix T69377 Texture flickering when selecting in solid viewport (AMD Pro driver)
Workaround that does not fix the real issue.

The bug is caused by glBufferData inside
DRW_instance_buffer_finish > GPU_vertbuf_use
but only after the selection code which resets the number of items in
idatalist->pool_buffers.

I don't understand why this is happening as the vbo ids are all valid and
no error is reported. What is even more strange, is that it affects another
vbo which has no connection with the ones in DRW_instance_buffer_finish.
2019-09-27 15:31:18 +02:00
c601839176 Fix T70106 Objects with multiple materials are not displaying correctly
Seems to be an issue with OSX and loading objects matrices from uniform
buffers.

Using legacy path for that reason.
2019-09-27 15:31:18 +02:00
12688a6636 GPencil: New smart smooth for strokes
When using the samples, the interpolated points get abrupt steps because the system cannot receive all events in a short period of time.

This is more noticeable when the samples are set to 10 and the pen is moved very fast. The problem with post-processing smooth is that is applied to all stroke and this removes details.

The smart smooth is automatic and detect only the segments in the stroke where the system was unable to capture all movements and apply a smooth algorithm.
2019-09-27 15:28:32 +02:00
770e91703d Fix part of T70295: sculpt drawing not clipping PBVH behind the camera
Use all 6 clipping planes for drawing.
2019-09-27 14:59:41 +02:00
d3a98b2c3b Fix part of T70295: sculpt drawing not clipping PBVH nodes outside of viewport
As before in 2.7, this only works for optimized drawing in workbench mode.
2019-09-27 14:29:40 +02:00
0901a72b6b Cleanup: use consistent clipping plane sign convention 2019-09-27 14:24:49 +02:00
c5db0272d4 Fix T70276: View animation with jpeg 2000 image will crash player
Since our ffmpeg is built with openjpeg support and thus can decode jpeg
2000 (in both J2K and JP2 codec flavors as well as high bitdepths), added
these extensions to the supported list.

Also IMB_ispic > IMB_ispic_type > imb_is_a_jp2 was only testing for jp2,
now do both jp2/j2k.

Reviewers: brecht

Maniphest Tasks: T70276

Differential Revision: https://developer.blender.org/D5909
2019-09-27 12:02:08 +02:00
4b206d9a51 Cleanup: remove unused function 2019-09-27 18:04:44 +10:00
92686c667e Cleanup: structs, cmake file lists 2019-09-27 12:45:54 +10:00
7ae85b54d7 Cleanup: clang-format 2019-09-27 12:37:53 +10:00
c43018cdc0 Fix T69814: Grease Pencil Onion Skin Loop doesn't work as expected
The first element of the loop was not calculated for all onion modes. For select mode the first selected is used, for other modes the first frame in the layer is used.
2019-09-26 18:04:36 +02:00
7ac581cb1b Cleanup: clang format for particle loop macros
See https://developer.blender.org/D5903

Reviewers: JacquesLucke
2019-09-26 17:55:51 +02:00
b0d3ed3d20 clang-format: add particle loop macros
This is so the '{' will be on the same line for those as well.

Reviewers: JacquesLucke

Differential Revision: https://developer.blender.org/D5903
2019-09-26 17:52:49 +02:00
db4571f3c3 Fix T68645: Hair Particle Edit - Particle Mirror crash when children are
visible in the viewport

Seems to be an issue of not correctly freeing the PTCacheEdit (see
T68645 for details), after discussion with sergey we went with the quick
and dirty fix to free the path cache early for now. Other solution of
freeing it in 'psys_cache_paths' for the non-evaluated psys [which would
also fix the particle delete, then undo crash from T69000] needs more
deep investigation and, possibly, reconsideration.

Reviewers: sergey

Maniphest Tasks: T68645

Differential Revision: https://developer.blender.org/D5755
2019-09-26 17:35:17 +02:00
cf2c09002f Fix T69488: Hair particles: rekey disolves the hair then crashes
Caused by rB914427afd512.

Since above commit 'pe_get_current' checks for an active depsgraph. This
caused the skipping of handling
`PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL`for everything calling
`PE_get_current` (this passes a NULL depsgraph as opposed to
`PE_create_current`). So we now pass a depsgraph here as well...

Note there are two RNA cases where we pass NULL, namely
- rna_ParticleEdit_editable_get
- rna_ParticleEdit_hair_get
I guess these should be fine though (no functional change to current
master)

Reviewers: sergey

Maniphest Tasks: T69488

Differential Revision: https://developer.blender.org/D5752
2019-09-26 17:27:43 +02:00
6a33e3b990 Cleanup: compiler warnings 2019-09-26 17:25:16 +02:00
a933237d68 Fix accumulate in Draw Sharp brush
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5814
2019-09-26 16:56:34 +02:00
e5c9bf3aa2 Quadriflow: Symmetry support
This patch adds paint symmetry support to Quadriflow. It bisects and mirrors the input and the output from the remesher to build the final mesh using the preserve boundary option.
This is also an important performance improvement in Quadriflow because it only needs to process half of the mesh with half the resolution.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5855
2019-09-26 16:43:35 +02:00
b7f27996e7 Cleanup: fix compiler warnings 2019-09-26 16:32:27 +02:00
09dc7bce37 Fix Cycles bake panel showing for other renderers, after recent changes 2019-09-26 16:30:41 +02:00
454c1a5de4 Voxel Remesh: Fix poles and preserve volume
This commit fixes most of the issues we currently have in the voxel remesher. Mesh volume is preserved when doing multiple iterations, so the sculpt won't shrink and smooth each time you run the remesher. Mesh topology is much better, fixing most issues related to mask extraction and other topology based operations.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5863
2019-09-26 16:30:25 +02:00
da84bd3c11 Cleanup: cursor header file 2019-09-26 16:26:04 +02:00
da63ac5576 Cleanup: remove unused cursors without high resolution image 2019-09-26 16:26:04 +02:00
a0d4c2e607 Sculpt: Brush default settings
- Update default values of current tools
  - Create default values for new sculpt tools
  - Update the color of the cursor to match the color of the tool icon

Reviewed By: jbakker, brecht

Maniphest Tasks: T68745

Differential Revision: https://developer.blender.org/D5813
2019-09-26 16:15:18 +02:00
4d89667663 Fix sequencer Metadata panel sidebar panel to show at the bottom, not the top 2019-09-26 16:07:36 +02:00
7c544626b7 Sculpt: UI fixes and improvements
- Fix vertical spacing in grab brush grab active vertex option
- Move Remesher popover in the top bar to the right of Dyntopo
- Move topology automasking to the options subpanel
- Remove voxel remesher button from the topbar
- Add default shortcut to voxel remesher [Ctrl R]
- Add default shortcut to quadriflow [Ctrl Alt R]
- Add set pivot position operator to the sculpt menu

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D5880
2019-09-26 16:01:54 +02:00
5603725389 Fix T70126: Can't Snap To Vertex With Rigidbody
The idea is to ignore dependency which comes via rigid body solver.

Reviewers: mano-wii

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D5900
2019-09-26 15:25:21 +02:00
5a7fee8132 RNA Manual Reference Update 2019-09-26 09:22:06 -04:00
0ac7b51dee Fix T70107 EEVEE: Crash using Irradiance Volume with Curve inside
This was more of a general nvidia driver bug. Was caused by a
drawcall that had 0 vertex count. This worked in normal drawcalls
but not in indirect drawcalls.
2019-09-26 15:48:29 +02:00
c525d0e3ae Object Mode: Fix missing ubo assert with irradiance grid 2019-09-26 15:48:29 +02:00
e02ecd599b Fix T70259: Hair particle point selection if 'use_fade_time' is set
If fade_time is used, particles would be flagged PEK_HIDE (depending on
time settings), but since this is not respected in drawing in 2.8 yet
the user would have no indication of them keys being hidden.
Also doing this for hair doesnt make much sense anyways...

Reviewers: jacqueslucke

Maniphest Tasks: T70259

Differential Revision: https://developer.blender.org/D5901
2019-09-26 15:01:06 +02:00
39d855f8f3 Fix particle lasso selecting non-visible keys
Even though hidden/faded keys are not supported in drawing in 2.8 yet,
the selection tools should not be able to select non-visible keys.

Spotted while looking into T70259

Reviewers: JacquesLucke

Differential Revision: https://developer.blender.org/D5902
2019-09-26 14:41:36 +02:00
b07db54cad Cleanup: clang-format 2019-09-26 14:37:30 +02:00
e56f71d03f Grease Pencil: use standard eraser and paint brush cursors
Ref D5197
2019-09-26 14:31:52 +02:00
47fdac8ad9 WM: always use standard cursors from GHOST when available, over custom ones
Fixes T62417: poorly visible cursors on high Windows DPI displays

Ref D5197
2019-09-26 14:31:51 +02:00
583beea3ee WM: refresh custom cursors designs, add a few more cursors
Cursors designed by Duarte Farrajota Ramos.

Also fixes misnamed vertical and horizontal split cursors.

Ref D5197
2019-09-26 14:31:50 +02:00
b29ad7c91a WM: clean up cursors constants and code
There was a mix of old and new constants. Now have one list of WM_CURSOR_*
cursor types, using GHOST standard cursors when available and otherwise falling
back to our custom cursors.

Ref D5197
2019-09-26 14:31:48 +02:00
3bf4610347 GHOST: refresh standard cursors available for platforms
* Add more standard cursor types, that platforms can optionally support.
* Remove a few unused cursor types that were not properly supported and
  would show the wrong cursor when used.
* Add native cursor files for Windows. These scale well with DPI and have
  anti-aliasing. Designed by Duarte Farrajota Ramos.

Ref D5197
2019-09-26 14:31:47 +02:00
6292cab193 GHOST: add GHOST_HasWindowCursorShape() to test if standard cursor exists
Ref D5197
2019-09-26 14:31:43 +02:00
bab6ede286 Fix (unreported) (2d) paint cursor always drawing in half alpha
Own mistake in rB078fcc62534c (should only switch to half alpha if we
draw the second pressure circle as well...)
2019-09-26 14:19:47 +02:00
f547c396e1 Fix T70260: Stencil Paint Overlay Broken
own error in rB078fcc62534c (doing the overlay only in 3d painting)
2019-09-26 14:19:47 +02:00
cbf2d23ff2 CleanUp
Removed unused define in `edit_mesh_mode.c`
2019-09-26 13:32:55 +02:00
24afa26a50 Clean up
Unused framebuffers in `edit_mesh_mode.c`
2019-09-26 12:56:20 +02:00
bb74bd243f Code Cleanup
Removed unused shading groups in `edit_mesh_mode.c`
2019-09-26 12:37:39 +02:00
ae5bf4c2c8 Fix T67732: metadata "Include Labels" checkbox doesn't work when "Use Strip Metadata" is checked
The 'metadata from sequencer strip' system was using the
`stampdata_from_template()` function, which ignored the 'Use Labels'
setting.
2019-09-26 12:05:40 +02:00
8a7085b9d4 Fix T70163: Error painting with Subdivision at end of stack
Deformation of subdivision surface modifier was using wrong coordinates
for the coarse mesh: as the modifier flow goes the coordinates are to be
taken from the input array of coordinates.
2019-09-26 12:01:52 +02:00
ee47075449 Fix: T70251 update license from gplv2 to v3 in exe properties 2019-09-25 14:42:53 -06:00
f9d7f690b2 Fix T69639: Bevel Info bar Width value not affected by Unit Scale 2019-09-25 17:05:53 -03:00
abc8d6b12c Cleanup: Modernize Smooth modifier code.
Simplify it a bit, hopefully make it clearer, better var names, use
proper types for arrays of vectors, etc.

No behavioral change expected (except for corner-case of vertices being
used by more than 255 edges, which were sort of 'clamped' to those 255
first edges for the smoothed position computation previously, now we use
proper integer, which fixes that bug).
2019-09-25 21:51:13 +02:00
Laurent Noel
ae755c0167 Windows: Fill ProductVersion of blender executable
On windows, the ProductVersion field of the blender executable was empty,
see [1] for more information. This field might be required by windows
tools such as SCCM agent to track usage statistics.

It seems that it was due to the BLEN_VER_RC_STR macro used in
winblender.rc not being a string.

[1] https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource

Differential Revision: https://developer.blender.org/D5896
2019-09-25 12:06:20 -06:00
9e62cca29d Fix T69542: Corrective Smooth modifier breaks when drivers are involved
Previously the cache for the modifier would not be invalidated if
modifier settings were changed with drivers or keyframes.

Now we compare the current setting with the ones used to generate the
cache and invalidate the cache if they differ.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D5694
2019-09-25 16:47:51 +02:00
b393b13524 Fix T70231: GPencil - Moving very fast tablet pen gets ugly stroke ends
When move very fast the pen using a tablet, the end of the strokes was very ugly if the sampling was enabled. The reason for that is the last point and the previous one was interpolated in distance, but not in pressure and strength.

This commit uses several processes to get better endings:

a) If the pressure at the end of the stroke is very low, this part of the stroke is removed. This is a common issue with some tablet that send events with very low pressure when the pen is raised from drawing surface.
b)  The interpolated points created by sampling are interpolated in strength and pressure to get a smooth transition.
c) Active smooth also uses the strength. Before only pressure was used.
2019-09-25 16:13:57 +02:00
f8da7218be Fix T70187: GPU Driver: Merge Vertices Crashes ATI/Linux/OpenSource
This has been tested with 18.2.2, 19.0.8 and 19.3.0~develop.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5886
2019-09-25 15:57:34 +02:00
b651ac6531 Removed auto generated config.h file from quadriflow
The config.h file is autogenerated during compile by a 3rd party library
quadriflow uses. Now we put this file in the build directory to avoid
adding this to the git repository in the future.
2019-09-25 15:55:36 +02:00
f9ef0e1bde Fix T67342 EEVEE: Uninitialized buffer when changing screen size
Was caused by some drawcall not being done if the volumetric resolve pass
was drawn (using dual source blending seems to be the cause).
Not sure why this is needed since it is still reset before the next
drawcall.
2019-09-25 15:37:42 +02:00
7d09c943f6 make.bat: Fix rebuilds with custom build directory.
When calling make.bat multiple times to rebuild blender
make.bat failed to rebuild if a custom build dir was set.

reported and fixed on chat by @dgsantana
2019-09-25 07:17:06 -06:00
1ca5c8491d Pose paste: avoid auto-keying on unselected bones when 'selection only' is enabled
The `pose_bone_do_paste()` function is documented to only return a
non-NULL pointer on a successful paste, and the one caller that checks
the return value is expecting this behaviour. However, before this
commit, when a valid pose channel was found, 'Selected Only' was
enabled, and the bone was not selected, the function would still return
non-NULL. This resulted in auto-keying pose channels that were not
pasted.

Reviewed by: angavrilov

Differential Revision: https://developer.blender.org/D5891
2019-09-25 15:07:57 +02:00
2507b6a489 Added missing documentation for options parameter in keyframe_insert()
The RNA docstring of `keyframe_insert()` didn't mention the `options`
parameter in the function signature.

No functional changes.
2019-09-25 15:04:20 +02:00
615d5fa2fb Motion paths: Use minimal possible dependency graph
This change makes it so motion paths are using minimal possible
dependency graph which is sufficient to evaluate required motion
path targets.

Disclaimer: granularity is done on ID level, but it is possible
to go more granular if really needed.

Brings time down to 0.5 sec when updating motion path for the
Rain animation file used for benchmarks in the previous commits.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5874
2019-09-25 14:40:06 +02:00
eb2ed0ea7a Depsgraph: Implement builder from given set of IDs
The title explains it all actually: this commit introduces special
dependency graph builder API which builds graph which is sufficient
to evaluate given set of IDs.
2019-09-25 14:40:06 +02:00
6aadfa243d Depsgraph: Mark build methods as virtual
Allows to override behavior in a subclasses.

Currently no functional changes. The penalty of calls being virtual
should be neglectable.
2019-09-25 14:40:06 +02:00
c0855f77c0 Depsgraph: Move proxy group and from building to own function
Currently no functional changes, but allows to make it more clear to
implement depsgraph construction from a given subset of scene.
2019-09-25 14:40:06 +02:00
e7507c16e8 Motion paths: Limit updates to changed frame range only
The idea is to only update parts of motion paths which lies between
keyframes around changed frame.

The changed frames are considered to be from second previous to
second next one to work correctly with bezier handles interpolation.

Brings updates in the Rain test animation file from around 11 sec
down to 1 sec.
2019-09-25 14:40:05 +02:00
4db2a08281 Motion paths: Refactor, make update range more explicit
Allows to have a higher versatility in the API.

Should be no functional changes.
2019-09-25 14:40:05 +02:00
c77a0d7dc6 Motion paths: Cleanup, de-duplicate code 2019-09-25 14:40:05 +02:00
7b83ea5c6d LibOverride: tweaks to custom props UI.
For now, do not allow to add custom props to overriding IDs (this should
be possible in the future, by getting basic correct behavior here is
already fairly hard, no reason to complicate things even more).

Also, properly disallow editing of existing custom props in overriding IDs.
2019-09-25 14:27:47 +02:00
1c624a1219 LibOverride: Fix 'overridable' flag desapearing when setting IDProp from py code.
Do not see any reason not to copy over the flag of the old, existing
IDProp to the new one when assigning (e.g. `C.object['prop'] = 0.5`
would nuke that IDProp flag).
2019-09-25 14:27:47 +02:00
1201352217 LibOverride: Fix several issues in handling of overridable status for IDProps.
The triple possible status of an PropertyRNA (actual C-defined prop,
py-defined IDprop behaving similar ot RNA one, or actual 'pure' custom
prop) is really confusing... Not to mention the _RNA_UI ugly thingy on
top of that. :/
2019-09-25 14:27:47 +02:00
ef60cf8fca Cleanup: remove override's 'static' references in some py API docs strings. 2019-09-25 14:27:47 +02:00
a1e40087c5 Cycles: Fix undefined behavior which can causes crashes with a misaligned address error
Cycles casts a pointer from ShaderDataTinyStorage to ShaderData, these structs by default had different alignments however (the former was 1-byte aligned, the latter 16-byte). This caused undefined behavior on at least the CUDA platform. Forcing both structs to use the same alignment fixes this.

CUDA toolkits newer than 10.1 run into this because of a compiler optimization.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5883
2019-09-25 14:22:21 +02:00
900a9a4b06 Sculpt: Cleanup, use more suitable utility function
No functional changes, just more clear semantic and shorter call.
2019-09-25 12:44:42 +02:00
d6dcf5b1ff Sculpt: Fix crash hovering mouse onto multire surface
The check around function which is only supposed to be used for
non-multires case was gone after aea8c0102a.
2019-09-25 12:43:27 +02:00
fae122f12f Sculpt: Cleanup, grant expected usage with asserts
Don't just rely on a comment next top the code, do an assert as well.

Also, don't use `default` since that silences compiler warnings when
new enumerators are added and related code is to be verified.

More switch statements might need an adjustment, but this is something
what is easier to go over by Pablo.
2019-09-25 12:40:10 +02:00
9fff5c2965 Fix T70236: voronoi misspelling in description 2019-09-25 10:26:57 +02:00
fbfa904bce Fix T69573: Driver Value does not slide along the actual value in the Driver Editor
This change is two-fold:

- Ensure the result of the F-Curve evaluation is stored on the FCurve
  object. This was done in 2.79 but lost when we moved to more granular
  per-curve evaluation from the depsgraph.
- Flush this result from the CoW copy back to the original.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D5888
2019-09-25 10:32:14 +02:00
d0279f7d36 Cleanup: use const for image blending functions 2019-09-25 17:19:08 +10:00
Dalai Felinto
3142ae19d2 Fix T70080: Newly created objects not visible with local collections
The tricky part here is to support a hidden parent and a "visible" child
collection. In this case the object should obviously be invisible. It is
all working now.
2019-09-24 14:25:42 -03:00
9dced206dd Cleanup: removed 7-year-old commented-out code marked 'for now' 2019-09-24 18:22:46 +02:00
c6995b3095 Fix T70004 EEVEE: Texture Coordinate Node in world shader render artifacts 2019-09-24 18:21:39 +02:00
dcee994af6 Tracking: Highlight keyframes in path visualization
This gives better idea of what's going on with your track. Example:

{F693806}

Color of keyframes are configurable from theme editor of clip editor.

Reviewers: keir, brecht, Severin

Differential Revision: https://developer.blender.org/D2772
2019-09-24 17:20:16 +02:00
9a0a556d3b Fix T70202: Typo error in message 2019-09-24 16:16:31 +02:00
a2cc855dba Fix T68736 EEVEE: Loose subsurface node breaks shader 2019-09-24 16:11:53 +02:00
f94f4e1d79 Fix T66555: Handler render init ignores output placeholders
Blender now calls render hooks before taking copy of `scene->r` in
`RE_RenderAnim()`.

A change to the render output filename made in the render-init hook
would not be picked up by by the copy. As a result, placeholders were
touched using the old name, whereas the rendered images would be saved
with the new filename.

Reviewers: sergey

Maniphest Tasks: T66555

Differential Revision: https://developer.blender.org/D5887
2019-09-24 15:59:06 +02:00
aea8c0102a Fix T70140: Topology Automasking and 2D Falloff don't work correctly together
Reviewed By: jbakker

Maniphest Tasks: T70140

Differential Revision: https://developer.blender.org/D5878
2019-09-24 15:51:47 +02:00
a9d3e95bea Fix T69875: Sculpt Scene Spacing breaks with Adjust Strength for Spacing enabled
Reviewed By: jbakker

Maniphest Tasks: T69875

Differential Revision: https://developer.blender.org/D5849
2019-09-24 15:49:23 +02:00
a7904dff4b Fix crash in dynamic mesh preview edge list update
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5824
2019-09-24 15:47:03 +02:00
Dalai Felinto
0dd83b385e Fix T70046: Linked instanced collections not working with local collections 2019-09-24 10:34:03 -03:00
Dalai Felinto
8cb8853ebc Make new objects (from enabled collections or append) visible to local views
This fix T67162.
2019-09-24 10:34:03 -03:00
561dfd12be Fix T70124: Motion path not drawn for Armature in Object Mode 2019-09-24 15:33:32 +02:00
22abc205ac Fix T69743: Armature display issues with Intel 5x0 GPU
Apparently this workaround solves the problem.
2019-09-24 08:47:15 -03:00
bf61f217e7 GPencil: Fix wrong icon for Brush presets
It was using the old 2.7 icon.
2019-09-24 13:17:28 +02:00
4e7faf5ffa GPencil: Keep Options panels open by default 2019-09-24 10:36:43 +02:00
9c62ac562c Cleanup: clang-format 2019-09-24 10:15:43 +02:00
36683475d1 Fix T68457: Cycles OpenCL Displacement Shading
When doing simple scenes the displacement shading failed during final
rendering when the displacement method is set to `Displacement + Bump`.

When this option is enabled the shader uses the Vector math
node. This node is part of the node group level 1. When doing simple
shading only using nodes that are part of the node group level
0 the shading was rendered black.

This only happened in final rendering as there the OpenCL programs are
optimized to save registries. Viewport rendering rendered correctly

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5859
2019-09-24 09:44:19 +02:00
5a6ab6f594 UI: Small tweaks to sculpt tool icons
Draw Sharp: More pronounced difference between it and Draw
Mask: Fits in with other similar tools
Border Hide: Fits in with other similar tools
Pinch: Much better communicates what it does
Simplify: Fix a small issue with caused by inverted normals
2019-09-23 22:20:21 +02:00
Daniel Grosse
14acac0bb7 Fix T70013: slow OpenGL calls for every vertex and weight painting step
Stroke update use now the location from Strokecache instead of the mouse
position.

Differential Revision: https://developer.blender.org/D5861
2019-09-23 17:18:15 +02:00
2713921e8a Fix T70143: GPencil Multiframe selection is not updated when use Box select in Dopesheet
Differential Revision: https://developer.blender.org/D5868
2019-09-23 17:03:45 +02:00
e2e567e0b4 Fix file browser new directory prompting for confirmation
This is only needed for the case where it's automatically done when entering a
file path that does not exist, not when pressing the button.
2019-09-23 16:44:06 +02:00
a168c3d282 Modifiers: every modifier now copies mesh settings, fixing texture space issues
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.

Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.

Fixes T64739: incorrect texture space for various modifiers

Differential Revision: https://developer.blender.org/D5808
2019-09-23 16:27:23 +02:00
69ad44d5b4 Cleanup: remove unimplemented texture space rotation variables 2019-09-23 16:27:23 +02:00
9208146199 Cleanup: remove Mesh.bb and Curve.bb, no reason for these to be persistent
These were only strictly valid for texture space calculation, don't store them
since they should not be used after that. Only store a flag to indicate if the
auto texture space has been evaluated.

In the future it might make sense to store bounding boxes at the mesh level to
speed up bounding box computation for multiple objects using the same mesh, but
then it will need to be implemented differently.
2019-09-23 16:27:23 +02:00
5c89c689db Fix selection and snapping misusing texture space as boundbox
This fixes the regression from T70103 introduced by the fix for T70103.
2019-09-23 16:27:03 +02:00
8634c4646e GPencil: Use correct comparison for non-bit values 2019-09-23 12:55:16 +02:00
1d1ef2e797 Revert part of "GPencil: Invert Paste operator and make Paste to Active default"
This commit accidentally undid a bunch of previous commits. Only the intended
changes are left now.
2019-09-23 11:09:00 +02:00
3a1b0c0f30 ShaderNodeTree: Add flatten function to get rid of nodegroups
This makes a lot of shader node wiring code less complex.

This only add the flatten mechanism (which fixes T69672).

~~Cleanup to remove the complexity in ntree_shader_relink_displacement,
ntree_shader_bump_branches and ntree_shader_tag_nodes will be commited
separately.~~(already included)

The code is only added for shader nodes for now but could be exported to
other internal nodetree types in the future.

Cleanup: Node Shader Tree: Remove GPUmaterial special nodegroup handling

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T69672

Differential Revision: https://developer.blender.org/D5829
2019-09-23 11:34:34 +02:00
4987f28ed2 Fix T70177: Crash when calling to_track_quat() without arguments 2019-09-23 09:46:31 +02:00
73a6fcfa80 ImBuf: add planes, channels attributes
D5857 by @cmbasnett
2019-09-23 09:56:46 +10:00
381a274909 Cleanup: use braces 2019-09-23 09:36:12 +10:00
4031bc1478 Cleanup: quote use 2019-09-23 09:35:27 +10:00
a083ddf49b Sequencer: correct fcurve map usage 2019-09-23 09:31:08 +10:00
52bdf522af Fix T69593: Color strip won't update
Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D5803
2019-09-22 13:38:39 -07:00
2e55171e71 Fix T69564: Empty fcurve prevents waveform drawing
Add check if fcurve is empty to skip fcurve evaluation.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D5805
2019-09-22 13:38:39 -07:00
29a7b1b64d VSE: Remove the use of eval in Fades operators
Fix security issue introduced in rB2ec025d7be3c

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5807
2019-09-22 13:38:39 -07:00
d025119aeb Fix T69352: Audio strips don't update when changing frame_start
Tag depsgraph update as a part of cache invalidation.

Author: mdewanchand

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D5718
2019-09-22 13:38:38 -07:00
aa697496e9 UI: Updated Sculpt Simplify tool icon
Fits better with the other tool icons.
2019-09-22 21:36:18 +02:00
012b5e6b22 Cleanup: MOD_explode: Sanitize code some more.
This happens to be a non-behavioral change, but previous code here was
*very* confusing, and only ended up generating expected results by mere
chance (since `facepa[i]` == `totpart` in case the face has no (valid)
particle, i.e. `pa == NULL`)...
2019-09-22 18:51:45 +02:00
591c1a1372 Cleanup: MOD_Explode: sanitize face-without-particle case.
Systematically reset particle pointer to NULL and use it to detect
invalid particle case, instead of checking value of the face's
particle index everywhere in a confusing and prone-to-bug way
(see T70150 and previous commit).

No behavioral change expected here.
2019-09-22 18:48:00 +02:00
6eea69a7ad Fix T70150: Explode modifier crashes with empty vertex group.
There’s be a lot to say about that explode modifier code, for now just
follow other places in code... But the handling of 'invalid'/'unkown'
particle case is... quiet confusing to say the least.
2019-09-22 18:29:05 +02:00
981b063473 UI: Move new sculpt mode tools to correct places in toolbar
Follows general logic, and are placed next to similar tools.
2019-09-22 15:10:15 +02:00
41853a566e UI: Add missing toolbar icons for Sculpt Mode 2019-09-22 14:54:14 +02:00
22a478e5ee GPencil: Fix missing last point when sculpt in Multiframe
This was a mistake when fixed the problem with multiframe sculpt. I missed change the index and use active point in the check.
2019-09-22 13:16:02 +02:00
b3aa8f0fad Mathutils: expose the swing + twist Quaternion decomposition to Python.
This decomposition is useful in rigging, and involves a math trick.
2019-09-22 13:19:33 +03:00
c71be416e0 GPencil: Performance improvement for Multiframe and Onion Skin
Before when Onion or Multiframe was enabled the VBO length was the total of points on the object for all frames and this results in a big size when the scene had a lot of frames.

Now, the size of VBO length is calculated more precisely and reduce the time to alloc the VBO.This also reduce memory footprint.
2019-09-21 19:21:37 +02:00
886adbbe49 Cleanup: Fix comment mistake 2019-09-21 17:18:11 +02:00
a5b15931c3 GPencil: Apply transformed rotation only if needed
If there aren't modifiers or they are not transform type, the rotation is not needed.
2019-09-21 16:13:30 +02:00
ef45d1c8cd GPencil: Use Object location instead of 3D cursor for Grab Brush
Instead to use the 3D cursor as reference point (legacy code), it would be better use the object location.

Tested by: @pepeland
2019-09-21 10:48:40 +02:00
cdf489d101 GPencil: Remove Sculpt rotation effect for multiframe sculpt
As multiframe does not use modifiers, this is not required and only gets weird results.

Related to T70116
2019-09-21 10:29:25 +02:00
35114b0e4e GPencil: More changes to use original data in multiframe sculpt
Related to T70116
2019-09-21 10:29:25 +02:00
c4cc4b5794 GPencil: Multiframe Show only Edit lines was inverted
The flag was working in the oposite mode.

Related to T70116
2019-09-21 10:29:25 +02:00
db7b3de918 GPencil: Copy temp color in multiframe
As the evaluated data is not calculated in multiframe, needs to have the original colors.

Related to T70116
2019-09-21 10:29:25 +02:00
bf4fa5792d GPencil: Rename function 2019-09-21 10:29:25 +02:00
b1cac03fe5 GPencil: Fix error in previous commit
Related to T70116
2019-09-21 10:29:25 +02:00
fe9d522273 GPencil: Use evaluated or original data in Sculpt for Multiframe
The evaluated frame is only available when the frame is the active one.

Related to T70116
2019-09-21 10:29:25 +02:00
c8443d8340 GPencil: Fix unreported select not working in multiframe mode
The selection was not working because the evaluated frame was only working for active frame, so when the evaluation was changed to use eval data instead of original data, the data was not available and the loop did not use it.

Related to T70116
2019-09-21 10:29:24 +02:00
3fcedae8c8 Cleanup: extra semicolon, comma warnings 2019-09-21 11:34:39 +10:00
3589701f6d Cleanup: unused headers in editors 2019-09-21 10:18:29 +10:00
7926e8ea4c Revert "Modifiers: every modifier now copies mesh settings, fixing texture space issues"
This reverts commit e7a514369f, it introduces
a bug in selection in edit mode.

Fixes T70103: can't select extruded Vertex

Ref T64739
2019-09-21 00:35:46 +02:00
bf14e323e6 Fix build error in debug build on macOS
NDEBUG is the standard define, not DEBUG.
2019-09-20 23:41:54 +02:00
Julian Eisel
ac15bf1646 UI: Avoid file browser directory change if path didn't change
E.g. entering the file path field and then pressing enter without any
change would call an unneccesary directory change, causing flickering.
So the main point of this is to avoid flickering.

Without this the text field could also be used to refresh the file list,
but for that we have a proper button.
2019-09-20 20:47:39 +02:00
Julian Eisel
adfe68e202 UI: Replace big options button in file browser
The big options button in the lower left is now gone, it's replaced by a
smaller icon toggle button in the upper right.
That means I could also remove code for the region we had just for this
button.
I also added versioning code for the removal, to make sure the region is
removed cleanly when reading old files.
2019-09-20 17:42:08 +02:00
8c60205bef Fix T70109: Crash with the Data Transfer Modifier (with any 'Edge Data' option)
The BVHTree was erroneously marked as not cached.
2019-09-20 12:18:22 -03:00
Julian Eisel
f0ec7c2ec6 UI: Use vertical file list for "Recover Auto Save"
Pablo and William agreed that the main purpose of the layout should be
to list files in a way that it's easy see which files were
created/modified when. Previously it was set to "Long List" to show the
modification time, now the vertical list is much better suited. The time
is shown anyway.
2019-09-20 16:20:44 +02:00
c460b7e0c6 Fix T70112: Spot cone prevents selection 2019-09-21 00:19:09 +10:00
Julian Eisel
2f1e8f4b97 Remove redundant file bookmarks region toggle operator
For the default keymap we were only using the regular toolshelf
operator, doing this for the industry compatible keymap too now (we
could even remove it there, we don't use it in other editors).

Since we "now" have proper operators for toggling regions, this specific
one is totally redundant.
2019-09-20 15:54:59 +02:00
Julian Eisel
b20182e334 Refactor: Ensure there's always a valid file editor tool region
So far the file browser code had some lazy creation for the tool region,
even though it should always be there. The only reason I can see for
this is compatiblity. So I simply added versioning code to add the
region in case it's not there. Now we should be able to savely assume
the tool region to be there, whithout any unusual lazy-creation.
2019-09-20 15:35:28 +02:00
Julian Eisel
d1cc340e56 Rewrite file region handling for non-editor mode
This makes it so that regions only needed when the file browser is
invoked as an operation (e.g. Ctrl+O rather than a regular editor) are
lazy created then, and removed if the file browser is changed into a
regular editor then (e.g. Ctrl+O over regular file browser editor ->
Cancel).

That should remove some troublesome assumptions and makes versioning
redundant.
It also fixes the issue of an empty execute region at the bottom after
cancelling a file operation invoked from a regular file browser editor.
2019-09-20 15:18:25 +02:00
Yevgeny Makarov
7a83b64f7b UI: Fix Capitalization
Differential Revision: https://developer.blender.org/D5716
2019-09-20 14:31:24 +02:00
Himanshi Kalra
60af4d207b UI: Incorrect info message after batch rename
Differential Revision: https://developer.blender.org/D5744
2019-09-20 14:15:32 +02:00
c8b293ec05 Fix T69097: Empty context menu for dimensions
Adjust empty menu check to skip the menu title.
2019-09-20 21:05:28 +10:00
f431c19954 Cleanup: discarded-qualifier warning 2019-09-20 21:05:28 +10:00
Pedro Reis
fb6ef2ec8d Fix T69486: Reloading file in text editor marks file as modified
Differential Revision: https://developer.blender.org/D5847
2019-09-20 12:46:26 +02:00
Julian Eisel
f5dc979a7e Cleanup: Add/use utility to remove regions 2019-09-20 12:28:15 +02:00
Julian Eisel
09b728ff3e Fix empty file options region in regular editor
This would happen when opening a file browser as regular editor, opening
a temporary file browser from there (e.g. Ctrl+O) and cancelling the
operation.
In some cases this would cause most of the editor to be filled with an
empty operator options region:
* Go to Shading workspace
* File -> Append
* Cancel
2019-09-20 12:13:28 +02:00
078fcc6253 Fix paint cursor drawing asserts
The new paint cursor (introduced in rBe0c792135adf) mixed 3d and 2d
drawing leading to asserts [e.g. when tablet pressure sensitivity was
enabled for size, see D5820 also].

We could get away with always drawing in 3D [using vertformat with
comp_len 3 / GPU_SHADER_3D_UNIFORM_COLOR / imm_draw_circle_wire_3d],
even if in the Image Editor, but this patch clearly separates what is
drawn in 3d and what is in 2d.

part of T69957

Reviewers: jbakker

Differential Revision: https://developer.blender.org/D5836
2019-09-20 11:56:53 +02:00
fde8682d96 Fix T69995: Object Drawtype Set To Solid Issues
When setting an object draw type to Solid it always used the Material
color mode. This change only sets the material color when the viewport
is set to display textures.
2019-09-20 11:21:41 +02:00
44d0c868bf Fix T70101: Displace modifier handles empty vertex group incorrectly 2019-09-20 10:41:49 +02:00
f83a8a61ff Fix T69600: Bridge edges creates UV's with wrong rotation 2019-09-20 18:29:19 +10:00
cd236bc22d Fix T69355: Closing window stops video but not audio 2019-09-20 16:37:07 +10:00
01cb4f9862 Fix T65264: Quick Favorite use in node-editor
Each node tree type now has it's own quick-favorites.
2019-09-20 14:56:08 +10:00
3794d9ef6e Fix T69797: Shear gizmo doesn't update on pivot point change 2019-09-20 14:11:43 +10:00
9dd64cb088 Fix T67174: Weight paint gradient has empty redo panel 2019-09-20 12:49:13 +10:00
fd51d5d412 Mesh: support face-maps when joining
Resolves T64320
2019-09-20 12:09:22 +10:00
6dc7cefb78 Fix T69999: Active element pivot crashes without active object 2019-09-20 10:23:47 +10:00
5356577e4c Cleanup: shadow warning 2019-09-20 10:23:37 +10:00
Julian Eisel
c8df6f2cf9 Fix Preferences opens file browser in wrong window
Steps to reproduce were:
* Open Preferences in a new window (Edit -> Preferences)
* Set file browsers to open fullscreen (Interface->Editors->Temporary
  Windows)
* Open a file browser in the Preferences (e.g. Add-ons -> Install)
The file browser would be opened in the parent window, rather than the
preferences.
2019-09-19 22:35:48 +02:00
27642f24e1 Fix T69855: 3DView glitches involving depth buffer
The problem is that `DST.vmempool->passes` was not cleared, so passes
previously created in another drw function were being reused.
2019-09-19 17:25:25 -03:00
b11272a007 DRW: Deduplicate drw_draw_depth_loop functions 2019-09-19 17:25:25 -03:00
Julian Eisel
4a5af65fe9 Fix T70048: Assert when cancelling Append window
If the file browser was opened from an existing file browser editor
(using File -> Append would make the mouse hover the file browser in the
 Shading workspace), we need special handling for closing the fullscreen
area.
This change brings back the old way of handling fullscreen closing.
2019-09-19 20:21:42 +02:00
3791d7abfd UI: Consistent Tooltip for Add Torus Operator
Changes "Add" to "Construct" to be consistent with the other
primitive mesh add operations.
2019-09-19 13:52:46 -04:00
f4f190a399 Fix T69971 EEVEE: Bump does not work using a UVMap node as input
This fixes both the attribute and the uvmap node. Some other nodes are not
supported but I think it makes little sense.
2019-09-19 19:43:28 +02:00
5e2f0adb1b UI: layout support for fixed size buttons, and use for file browser open/cancel
Not exposed to Python API yet, this should get more detailed testing with different
layouts before that happens.

Ref T69652
2019-09-19 18:40:58 +02:00
Julian Eisel
ee12af9c97 Fix T70074: Missing file execute region in some files (crashes)
I'm not sure how a .blend file could get into this state, but apparently
for some files saved with versions of Blender after the file browser
changes, the execute region would not have been created. File browser
code assumes this region to be there however.
Luckily I found a file with which I could recreate the issue. My guess
is that the error only happens with files that were stored before
certain versioning fixes were done after the file browser redesign.

To fix this, we just let the versioning code for the execute region run
even with newest files. We can run this safely, it only acts if the
execute region actually doesn't exist.
2019-09-19 18:03:05 +02:00
5883b6fde2 Fix T70021: Alembic incomplete crease import
Creases are stored by the vertex indices of the edges. Sometimes they
were stored with (v1, v2) when the edge itself was stored with (v2, v1).
We now search for both orientations.

Sorting the vertex indices before searching avoids the second search
altogether when loading the example file of T70021.
2019-09-19 17:36:18 +02:00
c1612ca114 Fix T67471: hidden particle emitter occludes in Cycles rendered viewport 2019-09-19 17:31:53 +02:00
ee44f8a289 Fix T67724: Cycles renders metaballs with wrong texture space 2019-09-19 17:31:53 +02:00
08b0c08577 Fix the rest of T68666: Animated mesh UVs, vertex colors don’t update on
time change

followup to 815ca2310f, this one fixes the RNA_MeshLoopColor case, adds
RNA_VertexGroupElement and RNA_LatticePoint.

coop with @sergey, thx.

Fixes T68666
2019-09-19 17:22:49 +02:00
2480c9236f Fix T69610: Outliner doesn't update for text new and unlink
Redraw the outliner when text data-blocks are created and unlinked. This
also fixes a crash when unlinking.
2019-09-19 09:14:27 -06:00
fb09d229dd Alembic: Fix compiler error on Windows
Error was introduced in 34143e4510.
2019-09-19 17:10:50 +02:00
b5702d9bc0 Fix T55403: Alembic: export of animated child hairs
The parent hairs were written to Alembic even when the 'Parent Particles'
checkbox (`use_parent_particles`) was disabled. In this case the parent
hairs were not correct in Blender's memory, and thus also not correct in
the exported Alembic file. The Alembic exporter now respects this setting
and doesn't write the parent hairs when 'Parent Particles' is off.
2019-09-19 16:59:10 +02:00
931d280af7 Fix buffer overflow using bbone segment interpolation
Do proper segment clamping to a proper value.

Thanks Brecht for pair-coding!
2019-09-19 16:55:14 +02:00
1bf0384111 Fix T70077: GPenci Controls points are not displayed in right location
The problem was the unit matrix was not set in the uniform variable.
2019-09-19 16:38:24 +02:00
d0c772f68b Fix T69853: Object orientation is wrong with some AMD deprecated drivers.
This solution only reuses the performance workaround made for Intel.
But the original problem was not solved.
Not much we can do to solve it.
2019-09-19 11:18:18 -03:00
cb5ed2e5f4 Manpage gen script: fix for python < 3.7, and missing Blender build info.
Python3.7 is still fairly recent, not all distro use it as system python
yet, fallback to code compatible up to py3.5.

Also, often distro builds of Blender do not have the buildinfo, in that
case fallback to `SOURCE_DATE_EPOCH` envvar, and as last resort to
current time, as in orig patch D5756 (we still use blender builddate
when available).

Issues raised in recent own rBcd5c70630318.
2019-09-19 15:57:33 +02:00
815ca2310f Fix part of T68666: Animated mesh UVs, vertex colors don’t update on time change 2019-09-19 15:56:02 +02:00
34143e4510 Fix T70070: Path always absolute when importing Alembic
Importing an Alembic file with a relative path is now also possible.
2019-09-19 15:55:19 +02:00
Julian Eisel
1353158aa2 Fix crash in local collections with excluded layer
Steps to reproduce were:
* Add a new collection
* Put an object into it
* Exclude the selection (the checkbox in front of the name)
* Enable "Local Collections" in any viewport
-> Crash

Did not skip the excluded collections, causing an unsuccessful object
lookup (returned null-pointer).
2019-09-19 15:42:48 +02:00
3c09e4d8cc Fix T69993: vertex instancing only works on original vertices
This behavior was accidentally changed in 3e6f37b9, now it works compatible
with 2.79 again.
2019-09-19 15:27:02 +02:00
3977854c70 Cleanup: rename anim::duration to anim::duration_in_frames
Units should be explicit, and not left to be guessed by the reader.

The field is only used in a single C file, so it's a relatively low-risk
change.
2019-09-19 15:26:17 +02:00
71f2229b0d Fix T68091: Adding a corrupt video crashes/confuses Blender
The problematic video from T68091 clearly has an invalid stream duration
(it would be 55 centuries long if interpreted at 30 FPS, and given that
it was recorded with an Android 9 device, it's unlikely that recording
started that long ago). I've added a heuristic to check the stream
duration against the container duration; if the stream is more than 4x
longer than the container, Blender now falls back to the container
duration.

We could use MIN(stream duration, container duration), but there might
be video files out there where the container duration is less precise
than the stream duration; they are measured in different units of time
(microseconds for the container vs. frames for the stream).

Includes a unit test for the above heuristic.

Reviewed by: jbakker

Differential revision: https://developer.blender.org/D5853
2019-09-19 15:12:53 +02:00
fba35aa8c5 Use FFmpeg's own av_guess_frame_rate() function instead of guessing ourselves
This was introduced in FFmpeg lavf 55.1.100 in 2013. For systems that are
still on LibAV or older FFmpeg there is a fallback implementation that
performs the same guess as we did before in `av_get_r_frame_rate_compat()`.
2019-09-19 15:12:53 +02:00
1e09dd094b Cleanup: don't index the same array multiple times
There is now a clearer distinction between `video_stream` (the stream itself)
and `video_stream_index` (its index), and no more repetition of accessing
the same item of an array. This also makes the code a bit more readable in
preparation for an upcoming functional change.
2019-09-19 15:12:53 +02:00
2f6a064765 Fix T70068: sculpt mode hide masked not working after show all 2019-09-19 14:40:33 +02:00
441f6cf020 Fix T64855: smooth view not working in Eevee rendered mode 2019-09-19 14:09:49 +02:00
8927d416f6 Fix missing 3D viewport solid shading mode request for UVs and vertex colors
This probably fixes no current issues, because there is another one causing
these to be computed unnecessarily.
2019-09-19 14:03:03 +02:00
87ebc4ef4f Fix T70060: Add bgl wrapper for glVertexAttribIPointer 2019-09-19 12:54:37 +02:00
745088cb30 userdef_defaults for 'Render In' and 'File Browser'
Otherwise --factory-startup would e.g render as `Keep User Interface`
(which is supposed to be `New Window` by default)

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5851
2019-09-19 12:07:24 +02:00
658d7eeed2 Clean-up/safety check in new BKE_mesh_copy_settings().
From rBe7a514369fe70, since I did not have time to do proper review
in D5808...

Note that we could also consider that shallow copy of src should never
be dst of that function and add some asserts instead. For now going the
safest and simplest way though.
2019-09-19 12:06:07 +02:00
7a78bc5d24 Cleanup: Spelling in comment 2019-09-19 11:51:25 +02:00
5e332fd700 Fix T67934: Weight paint doesn't work with Subsurf/Multires
This is a regression since PBVH was introduced for weight paint.

The solution is: treat subsurf and multires modifiers as deforming
ones for the weight painting. This is an easiest solution to make
PBVH use subdivided location of original vertices.

This change could simplify some of the weight paint by removing
the grids check, since PBVH is not supposed to be built from grids
in this case anymore.

Differential Revision: https://developer.blender.org/D5751
2019-09-19 11:51:25 +02:00
74d27bb0ef Subdiv: Add vertex deformation callback to multires/subsurf
Currently unused but the intention is to use this to hook up these
modifiers to a generic deformed PBVH to make it easier to sculpt or
paint on a subdivided mesh.
2019-09-19 11:51:25 +02:00
65d8c771c7 Subdiv: Add deformation-only subdivision
Is intended to be used to generate an array of coordinates of coarse vertices
placed to the final subdivided position.
2019-09-19 11:51:25 +02:00
b2333a3534 Subdiv: Cleanup, comments 2019-09-19 11:51:25 +02:00
659ccd9cd2 Fix T66154: viewlayer hide/exclude settings getting lost for linked collections
The problem was that the object and collection pointers in Base and
LayerCollection would get lost of file read. Normally such ID pointers would
be resolved by pointing to an ID_ID placeholder which has the datablock name,
and then replacing it will the real datablock. However ID_ID is only written
for directly linked datablocks.

This adds the concept of an indirectly linked datablock with a weak reference
to it. For this we write an ID_ID_WEAK_REF code, which is a reference that
will only be resolved if the datablock was read for another reason.

Differential Revision: https://developer.blender.org/D4416
2019-09-19 11:32:35 +02:00
e7a514369f Modifiers: every modifier now copies mesh settings, fixing texture space issues
Modifier stack evaluation would copy mesh settings other than mesh topology
automatically, outside of the individual modifier evaluation. This leads to hard
to understand code, and makes it unclear which settings are available in following
modifiers, and which only after the entire stack is evaluated.

Now every modifier is responsible to ensure the mesh it outputs preserves materials,
texture space and other settings, or alters them as needed.

Fixes T64739: incorrect texture space for various modifiers

Differential Revision: https://developer.blender.org/D5808
2019-09-19 11:32:35 +02:00
5516e52fad Fix QuadriFlow build error on FreeBSD and compiler warnings on Linux 2019-09-19 11:30:08 +02:00
6f4e595e9b Fix T68852: Link select crashes after knife project
Knife project switches out of vertex selection mode, but wouldnt do this
for all participating meshes.
Logic in edbm_select_linked_pick would switch the viewcontext multiple
times and the meshes selectmode was not in sync then, leading e.g.
finding a vertex in 'unified_findnearest' (because last of the meshes
selectmode was SCE_SELECT_VERTEX), but then later in
'EDBM_elem_from_selectmode' other meshes selectmode was not matching
SCE_SELECT_VERTEX, leading to crash...

Reviewers: campbellbarton

Maniphest Tasks: T68852

Differential Revision: https://developer.blender.org/D5536
2019-09-19 11:27:51 +02:00
1888990934 Cleanup: Remove redundant name checking
The BKE function already does this checking.
2019-09-19 11:23:57 +02:00
05de43d843 Fix T70009: GPencil copied layer is linked to its original layer
As the layer and frame memory was duplicated, the pointers were connected to old data. This was solved when saved the file, but this was a bug. Also this required a duplication and clean all listbase items.

Now, instead to duplicate and clear memory for layers and frames, just create a new layer and frame. This solution fix the problem, it's faster and also keeps the code cleaner.
2019-09-19 10:38:15 +02:00
4e9aadac5e Fix T70033: Crash editing keymap operator
Expanding operator names could buffer overrun.
2019-09-19 17:15:19 +10:00
86590b90aa Cleanup: use uint,ushort,uchar for modifiers 2019-09-19 13:33:44 +10:00
d8a7e5ee32 Cleanup: spelling 2019-09-19 13:19:53 +10:00
741d7d60ed Cleanup: Manpage: use 'https' blender.org URL instead of 'http' one. 2019-09-18 23:04:23 +02:00
cd5c706303 Blender manpage generator: use blender build date instead of current time.
It makes much more sense to use the build timestamp of the Blender
binary used to generate that manpage, than the current time.

As a bonus, when Blender building makes use of the SOURCE_DATE_EPOCH envvar
(through CMake, since previous commit), this also propagate automatically
to that man page.

Inspired by D5756 by Bernhard M. Wiedemann (@bmwiedemann), thanks.
2019-09-18 23:04:23 +02:00
Bernhard M. Wiedemann
ea6c9f17bd Use cmake TIMESTAMP for BUILD_DATE+TIME
Use cmake TIMESTAMP for BUILD_DATE+TIME
this simplifies code a lot
and even makes it more portable to other platforms

TIMESTAMP is available since cmake-2.8.11 ; blender already requires
cmake>=3.5 so that is fine.

Note that with CMake>=3.8, if defined, the SOURCE_DATE_EPOCH envvar
will be used by CMake here.

Reviewers: mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Differential Revision: https://developer.blender.org/D5760
2019-09-18 23:04:23 +02:00
6f7a64b57f GPencil: Create blank texture only once by engine
This texture is used for missing textures as replace.

Differential Revision: https://developer.blender.org/D5845
2019-09-18 20:55:38 +02:00
e7fde3a0f3 Fix transforming paint curve edit points also doing
ED_sculpt_end_transform in sculpt mode

followup to rB67310ed97618, thx @mano-wii for the heads up.
2019-09-18 19:58:42 +02:00
85acd72c9b Fix remesher operator poll function
This commit also removes the name "voxel" from the messages because this function
is now used for the voxel remesher and quadriflow.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5842
2019-09-18 19:45:58 +02:00
67310ed976 Fix T70006: crash when transforming paint curve edit points in sculpt mode
This was caused by rB309cd047ef46.
Above commit introduced code that would skip early for sculptmode
(leaving out the neccessary createTransPaintCurveVerts).

Reviewers: pablodp606, jbakker, mano-wii

Maniphest Tasks: T70006

Differential Revision: https://developer.blender.org/D5837
2019-09-18 19:27:47 +02:00
383c4ba3d8 Fix excessive dependency graph evaluation while painting strokes
Particularly noticeable when vertex painting with a subsurf modifier.

In some cases every sculpt or paint stroke step would evaluate the dependency
graph. This should only happen for redraws. Now more selectively choose if the
dependency graph should be evaluated to initialize the view context. Doing it
in the view context evaluation is somewhat hidden, now it's more explicit.

Differential Revision: https://developer.blender.org/D5844
2019-09-18 18:19:27 +02:00
3e230cecf0 Depsgraph: Cleanup, spelling in comment 2019-09-18 17:56:22 +02:00
296c03a389 Subvid: Initial support of subdiv topology query
Just some higher level functions to access topology information.
2019-09-18 17:56:22 +02:00
acf1c027ce Subdiv: Cleanup, split function into smaller ones 2019-09-18 17:56:22 +02:00
2409a9f0af BLI_tasks: simplify/generalize heuristic computing default chunk size.
That code is simpler and more general (not limited to some specific
values of thread numbers). It still gives similar default chunk size as
what we had before, but handles smoother increase steps, and higher
number of threads, by keeping increasing the chunk size.

No functional change expected from that commit.
2019-09-18 17:38:08 +02:00
84bd9e284e GPencil: Fix unreported error using Grab sculpt in empty frame
When the grab brush was used in an empty frame, a new frame was created, but as the depsgraph was no tagged, the evaluated data was wrong and the Grab hash failed.
2019-09-18 17:37:55 +02:00
77f1f13663 GPU: AMD: Remove workaround that doesn't work 2019-09-18 12:33:23 -03:00
f9beb1bef1 Fix (unreported) missing viewport update deleting a particle
If children hairs were displayed in particle editmode, these would not
update when a particle was deleted.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D5840
2019-09-18 17:19:33 +02:00
a9a8eedd16 Fix T65816: Alembic export of procedural mesh results in a static mesh and crashes
The static mesh issue described in T65816 has been resolved by @Sergey
in T60094.

This commit fixes the last bit of the puzzle, which was two-fold:
- A missing depsgraph update when setting `orig_object.data = new_mesh`
  from Python. Thanks @Sergey for providing the fix :)
- Properly locking the interface while exporting. This prevents crashes
  as described in T60094. The previous approach of calling
  `BKE_spacedata_draw_locks()` was not enough.
2019-09-18 17:08:33 +02:00
a1318d2415 Fix T69580: Smooth brush freezes on highpoly mesh
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5831
2019-09-18 16:40:58 +02:00
4dbea85a3f Fix preference for file browser and new window not being saved
The subversion should just be bumped for cases like this, it doesn't cost
anything and functioning correctly is most important.
2019-09-18 16:36:07 +02:00
6278ab59bc Revert "UI: Open file browser in fullscreen by default"
This reverts commit b962aca800. We may revert
to the fullscreen file browser if it's not good enough by the time of the 2.81
release. But then it first needs some changes since the in between state now
is not good enough either.
2019-09-18 16:36:07 +02:00
16a384b485 Fix T69984: Cursor curve Alpha doesn't display curves other than Custom
Reviewed By: jbakker

Maniphest Tasks: T69984

Differential Revision: https://developer.blender.org/D5823
2019-09-18 16:37:13 +02:00
04843d1572 Sculpt: Split original normal into original normal and plane
This allows to create different effects with some brushes that use the sculpt plane.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5818
2019-09-18 16:34:24 +02:00
Julian Eisel
b962aca800 UI: Open file browser in fullscreen by default
Fullscreen as in, maximized area.

This may be a temporary change until we consider the temporary window
mode as working well enough.
Note that you can still enable the windowed mode in the Preferences
(Interface > Editors > Temporary Windows).
2019-09-18 14:51:40 +02:00
Julian Eisel
f5bbaf55ac UI: Preference for file browser as fullscreen area
Addes a Preference setting to choose between opening new file browsers
in a maximized area (like with the old file browser) or in a new window
(like the new one).
2019-09-18 14:37:11 +02:00
Julian Eisel
cac756a92a UI: Move render display type to Preferences
Moves the render display type (to choose between rendering in a new
window, in a fullscreen area, in an Image Editor, etc) from the scene to
the preferences.
2019-09-18 14:32:21 +02:00
Julian Eisel
95373e2749 Refactor temp-space opening for optional fullscreen mode
Will be put to use in followup commits.
2019-09-18 14:22:50 +02:00
e2cbf8b117 Cleanup: minor changes to paint undo
Use a shared tile freeing function.
2019-09-18 18:49:53 +10:00
8c0dea72b6 Fix segfault when polling OBJECT_OT_voxel_remesh without active object
The active object can be `NULL`, which causes a segfault in
`BKE_object_is_in_editmode(NULL)` (and if that were made NULL-safe, the
segfault would happen further down in `object_remesh_poll()`).
2019-09-18 10:23:42 +02:00
dc6cec65af Cleanup: includes for readfile.c 2019-09-18 13:29:08 +10:00
OmarSquircleArt
9609840b5e Fix T69989: Correct Mapping node min/max versioning.
The old min/max options specified the target min/max values, they didn't
act as min/max operators. So the versioning code should be adjusted
accordingly.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5828
2019-09-17 21:54:09 +02:00
e13a2cde28 GPU: Comment incorrect asserts
These asserts are too simple and triggers false positive.
2019-09-17 19:56:43 +02:00
3009429c90 Fix T69809, T69810: sculpt gone or crashing after render
Make a distinction between flush sculpt changes for rendering, and forcing
sculpt data structures to be rebuilt after mesh changes. Also don't use PBVH
for renders.
2019-09-17 19:20:08 +02:00
884a385287 GPU: Fix broken assert 2019-09-17 16:22:11 +02:00
41d6d1463f Fix paint cursor crash
The new paint cursor (introduced in rBe0c792135adf) could crash for 2d
painting without an active object.

Note there are still drawing asserts (because we are mixing 2d and 3d
drawing in 'paint_draw_cursor'), but these will be handled in a seperate
commit.

part of T69957

Reviewers: jbakker

Maniphest Tasks: T69957

Differential Revision: https://developer.blender.org/D5820
2019-09-17 15:43:05 +02:00
3a08153d7a DRW: Refactor to support draw call batching
Reviewers: brecht

Differential Revision: D4997
2019-09-17 15:16:43 +02:00
41299bce93 Fix T69808: crash using custom Node.draw_label
Start happening after 9ecbd67dfb, but code was already wrong.
2019-09-17 15:12:14 +02:00
71803f2c94 Fix T69687: Edit Curve culling
Curve edit points could disappear when the deformed curve is out of view
area. Fix similar to rB0f983e854052.

Reviewers: jbakker

Maniphest Tasks: T69687

Differential Revision: https://developer.blender.org/D5748
2019-09-17 15:03:53 +02:00
fb39f1776f Fix enabled dynamic size in pose brush
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5816
2019-09-17 14:59:49 +02:00
0927e7b835 Sculpt: Rename pinch to magnify in some brushes
Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5815
2019-09-17 14:56:44 +02:00
54b690897e Fix topology automasking when starting from a boundary vertex
When starting automaking from a boundary vertex it was only updating the automasking factor in connected boundary vertices. This also fixes other similar functions like mask expand or dynamic mesh preview.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5812
2019-09-17 14:52:48 +02:00
58214ab52a Sculpt: Add pose origin preview to the Pose Brush
This commit makes the pose brush easier to control. It also includes a refactor of the pose brush init code.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5761
2019-09-17 14:46:45 +02:00
9be5a94cf3 Fix part of T69728: drawing glitches with sculpt dynamic mesh preview
Depth test must default to off for drawing outside the 3D viewport and
overlays like cursors.
2019-09-17 12:24:31 +02:00
398de6a86f Alembic: fix updating of GUI when export progress is made
The `do_update` variable wasn't set after changing the `progress`
variable, causing the GUI only to update on redraw (f.e. when the user
was waving the mouse around).
2019-09-17 14:10:47 +02:00
a3c8afc7cd Cleanup: Alembic: use pointers instead of references when passing progress variables
Using pointers instead of references when passing progress variables
makes the C++ code more in line with the C code (as it doesn't transform
pointer parameters to reference parameters). Also makes it easier to
spot when a common Blender pattern is implemented incorrectly (fix will
be in the next commit).
2019-09-17 14:09:42 +02:00
c25f5a375e Fix T61313: gravity not displayed correct when changing unit scale
Display of velocity and acceleration units should be affected by unit scale.
Arguably the behavior of the physics simulation should be for gravity to remain
constant, but such design changes are outside the scope of bug fixing. At least
the UI should correctly reflect what the physics simulation will do.
2019-09-17 13:43:00 +02:00
8f662e84e0 Fix T69716: Can't select geometry hidden by faces created by modifiers
This kind of reverts rBc060a835 that was committed without discussion.
2019-09-17 08:26:57 -03:00
6ee2d10005 Fix T69974: crashes in .blend files where 3D viewport was split
This was caused by a missing copy of the recently adding 3D viewport shading
ID properties.
2019-09-17 13:20:11 +02:00
df5fae1fcc Fix T69963: GPencil Hotkeys (1,2,3) do not work to switch Select Mode in Edit Mode 2019-09-17 13:07:29 +02:00
271c6794d6 Cycles: Viewport Rendering Memory Improvement
Small memory reduction change by only storing the pixels of the combined
pass when it is being shown in the viewport. Previously the combined pass
was always calculated and present in the output buffer. The combined pass
will still be calculated.

It is a limitation in Blender that Cycles always had a combined pass.
This patch will remove the limitation from the code base of Cycles.
Blender still has the limitation, but will always request the combined
renderpass when doing final rendering.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5784
2019-09-17 11:24:55 +02:00
11b0c2080c UI: use unique name for install add-on operator
Was called "Install", which isn't useful in operator search.
2019-09-17 18:18:50 +10:00
aca58ae970 Tracking: Early output when drawing 0 path points
The rumors says that immBegin() will assert fail on 0 count. Not sure where exactly
that happens (can't reproduce that), but early output can't hurt.
2019-09-17 09:31:21 +02:00
e40dc53c44 Fix T69960: Track path tries to draw negative point counts 2019-09-17 09:29:56 +02:00
2b1e0c038c Tracking: Restore check for marker being disabled
A regression since refactor from yesterday which made it so path is displayed at
a frame where marker is disabled.
2019-09-17 09:29:13 +02:00
bac3184540 Tracking: Use proper wrapper around line width and point size 2019-09-17 09:18:22 +02:00
76650402f3 Fix T69931: Materials with keyframes duplicated by 'make single user' are linked.
Another sneaky bite from the infamous private ID data: While those
monsters are not in bmain, the actions used by their animdata are
regular cute little ID's, living with the herd in the safe and sound
Main DB...

So we have to be careful not to propagate the nasty black magic
required to handle the formers when we duplicate their animdata.

Saying it again: private ID datablocks should never have had their own
animdata & actions, this is endless issue also with RNA paths... And
makes copying of animation between materials and such needlessly
complicated.
2019-09-16 23:02:38 +02:00
7a0ca9f98f Cleanup/sanitize a bit Action copying within BKE_animdata_copy().
Whole animdata copying code would need much more love, but we can as
well sanitize some pieces of it when we hit them, for now.
2019-09-16 23:02:38 +02:00
8b53445e8d Fix T69612: Two instances of Bridge Edge Loops entries in Edge Context Menu 2019-09-16 22:36:09 +02:00
Julian Eisel
28ee0f97c3 UI: Open file options region for more operations
Open the file options region for image saving, linking and appending.
2019-09-16 18:35:27 +02:00
Julian Eisel
8d6b0eda5d UI: Show in-/decrement buttons for exporters
As per Brecht's suggestion, use the check_existing property to control
visibility of the '+' and '-' icons. It is typically set for save
operations.

Adds another FileSelectParams flag (to avoid duplicated propertie
lookups) and removes the recently introduced
FileSelectParams.action_type again.

Fixes T69881.
2019-09-16 18:25:31 +02:00
3618b2c359 Fix part of T65397: accidentally assigning shortcuts gives errors
This is not a proper solution, that will come later, this avoids the main
problematic error for now.
2019-09-16 14:33:19 +02:00
39e760fa1d Fix eevee volumetrics distribution at 1.0
reported in T69662

Reviewers: fclem

Differential Revision: https://developer.blender.org/D5809
2019-09-16 13:16:25 +02:00
9d2c8aa3c4 Tracking: Refactor path drawing code
Split into set of smaller functions, making it easier to tweak behavior.

Should be no functional changes.
2019-09-16 12:54:48 +02:00
7b9093e768 Cleanup: Spelling in comment 2019-09-16 12:54:48 +02:00
Julian Eisel
af9ca138ba Fix T69755: 'Enter' over file name not working
Was breaking event handling at the wrong place.
2019-09-16 12:46:56 +02:00
94ecad5809 Cleanup: Use const variables 2019-09-16 10:51:25 +02:00
95b60634c7 GPencil: Enable subdiv for 2-point strokes.
It makes sense when adding points to a straight line, e.g. for creating thickness variation in later modifiers.
2019-09-16 10:40:32 +02:00
345fb22ea3 Fix T64238: Scene Full Copy: Cameras bound to markers does not update.
That's exactly why we should get rid of all those 'custom cases'
remapping code, it's hard enough to keep a single place
(library_query.c) up to date and 100% valid, but having more areas doing
their own remapping is just impossible to maintain... Some day...
2019-09-16 10:03:41 +02:00
330a37f389 Revert "PyAPI: expose OperatorType.modal_keymap"
This reverts commit b53ee963b1.

Full support for defining modal enums and access through events
is more involved, revert for now.
2019-09-16 16:42:25 +10:00
f97eb0e338 Cleanup: use fixed indent in Python
Reduce right-shift.
2019-09-16 16:17:46 +10:00
b53ee963b1 PyAPI: expose OperatorType.modal_keymap
Support assigning modal keymaps once the operator is registered.
2019-09-16 16:05:53 +10:00
6cb1e38c87 ImBuf Py API: add filepath access
D5804 by @cmbasnett with setter support added.
2019-09-16 10:39:24 +10:00
367ce71b47 ImBuf Py API: rename filename to filepath
Match RNA image naming.
2019-09-16 10:31:08 +10:00
b043bef000 Cleanup: quiet warning -Wparentheses 2019-09-16 04:34:31 +10:00
00319df9fc Fix bl_app_override keyword argument use
D5737 by @cmporces
2019-09-16 04:31:22 +10:00
4a6f43d47b UI: Add extra file browser icons
Desktop, External Drive & Network Drive

These were already in the icon sheet, but not added in the Blender side.
2019-09-15 19:12:54 +02:00
bdc94ef4b9 Fix T69883: Deleting keyframe crashes blender
When delete in multiframe node the active frame gets NULL.
2019-09-15 18:56:57 +02:00
8e62fdbcbd UI: Add XYZ mirroring to the Tool Settings viewport header for Edit and Weight Paint modes
Previously, only X mirror was available here, but since we can now mirror on Y and Z, these should also be added.
2019-09-15 15:43:30 +02:00
87c0179857 Industry Compat keymap: Use Ctrl/Cmd + Up/Left/Right for navigating the file browser in addition to Alt
Windows generally uses Alt, and Mac uses Cmd. This commit makes both possible.
2019-09-15 12:29:25 +02:00
55e02e7931 Fix T69877: missing dependency update when setting PoseBone.custom_shape. 2019-09-15 11:15:58 +03:00
c9048e8e41 Sequencer: disable fades add/remove until eval() use is removed
2ec025d7be introduced 'eval()' on blend
file data-paths which can be used for code injection.
2019-09-15 10:59:31 +10:00
e2df789c48 fix: (unreported) When converting nurbs or curves to Mesh the generated UVMap is now named 'UVMap' 2019-09-14 23:16:38 +02:00
e9c18ea982 Cleanup: redundant code from recent sequence fade operator
No need to define class variables which are all overwritten,
also use __slots__ to avoid mistakes.

Remove redundant length check too.
2019-09-15 05:57:59 +10:00
14c160334d Cleanup: remove duplicate information in docstring
No need to document all options in the doc-string
since each option has it's own description.
2019-09-15 05:43:34 +10:00
19fc50ca6f Cleanup: pep8, unused args, indentation 2019-09-15 05:35:42 +10:00
96ff40859d Cleanup: quiet unused arg warning 2019-09-15 05:26:15 +10:00
2743eaf24e Cleanup: pep8
Quiet pylint warnings on keymaps.
2019-09-15 05:18:05 +10:00
Stefan Werner
2b9f4bcfa0 macOS: Replaced deprecated Cocoa API calls.
Most of these calls were replaced with the successors as suggested
by Xcode's Fix-It. Functionality should not be affected.
This reduces the number of warnings when building on macOS.
2019-09-14 20:27:16 +02:00
Stefan Werner
9d282d7a8d macOS: Replaced OSSpinLock with os_unfair_lock.
OSSplinLock is a deprecated API, os_unfair_lock is its successor.
This reduces the number of warnings when building on macOS.
2019-09-14 20:23:29 +02:00
ea70bd2abf MSVC: Fix macro collision with MSVC Headers
Picked up while investigating a build error on the functions branch
which seems to use this specific header in a way master doesn't.

The problem:

The MSVC headers define a `_CONCAT` macro, so does BLI_kdtree_imp.h
however at the end `BLI_kdtree_imp.h` undefines the macro making the
MS headers that still rely on it "unhappy".

Who's fault is this:

Ours, C99 Spec says

```
7.1.3 Reserved identifiers

- All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.

...

if the program removes (with #undef) any macro definition of an identifier in the first
group listed above, the behavior is undefined.
```

So we should not have defined it, and we definitely should not
have undefined it.

We have *tons* of these violations, although fixing them would be great
at one point lots of them are in /extern or in the 3rd party deps,
I'd rather deal with them on a case by case basis when it actually
causes issues.

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

Reviewers: campbellbarton, JacquesLucke
2019-09-14 09:59:42 -06:00
5fe14f32cf Quiet self assignment warning 2019-09-14 17:00:19 +02:00
5055a55bc4 VSE: quiet missing prototype warnings 2019-09-14 16:54:59 +02:00
7aeedf71b8 UI: quiet warning when drawing markers
The compiler was warning that it assumed that
crfa - 4 < cfra is always true even though that might not
be the case due to overflow. This patch just removes
the condition that caused the assumption.
2019-09-14 16:52:56 +02:00
38cc53a168 BLI: make Map.add_or_modify more powerful
The function now allows custom return types defined
by the callbacks. This can be useful when a user of the
data structure has to implement some custom behavior.
2019-09-14 16:25:17 +02:00
d6057b919d BLI: add utility to print VectorSet stats 2019-09-14 15:03:25 +02:00
a98760f7da BLI: speedup adding to VectorSet by removing a check 2019-09-14 14:41:19 +02:00
5b00ecf70b BLI: remove non const accessors in VectorSet
With this the values could have been changed without
updating the hash table.
2019-09-14 13:30:24 +02:00
dd8a70c246 BLI: add missing include 2019-09-14 12:44:23 +02:00
e73030e336 BLI: rename SetVector to VectorSet
The structure is a set built on top of a vector and not the other
way around.
2019-09-14 12:37:58 +02:00
79e1165bd7 BLI: Improve forwarding semantics of some data structures
This makes it possible to use e.g. `std::unique_ptr` in a map.
2019-09-14 12:11:14 +02:00
Stefan Werner
ca76ecfa0e Cleanup: clang-format 2019-09-14 09:26:51 +02:00
2ec025d7be VSE: Add operators to add and remove fades
Fades add:
Adds or updates a fade animation for either visual or audio strips.
    Fade options:
    - In, Out, In and Out create a fade animation of the given duration from
    the start of the sequence, to the end of the sequence, or on boths sides
    - From playhead: the fade animation goes from the start of sequences under the playhead to the playhead
    - To playhead: the fade animation goes from the playhead to the end of sequences under the playhead
    By default, the duration of the fade is 1 second.

Fades clear:
Removes fade animation from selected sequences.
Removes opacity or volume animation on selected sequences and resets the
property to a value of 1.0. Works on all types of sequences.

Author: gdquest

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D5166
2019-09-13 17:24:42 -07:00
a960dc4519 BLF: make library glyph cache handling thread-safe
Functions that utilize glyph cache should lock and unlock cache by
calling `blf_glyph_cache_acquire()` and `blf_glyph_cache_release()`.
Function `blf_glyph_cache_acquire()` will create glyph cache, if it doesn't exist.
Locking mutex is global and shared by all fonts.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5701
2019-09-13 17:24:42 -07:00
ab3a9dc1ed VSE: prefetching
When enabled prefetching(preview panel>view settings), a pernament running job
is created, that will render frames in the background until the cache is full.
If the cache is not filled fast enough, prefetch job suspends itself
at the last moment and will wait until it has chance to "catch up".
Effectively this will decouple rendering to separate thread, so rendering
itself is a bit faster.
Cache recycling behavior will be changed to "free furthest frame to the left
of playhead if possible, otherwise rightmost frame".

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5386
2019-09-13 17:24:42 -07:00
0547a77536 Cleanup: use const args, variables 2019-09-14 08:12:53 +10:00
d30ec73d76 Cleanup: undeclared variable warnings, extra semicolon 2019-09-14 08:05:57 +10:00
1cdfc1d199 Fix T69857: image.load() API function does not load pixels
Broke after recent changes for DNA default initialization.
2019-09-13 23:07:08 +02:00
fd5c1972cd Revert "DRW: Refactor to support draw call batching"
This reverts commit ce34a6b0d7.
2019-09-13 23:03:10 +02:00
Stefan Werner
c80564ef9f macOS: Enabled posix_memalign() like on other Unix platforms. 2019-09-13 22:49:26 +02:00
57e0e520e8 Fix (unreported) 'smooth vertex colors' operator not respecting vertex
paint mask selection

followup to rBr27bbe7cbd9b, might as well make this consistent across
all the color operations [with the exception of 'Dirty Vertex Colors'
which is python]

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5786
2019-09-13 22:29:14 +02:00
89cc5c2bd3 Fix Particles: Keyed Physics crash when clicking on a particle slot
without a valid target

rB95b9680597f5 introduced code that would skip creation of GPUVertBuf
for ParticlePointCache if the keyed physics would not have a valid
target. Missing vertex buffer would lead to assert/crash.

This code is now removed (dont see a reason why this was done? afaict
2.79 also just displayed the particles without physics in this case and
this seems to be working just fine in 2.8 as well)

part of T69741

Reviewers: fclem

Maniphest Tasks: T69741

Differential Revision: https://developer.blender.org/D5781
2019-09-13 22:15:58 +02:00
Stefan Werner
2520f78971 Fixed macOS build, header cleanup was too agressive. 2019-09-13 21:29:05 +02:00
83e4991c16 Cleanup: unused headers for readfile, versioning 2019-09-14 05:21:25 +10:00
dc1f002fb7 Cleanup: unused headers for the windowmanager 2019-09-14 05:06:03 +10:00
5d4cbbb16c UI: don't mark batch rename as internal
Prevented it showing in operator search.
2019-09-14 02:39:58 +10:00
0ab550d8e0 UI: rename transform options
When added to quick-favourites, these names are used which
didn't make much sense out of the panel context.
2019-09-14 02:03:49 +10:00
Dalai Felinto
92736a7b75 Per-Viewport Collection Visibility
Support per-viewport collection visibility options.

Note 1: There is no way to show a collection that was not visible before
due to depsgraph. Otherwise we would risk having all the collections in
the depsgraph and I believe this is not the idea.

An alternative would be to have a new depsgraph for viewports that are
not local. Something to keep in mind if we do per-viewport current frame
in the future.

So for now what we do is to only allow collections visibility to be
disabled/hidden in this mode.

Note 2: hide_viewport (the eye icon) doesn't really matter for
depsgraph. So after the merge we can still ignore it to show the
collections locally in a viewport with no problems for the depsgraph.

Reviewers: brecht, sergey
Subscribers: billreynish

Related task: T61327
Differential Revision: https://developer.blender.org/D5611
2019-09-13 12:37:35 -03:00
ce34a6b0d7 DRW: Refactor to support draw call batching
Reviewers: brecht

Differential Revision: D4997
2019-09-13 17:32:18 +02:00
f7e8b58098 Fix BLI_bvhtree_overlap_ex assert 2019-09-13 12:19:54 -03:00
23a4149778 Fix "minimum twist" curve flipping issue
Correct the code to actually do what the comment says.
This fixes an issue where the curve would flip 180 degrees under certain
conditions.
2019-09-13 17:18:35 +02:00
6b0d1ef7e1 Cleanup: compiler warnings 2019-09-13 16:51:51 +02:00
27b82bbb75 Fix T69816: Using Transform gizmos in Sculpt Mode while MultiRes is activated crashes Blender
Reviewed By: jbakker

Maniphest Tasks: T69816

Differential Revision: https://developer.blender.org/D5779
2019-09-13 16:43:05 +02:00
f71d89bb04 Fix T69804: Transform tools in sculpt mode fails with transformed objects
Reviewed By: mano-wii

Maniphest Tasks: T69804

Differential Revision: https://developer.blender.org/D5777
2019-09-13 16:30:06 +02:00
0ec6564668 Cleanup: unused headers (GPU) 2019-09-14 00:22:24 +10:00
59f9c39f74 Fix T69846: Segment fault converting Curves to GPencil strokes
The problem was when the material slot had something, but the material was NULL.
2019-09-13 16:22:02 +02:00
d4fb850366 Fix T69829: Gpencil sample memory leaks. 2019-09-13 21:43:40 +08:00
Anthony Eriksson
77399283d4 Fix T69037: Automerge is greyed-out in popover
Split "use_mesh_automerge_and_split" and "double_threshold" into their
own column so .active doesn't have to be applied for the entire layout.

Reviewers: billreynish, mano-wii

Differential Revision: https://developer.blender.org/D5618
2019-09-13 09:29:50 -03:00
fcf94c772f UI: don't show decorators in Remesh panel 2019-09-13 14:06:41 +02:00
27bbe7cbd9 Fix vertex paint: color transform operators not respecting vertex paint
mask selection

for 'Invert', 'Levels', 'Hue saturation Value' and 'Bright/Contrast',
face mask was respected, but vertex mask wasnt...

Same code as done in 'Set Vertex Colors'.

reported in T69835

Reviewers: brecht

Maniphest Tasks: T69835

Differential Revision: https://developer.blender.org/D5783
2019-09-13 13:30:55 +02:00
cf858e7738 Cleanup: Use bool instead of int 2019-09-13 13:19:22 +02:00
f795bdbf21 Cleanup: use header guards 2019-09-13 21:12:43 +10:00
9e60e86057 Cleanup: clang-format 2019-09-13 21:12:43 +10:00
Joep Peters
95ef6dfa9e UI: use pageup/down and home/end to scroll to start/end of menus
Differential Revision: https://developer.blender.org/D5582
2019-09-13 13:06:06 +02:00
f7ee2348c0 Fix Particles Keyed Physics target UI greyed out
Picking the 'Target Object' as well as the 'System' number was greyed
out as long as 'Use Timing' was disabled. 'Use Timing' is unrelated for
the above two, these should always be active...

part of T69741

Reviewers: sergey

Maniphest Tasks: T69741

Differential Revision: https://developer.blender.org/D5782
2019-09-13 12:38:49 +02:00
f85ea4ae3c BLI: add non-const lookup methods for StringMap 2019-09-13 12:28:19 +02:00
08539312b2 BLI: add some missing methods to Map and SetVector 2019-09-13 12:10:40 +02:00
592a3d7b47 Tracking: Perform tracking and solving from a locked interface
Solves stability issues with possibly doing destructive changes to the
tracking setup. Locking interface is the simplest and most reliable way
to avoid crashes.

It is still possible to run non-destructive changes such as clip view
navigation. More operations can be marked as safe if needed.

Fixes T67012: Software closes when a processing marker is deleted
2019-09-13 11:59:34 +02:00
49c36d3430 Tracking: Move Lock Selection to an own operator
There are no functional changes as far as users are concerned,
just allows to mark operator as safe to be run from a locked
interface.
2019-09-13 11:59:34 +02:00
11b776d215 Tracking: Mark view operators as safe for locked interface 2019-09-13 11:59:34 +02:00
fa26012f51 Tracking: Cleanup, use bool type instead of int 2019-09-13 11:59:34 +02:00
a2b52dc571 Cycles: add Optix device backend
This uses hardware-accelerated raytracing on NVIDIA RTX graphics cards.

It is still currently experimental. Most features are supported, but a few
are still missing like baking, branched path tracing and using CPU memory.
https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Cycles#NVIDIA_RTX

For building with Optix support, the Optix SDK must be installed. See here for
build instructions:
https://wiki.blender.org/wiki/Building_Blender/CUDA

Differential Revision: https://developer.blender.org/D5363
2019-09-13 11:50:11 +02:00
53932f1f06 Cycles: add Optix support in the kernel
This adds all the kernel side changes for the Optix backend.

Ref D5363
2019-09-13 11:46:22 +02:00
7eb293a37b Build: output log file to tests/log.txt when running "make test" 2019-09-13 11:46:22 +02:00
577239d2ce GPencil: Fix unreported memory leak for weights
As the total of points was changed before free memory, if the total was lower than before, the remaining points were not released.
2019-09-13 11:18:48 +02:00
bb7c858598 BLI: make more integer type conversions explicit 2019-09-13 11:03:49 +02:00
394318da74 BLI: fix some integer conversions 2019-09-13 10:39:37 +02:00
57e55906f0 Add QuadriFlow remesher 2019-09-13 10:36:05 +02:00
1c44d08a69 BLI: new C++ hash table data structures
This commit adds some new hashing based data structures to blenlib.
All of them use open addressing with probing currently.
Furthermore, they support small object optimization, but it is not
customizable yet. I'll add support for this when necessary.
The following main data structures are included:

**Set**
A collection of values, where every value must exist at most once.
This is similar to a Python `set`.

**SetVector**
A combination of a Set and a Vector. It supports fast search for
elements and maintains insertion order when there are no deletes.
All elements are stored in a continuous array. So they can be
iterated over using a normal `ArrayRef`.

**Map**
A set of key-value-pairs, where every key must exist at most once.
This is similar to a Python `dict`.

**StringMap**
A special map for the case when the keys are strings. This case is
fairly common and allows for some optimizations. Most importantly,
many unnecessary allocations can be avoided by storing strings in
a single buffer. Furthermore, the interface of this class uses
`StringRef` to avoid unnecessary conversions.

This commit is a continuation of rB369d5e8ad2bb7.
2019-09-13 10:06:02 +02:00
8d12c2a836 UI: Fix Mask popover crumpled
Make popover wider and image ID widget full width, like in textures properties.
Not ideal but at least the image name can be read now, until the ID widget
gets a more compact redesign.

Fixes T67748
2019-09-13 00:20:59 +02:00
7137d1470a Docs: update link 2019-09-13 07:46:25 +10:00
bc109be34c Object Mode: don't use origin axis helpers for selection 2019-09-13 06:34:36 +10:00
b6838fd04f Revert "BLI: fix unregistering timer with same id twice"
This reverts commit a1d61c1c84.
Put by error
2019-09-12 22:23:07 +02:00
d7f594ae3a GPencil: New set of Brush icons
Added: Airbrush and Chisel
Changed: Marker

Design: @mendio

Subscribers: mendio

Differential Revision: https://developer.blender.org/D5774
2019-09-12 22:15:19 +02:00
a1d61c1c84 BLI: fix unregistering timer with same id twice 2019-09-12 22:14:23 +02:00
0672cc884c macOS fix typo on Frameworks dir 2019-09-12 23:13:52 +03:00
85a6c07670 macOS fix T67686 , use absolute path to load 3Dconnexion framework 2019-09-12 22:46:49 +03:00
6472662d66 Build: add "make test" command for Windows, output log file
Differential Revision: https://developer.blender.org/D5715
2019-09-12 20:23:03 +02:00
38d62a195b Fix build error on Windows 2019-09-12 19:58:11 +02:00
3062f341b3 BLI: fix illegal zero sized array 2019-09-12 18:46:31 +02:00
852c727073 Transform: AutoMerge & Split: Create and merge vertices at edge intersections
Differential Revision: D5635
2019-09-12 13:32:44 -03:00
ca5e1615a1 BMesh: New tool BM_mesh_intersect_edges
Along with the new utility `BM_vert_weld_linked_wire_edges_into_linked_faces`
2019-09-12 13:32:44 -03:00
f9ef59ccc8 BLIKdopBVH: New BLI_bvhtree_overlap_ex utility 2019-09-12 13:32:44 -03:00
5b2cebf49b Fix T69752: Texture paint sampling colors always 'merged down'
Rgression from rBaf4dcc6073fa.

paint_sample_color > imapaint_pick_face uses the the selection buffer
(DRW_select_buffer_sample_point) and to get flat colors [select_id_flat] we
need to be in SCE_SELECT_FACE mode. This was already fine if you had
'Face Selection Masking' turned on, but got colors including lighting
when turned of [select_id_uniform].

There was already an exception in 'select_cache_init' that turns on
SCE_SELECT_FACE for weightpaint, we just need this for texture paint
(vertex paint) as well... Also moved the logic into
select_id_get_object_select_mode.

Note we were also asserting here:
BLI_assert failed: /blender/source/blender/draw/engines/select/
select_engine.c:174, select_cache_init(), at 'e_data.context.select_mode
!= 0'

Note also this is not working correctly for vertexpaint (yet), but has
been discussed in T69752 and there is a solution by @mano-wii in P1032.

Reviewers: mano-wii

Subscribers: mano-wii

Maniphest Tasks: T69752

Differential Revision: https://developer.blender.org/D5775
2019-09-12 18:23:36 +02:00
OmarSquircleArt
2ea82e86ca Shading: Add Vertex Color node.
This patch adds a new Vertex Color node. The node also returns the alpha
of the vertex color layer as an output.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5767
2019-09-12 17:42:13 +02:00
f80018b5f7 Fix: missing atomic include 2019-09-12 17:03:03 +02:00
058d218254 BLI: new StringRef and StringRefNull data structures
These two data structures reference strings somewhere in memory.
They do not own the referenced string. The string is considered
const.

A string referenced by StringRefNull can be expected to be
null-terminated. That is not the case for StringRef.

This commit is a continuation of rB369d5e8ad2bb7c2.
2019-09-12 16:55:35 +02:00
Julian Eisel
914f4308fb Fix T69791: Fix crash reading old file browser in temporary window
When reading a old .blend file (from before the new file browser
design), we wouldn't create the execute region for existing file
editors. This usually wasn't an issue, but it could become one when a
file browser was opened in a temporary screen before, and that screen
was still visible. Then code spawning the new file browser would re-use
the old file browser data, assuming the execute region was there.

Handle this in versioning code and let rest of the code keep sane
assumtions (e.g. that there always is a execute region, even if
invisible).
2019-09-12 16:36:07 +02:00
52b32fde18 GPencil: Add Simplify panel to Workbench engine 2019-09-12 16:21:34 +02:00
78496331f5 GPencil: Fix missing Simplify panel in Cycles
Differential Revision: https://developer.blender.org/D5776
2019-09-12 16:21:34 +02:00
c40171c60d Themes: Update Blender Light theme.
Fixes T69531
2019-09-12 16:08:58 +02:00
2e10cb02fb UI: Two-column layout for User Interface theme settings.
Group related settings in columns:
* Align Inner, Inner Selected and Outline.
* Align Text, Text Selected and Item.

Place Shaded settings in its own sub-panel.
2019-09-12 16:08:58 +02:00
c168092014 Fix T69792: Auto-merge split faces creates faces with unrelated wire edges. 2019-09-12 10:58:18 -03:00
62c820cdaa UI: avoid using parenthesis
Convention is not to use parenthesis,
Details are included in tool-tip.
2019-09-12 22:53:29 +10:00
c6221f5ce4 BLI: fix unregistering timer with same id twice 2019-09-12 14:44:33 +02:00
369d5e8ad2 BLI: new C++ ArrayRef, Vector, Stack, ... data structures
Many generic C++ data structures have been developed in the
functions branch. This commit merges a first chunk of them into
master. The following new data structures are included:

Array: Owns a memory buffer with a fixed size. It is different
  from std::array in that the size is not part of the type.

ArrayRef: References an array owned by someone else. All elements
  in the referenced array are considered to be const. This should
  be the preferred parameter type for functions that take arrays
  as input.

MutableArrayRef: References an array owned by someone else. The
  elements in the referenced array can be changed.

IndexRange: Specifies a continuous range of integers with a start
  and end index.

IntrusiveListBaseWrapper: A utility class that allows iterating
  over ListBase instances where the prev and next pointer are
  stored in the objects directly.

Stack: A stack implemented on top of a vector.

Vector: An array that can grow dynamically.

Allocators: Three allocator types are included that can be used
  by the container types to support different use cases.

The Stack and Vector support small object optimization. So when
the amount of elements in them is below a certain threshold, no
memory allocation is performed.

Additionally, most methods have unit tests.

I'm merging this without normal code review, after I checked the
code roughly with Sergey, and after we talked about it with Brecht.
2019-09-12 14:23:21 +02:00
1954723635 Cycles: Fix Show Instanced Local View Objects
The local view check in the RNA didn't support instanced objects. Every
object has a copy of the local_view_bits from the base. This patch
changes the check to look at the local stored bits.

This patch removes the check if the object is part of the view_layer.
In the cases we are using it this check is not relevant. The `mesh_tissue`
add-on also uses it, and is not effected by this change.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5773
2019-09-12 13:33:46 +02:00
OmarSquircleArt
613b37bc2c Shading: Add More Features To The Voronoi Node.
This patch allows the Voronoi node to operate in 1D, 2D, and 4D space.
It also adds a Randomness input to control the randomness of the texture.
Additionally, it adds three new modes of operation:

- Smooth F1: A smooth version of F1 Voronoi with no discontinuities.
- Distance To Edge: Returns the distance to the edges of the cells.
- N-Sphere Radius: Returns the radius of the n-sphere inscribed in
the cells. In other words, it is half the distance between the
closest feature point and the feature point closest to it.

And it removes the following three modes of operation:

- F3.
- F4.
- Cracks.

The Distance metric is now called Euclidean, and it computes the actual
euclidean distance as opposed to the old method of computing the squared
euclidean distance.

This breaks backward compatibility in many ways, including the base case.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5743
2019-09-12 13:09:31 +02:00
0137509476 Fix T69789: Assert when create a new Full Copy scene base on 2D template.
Private ID data (nodetrees and scene collections...) need special care
and handling of their copy flags, and checks must be adapted too.

In that case, issue came from the fact that even though those IDs have
to be copied outside of bmain, we may still require usercount handling.

That commit also fixes a somewhat related issue - we cannot use the
non-id private data copying flag for private IDs copying, due to
difference in handling of usercount again.
2019-09-12 12:27:39 +02:00
4df75063e1 UI: Sub-type for Screen Grab Size.
Set to Pixel.
2019-09-12 12:23:51 +02:00
1885246015 UI: Wrong label in Screen Grab Size.
It was using "screen_grab_size" as label.
2019-09-12 12:23:51 +02:00
b6027b4efd UI: Labels capitalization.
Capitalize the first letter of a word, except articles and prepositions.
2019-09-12 12:23:51 +02:00
492a7998d5 Fix T69785: crash dragging in empty space in edit mode 2019-09-12 11:34:42 +02:00
9fa8614b32 Cleanup: compiler warnings 2019-09-12 11:34:42 +02:00
2cec4af124 Fix T69582: Empties no longer support Rigid Body Constraints
This is caused by rB1342d1879e12 and would also break the whole
"Connect" workflow [which relies on empties]

Reviewers: mont29, brecht

Maniphest Tasks: T69582

Differential Revision: https://developer.blender.org/D5772
2019-09-12 11:24:23 +02:00
bbae7874c0 Fix T69782: crash using gizmos in grease pencil edit mode 2019-09-12 11:14:44 +02:00
a22c2ceb0f Cleanup: line breaks with comments 2019-09-12 18:59:44 +10:00
1e2f2f27e9 Fix crash when doing cycles rendering
During F-12 Rendering the passed screen was Null, but decoded as a
number. In stead of a Null a 0 will be send to cycles python wrapper.
2019-09-12 10:25:39 +02:00
861697c9e5 Cycles: Initial Support For Local View
This diff will add support for local view to Cycles rendered preview mode.

Currently the implementation shows same results as EEVEE does. This entails
a difference with Blender 2.79, where lights were automatically added to the
local view. {T69780} describes this should be solved before the next release.

This patch also solves missing `owner_id` issues when using the RNA CPP Api
from Cycles. Cycles didn't provide the `owner_id` making some functionality
fail, what then was worked around in Blender. It also fixes an issue in
`makesrna` where incorrect CPP code was generated when only `PARM_RNAPTR`
was provided.

An optional `view_layer` parameter is added to the `Object.local_view_get`
method to reduce lookups.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5753
2019-09-12 09:08:22 +02:00
70a9347705 Fix T69737: Crash using the Elastic Deform brush and Compressibility
Also renamed "compressibility" to "volume preservation"

Reviewed By: brecht

Maniphest Tasks: T69737

Differential Revision: https://developer.blender.org/D5757
2019-09-12 03:55:53 +02:00
1e375ab5a1 3D View: only show origin axes when in object mode 2019-09-12 07:31:46 +10:00
32b49f9e9f Fix transforming armature origins
Using geometry update doesn't work on armatures.
2019-09-12 07:28:49 +10:00
62ffc0c2c9 DNA: use defaults for SceneEEVEE 2019-09-12 06:53:25 +10:00
ff085e85d3 DNA: move View3D, View3DOverlay into DNA_view3d_defaults.h 2019-09-12 06:48:13 +10:00
6db00065c5 Cleanup: remove redundant RNA defaults
These are now set from DNA defaults.
2019-09-12 06:25:32 +10:00
9a076dd95a DNA: defaults for ID types 2019-09-12 04:58:09 +10:00
2f08a25d83 Cleanup: Warning: 'sld': local variable is initialized but not referenced 2019-09-11 15:22:00 -03:00
3bd4f229be Transform: Edit Mesh: Support mirror on all axes
Part of T68930

Now two other mirror options that can be enabled simultaneously: Mirror Y and Z.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Subscribers: ThatAsherGuy

Differential Revision: https://developer.blender.org/D5720
2019-09-11 13:49:18 -03:00
OmarSquircleArt
003802db83 Cycles: Ignore links with unavailable sockets.
Ignore links with unavailable/disabled sockets during shader graph
generation.
2019-09-11 18:32:50 +02:00
6d85280ec3 Fix T69458: Edit Mesh selection bug from camera view 2019-09-11 13:06:28 -03:00
7e245e482c Fix T59143: Frame Selected Doesn't work in hair particle editmode
This is caused by rBeb521b22b2b1.

Looks like `PE_minmax` doesnt play nice with the evaluated view_layer.
If we look inside `PE_get_current`, then `BKE_ptcache_ids_from_object`
will actually return a list of `PTCacheID` for the evaluated object.
However, looking further, then `PTCacheEdit` / `psys->pointcache->edit`
is always NULL for the evaluated object.

Without a valid `PTCacheEdit`, `PE_minmax` will basically do nothing.
So now we are passing the non-evaluated view layer in the case of
particles.

Regarding to @sergey, in a longer term we should probably make it so
evaluated pointcache have pointer to edit.

Reviewers: sergey

Maniphest Tasks: T59143

Differential Revision: https://developer.blender.org/D5758
2019-09-11 18:01:45 +02:00
30aa67d5d5 Fix T69558: crash in BKE_scene_update_sound for a soundstrip without
linked sound

Crash could be triggered by just adding any object to the scene.

Reviewers: sergey

Maniphest Tasks: T69558

Differential Revision: https://developer.blender.org/D5764
2019-09-11 17:47:58 +02:00
d84d49280b Fix T69722: Pose brush crashes with multires modifier
Reviewed By: brecht

Maniphest Tasks: T69722

Differential Revision: https://developer.blender.org/D5759
2019-09-11 17:42:58 +02:00
ee734dcc73 Fix T69754: crash in sculpting after library overrides were enabled
The rest of this function uses G_MAIN, so do the same.
2019-09-11 17:32:44 +02:00
6283b5b817 UI: move transform settings from pivot to options panel
These weren't related to pivot, so add in a new options panel.
2019-09-12 00:52:46 +10:00
5f47adc0f7 UI: enable topbar by default
This lets us add settings to the options panel without them being
hidden from the user.
2019-09-12 00:52:46 +10:00
4665a08873 Python: Fix to support old-style handlers
Can not re-use single typle even if there is a single input pointer:
the all-arguments-typle consists of 2 elements.
2019-09-11 15:53:36 +02:00
fc16cf8d2d LibOverride: Enable them in UI by default.
This is minimal 'flip-switch' commit, proper cleanup and removal of the
option thing will happen later, once we are sure that we can release
2.81 with it enabled.

For now, we have a `--disable-library-override` now. ;)
2019-09-11 15:19:14 +02:00
e0ca19152f DNA: initialize defaults for output paths 2019-09-11 22:21:39 +10:00
0c2a314443 RNA: automatically initialize defaults from DNA
Use defaults from DNA_*_defaults.h headers, this avoids calling
RNA_def_property_*_default explicitly & having to repeat values.
2019-09-11 22:21:13 +10:00
a941e9de89 DNA: make DNA_elem_size_nr a public function
Needed for getting struct member offsets.
2019-09-11 22:20:36 +10:00
3f5c54575f RNA: separate internal allocation function 2019-09-11 22:16:36 +10:00
309cd047ef Sculpt: Transform tool
The sculpt mode transform tool applies the sculpt pivot transformation to all vertices, taking XYZ symmetry into account.
This commit also includes an operator to set the pivot point initial position.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5717
2019-09-11 13:07:19 +02:00
ef18b672f5 GPencil: New Brush postprocesing Simplify
This option allows to apply a simplify when the stroke is completed. The simplify use the Adaptive option to keep the shape.
2019-09-11 12:28:23 +02:00
7e61e59725 Cycles: Display RenderPass in Viewport
This change allows the user to select a renderpass in the 3d viewport.

Added support for external renderers to extend the `View3DShading` struct.
This way Blender doesn't need to know the features an external render engine wants to support.
Note that the View3DShading is also available in the scene->display.shading; although this is
supported, it does not make sense for render engines to put something here as it is really
scene/workbench related.

Currently cycles assumes that it always needs to calculate the combined pass; it ignores the
`pass_flag` in KernelFilm. We could optimize this but that was not in scope of this change

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5689
2019-09-11 12:19:44 +02:00
d4f8bc80a4 Armature: convert the length Python property of bones to a RNA property.
This allows accessing it from drivers and using it in UI, as
demonstrated by adding it to the transform panel of 3D View.

As an aside, properly mark transform-related properties of Bone
read-only, as they can only be changed correctly in edit mode.
2019-09-11 12:49:04 +03:00
Julian Eisel
69e0f485c9 Fix T69736: Flipping bookmarks region empties it 2019-09-11 11:39:58 +02:00
9bb6058489 Cleanup: typo/spelling 2019-09-11 11:29:45 +02:00
f7fce00297 Depsgraph: Allow non-keyed changes from frame_change_post handler
Makes it possible to do custom edits to animated properties from a
python handler.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5738
2019-09-11 10:43:27 +02:00
ea513a97f5 Render: Only run callbacks for non-preview renders
Those handlers are usually done to edit scene which is being rendered,
and this is not supported due to a fully localized nature of the preview
bmain.

There is still non-conditional callback in stats_background which is a
bit tricky to cover with check, but this code is not supposed to be run
for previews anyway.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5731
2019-09-11 10:43:27 +02:00
a650258158 Python handlers: Pass depsgraph to events where it makes sense
The goal is to make it possible to access evaluated datablocks at a
corresponding context. For example, be able to check evaluated state
if an object used for rendering.

Allows to write scripts in a safe manner for T63548 and T60094.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5726
2019-09-11 10:43:27 +02:00
022de797f1 Depsgraph: Introduce depsgraph registry
Allows to access dependency graphs created for render engines
to inform them about changes in .blend file structure from the
Python handlers.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5724
2019-09-11 10:43:27 +02:00
73a199e96a Depsgraph: Pass bmain to depsgraph object creation
Currently unused, but will allow to keep of an owner of the depsgraph.

Could also simplify other APIs in the future by avoiding to pass bmain
explicitly to relation update functions and things like that.
2019-09-11 10:43:27 +02:00
559df2fed9 Transform: Snap: Fix mixed snap without edge
Face snapping was disregarded when approaching an edge.
2019-09-10 22:09:05 -03:00
4ce3fbd52a UI: File Browser Friendly Volume Descriptions
File Browser Volumes list gets nicer friendly drive names with volume label or device description.

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

Reviewed by Brecht Van Lommel
2019-09-10 15:12:42 -07:00
fa12428ede Fix T69729: Missing Direction buttons in Draw Sharp brush
Reviewed By: brecht

Maniphest Tasks: T69729

Differential Revision: https://developer.blender.org/D5746
2019-09-10 22:05:12 +02:00
f1b52ef211 EEVEE: Volume: Fix error in fallback integration algo 2019-09-10 21:59:33 +02:00
caf494444c EEVEE: Volume: Speedup: Use Image load store extension
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5740
2019-09-10 21:59:16 +02:00
Julian Eisel
42c062c98a UI: File browser deselect on click on empty space
For the default and industry compatible keymap, clicking on empty space
in the file browser will deselect all files.

Also makes selection use same operator description we use for other
select operators.
2019-09-10 18:40:31 +02:00
01a3a9c818 Fix SDNA error expanding names not updating name array sizes
This doesn't cause problems at the moment,
it just makes using name sizes possible in the future.
2019-09-11 01:51:15 +10:00
2f4153396c Cleanup: no need to add Brush.flag2
Also use 'use_' prefix for RNA booleans.
2019-09-11 01:51:15 +10:00
5ba0726bc1 GPencil: Deduplicate function
The same code was duplicated and now it was moved to shared function.
2019-09-10 17:49:27 +02:00
841df2b98e Fix T69723: Crash with mask expand operator while in rendered or material view
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5745
2019-09-10 17:45:41 +02:00
0174185e2f GPencil: New Simplify Tint option
This is useful to disable all layers tint in one step and it will be used for future operators.
2019-09-10 17:41:23 +02:00
8f55794c0e UI: File Browser Custom Folder Color
Allows file browser folders to be shown in a theme-selectable color, default of manila.

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

Reviewed by Brecht Van Lommel
2019-09-10 08:07:39 -07:00
a3e7440cfd Sculpt: Grab Active Vertex and Dynamic Mesh Preview
Grab active vertex snaps the maximum strength of the grab brush to the highlighted active vertex, making it easier to manipulate low poly models or meshes with subdivision surfaces.
Dynamic Mesh Preview generates a list of connected vertices from the active vertex and draws them from the cursor code. This helps to visualize the real geometry the user is manipulating from sculpt mode when there are active modifiers.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5646
2019-09-10 16:24:09 +02:00
e0f7ada0d2 Fix warning and naming in mask expand
Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5742
2019-09-10 15:53:02 +02:00
a13b1b18de Fix T69702: crash using particles rendered as whole collection
This happened when the 'Whole Collection' option was enabled next to the
'Use Count' option. These two are exclusive but some code paths only
checked for 'Use Count'.

Reviewers: brecht

Maniphest Tasks: T69702

Differential Revision: https://developer.blender.org/D5741
2019-09-10 15:39:38 +02:00
cfb3011e52 Sculpt: Mask Extract operator
This operator extracts the paint mask to a new mesh object. It can extract the paint mask creating a boundary loop in the geometry, making it ready for adding a subdivision surface modifier.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5384
2019-09-10 15:19:48 +02:00
0083c96125 Sculpt: Mask Expand operator
This operator is a combined version of mask expand and mask by normal from the sculpt branch. It can be used to quickly isolate parts of a model based on topology or curvature.
- Shift + A starts the operator in topology mode from the active vertex
- Shift + Alt + A starts the operator in curvature mode from the active vertex

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5657
2019-09-10 15:13:37 +02:00
ef47c99fcb Fix T69651: Inpaint node distance parameter: Default value does not match minimum value
probably makes sense to allow for zero iterations...

Reviewers: jbakker

Maniphest Tasks: T69651

Differential Revision: https://developer.blender.org/D5728
2019-09-10 13:35:49 +02:00
b2b52c6c91 Fix T69432: Hair particle editmode: hiding not working
PTCacheEditPoint flag PEP_HIDE was not respected at all...

Reviewers: brecht

Maniphest Tasks: T69432

Differential Revision: https://developer.blender.org/D5739
2019-09-10 13:15:29 +02:00
df8341a486 Python: don't include distutils Windows installer executables for Linux/macOS
They were detected as (false positive) malware with ClamAV. It's unlikely
someone would need these files, and e.g. the Debian Python package also
excludes them with a custom patch.
2019-09-10 12:44:52 +02:00
bf6e05562c Fix assert hiding selected particles
was trying to get a boolean with RNA_enum_get (instead of
RNA_boolean_get)

Spotted while looking into T69680, T69432
2019-09-10 11:31:40 +02:00
3e81c1c1d5 Fix (unreported) crash after new mapping node commit.
Blatant obvious usage of freed memory in rBbaaa89a0bc54.

And also fix a memleak in same code/commit...
2019-09-09 22:20:32 +02:00
c8c3e7d284 Cleanup: trailing space, remove tabs, pep8 2019-09-10 06:17:59 +10:00
51334dd3a6 Fix T69686: Cycles OpenCL build error after recent changes 2019-09-09 22:11:23 +02:00
0426866eb0 Fix T67637: Selected edges hard to see with wireframe
Always show selected edges in wire/xray modes.
2019-09-10 05:59:50 +10:00
OmarSquircleArt
f2176b3ff3 Shading: Extend Musgrave node to other dimensions.
This patch extends Musgrave noise to operate in 1D, 2D, 3D, and 4D
space. The Color output was also removed because it was identical
to the Fac output.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5566
2019-09-09 21:06:55 +02:00
c2d37929b4 Fix T69633: weird behavior of operator_menu_enum tooltips.
For operators with dynamic tooltips the tooltip calculation is
deferred until the moment it is actually shown for performance
reasons, with the tooltip field left blank for the time being.
Enum menu code shouldn't jump in and assign a tooltip either.

The menu button itself can't show a dynamic tooltip because it
does not actually call the operator, and has no reference to it.

As a side change, allow returning None from the python callback
as the most natural way to fall back to the default tooltip.
2019-09-09 21:13:34 +03:00
ee9fb174f4 Added function to calculate the total area of a mesh. 2019-09-09 19:41:12 +02:00
9f859528e9 DNA: use defaults for Object, Mesh, Material 2019-09-10 03:27:27 +10:00
b24fdaed65 DNA: add theme & preferences to defaults
Use existing theme & preferences for defaults.
2019-09-10 03:27:27 +10:00
6be3348505 Cleanup: fix compiler warnings 2019-09-09 19:22:54 +02:00
828ef61cd1 Fix crashing mask brush after recent changes 2019-09-09 19:19:59 +02:00
8594cdb456 Fix build error after DNA defaults changing
dna_type_offsets.h must be generated before we use it in blenkernel,
similar to what we already do for blenloader.
2019-09-09 19:09:13 +02:00
bfbee87831 Sculpt: Pose Brush
This brush lets the user pose a model simulating an armature-like deformation. The pivot point for rotation is calculated automatically based on the radius of the brush and the topology of the model.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5647
2019-09-09 17:55:16 +02:00
55245ed6ad Fix (unreported) non-official X3D add-on enabled in factory startup.
Forgot to remove it from there when I moved it to community-supported
status last week.

Also raising subversion.
2019-09-09 17:42:44 +02:00
22d157d469 I18n: dirty workaround for PITA ghost classes remaining after unregister.
Spent again a whole day trying to understand what happens here, with no
luck. For some reasons, OperatorProperties children of unregistered
operator classes remain accessible, with their `bl_rna` member, although
that one is 100% invalid (freed memory, crashes with ASAN builds).

Funny thing is, I cannot reproduce that situation when disabling the
add-on from the py console of a Blender-with-UI.

Note: issue revealed by X3D add-on, which is still enabled in factory
settings, while not being officially supported any more, this has to be
fixed in a separate commit.
2019-09-09 17:42:44 +02:00
e781e9565d UI: Format Memory Strings in Binary
Show all memory-related byte size strings calculated with a base of 1024.

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

Reviewed by Brecht Van Lommel
2019-09-09 08:38:01 -07:00
6d4b311888 UI: File Browser Sizes in Binary for Windows
This adds per-platform change so Windows users will see file sizes calculated with a base of 1024.

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

Reviewed by Brecht Van Lommel
2019-09-09 08:29:21 -07:00
2b2739724e Sculpt: Topology automasking
The sculpt automasking feature assigns a factor to each vertex before starting the stroke. This can be used for isolating disconnected meshes, masking cavities, mesh boundary edges or creating topological falloffs.

This commit implements automasking in all brushes and topology automasking without topology falloff.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5645
2019-09-09 17:02:04 +02:00
5fe83ffb3a Cleanup: unused functions 2019-09-10 00:42:04 +10:00
Julian Eisel
2aa3e9c67c UI: Add superimposed + and - icons for file number
Brings back + and - icons to the file name button, but now as
superimposed icons.
2019-09-09 16:37:47 +02:00
Julian Eisel
828905190e UI: Refactor and improve buttton extra icons
Without this patch there could only be one superimposed icon
and the operators were hard coded for the button types.
This keeps the previous, sort of predefined extra icons working in a
rather generic way, but allows adding specific ones for specific case
through `UI_but_extra_operator_icon_set()`.

Reviewed by: Campbell Barton

Differential Revision: https://developer.blender.org/D5730
2019-09-09 16:37:47 +02:00
9b6233b27c Partial revert "Edit Mesh: Change color behavior"
Using a lighter color for faces than edges makes edges hard to see
in wire-frame display mode. See T67637.

This partially reverts commit 203f9a49e2.
2019-09-10 00:33:31 +10:00
2541d03917 Fix T69382: Crash - Regression - GPU Intel HD 4000
Workarounds were not being enabled for drivers like `10.18.10.5069`.
2019-09-09 11:32:32 -03:00
13206a6dc0 Sculpt: Mask Filter and Dirty Mask generator
The mask filter operator modifies the whole paint mask. In includes multiple operations like smooth, grow or contrast accessible from a pie menu.
The dirty mask generator is similar to Dirty Vertex Colors, but it generates a paint mask. It can be used to mask cavities in the sculpt.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5496
2019-09-09 16:30:12 +02:00
87c7135da5 Cleanup: GPencil small improvements in comparison
As the function `gpencil_onion_active()` has a loop, if some condition is false before we can avoid the loop.
2019-09-09 16:25:44 +02:00
bb8d859a68 GPencil: Fix unreported problem when main Onion switch is disabled
The main switch was not checked and the function was doing all calculations, but the data was not used. This makes all slower than expected because the user had the Onion Skinning disabled, but internally was running.
2019-09-09 16:20:40 +02:00
3d2b0c9b40 Cleanup: expand tabs 2019-09-10 00:04:02 +10:00
e22bae15aa Cleanup: missing break & shadowing warnings 2019-09-10 00:04:02 +10:00
6a4df70d41 Sculpt: Mesh Filter Tool
The mesh filter tool applies a deformation to all vertices in the mesh at the same time. It includes multiple deformation modes and the option to lock the deformation axis.
This commit also includes the FilterCache, which is needed in some new operators and tools.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5513
2019-09-09 15:50:17 +02:00
97a5f961c4 Fix compiler error in Windows introduced in 322c03f13c 2019-09-09 15:45:48 +02:00
74dcfaf172 GPencil: Fade layer using background color
Now the fade layer uses the same logic used to fade objects and also is available in all modes.

Reviewers: mendio, pepeland

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D5707
2019-09-09 15:41:11 +02:00
70c1aaf59b Sculpt: Elastic Deform Brush
This patch implements the paper "Regularized Kelvinlets: Sculpting Brushes based on Fundamental Solutions of Elasticity" https://graphics.pixar.com/library/Kelvinlets/paper.pdf

It includes grab, biscale grab, triscale grab, scale and twist.
All deformation modes are accessible under the same tool. This helps to keep the code organized and it should not make any difference to the user when a better brush management system is implemented.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5634
2019-09-09 15:34:25 +02:00
8127bbbe39 Cleanup: clang-format 2019-09-09 15:23:00 +02:00
5d9c01c53f Fix T69663: 2.81 Cant open/append/link a blend file but 2.8 can
Was a problem in the versioning code from rBbaaa89a0bc54, since the
TexMapping struct could already be freed and node->storage could already
be set to NULL (if a file with the new mapping node [saved from (2, 81,
8) or newer] is opened in a blender version prior to (2, 81, 8) and
saved from there again).

Reviewers: brecht

Maniphest Tasks: T69663

Differential Revision: https://developer.blender.org/D5723
2019-09-09 15:19:12 +02:00
f5e0dfe59c DNA: initial DNA defaults support
This provides an API to access structs
with their members set to default values:

- DNA_struct_default_get(name)
- DNA_struct_default_alloc(name)

Currently this is only used for scene & view shading initialization,
eventually it can be used for RNA defaults and initializing
DNA struct members on file reading.
2019-09-09 23:17:03 +10:00
e164afe9b5 GPencil: Change Arrange Strokes menu order
Before: Bring Forward, Send Backward, Bring to Front, Send to Back.

After: Bring to Front, Bring Forward, Send Backward,  Send to Back.
2019-09-09 15:15:29 +02:00
70991bfd94 Sculpt: Draw Sharp Brush
This brush is similar to the draw brush but it deforms the mesh from the original coordinates. When used with the sharper curve presets it has a much more pleasant crease/cut behavior than any of the other brushes. This is useful for creating cloth wrinkles, stylized hair or hard surface edges.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5530
2019-09-09 15:12:15 +02:00
056bb7721e Cleanup: remove unused scene struct members 2019-09-09 22:39:58 +10:00
322c03f13c Move callbacks API from BLI to BKE
Preparing for the bigger changes which will be related on passing
dependency graph to various callbacks which need it.

Differential Revision: https://developer.blender.org/D5725
2019-09-09 14:26:42 +02:00
103d29e2b2 Timer: Use explicit re-initialization on file load
Before this the timer API was relying on using a callback API to do
initialization when new file is loaded. This isn't how rest of Blender
works and it gets in a way because callbacks API is to be move to the
BKE level.

Use explicit call to timer API from where the file is loaded.
2019-09-09 14:26:29 +02:00
423435bd2e Cleanup: sort struct, file lists 2019-09-09 21:09:19 +10:00
98d3a16281 Fix (unreported) Freestyle modifiers element-wise multiplication error 2019-09-09 10:46:25 +02:00
d865ac8b1b Fix T69653: Freestyle modifiers "Distance from ..." python error
Was a wrong rename in rBaeb8e81f2741
2019-09-09 10:45:24 +02:00
f3a4f12ac0 Batch Rename: Rename Title Caps to Title Case 2019-09-08 17:40:46 -04:00
Julian Eisel
de12057365 UI: Allow context menu in all file browser regions 2019-09-08 21:27:58 +02:00
Julian Eisel
1601413b63 UI: Allow file number shortcuts ouside main region
Makes the numpad + and - type of shortcuts to increase/decrease the file
number suffix work in the upper and lower bar of the file browser.

Had to add keymap handlers to the execute region for this to work.
2019-09-08 20:35:56 +02:00
7ab936c5b9 Fix T69640: make update not working with Python older than 3.7 2019-09-08 18:45:08 +02:00
a9dbc2ef4a Edit Mesh: select interior faces now detects regions
The previous method only worked in simple cases where faces were
surrounded by non-manifold edges.

Now face regions surrounded by non-manifold edges are marked as interior.
Starting with regions most perpendicular to the surrounding geometry.

Resolves T68401
2019-09-09 01:48:25 +10:00
Julian Eisel
e7476b667e Fix T67756: File drag starts on file browser open
When the file browser was opened (from a temporary window since the file
browser redesign) using a button in the UI, under certain conditions
moving the mouse would trigger files to be dragged.

Note that this has been an issue before the new file browser design was
introduced, although under slightly different conditions.

Steps to reproduce:
* With factory settings, press F12
* Open a different image in the appearing Image Editor (not Render
  Result)
* Make sure the window is not maximized
* Press N to open the side bar, open Image tab
* Click the folder icon there to change the image
* Change to thumbnail display type in the appearing file browser
* Cancel, click the folder icon again
Moving the mouse now would start dragging files in most cases.

The same issue could be reproduced in a similar way when installing
lights/MatCaps or HDRIs through Preferences -> Lights -> Install...
2019-09-08 17:03:48 +02:00
5de51b46b6 Fix T69634: GPencil:Cutter Tool removes unexpected strokes on another layer
The function was not checking the locked flag.
2019-09-08 16:49:47 +02:00
c3be14e151 Cycles: add bump map shadow terminator softening term for diffuse BSDFs
This avoids artifacts for bump mapping and diffuse BSDFs, where the bump
normal deviates far from the actual normal.

Differential Revision: https://developer.blender.org/D5399
2019-09-08 15:32:08 +02:00
ad21a6c224 Fix script_load_modules test failure in power sequencer 2019-09-08 15:17:06 +02:00
b6114c3849 Build: skip Blender repository pull in "make update" when not possible
This prints a more informative message, and is convenient when working with
local changes or in a branch where you only need to update submodules or tests.
2019-09-08 14:52:33 +02:00
Julian Eisel
a566b71333 Fix crash closing stacked file browser window
Caused by ab823176d3.
Steps to reproduce were:
* Open Preferences
* Open file browser through Lights -> Install (doesn't matter which)
* Close browser through the window controlls

The window was freed earlier, but still referenced by new handler
context storage.
2019-09-08 14:37:12 +02:00
f5ad622009 Update RNA Manual References 2019-09-07 20:23:13 -04:00
4764362ebb Fix GTests failing on Windows buildbot
Run these tests from the install directory so they can find dlls.
2019-09-07 22:51:19 +02:00
fd05f01be6 Partially revert "Cleanup: use post increment/decrement"
This partially reverts commit 0b2d1badec

Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
2019-09-08 04:08:10 +10:00
abeab4fcad Fix buildbot not reporting error when tests fail 2019-09-07 18:22:48 +02:00
2028302f44 Tests: run tests from install path
Blender can only be run correctly from the install path since it requires Python
scripts, dynamic libraries and other files to be present. By default the install
path is the same as the build path, so it works anyway. But on the buildbot it
isn't. There was a workaround but it failed on Windows and macOS.

Now tests run from the install path. Detecting that path for ctest is more
complicated than I would like, but I couldn't find a better solution.

Ref T69541.
2019-09-07 18:09:41 +02:00
708e81bdfa Fix buildbot error building release on macOS 2019-09-07 18:09:41 +02:00
ea6992d0e5 Fix missing LLVM include directories on macOS
These are not used in master yet, but they are needed for the functions branch.
2019-09-07 18:09:41 +02:00
d5642584cd Fix redo panel button alignment
Menu's in the redo panel left a space for decorators.
2019-09-08 01:18:51 +10:00
b380a98887 Fix two bugs in delaunay blenlib function.
Bugs were: (1) needed an epsilon test in CCW test in order to
handle new costraint edge that intersects an existing point
but only within epsilon; (2) the "valid bmesh" output mode
sometimes left a face that included outside frame point.
2019-09-07 20:31:24 +05:30
0b2d1badec Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
2019-09-08 00:23:25 +10:00
Julian Eisel
ab823176d3 Fix saving images from temp Image Editor failing
Steps to reproduce were:
* Ensure //Render//->//Display Mode// is //New Window//
* F12
* In the opened Image Editor, Alt+S to save the image
* Save the image
The saving would fail silently.

Issue was that wm_handler_op_context() would fail to find the correct
area to activate, as the wrong window was active in context. So allow
overriding this window and do so when creating the file-select handler.
2019-09-07 16:08:56 +02:00
fa7ee622f0 Cleanup: includes in headers
Forward declare structs where possible.
2019-09-07 23:17:40 +10:00
1b0dd5a215 Cleanup: style, spelling 2019-09-07 21:28:05 +10:00
ed779333bb EEVEE: Shadows: Fix correlation issue between Shadows and Anti-Aliasing
To fix this, we just scramble the halton sequence by multiplying by a large
prime number.

It seems to work fine in practice.

We also tried Sobol sequence but it has a less uniform pattern for low
number of sample.

Fix T68594 Eevee: Soft shadows causing flickering in animation and temporal AA in scenes
2019-09-07 00:44:20 +02:00
963a266faf EEVEE: Fix tests crashing if file is in edit mode 2019-09-07 00:44:20 +02:00
44aaee573a EEVEE: Shadows: Fix incorrect shadowing near point lights source 2019-09-07 00:44:20 +02:00
Jean First
d288776cef Fix T68843: wireframe node in Eevee fails on macOS
Differential Revision: https://developer.blender.org/D5712
2019-09-07 00:01:48 +02:00
87d0033ea9 Fix node_shader_utils problems with new mapping node
Since rBbaaa89a0bc54 we have to access the mapping node differently.
This doesnt take actual linkage of the new sockets into account (but
this wasnt done for most sockets on the Principled BSDF node either)

Also the min/max of the mapping node was removed entirely.
It was decided upon removing this from node_shader_utils as well (and
replace this by existing access to the Extension parameter of the
Texture node).

Part of solving T69526.

Differential Revision: https://developer.blender.org/D5693
2019-09-06 23:39:19 +02:00
bbcb4be04f Fix T69597: Changing Grease Pencil Layer in Dopesheet unlocks all layers
The Dopesheet was unlocked all layers because it was using the same logic used in UI panel, but this was wrong.
2019-09-06 23:33:29 +02:00
9ecbd67dfb Python API: implement an Operator callback for dynamic description.
Blender UI Layout API allows supplying parameters to operators via
button definitions. If an operator behavior strongly depends on its
parameters, it may be difficult to write a tooltip that covers all
of its operation modes. Thus it is useful to provide a way for the
operator to produce different descriptions based on the input info.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5709
2019-09-06 22:05:20 +03:00
b0b24b77ff Fix T68796: stereo side-by-side and pageflip not drawing correctly 2019-09-06 20:38:58 +02:00
7cec119c57 EEVEE: Fix Ambient Occlusion on backfaces
N is already the Facing normal! Dummy!
2019-09-06 19:15:15 +02:00
5289b16d77 UI: File Browser Preview Outlines
File Browser image thumbnails get just a contrasting outline and no shadow.

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

Reviewed by Brecht Van Lommel
2019-09-06 10:03:22 -07:00
d83734aa4b EEVEE: Fix bump mapping
Fix issue in latest patch and assure derivatives calculation is correct on
all GPU.
2019-09-06 19:02:15 +02:00
073624d4cc Eevee: Improve Test setup
- Remove use_screen_refraction as it conflict with SSR and SSS
- Increase GTAO distance
- Add a simple lightprobe setup that works well in most cases
- Enable soft shadows

Baking the lightprobes adds some overhead to the test time (+33%).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5507
2019-09-06 18:31:30 +02:00
a5a003ed55 GPencil: New option to fade not selected objects
Before, it was only possible to fade the active object. The new option allows to fade all non gpencil selected object. This is a common request by artists.

{F7719513}

Reviewers: mendio, pepeland

Reviewed By: mendio

Differential Revision: https://developer.blender.org/D5704
2019-09-06 17:23:00 +02:00
6d8a86c07d Fix T69548: Sculpt scene spacing breaks when object pivot not at origin
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5699
2019-09-06 17:20:32 +02:00
Huseyin Karakullukcu
6222cb575f Fix T68950: Adding lots of edge loops to cylinder produces a crash
Instead of fixed size, `IMM_BUFFER_SIZE` is adjustable now. The internal buffer can expand if there is a need a bigger buffer. All other behaviors are still the same.

Reviewed By: fclem, #gpu_viewport

Differential Revision: https://developer.blender.org/D5570
2019-09-06 17:03:15 +02:00
ffd5e1e6ac Eevee: Use manual derivatives for better quality bump.
We basically duplicate the height map branch plugged into the bump node,
and tag each node in each branch as dx/dy/ref using `branch_tag`.

Then we add a one pixel offset on the texture coordinates if the node is
tagged as dx or dy.

The dx/dy branches are plugged into (new) hidden sockets on the bump node.

This match cycles bump better but have a performance impact. Also, complex
nodetrees can now become instruction limited and not compile anymore.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5531
2019-09-06 16:59:15 +02:00
Julian Eisel
83a7d98a32 Fix: File browser report popups not showing up
Popup would be closed immediately after creating, because of incorrect
mouse coordinates stored in window (popup is set to close if mouse is
some distance away from it).

Completes fix for T69581.
2019-09-06 16:49:59 +02:00
24d05b5ff9 UI: File Browser Large Icon Update
Replaces the large icons used in the File Browser with updated versions by Andrzej Ambroz (jendrzych).

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

Reviewed by Brecht Van Lommel
2019-09-06 07:44:50 -07:00
OmarSquircleArt
61cc604da7 Fix: Rename the dimensions property in Noise nodes.
The `dimensions` property of the noise nodes has been renamed to
`noise_dimensions` because it conflicted with and overwrote the
`dimensions` property of the base node.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5705
2019-09-06 16:06:54 +02:00
d83f62e185 WM: batch rename support for regex groups
Optionally use regular expressions for the destination name,
allows re-ordering words while renaming.

Initial patch by @jmztn with error handling and UI changes.
2019-09-06 23:24:13 +10:00
a94bf0e134 GPencil: Guides: Refactor and add new ISO option
+ Simplify code, move into own function and run once rather than on every point
+ Improved snapping when a stroke is between increments
+ Added ISO grid option for lines specified by Angle under guide settings
+ Radial snapping mode uses Angle as an offset

Differential Revision: https://developer.blender.org/D5668
2019-09-06 14:07:26 +01:00
Julian Eisel
4c20c53b89 Fix: File browser errors not reported in the UI
This is a partial fix, in that it only brings back the banner reports in
the status bar. The popups still don't show up but I need to investigate
more.
It's really ugly that reports rely on wmWindowManager.winactive, but
that's how it is...

Partialy fixes T69581.
2019-09-06 12:48:23 +02:00
39f3474cf1 Fix T69536: Setting dimensions for parented objects fails
Parenting/constraints/delta-scaled all caused setting dimensions to fail.

Take the difference between the input scale and final scale into
account when applying the dimensions.
2019-09-06 20:04:09 +10:00
e858d21ae4 Transformation Constraint: implement a Mix Mode option.
Allow selecting how the new location/rotation/scale is combined with
the existing transformation. This is most useful for rotation, which
has multiple options, and scale, which previously could only replace.
2019-09-06 12:53:35 +03:00
a23ce7f3b7 Transformation Constraint: initialize scale range values to 1 instead of 0. 2019-09-06 12:53:35 +03:00
Julian Eisel
5fd46d27f5 Fix failing assert on directory auto-creation
The failing assert was there before the recent file browser design
overhaul. Might have been in there for quite a while in fact.

Auto-creation in this case means that the file path would be created if
a non-existent path was entered in the file browser path button.
2019-09-06 11:21:47 +02:00
Julian Eisel
e10f8c27a2 UI: Confirmation prompt for file path auto-create
This confirmation prompt was there earlier, we removed the prompts for
creating new directories all together, but in this case it's reasonable.
Without it, it's simply too easy to create new directories by accident.
2019-09-06 11:06:32 +02:00
f1659c5dd8 Cleanup: function grouping
Also rename widget color blending functions more clearly.

- color_blend_v3_v3, was widget_state_blend
- color_blend_v4_v4v4, was round_box_shade_col4_r
- color_ensure_contrast_v3, was rgb_ensure_contrast
2019-09-06 16:47:59 +10:00
ebb7096bb1 Cleanup: use doxy sections 2019-09-06 16:46:00 +10:00
1b287230a4 Viewport Shading: StudioLight Intensity
Add option to change the Intensity of the HDRI in the 3d viewport. This works for both EEVEE and Cycles

Reviewed By: brecht, fclem

Differential Revision: https://developer.blender.org/D5674
2019-09-06 08:35:14 +02:00
f8362836a5 Copy Transforms: add a mixing mode option.
Allow combining location, rotation and scale at the same time,
using one constraint. The mixing modes are based on matrix
multiplication, but handle scale in a way that avoids creating
shear.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5640
2019-09-06 07:58:13 +03:00
f4056e9ec3 Copy Rotation: implement new mixing modes that actually work.
Upon close inspection, the way the Offset mode works in the
Copy Rotation constraint makes no sense, and in fact, destroys
the rotation of its owner unless either it's single axis, or
the order is set specifically to `ZYX Euler`.

Since it can't simply be changed because of backward compatibility
concerns, replace the checkbox with a dropdown that provides a set
of new modes that actually make sense.

Specifically, add a mode that simply adds Euler components together,
and two options that use matrix multiplication in different order.

The Python use_offset property is replaced with compatibility stubs.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5640
2019-09-06 07:57:16 +03:00
Julian Eisel
9972d6c306 UI: Bring back features for file path button
Adds back auto-completion and auto-creation (inserting a non-existing
file-path would create it) for the file path button. The second feature
was left out knowingly, but seems there are reasonable use cases for it.

We can't add these features to the button in the Python script, we have
to call into C. So using a template to do that.
Note that this is based on the old file browser code, I've copied over
the TODO comment.
2019-09-06 01:31:45 +02:00
Julian Eisel
4c4a8bf588 Fix T69498: Crash on export UV Layout
Ensure there's a drawable context after the file browser window is
destroyed.
2019-09-06 00:13:24 +02:00
Julian Eisel
fbf6898f58 Fix T69495: Crash changing action in file browser
We need to ensure the file browser window doesn't manage the handlers
for itself.
The special file browser closing code that we used previously isn't
needed anymore, wm_window_open_temp() and the handling of
EVT_FILESELECT_FULL_OPEN  already manage it fine.
2019-09-05 23:38:45 +02:00
e77ecfa8cb UI: tweak 3D view space between navigation gizmo & buttons
Align the lower side of the navigation gizmo with the top of the icons.
2019-09-06 06:21:25 +10:00
524e000678 Revert "UI: Add Dimensions to Object Transform panel"
This reverts commit 82fc9d778e.

This doesn't use the workaround from v3d_object_dimension_buts
needed for dimensions properly update.

Doing this would require moving the panel to C.

Issues from T69536 should be resolved before adding this back.
2019-09-06 06:05:31 +10:00
051f98baf3 LibOverride: Initial attempt to ignore missing place-holders IDs.
Ideally, when a reference linked ID is missing (and replaced by linking
code with an empty place-holder), we should just keep the local
overriding datablocks as-is, until broken links are fixed.

Not really working yet though, needs more work here...
2019-09-05 21:31:01 +02:00
5f4caa8c4f LibOverride: add a generic macro to check whetehr an ID is overridable.
...and use it in code generating library overrides.
2019-09-05 21:31:01 +02:00
8622849beb LibOverride: give more remapping control to BKE_override_library_create_from_id() too.
Similar change to the one done for tagged IDs overriding some days ago.
We do not always want to remap all local usages of a linked data-block
to its new local overriding copy.
2019-09-05 21:31:00 +02:00
23d19c2b0d Fix T63653: Industry Compatible Keymap can't be saved & loaded
Replace keymap specific operator.
2019-09-06 04:44:12 +10:00
493fa59225 Fix keymap export of enum-flag properties 2019-09-06 04:44:12 +10:00
1efd857430 Object: Mode switching operator
Remove unused OBJECT_OT_mode_set_or_submode, add
OBJECT_OT_mode_set_with_submode which can switch to edit mode as well
as a sub-mode - currently only mesh select mode is supported
(others may be added later).
2019-09-06 04:44:12 +10:00
c25c3f73c4 Cleanup: reuse mesh select mode enum 2019-09-06 04:44:12 +10:00
3a15643b90 Cleanup: Cmake submodule checks
It is a pain if the subfile we are checking if it exists gets
renamed/removed.

Instead we can check if the directory is empty.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D5653
2019-09-05 14:28:20 -04:00
08991c01f0 Fix unreported: snapping to 3d tracking markers sometimes fails 2019-09-05 14:48:18 -03:00
4e731ec97b Transform: Split transform_conversions into multiple files.
Part of T68836

`transform conversions.c` is a file that is getting too big (almost 10,000 lines).
So it's a good idea to split it into smaller files.

differential revision: https://developer.blender.org/D5677
2019-09-05 14:35:38 -03:00
c90b81172b Fix T69513: Grease Pencil Fade Layers Overlay only works in Material and Texture Shading
The overlay factor was not used in other modes.
2019-09-05 19:10:15 +02:00
Erik Abrahamsson
caaaac1365 Improve some textures UI properties click-drag precision
When click-dragging to change values in textures (for example Musgrave-
>Size to give an example) the step size is too big.

Reviewers: brecht, lichtwerk

Reviewed By: brecht, lichtwerk

Differential Revision: https://developer.blender.org/D5661
2019-09-05 17:55:37 +02:00
1bafa3139c Fix T68840: Metaballs update 'NEVER' method not working
Was always evaluating due to typo in rB34ab90f546f0.

Reviewers: brecht

Maniphest Tasks: T68840

Differential Revision: https://developer.blender.org/D5695
2019-09-05 17:45:42 +02:00
d8aaf25c23 Eevee: Shadow map refactor
Reviewed By: brecht

Differential Revision: http://developer.blender.org/D5659
2019-09-05 17:37:50 +02:00
ca58936f2f Cleanup: de-duplicate code 2019-09-06 00:59:25 +10:00
411adadf67 Depsgraph: Ensure it's fully evaluated after POST callbacks
It is possible that POST callbacks will modify objects or relations.
This change makes it so an extra update pass is done if needed.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5690
2019-09-05 16:35:07 +02:00
7825697827 UI: use boolean for sequencer reverse frames
Revert part of 04b86c21bf

The option to reverse frames is used elsewhere as a boolean
which makes sense since reversing playback is a special case.
2019-09-05 21:47:06 +10:00
d0462dca90 GPencil: New Operator to set the active object material based on the selected stroke material
The operator set as active object material the material used in the selected stroke.

Access to the operator were added in the stroke menu and context stroke menu.

Reviewers: antoniov, pepeland

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5692
2019-09-05 13:29:13 +02:00
OmarSquircleArt
3a0b22b2da Fix T69532: Wave texture fails with a compile error.
`noise_turbulence` was renamed to `fractal_noise`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5691
2019-09-05 13:25:13 +02:00
OmarSquircleArt
c060a4a714 Fix: Compile error due to undefined isinf function.
Some implementations of the standard c++ library doesn't define its
functions in the global namespace. So the `isinf` function might
fail in some systems. To fix this, we use the `ensure_finite`
function instead.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5687
2019-09-05 13:21:21 +02:00
b6e7e173ec Buildbot: enable tests to run again
These will not stop the build on failure yet, first step is to get them passing
more reliably.
2019-09-05 12:52:54 +02:00
Sebastian Koenig
83875e978d Tracking: Enable "Render Undistorted" only if there is actual distortion
Applies to "Setup Tracking Scene" operator which configures background
images for the viewport.

Solves unnecessary slowdown and higher memory usage when camera's model
does not have any effective distortion.

Differential Revision: https://developer.blender.org/D5520
2019-09-05 12:06:09 +02:00
31c2929496 Depsgraph: Free user code from worry about updates flush 2019-09-05 11:57:20 +02:00
ac060232aa Depsgraph: Pass bmain to evaluation function
Currently unused, makes code ready for an upcoming change.
2019-09-05 11:57:20 +02:00
f2400c1bb5 Industry Compat keymap: Add Batch Rename to Alt-Return 2019-09-05 10:51:02 +02:00
c2a0f5c3d4 File Browser UI: Use 'Install' instead of ''Install Add-on from File...' as the name of the execute button
The old name didn't fit inside the button, and this fits with simpler Open/Save labels too.
2019-09-05 10:21:24 +02:00
ab158cd00a Fix T69522: Render Region not refreshing Output Properties
setting/clearing render region uses ND_RENDER_OPTIONS notifier, but
listener was only refreshing RENDER and VIEWLAYER tabs in that case,
whereas the render region buttons are located in OUTPUT tab.

Reviewers: billreynish

Maniphest Tasks: T69522

Differential Revision: https://developer.blender.org/D5685
2019-09-05 10:14:28 +02:00
05721cd00a Mesh Batch Cache: Fix threading issue
I believed the crash I experienced happened because:
1. The `extract_pos_nor_init` function is called.
2. Tasks are added to the task pool for `extract_pos_nor`.
3. The tasks begin to be executed while more tasks are added.
4. In some rare cases, all existing tasks are finished, but not all have been added yet.
5. This let the task-counter go down to zero.
6. This triggered a call to `extract_pos_nor_finish`.
7. Then more tasks are added and in the end `extract_pos_nor_finish` is called again.

A solution is to use a task pool that is suspended when created.
Unfortunately, there was an outdated comment, that was probably the root cause of the issue.

Reviewers: fclem, sergey

Differential Revision: https://developer.blender.org/D5680
2019-09-05 09:57:30 +02:00
Sebastian Koenig
17baa43e59 MovieClip: Make name of Active Clip consistent in UI
Using the currently active movie clip had different names in the interface:
In scene context it was "Active Movie Clip", in Camera Background Images it was "Camera Clip", in Constraints it was "ActiveClip".
I made all those instances use "Active Clip", which is descriptive enough and also the shortest of the three.

Reviewed By: billreynish

Differential Revision: https://developer.blender.org/D5400
2019-09-05 09:32:13 +02:00
d813cc706d File Browser: Add Zip files as native recognised file type
Differential Revision: https://developer.blender.org/D5683

Reviewers: Brecht
2019-09-05 07:54:41 +02:00
6fc6f2504d Cleanup: use backslash for doxygen commands 2019-09-05 12:56:55 +10:00
adae93281c Cleanup: clang-format 2019-09-05 12:56:34 +10:00
410f3bc1d3 Fix 'make icons' on Linux
CRLF line ending caused shebang to fail.
2019-09-05 12:28:30 +10:00
OmarSquircleArt
baaa89a0bc Shading: Rewrite Mapping node with dynamic inputs.
This patch rewrites the Mapping node to support dynamic inputs. The
Max and Min options have been removed. They can be added as Min and
Max Vector Math nodes manually.

Texture nodes still use the old matrix-based mapping. A new SVM node
`NODE_TEXTURE_MAPPING` has been added to preserve this functionality.
Similarly, in GLSL, a `mapping_mat4` function has been added.

Reviewers: brecht, JacquesLucke
2019-09-04 23:17:13 +02:00
f098f6df76 UI: Remove 'Context.' string when hovering over Properties tabs
Differential Revision: https://developer.blender.org/D5679

Reviewers: Brecht
2019-09-04 22:33:32 +02:00
5d442440f8 File Browser UI: Add Select menu to File Browser
Adding this for consistency with other editors. Seems as if we never had this in the past.
2019-09-04 22:09:01 +02:00
fc0b51d516 UI: Icons update
New icons from Andrzej Ambroż (jendrzych)

  - Many tweaks to existing icons, such as folders and drives for the new file browser, as well as snapping
  - New icons for Checkmark, Transform Origins, Snap to Face Center, Zip Files (currently unused)
2019-09-04 21:42:25 +02:00
36e23c95e8 Python API: add methods for reordering constraints.
Order matters for constraints, but there was no way to change it.
The API follows other collections like idprops and node sockets.
2019-09-04 22:38:33 +03:00
e52ad1835a Fix hair collision instability with 'Quality Steps' > 1
This was removed in rB0666ece2e2f9 because it is handled differently for
"real" cloth in cloth_solve_collisions(), but hair still needs this
apparently [does its thing in cloth_continuum_step() instead].

And since we have a default 'Quality Steps' setting of 5, it made many
simulations unstable.

Fixes T65038, T59742 (possibly others)

Reviewers: brecht

Maniphest Tasks: T65038, T59742

Differential Revision: https://developer.blender.org/D5681
2019-09-04 21:05:54 +02:00
49ff9ca613 Missed from last commit 2019-09-05 03:28:45 +10:00
1715d09d7c Cleanup: userpref UI options into their own struct
Mixing options for showing preferences with other flags was confusing.
2019-09-05 03:25:55 +10:00
933725ab46 Cleanup: use doxy comments 2019-09-05 03:16:22 +10:00
c7b9ae310b Cleanup: correct UI_THEMESPACE_START/END macros 2019-09-05 03:16:09 +10:00
OmarSquircleArt
6f32f0ea27 Versioning: Bump subversion for the Noise node.
D5560 was missing a subversion bump.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5678
2019-09-04 19:02:40 +02:00
82fc9d778e UI: Add Dimensions to Object Transform panel
This makes the Transform panel complete, so you don't need to open the Sidebar for such a basic concept.

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

Reviewers: Brecht, Pablo Vazquez
2019-09-04 18:37:33 +02:00
OmarSquircleArt
23564583a4 Shading: Extend Noise node to other dimenstions.
This patch extends perlin noise to operate in 1D, 2D, 3D, and 4D
space. The noise code has also been refactored to be more readable.

The Color output and distortion patterns changed, so this patch
breaks backward compatibility. This is due to the fact that we
now use random offsets as noise seeds, as opposed to swizzling
and constants offsets.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5560
2019-09-04 17:54:32 +02:00
Julian Eisel
45d4c92579 Move file execute region back to C, fixing bugs
We moved this to Python too quickly, causing the following regressions:
* No auto completion for file names
* Additional handling not applied on changes, like automatic extension
  appending (see file_filename_enter_handle)
* Red highlight missing when the file name already exists

Note that earlier (before the file browser redesign), this didn't use
the panel and layout code at all. So even if it's still not in Python,
at least it's integrated into regular panel management now.
OS-specific ordering of the open and cancel button is kept.

Fixes T69457.
2019-09-04 16:30:09 +02:00
Julian Eisel
640c45dc3a Expose button UTF8 check in UI_interface.h
Used in following commit.
2019-09-04 16:30:09 +02:00
68d1f09158 Shading Modes: Material and Render Preview
This change implements the basics as described in {T68312} for the
shading modes.

* LookDev shading mode is renamed to Material Preview. It always uses Eevee as renderer, and is intended to provide a fast material preview suitable for texture painting, and texture and material setup.

* Rendered shading gains "Use Scene Lights" and "Use Scene World" options similar to current Material Preview. These will be enabled by default. When Use Scene World is turned off, HDRIs will be used for lighting instead. These options are available for EEVEE and Cycles.
* Renderers will be able to customize the shading settings panel and add additional settings.

Reviewed By: brecht, fclem

Differential Revision: https://developer.blender.org/D5612
2019-09-04 15:57:00 +02:00
d3ab930c88 Fix/cleanup error handling in paths generation for private ID data case.
When using new `rna_prepend_real_ID_path()`, caller have to handle the
NULL path case and decide whetehr this is a valid case or an error one.
2019-09-04 15:08:32 +02:00
e08dac5f06 UI: use vertical navigation buttons
This addresses crowding in the top right area of the view
with the existing header and tool header.

D5670 by @CandleComet
2019-09-04 23:05:20 +10:00
Yevgeny Makarov
0381727663 Fix T55745: Checker de-select, inconsistent selection
With these changes, successive selections result in an even pattern.
2019-09-04 22:51:48 +10:00
4d995527a9 UI: Rename Select tool to Tweak tool
'Tweak' better communicates what this tool is for

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

Reviewers: Brecht, Campbell Barton
2019-09-04 11:55:36 +02:00
Julian Eisel
718989d662 Fix T69469: Overrun in file action type RNA enum
Think it was harmless in practice since we didn't actually enumerate the
items, only count them and access the set value. Still...
2019-09-04 10:23:38 +02:00
fcf2a712ec Armature: add Inherit Scale options to remove shear or average the scale.
As an inherent property of matrix-based transformation math, non-
uniform scaling of a parent bone induces shear into the transform
matrix of any rotated child. Such matrices cannot be cleanly
decomposed into a combination of location/rotation/scale, which
causes issues for rigging and animation tools.

Blender bones have options to exclude rotation and/or scale from the
inherited transformation, but don't have any support for removing the
often undesired shear component. That goal requires replacing simple
parenting with a combination of multiple bones and constraints. The
same is true about the goal of inheriting some scale, but completely
avoiding shear.

This patch replaces the old Inherit Scale checkbox with a enum that
supports multiple options:

* Full: inherit all effects of scale, like with enabled Inherit Scale.

* Fix Shear: removes shear from the final inherited transformation.

  The cleanup math is specifically designed to preserve the main
  axis of the bone, its length and total volume, and minimally
  affect roll on average. It however will not prevent reappearance
  of shear due to local rotation of the child or its children.

* Average: inherit uniform scale that represents the parent volume.

  This is the simplest foolproof solution that will inherit some
  scale without ever causing shear.

* None: completely remove scale and shear.

* None (Legacy): old disabled Inherit Scale checkbox.

  This mode does not handle parent shear in any way, so the child
  is likely to end up having both scale and shear. It is retained
  for backward compatibility.

Since many rigging-related addons access the use_inherit_scale
property from Python, it is retained as a backward compatibility
stub that provides the old functionality.

As a side effect of reworking the code, this also fixes a matrix
multiplication order bug in the Inherit Rotation code, which caused
the parent local scale to be applied in world space. In rigger
opinion this option is useless in production rigs, so this fix
should not be a problem.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5588
2019-09-04 10:34:21 +03:00
64f8f7db7c Fix T63755: Area Stretching Overlay
Support for UV Stretching overlay during multi object editing. The
VBO now holds the ratios per fase. In the shader these ratios will
be compared against the global ratios. The global rations are created
from all selected objects.

The current implementation does not fit well with the draw module. The
plan is to move the drawing of other spaces towards the draw manager what
leads to a better fit. Currently the details on this solution is unclear
but this requirement will become an attentionpoint in the future design.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5665
2019-09-04 08:08:27 +02:00
0cb730146b Transform: remove X/Y shear tool option
Instead use vertical cursor motion for Y axis shear.

This removes the shear_axis option completely since we now have two
axis options used by shear it's not needed.
2019-09-04 15:33:07 +10:00
966c00060f Transform: Improve hierarchy in mixed snap edge detection. 2019-09-04 02:16:50 -03:00
Julian Eisel
da25aca267 Fix T69463: File Browser opens off-center on hiDPI
wmWindow.sizex/y doesn't have system's pixel size applied.
2019-09-04 02:01:44 +02:00
Julian Eisel
0c7bfdf9a5 Fix T69467: Temporary Info Editor window crashes
Code called editor creation twice, once for SPACE_INFO, once for
SPACE_EMPTY. Caused by a incorrectly solved merge conflict.
2019-09-04 01:47:16 +02:00
1886a2f3f5 Industry Compat keymap: Add support for tool hotkeys in paint modes
Use D for Draw, B for Blur.
2019-09-04 00:58:47 +02:00
c69130e9f9 Industry Compat keymap: Fix for opening folders in new File Browser 2019-09-04 00:51:43 +02:00
Julian Eisel
197653e087 Fix selecting multiple files ignoring first file
E.g. box selecting wouldn't allow selecting the first file.
Work selection and shift/ctrl selection had similar issues.

Code assumed that the first item was the '..' parent item and manually
removed it from the selection. I could just remove this special
handling, but instead I made the behavior more dynamic. So the file list
checks if the '..' item is there and only then applies special
treatment.
That way we can easily bring the '..' item back or make it optional if
wanted.
2019-09-03 23:15:31 +02:00
5ba0ce8544 UI: Minor fixes to Delta Transform panel
Removes some wrong gaps appearing
2019-09-03 22:34:55 +02:00
1af0f1fed9 File Browser: Fix Windows Execute/Cancel button order
Was using wrong check for Windows, causing this to fail
2019-09-03 21:45:39 +02:00
Julian Eisel
9e3cd98529 Fix T69451: Walk-select in empty directory asserts
Code assumed the '..' was there, which isn't the case any more. Just
early exiting for empty directories is fine.
2019-09-03 19:51:52 +02:00
0df6224d48 GPencil: Context menu update
Add missed 'Insert Blank keyframe in All Layers' to context menu

Reviewers: antoniov, pepeland

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5669
2019-09-03 19:04:36 +02:00
1abb1ba9a3 GPencil: Fix unreported autolock layers using Dopesheet
When select a layer in Dopesheet, the autolock layer was not working.

Now the Dopesheet code calls the function for autolock. Also some code cleanup to move the logic to new function.
2019-09-03 18:59:12 +02:00
e91ea20ebe Drivers: support decomposing rotation into swing followed by twist.
In order to correctly drive corrective shape keys from a freely
rotating organic joint it is very often found necessary to
decompose the rotation into separate bending and twisting
motions. This type of decomposition cannot be reproduced by
any Euler order or a single quaternion.

Instead this is done by using a helper bone with a Damped Track
constraint aimed at the tail of the control to pick up the bending,
and its helper child with Copy Transforms to separate the twist.

Requiring two additional bones to drive a shape key or a correction
bone seems inconvenient, so this implements the necessary math as new
options in the recently introduced Rotation Mode dropdown of the
Transform Channel driver variable type. The data is also accessible
as a Transformation constraint input.

The output is in the form of Quaternion-derived 'pseudo-angles',
which for `Swing and Y Twist` would represent the following:

* W: true bend angle, independent of bend direction.
* Y: true twist angle.
* X, Z: pseudo-angles representing the proportion of bending around X/Z.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5651
2019-09-03 19:35:36 +03:00
b3b59e3b56 Transform: support snap to children with 'Affect Parents'
Resolves T69398
2019-09-04 02:04:01 +10:00
e5c8f096f8 Cleanup: expand checks for selection when snapping
Adding extra checks here was getting unreadable,
expand to allow for easier to follow logic.
2019-09-04 02:04:01 +10:00
4f92725283 Fix buildbot unsuccessfully trying to update Blender repository for branches 2019-09-03 18:01:57 +02:00
bc1781cf6a EEVEE: Fix broken bump regression
Regression introduced by 7f4a2fc437
2019-09-03 17:45:58 +02:00
4c14a7484c Cleanup: unused flag, spelling 2019-09-04 00:53:05 +10:00
Julian Eisel
ee8f69c96c UI: File Browser Design Overhaul
This is a general redesign of the File Browser GUI and interaction
methods. For screenshots, check patch D5601.

Main changes in short:
* File Browser as floating window
* New layout of regions
* Popovers for view and filter options
* Vertical list view with interactive column header
* New and updated icons
* Keymap consistency fixes
* Many tweaks and fixes to the drawing of views

----

General:
* The file browser now opens as temporary floating window. It closes on
  Esc. The header is hidden then.
* When the file browser is opened as regular editor, the header remains
  visible.
* All file browser regions are now defined in Python (the button
  layout).
* Adjusted related operator UI names.

Keymap:
Keymap is now consistent with other list-based views in Blender, such as
the Outliner.
* Left click to select, double-click to open
* Right-click context menus
* Shift-click to fill selection
* Ctrl-click to extend selection

Operator options:
These previously overlapped with the source list, which caused numerous
issues with resizing and presenting many settings in a small panel area.
It was also generally inconsistent with Blender.
* Moved to new sidebar, which can easily be shown or hidden using a
  prominent Options toggle.
* IO operators have new layouts to match this new sidebar, using
  sub-panels. This will have to be committed separately (Add-on
  repository).
* If operators want to show the options by default, they have the option
  to do so (see `WM_FILESEL_SHOW_PROPS`, `hide_props_region`), otherwise
  they are hidden by default.

General Layout:
The layout has been changed to be simpler, more standard, and fits
better in with Blender 2.8.
* More conventional layout (file path at top, file name at the bottom,
  execute/cancel buttons in bottom right).
* Use of popovers to group controls, and allow for more descriptive
  naming.
* Search box is always live now, just like Outliner.

Views:
* Date Modified column combines both date and time, also uses user
  friendly strings for recent dates (i.e. "Yesterday", "Today").
* Details columns (file size, modification date/time) are now toggleable
  for all display types, they are not hardcoded per display type.
* File sizes now show as B, KB, MB, ... rather than B, KiB, MiB, … They
  are now also calculated using base 10 of course.
* Option to sort in inverse order.

Vertical List View:
* This view now used a much simpler single vertical list with columns
  for information.
* Users can click on the headers of these columns to order by that
  category, and click again to reverse the ordering.

Icons:
* Updated icons by Jendrzych, with better centering.
* Files and folders have new icons in Icon view.
* Both files and folders have reworked superimposed icons that show
  users the file/folder type.
* 3D file documents correctly use the 3d file icon, which was unused
  previously.
* Workspaces now show their icon on Link/Append - also when listed in
  the Outliner.

Minor Python-API breakage:
* `bpy.types.FileSelectParams.display_type`: `LIST_SHORT` and
  `LIST_LONG` are replaced by `LIST_VERTICAL` and `LIST_HORIZONTAL`.

Removes the feature where directories would automatically be created if
they are entered into the file path text button, but don't exist. We
were not sure if users use it enough to keep it. We can definitely bring
it back.

----

//Combined effort by @billreynish, @harley, @jendrzych, my university
colleague Brian Meisenheimer and myself.//

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

Reviewers: Brecht, Bastien
2019-09-03 16:10:40 +02:00
545f565426 Fix selection engine checks
- Don't use vertex selection in texture paint mode.
- Don't allow mixing vertex & face flags in vert/weight paint modes.
2019-09-03 23:43:15 +10:00
8be800dcdf Fix T69424: Weight paint sample doesn't work 2019-09-03 23:38:12 +10:00
51d8facbc3 Fix buildbot Python executable not found on Windows 2019-09-03 14:35:57 +02:00
fc99297411 Fix T66950: WeightPaint Bone Selection Overlay
In weightpaint it is possible to enable the bone selection mode. During
drawing the overlay was rendered, but during selection this was ignored.
Users needed to double click in order to select bones even when the overlay
was enabled.

This patch makes bone selection possible during weight painting using the pose mode bone
selection overlay with a single click.

Reviewed By: fclem, campbellbarton

Differential Revision: https://developer.blender.org/D5629
2019-09-03 14:09:44 +02:00
Lucas Boutrot
97f7f5fdbb Fix T69384: Noise Depth widgets steps set to 0
Reviewed By: brecht, lichtwerk

Maniphest Tasks: T69384

Differential Revision: https://developer.blender.org/D5652
2019-09-03 13:42:43 +02:00
21c099c5be Fix compiler warning after recent change to splash screen version 2019-09-03 13:05:55 +02:00
a620501acb Fix T62152: Shear X and Y are swapped 2019-09-03 20:36:31 +10:00
85b1506c6e Fix Credits link not working in About menu 2019-09-03 12:35:17 +02:00
81849e7c9d Buildbot: support building releases, make non-releases more consistent
* Auto detect rc and release version cycle in BKE_blender_version.h.
* On Windows, generate zip and installer if a release is detected.
* On macOS, always generate a dmg instead of zip.
* Use standard package names without hash if a release is detected.
* Buildbot package names now match platform names in releases.

Ref T67056

Differential Revision: https://developer.blender.org/D5643
2019-09-03 12:23:39 +02:00
ad5e91a107 Subsurf: Show error when Blender is built without OpenSubdiv 2019-09-03 11:45:52 +02:00
42478436ae Add OpenSubdiv information to bpy.app
Allows to customize interface and inform about lack of
subdivision surface support.
2019-09-03 11:45:52 +02:00
5ea6545ad5 Fix library link errors after building with install_deps.sh on Ubuntu
On some systems this would use the builtin echo command without support for
the -e option.

Thanks Alexander Gavrilov for helping find this.
2019-09-03 11:20:29 +02:00
9be138bf63 Fix empty image wire drawing with front/back depth
The vertex shaders depth offset was ignored in this case.
2019-09-03 19:16:37 +10:00
65db18fc56 Fix T68868: Assert in depsgraph debugging logs
Was happening when tagging for LEGACY_0 was used.
2019-09-03 11:06:41 +02:00
abfb8b6963 3D View: option only to show axis aligned image empties
Useful for using reference images that only make sense to see
in aligned axis-views.

This restores functionality possible with 2.7x background images.
See: T52668.
2019-09-03 19:01:27 +10:00
8a7a7af627 Fix T69326: Parent type ARMATURE doesn't work 2019-09-03 10:48:29 +02:00
841346df5d Depsgraph: Cleanup, more clear variable name 2019-09-03 10:43:40 +02:00
f45e55c9c8 Depsgraph: Cleanup comment 2019-09-03 10:43:05 +02:00
d74cc6c08c Drivers: add separators to the Transform Channel type enum menu.
It's hard to find things quickly in the wall of '...ation' without breaks.
2019-09-02 23:51:09 +03:00
d4a905fd85 UI: Fix Bug With Join Area Tolerance
Join area tolerance not properly checking all vertices on shared edge.

Differential Revision: https://developer.blender.org/D5662
2019-09-02 13:06:42 -07:00
47cde3292c Return proper RNA path in py console for 'private ID' data.
We can now generate a proper path here, make use of it.

Note: not sure how property pyrna path is supposed to be accessed? code is
similar to the struct pyrna path anyway...
2019-09-02 18:46:20 +02:00
6f1fa7aa25 Fix/enhance new RNA path from real ID helpers.
Main issue was that `rna_prepend_real_ID_path()` would return
nothing in case given path was NULL, when it should actually return the
`prefix` computed by `RNA_find_real_ID_and_path()` in that case...

Also make return `real_id` pointer optionnal, no reasons to make it
mandatory here. And some general naming fixes.
2019-09-02 18:43:43 +02:00
1fd5c90e63 DatablockManagement: Cleanup: get rid of BKE_collection_copy_master().
Now that we 'properly' support private ID data in lib management, there
is no reason anymore to have that custom func, badly named and
by-passing the whole generic ID management code.
2019-09-02 18:39:08 +02:00
99e8aeaa4a DatablockManagement: Fix/sanitize handling of flags for private ID data in copy functions.
Not sure exactly why that was working with nodetrees in depsgraph (could be some special
code in the despgraph), but we always want to allocate memory for the nodetrees here!
2019-09-02 18:39:08 +02:00
3850557073 Cleanup: get rid of BKE_collection_master() useless accessor.
In its current version that was a totally useless extra layer of crap
that we can totally avoid. Plus name was bad too.
2019-09-02 18:39:08 +02:00
0ebc76354f DatablockManagement: Cleanup logic of private IDs handling in BKE_libblock_copy_ex().
Now that we have the private ID data flag, we can be more simple *and*
generic here.
2019-09-02 18:39:08 +02:00
64efbbca8e Make Scene Master collection 'Private' ID data, like root nodetrees.
Same issue here as with root nodetrees, those are private ID data owned
by another ID, and not in Main DB. This requires special handling.

there are still quiet a few things to do here, like getting rid of
special code for master collection (regular ID copying should handle
that just as it already does for root nodetrees), cleanup in ID copying
code, etc.
2019-09-02 18:39:08 +02:00
283d96de11 Buildbot: refactor all build slave code
* Move common code into buildbot_utils.py
* Remove legacy code from removed builders
* Split code into smaller functions

Differential Revision: https://developer.blender.org/D5642
2019-09-02 17:37:22 +02:00
a565096109 GPencil: Add suport to Poly Curves to Convert to Strokes operator
The Poly curves were not supported when convert curves to grease pencil strokes, but now are supported.

Also, some code cleanup to make it more readable.
2019-09-02 17:24:05 +02:00
a3559a70dd Fix T69404: Merge by distance crash with Unselected
Error introduced when removing the automerge bmesh operator.
2019-09-03 00:35:22 +10:00
Julian Eisel
2356f60c62 UI: Don't show button context menu for drag-labels
While the vast majority of labels would never get a button context menu
(as opposed to the regular context menu of this region), draggable
labels would still reach code for such context menu creation. From what
I can tell only file browser icons/thumbnails and the properties editor
data path would be affected. The button context menu doesn't make sense
for them, so let the region context menu show up instead.

If at some point we want button context menus for specific labels, we
can make checks more granular.
2019-09-02 15:41:46 +02:00
591db72ee2 GPencil: New Strength mode for Opacity modifier
This new option applies the opacity using the strength of the stroke instead to use the alpha channel of the material.

Tested in greasepencil-object branch

{F7712796}

The vertex group filter has been removed because this filter is not logic in Material mode and must be valid only in Strength mode.

{F7713147}

Reviewers: pepeland, mendio

Reviewed By: mendio

Differential Revision: https://developer.blender.org/D5650
2019-09-02 13:31:37 +02:00
a6816bf5db CMake: De-duplicate test target name construction 2019-09-02 09:42:44 +02:00
b8be0557a7 Fix noisy GFlags warnings when building tests
Split include directories into regular and system ones, which
makes it so strict flags are properly cancelled out for GFlags
headers.
2019-09-02 09:42:44 +02:00
2c68d50421 CMake: Cleanup, unset temporary variables
Was happening in macros, polluting the namespace.

No functional changes, just making things cleaner.
2019-09-02 09:42:44 +02:00
7f2b4c871e WM: batch rename, regular expression support
Find/Replace can now use regular expressions.
2019-09-02 15:23:39 +10:00
928e0258fe GPencil: Set fill material when curve is 2D and has filling
Now the material is set as fill if the curve is 2D and is filled with a material. This is done in the Convert operator only, because the SVG add-on works totally different due the SVG has more parameters to determine the type of filling.
2019-09-01 22:47:23 +02:00
35bc4c2cf4 GPencil: Add Convert to Grease Pencil to context Object menu 2019-09-01 22:30:47 +02:00
8ca9626985 UI: Active Default Button Highlight
Buttons marked as the default action are shown in full selected color. Simplification of all the related active_default code.

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

Reviewed by Campbell Barton
2019-09-01 09:40:28 -07:00
a9e389b8c4 WM: make find/replace default for batch rename
Use this since it's a common operation for batch naming.
2019-09-02 01:57:39 +10:00
6ff675f830 Fix transforming origin affecting unselected children 2019-09-02 01:39:34 +10:00
460e4024e8 WM: batch rename, material & object-data support 2019-09-02 00:58:39 +10:00
18d4ad5a59 Copy Rotation & Transform: add Euler order override options.
For reasons similar to drivers, it should be possible to set an
explicit Euler rotation order in constraints that use Euler angles.

The Transform constraint in a way approaches drivers in its use,
in that it effectively alters channels using values of other
channels after applying a fixed form mathematical expression.

For this reason, instead of just specifying the euler order for
its inputs, it uses the same enum as driver variables. However
Quaternion components are converted to a weighted pseudo-angle
representation as the rest of the constraint UI expects angles.
2019-09-01 14:13:23 +03:00
ae43b1d51b Fix T69364: GPencil Array Modifiers causes crash
This bug was introduced when adding the support for default materials.
2019-09-01 09:31:20 +02:00
883706395e Drivers: support accessing Quaternion rotation channels.
After adding the Euler order option, it's an easy addition to
the enum. The list of channels had of course to be expanded too.
2019-08-31 20:53:32 +03:00
a5b1231de7 WM: batch rename operator
Matches rename active, supports objects, bones, sequence strips & nodes.

Support chaining actions, these can be extended, initially support:

- set/prefix/suffix
- search replace
- stripping characters
- capitalization.
2019-09-01 03:36:00 +10:00
284e4d18be Fix non-functional return argument in new gpencil code
Also remove unused arguments.
2019-09-01 03:35:48 +10:00
ebafb46e4a Build: don't require svn to be available for "make update" when not used
Specifically on Linux, when not having a tests checkout.
2019-08-31 18:52:28 +02:00
505340202e Fix T66452: Convert Curve to Grease Pencil Strokes
This commit adds support to convert curves to Grease Pencil strokes and create the materials too.

Also, there is a new python API. This API is required by the modified SVG import addon to create strokes( see T67065).

All curves selected in one operation are converted in the same Grease Pencil object.
2019-08-31 17:48:44 +02:00
a098bd094c Build: use non-interactive svn commands for "make update"
Needed for buildbot, but interactively solving svn conflicts in the middle
of manual make update is also not ideal.
2019-08-31 15:52:11 +02:00
82ef1edce4 Drivers: support explicit euler rotation order for transform channels.
The meaning of the euler angles completely depends on the rotation
order. Currently the rotation order is taken from the target of the
driver variable, which somewhat makes sense if it uses euler, but if
it's quaternion, then the order is always set to XYZ.

Add a new option for the rotation channels of the Transform Channel
driver variables that defaults to the old behavior, but allows setting
an explicit rotation order.
2019-08-31 14:22:12 +03:00
9821dd72ba Cleanup: rename natural string comparison 2019-08-31 17:32:30 +10:00
e72053a201 Outliner: fix unnecessary syncing
Depending on the outliner display mode and the outliner dirty state,
a sync may not be needed on each draw. This commit adds a check
before syncing to prevent syncing when not needed.
2019-08-30 21:09:40 -06:00
82627c5016 Outliner: always sync object selection
This changes from-outliner selection syncing to always sync the
selection state of objects. This allows selecting objects while in
edit mode for parenting or adding hooks. This also fixes a few issues
where the sync algorithm would fail when no active object existed.
2019-08-30 20:47:27 -06:00
6726e98fe2 Cleanup: clang-format 2019-08-30 13:33:49 -06:00
6c16c2c233 MSVC: Fix BlendThumb debug build.
Spotted by @deadpin on chat
2019-08-30 13:27:56 -06:00
5b547932fa GPencil: Fix move_to_layer menu in Stroke context menu
Missing in previous commit
2019-08-30 20:53:01 +02:00
dacc773c29 make_deps: remove blendthumb
now in regular codebase.
2019-08-30 11:56:02 -06:00
74763d1ae8 Transform: use recalc geometry depsgraph tag
Better be specific with the data that needs updating.
2019-08-31 03:52:49 +10:00
a785835b2c Fix T69299: Transform origin & skip-children jitters 2019-08-31 03:42:37 +10:00
503716bb65 Cleanup: 2 space indentation 2019-08-31 03:42:37 +10:00
f430685d2d Windows: Fix compatibility with older cmake
Older cmake did not find the BlendThumb sub project.
2019-08-30 11:40:46 -06:00
d8bc28ca20 Fix possible crash with new sculpting cursor, due to stack overflow 2019-08-30 19:34:11 +02:00
c65febf396 Cleanup: Silence debug prints in readfile code.
Not sure since when that one has been enabled, but there is no reasons
to print all that for regular users...
2019-08-30 19:08:09 +02:00
0f3b910c3a Cleanup: redundant lowercase in BLI_natstrcmp 2019-08-31 02:40:34 +10:00
bed321f6da Cleanup: remove debug print 2019-08-30 18:13:10 +02:00
86b9470037 Tests: reorder render tests so cycles/eevee/workbench are not interleaved 2019-08-30 18:01:50 +02:00
718747c589 Tests: auto download test files when running "make test" 2019-08-30 18:01:50 +02:00
464e545c72 Tests: move "make test" on macOS and Linux to Python script 2019-08-30 17:57:18 +02:00
e218d8c24b Build: integrate make_update.py into Windows make.bat 2019-08-30 17:57:18 +02:00
fd48e17461 Buildbot: add script to update libraries and submodules
This is meant to replace the individual build steps for the various libraries
and submodules, so we can easily get the correct revisions associated with
different branches and releases.
2019-08-30 17:57:18 +02:00
53cd445785 Build: support updating for release branches in make_update.py 2019-08-30 17:57:18 +02:00
018fe9e006 Build: move "make update" on macOS and Linux to Python script
Differential Revision: https://developer.blender.org/D5545
2019-08-30 17:57:18 +02:00
410cde82e3 Fix "make deps" error when building deps with make and Blender with ninja 2019-08-30 17:57:18 +02:00
bb8a9a6f8b Fix BLI_array macro so can use BLI_strict_flags.h.
Was doing int comparision against size_t, so added casts.
2019-08-30 11:39:27 -04:00
OmarSquircleArt
8cd0da88e5 GPU: Split gpu_shader_material into multiple files.
This patch continue the efforts to split the `gpu_shader_material` file
started in D5569.

Dependency resolution is now recursive. Each shading node gets its own
file. Additionally, some utility files are added to be shared between
files, like `math_util`, `color_util`, and `hash`. Some files are always
included because they may be used in the execution function, like
`world_normals`.

Some glsl functions appeared to be unused, so they were removed, like
`output_node`, `bits_to_01`, and `exp_blender`. Other functions have
been renamed to be more general and get used as utils, like `texco_norm`
which became `vector_normalize`.

A lot of the opengl tests fails, but those same tests also fail in
master, so this is probably unrelated to this patch.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5616
2019-08-30 17:28:57 +02:00
ac646bc20d Cleanup: spelling 2019-08-31 01:21:42 +10:00
ec51355a47 UI: Outliner Natural Sort
Collection contents alphabetical sort now uses a Natural Sort that takes number magnitude into account.

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

Reviewed by Brecht Van Lommel
2019-08-30 07:50:11 -07:00
e0c792135a Sculpt: New brush cursor, active vertex and normal radius
This commit includes the new brush cursor, active vertex updates and the normal radius brush property for all sculpt brushes.
  -The new brush cursor previews the real stroke radius over the mesh and the sampled sculpt normal.
  -The active vertex is used in sculpt tools and brushes as a starting point for an operation, similar to a preselection. It is also mirrored following the enabled symmetry options to preview the stroke symmetry.
  -The normal radius brush property limits the radius that is going to be used to sample the sculpt normal and area center. It controls how closely the cursor follows the surface and it improves the behavior of most brushes, making them suitable for hard surface sculpting.

Reviewed By: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3594
2019-08-30 16:46:20 +02:00
8a07ec582e Install_deps: Do not take sub-versions '6' numbers of RHEL/CentOS versions as main '6' version. 2019-08-30 16:40:26 +02:00
66ec72045f Windows: Move building of blendthumb into the blender codebase.
Previously this was done in the deps builder due to the fact we needed
both 32 and 64 bit versions of this dll and CMAKE does not support that
in a single build folder. Now that 32 bit support has been dropped, this
can be safely moved into the codebase.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5633
2019-08-30 08:40:08 -06:00
26c110f2d2 Cleanup: Fix typo error 2019-08-30 16:19:35 +02:00
93f1d76bf0 DrawManager: UV Stretching
Calculating UV Stretching on large meshes showed garbage. The reason
is that the calculation is not thread save. Temporarily disable
threading for UV Stretching
2019-08-30 16:16:57 +02:00
30d900934c UI: assert on invalid click-step for integer buttons
Avoids T69305 going by unnoticed.
2019-08-30 23:41:22 +10:00
a209681bee UI: Remove Colons From Number Fields
Removes the colon separating label and number inside some number fields.

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

Reviewed by Brecht Van Lommel
2019-08-30 05:54:39 -07:00
f7b47ce16d Fix T69324: Console error in particle systems using "Follow Leader" boid
brain rule

Was missing from rna renaming in rBeee445590a29.
2019-08-30 14:33:45 +02:00
d5d3dc4189 GPencil: Use default material when slot material is empty
When a material slot is empty, the default material is used.

The default color used is Gray to get a good contrast in dense scenes with dark and white background.

Reviewers: brecht, dfelinto, mendio, pepeland

Differential Revision: https://developer.blender.org/D5625
2019-08-30 14:26:39 +02:00
4608220c9b Fix (unreported) 'Duplicate Particle System' operator not ensuring
unique name

This was leading to equally named particle systems, causing problems
later on.
Spotted while looking into T67958.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5632
2019-08-30 14:07:59 +02:00
b9ed30c25c Cycles: OpenCL Separate Compilation Debug Flag
OpenCL Parallel compilation only works inside Blender. When using cycles in a different setup (standaline or other software) it failed compiling kernels as they don't have the appropriate Python API and command line arguments.

This change introduces a `running_inside_blender` debug flag, that triggers out of process compilation of the kernels. Compilation still happens in subthread that enabled the preview kernels and compilation of the kernels during BVH building

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5439
2019-08-30 13:53:23 +02:00
040d075f17 GPencil: Fix unreported problem with Move to Layer popup
As the operator was designed to use only as popup, when it was used as menu option, the popup was displayed again.

Reviewers: mendio, pepeland

Differential Revision: https://developer.blender.org/D5630
2019-08-30 13:00:41 +02:00
44ace647a8 Fix interger number buttons increment/decrement arrows not working in
some cases

Since rB78b56fa7d973 defining a button with 'but->a1 = 0' wasnt
automatically setting its step value to 1 in 'ui_do_but_NUM' anymore.
Instead of handling this more forgiving in 'ui_do_but_NUM', went over
the remaining cases of buttons and and defined them with a step value of
1.

Fixes T69305

Reviewed By: brecht

Maniphest Tasks: T69305

Differential Revision: https://developer.blender.org/D5631
2019-08-30 12:45:38 +02:00
f033fa0fbc GPencil: Set active layer when click in Dopesheet keyframe area
Now, when clicking in the keys area, the layer is synchronized, not only in the left area with the names. This is one of the most requested feature by artists.

Also, removed some old comments.

Reviewers: brecht, angavrilov

Reviewed By: brecht

Subscribers: pepeland, mendio

Differential Revision: https://developer.blender.org/D5627
2019-08-30 11:58:02 +02:00
e33b4572af GPencil: Make visible active layer when hide others
To make more consistent the UI, when hide all other layers, the active layer is always set to visble.
2019-08-30 11:26:18 +02:00
cc49644551 Build: check necessary software is installed for make deps on macOS and Linux
To avoid errors deep into the build process. Fixes T69297.
2019-08-30 11:21:23 +02:00
a771fdb5dc Cleanup: clang-format, spelling 2019-08-30 10:55:31 +10:00
2fca31a5d6 Cleanup: no need to zero the area in beautify calculation
Also correct comment.
2019-08-30 10:50:06 +10:00
7c44182c4a GPencil: Minor Menu tweaks
- Added 'Hide Inactive Layers' operator and reordered 'Show/Hide' menu items
- Move 'New Layer' to bottom in 'Move to Layer' operator for consistency.
- Removed extra end points in some menu items (...)

Reviewers: antoniov, billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5626
2019-08-29 20:12:39 +02:00
33cd0535a0 Build: install_deps add lib64 paths for ldconfig
Building deps on some systems will install to opt/lib/library/lib64
directories rather than opt/lib/library/lib. This adds additional
lib64 paths for ldconfig to ensure the libraries are found at
runtime.
2019-08-29 11:15:43 -06:00
5c7852ef9c LibOverride: Create override operator: various fixes.
* `make_override_library_exec` was not properly cleaning `LIB_TAG_DOIT`
from all IDs in the Main DB.
* `BKE_override_library_create_from_tag` was doing dangerous things
(like iterating over a BMain listbase while adding items to it...).
* It would remap *all* local usages of overridden linked IDs to new
overriding local IDs, which was very inconvinient.

New handling of remapping now allows to only remap inside of the group
of IDs that is being overridden, in other words you can still have e.g.
other empties still instancing the same linked collection...
2019-08-29 18:11:12 +02:00
b9c400cee2 BKE_libblock_relink_ex: pass all remapping flags instead of a single boolean.
There is no reasons to limit access to remapping flags here, we may want
to use other options than only the ID_REMAP_SKIP_NEVER_NULL_USAGE one...
2019-08-29 18:11:12 +02:00
f4307d4bd9 LibOverride: Add entry to create a liboverride to object->relations menu. 2019-08-29 18:11:12 +02:00
497297850a Copy Scale: support copying arbitrary non-uniform scale as uniform.
Uniform scale is superior to non-uniform scale in that it works with
parenting without causing shear. Thus it is a valid desire in some
cases to turn arbitrary scale into guaranteed uniform scale.

Implementing this in the Copy Scale constraint allows one for instance
to 'inherit scale as uniform' by disabling Inherit Scale, and using
Copy Scale from parent with Offset and Make Uniform.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5614
2019-08-29 17:22:27 +03:00
c160853b04 UI: Correct Sequencer Text Alignment Tooltips
Pointed out in rBM5719
2019-08-29 10:06:09 -04:00
7745c6e35c Fix T56532: Boolean locks up Blender
Actual issue is with triangle beautify,
avoid precision error by scaling the epsilon
by the face area when it's over 1

The mesh in the report was very large (approx 2000 on each side),
causing precision issues with a fixed epsilon.
2019-08-29 23:11:18 +10:00
7f23c91478 LibOverride: Fix use-after-free error when freeing whole Main DB.
We do not want to touch to other ID pointers in that case, those might
have already been freed...
2019-08-29 14:49:54 +02:00
6b33bd1067 GPencil: For Stroke select don't display points
Now, when it's selected the stroke select mode, the points are not displayed and the stroke is fully selected automatically extending the selection.

Differential Revision: https://developer.blender.org/D5622
2019-08-29 10:44:24 +02:00
6b5e2f61b9 Cleanup: unused warning 2019-08-29 13:22:10 +10:00
c61a47d521 Cleanup: use custom data for object transform data 2019-08-29 13:22:10 +10:00
f4424727de Outliner: fix sync select on read file without loading UI
Tag for a complete sync when loading a file with load UI disabled.
2019-08-28 20:49:15 -06:00
5b96dc2381 Fix T69267: Missing Boids force field tooltip 2019-08-28 21:14:18 -04:00
749567e0b2 Move math and vector double routines into blenlib from delaunay code 2019-08-28 18:33:24 -06:00
07b1a5e05c Fix T69273: Rotate tool gizmo not showing incremental snapping tick marks 2019-08-28 20:36:56 -03:00
b1079ec3f2 Edit Mesh: AutoMerge and Split: Improve detection of the best split face 2019-08-28 20:07:43 -03:00
7aed8f69d1 Fix possible endless loop in AutoMerge and Split 2019-08-28 20:04:26 -03:00
a7ac8a22f8 GPencil: Animation menu updates
Animation menu updates for Edit Mode and Draw Mode (header and context menu):

- Rename menu items for a better understanding of what the operators really do.
- Change shortcuts (legacy from the old Grease pencil)

{F7708018}

Reviewers: antoniov, pepeland, billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5617
2019-08-28 22:33:44 +02:00
34ed58dcaf Fix T68971: Copy As New Driver from Material node creates a bad reference.
NodeTree structures of materials and some other data blocks are
effectively node group datablock objects that are contained inside
the parent block. Thus, direct references to them are only valid
while blender is running, and are lost on save.

Fix Copy As New Driver to create a reference that goes through
the owner datablock, by adding a new ID flag to mark private
pseudo-datablocks.

Also fix functions that return full paths to structures and
properties, e.g. used in python tooltips. Functions for paths
from ID to struct or property can't be changed because of
Animation Data related code.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D5559
2019-08-28 21:52:54 +03:00
69a966aca0 Transform: option to transform parent objects without children
Supports parent/child chains with mixed selections.

Currently accessible from the pivot popover
(may be moved along with the other options here).
2019-08-29 01:53:07 +10:00
01bd22929f Fix T69221: inconsistent handling of filenames derived from image names.
We did not properly sanitize image data block name when using it to init
file name...
2019-08-28 17:51:40 +02:00
d5192d6fd6 Fix strict compiler warning in release mode 2019-08-28 16:00:40 +02:00
6f97855d06 CMake: Remove unsupported G++ strict flag
According to the documentation this flag is only supported
by C and Objective-C languages:

  https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Solves noisy output on every C++ file in the project when
using latest GCC-9.
2019-08-28 15:47:05 +02:00
f88022b96f Cleanup: make transform data in object mode flag public
This fits better with intended flag usage.
2019-08-28 13:44:21 +10:00
ed066f231d Cleanup: remove automerge BMesh operator
Move logic into EDBM_automerge since this is meant to run after
transform and isn't a generic editing operation.
2019-08-28 13:20:05 +10:00
f93b69c17a Cleanup: split automerge logic into own file
This isn't closely related to selection & this file was over 5k lines.
2019-08-28 13:19:55 +10:00
697fd86506 Cycles: Stitching of subdivided and displaced meshes
This patch stitches the vertices along patch edges so that cracks can
no longer form when applying subdivision or displacement a mesh.

Subpatches are now formed in a way that ensures vertex indices along
subpatch edges are equal for adjacent subpatches. A mapping of vertices
along patch edges is built to preform stitching. Overall performance is
roughly the same, some gains were made in splitting, but some was lost
in stitching.

This fixes:
- T49049 (cracks between patches from material and uv seams)
- T49048 (discontinuous normals with true displacement)

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3692
2019-08-27 14:27:53 -04:00
7aef075ef6 Cleanup some outdated dead code and comments in Outliner. 2019-08-27 19:49:01 +02:00
9bda62c136 Fix T69176: Outliner->BlenderFile->Delete not working on some objects.
Object not referenced in any scene would not be deletable with previous
code... that was fine in 2.7x since it was not supposed to happen, but
now we can just use the nuclear `BKE_id_delete` for objects as well,
will take care of properly unlinking everything as needed.
2019-08-27 19:44:49 +02:00
490f966af5 Fix multires modifier using too much memory outside of sculpt mode
This reduce memory usage by about 25% in object mode for multires meshes.
2019-08-27 18:22:29 +02:00
c5b8d3b6d7 Cleanup: fix compiler warning 2019-08-27 18:22:29 +02:00
ec9e2dc3c0 Cleanup: spelling 2019-08-28 01:57:09 +10:00
179226977b Cleanup: clang-format 2019-08-28 01:57:09 +10:00
d5ed3de654 Fix Poly Build crash with empty meshes
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5609
2019-08-27 17:44:36 +02:00
6d37654ce8 UI: Area Join Tolerance
Allow area joining even if the areas are not quite perfectly aligned.

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

Reviewed by Brecht Van Lommel
2019-08-27 08:30:36 -07:00
a758dce0fa UI: Graph Editor Dot Scaling
Scale Graph Editor keyframe dots and handles based on Resolution Scale rather than Line Width.

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

Reviewed by Brecht Van Lommel
2019-08-27 08:05:17 -07:00
ce47dc5e70 LibOverride: Fix broken Hook modifier case.
Hook modifier uses same kind of parent inverse matrix as regular object
parenting, so we need to bypass that matrix re-computation when setting
the overridding object here as well.

Also cleanup some minor glitches in object parents' override_apply func.
2019-08-27 16:31:03 +02:00
d8baafd693 Edit Mesh: Poly build tool improvements
This commit changes the functionality of the Poly build tool to make it more suitable for retopology tasks:
  - Click and drag from a boundary edge extrudes a new quad
  - Click and drag on vertices tweaks the position
  - Ctrl + click adds geometry. There is a geometry preview in the gizmo. It also can automatically convert triangles to quads.
  - Shift + click deletes mesh elements (faces or vertices)
  - Updated preselection code. Different mesh elements take priority depending on the selected action.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5573
2019-08-27 16:24:16 +02:00
2a2fd75ef9 Cleanup: Fix build error with MSVC
`BLI_cpu_support_sse41` needs BLI_System.h.

Reviewers: brecht
2019-08-27 08:13:23 -06:00
d667105ba9 Fix T69210: Crash on Making GPencil Materials zero user
The evaluated data must not copy the material if it's NULL.

Still the stroke exists in the file, so maybe need some thinking in how resolve this, but anyway this is a different topic not related to bug.
2019-08-27 15:58:58 +02:00
0067b3b09b GPencil: Draw Mode menu update
- Rename menu 'Stroke' to 'Draw': the menu includes not only strokes related things and the name follows the usage in other paint modes in Blender.
- Remove duplicate animation operators.
- Menu updates to include clean up and layers operators that don't need previous selection.

{F7705120}

Reviewers: antoniov, pepeland, billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5599
2019-08-27 15:47:43 +02:00
8e4f3b2bb0 Fix T68763: Smooth Brush not working in LookDev or Rendered Mode
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5585
2019-08-27 15:02:38 +02:00
87cafe92ce Sculpt/Paint: Brush world spacing option for sculpt mode
New brush option to calculate the distance to generate a new brush step using the cursor position over the mesh instead of the screen coordinates. This avoids artifacts when sculpting across curved surfaces.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5432
2019-08-27 14:58:24 +02:00
Stefan Werner
cd890c4c25 Compositor: Reversed order of Normal and Albedo in Denoising Node. 2019-08-27 14:43:48 +02:00
Stefan Werner
d547f9d3d2 Fix T68944: Added check for SSE4.1 to denoising node.
Since OpenImageDenoise requires a CPU with SSE 4.1 or newer,
let the node act as passthrough on unsupported CPUs and display
a message in the node itself.
2019-08-27 14:03:49 +02:00
e39528b351 Fix marker name drawing without intended offset in some cases
Order of arguments matters here.
2019-08-27 13:04:43 +02:00
Yevgeny Makarov
ed92a1ff65 UI: fix jumping of play/pause buttons, add more space when showing subframes
Differential Revision: https://developer.blender.org/D5604
2019-08-27 12:52:42 +02:00
Robert Fornof
b19099346a UI: rename Energy to Power in context menu, for consistency
Differential Revision: https://developer.blender.org/D5310
2019-08-27 12:50:08 +02:00
Yevgeny Makarov
41b27a4def UI: add title to assign shortcut popup, tweak padding
Differential Revision: https://developer.blender.org/D5576
2019-08-27 12:50:08 +02:00
Alex Fuller
ee2bed7947 Fix undefined symbols for ccl::Node with some compilers and build options
Differential Revision: https://developer.blender.org/D5590
2019-08-27 12:50:08 +02:00
Yevgeny Makarov
9169d40175 UI: tweak warning messages style and layout in save/close dialog
Differential Revision: https://developer.blender.org/D5589
2019-08-27 12:32:42 +02:00
Yevgeny Makarov
1a40f089ea UI: improve layout of curve widget clipping options popup
Differential Revision: https://developer.blender.org/D5593
2019-08-27 12:32:35 +02:00
Yevgeny Makarov
811ac2965a UI: fix some menus and popups not taking into account UI scale for padding
Differential Revision: https://developer.blender.org/D5581
2019-08-27 12:27:23 +02:00
Yevgeny Makarov
9d5fb3491d UI: make layout in adjust last operator popup consistent with corner panel
Differential Revision: https://developer.blender.org/D5581
2019-08-27 12:25:52 +02:00
a7609598fa Cleanup: clang-format 2019-08-27 12:18:28 +02:00
Vinay Mulakkayala
af71be23c2 Build: run ldconfig for OpenImageDenoise in install_deps.sh
Differential Revision: https://developer.blender.org/D5580
2019-08-27 12:18:28 +02:00
1c21b79108 Fix T69165: wrong update function on Bone b-bone properties crashes.
Obvious fix suggested by @lichtwerk.
2019-08-27 12:52:06 +03:00
666be7d886 Fix T69166: built-in start-up file has unnecessary screen data 2019-08-27 19:20:38 +10:00
ebe7a407d7 Cleanup: use static set instead of list 2019-08-27 19:20:34 +10:00
90751d1835 Fix compiler error in Windows
This error was introduced in commit https://developer.blender.org/rB66700196074ad168f3322f2766846a0a07f7a00f
2019-08-27 11:14:36 +02:00
Stefan Werner
b91b9a8eca Compositor: Run only one instance of OIDN at a time.
Running multiple instances of OIDN simultaneously can use dozens
of GBs of memory. Since OIDN is multithreaded internally, we can run
only one instance at a time and should not lose much performance.
Fixing T69006
2019-08-27 11:06:48 +02:00
6670019607 Workbench: Specular Highlighting for MatCaps
With Blender 2.80 we introduced a more flexible matcap system. One
change we did was to multiply the matcap with the base color that was
shaded. As matcaps contains diffuse and specular lighting in a single
texture this lead to rendering artifacts. Artists were complaining that
everything looked to metalic.

We now support a separate `diffuse` and `specular` pass for matcaps.

`shaded_color = diffuse_light * base_color + specular_light`

For matcaps to support this feature they need to be multilayer openexr
files with 2 renderpasses (named `diffuse` and `specular`). In the future
we can change this to first pass/second pass in stead of this naming
convention.

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D5335
2019-08-27 08:56:56 +02:00
bc51250c1f UV Editor: Remove Unimplemented Show Edges Option
Show Edges option in the UV editor does not do anything. Only RNA/DNA
code could be found, so it is save to be removed.

Differential Revision: https://developer.blender.org/D5446
2019-08-27 08:35:47 +02:00
21daeaa95a Cleanup: rename max_len -> alloc_len 2019-08-27 15:38:38 +10:00
13f54f65c4 Cleanup: struct member name wasn't descriptive 2019-08-27 15:07:51 +10:00
2b618b0f2d Cleanup: unused warning 2019-08-27 15:01:41 +10:00
e57b14feae Edit Mesh AutoMerge: Improve Split Edges & Faces option
Now all wire edges linked to the merged vertex are used for split faces.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5603
2019-08-27 01:42:02 -03:00
60ba7d4539 Clean: style 2019-08-27 14:25:05 +10:00
2435850961 Fix crash transforming origins when no editable origins exist 2019-08-27 14:25:05 +10:00
963a991a20 Fix specific case where a vertex is ignored in snapping
Sometimes the index of the edge and the vertex may coincide.
2019-08-27 01:06:30 -03:00
3df04851cf Cycles/Windows: Fix over estimation of System RAM.
`system_physical_ram` reported 1024x more System RAM than what
was actually available.
2019-08-26 18:34:54 -06:00
d9be59e872 Fix T68687 Eevee: Modulo node behaves unexpectedly/inconsistently
This was a regression.
2019-08-27 01:50:01 +02:00
ce2368cf69 Fix T69122: Area Join Error on Invalid Cursor Position
Improved error handling of Join Area operator in cased it is passed cursor position that is not valid.

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

Reviewed by Brecht Van Lommel
2019-08-26 13:39:25 -07:00
378a13483f Fix T69185: Cycles kernel OpenCL compile error after recent changes 2019-08-26 22:06:02 +02:00
c69d75e880 GPencil: Fix typo error in previous commit 2019-08-26 21:04:04 +02:00
e148873f3f GPencil: Temporary fix to keep running Cycles + GPencil object in background.
This is a temporary solution to keep the render running.
2019-08-26 21:00:20 +02:00
8c7cbad542 Gpencil: Splitting and rearranging Context Menu in Edit Mode
Following the changes in the Edit Mode menus on the header, this patch split the current context menus into Point and Stroke and also rearrange the operators.

{F7704949}

Reviewers: antoniov, pepeland, billreynish

Reviewed By: billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5596
2019-08-26 20:53:16 +02:00
7f840426fd GPU: add mechanism for splitting up big gpu_shader_material.glsl file
Compiling this big file for every Eevee material is bad for performance, and
now that we are adding more nodes it gets worse. This patch adds a simple
mechanism to split up that file, and use only the parts used by shader nodes.

When a function is used by GPU_link, we detect which GLSL file it came from
and use it in GLSL code generation automatically. Dependencies between GLSL
files are manually specified, and function names must be unique across all
GLSL files.

Most of the actual splitting up will be done in later commits.

Differential Revision: https://developer.blender.org/D5569
2019-08-26 19:18:34 +02:00
6b189d2bcf Edit Mesh: New option "Split Edges & Faces" to "AutoMerge"
Ref T66423

Differential revision: https://developer.blender.org/D5562
2019-08-26 14:15:25 -03:00
7273dbd47b Fix T69051 Vertex Paint: Selection not show in vertex select mode. 2019-08-26 18:43:53 +02:00
1a6491639a Fix T68954 UVEdit: Auto Smooth option conflicts with uvs display 2019-08-26 18:43:53 +02:00
d5f3f4410d Missed adding file in recent commit 2019-08-27 01:53:00 +10:00
6d87ad08a4 Keymap: Use Ctrl-Period to toggle origin editing
Add a key binding since this option is typically for quick adjustments.
2019-08-27 01:49:21 +10:00
7fee153bf5 3D View: show selected object axis when affect origins is enabled
This replaces temporarily enabling draw-axis.
2019-08-27 01:46:03 +10:00
487cd7237c DRW: check exact draw flags before getting wire-frame color
Only some options need this.
2019-08-27 01:46:03 +10:00
c32377da98 Cycles: support move semantics for device_memory
Ref D5363
2019-08-26 17:42:52 +02:00
f6da680946 Cycles: refactor of BVH building to prepare for Optix
Ref D5363
2019-08-26 17:39:57 +02:00
2dd1e6b376 GPencil: Add missing update of modifiers
This was missing in previous commit for T66294
2019-08-26 17:31:55 +02:00
8f8e6a7c7b Fix Cycles session being (re)created twice
In most cases this only makes a small startup time difference, but there is
no reason to do this.

Ref D5363
2019-08-26 17:12:45 +02:00
2b55f621fe Cleanup: fix compiler warnings 2019-08-26 16:08:17 +02:00
1ff939f3f7 Cleanup: avoid unnecessary primitive type lookup and variable initialization
Ref D5363
2019-08-26 16:07:01 +02:00
6055db084d Cycles: optimize Sobol loop
Ref D5363
2019-08-26 16:07:01 +02:00
030a023eb2 Cleanup: add zero bit counting functions 2019-08-26 16:07:01 +02:00
d133934ea4 Cycles: code to optionally zero initialize some structs in the kernel
This will be used by Optix to help the compiler figure out scoping. It is not
used by other devices currently, but worth testing if it helps there too.

Ref D5363
2019-08-26 16:07:01 +02:00
39439a3afe Fix T69156: Blender crash when baking rigid body world.
Issue was exposed by recent own rB03bf84db86b commit, but was actually
present in RNA API for PointCaches since (probably) ages: whole accessor
code here was assuming that owner ID was an Object, when it is actually
a scene for RigidBody simulations...

Had also to make `BKE_ptcache_id_find()` and friends a bit more
flexible, now they also accept a NULL object pointer parameter...
2019-08-26 16:03:58 +02:00
51d9f56f87 GPencil: Invert Paste operator and make Paste to Active default
Before there were two options: Paste to original layer called "Paste" and Paste to active   layer called "Paste & Merge"

Now, by default the paste is in active layer and the "Paste & Merge" has been renamed "Paste".

For old "Paste", now is called "Paste by Layer" and it's not the default value anymore.

Note: Minor edits to add icons not present in Differential revision.

Differential Revision: https://developer.blender.org/D5591
2019-08-26 15:49:16 +02:00
742119bcb5 Fix T68826 Eevee: Multi-Mat not working if switching from Solid shading
The correct fix would be to avoid all those hacks but this is needed if
we want to be able to parallelize object vbo extractions.

This is the fixed version of the hack. The issue was that the ibo ranges
were saved before the batch were reset and the IBO was discarded, leading
to a read after free error. All previous reported crash were tested and
are now not reproductible.
2019-08-26 15:43:28 +02:00
b9f61eb874 Cycles: Fix Architecture logging on x64.
x64 builds with WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 not defined
since SSE2 is the lower bar for x64 cpus. Turning the architecture
logging related if into the last if in the architecture detection
chain, which will never execute unless you turn off all kernels
in de debug flags.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5579
2019-08-26 07:22:44 -06:00
16c1b10ed2 Fix T69146: Segment Fault using Undo for file with several scenes and script.
The specifc bug here came fro; some IDProperties ID pointer storing
references to workspaces.

But that was actually a main loophole in that 'unndoing data while
keeping same UI' process, as we never know who might store a pointer to
one of those datablocks that we want to keep the 'old' version off.

It might actually be ever more needed when we start undoing (changing)
only the IDs actually modified in an undo step...

Notes:
* While not ideal, I think we can afford an extra looping over the whole
Main DB here... Remapping process in itself is fairly cheap, thanks to
the hashes.
* This commit is considered rather risky (especially thanks to 'private'
IDs), think it should work fine for now, unless some IDPointers start
storing references to private IDs...

Once D5559 is in, we shall do another pass here, probably also forbids
assigning private IDs to IDProperties, etc.
2019-08-26 14:51:30 +02:00
81e2fdcd1d Cleanup: simplify perlin noise function definition
Ref D5363
2019-08-26 14:13:00 +02:00
7b150e8767 Cleanup: use saturate3() for float3 clamping
Ref D5363
2019-08-26 14:11:08 +02:00
b5daed9680 Cleanup: fix compiler warning 2019-08-26 13:47:00 +02:00
2778754925 Cleanp: fix compiler warnings 2019-08-26 11:27:04 +02:00
fd52dc58dd Cycles: GPU code generation optimizations for direct lighting
Use a single loop to iterate over all lights, reducing divergence and amount
of code to generate. Moving ray intersection calls out of conditionals will
also help the Optix compiler.

Ref D5363
2019-08-26 10:26:53 +02:00
f491c23f1e Cycles: inline more functions on the GPU
This makes little difference for CUDA and OpenCL, but will be helpful
for Optix.
2019-08-26 10:26:53 +02:00
2b999c6a68 Cycles: change svm node decoding for more efficient code generation on GPU
These functions no longer accept NULL. They were renamed for clarity and to
avoid hidden merge issues.

Ref D5363
2019-08-26 10:26:53 +02:00
db257e679a Cycles: remove workaround to pass ray by value
CUDA is working correct without it now, and it's more efficient not to do this.

Ref D5363
2019-08-26 10:26:53 +02:00
edbb755dfe Cycles: tweaks for better GPU code generation
Uninitialized variables are harder to handle for the compiler.

Ref D5363
2019-08-26 10:26:53 +02:00
b05e7ea719 Cycles: fixes for building kernel without certain features
Ref D5363
2019-08-26 10:10:35 +02:00
7a15b938bd Cleanup: fix use of wrong constant
Ref D5363
2019-08-26 10:10:35 +02:00
7b0cd21750 Cleanup: fix compiler warning 2019-08-26 10:10:35 +02:00
dc216c89e0 Fix render test Python error on crashes 2019-08-26 10:10:35 +02:00
b2608af702 Gizmo: match the DOF gizmo size with the non-gizmo indicator 2019-08-26 17:12:42 +10:00
c70e6a2e21 Fix T69153: Camera DOF gizmo fails
Regression from bc3139d792
2019-08-26 17:04:47 +10:00
abd1a2d07d Gizmo: report error when property isn't found
Also add assert so this doesn't go unnoticed, see: T69153
2019-08-26 16:58:26 +10:00
db851c78b4 Transform: support snapping origins onto the objects geometry
Normally it wouldn't make sense for the object to snap onto it's self,
when moving origins this is a common use-case.
2019-08-26 14:40:00 +10:00
7b61fe1638 Cleanup: use BLI_assert 2019-08-26 14:32:35 +10:00
8d03e04493 Fix assert restricting allowed operation 2019-08-26 01:18:40 -03:00
22822b0572 Cleanup: unused arg 2019-08-26 12:20:02 +10:00
af8e8be7b1 Cleanup: Move RNA Manual References to Modules
This file used to be stored in the Add-ons repository
to allow easy commit access for updating.
Since then, we have created an automated process,
the script can now easily be updated by anyone.

This also makes more logical sense to store the file here
as it is not an add-on.
2019-08-25 15:05:25 -04:00
fd9614de0c UI: Dim Disabled Menu Items on Hover
Dims the text and background of disabled menu items while mouse is hovering.

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

Reviewed by William Reynish
2019-08-25 12:01:29 -07:00
b876fe3f3d GPencil: Show edit points in Sculpt only if mask is enabled
If the masks are disabled, the edit points must not visible.
2019-08-25 20:56:09 +02:00
de0fc96dfe cleanup: collada: removed unused public class variable 2019-08-25 19:38:12 +02:00
2f1604cef7 fix: Removed Debug statement from Collada CMakeLists. cmake now silently determines which collada library version it uses 2019-08-25 19:38:12 +02:00
f2c3dc94b1 Fix T69127: Node sockets location bug after a keyframe is inserted 2019-08-25 16:37:06 +01:00
63533a0c7d Cleanup: Clarify alloc comment text 2019-08-25 17:13:13 +02:00
a67f218b54 GPencil: Use evaluated data for Sculpt Brushes
As part of T66294 is needed to use the evaluated data for Sculpt brushes to make possible to Sculpt a transformed stroke.

Without this commit, it was impossible sculpt the stroke if the modifier moves away the stroke point from original position. Also, some calculation is done in order to determine the rotation to transform the brush effect too.
2019-08-25 16:04:23 +02:00
6917ac06a2 Fix error accessing a named UV layer when baking 2019-08-25 16:45:47 +10:00
755c11c3db Curve: remove tessface calculation when calculating modifiers
- All parts of the code that need tessface should calculate it on demand.
- The check for tessloopnormal mask isn't correct
  (since this is loop data, not tessface data).
2019-08-25 16:45:47 +10:00
6eadd40597 Cleanup: redundant struct declarations 2019-08-25 16:45:47 +10:00
f1ddc6ed0a Cleanup: clang-format 2019-08-25 16:45:47 +10:00
8df6673165 Cleanup: skip adding tessface loop & color layers
Also correct check in unused poll function
2019-08-25 16:45:47 +10:00
7585d47b36 Cleanup: remove UV name syncing function
MTFace's on the mesh are now only used for conversion.
There is no need to keep both UV layers in sync at once.
2019-08-25 16:45:47 +10:00
5572986aad Cleanup: rename mesh looptri/tessface functions
Use consistent terminology.
2019-08-25 16:45:47 +10:00
2626a6fca2 Cleanup: remove tessface check when entering edit-mode 2019-08-25 15:49:32 +10:00
bada34c766 Cleanup: remove BKE_mesh_calc_normals_tessface
This was used for versioning, now normals are calculated after
initializing MPoly data.
2019-08-25 15:49:26 +10:00
4ab50eb7fa Cleanup: remove unused ED_mesh_*_tessface functions 2019-08-25 15:06:12 +10:00
f8d7993eec Cleanup: remove unused DM_to_mesh function 2019-08-25 14:09:09 +10:00
19f27cf3e9 RNA: remove Mesh.update() calc_loop_triangles argument
This calculated tessfaces, not loop-triangles.

Remove this since they aren't accessible from RNA anymore.
2019-08-25 12:39:15 +10:00
17e1c97e43 Cleanup: remove USE_TESSFACE_DEFAULT define 2019-08-25 12:21:09 +10:00
d42a23b31a Cleanup: remove tessface loop from set-smooth function 2019-08-25 12:08:18 +10:00
6bb2912704 GPencil: Fix unreported unable to deselect when masking is OFF
When the mask is disabled, all select operators must be disabled, but the deselect all operator must work or it's impossible to deselect.
2019-08-24 17:59:32 +02:00
a53ed1e049 Fix crash when snapping ruler 2019-08-24 09:21:13 -03:00
3437fcf2f1 BKE_bvhutils: implement hiden check
Accidentally unused in rB7c3bbe93aaa2
2019-08-24 09:20:55 -03:00
091e7979d3 GPencil: Use evaluated data in selection
Now the selection is using the position after evaluating the modifiers and makes possible to select a stroke point that has been moved from the original location.

Related to T66294
2019-08-24 13:46:00 +02:00
b1ed72f152 Cleanup: use eval as suffix
Follow conversion already used in most places.
2019-08-24 13:27:08 +02:00
8b806b8e64 Fix object origin transform with vertex snapping 2019-08-24 21:23:04 +10:00
d9d1c68809 UI: Add Meta strip icon to Sequencer sidebar
Patch by Peter Fog (tintwotin).

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

Reviewers: Brecht Van Lommel (brecht), William Reynish (billreynish)
2019-08-24 12:25:51 +02:00
b7f786c0b1 GPencil: Fix typo error 2019-08-24 09:02:42 +02:00
ae0b855a32 Fix T68807: smoothing group issue
Showed in OBJ export.
Caused by comparison mistake in rB2e91fc39ac7.

Reviewers: mont29

Maniphest Task: T68807

Differential Revision: https://developer.blender.org/D5561
2019-08-24 08:50:58 +02:00
c9923baf84 Fix BKE_bvhtree_from_editmesh_get not setting cached value
The stored value was always false because of shadowing.

Also disable unused code.
2019-08-24 12:16:30 +10:00
fd43854fa3 Cleanup: use doxy sections for editfont 2019-08-24 12:06:58 +10:00
dc434bc273 Cleanup: correct use of term 'split' 2019-08-24 12:06:58 +10:00
67d9647ae4 Cleanup: use eval as a suffix
Follow conversion already used in most places.
2019-08-24 12:06:58 +10:00
a68e8ac993 BKE bvhutils: create and use new BKE_bvhtree_from_editmesh_get
With this function it is easier to create and have control over editmeshes `BHVtree`s.
2019-08-23 19:51:18 -03:00
4c353205ea UI: Various tooltip corrections and fixes
Patch by Yevgeny Makarov (jenkm)

Differential Revision: D5514
2019-08-24 00:45:21 +02:00
bf242362f6 UI: Sequencer: Move header spacer in to Preview modes
Patch by Peter Fog (tintwotin)

Differential Revision: D5511
2019-08-24 00:24:43 +02:00
beb025b3ab UI: Clip Editor: Move fractional zoom values into sub-menu
Patch by Peter Fog (tintwotin)

Differential Revision: D5525
2019-08-24 00:22:38 +02:00
acdb14d264 Transform: option to transform origins in object mode
Currently supports mesh, armature, lattice, curve & metaballs.

Access from pivot popover.
2019-08-24 07:34:43 +10:00
71c43e9225 Cleanup: unused args 2019-08-24 07:34:43 +10:00
e270b6f34c Cleanup: Fix PEP8 issues 2019-08-23 23:24:07 +02:00
ee4ec69b28 Fix T66924 : Move GPencil Modifiers evaluation to Depsgraph
Before, the evaluation of modifers were done in draw manager. The reason of the old design was grease pencil was designed before depsgraph was in place.

This commit moves this logic to depsgraph to follow general design and reduce Draw Manager complexity. Also, this is required in order to use modifiers in Edit modes.

Really, there is nothing really new in the creation of derived data, only the logic has been moved to depsgraph, but the main logic is the same. In order to get a reference to the original stroke and points, a pointer is added to Runtime data as part of the evaluated data. These pointers allow to know and use the original data.

As the modifiers now are evaluated in Depsgraph, the evaluated stroke is usable in Edit modes, so now it's possible to work with the evaluated version instead to use a "ghost" of the final image over the original geometry as work today.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5470
2019-08-23 23:10:48 +02:00
d795dd1fa7 GPencil: Object data UI updates
Some tweaks for the Grease Pencil object data UI:
- Update main layers controls for consistency (Opacity, Blend mode).
- Move "Show only On Keyframed" checkbox to Display section.
- Change "Duplicate Layer" icon in Layer menu.

{F7695928}

Reviewers: antoniov, pepeland, billreynish

Reviewed By: billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5571
2019-08-23 23:01:37 +02:00
f16a28c4af Revert "Fix T68826 Eevee: Multi-Mat not working if switching from Solid shading"
This reverts commit d357e7b065. This caused crashes in UV editor drawing and
updates in lookdev mode.

Fixes T69087, T69083, T69088, T69096.
2019-08-23 20:32:51 +02:00
777ca2dcdb Snapping System: Improve drawing indicating Perpendicular snap
Since pependicular snap depends on `snapTarget` it is important to indicate where this target is so as not to confuse users.
So draw a pivot where the target is and a dotted line toward the perpendicular snap point.

Reviewers: campbellbarton, brecht, billreynish

Differential Revision: https://developer.blender.org/D5557
2019-08-23 15:20:37 -03:00
9574ac1c8d LibOverride: Disable the re-parenting of overriding objects to the instancing empty.
Does not seems to be that useful... And it's breaking the objects also
'parented' to an armature through a modifier...
2019-08-23 18:58:21 +02:00
Yevgeny Makarov
e33fc3c37b UI: layout padding changes to autorun dialog, to match save dialog
Differential Revision: https://developer.blender.org/D5568
2019-08-23 18:42:26 +02:00
c3e4a26816 UI: layout and text changes for unsaved changes dialog
Patch by Harley Acheson, with additional changes by Yevgeny Makarov.

Differential Revision: https://developer.blender.org/D5133
2019-08-23 18:36:30 +02:00
77f01748e7 GPencil: Fix unreported set origin from Python
The set origin was not working from python because the operator was checking if the stroke was valid in the console area.

As the stroke only can be valid for GP obects, this check is not needed.
2019-08-23 17:20:12 +02:00
18f4182e98 LibOverride: Fixed bug in removing override op operator.
In case the property is a RNA pointer, `RNA_path_resolve()` will try to
resolve it and return that pointer, instead of returning expected
container... That is a bad inconsistency in the rNA path API, but no
proper way to solve it for now...
2019-08-23 15:55:00 +02:00
6d64da1e67 Fix potential issues when loading files with missing libraries
This is a continuation of rB39f005eae8eed8b939579aff8c9a05a4f50e5e38

Now all the fields where we check for object type in RNA (like
rna_Curve_object_poll) will have a safe guard for when this isn't the
case.  For example when loading files that has missing object libraries
and all missing objects are replaced with empties (placeholders).

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5425
2019-08-23 15:54:11 +02:00
8eb2296872 UI: use consistent "Color Burn" name for blend mode
Previously it was named just "Burn" in some places.

Differential Revision: https://developer.blender.org/D5186
2019-08-23 13:14:15 +02:00
2f8ea1c11e Fix T67140: transforming bone does not update bone tab in properties editor 2019-08-23 13:04:54 +02:00
3d1cb78336 Fix T69075: OSL build with install_deps.sh failing at runtime
Now uses the same cmake flags as make deps.
2019-08-23 12:04:54 +02:00
162c320a75 LibOverride: Add some basic non-nodal material properties to override realm. 2019-08-23 10:27:22 +02:00
a1aa4a2597 RNA: Cleanup PointerRNA struct
The old layout of `PointerRNA` was confusing for historic reasons:
```
typedef struct PointerRNA {
  struct {
    void *data;
  } id;

  struct StructRNA *type;
  void *data;
} PointerRNA;
```

This patch updates it to:
```
typedef struct PointerRNA {
  struct ID *owner_id;
  struct StructRNA *type;
  void *data;
} PointerRNA;
```

Throughout the code base `id.data` was replaced with `owner_id`.
Furthermore, many explicit pointer type casts were added which
were implicit before. Some type casts to `ID *` were removed.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D5558
2019-08-23 09:52:12 +02:00
232049dd94 Armature: use BKE_armature_transform when applying transformation
Keep ED_armature_transform for RNA Armature.transform
since it operates on edit-bones in edit-mode.

Rename ED_armature_transform_bones to ED_armature_edit_transform
since it wasn't obviously an edit-mode function.
2019-08-23 12:03:11 +10:00
30582c59cc Armature: add BKE_armature_transform
ED_armature_transform uses edit-mode conversion which re-creates bones.
Needed for efficiently transforming object-data in object-mode.
2019-08-23 11:53:28 +10:00
adfb9ec87c Cleanup: const args, naming, doxy groups, clang-format 2019-08-23 09:09:38 +10:00
1de7717ed7 Outliner: new icons for sequences and contraints
Adds a new icon for the action constraint so the icon draws with the
constraints color. Also adds two new icons for sequencer meta strips
and duplicate strips for use in the outliner sequence display mode.

The meta strip icon could be used in the sequencer sidebar.
2019-08-22 14:40:33 -06:00
22ebc57987 UI: Changes to Area Options Menu
Adds more options to the context menu that pops up on area edges. Both Split types, Join, and Swap.

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

Reviewed by Brecht Van Lommel
2019-08-22 13:19:11 -07:00
7c3bbe93aa Cleanup/Refactor: Simplify/deduplicate bvhutils code
This is a step that allow using `bvh_cache` for `EditMeshe`s.
2019-08-22 14:07:40 -03:00
d09b1ff1a6 Cleanup: undeclared variable warnings
Forward declare variables, or make them static.
2019-08-23 02:29:45 +10:00
4457c92fa3 GPencil: Fix missing variable due typo error 2019-08-22 18:28:19 +02:00
5888a2283e Cmake/MSVC: Enable Edit and Continue for debug builds.
This change switches the debug symbol format from /Zi to /ZI for
debug builds of blender, allowing Edit and Continue to work.

This allows limited [1] code changes in the debugger without
having to stop the process and recompile a new binary leading
to improved developer productivity.

All MSVC versions we support support this flag, Clang on
windows does not mind the /ZI flag, but doesn't currently
emit the required information to have this feature work.

[1] https://docs.microsoft.com/en-us/visualstudio/debugger/supported-code-changes-cpp
2019-08-22 10:20:40 -06:00
ec07340004 UI: Remove "Show Frame Indicator" option
This option was doing nothing in Blender 2.80.
I don't really see a reason for keeping it around.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5552
2019-08-22 17:55:21 +02:00
e6f3d8b3e1 Revert "Fix T68971: Copy As New Driver from Material node creates a bad reference."
This reverts commits 54fd8176d7, 4c5becb6b1 and 8f578150e.

Those kind of commits must be reviewed and approved by project owners.

That one:
* Broke Collada building by not properly updating all calls to modified
function.
* Broke *whole* ID management by not properly updating library_query.c.

And in general, I am strongly against backward ID pointers, those are
*always* a serious PITA for ID management. Sometimes  they cannot be
avoided, but in general other ways to get that kind of info should be
investigated first.
2019-08-22 16:07:36 +02:00
eae9b86297 Fix crash using 'Mesh > Normals > Point to Target' from the header menu
This was working from Alt+N menu but was passing wrong ARegion
(alongside wrong mouse coords) to ED_view3d_win_to_3d_int when called
from the header menu.

Operator context INVOKE_REGION_WIN takes care of this.

This also fixes wrong behavior of 'Mesh > Normals > Rotate' when called
from the header menu.

part of T69019

Reviewers: billreynish, mont29

Maniphest Tasks: T69019

Differential Revision: https://developer.blender.org/D5555
2019-08-22 16:01:47 +02:00
54fd8176d7 NodeTree: also assign the owner pointer when copying. 2019-08-22 16:55:02 +03:00
33a287e5c0 Snapping System: Return element type in 'ED_transform_snap_object_project_view3d_ex' 2019-08-22 10:53:21 -03:00
8965a81271 Cleanup: Split some code out of rna_access.c
That file was getting out of control, now comparison/override RNA code is
in `rna_access_compare_override.c`. 1K lines of code for now, but that
area is likely to grow more in the future...

Note that we can probably split more out of `rna_access.c`, but for now
that will do.
2019-08-22 15:33:44 +02:00
Dalai Felinto
662d94e020 Multi-View user interface minor tweak
There is no reason to not expand this enum as we did for 2.79.
It is self explanatory enough and it has only two options.
2019-08-22 10:16:43 -03:00
4c5becb6b1 Fix missing argument.
Missed because of broken dependency tracking in msvc build process.
2019-08-22 16:14:48 +03:00
8f578150ea Fix T68971: Copy As New Driver from Material node creates a bad reference.
NodeTree structures of materials and some other data blocks are
effectively node group data block objects that are contained inside
the parent block. Thus, direct references to them are only valid
while blender is running, and are lost on save.

Fix Copy As New Driver to create a reference that goes through
the owner data block, by adding a new runtime field to bNodeTree.
2019-08-22 15:46:37 +03:00
443586f34d LibOverride: Enforce full override operations check on file save.
We try to avoid diffing too much things during edition, but when saving
a file we need to check all possible overridable IDs to ensure we have
all needed override operations...

Was pretty sure that was already in code, but apparently not (or it got
lost at some point...).
2019-08-22 14:34:09 +02:00
e3442c8864 LibOverride: Cleanup: tget rid of G.main usage when we can get it from context. 2019-08-22 14:33:56 +02:00
df5237ec5e LibOverride: Fix broken logic in code checking and adding new override ops.
When we wanted to force all overidable IDs to be checked, code would end
up checking the whole Main DB, instead of only overrideable ones.
2019-08-22 14:33:56 +02:00
OmarSquircleArt
08ab3cbcce Shading: Add object color to Object Info node.
The object color property is added as an additional output in
the Object Info node.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5554
2019-08-22 14:26:09 +02:00
a244384864 Fix T68969: current value '0' matches no enum in 'ToolSettings', '(null)', 'snap_node_element'
I don't think a versioning solution is necessary in this case.
But it can still be implemented.
2019-08-22 09:10:46 -03:00
75127b6be7 Revert "Fix grid snap value in recent snapping updates"
This reverts commit 48a7f979a5.

Another solution to come.
2019-08-22 09:10:46 -03:00
OmarSquircleArt
c6f8ea7b45 Fix T69044: OpenCL fail due to bad fract function.
The fract function in OpenCL does more than just return the fraction.
It also writes the floor to the second argument. Which wasn't put
in consideration.

Instead, we use a simple `a - floor(a)` like the Math node.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5553
2019-08-22 13:51:39 +02:00
b208096538 Transform: Snap Perpendicular: Avoid snapping to snapTarget 2019-08-22 08:07:41 -03:00
3f9c0ab993 Transform: Snap Perpendicular: Use snapTarget instead of center_global 2019-08-22 08:00:53 -03:00
d13952e603 LibOverride: Cleanup: rename parameters in RNA apply code.
We cannot use local/reference here, that is very confusing, since at
that stage current local is kind of src of data for the future local ID,
that is currently a mere copy of the linked data... ;)

So we are much better with src/dst names here.
2019-08-22 12:21:25 +02:00
Charlie Jolly
2ba233a31f Nodes: Support for socket shapes other than circle
Previously there was already "draw_shape" property,
but it was doing nothing. This commit renames the
property to "display_shape". Furthermore, different
shapes like SQUARE and DIAMOND are supported now.

Currently, the shapes are drawn using the shader that also
draws keyframes. In the future we might want to separate
this.

The new shapes are not used anywhere yet, but they can
be used by addon developers and will probably be useful
when we want to support different kinds node systems later.
For example, different shapes can be used to distinguish
between data and control flow.

Differential Revision: https://developer.blender.org/D2829
2019-08-22 11:10:11 +02:00
0356c8f25b Cleanup: remove edit-mode check in vertex coordinate access
This makes the function more predictable since other object
types don't access edit-mode data.
2019-08-22 13:23:27 +10:00
c2442541a6 Cleanup: typo in last commit 2019-08-22 09:13:17 +10:00
189aa32a3a Cleanup: vertex coordinate access, naming & minor changes
This also splits vertex access and allocation so it's possible
to copy coordinates into an existing array without allocating it.
2019-08-22 06:48:10 +10:00
4a2d1953f3 Cleanup: use doxy groups 2019-08-22 04:56:18 +10:00
e6f8f18902 Cleanup: clang-format 2019-08-22 04:38:05 +10:00
OmarSquircleArt
e83f092201 Shading: Add Volume Info node.
The Volume Info node provides the Color, Desnity, Flame, and Temperature
of smoke domains.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5551
2019-08-21 20:22:24 +02:00
OmarSquircleArt
133dfdd704 Shading: Add White Noise node.
The White Noise node hashes the input and returns a random number in the
range [0, 1]. The input can be a 1D, 2D, 3D, or a 4D vector.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5550
2019-08-21 20:04:09 +02:00
OmarSquircleArt
7f4a2fc437 Shading: Add more operators to Vector Math node.
Add Multiply, Divide, Project, Reflect, Distance, Length, Scale, Snap,
Floor, Ceil, Modulo, Fraction, Absolute, Minimum, and Maximum operators
to the Vector Math node. The Value output has been removed from operators
whose output is a vector, and the other way around. All of those removals
has been handled properly in versioning code.

The patch doesn't include tests for the new operators. Tests will be added
in a later patch.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5523
2019-08-21 19:36:33 +02:00
6785da095d Cleanup: remove old Windows scons installer, this is handled by CMake now 2019-08-21 18:44:22 +02:00
6086a6d939 Cleanup: Fix build error with MSVC
Previously eigens internal include order somehow implicitly provided
M_PI and friends. The recent eigen version bump broke this implicit
behaviour, better to be explicit that we need the math defines for MSVC.
2019-08-21 10:38:33 -06:00
34921e9e56 Timeline: refactor cache drawing
I did this mostly to get to know the point cache from this direction.
This should not change anything from the user perspective.
2019-08-21 17:21:50 +02:00
922da6dfb4 LibOverride: Fix inverted logic in RNA collection operation application.
Note to self: need to recheck the namings of whole override code,
currently this is way to confusing and inconsistent.
2019-08-21 17:13:51 +02:00
654fd58270 Cleanup: minor error in assert message in libOverride collection code. 2019-08-21 17:13:51 +02:00
d357e7b065 Fix T68826 Eevee: Multi-Mat not working if switching from Solid shading
The correct fix would be to avoid all those hacks but this is needed if
we want to be able to parallelize object vbo extractions.
2019-08-21 15:53:57 +02:00
8a11e70252 GPU: Fix Element index range calculation
Fix T68880 2D line display is broken
2019-08-21 14:47:57 +02:00
b19c437eff Update Eigen to 3.3.7
This is in preparation for the QuadriFlow remesher lib.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5549
2019-08-21 14:15:28 +02:00
1658fd1f7e Fix T68837 Eevee: Fix "GPU failed to find function math_max" message
Was a missing rename.
2019-08-21 13:39:09 +02:00
de232f8887 Update CUEW to latest version 2019-08-21 11:49:29 +02:00
ecfe020e6c Fix T68951: Incrementing int property causes overflow
This was probably introduced in rBfdef1a6712b.
2019-08-21 11:31:10 +02:00
8f50cdd7d5 Fix T68943: GPencil Time modifier gets strange value in offset parameter
This is due a limitation in the RNA property when the range is too extreme. As we don't need that, the value was set to SHRT_MAX frames as maximum offset.

Also fixed the same problem in other modules of Grease Pencil.
2019-08-21 11:08:10 +02:00
Julian Eisel
6e8a76c96a UI: Don't left align operator buttons in toolbars
This hack would make operator (push down) buttons without icons align
their text to the left in toolbars. Everywhere else in Blender, we
center it by default.

We barely use operator buttons in toolbars anymore. Even if we do and
there's a good reason to make text left aligned, it's better to use
`uiLayout.alignment = 'LEFT'` to achieve the same effect, but without
lowish-level hacks for a specific region type.

Differential Revision: https://developer.blender.org/D5527
2019-08-21 10:35:46 +02:00
Demeter Dzadik
f041d2f116 Fix T65671: Armature X-Mirror inconsistencies
This fixes bendy bone properties not being mirrored correctly

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5408
2019-08-21 09:59:11 +02:00
3d8f158697 GPencil: add new filter by material to modifiers
This commit adds a new filter by material using the name and not only the index.

Reviewers: antoniov, pepeland

Differential Revision: https://developer.blender.org/D5544
2019-08-21 08:41:19 +02:00
8ffbe39834 Cleanup: pass lattice directly vertex coord utilities 2019-08-21 15:05:52 +10:00
666d74e4d6 Fix T68444: outliner bone visibility not updating
Tags for update when pose bone visibility is toggled in the outliner.
2019-08-20 22:30:32 -06:00
55c626770e Fix T68429: wrong pose bone hide icon in outliner
The hide icon was drawing instead of the disable in viewports icon.
2019-08-20 22:17:27 -06:00
50fdbf3ec0 Cleanup: use const arguments for vertex coords 2019-08-21 11:58:41 +10:00
0050a044fa Cleanup: remove unused derived-mesh API calls 2019-08-21 11:41:40 +10:00
48a7f979a5 Fix grid snap value in recent snapping updates
Increase the size of the snap mode so the flag can be used.
2019-08-21 11:41:40 +10:00
899d2461bf Fix T68911: "illegal recursive expansion of macro id"
I imagined that could be a problem for some drivers.
I should have avoided.
2019-08-20 21:56:39 -03:00
daba3e871f Fix conflict with "Edge Center" snap mode
`SCE_SNAP_MODE_GRID` is used for both nodes and objects.
I don't think it's worth versioning in this case.
2019-08-20 19:35:11 -03:00
dd08d68df8 Transform: New Snap Option: Edge Perpendicular
Part of T66420

Option for snapping to the nearest point of a reference coordinate.
The patch also adds Edge Center and Perpendicular snaps to the ruler.

{F7675906}

Reviewers: campbellbarton, brecht

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5543
2019-08-20 19:18:50 -03:00
2db09212fc Fix T68869: outliner missing subversion bump
The recent commit of synced selection added an active color theme to
the outliner, and synced selection enabled by default. The subversion
bump was missed.
2019-08-20 15:59:22 -06:00
f39145b211 Cleanup: remove redundant operator data in keymap 2019-08-21 07:23:20 +10:00
2930fbd86c Keymap: Shift-Ctrl-Click didn't allow toggle selection
D5518 by @jenkm
2019-08-21 07:13:23 +10:00
b6b01c48fa GPencil: Hide self_overlap parameter for Texture strokes
This property is not supported in this mode and must be removed from UI.
2019-08-20 20:26:48 +02:00
58341242bf Editor Transform: New Snap Option Middle
Part of T66420

Reviewers: campbellbarton, brecht

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5532
2019-08-20 15:07:48 -03:00
1876e18b1b Fix use of uninitialized variable in Cycles math node 2019-08-20 18:19:22 +02:00
a23e1c38f3 Fix T68877: GPencil - Missing remove unused slots in menu
The operator was missing in the menu for grease pencil materials.
2019-08-20 18:11:26 +02:00
14c4a217eb Liboverride: Add more missing ID RNA pointers as overridable. 2019-08-20 17:48:33 +02:00
207f2137dd Fix T68789: Do not use new python format strings thingy in UI code.
This is 100% incompatible with translation...
2019-08-20 17:48:32 +02:00
OmarSquircleArt
be002bb57f Cycles Tests: Fix Math tests when use_clamp is true.
The clamp option is implemented using graph expansion, where a Clamp node
named "clamp" is added and connected to the output. So the final result
is actually from the node "clamp".

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5540
2019-08-20 17:21:40 +02:00
247507a85f Cleanup: remove undefined function 2019-08-20 11:47:50 -03:00
c48d1d54f1 Select Engine: Move some private members out of select context 2019-08-20 11:36:36 -03:00
0827110a35 Cleanup: Move select_engine function to corresponding header 2019-08-20 11:36:35 -03:00
61ff578eab UI: add URL presets
This adds a url-preset operator to simplify opening re-usable links.

- Standard websites have their own tool-tip.
- De-duplicate logic to get URL's that include version information.
- Reporting bugs no longer needs to have all information
  included in the URL.

D5498 by @luisbg with edits.
2019-08-20 23:44:18 +10:00
e6a81ad61e Cleanup: comparison warning 2019-08-20 23:42:04 +10:00
8bee9af462 BLI: double version of some math functions. 2019-08-20 21:09:55 +08:00
a942d97b79 Fix release notes showing twice in the splash-screen 2019-08-20 22:47:25 +10:00
8919c1cad5 Cleanup: clang-format, sorted lists 2019-08-20 22:47:25 +10:00
3dbe172344 Fix crash with no grid unit 2019-08-20 09:11:32 -03:00
859f2561c8 Fix T61286: Viewport grid units not visible
The original code was commented on.
Unlike blender 2.79, the grid units are now displayed only when RV3D_VIEW_IS_AXIS.
The visible subdivisions in the grid are made by the GPU and depending on the pixel.
The code used here only mimics this behavior and adds a bit of overhead.

Reviewers: fclem, campbellbarton

Subscribers: FloridaJo, zlsa, rl.amorato, EitanSomething

Differential Revision: https://developer.blender.org/D4325
2019-08-20 08:58:07 -03:00
f2cab8267f Memory: Fix guarded aligned malloc with small alignment
When calling `MEM_guarded_mallocN_aligned` with an alignment of 4,
a pointer that was returned that is 4 byte but not 8 byte aligned.
When freeing this pointer, `MEM_guarded_freeN` thinks that it is an
illegal pointer, because it asserts that `((intptr_t)memh) & 0x7 == 0`.

The fix is to always use at least 8 byte alignment.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5529
2019-08-20 09:45:47 +02:00
6367845c51 Cleanup: outliner range selection
No functional changes. This commit simplifies the recursive call,
removes unneeded function calls, and adds comments.
2019-08-19 17:08:38 -06:00
4421eb684d Outliner: Add range extend select
Add support for ctrl+shift+lmb to default and industry compatible
keymaps to select a range without removing the existing selection.
2019-08-19 16:49:43 -06:00
74d05eb71a GPencil: Improve reproject operator in surface mode
This change was applied to GP branch during the period 2.80 cannot be updated. Now the patch can be moved to master.

The commit fix the problem when reproject over surface in multiframe mode and the surfaces can moved.

Also improved the surface algorithm thanks to Lukas W (@geloescht).

New Algorithm: Differential Revision: https://developer.blender.org/D4878

Tested by @mendio and @pepeland
2019-08-19 21:05:48 +02:00
beab06b242 GPencil: Change UI scale for z-depth offset
Actually, the value for this parameter must be in the order of 0.00001 and this makes the UI uncomfortable.

Now, the value is divided by 1000 internally and the UI values are more logic.

Reviewers: mendio, pepeland

Differential Revision: https://developer.blender.org/D5528
2019-08-19 20:32:20 +02:00
d1017027af Fix build error with OpenImageDenoise after recent changes for dynamic linking
CMake variables are case sensitive.
2019-08-19 20:19:55 +02:00
e54cde403c Fix T68831: use NULL instead of the wrong pointer to read default array.
The pointer argument is supposed to be the object the property belongs
to, not a pointer to the property metadata itself. This only worked
before because the argument was never used.
2019-08-19 20:23:06 +03:00
953264138d LibOverride: add some more missing override flags for RNA ID pointers. 2019-08-19 19:11:35 +02:00
5fa17ce720 Mesh Batch Cache: Fix crash caused by rB3cbf2462391c 2019-08-19 18:08:44 +02:00
4bf37bafc2 View3D Grid: fix imperial grid drawing
This is a step to finish the D4325 and fix the T61286.
Currently the grid is highlighted in steps of 10 out of 10, which is wrong for the imperial units as seen in `buImperialLenDef`.
The idea of the code is to pass the steps of the grid already dimensioned as a uniform.

Another important thing to note is that subdivisions now only affect the grid without unity.
This matches the 2.7x Blender versions.

No performance loss (almost no gain too).

Reviewers: fclem

Subscribers: zlsa, rl.amorato

Differential Revision: https://developer.blender.org/D4379
2019-08-19 12:05:57 -03:00
3cbf246239 Fix T68719 Viewport: Wrong material index when switching between view mode
This was due to the GPUIndexBuf ranges only computed when requesting
the triangles indices. If the tris were already calculated, the new shading
batches would never have the GPUIndexBuf ranges and instead use the full
triangle index buffer.

So since this only happen when shading data does not match, we just save
the previous GPUIndexBuf ranges and reuse them for the new batch.

This patch is a bit of a hack on top of a hack but it works fine.
2019-08-19 17:02:27 +02:00
0b2e0877de Outliner: sync selection on undo/redo
Tags all outliner sync types on undo and redo operations.
2019-08-19 09:00:42 -06:00
c8e775180b Fix crash when loading a file with existing proxy, and lib has been edited.
Editing a lib char should never, ever be done once you have proxies of
it in your project, that will most certainly break a lot of things...

But at leats let's try no to crash here.
2019-08-19 16:48:04 +02:00
caed5b04d2 Outliner: rename filter "invisible" to "hidden"
No functional changes. Renames the "invisible" object filter to
"Hidden" to be more consistent.
2019-08-19 08:20:13 -06:00
45a09de9dd Fix building with shared OIDN libraries
Previously cmake would error out if it couldn't find the static
libraries even though it can build with shared libraries just fine.
2019-08-19 15:21:44 +02:00
04f9c795aa UI: replace "reports to text" operator with showing info log
This operator only existed to be able to see multiple reports, now instead the
info log can be opened and contents can be copy/pasted.

Patch by Valentin (Poulpator)

Differential Revision: https://developer.blender.org/D5510
2019-08-19 14:56:37 +02:00
Luis de Bethencourt Guimera
aebc596175 Fix T68672: splash screen does not remain centered when window resizes
Differential Revision: https://developer.blender.org/D5508
2019-08-19 14:56:31 +02:00
3f725f10cc Fix T68647: objects cannot be moved to collection if there is no active
object

This showed e.g. when deleting active object, then selecting using box
select.
This commit also lifts the restriction that linked objects could not be
moved to a collection.

Reviewers: campbellbarton, dfelinto

Maniphest Tasks: T68647

Differential Revision: https://developer.blender.org/D5485
2019-08-19 14:48:37 +02:00
5615c675af Fix T68779: "Match Texture Space" causes blender to crash
need to access curve_cache from evaluated object.
thx @sergey for pointing that out.

Reviewers: sergey

Maniphest Tasks: T68779

Differential Revision: https://developer.blender.org/D5526
2019-08-19 14:30:54 +02:00
ce5477d993 Fix T68802: Paint brush's Fill Threshold option is lost 2019-08-19 14:25:55 +02:00
ca3f25fc64 build deps macOS: add PUGI_XML home to OSL 2019-08-19 15:00:28 +03:00
79710a417c UI: re-order sequencer effects panel in side-bar
When working with Effect strips it is not optimal to have to scroll
downwards to get to the important settings for these kinds of strips.

D5512 by @tintwotin
2019-08-19 20:50:52 +10:00
6f17527062 Fix T68806: UI: underscores instead of spaces in some labels. 2019-08-19 10:41:59 +02:00
edbd47b78a LibOverride: Fix some more broken characters after override.
Think pretty much any ID pointer property should be overrideable
actually, without this reconstructing a local hierarchy of overriding
data-blocks simply cannot work properly...
2019-08-19 10:06:36 +02:00
10001d9099 Mesh Batch Cache: Fix regression with mesh that have poly mat id > mat_len 2019-08-18 22:41:12 +02:00
38380ddca3 Fix T67008: Missing move handle and flickering in FileBrowser
Fix T67008: Missing move handle and flickering in FileBrowser

Allow split regions (child regions) to contribute to the action zones (azone) of the parent region.
This fixes the issues in file browser and also in the user preferences.

Reviewers: Severin, mont29, campbellbarton

Reviewed By: Severin, mont29, campbellbarton

Subscribers: brecht, campbellbarton

Maniphest Tasks: T67008

Differential Revision: https://developer.blender.org/D5273
2019-08-18 16:42:41 +02:00
454b120f48 GPencil: Interpolate pressure in active Smooth
Now the pressure is interpolated in active smooth and not only position as before.
2019-08-18 11:40:23 +02:00
8ac40e4163 Cleanup: spelling, change breaked to braked 2019-08-18 19:30:33 +10:00
14e3c0b3e3 Cleanup: unused warning 2019-08-18 19:30:13 +10:00
OmarSquircleArt
e5618725fd Shading: Refactor Math node and use dynamic inputs.
- Implement dynamic inputs. The second input is now unavailable in single
operand math operators.
- Reimplemenet the clamp option using graph expansion for Cycles.
- Clean up code and unify naming between Blender and Cycles.
- Remove unused code.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5481
2019-08-18 11:16:04 +02:00
e12c17b305 Industry Compat Keymap: support new outliner features
Adds support for changes in the outliner from the soc-2019-outliner
branch. All changes made in the default keymap are made in the
Industry Compatible  keymap, except for renaming. Renaming is done
with Return in the Industry Compatible keymap.
2019-08-17 19:43:46 -06:00
e3d90abac7 Fix: Outliner gsoc versioning
Move outliner versioning for syncing and themes to the block
for the next subversion bump. It was not moved from the first
location it was placed in the soc-2019-outliner branch.

Old files will now load with synced selection enabled reliably.
2019-08-17 19:24:32 -06:00
e69fb44027 Fix T68782: false occlusion in selecting vertices and edges with objects in any wire view 2019-08-17 18:40:08 -03:00
b1959a96a2 Cleanup: spelling 2019-08-18 04:26:34 +10:00
2aef1347f9 Cleanup: correct comments 2019-08-18 04:26:29 +10:00
fdb0f3bc0b Fix T68760: "Reload Scripts" '_sys_path_ensure' missing
Missed this in recent update.
2019-08-18 02:32:43 +10:00
c3d037e88f DRW: Fix couple of issues in DRW_draw_select_id
Theses 2 function calls are mandatory.
2019-08-17 17:27:28 +02:00
85f90ed6fd Fix T68723: GPencil - Split Select mode for Sculpt and Edit mode
Actually, the selection mode is not visible in Sculpt mode when mask is enabled, but still is used.
Also, the mode is shared between Edit mode and Sculpt mode and for meshes the selector is by mode.

This commit splits the select mode in different properties and show the selector in Sculpt mode to define the Select mode. Also, the Select Mask button has been removed and now the Select Mode buttons work equal to Meshes where the select buttons are the mask enable too.

Fixed some old code not valid detected during these changes.

Differential Revision: https://developer.blender.org/D5500
2019-08-17 16:26:46 +02:00
0e1d4dec7a Fix T68722: Improve Smooth algorithm for Thickness and Strength
Now the GPencil smooth algorithm uses a average value instead to use only two points and the interpolated value.

Differential Revision: https://developer.blender.org/D5489
2019-08-17 12:51:05 +02:00
a477c2e0e0 Fix unreported GPencil Thickness modifier affecting strokes not in Vertex Groups
Prior to this commit: If the Grease Pencil Thickness modifier is set to Normalize and a Vertex Group is selected, the thickness of all strokes are effected when changing the Thickness parameter. Points on strokes are only normalised (= pressure set to 1.0) if they are part of the Vertex Group; the strokes themselves may still change thickness.

With this patch: If Normalize is selected with a Vertex Group, Blender now pre-checks each stroke to determine whether it has vertices within or outside the Vertex Group. If all the points on the stroke belong to the Vertex Group, it normalises the whole stroke to a uniform thickness. If some or none of the points of the stroke belong to the Vertex Group, the stroke is now left as is.

Reviewed By: @antoniov
Differential Revision: https://developer.blender.org/D5483 with minor edit.
2019-08-17 11:17:12 +02:00
463eef36d3 Fix T68753: GPencil tooltip typo 2019-08-17 11:04:03 +02:00
e8ffe25eb1 PyRNA: include class name in double-register exception
Helps debugging errors when classes are registered twice.
2019-08-17 04:51:50 +10:00
fdcae9ed0c Outliner: Add range extend select and modify keymap
Modifies selection keymap to be more conventional, with
shift click for range selection and ctrl click for extend
selection.
2019-08-16 12:30:54 -06:00
7ee2392887 Outliner: Support box select on click+drag 2019-08-16 12:30:54 -06:00
7ba2de8f8f Outliner: set parent for entire selection
Set and clear parents for all elements in the selection in the outliner.

This also removes the popup menu for setting the parent to curves,
armatures, and lattices. It makes more sense to keep the outliner
simple and only do object parenting.
2019-08-16 12:30:54 -06:00
1e51411db4 Outliner: Fix scenes in scene display not starting open 2019-08-16 12:30:54 -06:00
6bc6d016c5 Outliner: Fixes to show active and scroll page
Adjusts the scrolling of show active and scroll page operators
to use the `outliner_scroll_view` operator to ensure scrolling
does not leave the outliner bounds.

Also changes show active to expand subtrees containing all
instances of the active object, which may be linked to multiple
collections.
2019-08-16 12:30:54 -06:00
b83b0d73a6 Outliner: set scene camera on camera data activate 2019-08-16 12:30:54 -06:00
05f2ccd6d4 Outliner: Draw sequencer and vertex group icons
Draw icons for sequencer and vertex groups. The sequence
types need updates because they all draw in various colors
and some sequence types do not have an icon.
2019-08-16 12:30:54 -06:00
4902094440 Outliner: Use F2 to rename active outliner item
Previously with F2 mapped to the global rename active object
operator, it was not posible to use the conventional F2 to rename any
outliner element like collections or object data. This adds F2 to the
outliner keymap to call the outliner rename operator rather than the
popup rename object operator.
2019-08-16 12:30:54 -06:00
252fb48997 Outliner: walk navigation operator and openclose fixes
Adds a keyboard walk navigation and selection operator to the
outliner. Up and down arrow keys walk up and down the list of
elements, and left and right will open and close elements if
the elements are closed or opened respectively. Holding shift
while walking up and down the tree expands the selection.

Holding shift while clicking or pressing left and right arrows
will expand or collapse all children elements recursively.
Pressing enter to openclose the hovered element is removed.

Also allows click+drag for openclose of element subtrees.

This moves openclose toggling to the openclose operator to
remove duplicate code. The outliner tree building is tweaked
slightly to set the proper parents in scene display mode for walk
select to walk to parents without errors.
2019-08-16 12:30:54 -06:00
eb92ac05d6 Outliner: invisible object filter
Adds an invisible object filter in the outliner to show hidden
objects. This is useful to quickly locate hidden items in a large outliner
tree and easily toggle visibilty back on. Invisible refers to an object
being hidden, or viewport visibility restricted.
2019-08-16 12:30:54 -06:00
01006aa45d Outliner: Allow select on row icons
Allow selection of subtree elements on a collapsed element's
row. Because subtree elements are aggregated by type, a select on
an icon that represents multiple subtree elements will invoke a
popup menu to select the specific subtree element.

Also draws highlights on cursor hover over a row icon.

Any child elements that are linked to multiple collections will
only be listed in the popup one time, and selection from the
popup will select the first instance in the subtree.
2019-08-16 12:30:54 -06:00
bf95ab6bb2 Outliner: Draw constraint icons and enable button
Draw all constraint icons and enable/disable restrict buttons.

The action constraint needs its own icon. It currently draws white
instead of the blue modifier color.
2019-08-16 12:30:53 -06:00
35a5dee2ef Eyedropper: Support datadropper in the outliner
Adds support for using the eyedropper in the outliner in addition to
the 3D view.
2019-08-16 12:30:53 -06:00
0a903e7ab1 Collections: change active if hidden or excluded
When the active collection is hidden or excluded, change the active
collection to the first visible parent collection. This behavior existed
previously for excluding collections, and is now expanded to also
switch the active collection when viewport hidden or restricted.

This does not prevent viewport hidden or restricted collections from
being reactivated later. This could be added as a separate commit.
Excluded collections cannot be activated, so it may make sense to
extend this behavior to hiding collections.
2019-08-16 12:30:53 -06:00
71eb653280 Outliner: Synced selection and active element highlighting
Adds a toggle to the filter menu for outliner synced selection. Enabled
by default, this ensures selection is synced between objects, bones, and
sequences. An active outliner element theme color is added to indicate
which element is active.

Synced selection is controlled on the operator level. Each operator
that modifies selection for objects, bones, sequences, or outliner
elements needs to call the respective ED_outliner_select_sync_from..
function to tag outliners to be synced.

Syncing is done lazily on outliner draw.
2019-08-16 12:30:53 -06:00
7ba2720a70 Fix T68103: bevel sometimes infinite loops with patch miter.
Needed to null terminate list of chain to process width adjustments on.
2019-08-16 13:20:48 -04:00
Rémi Verschelde
b57d386dc1 Fix T68009: Recognize X.Org/AMD as GPU_DEVICE_ATI and open source driver
Reviewed By: #gpu_viewport, fclem

Differential Revision: https://developer.blender.org/D5392
2019-08-16 18:41:43 +02:00
OmarSquircleArt
25f1783673 Fix T68702: Input socket in the Normal node isn't drawn properly.
The Normal vector socket in the Normal node wasn't drawn properly and
couldn't be controlled. Additionally, the socket name was drawn over it.

This happened because the socket had a default value of a zero vector.
To fix this, we set the default value to the unit vector `(0, 0, 1)`.
Moreover, we don't draw the UI name if the subtype is `PROP_DIRECTION`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5503
2019-08-16 17:59:12 +02:00
39288768b5 Revert "Outliner: only activate outliner items when clicking on icon/text"
The soc-2019-outliner branch relied on the previous behavior,
since this is going to be merged soon, postpone this change.

This reverts commit 9dab57a9f8.
2019-08-17 01:25:11 +10:00
66bd96e0bb Cleanup: remove gawain reference 2019-08-17 01:17:30 +10:00
d489aa2955 Cleanup: clang-format 2019-08-17 01:17:11 +10:00
2790740813 Cleanup: spelling 2019-08-17 00:57:05 +10:00
05edcf6329 Cleanup: unused args/vars 2019-08-17 00:53:32 +10:00
145f851731 UI: click on status bar report message now opens window with Info editor
Patch by Valentin (Poulpator)

Differential Revision: https://developer.blender.org/D5468
2019-08-16 16:49:04 +02:00
42cee6ab21 Fix part of T62917: selected edge not highlighted with black and white overlays
Differential Revision: https://developer.blender.org/D5369
2019-08-16 16:49:04 +02:00
ea8e0df672 Fix T55054: possible use of unsupported instructions in Cycles texture code
Differential Revision: https://developer.blender.org/D5326
2019-08-16 16:49:04 +02:00
4f03217dad Fix Unreported crash when opening linked material using nodegroups
This removes the recursive conversion of material using old blend modes.

With the approval of @brecht
2019-08-16 16:42:19 +02:00
d8bb429964 Fix T68651: LibOverride: Fix bad handling of RNA collections pointers.
We were storing the 'item' part in the RNA path of the override op
itself, which will not work with IDs because overriding local one might
not have the same name as the linked one (when some local ID with same
name already exists).

Now we are properly handling  this using the expected actual override
operation, which stores necessary data (names or indices) from both
local and linked data.
2019-08-16 16:25:52 +02:00
d436d67fcc Cleanup: proper use of UNUSED_VARS_NDEBUG instead of random hack. 2019-08-16 16:25:52 +02:00
dc0376555f LibOverride: do not allow diffing on collections' all_objects member.
This is useless (as diffing on `objects` + `children` shall be enough),
and potentially very time consuming in case of heavy hierarchy of
collections.
2019-08-16 16:25:52 +02:00
078d02f557 User Preferences: Added "Enabled add-ons only" preference
This checkbox replaces the "Disabled" and "Enabled" entries in the
filter drop-down. As a result, it now takes a single click to limit the
shown entries to enabled add-ons only. This is also an actual flag in
the preferences, and thus its state is saved between runs on Blender (in
contrast to the filter, which is always reset to "All").

Reviewed by: brecht, billreynish
2019-08-16 15:02:09 +02:00
ecc3b033a7 Fix T68715 Hidden polygon Edit mode are hidden in Object level 2019-08-16 15:00:50 +02:00
ee8aad79c1 Fix T56408: Hair children recalc on every frame on Alembic mesh
This fixes the glitching hairs described in T56408, T63534, and possibly
also T63534.

The fix consists of returning the original mesh (i.e. as visible in edit
mode) when constructing the ORCO mesh. This allows a static set of
coordinates to be used when computing the child hair positions.

The original mesh is only returned when it has the same topology (at
least same number of vertices, loops, and polys. It's up the author of
the Alembic file to ensure stable geometry when it's desired to be
compatible with Blender's hair system.

Reviewers: mont29, brecht

Differential Revision: https://developer.blender.org/D5492
2019-08-16 14:52:08 +02:00
c70f975d5c Fix T67999: calling Mesh.materials.clear() crashes Blender
The `BKE_material_pop_id()` and `BKE_material_clear_id()` functions had
a parameter `update_data` that, when `false`, would cause the mesh polys
to keep their material index, even when the indexed material slots were
removed. This behaviour was never used in the C code and not supported
by the drawing code, making polygons disappear and causing crashes. The
Python binding in RNA, however, defaulted to `update_data=False`.

This commit removes the `update_data` parameter altogether, and makes
the functions always fix up the material indices.

Reviewed by: mont29, brecht
2019-08-16 14:36:57 +02:00
82e719ff87 Fix T64998: Multi window spin tool crash
There could be a more direct way to initialize a gizmo in a view,
for now this resolves the crash.
2019-08-16 22:21:44 +10:00
Stefan Werner
8e4f55aba6 build_env: Added OpenImageDenoise to install_deps.sh
Building OIDN still needs to be enabled explicitly with --with-oidn.
It will fail with older versions of CMake or TBB, so I can't make
any guarantees for various Linux distributions or versions.
2019-08-16 14:01:37 +02:00
13c9df10a8 Fix T68710: crash on applying modifier after removing all shape keys
This was a mistake in rB87629b2a7443

`BKE_object_shapekey_free` would never return `true`, so DEG updates
would not happen...
So `ob->shapenr` was not up-to-date etc., leading to crash in
`BKE_mesh_nomain_to_mesh` shapekey handling...

Reviewers: brecht

Maniphest Tasks: T68710

Differential Revision: https://developer.blender.org/D5501
2019-08-16 13:58:47 +02:00
f8920bd8c7 Cleanup: fix compiler warnings 2019-08-16 12:44:06 +02:00
bdf8450713 Transform: use a kd-tree to calculate proportional distances
While speedup is non-linear, it gives ~30% speedup for ~6 million verts.

D3993 by @Al with edits.
2019-08-16 18:35:35 +10:00
9dab57a9f8 Outliner: only activate outliner items when clicking on icon/text
This is 2.7x behavior, while there are plans to improve on this,
committing in case larger changes take longer.

Without this it's not easy to select object data without changing modes.

See D5493
2019-08-16 07:07:22 +10:00
8f565f5a6f WM: reuse visible region calculation
Avoids calculating the visible part of a region whenever
on-screen overlays are drawn.
2019-08-16 06:44:25 +10:00
266e7b67fd Cleanup: use boolean 2019-08-16 06:44:25 +10:00
0f79c346c6 Fix check that validates a selection index 2019-08-15 17:08:38 -03:00
50ad4428ac Windows/MSI: Rework MSI installer.
The installer always upgraded the last version installed and did not allow for two versions to be installed side by side.

The reworked installer will allow side by side installs

install order:
```
2.81 -> 2.81a -> 2.82  : Allowed , will result in both 2.82 and 2.81a being installed
2.82 -> 2.81  -> 2.81a : Allowed , will result in both 2.82 and 2.81a being installed
2.82 -> 2.81a          : Allowed , will result in both 2.82 and 2.81a being installed
2.82 -> 2.81a -> 2.81  : Not Allowed, 2.81 will only install if you manually remove 2.81a first.
```

Do note though that this will not apply to any previously issued installers and even for 2.80a this is not something we can fix.

This patch is for landing in 2.81 *only* and should be excluded from any possible 2.80a release.

Second change is a change to the compression level, building the MSI takes 30 minutes, which is crazy, perhaps worth it if the compression actually pays of.

```
MSI - none     1:35  247.0 MB (260,025,634 bytes)
MSI - mszip    2:02   89.6 MB ( 94,022,946 bytes)
MSI - low      2:35   81.6 MB ( 85,646,626 bytes)
MSI - medium   4:11   77.3 MB ( 81,136,930 bytes)
MSI - high    28:01   74.7 MB ( 78,384,418 bytes)

zip            1:32   93.2 MB ( 97,732,293 bytes)
7Z             2:22   65.0 MB ( 68,171,614 bytes)
```

It didn't, so I lowered it to medium, seemed reasonable.

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

Reviewers: brecht, jesterking
2019-08-15 13:43:44 -06:00
Dalai Felinto
cbd1739004 Fix T68705: Changing any editor to the properties crashes Blender
Issue introduced (more like exposed) in b7f86ff722.
2019-08-15 16:39:51 -03:00
b5fe838d44 Fix T68689 Fix infinite recursion cause by versioning code
Complex nodetrees could fire infinite recursion with previous algo.
Now using another gset we make sure we can only evaluate a tree once.
2019-08-15 18:46:37 +02:00
5d72ceb8d8 Fix broken text editing of integer number buttons, after recent changes 2019-08-15 18:20:33 +02:00
f61c6a2a1f Build: enable OpenImageDenoise, now that we have libraries for all platforms
Note that we are still missing an update for install_deps.sh to easily build this
on Linux. Only "make deps" has it for now.
2019-08-15 18:13:22 +02:00
c883fe25da Cleanup: clang-format, unused arg 2019-08-16 01:59:32 +10:00
8856c26fc3 Windows: add cycles debug logging to helper batch file. 2019-08-15 09:42:00 -06:00
4aad773061 Cleanup: Silence C4115 warning
`'ParticleSystem': named type definition in parentheses`
And prevent the need for struct `Object` to be defined.
2019-08-15 12:35:28 -03:00
f4faf6d856 Cleanup: Remove redundant headers 2019-08-15 12:35:28 -03:00
9684971add Fix T56843 : fix case sensitive filenames on win10
When building with case sensitive folders there were some linker errors.
2019-08-15 09:27:15 -06:00
4d320f4313 Edit Mesh Selection: Refactor: Redraw idmap buffer at runtime with only objects inside the rect
But in the future the selection code may also be used in object mode (eg for snapping).
So to avoid using too much VRAM resources, it is good to avoid drawing all objects in the viewport.

The solution was to create an array with only objects that are detected within the selection area.
If the selection operator is modal, objects already detected are not removed from the array until view3d is moved or orbited.
To detect the object, its BoundBox is tested.
Since the Select Engine does not have a dedicated depth texture, whenever a new object is "found" the depth of the objects in the array already drawn is redrawn.

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5435
2019-08-15 10:31:54 -03:00
261a02fc59 DRW: New function DRW_culling_min_max_test
For testing intersection with frustrum planes without having to transform all bound box vertices into global space.
2019-08-15 10:20:21 -03:00
78b56fa7d9 Fix T65461: IntProperty does not respect its 'step' field
Originally D5020 by @deadpin, refactored to make the change simpler.
2019-08-15 22:57:41 +10:00
fdef1a6712 UI: make int/float button clicking logic consistent
- When no change is performed on a float button, cancel the action.
- Move left/right clicks into the same block.
- Replace ambiguous names: temp, tempf.
2019-08-15 22:57:41 +10:00
e4084f8b24 Fix CDT bug causing crash with some output modes.
Forgot to properly maintain the edge for faces while
dissolving edges.
2019-08-15 07:55:29 -04:00
48a6997e2a Fix T64888: full-screen button overlaps side-bar 2019-08-15 21:34:16 +10:00
95a0144293 Fix T68684: Vertex snapping with median not working if the object is not at center of the world 2019-08-15 08:29:49 -03:00
9e54e6bdc5 Cleanup: Minor change to previous commit 2019-08-15 13:17:28 +02:00
143a44caeb GPencil: Fix unreported missing VFX in Video Editor
As the video editor mode is not Render mode the VFX was omitted.

Now, the mode is only checked for View3D.
2019-08-15 13:15:15 +02:00
ff1ea600c9 Fix T68675: particle edit mode makes blender crash
In rB9c010c44f420, DRW_mesh_batch_cache_create_requested was changed to
take a scene (instead of toolsettings directly), but
DRW_draw_depth_object is calling this with with NULL, just checking for
this seems to fix...

Reviewers: fclem

Maniphest Tasks: T68675

Differential Revision: https://developer.blender.org/D5488
2019-08-15 11:56:57 +02:00
eac2a7ab0e Fix full-screen button overlapping navigation gizmo 2019-08-15 19:51:28 +10:00
e6fa174fd7 UI: skip drawing the full-screen when alpha is zero 2019-08-15 19:51:28 +10:00
a2a9c95845 Fix T68678: Invisible fullscreen button
Regression from 6148ed8cf9
2019-08-15 19:51:28 +10:00
c7598cd1a5 Cleanup: spelling
Missed in recent commit.
2019-08-15 19:51:28 +10:00
5b04829d43 Cleanup: replace commented out code by comment 2019-08-15 11:28:42 +02:00
32395dd4e2 UI: Finalize old TODO in UI float number handling.
Just enable some commented-out code from rB636289b755f6ce (disabled at
that time because we were too close of 2.79 release...).

Issue raised in D5486, thanks.
2019-08-15 11:13:54 +02:00
63b3cc1702 Cleanup: spelling 2019-08-15 16:56:24 +10:00
1ddc12ceb9 Cleanup: unused warnings
Reminder not to leave in unused code, or comment why it should be kept.
2019-08-15 16:55:48 +10:00
bb2394a298 Fix T68014: Add-on's override Python built-in modules
Append addon paths to the sys.path to avoid name
collisions with system modules.
2019-08-15 16:09:15 +10:00
7c258a8ad1 Mesh: bypass legacy tessface conversion step when remeshing 2019-08-15 15:59:58 +10:00
f4d548d384 msvc: Enable /bigobj on all object files.
bf_intern_openvdb makes a significant number of template instantiations
causing it go over the maximum number of sections (int16) in a coff file
when doing a debug build.

This change switches the compiler to use the extended coff format which
has this field extended (int32) all linkers post msvc2005 can process
this format so there's no reason not to turn this on globally.

Clang on windows does not need this change since clang switches implicitly
to the extended format when required. [1]

[1] https://reviews.llvm.org/rL217812
2019-08-14 17:57:01 -06:00
Dalai Felinto
cb7ead2e3b Fix T68658: Text offset makes scale to fit not to work
Differential Revision: https://developer.blender.org/D5484
2019-08-14 19:18:51 -03:00
5ff8fcfa72 Eevee: Fix tangent map node not using the right UVMap 2019-08-14 23:59:34 +02:00
6fcd071c7b GPU: Vertex Format: Increase number of byte per attribute name
This reduces the risks of hash collision while maintaining a small number
of character per attrib.
2019-08-14 23:59:34 +02:00
80e9eb66d5 Mesh Batch Cache: Split UV an tangent into 2 distinct VBOs
This is done because they don't have the same update frequency. UV can be
persistent even on geometry update (ex: skinned object) but tangents
can change if the normals change.

Also the name buffer per vbo was too small to contain all names.
2019-08-14 23:59:33 +02:00
deb5416a1a GPU: Vertex Format: ADd function for safe GLSL attrib name
This remove code duplication and use base63 encoding of the hash.
Use mumur hash to have more randomness.
2019-08-14 23:59:33 +02:00
67f49f9c03 Cleanup: fix compiler warnings 2019-08-14 23:40:12 +02:00
037cf920b4 Sculpt: mesh abstraction API
These functions make possible porting the tools from the sculpt branch, making them compatible with PBVH_FACES and PBVH_BMESH without duplicating the code. They can also help to simplify some existing code.

These functions should not be used when working with PBVH_GRIDS data in SculptSession. PBVH_GRIDS needs to be removed from the sculpt code and converted to PBVH_FACES to be compatible with this API.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5352
2019-08-14 22:59:31 +02:00
5489611e53 Compositor: Added denoising node
This node is built on Intel's OpenImageDenoise library.
Other denoisers could be integrated, for example Lukas' Cycles denoiser.

Compositor: Made OpenImageDenoise optional, added CMake and build_env files to find OIDN

Compositor: Fixed some warnings in the denoising operator

build_environment: Updated OpenImageDenoise to 0.8.1

build_environment: Updated OpenImageDenoise in `make deps` for macOS

Reviewers: sergey, jbakker, brecht

Reviewed By: brecht

Subscribers: YAFU, LazyDodo, Zen_YS, slumber, samgreen, tjvoll, yeus, ponomarovmax, getrad, coder.kalyan, vitos1k, Yegor, DeepBlender, kumaran7, Darkfie9825, aliasguru, aafra, ace_dragon, juang3d, pandrodor, cdog, lordodin, jtheninja, mavek, marcog, 5k1n2, Atair, rawalanche, 0o00o0oo, filibis, poor, lukasstockner97

Tags: #compositing

Differential Revision: https://developer.blender.org/D4304
2019-08-14 21:40:35 +02:00
1845f0ee8b Cleanup: Fix build error with MSVC
C99 style initializers are C++20 feature and should not be used.

Reported by @deadpin on chat.
2019-08-14 12:52:51 -06:00
655f5818a5 Cleanup: use BKE_mesh_ prefix for the remesh API
These functions deal with voxel remeshing of Mesh data,
and aren't related to MOD_remesh.c for e.g.

Name so other kinds of remeshing wont cause confusion.
2019-08-15 04:46:51 +10:00
76e5b4bee4 Fix T68657: Voxel remesh crash
Mesh was being double freed.
2019-08-15 03:51:06 +10:00
8ee3e7da28 Cleanup: use doxy sections for wm_operators.c 2019-08-15 03:42:04 +10:00
966f4a162b Cleanup: warnings, unnecessary nested header 2019-08-15 03:42:04 +10:00
9c010c44f4 Mesh Batch Cache: Refactor + Multithread
For clarity sake, the batch cache now uses exclusively per Loop attributes.
While this is a bit of a waste of VRAM (for the few case where per vert
attribs are enough) it reduces the complexity and amount of overall VBO
to update in general situations.

This patch also makes the VertexBuffers filling multithreaded. This make
the update of dense meshes a bit faster. The main bottleneck is the
IndexBuffers update which cannot be multithreaded efficiently (have to
increment a counter and/or do a final sorting pass).

We introduce the concept of "extract" functions/step.
All extract functions are executed in one thread each and if possible,
using multiple thread for looping over all elements.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D5424
2019-08-14 19:05:26 +02:00
45a45f7d66 OpenVDB: Voxel Remesher
The voxel remesher introduces a new workflow for sculpting without any of the limitations of Dyntopo (no geometry errors or performance penalty when blocking shapes). It is also useful for simulations and 3D printing.

This commit includes:
- Voxel remesh operator, voxel size mesh property and general remesh flags.
- Paint mask reprojection.
- Geometry undo/redo for sculpt mode. This should support remesh operations as well as future tools that modify the topology of the sculpt in a single step, like trimming tools or mesh insert brushes.
- UI changes in the sculpt topbar and the mesh properties pannel.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5407
2019-08-14 18:58:19 +02:00
16c28b5a67 UI: suppress Copy/Paste/Edit Driver options on whole array property fields.
When a button represents the whole array (e.g. color picker buttons),
these context menu options were available, but didn't really work
correctly. Since it's not clear how they could reasonably work without
a valid index, it's better to hide them.
2019-08-14 19:18:13 +03:00
9ac3964be1 OpenVDB: mesh/level set conversion, filters and CSG operations
This code is needed to implement the Voxel Remesher as well as other features like a better remesh modifier with filters and CSG operations.

Done by Martin Felke and Pablo Dobarro

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5364
2019-08-14 18:13:56 +02:00
5ca5357e08 Install_deps: bump official numpy version to 1.17.0
Following recent ;ails re python version bump (looks like py version
itself had already been bumped in that script).
2019-08-14 17:49:15 +02:00
4b9e05b428 Cleanup: clang-format, sort structs & cmake files 2019-08-15 01:34:58 +10:00
8cbe9f1b9a Cleanup: headers 2019-08-15 01:32:46 +10:00
c5c4012b10 Cleanup: split out splash screen into own file
`wm_operators.c` is mainly for generic operator logic
where as the splash screen is one of a kind.
2019-08-15 01:32:46 +10:00
9bc10c1f54 Cleanup: remove comment to workaround weak code parsing
This is quite an old comment, recent IDE's/editors
should be able to handle escaped quotes in strings.

If kludges like this are needed, developers should note exactly why.
2019-08-15 01:32:46 +10:00
2623e68c3b GPencil: Revert commit d727f4f223 (Interpolate menu)
The menu is not redundant,  it is just another way to reach the tool and also give more discoverability of the operator shortcut (Many tools in Blender are also on menus, toolbar or header, just think of Move, Rotate, Scale).

There is also no reason to force the user/artist to change to edit mode for interpolate strokes, when the tool works perfectly in drawing mode too. It would only slow down the 2D animation workflow.

Reviewers: @mendio
2019-08-14 17:32:23 +02:00
63bf2ddc5d Fix main part of T68646: Library overrides: Broken parenting (parent inverse matrix gets reset) after reload.
We need a custom 'apply override' callback here to prevent resetting
the inverse parent matrix.

Things are now working for basic cases, but complex ones (in production
rigs e.g.) are still partially broken...
2019-08-14 17:27:34 +02:00
05417b2220 Text editor: syntax highlighting + line numbers on by default
The most common use of the text editor seems to be for scripting. Having
line numbers and syntax highlighting enabled by default seems sensible.

Syntax highlighting is now enabled by default, but is automatically
disabled when the datablock has a non-highlighted extension.
Highlighting is enabled for filenames like:
    - Text
    - Text.001
    - somefile.py
and is automatically disabled when the datablock has an extension for
which Blender has no syntax highlighter registered.

Reviewers: billreynish, campbellbarton

Subscribers: brecht, billreynish

Differential Revision: https://developer.blender.org/D5472
2019-08-14 16:59:37 +02:00
72eb70f933 Added missing forward declaration 2019-08-14 16:55:51 +02:00
f0f5e11b33 Eevee: Fix: Regression when using ssr and default shader 2019-08-14 16:43:52 +02:00
0dcd442c1f Fix T68487: double free when inserting keyframe outside of action clip range 2019-08-14 16:12:16 +02:00
Julian Eisel
b7f86ff722 Fix Area.ui_type invalid during area change
To reproduce:
* Split 3D View to show Info Editor
* Change 3D View a few times to various subtypes (Timeline, UV Editor
  etc).
Every now and then, the Info Editor should show `UNKNOWN ENUM`. Other
prints may also be lagging behind.

Reviewed By: campbellbarton, brecht
Differential Revision: https://developer.blender.org/D5325
2019-08-14 15:51:54 +02:00
03b2371387 Cleanup: move trailing comments to avoid wrapping code
Some statements were split across multiple lines because of their
trailing comments.

In most cases it's clearer to put the comments above.
2019-08-14 23:32:24 +10:00
bc4fe45aef Cleanup: pep8, prefix unused arg 2019-08-14 23:32:24 +10:00
Julian Eisel
e6425aa2bf Manage GPU_matrix stacks per GPUContext
Previously, we had one global `GPU_matrix` stack, so the API was not
thread safe. This patch makes the stack be per `GPUContext`, effectively
making it local per thread (`GPUContext` is located in thread local
storage).

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5405
2019-08-14 15:27:10 +02:00
4074ab361e Eevee: Fix background alpha regression 2019-08-14 14:29:02 +02:00
7ae3aa7b63 Cleanup: don't unnecessarily use ustring in IES file parsing 2019-08-14 14:16:11 +02:00
d2195d9ef2 Fix T68637: Crash assigning caps-lock shortcut
Report that this isn't supported instead, also for unknown key.
2019-08-14 21:40:16 +10:00
67c10dbf13 Eevee: Add support for the holdout node
Support should be full when using Alpha Blend mode and partial if using
any other blend mode (opaque / alpha clip / alpha hashed).
2019-08-14 13:36:56 +02:00
13d469e6f0 Eevee: Remove Additive & Multiply Blend mode
This commit also provide a compatibility code that will convert old
materials using Additive or Multiply Blend mode to their node equivalent.

This conversion is only done on outputs that are enabled for eevee.
2019-08-14 13:36:56 +02:00
d5002f007e Eevee: Improve Transparent BSDF behavior
Alpha blended Transparency is now using dual source blending making it
fully compatible with cycles Transparent BSDF.

Multiply and additive blend mode can be achieved using some nodes and are
going to be removed.
2019-08-14 13:36:56 +02:00
8a338950c6 Fix T68537 Eevee: Modulo node behaves unexpectedly/inconsistently
There was still some float imprecision when both input values are equal.
2019-08-14 13:36:56 +02:00
55c38f476e Custom Properties: allow changing the property UI to color picker.
To fully support storing colors as a custom property, it is necessary
to allow switching the property UI to the standard color picker button.
That means in effect supporting custom property subtype values.

Change RNA_property_subtype to look for a 'subtype' string field
in _RNA_UI and parse it as an enum value. To minimize performance
impact, only do it if the property is an array; also, don't use
the custom subtype during RNA path parsing.

On the python side, allow setting some most useful seeming values
from the custom property settings editor.

Also, since some color picker code seems to run into a risk of
buffer overruns if the array size is wrong, check the size in
the UI layout code to be safe.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5475
2019-08-14 13:38:23 +03:00
c47c7a44b2 Fix T68623: bpy.types.UI_UL_list.filter_items_by_name is case sensitive.
Was a mismatch with default behavior from C-defined basic UI list...
2019-08-14 11:43:25 +02:00
b4051db4fc Fix cycles crash when voxel attributes changed
This could happen e.g. when changing smoke type from flow to domain or
connecting a volume shader with to a domain without an actual flow type
around.

Fixes T58569, T68359

Reviewers: brecht

Maniphest Tasks: T58569, T68359

Differential Revision: https://developer.blender.org/D5478
2019-08-14 10:54:28 +02:00
OmarSquircleArt
7a7eadaf7f Shading: Add a clamp option to the Map Range node.
If the option is enabled, the output is clamped to the target range.
The target range is [To Min, To Max]. The option is enabled by default.

The clamp option is implemented in EEVEE by linking to the `clamp_value`
GLSL function. And it is implemented in Cycles using a graph expand
function.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5477
2019-08-14 10:53:19 +02:00
c9acc5faad Fix T68597: GPencil Dope Sheet can fail to display active GP object
Now, the dopesheet is activated if the object is in any Edition mode.
2019-08-14 10:30:58 +02:00
b3c3c83560 cleanup: fix python related build error on windows.
Recent python changes caused issues on some systems.
2019-08-13 19:55:33 -06:00
fc0f47e349 make.bat: Support running python from lib folder for make format
We are no longer depended on a system python being installed.
2019-08-13 17:03:09 -06:00
c538903558 deps: python 3.7.4 for windows.
This also updates to a new packaging method where python is runnable
from the library folder rather than having tarballs in the release
folder.
2019-08-13 17:02:19 -06:00
87d3685e93 deps/cleanup: remove partial boost-python support.
boost python was not required by any dependency nor was it ever properly supported.
2019-08-13 17:00:23 -06:00
54013d541c build_environment/python: Bump versions of our site-packages
IDNA     2.8
CHARDET  3.0.4
URLLIB3  1.25.3
CERTIFI  2019.6.16
REQUESTS 2.22.0
NUMPY    1.17.0
2019-08-13 16:58:26 -06:00
OmarSquircleArt
313b789289 Shading: Add Clamp node to Cycles and EEVEE.
This patch adds a new node that clamps a value between a maximum and
a minimum values.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5476
2019-08-13 22:22:15 +02:00
42798a5ca1 Fix T67516 VSE: Animation evaluated incorrectly when scene strip present
The calls to `BKE_animsys_evaluate_all_animation()` and
`BKE_mask_evaluate_all_masks()` used the wrong timecode to evaluate the
animation system. This happened:

- Sequencer in scene A was rendered at frame X.
- Scene strip for scene B which should be evaluated at frame Y.
- BKE_animsys_evaluate_all_animation() was called with frame Y, which
  also re-evaluated the animation data in scene A.
- Other sequencer strips with animated values were then evaluated for
  frame Y and not frame X.

Since the depsgraph for rendering the scene strip is already OK and does
its job, it's no longer necessary to re-evaluate all the animation in
this way.

Removed `BKE_mask_evaluate_all_masks()` because it's no longer used.

Reviewers: sergey, brecht, iss

Differential Revision: https://developer.blender.org/D5394
2019-08-13 16:38:22 +02:00
OmarSquircleArt
71641ab56d Shading: Add Map Range node to Cycles and EEVEE.
This patch adds a new Map Range node that linearly remaps an input
value from a range to another. This node is similar to the compositor's
Map Range node.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5471
2019-08-13 16:38:56 +02:00
aef08fda3a Custom Properties: officially support int and float arrays in the UI.
In some rare cases it is convenient to store a short array value
as a custom property, e.g. a vector or color. For example, it may
be helpful when importing/exporting certain formats that support
custom or nonstandard attributes on objects.

The custom property storage already can handle arrays in order to
support properties defined via python. The only thing missing is
UI support (and some bugs), and this patch fixes that:

- Allow editing short array properties via Custom Properties panel.
- Fix a UI layout sizing bug triggered by the previous item.
- Fix a dependency graph bug with drivers using such properties.
- Make RNA_*_get_default_array code robust in case of size mismatch.
- Support custom default values for array properties, allowing
  both an array and a scalar value.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5457
2019-08-13 17:13:19 +03:00
6e7ea807e1 UI: Fix wrong properties being grayed out
This has been mentioned in T68610.
2019-08-13 15:47:03 +02:00
03bf84db86 Fix T66373: Strange translation text behaviour.
i18n code does not work from threads on some plaforms, so it is disabled
in Blender when called from non-main thread.

Means that we have to go to a slightly different approach, with dirty
tag and generating string on request for UI.

Note: Also had to update the `info` string size, to fit with expensive
asiatic scripts in utf-8... Using mem for that kind of runtime data is
not really nice, but for now it will have to do.
2019-08-13 15:37:11 +02:00
6f9cbbc8ec Add mathutils.geometry.delaunay_2d_cdt() function to Python API.
Provides Python API access to recently added Constrained Delaunay
Triangulation routine.
Reviewed in D5467.
2019-08-13 07:31:14 -04:00
918150a0b9 Fix T65670: bone envelope head radius missing from transform panel
Make the transforms section of the properties panel consistent with
the transforms section of the side-bar, and to expose some currently
hidden BBone properties in the Bendy Bone section.

- Object transformations were not consistent with Pose Bone
  transformations in that they did not use single-column layout.

- Even in Pose Bone transformations,
  the rotation mode option was after Scale.

- Edit Bone Transforms panel included "Tail Radius" and
  "Envelope Deform Distance", neither of which belong there. See T65670.

- Expose bbone_x and bbone_z.

D5454 by @Mets
2019-08-13 18:20:05 +10:00
b84db342a5 Fix build errors with older GCC versions like 4.9
We can add more fine grained checks for when these flags are supported so
that adding asan flags manually still has all the workarounds, but for now
compiling succesfully is more important.
2019-08-13 06:04:17 +02:00
af3f0bf9d4 Fix T68507: Gpencil: Show always the Select Menu in Edit Mode
In Grease Pencil Edit Mode the Select menu should always be visible. Right now the menu visibility is controlled by the Selection Mask button next interpolate popover

Differential Revision: https://developer.blender.org/D5466
2019-08-12 23:22:08 +02:00
bb1719ddb5 Fix T68547: Plane Constraint inaccuracy
If it is to prevent division by zero just check if the `factor` is zero (instead of using an epsilon).
2019-08-12 17:13:32 -03:00
1a8dccd70a UI: Use singular noun form in add menus 2019-08-12 15:46:07 -04:00
3c014fe3fb Fix T68187: Factory Preferences doesn't update gizmo colors 2019-08-13 04:44:25 +10:00
ef5bf8d67e Fix T68557: Incorrect property reported in error
Error spotted by @gbayliss
2019-08-13 03:45:29 +10:00
b5f5f6e319 Cleanup: rename BaseOffset to ObjectOffsets 2019-08-12 12:29:38 -03:00
4815bd7748 Fix wrong detection in recent ninja build change 2019-08-12 17:28:01 +02:00
44d95cbf95 Cleanup: DRW manager: Move select_buffer.c utilities out of the selection engine internals 2019-08-12 12:10:44 -03:00
37b4384b59 Fix T67032: Do not systematically link 'orphaned' indirectly linked objects to scene.
Not even in append case. If those objects are already part of a
collection, we can now leave them fully un-instantiated in any scene,
since user can easily do it themselves as they need to.
2019-08-12 15:44:17 +02:00
102035373a Build: automatically detect ninja build system when running "make"
So that you don't have to specify "make ninja" every time.
2019-08-12 15:24:23 +02:00
922e77036b Fix Bullet build error with Clang 8 and Xcode 11
See D5366 and upstream:
https://github.com/bulletphysics/bullet3/commit/7f6c479ea6
2019-08-12 15:12:27 +02:00
3736dabd93 Fix running space_node directly
Part of T65393
2019-08-12 22:54:17 +10:00
961d43c623 Fix T68539: transferring uv (Ctrl+L) does not update immediately in
object mode
2019-08-12 14:49:27 +02:00
f555379ce3 Fix T66922: Merge by distance tooltip text wrong
merge/dissolve distance is actually a maximum, not a minimum

Reviewers: campbellbarton

Maniphest Tasks: T66922

Differential Revision: https://developer.blender.org/D5462
2019-08-12 14:44:51 +02:00
ca9698b8e0 Sculpt/Paint: Ignore INBETWEEN_MOUSEMOVE events on certain brush tools
Some brush tools were being executed too often when using devices with high polling rates, causing performance issues. This should improve the performance of brushes that don't need those updates.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5429
2019-08-12 12:58:08 +02:00
761aeb4899 Fix crashes caused by library placeholders.
This fixes inconsistencies in materials between objects and obdata
due to placeholders generation for missing libdata.

Note that we cannot do that when generating the obdata placeholder,
as not all objects using it might be already loaded...
So this has to be done near the end of the reading/linking process.

Reported here by Blender Studio.

Reviewers: brecht

Subscribers: jbakker, zeddb

Tags: #datablocks_and_libraries

Differential Revision: https://developer.blender.org/D5428
2019-08-12 11:54:37 +02:00
35a9a85b27 Fix T68542: ParticleSystem.uv_on_emitter returns always 0,0 while Particle.uv_on_emitter returns a value.
'cached' particles (for paths actually) are only generated for some kind
(hair, keyed, and baked system afaik), not for all.

Note that we could probably just use directly `totpart` and `totchild`,
but keeping code as close to what it was as possible, for now...
2019-08-12 11:47:08 +02:00
2b5575cc35 Fix error displaying brush panel (sidebar) in Vertex Paint mode
oversight in rB83fc8342d827
2019-08-12 11:37:24 +02:00
52421e9ace View3D: Circle Select optimization
Don't recreate `select_bitmap` for each edited object.
2019-08-11 22:12:11 -03:00
0d719fcacb Cleanup: spelling 2019-08-12 01:10:43 +10:00
a5f59bffd6 Cleanup: use doxy comments 2019-08-11 22:41:04 +10:00
63c463ac45 Docs: improve comments 2019-08-11 22:34:22 +10:00
1cd65b274b BLI_math: add isect_tri_tri_v2, wrap via mathutils.geometry 2019-08-11 21:50:48 +10:00
c3a9fc5efb Text: support comment without selection
D5451 by @Poulpator with fixes.
2019-08-11 20:52:45 +10:00
e2c6cfec18 Preferences: tag as dirty when loading factory startup 2019-08-11 18:03:17 +10:00
18ba66d75e UI: clarify auto-save preference
- Grey out the option when factory settings have been loaded.
- Note it it's tool-top that it's ignored when factory settings
  have been loaded.

Suggestions by @JulienKaspar
2019-08-11 17:51:09 +10:00
22cdadaa32 Cleanup: clang-format 2019-08-11 02:47:32 +10:00
cd91ff98c0 Cleanup: unused var 2019-08-11 02:47:32 +10:00
OmarSquircleArt
26911ba1e2 Nodes: Display vector values expanded, except when specified as compact.
Change the default drawing method of vector sockets to use a column layout.
This allows more interactive use of nodes and avoids the one or two clicks
needed to edit vector sockets in the old default component layout.

Developers may still use the component layout by flaging the socket with the
`SOCK_COMPACT` socket flag. For now, we choose to draw the SSS scale vector
of the Principled and SSS nodes in a compact form because they don't require
much interactivity.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5458
2019-08-10 17:57:54 +02:00
f51f4355b9 GPencil: Refine tooltip for Simplify modifier 2019-08-10 17:22:58 +02:00
7440144e2b GPencil: Hide selection tool in sculpt mode when mask is disabled
The selection tool must be hidden if the sculpt mask is not enabled because these options are not usable in this mode.

Also, the Select tools have been moved to the bottom of the toolbar.

Now, the logic is similar to Meshes.

Differential Revision: http://developer.blender.org/D5452
2019-08-10 17:20:12 +02:00
7029810b04 GPencil: Add new Distance property to Simplify modifier
Before, the length variable was reused for Sample and Merge Simplify. Now, the Merge has its own distance property and variable in the modifier struct.
2019-08-10 17:16:12 +02:00
745f773d92 GPencil: Fix tooltips for Simplify modifier 2019-08-10 17:00:49 +02:00
049c50e095 GPencil: Disable Select operator for Sculpt mode if Mask is OFF
The selection is only valid when the mask is enabled, so the operators must be disabled.

This modification is part of D5452
2019-08-10 16:50:21 +02:00
9e68b560a6 GPencil: New macros to check Sculpt and Weight Paint modes 2019-08-10 16:26:59 +02:00
b99c616b9b Fix T68414: GPencil crash after using L key and Ctrl+Z in Draw Mode
There is a segment fault because the operator was in modal but the Ctrl+Z breaks the custom data. Now, the Ctrl+Z ends the operator.
2019-08-10 16:04:42 +02:00
b91643c711 Add Constrained Delaunay Triangulation routine to Blenlib.
See Design task T68277, and patch D5423.
This commit includes edits by @ideasman42 to patch in
branch temp-D5423-update, plus responses to his comments.
2019-08-10 08:24:20 -05:00
553b581f25 GPencil: Improves Close stroke when the closing gap is very small
For very small gaps, we don't need generate geometry.
2019-08-10 13:15:20 +02:00
41f8f08e51 UI: Add initial context menus for Info and Console editors
Both keymaps are also updated
2019-08-10 11:35:16 +02:00
77516c25e4 GPencil: Fix segment fault using Search menu
The poll was not checking Object type
2019-08-10 10:20:30 +02:00
a571ff2c16 Text: minor change to text prefix behavior
Don't keep the cursor at the start of the line,
this was creating a selection when adding a prefix without a selection.
2019-08-10 04:48:59 +10:00
d20d9aa3e8 Fix T68486: GPencil ehen interpolate strokes, only display one stroke not all
The drawing loop exit too early.
2019-08-09 20:28:12 +02:00
3c81c53a31 UI: add menus for the info editor
D5444 by @tintwotin with edits
2019-08-10 01:48:53 +10:00
0944750921 Keymap: Ctrl-G now maps to Find Set Selected
This finds using the current selection instead
of using the text in the find side-bar.

More useful for quickly jump to other instances of a word.
2019-08-10 01:48:53 +10:00
18668a20cb Cleanup: Remove blank lines and trim end line spaces 2019-08-09 17:46:05 +02:00
810caad80e Fix T67591: Gpencil reorganize Edit Menu
The Grease Pencil Stroke Menu in Edit mode is cluttered with operators that act over stroke, points or the entire object.

To keep the consistency of the edit menu with other Blender Objects, we should separate the menu in: Grease Pencil - Stroke - Point.
Also we should add some missing operators and other menus like Show/hide or Weights among others

Differential Revision: http://developer.blender.org/D5449
2019-08-09 17:39:34 +02:00
899c85a118 Fix T67821: Snap to Symmetry not updating
Added a missing depsgraph update.
2019-08-09 17:26:54 +02:00
58f38ff5c1 UI: add back header icons to toggle text display options
These were removed in D5028, adding back by popular demand.
2019-08-10 01:14:40 +10:00
2b029234ba Cleanup: alternate fix for T66019
Prefer triple quoting to avoid having to escape quotes.
2019-08-10 00:44:50 +10:00
62ff55167c Cleanup: simplify preview check in sequencer
Also removed XXX comment which is now resolved.
2019-08-10 00:22:22 +10:00
a148056841 UI: Show suffix '*' instead of graying out 'Save Preferences'
Save preferences still works when preferences have not been edited.
2019-08-10 00:09:39 +10:00
c274151afe Cleanup: move space types under DNA_DEPRECATED
Prevent accidental use
2019-08-10 00:05:12 +10:00
b88d4ae12e Cleanup: remove redundant time check 2019-08-10 00:05:12 +10:00
65408cba20 UI: Clean up Sequencer/Preview Menu and Preview Menu
The Sequencer/Preview Menu is a mixture of both the Sequencer and the Preview menu functions, but they are currently not presented in an organized way.

Moved the Preview Zoom functions up next to the Sequencer Zoom functions with a separator in between.
Moved the Preview Show functions up next to the Sequencer Show functions with a separator in between.
Uncommented Show Framenumber Indicator, since it does not work or have a function after scrubbing in the timebar was implemented.
Renamed Show Metadata to Show Image Metadata, since it does only show metadata for images.
Added Show Annotations to View Menu for consistency.
Added Frame Overlay to View Menu for consistency.
Added Fractional Zoom to a sub-menu, since Sequencer/Preview View menu became too long. This sub-menu is in consistency with the Fractional Zoom menu in the Image Editor.
In Sequencer/Preview mode the Fractional Zoom will be named Fractional Preview Zoom, to specify that this function is only for the Preview.

Patch by Peter Fog (tintwotin)

Differential Revision: https://developer.blender.org/D5339
2019-08-09 15:35:42 +02:00
e1665905df Fix T68322: Shear in Dopesheet causes crash
The Shear transform operator is now disallowed in the timeline and
dopesheet editors.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5440
2019-08-09 14:53:25 +02:00
9deb73df3d Clarify "Save on Exit" tooltip
The old text, "Save modified preferences on exit" suggests that only the
modified preferences are saved. This is not the case: all preferences
are saved at once. This distinction is especially important after having
loaded factory default settings.

As discussed with @campbellbarton and @JulienKaspar.
2019-08-09 14:35:28 +02:00
fbc90ae2bf UI: Sequencer Sidebar Text-Strip Panel adjustments
The functions are now divided into two nested sub panels, since it makes it easier to navigate through the options.

The Location values are moved above the Alignment values, to avoid the confusion that the alignment values could be presets for the location.

In the menu and context menu the Text Effect strip was among the functions which had the Input sub menu visible. Text strips do not take strip inputs, so this is a bug, which is solved with this diff.

Patch by Peter Fog (tintwotin)

Differential Revision: https://developer.blender.org/D5142
2019-08-09 14:08:20 +02:00
97336dbb3d Cleanup: Fix stupid style error in previous commit 2019-08-09 11:41:50 +02:00
8aa2f3b6ce GPencil: Add "Self Overlap" parameter to materials to disable Stencil
This parameter was removed in 2.80 and we decided to back again, but now is inverted.
2019-08-09 11:37:02 +02:00
533e48520e UI: expand on console menus
Some features weren't exposed anywhere in the interface.

D5443 by @tintwotin
2019-08-09 19:16:35 +10:00
4c9fe65745 UI: Sculpt menus cleanup
This removes the Brush pulldown menu from Sculpt and Paint modes. This menu only contained a random duplicated subset of brush options. Now everything is accessible centrally in the Brush Tool Settings.

The Sculpt menu likewise contained various random brush options. These are removed and replaced by a list of commands, just like the other paint modes.

Also removes the Show Mask option from the mode options panel since this is also in Overlays.

Reviewers: Campbell Barton

Differential Revision: https://developer.blender.org/D5420
2019-08-08 22:54:57 +02:00
634621d54d BMesh: add utility to calculate normal from a vertex cloud
Extract from BM_verts_sort_radial_plane & simplify.
2019-08-09 05:44:27 +10:00
1eead85cdc Cleanup: remove function already implemented in BKE_deform 2019-08-09 02:02:32 +10:00
47cd57eedc Docs: improve description of 3D view distance offset utility 2019-08-09 01:55:05 +10:00
39b5b22174 Cleanup: use doxy sections 2019-08-09 01:55:05 +10:00
a0d9043f43 Cleanup: warnings 2019-08-09 01:55:05 +10:00
e18e9aa0d0 Cleanup: Typo in naming (BLE instead of BKE, tssttt). 2019-08-08 17:20:39 +02:00
1342d1879e Fix T52551: undo causes crash after enabling a new rigid body when scene uses a referenced rigid body world.
Poll functions were not correct here, we cannot make objects part of
rigidbody sim if the RB collection is a linked one...
2019-08-08 17:20:39 +02:00
45ec08dc99 GPencil: Add mode Merge to Simplify modifier
This option uses the same logic of the merge by distance but as an option of modifier to allow dynamic merge.

This option will be very useful for LANPR generated strokes.
2019-08-08 17:16:17 +02:00
179e886ab3 GPencil: New Simplify modifier mode Sample and operator
This mode simplify the stroke doing a resampling of the points and generate new geometry at the distance defined.

Sample function developed by @NicksBest

New Resample Stroke operator

This operator recreates the stroke geometry with a predefined length between points.

The operator uses the same code used in Simplify modifier.

Reviewers: @mendio
2019-08-08 16:43:54 +02:00
5ca3bc7a14 Fix T68393: lift hardcoded limit on particle children 'child_radius'
Reviewers: jacqueslucke

Maniphest Tasks: T68393

Differential Revision: https://developer.blender.org/D5436
2019-08-08 15:22:56 +02:00
2fb42816cf Fix T68375: Polyline: can not make segment (cyclic)
Reviewers: campbellbarton

Maniphest Tasks: T68375

Differential Revision: https://developer.blender.org/D5438
2019-08-08 15:13:49 +02:00
3504b4c9c3 Fix T68360: Zoom too sensitive with hi-dpi
Scale pixel-input by pixel size for zoom operators.
2019-08-08 22:53:30 +10:00
01aae653a1 Cleanup: use static for undeclared function 2019-08-08 22:51:01 +10:00
b9d0f33530 Fix T67545: GPencil - New Merge by Distance operator
Merge points when the distance is less than a predefined value.

The method to interpolate the position created a wrong merge. Now, always the secondary point is merged with the first one (merge at first), except the last point.
2019-08-08 14:13:01 +02:00
9d4a8cbd88 2nd attempt to fix build error from rB22bdd08dfd08
sorry for the noise, if that doesnt do it, I'll revert and check this
thoroughly...
2019-08-08 10:44:32 +02:00
6689614e39 attempt to fix build error from rB22bdd08dfd08 2019-08-08 10:38:01 +02:00
22bdd08dfd Fix T68250: Camera keyframing (Walk/Fly) despite canceling movement
Reviewers: campbellbarton (thx!)

Maniphest Tasks: T68250

Differential Revision: https://developer.blender.org/D5418
2019-08-08 09:41:19 +02:00
3241a29990 Keymap: don't use 'any' modifiers for the text editor context menu 2019-08-08 16:40:40 +10:00
8c0daaecdf Cleanup: rename text toolbox to context menu 2019-08-08 16:39:50 +10:00
512b562b3b Text: reorganize menus
- Add "Live Edit" to Text menu.
- "Top/Bottom of File" renamed to "Top/Bottom" and placed in Navigation sub-menu.
- Added navigation functions to Navigation menu,
  since they were not exposed in the menus.
- Added selection functions to Select menu,
  since they were not exposed in the menus.
- Moved the Select menu to the Header in consistency with the 3D View.
- Inserted comment in context menu.

D5434 with edits.
2019-08-08 16:15:59 +10:00
7bc300a74b Fix T67587: Fix Drawing in Wireframe Non X-Ray Mode
When using Vertex or Weight paint mode on a wireframe the overlay was
blended with the background. In this case we now use alpha blending.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5340
2019-08-08 08:00:57 +02:00
66356dae94 Fix T67638: Stretched Camera Background Images
The matrices that projects background images in the 3d view
were incorrect. The root cause was that the coordinate systems were not
respected, that was most noticeable when rotating a stretched image.

We re-validated conversions of coordinate spaces (UV -> Image -> Camera -> Window)
and made sure that the rotation is done in image space.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D5431
2019-08-08 07:53:21 +02:00
9fd9d90247 Keymap: only use Alt-Left/Right for legacy keymap
Ctrl-Left/Right aren't in conflict for the default keymap.
2019-08-08 15:31:47 +10:00
d727f4f223 UI: Remove Grease Pencil Interpolation from stroke menu
This is a bit redundant because there is the interpolation popover.
Also these options were available while drawing which is not useful.
2019-08-07 19:56:52 -04:00
5e77fb2482 API Docs: Correct Hotkey
Here we can link to the manual and keep the hotkey updated in the manual 
rather than the API docs.

Fixes T68371
2019-08-07 17:20:40 -04:00
ba0870713b Fix T68268: Crash switching to Weight Paint mode
Also applied to sculpt mode
2019-08-08 04:36:43 +10:00
7c08cddedb Fix unassigned return argument in recent select refactor 2019-08-08 04:36:43 +10:00
764cc75e1f Edit Mesh Selection: Move ED_view3d_select_ functions to bf_draw
It is easier to deal with private values of the DRW_select engine and gives room for improvement.

Reviewers: campbellbarton, fclem

Differential Revision: https://developer.blender.org/D5415
2019-08-07 12:43:31 -03:00
9d7d34c12a Select utils refactor: remove lagacy ED_view3d_select_id_read_rect
`ED_view3d_select_id_read_rect` serves only as a bridge to `DRW_framebuffer_select_id_read`.
Keeping these codes similar only increases the complexity of some functions.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5415
2019-08-07 12:43:31 -03:00
dafecfa683 UV: select overlap operator
New operator to select overlapping UV's,
from all visible edit-mesh UV's.

D5421 @deadpin with edits.
2019-08-08 01:28:03 +10:00
3e27dd5b55 Fix T67623 Eevee: Modulo node making unexpected/inconsistent behaviour
This was a precision error. Using a more robust approach
2019-08-07 13:08:48 +02:00
be4063dbbb Fix error in recent trackball aspect cleanup
Error in 7f8d620e20
2019-08-07 21:02:19 +10:00
b560e15028 Fix T68348: Hotkeys do nothing when over viewport gizmos
This was done intentionally so mouse press events tools didn't prevent gizmos
receiving click events before `USE_GIZMO_MOUSE_PRIORITY_HACK` was added.
2019-08-07 20:36:48 +10:00
8f8e91987b Fix tool-tips remaining after operators start
It was possible for e.g. to have a header tooltip displayed,
then start walk-navigation which didn't close the tool-tip.
2019-08-07 20:36:44 +10:00
c3ef1f8db3 3D View: utility function to set the depth from a location
Avoids having to do projection/offset calculations inline.
2019-08-07 18:27:21 +10:00
7fcf1f2d9c Fix T68340: Add reference image to hidden collection fails 2019-08-07 16:40:27 +10:00
Julian Eisel
85c843b115 Remove compiler fix for unsupported MSVC version 2019-08-07 01:55:16 +02:00
f4e27bc2c9 Fix not reported: Face selection sometimes does not work in weight, paint and texture mode. 2019-08-06 17:27:00 -03:00
00cb31de65 Cleanup: use BKE_ prefix for BKE_colortools.h 2019-08-07 03:38:01 +10:00
e2630f388d Cleanup: clang-format 2019-08-07 03:34:59 +10:00
3227b37141 Fix Dopesheet transform regressions due to rB81dc76c19cff
Functions that begin with the name `apply` closely resemble the main callback to apply.
Ref T68137
2019-08-06 14:02:29 -03:00
317033a1be Annotations: Remove Simplify option from Userprefs
This option was an old option for Grease Pencil tools and it's not logic for Annotations.

Differential Revision: http://developer.blender.org/D5426
2019-08-06 18:53:39 +02:00
467b0aa227 Fix T68320: measure tool memoryleak
It was a stupid mistake with the wrong pointer being referenced.
It was a serious problem because the memory leak was considerable.
2019-08-06 12:50:08 -03:00
edb828d0d7 DrawManager: Fixed Assertion In Workbench 2019-08-06 16:49:02 +02:00
88a872dd6e Fix T68227: Pinning the particles system data-block causes error
The 'Seed' setting is not part of the pinned data-block. When pinning,
the local variable `psys` is `None`, and this wasn't properly checked for
when drawing the 'Seed' setting.
2019-08-06 15:31:49 +02:00
6b0c97466f Keymap: add sequencer left/right select
Matches graph editor keys.

D5192 by @tintwotin
2019-08-06 22:40:34 +10:00
39f005eae8 Fix crash when opening files with missing armature libaries
In the case where the library is missing, the armature object is
replaced with an empty. This would crash the armature modifier.

Now we check if the armature object really is an armature or not.
2019-08-06 14:34:48 +02:00
dcad1eb03c Cleanup: move utf8 offset conversion into BLI_string_utf8
There isn't anything specific to text data with these functions.
2019-08-06 21:59:13 +10:00
8b2810a32f Cleanup: spelling (neighbor) 2019-08-06 21:59:13 +10:00
199c37d7e4 Fix T68291: crash snapping to both verts and edges with linked meshes
this was also happening in snapping with the measure tool

same method as in snap_mesh_polygon() (from rB59286ddcf80c) now used in
snap_mesh_edge_verts_mixed() as well...

Reviewers: mano-wii

Maniphest Tasks: T68291

Differential Revision: https://developer.blender.org/D5422
2019-08-06 13:28:20 +02:00
45ae33a952 Fix T66731: Part 3: Labels translations when tools are in 'compact' mode.
Very annoying that this whole UI thingy uses its own cooking... This is
more a quick-slap fix than a proper solution, would expect it to work in
nearly all cases though...
2019-08-06 12:18:42 +02:00
785301e5ac Annotation: Simplify only 3D annotations and reduce factor
The old factor was too much and the lines could be changed. Anyway, when use simplify the number of points is reduced and the general shape is the same but not as smooth as original stroke.

Also, the simplify is only used in 3D view.

Note: Not sure if we would have to remove this simplify option for annotations.
2019-08-06 09:06:29 +02:00
bb53d2b07a Sequencer: frame offset feature usability
- Expose the operator in the panel,
  (wasn't available in the UI at all).
- Offset frame was hard coded to a color matching the background.
  Use the current frame color with dashes instead.
- Overlay toggle had wrong name.
2019-08-06 17:05:07 +10:00
1aabb0bfcf Cleanup: redundant const usage 2019-08-06 17:05:07 +10:00
85c3e12049 Fix T66100: WorkBench Banding Issues
Color banding issues can appear, as result of the 8 bitdepth RGBA that
is used in the viewport.

This change will use `GPU_RGBA16F` for final renderings and for drawing textures. This
allows displaying HDRI textures. Vertex Colors uses `GPU_RGBA16` to resolve
color banding issues. All other modes use `GPU_RGBA8` to reduce
bandwidth and gpu memory.

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D5179
2019-08-06 08:34:39 +02:00
0394f2ab30 Fix T66671: Memory Leak Material Preview
During generating of a material preview with world lighting only the
copy world was being freed. The material was removed from the main, but
was not freed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5224
2019-08-06 08:30:59 +02:00
694f9cb18c DrawManager: Fix Camera Images Interfere During Selection
When drawing the selection buffer the camera images were drawn. This
resulted in unneeded extra clicking for the user. This change will
ignore camera images during the selection.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5276
2019-08-06 08:26:43 +02:00
972c05537d Refactor Paint Overlay Opacity Panel
It is now possible to translate this panel. Due to the previous
structure the translation tools were not able to pick the strings up as
translatable strings.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5279
2019-08-06 08:20:56 +02:00
08717f4a2c Fix T67437: Vertex Colors Not Visible In SculptMode
Recently Shader parameter names for UVMaps and vertex colors were renamed.
The sculpt drawing code still used the old parameter names.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D5320
2019-08-06 08:18:28 +02:00
4cdc5a12da UI: rename Border to Box Select
Missed in previous renaming commits.
2019-08-06 16:10:48 +10:00
95de738953 Fix T68283: Missing operator in graph context menu 2019-08-06 14:49:59 +10:00
dcbce4b924 Fix T6813: Dopesheet Editor: Moving keyframes by a number value doesn't work
It was a mistake to add the line `t->values_final[0] = t->values[0];`
2019-08-05 21:47:22 -03:00
cdeda1fa6c Fix T68272: Annotations segment fault when use Simplify option
This error was introduced with the array dynamic system for very long stroke.

Now, instead to use a custom code for simplify annotations, it uses the standard simplify BKE function more robust and with better results.

The factor of 0.15f has been set fixed after testing a good result value.
2019-08-05 20:52:10 +02:00
b4a325f535 Cleanup: use unsigned char for theme colors
Nearly all byte-color functions use 'uchar'
causing casts when then colors were passed in.

Declare as uchar to remove the need for casts.
2019-08-06 04:35:22 +10:00
17f299c5d1 Cleanup: quiet cast warnings in recent commit 2019-08-06 04:35:22 +10:00
ad417f73c0 New BLI Function: projmat_from_window_region
Creates a projection matrix for a small region of the viewport.

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D5412
2019-08-05 14:04:43 -03:00
0c4ee9e13d Fix T67665 "Affect Alpha" in Texture Paint mode doesn't work as expected
The "alpha lock" check was missing for the smear and soften brush.
Added checks to make sure that the alpha values are kept the same.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5416
2019-08-05 18:50:34 +02:00
9fe592ab8f Fix (unreported) transfer mesh data operator not enabling autosmooth.
When we transfer custom normals and allow for data creation, we should
also enable autosmooth on destination meshes.
2019-08-05 18:44:10 +02:00
64b092974c Cleanup/windows: Remove 32 bit support from make.bat helper script
This change removes 32 bit support from the helper make.bat scripts
as we are dropping official 32 bit support, you can still build for
32 bit by configuring your build yourself using cmake and pointing
the LIBDIR cmake variable to your own 32 bit library folder.
2019-08-05 10:31:51 -06:00
592759e3d6 Fix T68211: Transfer Mesh Data with Custom Normal crash when Auto Smooth is enabled.
Code in modifier stack ensuring requested CDLayers are provided was not
working very well for polynors in several cases:
* We cannot share the orig mesh if we have to generate pnors/lnors;
* Generating pnors without lnors was not possible.
2019-08-05 18:07:49 +02:00
52f83011c8 Fix T67259 : Auto depth not working with multires in sculpt mode
Basically the solution is to call `DRW_shgroup_call_sculpt` when `BKE_sculptsession_use_pbvh_draw(...)` is true.

Ref T67259

Reviewers: fclem, jbakker, brecht

Reviewed By: fclem, brecht

Maniphest Tasks: T67259

Differential Revision: https://developer.blender.org/D5396
2019-08-05 11:04:40 -03:00
58229b191a Fix T68145: Bone Rotate Individual Axes fail.
Rotation matrix would not get updated every time it would need to, after
own changes to handle 'big' rotations from keyboard input (rBcee484a4c51a3d2).
2019-08-05 15:47:28 +02:00
8f1a55831c Cycles: Fix wrong number of threads on multi-socket machines
The issue was caused by a limitation of GetNumaNodeProcessorMask():
on systems with more than 64 processors, this parameter is set to the
processor mask for the node only if the node is in the same processor
group as the calling thread. Otherwise, the parameter is set to zero.

Patch from Max Dmitrichenko, thanks!
2019-08-05 15:33:47 +02:00
afff94f09f Build: add ninja target to make wrapper
To use the ninja build tool which is typically faster than make, especially
for quick rebuilds.
2019-08-05 15:25:36 +02:00
2d60a54649 Build: add config for developers
This has faster builds, error checks and tests. The number of cmake options
for this type of thing has grown over the years and it's convenient to be
able to point new developers to a single target.

Previously the combination of all these options did not work correctly, now
all tests should pass.

The easiest way to use this is with the make wrapper, for example:
make full developer debug

Or set it manually with CMake:
cmake -C ../blender/build_files/cmake/config/blender_developer.cmake .

Differential Revision: https://developer.blender.org/D5149
2019-08-05 15:25:36 +02:00
47bf754de4 Build: disable address sanitizer for Cycles optimized kernels with GCC
It's extremely slow to compile and run, so just disable it unless
WITH_CYCLES_KERNEL_ASAN is manually enabled. For Clang it's always
enabled since that appears to work ok.

This also limits the -fno-sanitize=vptr flag to the Cycles kernel, as it
was added specifically to work around an issue there.

Differential Revision: https://developer.blender.org/D5404
2019-08-05 15:23:57 +02:00
916e51a407 PyRNA: support separators in enum-items lists
Resolves T68260
2019-08-05 23:10:44 +10:00
fa1d470692 GTest: test cases for polyfill2d bug T67109 2019-08-05 22:44:16 +10:00
e31a1c6fd3 Fix T67109: n-gon tessellation error with co-linear edges
Improve the area calculation method for better precision,
so faces offset from the center don't have a less precise area.
2019-08-05 22:43:23 +10:00
f9cf815160 ED_view3D: Remove and replace ED_view3d_select_id_read
It is very similar to `ED_view3d_select_id_read_rect`.
2019-08-05 09:30:55 -03:00
38d7e14dc8 Fix (unreported0 bad usage of do_versions_find_region() in versionning code.
When NULL pointer can be a valid return value, one has to use
`do_versions_find_region_or_null()` instead...

Fixes asserts as reported in rBa2fe386153e.
2019-08-05 14:24:44 +02:00
9620b8f6bb Cycles: Fix compilation on 32bit Linux with GCC-9
We don't use explicit SIMD flags on 32bit, so trying to use
intrinsics was causing issues.
2019-08-05 11:47:47 +02:00
94dce826a9 Text: only un-comment blocks which are completely commented
It's common to select a block of code and comment it
which may already contains some comments.

Now only un-comment blocks which are completely commented
(ignoring white-space).

Makes toggle comments behave more usefully, resolves T68060.
2019-08-05 15:53:27 +10:00
91fa07dfb1 Text: merge toggle comments into a single operator
This allows users to map comment/un-comment to be mapped to keys.
2019-08-05 13:54:27 +10:00
8b4f00269c UI: rename rotate to orbit for viewport sensitivity
Matches names of related preferences.
2019-08-05 13:15:36 +10:00
cd02fe5d70 Cleanup: remove underscore prefix for used vars
Also remove unused vars.
2019-08-05 12:47:55 +10:00
f69ea92599 Cleanup: add braces 2019-08-05 12:46:58 +10:00
9fbf522dd8 Cleanup: Fix eeve_lut arrays being duplicated in blender binary.
Both eevee_materials.c and workbench_deferred.c include eeve_lut.h which has its arrays marked as static leading to the blue_noise array being embedded into our binary twice.

This change takes the arrays out of the header and properly marks them as const since they are lookup tables and should not be written to.

Reviewers: fclem, brecht

Differential Revision: https://developer.blender.org/D5346
2019-08-04 14:32:53 -06:00
418fdee5dc Cleanup: Mark large arrays of of constant data as const.
For background information see D5345

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D5345
2019-08-04 14:24:29 -06:00
37cef86f0d Fix: msgfmt add support for cr-lf style line endings
linux did not recognize cr as a valid character.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5337
2019-08-04 11:46:00 -06:00
Your Name
f08662d3ed Sculpting: Remove Show Diffuse Color Option
This should have been removed in 2.80 as the functionality was removed.
This feature now does not do anything and can be removed.

Differential Revision: https://developer.blender.org/D5411
2019-08-04 11:53:48 -04:00
47335b4e61 Add a new Copy As Driver context menu option for properties.
It is a very common need to create drivers that set the value of
a property to the value of some other property, but it currently
requires multiple actions: Copy Data Path on the input property,
adding a driver to the output property, selecting the input ID
reference, and pasting the path.

This adds a new Copy As Driver context menu option, which creates
a complete driver in the clipboard that reads the current property,
so all that remains is to paste it to the output property. It is
also possible to paste just the new driver variable into an existing
driver to combine multiple inputs.

Reviewers: brecht, billreynish

Differential Revision: https://developer.blender.org/D5382
2019-08-04 13:58:15 +03:00
a2fe386153 Text Editor UI
Tweak Text Editor to fit better with the rest of Blender 2.8:

  - Move sidebar to the right
  - Add proper context menu
  - Move view toggles to the View menu
  - Change the indentation option to be an enum between spaces and tabs
  - Several layout tweaks

Patch by @tintwotin / Peter Fog with additional tweaks by me.

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

Reviewers: Brecht, Campbell
2019-08-04 12:51:28 +02:00
c0aada58c9 Tweak Brush Gradient UI
Gradient and Color are mutually exclusive, so we now communicate this in the UI much more clearly

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

Reviewers: brechrt
2019-08-04 12:37:22 +02:00
dd3cdf6f1e Fix T68202: GPencil Set Origin do not refresh until object is moved 2019-08-04 10:21:02 +02:00
18540f41d7 Cleanup: improve comments 2019-08-04 12:53:06 +10:00
2425401a59 Cleanup: spelling 2019-08-04 12:51:44 +10:00
Your Name
85a7cebd53 UI: Fix Small inconsistency in particle emission
This property was being called something
else depending on the distribution type
2019-08-03 16:22:04 -04:00
edcefb739a Cleanup: Fix build error with msvc
math.h does not define M_PI on windows, needs BLI_math_base.h to get them.

thanks to @quollism on chat for spotting it.
2019-08-03 10:47:35 -06:00
e82b7f1527 3D View: preferences for rotate sensitivity
Added because the current default is too fast
for painting with tablets, see D5385.

Turntable and trackball have different settings because
turn-table uses an angle-per-pixel, where as trackball
values are relative to the view-port size so a scale is used.

The sensitivity is scaled by the pixel size so hi-dpi views don't rotate faster.
2019-08-04 01:31:25 +10:00
27aef8b551 3D View: aspect correct trackball rotation
Hard coded aspect was used, doubling horizontal input
however this caused sliding for views which didn't match this aspect.

Calculate the aspect based on the view bounds instead.
2019-08-04 01:19:22 +10:00
7f8d620e20 Cleanup: trackball direction calculation
Remove z axis flipping, only needed because x & y were flipped.
2019-08-04 01:18:23 +10:00
5e5cf9ea9f Fix T68161: typo in ui_text of RNA scene.objects 2019-08-03 12:22:23 +02:00
3232fc335d Deps: Fix build error with theora on windows. 2019-08-02 13:29:29 -06:00
6de4123ebd GPencil: Replace Separate menu by operator Enum to display assigned key
As the operator was using a menu, the keymap was not displayed. Now, the operator is used directly and don't need the menu.
2019-08-02 21:24:00 +02:00
f7d5941faa Fix freestyle tests failing when using WITH_PYTHON_SAFETY 2019-08-02 19:53:59 +02:00
15e224dca3 Build: disable RTTI for the entire Cycles module, not only the kernel
The partial disabling was causing issues with Clang and ASAN, and it seems we
don't need to restrict it to the kernel anymore now that we are no longer using
boost directly.
2019-08-02 19:03:57 +02:00
a744fedc85 Fix T68129: Bridge edge loops fails on small edge loops 2019-08-03 02:52:30 +10:00
26d5fae284 Fix T68135: Do not return NULL/None when converting an object to a mesh.
Does not make sense in the use-cases of that function, especially since
we don't know whether it is actually due to an error, or some glitch
(like an empty curve).

Think we always want to get a mesh when using either operator
conversion, or the `bpy.data.meshes.new_from_object` function.

Note that an assert was also added to ensure we do try to convert from a
valid 'geometry' object type.
2019-08-02 18:24:59 +02:00
dda0de4a3d Fix address sanitizer overflow warnings for bit manipulation functions
Perform with unsigned int instead of signed int.

Differential Revision: https://developer.blender.org/D5402
2019-08-02 17:25:25 +02:00
256c412b31 Tests: also don't fail on memory leaks for gtests 2019-08-02 17:25:25 +02:00
5ba070ce53 DRW: Select Engine: Create DRWPass only when context requests it 2019-08-02 12:14:12 -03:00
454daf9b6b Upgrade Python from 3.7.0 to 3.7.4 2019-08-02 16:49:26 +02:00
53ae209d25 make deps: avoid running pdflatex as part of building Theora
On machines with pdflatex installed, this is run to build Theora.pdf.
Unfortunately this process breaks, at least on my Ubuntu 18.04 LTS
system. By setting `HAVE_PDFLATEX=no` (or any other value that is not
"yes") this can be avoided. I don't think that it's important to have
this PDF file built anyway, as it's not a dependency of Blender itself.
2019-08-02 16:49:26 +02:00
369ffbd911 Fix T68073: Wacom Intuos 5S no pen pressure on Wayland
The issue is that wayland seems to impose a generic device naming scheme
when using Xwayland For example any table stylus will show up with the
following naming convention: xwayland-stylus:33

For this to work in blender, I had to modify how the identifier string
is extracted. I also renamed the two char pointers in the search
algorithm to be more logical.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5401
2019-08-02 16:42:24 +02:00
455a1e210b Fix T68021: GPencil After using eraser when draw primitives, next primitive has missing handles
The problem was related to wrong Brush. After using the Eraser or Fill, the default brush was not the drawing one, so the handles were missing.

Now, the operator force the drawing brush.

Reviewer: @campbellbarton
Differential Revision: http://developer.blender.org/D5403
2019-08-02 16:25:49 +02:00
9198ff4306 Cleanup/Win: Fix build folder name if no target is set
When you call make.bat without a target the build folder name would
have a double underscore in it which looked odd.
2019-08-02 08:25:18 -06:00
630747ca66 Fix T66731: Translated texts remain original english (Tools' tips part).
This should fix all remaining issues reported in T66731 I think.
2019-08-02 16:20:06 +02:00
820522d514 Fix (unreported) missing/broken translations in Text space.
As a reminder, no new fancy python string formatting is just
not working (tm) with i18n translations system...
2019-08-02 16:20:06 +02:00
15b848ef60 Fix most (if not all) untranslated Panel-labels reported in T66731. 2019-08-02 16:20:06 +02:00
8936479f76 Cleanup/Win: Remove unused game engine variables in build helper scripts 2019-08-02 08:19:04 -06:00
e5a5d28c3e Fix T67670: Sculpt doesn't mark the file as modified
Was also an issue for texture & paint curve.
2019-08-03 00:12:55 +10:00
05226e1512 Fix T68122: Settings for Select root and Select tip in particle edit mode are missing
Do not hide the redo window for root/tip select anymore.
2019-08-02 16:03:26 +02:00
cb1b7e8a48 Cleanup: clang format
Strange, this was not applied automatically.
2019-08-02 11:00:49 -03:00
8fbe18dc8d DRW: Select Engine: Set uniform only once per ShadowGroup 2019-08-02 10:48:16 -03:00
ae7137cdf8 View3D Mesh Selection: Specify select_mode directly for Circle, Lasso and Box selection
No functional changes.
2019-08-02 10:48:16 -03:00
5f4e99b7a2 Fix broken add_python_test after recent changes 2019-08-02 15:45:01 +02:00
ab3de09591 Fix T68112: Align View on object add is broken
No need to use BKE_object_where_is_calc() in this case: there is no
parenting or constraint system involved on object add.

So simply use direct object matrix calculation from it's local
transform. No need in dependency graph either in this case.
2019-08-02 15:15:41 +02:00
5cf6d7e2b0 Fix edge selection ignoring clipping in wire-frame display 2019-08-02 23:01:19 +10:00
d8c6105366 Fix ignored window clipping test in foreach edge function 2019-08-02 22:54:17 +10:00
38ff5064b3 Tests: don't fail on leaks detected by leak sanitizer
These often happen in external libraries that we can't fix. The leaks are
still printed in the logs.
2019-08-02 14:42:25 +02:00
f4b0900856 Cleanup: refactor tests executing Blender to use add_blender_test function 2019-08-02 14:42:25 +02:00
22f17551e5 Fix scene units test failure after recent changes 2019-08-02 14:42:25 +02:00
b5807be437 Fix T68126: Cycles not enabled with factory settings 2019-08-02 13:04:10 +02:00
0c7a4c74d3 Cleanup: clang-format, also typo fix. 2019-08-02 20:04:45 +10:00
67e5422970 Fix text editor undo sync when mixed with other undo systems
Undo rewrite broke test_undo.text_editor_edit_mode_mix.

Relatively harmless since it's only out of sync by one action.
2019-08-02 19:48:08 +10:00
8949dd6cb6 Cleanup: correct name for scene frame conversion
Thanks to @sybren for pointing out issue from 299ff91ea1
2019-08-02 19:30:38 +10:00
a89ecd9617 Cleanup: GPencil dissolve operator now uses GP_EDITABLE_STROKES_BEGIN macro
This reduces the number of loops
2019-08-02 11:29:12 +02:00
cb6e3e82b0 GPencil: Make GP_EDITABLE_STROKES_BEGIN macro safe when stroke is removed
If the macro was used in a loop where the stroke was removed, the macro failed.
2019-08-02 11:29:11 +02:00
eb2a078f4d GPencil: New function to dissolve points in stroke
This function will be used for new operators.
2019-08-02 11:29:11 +02:00
b54528fa1e BrightContrast not working correctly with negative contrast
followup to rB8dd95abb2ff9 (which fixed this for the Compositor node),
turns out this was also wrong for the VSE modifier and in vertex color
operator.

- also adjust min/max for VSE modifier
- also guard against division by zero

Reviewers: brecht

Maniphest Tasks: T67808

Differential Revision: https://developer.blender.org/D5398
2019-08-02 10:09:29 +02:00
31da3936b4 GPencil: Add Frame parameter to modifier deformStroke Callback
This commit adds the frame to deformStroke Callback as a preparation for new modifiers that will need this variable.

Actually, the existing modifiers are not using the frame.
2019-08-02 09:50:33 +02:00
a897c8e342 Fix unreported: length measure displayed on the "Sequence Slide" operator panel 2019-08-02 01:49:49 -03:00
2074d850ee Docs: correct comment for PROP_THICK_WRAP 2019-08-02 14:32:17 +10:00
81dc76c19c Fix T63570: Proportional editing resets scaling along Y and Z axis on mouse wheel
`applyResize(...)` considers that `t->values` always represents a `ratio`.
But this is only `true` with the `MOUSEMOVE` event.
The solution proposed is to never change `t->values`.
The result of the final transformation is now written to `t->values_final`.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5212
2019-08-02 01:15:33 -03:00
14b2c41216 Cleanup: doxy sections 2019-08-02 12:30:57 +10:00
c060a835bb Fix unreported: Selection of mesh_cage element occluded by the mesh_cage itself.
The right thing is to be occluded by the visible mesh (in the case with modifiers).
2019-08-01 23:19:00 -03:00
58a2b2dd7e Cleanup: spelling 2019-08-02 12:05:13 +10:00
9be956c326 Cleanup: unused variable 2019-08-02 12:05:13 +10:00
53a0916636 DRW: Select Engine: Add a utility to detect select_node 2019-08-01 23:00:34 -03:00
65b6d4a34d Edit Mesh Select: Remove redundant and deprecated FAKE_SELECT_MODE_... 2019-08-01 23:00:34 -03:00
eff91da4df DRW: Select Engine: Use specified offset.
Due to current uses, this does not bring functional changes.
2019-08-01 23:00:34 -03:00
abebb27644 DRW: Select Engine: remove unnecessary DRWShadingGroup creations 2019-08-01 23:00:34 -03:00
ec131e2d53 Object Mode: add back non '_ex' versions of mode-switching functions
While these aren't currently used, its strange to have
extended versions of a function without the non-extended versions
it also avoids callers needing to add them back if they need -
or duplicating the same boiler plate when calling the '_ex' versions.

Reverts 11da3b132a, 11da3b132a, adds depsgraph argument
so the caller is responsible for the evaluation state.
2019-08-02 11:44:01 +10:00
7a47c0031f Cleanup: quiet maybe-unused warnings
While harmless, use flow control that always sets the variable.
2019-08-02 11:44:01 +10:00
7f9b1fe73c Cleanup: quiet maybe-unused warning
While harmless, use flow control that always sets the variable.
2019-08-02 11:21:22 +10:00
cfaef2db30 Cleanup: padding in windowmanager 2019-08-01 18:32:12 -06:00
066a7173c0 Keymap: add fractional zoom shortcuts for sequencer preview
Matches shortcuts from the image editor.

D5341 by @tintwotin
2019-08-02 08:36:03 +10:00
f66b5edf98 VSE: Use sequencer boundbox for view_all operator
Fix T67279
Fix T59954

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5368
2019-08-01 12:43:46 -07:00
2c4dfbb002 Fix T66028: Move sequence, movieclip and text editor progressbars to status bar
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5219
2019-08-01 12:42:01 -07:00
aa0322524e GPU: more complete coverage of drivers for Intel shader compilation workaround 2019-08-01 21:11:28 +02:00
80123efc5f Fix T67939: GPencil Noise modifier wrong random calculation
There were several problems in the old random calculation:

* Different result in the viewport and render.
* Noise "pop" in some frames. 
* Random number was calculated every time the file was opened, so get different results.

Now, instead to calculate the random numbers when n number of frames changed, the random values are calculated using a unique seed by stroke.

Also, a new Seed parameter has been added and this adds more control in the noise generated. This value can be animated and get more variations.

Differential Revision: http://developer.blender.org/D5393
2019-08-01 18:07:57 +02:00
49b2162309 Cleanup: remove unnecessary include 2019-08-01 11:31:25 -03:00
895201808c Fix T66040: Make Data Transfer' Mix Factor multiply with vgroup weights when given, instead of ignoring it.
Brings behavior of those options in line with the VGroup editing
modifiers ones e.g.
2019-08-01 16:01:50 +02:00
21c039f6ef Alembic: fix heap-use-after-free error
The mesh can be freed by BKE_mesh_nomain_to_mesh(), so we need to get
the `ME_AUTOSMOOTH` flag before that call, and not after.
2019-08-01 15:14:57 +02:00
2741992f66 Fix T61935: load camera transforms from Alembic files written by Meshroom
Meshroom writes two hierarchies to Alembic, one rooted at
`/mvgRoot/mvgCameras` and the other at `/mvgRoot/mvgCamerasUndefined`.
These paths have no schema definition, and thus are ignored by Blender.
The cameras themselves have those schemaless paths as parent, and have
their transforms marked as "inherited", e.g. relative to their parent.
As these cameras have no valid parent, there is no Blender object to use
to convert their local matrices to world matrices, and Blender just
decided to reset them to the unit matrix.

Now "inherited" transforms without a parent in Blender are interpreted
as world transforms. Reparenting those objects to a Blender object will
re-interpret the transforms as local to the parent again.
2019-08-01 14:54:22 +02:00
08a6321501 FFmpeg pixel format conversion improvements
FFmpeg expects Blender to feed it pixels in the output pixel format. If
the output pixel format is different than Blender's RGBA, a conversion
is needed (via FFmpeg's `sws_scale()` function). There were a few issues
with this conversion (and surrounding code) that are fixed in this
commit:

- When conversion was necessary a temporary buffer was allocated and
  deallocated for every frame. This is now allocated once and re-used.
- Copying data to the buffer was done byte-for-byte. On little-endian
  machines it is now done line-by-line using `memcpy` for a little speedup.
- The decision whether pixel format conversion is necessary is now
  correctly done based on the pixel format Blender is actually using.
- The pixel format of the buffer sent to FFmpeg is no longer hard-coded
  incorrectly to a fixed pixel format, but uses the actual output pixel
  format. This is fixes T53058 properly, making RGB QTRLE export possible.
- I added some comments to make it clear which pixel format is referred
  to (either Blender's internal format or the FFmpeg output format).

Combined these improvements not only correct a bug (T53058) but also
results in approximately 5% speed improvement (tested with a 117-frame
shot from Spring, loaded as PNGs in the VSE, encoding to h.264 with
preset 'realtime').

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D5174
2019-08-01 13:37:48 +02:00
eb7fe7546c Fix T68055: mesh selection issues, once blend is loaded second time in a Blender session
The depth attachment of the framebuffer was missing.
2019-08-01 08:30:57 -03:00
6786c336bd Added FFmpeg preset for WebM + VP9 video + Opus audio
This is a standard combination (VP9 video, Opus audio, in WebM container),
so it's nice to have as a preset.
2019-08-01 12:53:11 +02:00
4cbcbacc6a I18n messages extraction: do not report multi-lines messages anymore.
Those are now supported for tooltips.
2019-08-01 12:52:52 +02:00
4b37abd61f Cleanup a bit i18n message extraction code. 2019-08-01 12:52:52 +02:00
5fde4494f6 Keymap: use Ctrl-/ to toggle comments
Consistent with many code editors, see: D5175
2019-08-01 20:32:25 +10:00
433eb3f35d Text: toggle comment operator 2019-08-01 20:31:57 +10:00
3a47fbfac5 Cleanup: quiet gcc warning 'alloc-size-larger-than' 2019-08-01 20:28:39 +10:00
7c5838cfd6 Cleanup: use doxy sections for text operators 2019-08-01 19:27:59 +10:00
765ed6ffb9 Fix T68036: VSE: 'Remove Gaps' causes audio to go out of sync
Reviewers: sergey

Maniphest Tasks: T68036

Differential Revision: https://developer.blender.org/D5391
2019-08-01 11:22:46 +02:00
eb0902243e Linux: resolve issue compiling on mint 18.3
size_t wasn't declared. While this could be resolved differently,
convention is to include BKE after BLI.
2019-08-01 19:17:22 +10:00
b5b0804c5a Cleanup: use _ex suffix instead of _ext
Convention is to use ex, not ext for extended
versions of a functions.
2019-08-01 18:39:21 +10:00
502c2c233d Cleanup: misc spelling fixes in variable names & defines
T68045 by @luzpaz
2019-08-01 17:35:59 +10:00
46c22f33b2 Cleanup: remove redundant LMB select default. 2019-08-01 17:23:58 +10:00
d1848b80f1 Fix error setting the user preferences
User preferences from the startup.blend was still being used,
fixing this exposed missing theme initialization, now fixed.
2019-08-01 17:23:41 +10:00
036312ecff Fix error de-duplicating BLI_file_read functions
Own error in recent code de-duplication: a345f56ce3
causing issues on Windows.

Flipped argument for reading the exact size.
2019-08-01 16:14:54 +10:00
760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
135413e324 Cleanup/msvc: Remove math.h from creator_signals.c
Was never needed, looks like it was copy/pasted from creator.c

spotted by @campbellbarton
2019-07-31 21:36:52 -06:00
fc982c102b Cleanup: Remove FMA3 Disable for msvc
We no longer build with or support msvc2013, so this hack can be removed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5298
2019-07-31 20:18:44 -06:00
421280a3f7 Cleanup: remove unused member 2019-07-31 22:46:41 -03:00
2b99faed52 Cleanup: move defaults into U_default struct 2019-08-01 10:03:20 +10:00
1ec1797d35 Cleanup: remove unused compute-id from preferences 2019-08-01 09:08:43 +10:00
059d61ae9d Cleanup: use braces, unused variable, unused enum 2019-08-01 09:03:50 +10:00
d8fb63661b Fix T67951: Bone selection is broken on some Intel GPUs
The problem is that the `glDrawArraysInstancedBaseInstance` is ignoring the last parameter.
The solution is to indicate that `GLEW_ARB_base_instance` is not supported in these cases.

Reviewers: fclem, brecht, jbakker

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D5383
2019-07-31 16:36:18 -03:00
ea3690e329 Fix several undefined-behaviour-sanitizer warnings
Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4222
2019-07-31 12:24:34 -07:00
77d7cc9ba7 UI: Correct Spacing for Short Unit Names
This adds a space between a value and its short unit name except for foot, inch, degree, arcminute, arcsecond

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

Reviewed by Brecht Van Lommel
2019-07-31 12:17:33 -07:00
a2f357edc2 Add operator for removing unused material slots
Reviewers: campbellbarton, brecht

Reviewed By: brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D4991
2019-07-31 12:08:18 -07:00
feed46c4ae Merge per-shader SVM nodes in the main update thread to avoid locking and resizing overhead
In a test file containing 1300 copies of the same shader, this reduces shader update time from 3.1 sec to 0.05 sec.

Thanks to @swerner for noticing this issue.

Reviewers: brecht, sergey, swerner

Subscribers: swerner

Differential Revision: https://developer.blender.org/D5376
2019-07-31 12:03:45 -07:00
c72f6b713f Fix T66785: Blender Menu As Text When Main Menu Collapsed
This makes the blender logo menu appear as text if 'Show Menus' is off

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

Reviewed by Brecht Van Lommel
2019-07-31 11:38:55 -07:00
881675dff1 Clarify in FloatProperty generated docs: single precision floats.
At least one script writer was upset that this was not specified,
as it is different from "floating point" in Python.
Also, docstring for hard and soft min and max for FloatProperty
was wrong, using sys.float_info.min and sys.float_info.max.
2019-07-31 14:01:42 -04:00
f7c13f2d76 Revert "UI: remove checks for other popovers when switching menu"
This reverts commit 7761657129.

This commit broke overlapping popovers. For example in the color
management tab it would be impossible to select and of the popover
alternatives as it would switch to the menu button under the cursor.
2019-07-31 19:16:47 +02:00
81d4cf5f5a Fix build error after recent cleanup 2019-07-31 18:57:55 +02:00
6bda1fbd2e Cleanup: typo in parameter name in function declarations. 2019-07-31 18:47:26 +02:00
Habib Gahbiche
ffda674893 Fix: test object_modifier_array is passing when it shouldn't.
From D5253.
2019-07-31 18:31:15 +02:00
4c12764a7f Fix negative boolean
Was a nice looking invention, but is obviously wrong.

Is likely no function changes, since -false is like -0
which is 0 and which false. And -true is like -<non-zero> which
is non-zero as well.

Spotted by Sybren, thanks!
2019-07-31 18:21:08 +02:00
bcda8cc89b Fix T65837: "Zoom Axis" is not working on the node editor
We would not take into account the user "Zoom Axis" setting in certain
2D space viewports.  In addition to this, the "Scale Zoom" didn't work
consistently in these spaces either.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5132
2019-07-31 18:16:37 +02:00
0516d49d0c Fix T63921: Unable to use confirm on release for keyboard shortcuts
The first issue was that we were still working around a Xorg bug that
has been solved since a very long time:

https://bugs.freedesktop.org/show_bug.cgi?id=22515

The second issue was that the global "confirm on release for mouse
clicks" was used for keyboard shortcuts as well.
2019-07-31 18:01:28 +02:00
e34587922c Cleanup: remove unused boost code 2019-07-31 17:52:07 +02:00
92a3995c6d Fix T67999: calling obj.data.materials.clear() crashes Blender
The `BKE_material_clear_id()` didn't call `test_all_objects_materials()`,
which caused the object and mesh material slot count to go out of sync.
2019-07-31 17:18:21 +02:00
3566b81c8b Refactor access to dependency graph
This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.

Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.

This replaces OPTYPE_USE_EVAL_DATA which is now removed.

Some general rules about usage of accessors:

- Drawing is expected to happen from a fully evaluated dependency graph.
  There is now a function to access it, which will in the future control
  that dependency graph is actually evaluated.

  This check is not yet done because there are some things to be taken
  care about first: for example, post-update hooks might leave scene in
  a state where something is still tagged for update.

- All operators which needs to access evaluated state must use
  CTX_data_ensure_evaluated_depsgraph().

  This function replaces OPTYPE_USE_EVAL_DATA.

  The call is generally to be done in the very beginning of the
  operator, prior other logic (unless this is some comprehensive
  operator which might or might not need access to an evaluated state).

  This call is never to be used from a loop.

  If some utility function requires evaluated state of dependency graph
  the graph is to be passed as an explicit argument. This way it is
  clear that no evaluation happens in a loop or something like this.

- All cases which needs to know dependency graph pointer, but which
  doesn't want to actually evaluate it can use old-style function
  CTX_data_depsgraph_pointer(), assuming that underlying code will
  ensure dependency graph is evaluated prior to accessing it.

- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
  explicit and local about where dependency graph is being ensured.

This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.

Fixes T67454: Blender crash on rapid undo and select

Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.

Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut

Reviewers: brecht

Reviewed By: brecht

Subscribers: lichtwerk

Maniphest Tasks: T67454

Differential Revision: https://developer.blender.org/D5343
2019-07-31 16:55:15 +02:00
f5f3003874 Fix: build error with MSVC
Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D5381
2019-07-31 08:45:41 -06:00
0b2cb96725 Depsgraph: Fix wrong check for need-to-be-evaluated
Was missing since 1693a5efe9.
2019-07-31 16:40:10 +02:00
96843ae85c Fix T67883: Time Remapping doesn't work
Was caused by 1693a5efe9.
2019-07-31 16:40:10 +02:00
bc42092a7d Fix T67597: Texture painting: Texture slots that correspond to nodes inside node_groups don't remain active
Unlike `fill_texpaint_slots_recursive`, `rna_Material_active_paint_texture_index_update` did not search for texture nodes that are inside node groups.

Reviewers: sergey, psy-fi, zeddb, brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D5338
2019-07-31 11:39:30 -03:00
8dd95abb2f Fix T67808: Bright/Contrast node wrong for negative contrast
strange nobody noticed since 2012...

thx @jenkm for spotting

Reviewers: brecht

Subscribers: jenkm

Maniphest Tasks: T67808

Differential Revision: https://developer.blender.org/D5378
2019-07-31 16:29:51 +02:00
Alessio Monti di Sopra
200c9f37d6 Fix T67573: Missing offset in marker names on current frame
Differential Revision: https://developer.blender.org/D5333
2019-07-31 16:18:10 +02:00
fb03a86b1b Have CMake be more strict when optional x11 libraries are missing but enabled
Previously cmake would silently disable features that depended on
certain x11 libraries if they were not found. Now we instead error out
and inform the user that these are missing but optional.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5380
2019-07-31 16:18:17 +02:00
b0531227d4 Fix T68001: Rotating vertices on the UV map by a fixed number immediately crashes Blender.
Spaghetti Transform code can use same code for different kind of data.
The 'stepped rotation' process is actually only useful/doable in a few
cases (when we do have some real place to store rotation value, and we
are using Eulers).
2019-07-31 16:14:34 +02:00
03be31e817 Cleanup: Remove unused function 2019-07-31 15:42:42 +02:00
4328b56980 Fix T66031: Text Material Change broken.
font_to_curve code was not handling properly the case where it has nop
object to check for mat indices validity. Check should just not happen
then, not reset mat indices of chars to default 0 value.
2019-07-31 15:38:01 +02:00
8b1041d510 Fix Visual Studio compatibility in writeffmpeg.c
This fixes an incompatibility with Visual Studio 2019 introduced in
631d5026c7. It is likely caused by using
`#  ifdef` inside the use of the `ELEM()` macro.
2019-07-31 15:26:29 +02:00
64e029ea92 Animation: Remove depsgraph argument from a lot of API
Use explicit boolean flag to indicate whether flush to original data
is needed or not. Makes it possible to avoid confusion on whether an
evaluated or any depsgraph can be passed to the API.

Allows to remove depsgraph from bAnimContext as well.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5379
2019-07-31 15:11:38 +02:00
9c0e7f7dd6 Animation: Remove depsgraph argument from direct keyframing
It was used to access evaluated object and pose and was done prior
to implementation of flushing values back to original data for an
active dependency graph.

Removing the argument allows to simplify API and solve issues with
accessing missing dependency graph on redo.
2019-07-31 15:10:49 +02:00
0d3493d6d9 Fix: Cycles reporting incorrect number of samples in viewport render
During viewport rendering where the viewport samples are set to 0 the UI
showed 16777216 as number of samples. We should not show the number of
samples when the number of viewport samples are set to 0.

Differential Revision: https://developer.blender.org/D5301
2019-07-31 14:32:41 +02:00
604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
136a7a7fe8 Fix error in user preferences commit
Add include & initialize variable.
2019-07-31 22:25:49 +10:00
0272b7c814 Fix T67652: editing UV vertex location does not work with multiple objects
Patch contributed by matc.

Differential Revision: https://developer.blender.org/D5355
2019-07-31 14:03:33 +02:00
f7adb78828 Cleanup: remove BLO_update_defaults_userpref_blend
Merge into BKE_blendfile_userdef_from_defaults
2019-07-31 21:52:42 +10:00
07499c04f6 Preferences: don't store preferences in the startup
Simplify preferences by removing the ability to load them from
either the startup.blend or userpref.blend.

Also simplifies updating default preferences by moving
them to a struct definition.
2019-07-31 21:36:12 +10:00
86029b5071 UI: tweak naming in snapping popover to be "Snap with" and "Snap to"
To replace "Target" and "Snapping", this should be more clear.

Differential Revision: https://developer.blender.org/D5242
2019-07-31 13:11:38 +02:00
4bb9fbd3a8 Sculpt/Paint: Brush curve presets
This patch introduces the same presets that are used for proportional editing in the brush falloff menu. The user can select any of these presets or use the regular custom falloff curve. The presets are hardcoded formulas, so the falloff curve is not used when they are active.

This change improves the general feeling of the brushes and it is more convenient and simpler to use. The CUSTOM curve option should now be used in the case that an unusual deformation is needed, in other cases, the hardcoded curve presets should be the default.

The smooth curve presets is a must in the grab brush, as it fixes the deformation issue with the current custom curve setting. The user may try to adjust the deformation by tweaking the curve, but it is nearly impossible to replicate this desired behavior.

{F7636217}

Other brushes that are included in the sculpt branch also rely on this as they need specific hardcoded falloffs to produce the desired effect.

Reviewers: brecht, billreynish

Reviewed By: brecht

Subscribers: JulienKaspar

Differential Revision: https://developer.blender.org/D5367
2019-07-31 13:04:55 +02:00
03f652b2c1 FIx T66019: Text cutoffs for descriptions in keyframe insertion (keyingsets). 2019-07-31 12:30:03 +02:00
6d2f9b1dfa Added BKE_mesh_clear_geometry() function
This function makes it possible to clear/remove/nuke all the geometry in
a mesh, allowing functions like `Mesh.from_python()` to construct a new
mesh in its place. Without this function, code like in T67627 have to
allocate a new Mesh datablock, fill that, and swap out the old Mesh for
the new one. This introduces issues when exporting, as the new mesh
could be seen by an exporter as unrelated to the old one.

Shape keys are not freed by this function. Freeing those would require
tagging the depsgraph for relations update, which is an expensive
operation. They should be removed explicitly if necessary.

Material slots are also not cleared by this function, in the same way
that they are not cleared when manually removing all geometry from a
mesh.

The `BKE_mesh_clear_geometry()` function is available in Python as
`mesh.clear_geometry()`.

Reviewed by: mont29, brecht

Differential Revision: https://developer.blender.org/D5373
2019-07-31 12:23:56 +02:00
e51067505b Cleanup: Use explicit forward declaration 2019-07-31 11:58:53 +02:00
7761657129 UI: remove checks for other popovers when switching menu
I'm unable to redo the original report,
Revert fix for T43247..
2019-07-31 19:50:13 +10:00
94b81d51a6 UI: simplify check for active menu button
Dragging to select another popup now checks the menus active button.
2019-07-31 19:50:13 +10:00
ce0582ee2b Particle: Cleanup, remove unused depsgraph argument 2019-07-31 11:51:38 +02:00
11da3b132a Cleanup: Remove unused functions 2019-07-31 11:46:45 +02:00
2ddfd51810 FFmpeg: Added support for writing Opus audio.
This audio format is often used in conjunction with VP9 video in a WebM
container. Opus was created with the intention to replace Vorbis and
Speex ([source](https://en.wikipedia.org/wiki/Opus_(audio_format))).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156
2019-07-31 11:28:48 +02:00
ca0b5529d0 FFmpeg: Added writing of WebM containers
This commit adds support for the WebM container. Previously we only
supported the WebM/VP9 video codec, but still required that it was
stored in a Matroska, MP4, or other compatible container format.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156
2019-07-31 11:28:38 +02:00
43b7512a59 FFmpeg: Added support for writing alpha values in WebM/VP9 video
The VP9 video codec supports writing alpha values; now this is available
in Blender too.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156
2019-07-31 11:28:36 +02:00
631d5026c7 Cleanup: Simplification of BKE_ffmpeg_alpha_channel_is_supported()
Simplified `BKE_ffmpeg_alpha_channel_is_supported()` to use `ELEM()`
instead of a row consecutive `if`-statements.

No functional changes.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5156
2019-07-31 11:28:33 +02:00
af4dcc6073 DRW manager: select engine: create generic draw_select_id_mesh 2019-07-30 20:47:18 -03:00
43ec8d7ae9 Cleanup: Rearrange Select Engine into multiple files 2019-07-30 20:47:18 -03:00
5359b7a033 cleanup: Fix typo in last commit
Accidentally took the C flags as a base.
2019-07-30 14:50:53 -06:00
19b72f50d7 CMake/Windows: Enable JMC on compilers that support it.
JMC [1] enables more productive debugging of C++ code in visual studio
this change enables it on debug builds for builds with visual studio 15.8
or higher.

[1] https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/
2019-07-30 14:40:05 -06:00
fe47c7bf84 DRW manager: select engine: remove redundant calls 2019-07-30 16:32:08 -03:00
34b3a9583a Cmake/windows: Fix vcpkg bypassing our libs folder.
Occasionally we get reports of people that build blender and end up
with either build errors or end up with builds that do not run on
other systems. The root cause is when you install vpckg and integrate
it into the build system it puts the search path for its includes and
libraries before anything else.

previously we told people to either uninstall vcpkg or remove the
conflicting packages, which was not great.

this change opts out of the use of vcpkg for blender only, so people
can keep using it for other work without issues.
2019-07-30 11:46:13 -06:00
9d7a03ab11 Fix T67939: GPencil Noise modifier step is ignored in render
The value of the step was calculated using a variable that was removed when the render frame change.

Now, the step is calculated using the modulus of the current frame and recalculate noise only if the remainder that results from performing integer division is equal to 0.

To calculate current frame, the first used frame is calculated to adjust real frame range.

This approach is more stable in viewport and render.
2019-07-30 19:43:17 +02:00
28bd15cdf0 Fix snap package to work with 2.80 version number
Without this it rounds to 2.8.
2019-07-30 18:11:42 +02:00
7f29fc7415 Fix T65691: GPencil Drawing long strokes turn invisible
There was a fixed limit to the number of points available in a buffer stroke.

Now, the array is expanded as needed using a predefined number of points for each expansion, instead to add one by one. This is done to reduce the number of times the memory allocation is required.

As part of the fix, some variables have been renamed to reflect better their use.
2019-07-30 17:11:56 +02:00
f69e57a53f Alembic export: fix exporting of loop normals
When the mesh is using custom normals, those should always be exported,
regardless of the `ME_SMOOTH` flag on the invidivual polys.

Also replaced the loop normal writing with the same logic as we use for
reading (less pointer arithmetic, more normal counting).
2019-07-30 17:06:47 +02:00
e9c149d911 Alembic import: load face-varying normals
Loop normals are called 'Face-varying normals' in Alembic. Before this
commit, the existence of such normals was used to enable smooth shading.
This is incorrect, as the normals could encode flat faces just as well.

This commit adds the loading of these normals as custom loop normals. It
then also enables Auto-Smoothing on the mesh (which is a bit of a
misnomer and indicates to Blender that the custom normals should be
used).

Fixes the glitching described in T65959.

Differential Revision: https://developer.blender.org/D5191
2019-07-30 17:06:47 +02:00
dde978d149 Cleanup: Alembic: renamed 'smooth_normals' to 'export_loop_normals'
The name now indicates what happens when the variable is set to true.

No functional changes.
2019-07-30 16:59:10 +02:00
e74847e6bb Alembic: changed 'void *user_data' to 'Mesh *mesh'
The only thing that is stored in this pointer is a `Mesh*`, and casting
it from/to `void*` is unnecessary and confusing. Maybe the entire
CDStreamConfig class could/should be removed at some point.

No functional changes.
2019-07-30 16:59:10 +02:00
3568d56bcc Alembic: transformed chain-of-ifs into switch statement
By having a switch statement that lists all the values of the enum, it is
clear which cases we're not handling, and it also allows for warnings in
the future when the enum expands.

No functional changes.
2019-07-30 16:59:10 +02:00
d65a4b5990 Alembic: use r_ prefix for return variables
No functional changes.
2019-07-30 16:59:10 +02:00
7f552be7d1 Alembic: removal of always-zero parameter
The `poly_start` parameter was always 0, so adding it to a poly index
from Alembic is a no-op.

No functional changes.
2019-07-30 16:59:10 +02:00
0dece50667 Fix T65717: Alembic (camera - also mesh) import scale issue
The w-component of the translation column of the scaled matrix wasn't
set to 1.0, which, apart from being incorrect, caused drawing problems.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5290
2019-07-30 16:55:29 +02:00
406e960327 Fix T67904: GPencil clone brush doesn't copy the right color and layer
When using the clone brush, the first time the brush worked, but the next time no. The reasons were two:

1) The strokes were copied to the active layer, but if there were more than one layer, the stroke must be copied to the original layer.

2) The materials were not assigned properly and the materials were set as the first slot in the list always.

Now, the original layer name is used to try to find the same layer in destination. If the layer is missing, the active layer is used.

For materials, the bug in the hash lookup is fixed and the material is assigned to the right slot.
2019-07-30 16:51:37 +02:00
77cc69d66f Fix T67460: Vertex painting: Sampling color opens empty options window in viewport
The issue was that the redo panel area would call with region type HUD (not WINDOW).
Now we make sure that the redo panel always polls the operator in the original area type context.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5361
2019-07-30 16:01:51 +02:00
d87fb0356a Make 3d projpaint iteration lockless.
While speedup is hard to detect (highly fluctuent), it seems to be
around 5% on average on my 8 threads machine...

It also remove usage of a 'global' thread lock, which is always good.

Note that I also tried to use proper foreach threaded iterator construct
(see D5372), but that proved to be relatively slower (presumably due to
the very high dissymmetry between tasks, usually during a paint stroke
only a few chunks will require most of the computing effort, overhead of
threaded foreach management is then noticeable).

This concludes (for now) the work on
T51133 Bad performance with texture painting depending on multi-thread settings.
2019-07-30 15:42:16 +02:00
363dd97ae8 Fix T67370 Normal Tools(Alt +N), copy and paste not work
The copy operator requried at least a vert AND a face to be selected.
It should only require that a vert OR a face is selected.
2019-07-30 15:41:19 +02:00
5f405728bb BLI_task: Cleanup: rename some structs to make them more generic.
TLS and Settings can be used by other types of parallel 'for loops', so
removing 'Range' from their names.

No functional changes expected here.
2019-07-30 14:56:47 +02:00
b9c257019f BLI_task: tweak default chunk size for BLI_task_parallel_range().
Previously we were setting it to 1 (aka no 'chunking'), to follow
previous behavior. However, this is far from optimal, especially with
CPUs that can have tens of threads nowadays.

Now taking an heuristic approach (inspired from the one already existing
for `BLI_task_parallel_listbase()`, which tries to guesstimate best
chunk sizes based on several factors (amount of threads/parallel tasks,
total number of items, ...).

Think this is a reasonable base ground, more optimization here would of
course be possible.

Note that code that was already explicitely settings some value here
won't be affected at all by that change.
2019-07-30 14:36:59 +02:00
ae7db53744 Fix T66629: Library override - fails when armature and mesh are in separate collections.
Some ugly very low-level collection code was using the generic
LIB_TAG_DOIT tag... should never happen, that one is for rather
high-level code to use, core process shall use own tags.
2019-07-30 14:25:41 +02:00
cee484a4c5 Fix T67067: Wrong rotation input values when using shortcuts on keyboard like rx720.
This allows to type in numinput 720 and indeed get a rotation of 720°, not 0°...

This patch basically applies 'big rotations' in steps < 180°, such that
compatible rotation works as expected. This implies resetting current
rotation to initial one first, otherwise we'd end up applying much more
turns than expected when that code is called more than once.

It also makes things somewhat slower for big rotations (millions of degrees),
Hence we clamp to 1000 turns max.

And since that's a case that cannot happen with regular tool/widget-driven rotation,
it's only enabled when numinput is used for now.

Review task: https://developer.blender.org/D5289
2019-07-30 14:25:41 +02:00
b9718299ea Fix crash clicking in the 3D view on startup
Setting the 3D view cursor on startup could crash because the
viewport hasn't been assigned to the region.
2019-07-30 21:43:40 +10:00
51be0a765e Tracking: Fix wrong usage of draw buffers
Curve drawing was attempting to draw reprojection error curve when it was
not visible.

Worst thing is that the imm was not informed about vertices, so the code
was causing an assert in debug mode. Probably, it is also what have caused
random crashes after recent changes.
2019-07-30 13:00:22 +02:00
edb3b7a323 Fix T67274: Graph Editor Normalization broken by Keyframe that uses Easing or Dynamic interpolation
We didn't include and of the newer interpolation types in the
normalization function.
Besides taking into account these newer types, we now also only evaluate
the curves when needed. If the values between the control points won't
exceed the control point values, we only use the start/end values for
our normalization

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5365
2019-07-30 12:25:39 +02:00
5662a5969b Particle: Fix incorrect access to evaluated mesh
Mesh can not be requested from original object, and it can not be
copied into evaluated modifier because there is no such a thing yet.

It can not be done this way now, because getting evaluated object
will force it to re-calculate, which kind of defeats idea of this
code to preserve un-baked particles.
2019-07-30 11:57:33 +02:00
651d8bfd98 3D View: Move selection API to a Selection engine.
This commit moves the API of selecting faces, vertices and edges to a DRW manager engine.

Reviewers: campbellbarton, fclem

Subscribers: jbakker, brecht

Differential Revision: https://developer.blender.org/D5090
2019-07-30 06:46:59 -03:00
a85963bed8 Fix T67906: empty menus for hooks if non-hook modifiers are present 2019-07-30 11:30:13 +02:00
db0782e946 Py node shader wrapper: Add clamping to official min/max values.
Taking values from relevant node definition C file...

Related to T67889.
2019-07-30 11:24:10 +02:00
286c921c25 Tracking: Fix crash happening after removing object 2019-07-30 11:11:54 +02:00
58b554c7a4 Fix T66591: GPencil layer visibility control via driver doesn't work 2019-07-30 10:27:13 +02:00
6fa47f656e Fix T67882: buttons are interrupt drag actions 2019-07-30 17:39:06 +10:00
d2063f7bc3 Fix edit-mode interfering with brush swap color
D5353 by @robert-wallis
2019-07-30 15:37:45 +10:00
369b574fd5 UI: add use_button option to popovers
This is useful when popovers are launched from operators
instead of as button popover types.
Where the connection between the button and the popover is useful to keep.
2019-07-30 10:57:47 +10:00
a345f56ce3 Cleanup: de-duplicate file reading code
Also remove goto's.
2019-07-30 10:43:07 +10:00
f1516ae637 Cleanup: check is_startup parameters instead of the path 2019-07-30 10:41:34 +10:00
0a2fd63383 Cleanup: replace unused return defines with bool 2019-07-30 10:31:27 +10:00
1178046ed2 GPencil: Remove Annotations panel from non-preview Sequencer areas
Fix by: Peter Fog (@tintwotin)

I did some small changes to original differential code.

Differential Revision: http://developer.blender.org/D5306
2019-07-29 22:43:25 +02:00
2b8bc1a22e Doxygen: update version number to 2.81 2019-07-29 19:10:48 +02:00
daa7b56890 Fix T67874: Show gizmo incorrectly uses Cmd-` on macOS 2019-07-30 01:55:06 +10:00
770b496729 Cleanup: GPencil replace cfra_eval by cfra or CFRA
Don't need these variable because this code was part of using depsgraph frame number, but now using scene framenumber only add noise to the code.
2019-07-29 17:07:37 +02:00
453586be06 Fix T67849: Offset after "Hook to Selected Object" 2019-07-30 00:36:10 +10:00
0ae52711b6 Fix T67857: crash assigning None to the data of an empty using python
Assigning None is allowed for (image) empties.

Reviewers: sergey

Maniphest Tasks: T67857

Differential Revision: https://developer.blender.org/D5362
2019-07-29 15:28:00 +02:00
baff245b9d Fix T67860: missing 3d cursor update when picking texture clone location
Reviewers: sergey

Maniphest Tasks: T67860

Differential Revision: https://developer.blender.org/D5360
2019-07-29 15:24:25 +02:00
a7d9e2f57e Fix T67221: Auto-offset in VSE doesn't refresh audio
Reviewers: sergey, ISS

Maniphest Tasks: T67221

Differential Revision: https://developer.blender.org/D5300
2019-07-29 15:21:04 +02:00
a3c66680fd Fix T66931: "reset to default value" of metaball - viewport resolution is way too high
Maniphest Tasks: T66931

Differential Revision: https://developer.blender.org/D5251
2019-07-29 15:10:38 +02:00
537209cb4b Remove debug prints from previous commit.
Sorry for the noise...
2019-07-29 14:45:56 +02:00
3b6c75dc31 Fix T67620: Font preview translations malfunction in Blender 2.8
We cannot reliably use translations API from non-main threads.

Now storing translated strings in a static cache, with basic mechanism
to update it on language change.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D5350
2019-07-29 14:11:35 +02:00
b83a1b62c7 Fix T66233: Grease Pencil Swirl Effect not working at origin
If the control object is in the origin the radius is wrongly calculated because the result is 0.

Now, this value is clamped to avoid this situation
2019-07-29 12:41:24 +02:00
13f57237f2 Fix T67331: Annotations: Rename old grease pencil panels
These panels were using the old names, but now they are not grease pencil, but annotations.

Also removed old Tools panel. This must be replaced with new Toolbar
2019-07-29 12:39:39 +02:00
3ee246f614 Fix T67338 : GPencil Disable material properties when material is locked
When the material was locked, the properties were deactivated but not disabled.

Differential Revision: http://developer.blender.org/D5309
2019-07-29 12:35:12 +02:00
92f6e60f46 Fix T67876: 2D Stabilization doesn't compensate rotation in spacial cases
This was caused by 2D stabilization trying to be smart and lower weight
of tracks which are too close to the rotation center. This was causing
algorithm to ignore a single track which was set to constant 1 weight and
used for rotation compensation.

It is quite tricky to quantify this change without having comprehensive
regression suit, so can only hope that initial intention is still working
as expected.
2019-07-29 12:30:45 +02:00
60d71ffbe9 Fix T67811: GPencil Weights shift when use dissolve in Edit Mode
The problem was the index was not right calculated for unselected points.
2019-07-29 12:13:39 +02:00
801962e2b6 Fix T67813: Remove mask from Weight Paint
Weight Painting was using mask if "Selection Mask" in Sculpt Mode is turned on.

This can be quite confusing because the option to turn it off is not available in Weight Painting and the selection is also not visible.

Now the mask is not checked in weight paint mode.
2019-07-29 12:12:43 +02:00
d438e71729 GPencil: Use uniform_int_copy instead to pass reference
The constant variable was passed as reference to constant variable, but it's better use the new function to copy values.

This could be the problem with T67772
2019-07-29 12:10:48 +02:00
fd730fce0c GPencil: Add inverse diff matrix to iterator macro
GPencil: Cleanup inverse mat code

This calculation is done in the macro, so don't need do it again in loop.
2019-07-29 12:10:48 +02:00
d3ca0bf6f8 Version bump to 2.81 alpha, master is now open for new features and changes 2019-07-29 12:00:52 +02:00
7ac0c87473 Fix T67800: Incorrect behavior of simple Subdivision Surface
Stupid typo in an original fix, need to operate in 3D, not in 2D.
2019-07-29 11:26:16 +02:00
0528ef0b4d Fix T67777: Linked rig crashes Blender 2.8 RC3 on File|New.
Sync back between proxy armature pose and linked one was not properly
clearing the posebone runtime data, ending up with shared memory between
both (direct cause of reported crash), and probably some other nasty
issues.

While this crash is not critical in itself, I would suggest to add this
fix to 2.80 branch, as it is super-safe and simple, and is probably
fixing some other un-reported issues?
2019-07-29 10:54:28 +02:00
a38759f017 Fix T67863: Crash pressing Ctrl +/- in gpencil action editor 2019-07-29 17:22:12 +10:00
314891b1c5 Fix T67826: View selected fails with files from 2.7x
Grease pencil could have edit mode enabled in old files.
2019-07-29 15:31:00 +10:00
matc
a542f50b51 Fix T67523: Incorrect UV's for grid primitive 2019-07-29 14:28:02 +10:00
a49838ccb0 Tracking: Fix missing camera depsgraph update tag
Was causing lack of proper viewport update when camera solve assigned
new focal length to the camera.
2019-07-28 17:07:39 +02:00
fc5ba7e0bd Tracking: Support selecting tracks by their reprojection error curve
Quite straightforward after previous refactor: now speed and error curves
are handled in the same exact manner.
2019-07-28 17:04:10 +02:00
bf637984d1 Tracking: Refactor, generalize curve iteration API
Make it generic enough to support iterating over reprojection error
in the same manner as coordinate speed.
2019-07-28 17:04:10 +02:00
1c40227bfa Fix related to T67385: disallow some modifiers ops from Edit mode.
Some modifier operators cannot be reliably executed from Edit mode
currently, so disable them from the generic mod ops pool function.

Have been very conservative here from now, keeping existing behavior
most of the time, and only forbidding Edit mode when code was already
doing it in its own way, or when it was obviously not possible.
2019-07-28 16:11:42 +02:00
3e45f01494 Fix T67385: Bind in Laplacian Deform Modifier with new vertex group in Edit Mode crashes Blender.
Main issue in that report was that meshes generated from
`mesh_create_eval_final_view()` and the like need some
special freeing handling (as, among other things, they borrow and do not
own their potential editmesh data...).

Factorized that into a helper func also used by
`BKE_object_free_derived_caches()`.
2019-07-28 16:11:42 +02:00
c4cf14d161 Cleanup: Spelling in comments 2019-07-28 15:31:20 +02:00
1f47916664 Depsgraph: Fix changes in tracking invalidating movie cache
Added special exception in legacy tag with 0 flag.
2019-07-28 15:08:41 +02:00
11814080a6 Depsgraph: Fix missing cases of SOURCE ID recalc tag 2019-07-28 15:07:06 +02:00
5e56cfa958 Cleanup: Fix strict compiler warning 2019-07-28 15:05:10 +02:00
2cce65de96 Fix T66872: Changing clip color space does not update background images
Such reload can no longer happen directly and is to be done via dependency
graph.

Eventually, the movie cache will become shared across all copies of the
clip, but even then we still need to have dependency graph mechanism because
we need to update FFmpeg animation handle (which can not be shared across
the copies).
2019-07-28 13:24:18 +02:00
233f78c017 Cleanup: remove unused ID-map undo API
Removing this since it was added for TexFace support
which has since been removed.
2019-07-28 17:53:41 +10:00
ae19f68d45 Cleanup: pep8 2019-07-28 17:45:55 +10:00
79ce2054d4 Linux: add script and instructions for creating snap packages
We will now maintain the Blender package on snapcraft.io/blender.

Differential Revision: https://developer.blender.org/D5342
2019-07-26 17:34:45 +02:00
d25386b8a7 Linux: update appdata description 2019-07-26 17:34:45 +02:00
963b761144 WM: Pre-fill bug-reports for addons
This is an increment of the proposed changes in D4507.

Differential Revision: https://developer.blender.org/D5303
2019-07-26 11:19:21 -03:00
9270c15af8 GPencil: Get current frame from scene
This change makes it so current frame is queried from a scene rather
than from a dependency graph. This makes it possible to avoid the
fact that dependency graph might not be fully evaluated yet.

There are still some cases where it frame is queried from the graph,
but those seems to be in a code path where we need to ensure valid
dependency graph anyway.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5349
2019-07-26 15:16:52 +02:00
ad18d331d7 Cleanup: Remove unused depsgraph pointer 2019-07-26 15:16:12 +02:00
6cb8bd0a1c Modifiers: Update LaplacianDeform error message about vgroups.
Vgroup might be also 'invalid' because it is empty (and no other vgroup
with vertices currently exists on that mesh).

Related to T67385.
2019-07-26 14:45:55 +02:00
523de7ae9b Fix T66325: Animation Keyframe Undo/Redo Bug
The issue was caused by dependency graph always ignoring animation
update when it is first time constructed. This was a way to make it
preserve unkeyed changes on undo/redo. This, however, made it so
changes of animation data itself (such as deleting/moving keyframes)
did not trigger animation update by the dependency graph.

This worked prior to copy-on-write because animation recalc flags
were stored in the DNA and never re-set on file/undo load. This was
giving dependency graph a clue that animation is to be re-evaluated
when operator explicitly asked to (more precisely, when such operator
was undone/redone).

This change makes it so original ID's recalc flags are storing
recalc flags when ID is tagged for update as an response to user
input. This way re-building dependency graph can force animation
to be updated on redo.

Tricky part here is that ID's recalc flag is no longer to be zeroed
when loading undo step (which is the same as reading .blend file).
This is something what works differently comparing to legacy
dependency graph, which was zeroing object's recalc flags there but
not animation data's recalc flags.
Shouldn't be causing issues, since unkeyed changes are not preserved
upon opening a file anyway, at least to my knowledge.

Related reports which are to be taken into account and verified
they are not re-introduced when making changes in the area:

- T63111: Auto-Bake stuck at constant re-rendering
- T54296: Cycles viewport render stuck on constant re-render

Reviewers: campbellbarton, brecht

Reviewed By: campbellbarton, brecht

Maniphest Tasks: T66325

Differential Revision: https://developer.blender.org/D5316
2019-07-26 14:33:51 +02:00
ba94aaedba Fix T67639: Default cube UVs are incorrectly arranged 2019-07-26 21:55:53 +10:00
9e9c6eac6a Fix T67595: bevel concave cube corner.
The special case test for cube-like corner did not work if normals
are flipped.
2019-07-26 07:41:28 -04:00
11b994e26e Fix T67671: Blender crashes when resizing sidebar with a colorbamp
The amount of triangles drawn by the button depends on its `sizex`.
See:
```
immBegin(GPU_PRIM_TRI_STRIP, (sizex + 1) * 2);
```
Therefore the `sizex` cannot be 0.

Solution a bit similar to rB56b0cd1d.

Ref T67671

Reviewers: fclem, brecht

Maniphest Tasks: T67671

Differential Revision: https://developer.blender.org/D5347
2019-07-26 08:29:38 -03:00
1d7be99ba4 Fix missing ID pointer updates for texture paint undo
Partial fix for T61263, however mem-file undo sometimes reloads imbuf's.
2019-07-26 20:05:04 +10:00
81043397d7 Undo System: correct fix for T67709 2019-07-26 20:04:28 +10:00
62338abde4 Cleanup: Remove unused depsgraph pointer 2019-07-26 11:51:43 +02:00
1693a5efe9 Fix T66378: Missing animation update when switching view layer
Current frame is stored in a scene, and scene might have multiple view
layers. The inactive view layers were not informed about scene's frame
being changed, so when user switched back to view after changing scene
frame it was in an inconsistent state between current scene frame and
animation.

Now we tag scene for time changes, so dependency graph can catch up
and do proper update.

Currently tagging is from quite generic place. Probably better approach
would be to tag from where frame is actually being assigned. Downside
of this is that it's easy to miss some places.

Reviewers: brecht, mont29

Reviewed By: brecht

Maniphest Tasks: T66378

Differential Revision: https://developer.blender.org/D5332
2019-07-26 10:23:38 +02:00
250995d67b Fix T67507: Set origin on armature moves incorrectly parented objects
Need to copy changes from original armature to evaluated one prior to
BKE_pose_where_is(), otherwise the pose matrix in pose channels will
not be correct.

Can not use dependency graph update here, since we must not re-evaluate
possible dependencies of the changed armature.

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T67507

Differential Revision: https://developer.blender.org/D5331
2019-07-26 10:15:39 +02:00
cf0f2f2d3d Fix T67256: Add object redo duplicates, after exiting sculpt mode 2019-07-26 14:33:00 +10:00
ac7fe46ec3 Fix T67709: Texture paint undo gets out of sync 2019-07-26 13:14:24 +10:00
cb10bd379b Fix T67599: Issue with Simple subdivision of loose edges
They were always acting as a B-Spline subdivision.
2019-07-25 16:34:01 +02:00
4f363283eb Fix T67593: Crash when making link for instance collection 2019-07-25 10:02:00 +02:00
829cbd88ff Fix T67588: Crash after clearing animation in outliner 2019-07-25 09:47:43 +02:00
6a7fcf725e Fix app-template keymap preferences being ignored 2019-07-25 17:39:32 +10:00
d24300da5f Fix app-template keymap being ignored 2019-07-25 16:36:59 +10:00
e51943bd73 UI: clarify tip for viewport mouse position property
This is an hidden property only visible in the keymap editor.

Addresses T67589
2019-07-25 13:47:47 +10:00
410eddcbcc Fix T67603: Selecting toolbar from search raises error 2019-07-25 13:35:01 +10:00
2e92791074 Fix crash validating mesh polygons with invalid loop-start
Add check for negative loop-start,
fixes crash validating test file from T67605.
2019-07-25 13:23:05 +10:00
419f137c64 Doxygen: update version number 2019-07-25 13:08:44 +10:00
76dfbee423 Fix T67472: Gizmo overlap causes cursor to get stuck 2019-07-25 10:53:04 +10:00
bfe580642f Fix background image rotation and offset
- Offset was halved & not compensating for non-square aspect.
- Rotation was flipped.
2019-07-24 22:32:17 +10:00
4fe0fafb87 Fix T67548: Camera background-image ignores shift
Regression from 2.79
2019-07-24 20:42:39 +10:00
552cc30f3a Fix T65980: Boolean crash with many intersections on a single face 2019-07-24 19:33:55 +10:00
52fb8b1e80 Fix T67117: Font thumbnails crash to desktop
We were missing a null pointer check for invalid fonts.
2019-07-24 11:26:21 +02:00
53944e2f9f Fix T67315: Redo transform disables snap 2019-07-24 17:07:55 +10:00
796a2b5fc7 Fix T66768: Grid fill span not working 2019-07-24 16:32:15 +10:00
b63f0266a0 Fix T67459: Dope Editor, muting channels with shortcut doesn't work 2019-07-23 15:52:39 +02:00
4cf8f35cc1 Tracking: Give more reasonable error message directly in the interface
Before this the message could be too generic which was simply saying
that console is to be checked. This isn't very useful in cases when
we know that reconstruction is failed because of lack of good keyframes
or failure of initial reconstruction if there is no enough parallax
on the selected keyframes.
2019-07-23 15:12:35 +02:00
7d65827980 Fix T67089: Solve camera motion generates "Solve error: nan"
The code was missing some checks for whether keyframe selection
went successfully and whether reconstruction has been successfully
initialized.

The interface still gives quite generic message, with the details
printed to the console. This can be addressed separately.
2019-07-23 15:12:35 +02:00
361d578f9d fix: unreported: Collada using incompatible Enumeration types for compare 2019-07-23 15:09:02 +02:00
9e3ff9e059 Fix T67334: Blender does not exit after saving 2019-07-23 14:32:32 +02:00
ef0e06d764 Fix T65386 Eevee: Crash after baking indirect lights or cubemap
I'm not sure this fixes the root of the problem. The file from the ticket
seems to have been corrupted in some way.

We MIGHT want this in 2.80.
2019-07-23 13:21:03 +02:00
84c11e8644 Cleanup: Rearrange the order of isect_ray_ray_v3 parameters
And remove redundant add operation.
2019-07-23 08:11:46 -03:00
19aa873f70 Fix T67299: UV Stretching Overlay of type "Area" fail when any face is hidden
We want to include this for 2.80
2019-07-23 07:51:16 -03:00
matc
2d98ac33be Fix T65402: Syntax error causes CPython assert 2019-07-23 20:31:27 +10:00
34ad6da4a0 Fix T67450: Crash undoing edit-mode lattice resolution 2019-07-23 17:25:28 +10:00
07f3ad06fc Fix T63775: Toolbar icons ignore BLENDER_SYSTEM_DATAFILES
The environment variable to locate system data-files was
ignored by toolbar icons.

Add bpy.utils.system_resource
to match Blender's internal data-file access.
2019-07-23 16:30:26 +10:00
6e72d3e00e Fix T67389: Transform constraints fail at large distances 2019-07-23 14:56:49 +10:00
0a0e2dd8a2 Fix T67040: Undo crashes after renaming
Correct fix that doesn't cause T67217.

Temporarily removing the excluded undo step broke memfile-undo
since freeing the undo steps needs to access other steps in
the list to merge shared chunks, see: memfile_undosys_step_free.

Pass the exclude step as an argument instead.
2019-07-23 13:06:26 +10:00
8c61837150 Incompatible usage of the Collada transparency value
Some external tools seem to have issues with the definition
of Collada <transparency> - a float value in range (0,1).
However it is possible to use the <transparent> color as a container
for the <transparency> value. This seems to be a more reliable
method to export transparency values from Blender PBSDF Shaders.

The relevant documentation is in the collada 1.14 reference manual,
page 7-5 about the usage of transparent and transparency.

This fix makes export and import of the <transparency>
and <transparent> values more convenient and more reliable.

Reviewers: brecht, jesterking

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5305
2019-07-22 19:03:56 +02:00
2de95e8149 Fix missing subversion bump for 2.80 release.
We need a final subversion bump before release in case there are
remaining 'unversioned' code in our versionning callbacks...

Should have been done before first RC actually. ;)

To be ported to 2.80 release branch.
2019-07-22 18:44:22 +02:00
02c5c091df Bevel modifier: let it work on wire edges when vertex_only. 2019-07-22 07:13:04 -04:00
2c1d23f209 fix unreported: typo in python documentation
Fix as approved by dr.sybren in blender chat
2019-07-22 11:43:07 +02:00
45ae9edbd5 Revert "Fix T67040: Undo crashes after renaming"
This reverts commit c635663e4a. This is causing
crashes with sculpt mode and object mode switching.

Fixes T67217.
2019-07-21 12:59:36 +02:00
e2b0647272 Industry Compat keymap: Fix inconsistencies and conflicts with color swatches and other over-widget hotkeys
Sample hotkey is set to the I key now, similar to other apps.

Reported on Devtalk
2019-07-20 14:45:45 +02:00
4b980e2f57 Fix T67196: bevel bad at a 3-edge bevel.
The test for whether or not this was a "pipe" neglected to use
fabsf() around a dot result.
2019-07-20 08:38:41 -04:00
c2e8e249ac Fix assert in some cases when using DataTransfer modifier for custom normals.
Reported by @sybren on IRC, thanks.

Should be safe for 2.80.
2019-07-19 16:17:09 +02:00
65aac86d5a GPencil: Fix wrong material when apply Opacity, Hue or Tint modifier
When apply the modifier a new material is created, but it was assigned wrongly. The problem was the index was base 0 already, so subtract 1, got a wrong value.
2019-07-19 15:22:42 +02:00
23ea4b56ad GPencil: Fix showing wrong material in brush panel with pinning
The options of the material are from object material not pinned material.

If the brush is pinned, the material must be the brush material and not the object material.
2019-07-19 15:22:42 +02:00
3026 changed files with 348185 additions and 101217 deletions

View File

@@ -221,10 +221,23 @@ ForEachMacros:
- ITER_BEGIN
- ITER_PIXELS
- ITER_SLOTS
- ITER_SLOTS_BEGIN
- LOOP_EDITED_POINTS
- LOOP_KEYS
- LOOP_POINTS
- LOOP_SELECTED_KEYS
- LOOP_SELECTED_POINTS
- LOOP_TAGGED_KEYS
- LOOP_TAGGED_POINTS
- LOOP_UNSELECTED_POINTS
- LOOP_VISIBLE_KEYS
- LOOP_VISIBLE_POINTS
- LISTBASE_CIRCULAR_BACKWARD_BEGIN
- LISTBASE_CIRCULAR_FORWARD_BEGIN
- LISTBASE_FOREACH
- LISTBASE_FOREACH_BACKWARD
- LISTBASE_FOREACH_MUTABLE
- LISTBASE_FOREACH_BACKWARD_MUTABLE
- MAN2D_ITER_AXES_BEGIN
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
@@ -241,7 +254,7 @@ ForEachMacros:
- SEQ_BEGIN
- foreach
# Use once we bump the minimum verison to version 8.
# Use once we bump the minimum version to version 8.
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
# StatementMacros:
# - PyObject_VAR_HEAD

22
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
# Configuration for probot-stale - https://github.com/probot/stale
# This file is used on Blender's GitHub mirror to automatically close any pull request
# and invite contributors to join the official development platform on blender.org
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 1
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 1
# Label to use when marking as stale
staleLabel: stale
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed, because this repository is only
used as a mirror of git.blender.org. Blender development happens on
developer.blender.org.
To get started contributing code, please read:
https://wiki.blender.org/wiki/Process/Contributing_Code

3
.gitignore vendored
View File

@@ -40,3 +40,6 @@ Desktop.ini
# in-source lib downloads
/build_files/build_environment/downloads
# in-source buildbot signing configuration
/build_files/buildbot/codesign/config_server.py

View File

@@ -16,6 +16,7 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# ***** END GPL LICENSE BLOCK *****
#-----------------------------------------------------------------------------
@@ -169,6 +170,14 @@ option_defaults_init(
_init_OPENSUBDIV
)
# TBB malloc is only supported on for windows currently
if(WIN32)
set(_init_TBB_MALLOC_PROXY ON)
else()
set(_init_TBB_MALLOC_PROXY OFF)
endif()
# customize...
if(UNIX AND NOT APPLE)
# some of these libraries are problematic on Linux
@@ -182,6 +191,8 @@ if(UNIX AND NOT APPLE)
set(_init_SDL OFF)
set(_init_FFTW3 OFF)
set(_init_OPENSUBDIV OFF)
set(_init_OPENVDB OFF)
set(_init_OPENIMAGEDENOISE OFF)
elseif(WIN32)
set(_init_JACK OFF)
elseif(APPLE)
@@ -237,11 +248,12 @@ option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLO
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
option(WITH_OPENIMAGEDENOISE "Enable the OpenImageDenoise compositing node" ${_init_OPENIMAGEDENOISE})
option(WITH_OPENSUBDIV "Enable OpenSubdiv for surface subdivision" ${_init_OPENSUBDIV})
option(WITH_OPENVDB "Enable features relying on OpenVDB" OFF)
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF)
option(WITH_OPENVDB "Enable features relying on OpenVDB" ${_init_OPENVDB})
option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" ${_init_OPENVDB})
option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
@@ -260,6 +272,8 @@ endif()
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
mark_as_advanced(WITH_HEADLESS)
option(WITH_QUADRIFLOW "Build with quadriflow remesher support" ON)
option(WITH_AUDASPACE "Build with blenders audio library (only disable if you know what you're doing!)" ON)
option(WITH_SYSTEM_AUDASPACE "Build with external audaspace library installed on the system (only enable if you know what you're doing!)" OFF)
mark_as_advanced(WITH_AUDASPACE)
@@ -301,8 +315,6 @@ endif()
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
option(WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON)
option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
# option(WITH_MOD_CLOTH_ELTOPO "Enable Experimental cloth solver" OFF) # this is now only available in a branch
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
# Image format support
@@ -365,7 +377,6 @@ if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
@@ -413,12 +424,15 @@ unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
option(WITH_CYCLES_DEBUG "Build Cycles with extra debug capabilities" OFF)
option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
option(WITH_CYCLES_KERNEL_ASAN "Build Cycles kernels with address sanitizer when WITH_COMPILER_ASAN is on, even if it's very slow" OFF)
mark_as_advanced(WITH_CYCLES_KERNEL_ASAN)
mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
mark_as_advanced(WITH_CYCLES_LOGGING)
mark_as_advanced(WITH_CYCLES_DEBUG)
mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
option(WITH_CYCLES_DEVICE_CUDA "Enable Cycles CUDA compute support" ON)
option(WITH_CYCLES_DEVICE_OPTIX "Enable Cycles OptiX support" OFF)
option(WITH_CYCLES_DEVICE_OPENCL "Enable Cycles OpenCL compute support" ON)
option(WITH_CYCLES_NETWORK "Enable Cycles compute over network support (EXPERIMENTAL and unfinished)" OFF)
mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
@@ -452,14 +466,15 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
option(WITH_BOOST "Enable features depending on boost" ON)
option(WITH_BOOST "Enable features depending on boost" ON)
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
option(WITH_TBB_MALLOC_PROXY "Enable the TBB malloc replacement" ${_init_TBB_MALLOC_PROXY})
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
# Documentation
if(UNIX AND NOT APPLE)
option(WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF)
@@ -471,7 +486,7 @@ endif()
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)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
mark_as_advanced(
WITH_OPENGL
@@ -549,15 +564,6 @@ if(WIN32)
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
mark_as_advanced(WITH_WINDOWS_FIND_MODULES)
option(WITH_WINDOWS_CODESIGN "Use signtool to sign the final binary." OFF)
mark_as_advanced(WITH_WINDOWS_CODESIGN)
set(WINDOWS_CODESIGN_PFX CACHE FILEPATH "Path to pfx file to use for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX)
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
@@ -576,6 +582,15 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja")
mark_as_advanced(WITH_NINJA_POOL_JOBS)
endif()
if(UNIX AND NOT APPLE)
option(WITH_CXX11_ABI "Use native C++11 ABI of compiler" ON)
mark_as_advanced(WITH_CXX11_ABI)
endif()
# Installation process.
option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" OFF)
mark_as_advanced(POSTINSTALL_SCRIPT)
# avoid using again
option_defaults_clear()
@@ -668,6 +683,7 @@ if(NOT WITH_BOOST)
set_and_warn(WITH_INTERNATIONAL OFF)
set_and_warn(WITH_OPENVDB OFF)
set_and_warn(WITH_OPENCOLORIO OFF)
set_and_warn(WITH_QUADRIFLOW OFF)
elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO)
# Keep enabled
@@ -747,14 +763,12 @@ if(NOT WITH_CUDA_DYNLOAD)
endif()
#-----------------------------------------------------------------------------
# Check for valid directories
# ... a partial checkout may cause this.
#
# note: we need to check for a known subdir in both cases.
# since uninitialized git submodules will give blank dirs
# Check check if submodules are cloned
if(WITH_INTERNATIONAL)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/datafiles/locale/languages")
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
list(LENGTH RESULT DIR_LEN)
if(DIR_LEN EQUAL 0)
message(WARNING
"Translation path '${CMAKE_SOURCE_DIR}/release/datafiles/locale' is missing, "
"This is a 'git submodule', which are known not to work with bridges to other version "
@@ -776,7 +790,9 @@ if(WITH_PYTHON)
message(FATAL_ERROR "At least Python 3.7 is required to build")
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules")
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
list(LENGTH RESULT DIR_LEN)
if(DIR_LEN EQUAL 0)
message(WARNING
"Addons path '${CMAKE_SOURCE_DIR}/release/scripts/addons' is missing, "
"This is a 'git submodule', which are known not to work with bridges to other version "
@@ -822,12 +838,6 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
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(WITH_CYCLES_OSL)
# With OSL, Cycles disables rtti in some modules, wich then breaks at linking
# when trying to use vptr sanitizer (included into 'undefined' general option).
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr")
endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()
@@ -838,7 +848,7 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
endif()
#-----------------------------------------------------------------------------
#Platform specifics
# Platform specifics
if(WITH_X11)
find_package(X11 REQUIRED)
@@ -852,7 +862,8 @@ if(WITH_X11)
if(X11_Xinput_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xinput_LIB})
else()
set(WITH_X11_XINPUT OFF)
message(FATAL_ERROR "LibXi not found. Disable WITH_X11_XINPUT if you
want to build without tablet support")
endif()
endif()
@@ -863,7 +874,8 @@ if(WITH_X11)
if(X11_Xxf86vmode_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xxf86vmode_LIB})
else()
set(WITH_X11_XF86VMODE OFF)
message(FATAL_ERROR "libXxf86vm not found. Disable WITH_X11_XF86VMODE if you
want to build without")
endif()
endif()
@@ -871,7 +883,8 @@ if(WITH_X11)
if(X11_Xfixes_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xfixes_LIB})
else()
set(WITH_X11_XFIXES OFF)
message(FATAL_ERROR "libXfixes not found. Disable WITH_X11_XFIXES if you
want to build without")
endif()
endif()
@@ -881,7 +894,8 @@ if(WITH_X11)
if(X11_Xrender_LIB)
list(APPEND PLATFORM_LINKLIBS ${X11_Xrender_LIB})
else()
set(WITH_X11_ALPHA OFF)
message(FATAL_ERROR "libXrender not found. Disable WITH_X11_ALPHA if you
want to build without")
endif()
endif()
@@ -1176,6 +1190,7 @@ if(WITH_SYSTEM_GLEW)
message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
endif()
set(GLEW_INCLUDE_PATH "${GLEW_INCLUDE_DIR}")
set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
else()
if(WITH_GLEW_ES)
@@ -1388,13 +1403,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_LOGICAL_OP -Wlogical-op)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEF -Wundef)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_RESTRICT -Wrestrict)
# C-only.
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ABSOLUTE_VALUE -Wabsolute-value)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
@@ -1427,7 +1445,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_RETURN_TYPE -Werror=return-type)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_POINTER_ARITH -Wpointer-arith)
@@ -1564,7 +1581,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
if(MSVC_VERSION GREATER_EQUAL 1911)
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
set(_WARNINGS "${_WARNINGS} /w35038") #order of initialisation in c++ constructors
set(_WARNINGS "${_WARNINGS} /w35038") # order of initialization in c++ constructors
endif()
string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
@@ -1604,15 +1621,19 @@ if(WITH_PYTHON)
endif()
endif()
if(
if(MSVC)
# MSVC needs to be tested first, since clang on windows will
# match the compiler test below but clang-cl does not accept -std=c++11
# since it is on by default and cannot be turned off.
#
# Nothing special is needed, C++11 features are available by default.
elseif(
CMAKE_COMPILER_IS_GNUCC OR
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
CMAKE_C_COMPILER_ID MATCHES "Intel"
)
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(MSVC)
# Nothing special is needed, C++11 features are available by default.
else()
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++11 build")
endif()
@@ -1628,6 +1649,12 @@ if(
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
if(UNIX AND NOT APPLE)
if(NOT WITH_CXX11_ABI)
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
# Include warnings first, so its possible to disable them with user defined flags
# eg: -Wno-uninitialized
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
@@ -1760,13 +1787,14 @@ if(FIRST_RUN)
info_cfg_option(WITH_CYCLES)
info_cfg_option(WITH_FREESTYLE)
info_cfg_option(WITH_OPENCOLORIO)
info_cfg_option(WITH_OPENIMAGEDENOISE)
info_cfg_option(WITH_OPENVDB)
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)
info_cfg_option(WITH_OPENMP)
info_cfg_option(WITH_RAYOPTIMIZATION)
info_cfg_text("System Options:")
info_cfg_option(WITH_INSTALL_PORTABLE)

View File

@@ -37,14 +37,16 @@ Convenience Targets
* bpy: Build as a python module which can be loaded from python directly.
* deps: Build library dependencies (intended only for platform maintainers).
* developer: Enable faster builds, error checking and tests, recommended for developers.
* config: Run cmake configuration tool to set build options.
* ninja: Use ninja build tool for faster builds.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Project Files
Generate poject files for development environments.
Generate project files for development environments.
* project_qtcreator: QtCreator Project Files.
* project_netbeans: NetBeans Project Files.
@@ -60,8 +62,7 @@ Testing Targets
Not associated with building Blender.
* test:
Run ctest, currently tests import/export,
operator execution and that python modules load
Run automated tests with ctest.
* test_cmake:
Runs our own cmake file checker
which detects errors in the cmake file list definitions
@@ -117,7 +118,7 @@ Utilities
Example
make icons_geom BLENDER_BIN=/path/to/blender
* tgz:
* source_archive:
Create a compressed archive of the source code.
* update:
@@ -162,9 +163,8 @@ CPU:=$(shell uname -m)
BLENDER_DIR:=$(shell pwd -P)
BUILD_TYPE:=Release
ifndef BUILD_CMAKE_ARGS
BUILD_CMAKE_ARGS:=
endif
# CMake arguments, assigned to local variable to make it mutable.
CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS)
ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
@@ -191,6 +191,16 @@ ifndef PYTHON
PYTHON:=python3
endif
# For macOS python3 is not installed by default, so fallback to python binary
# in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=../lib/darwin/python/bin/python3.7m
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
endif
endif
# -----------------------------------------------------------------------------
# additional targets for the build configuration
@@ -202,25 +212,49 @@ ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
endif
ifneq "$(findstring full, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_full
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_cycles
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_headless
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake"
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
endif
# -----------------------------------------------------------------------------
# build tool
ifneq "$(findstring ninja, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=$(CMAKE_CONFIG_ARGS) -G Ninja
BUILD_COMMAND:=ninja
DEPS_BUILD_COMMAND:=ninja
else
ifneq ("$(wildcard $(BUILD_DIR)/build.ninja)","")
BUILD_COMMAND:=ninja
else
BUILD_COMMAND:=make -s
endif
ifneq ("$(wildcard $(DEPS_BUILD_DIR)/build.ninja)","")
DEPS_BUILD_COMMAND:=ninja
else
DEPS_BUILD_COMMAND:=make -s
endif
endif
# -----------------------------------------------------------------------------
# Blender binary path
@@ -241,7 +275,10 @@ ifndef NPROCS
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifneq (,$(filter $(OS),Darwin FreeBSD NetBSD))
ifeq ($(OS), NetBSD)
NPROCS:=$(shell getconf NPROCESSORS_ONLN)
endif
ifneq (,$(filter $(OS),Darwin FreeBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif
@@ -250,7 +287,7 @@ endif
# -----------------------------------------------------------------------------
# Macro for configuring cmake
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
CMAKE_CONFIG = cmake $(CMAKE_CONFIG_ARGS) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
@@ -282,7 +319,7 @@ all: .FORCE
@echo
@echo Building Blender ...
$(MAKE) -C "$(BUILD_DIR)" -s -j $(NPROCS) install
$(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install
@echo
@echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild.
@echo Blender successfully built, run from: $(BLENDER_BIN)
@@ -294,6 +331,8 @@ lite: all
cycles: all
headless: all
bpy: all
developer: all
ninja: all
# -----------------------------------------------------------------------------
# Build dependencies
@@ -312,7 +351,7 @@ deps: .FORCE
@echo
@echo Building dependencies ...
$(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
$(DEPS_BUILD_COMMAND) -C "$(DEPS_BUILD_DIR)" -j $(NPROCS) $(DEPS_TARGET)
@echo
@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
@echo
@@ -347,7 +386,7 @@ package_archive: .FORCE
# Tests
#
test: .FORCE
cd $(BUILD_DIR) ; ctest . --output-on-failure
$(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)"
# run pep8 check check on scripts we distribute.
test_pep8: .FORCE
@@ -488,8 +527,8 @@ check_descriptions: .FORCE
# Utilities
#
tgz: .FORCE
./build_files/utils/build_tgz.sh
source_archive: .FORCE
./build_files/utils/make_source_archive.sh
INKSCAPE_BIN?="inkscape"
icons: .FORCE
@@ -503,21 +542,11 @@ icons_geom: .FORCE
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE
if [ "$(OS_NCASE)" = "darwin" ] && [ ! -d "../lib/$(OS_NCASE)" ]; then \
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/$(OS_NCASE) ../lib/$(OS_NCASE) ; \
fi
if [ -d "../lib" ]; then \
svn cleanup ../lib/* ; \
svn update ../lib/* ; \
fi
git pull --rebase
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master
$(PYTHON) ./build_files/utils/make_update.py
format: .FORCE
PATH="../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
python3 source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
$(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
# -----------------------------------------------------------------------------
@@ -548,7 +577,7 @@ help_features: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"
clean: .FORCE
$(MAKE) -C "$(BUILD_DIR)" clean
$(BUILD_COMMAND) -C "$(BUILD_DIR)" clean
.PHONY: all

View File

@@ -43,6 +43,7 @@ project("BlenderDependencies")
cmake_minimum_required(VERSION 3.5)
include(ExternalProject)
include(cmake/check_software.cmake)
include(cmake/options.cmake)
include(cmake/versions.cmake)
@@ -57,7 +58,6 @@ else()
endif()
include(cmake/zlib.cmake)
include(cmake/blendthumb.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
@@ -90,12 +90,14 @@ include(cmake/tbb.cmake)
include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
if(UNIX AND NOT APPLE)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
endif()
include(cmake/openimagedenoise.cmake)
if(WITH_WEBP)
include(cmake/webp.cmake)
@@ -112,7 +114,7 @@ if(WIN32)
include(cmake/tinyxml.cmake)
include(cmake/yamlcpp.cmake)
# LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
#include(cmake/lcms.cmake)
# include(cmake/lcms.cmake)
endif()
@@ -126,6 +128,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/ogg.cmake)
include(cmake/vorbis.cmake)
include(cmake/theora.cmake)
include(cmake/opus.cmake)
include(cmake/vpx.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
@@ -155,4 +158,9 @@ if(UNIX)
include(cmake/sqlite.cmake)
endif()
if(UNIX AND NOT APPLE)
include(cmake/libglu.cmake)
include(cmake/mesa.cmake)
endif()
include(cmake/harvest.cmake)

View File

@@ -40,7 +40,7 @@ set(ALEMBIC_EXTRA_ARGS
-DBoost_USE_MULTITHREADED=ON
-DUSE_STATIC_BOOST=On
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON

View File

@@ -1,67 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release)
if(WIN32)
set(THUMB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../release/windows/blendthumb)
ExternalProject_Add(external_zlib_32
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_32}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib32 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib32
)
ExternalProject_Add(external_zlib_64
URL ${ZLIB_URI}
CMAKE_GENERATOR ${GENERATOR_64}
URL_HASH MD5=${ZLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/zlib64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zlib64 ${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/zlib64
)
ExternalProject_Add(external_blendthumb_32
CMAKE_GENERATOR ${GENERATOR_32}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb32
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb32
)
add_dependencies(
external_blendthumb_32
external_zlib_32
)
ExternalProject_Add(external_blendthumb_64
CMAKE_GENERATOR ${GENERATOR_64}
SOURCE_DIR ${THUMB_DIR}
PREFIX ${BUILD_DIR}/blendthumb64
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib
INSTALL_DIR ${LIBDIR}/blendthumb64
)
add_dependencies(
external_blendthumb_64
external_zlib_64
)
endif()
endif()

View File

@@ -30,8 +30,8 @@ set(BLOSC_EXTRA_ARGS
)
if(WIN32)
#prevent blosc from including it's own local copy of zlib in the object file
#and cause linker errors with everybody else
# Prevent blosc from including it's own local copy of zlib in the object file
# and cause linker errors with everybody else.
set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
-DPREFER_EXTERNAL_ZLIB=ON
)

View File

@@ -29,23 +29,13 @@ if(WIN32)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
set(BOOST_ADDRESS_MODEL 32)
endif()
if(MSVC14)
set(BOOST_TOOLSET toolset=msvc-14.0)
set(BOOST_COMPILER_STRING -vc140)
endif()
set(JAM_FILE ${BUILD_DIR}/boost/src/external_boost/user-config.jam)
set(semi_path "${PATCH_DIR}/semi.txt")
FILE(TO_NATIVE_PATH ${semi_path} semi_path)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat &&
echo using python : ${PYTHON_OUTPUTDIR}\\python.exe > "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/pc >> "${JAM_FILE}" &&
echo. : ${BUILD_DIR}/python/src/external_python/pcbuild >> "${JAM_FILE}" &&
type ${semi_path} >> "${JAM_FILE}"
)
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND bjam)
#--user-config=user-config.jam
set(BOOST_BUILD_OPTIONS runtime-link=static )
#set(BOOST_WITH_PYTHON --with-python)
set(BOOST_BUILD_OPTIONS runtime-link=shared )
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
if(BUILD_MODE STREQUAL Release)
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-1_68/ ${HARVEST_TARGET}/boost/include/)
@@ -82,7 +72,6 @@ set(BOOST_OPTIONS
--with-serialization
--with-program_options
--with-iostreams
${BOOST_WITH_PYTHON}
${BOOST_TOOLSET}
)
@@ -100,10 +89,3 @@ ExternalProject_Add(external_boost
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WIN32)
add_dependencies(
external_boost
Make_Python_Environment
)
endif()

View File

@@ -0,0 +1,59 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX)
if(APPLE)
set(_libtoolize_name glibtoolize)
else()
set(_libtoolize_name libtoolize)
endif()
set(_required_software
autoconf
automake
${_libtoolize_name}
nasm
yasm
tclsh
)
foreach(_software ${_required_software})
find_program(_software_find NAMES ${_software})
if(NOT _software_find)
set(_software_missing "${_software_missing}${_software} ")
endif()
unset(_software_find CACHE)
endforeach()
if(_software_missing)
message(
"\n"
"Missing software for building Blender dependencies:\n"
" ${_software_missing}\n"
"\n"
"On Debian and Ubuntu:\n"
" apt install autoconf automake libtool yasm nasm tcl\n"
"\n"
"On macOS (with homebrew):\n"
" brew install cmake autoconf automake libtool yasm nasm\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")
message(FATAL_ERROR "Install missing software before continuing")
endif()
endif()

View File

@@ -19,8 +19,8 @@
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)

View File

@@ -16,10 +16,10 @@
#
# ***** END GPL LICENSE BLOCK *****
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR})
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:)
if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
@@ -73,6 +73,7 @@ ExternalProject_Add(external_ffmpeg
--disable-libgsm
--disable-libspeex
--enable-libvpx
--enable-libopus
--prefix=${LIBDIR}/ffmpeg
--enable-libtheora
--enable-libvorbis
@@ -130,6 +131,7 @@ add_dependencies(
external_openjpeg
external_xvidcore
external_x264
external_opus
external_vpx
external_theora
external_vorbis

View File

@@ -51,13 +51,8 @@ if(BUILD_MODE STREQUAL Release)
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
# BlendThumb
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll &&
# hidapi
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
# webp, straight up copy
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/
DEPENDS
)
endif()
@@ -166,6 +161,8 @@ harvest(openimageio/bin openimageio/bin "maketx")
harvest(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest(openimageio/lib openimageio/lib "*.a")
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
@@ -193,6 +190,7 @@ harvest(theora/lib ffmpeg/lib "*.a")
harvest(tiff/include tiff/include "*.h")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(opus/lib ffmpeg/lib "*.a")
harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
@@ -200,4 +198,9 @@ harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
harvest(mesa/lib mesa/lib "*.so*")
endif()
endif()

View File

@@ -24,7 +24,7 @@ ExternalProject_Add(external_lcms
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LCMS_HASH}
PREFIX ${BUILD_DIR}/lcms
#patch taken from ocio
# Patch taken from ocio.
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/lcms

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LIBGLU_CFLAGS "-static-libgcc")
set(LIBGLU_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(LIBGLU_LDFLAGS "-pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(LIBGLU_EXTRA_FLAGS
CFLAGS=${LIBGLU_CFLAGS}
CXXFLAGS=${LIBGLU_CXXFLAGS}
LDFLAGS=${LIBGLU_LDFLAGS}
)
ExternalProject_Add(external_libglu
URL ${LIBGLU_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LIBGLU_HASH}
PREFIX ${BUILD_DIR}/libglu
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/libglu/src/external_libglu/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/libglu ${LIBGLU_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/libglu/src/external_libglu/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/libglu/src/external_libglu/ && make install
INSTALL_DIR ${LIBDIR}/libglu
)

View File

@@ -17,8 +17,8 @@
# ***** END GPL LICENSE BLOCK *****
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MT
-DLLVM_USE_CRT_DEBUG=MTd
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_INCLUDE_EXAMPLES=OFF

View File

@@ -0,0 +1,54 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(MESA_CFLAGS "-static-libgcc")
set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a")
set(MESA_EXTRA_FLAGS
CFLAGS=${MESA_CFLAGS}
CXXFLAGS=${MESA_CXXFLAGS}
LDFLAGS=${MESA_LDFLAGS}
--enable-glx=gallium-xlib
--with-gallium-drivers=swrast
--disable-dri
--disable-gbm
--disable-egl
--disable-gles1
--disable-gles2
--disable-llvm-shared-libs
--with-llvm-prefix=${LIBDIR}/llvm
)
ExternalProject_Add(external_mesa
URL ${MESA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${MESA_HASH}
PREFIX ${BUILD_DIR}/mesa
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/mesa/src/external_mesa/ &&
${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make install
INSTALL_DIR ${LIBDIR}/mesa
)
add_dependencies(
external_mesa
ll
)

View File

@@ -17,6 +17,7 @@
# ***** END GPL LICENSE BLOCK *****
if(MSVC)
message("BIN >${PYTHON_BINARY}<")
if(BUILD_MODE STREQUAL Debug)
set(NUMPY_DIR_POSTFIX -pydebug)
set(NUMPY_ARCHIVE_POSTFIX d)
@@ -30,17 +31,6 @@ endif()
set(NUMPY_POSTFIX)
if(WIN32)
set(NUMPY_INSTALL
${CMAKE_COMMAND} -E copy_directory "${BUILD_DIR}/python/src/external_python/run/lib/site-packages/numpy/core/include/numpy" "${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/numpy" &&
${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/numpy/src/external_numpy/build/lib.${PYTHON_ARCH2}-${PYTHON_SHORT_VERSION}${NUMPY_DIR_POSTFIX}"
${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz" "."
)
else()
set(NUMPY_INSTALL echo .)
set(NUMPY_PATCH echo .)
endif()
ExternalProject_Add(external_numpy
URL ${NUMPY_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -50,17 +40,10 @@ ExternalProject_Add(external_numpy
CONFIGURE_COMMAND ""
LOG_BUILD 1
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
INSTALL_COMMAND ${NUMPY_INSTALL}
INSTALL_COMMAND ""
)
if(WIN32)
ExternalProject_Add_Step(external_numpy after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}${NUMPY_ARCHIVE_POSTFIX}.tar.gz
DEPENDEES install
)
endif()
add_dependencies(
external_numpy
Make_Python_Environment
external_python
)

View File

@@ -50,7 +50,7 @@ if(WIN32)
-DUSE_EXTERNAL_LCMS=ON
-DINC_1=${LIBDIR}/tinyxml/include
-DINC_2=${LIBDIR}/yamlcpp/include
#lie because ocio cmake is demanding boost even though it is not needed
# Lie because ocio cmake is demanding boost even though it is not needed.
-DYAML_CPP_VERSION=0.5.0
)
else()
@@ -95,7 +95,7 @@ if(WIN32)
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmt.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
DEPENDEES install
)
@@ -103,7 +103,7 @@ if(WIN32)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/static/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmtd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml_d.lib
DEPENDEES install
)

View File

@@ -44,7 +44,7 @@ if(WIN32)
ExternalProject_Add_Step(external_openexr after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib
#libs have moved between versions, just duplicate it for now.
# Libs have moved between versions, just duplicate it for now.
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${LIBDIR}/ilmbase/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include
DEPENDEES install

View File

@@ -0,0 +1,61 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OIDN_EXTRA_ARGS
-DWITH_EXAMPLE=OFF
-DWITH_TEST=OFF
-DTBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=ON
-DOIDN_STATIC_LIB=ON
)
ExternalProject_Add(external_openimagedenoise
URL ${OIDN_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OIDN_HASH}
PREFIX ${BUILD_DIR}/openimagedenoise
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/openimagedenoise/src/external_openimagedenoise < ${PATCH_DIR}/openimagedenoise.diff
INSTALL_DIR ${LIBDIR}/openimagedenoise
)
add_dependencies(
external_openimagedenoise
external_tbb
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openimagedenoise after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openimagedenoise/include ${HARVEST_TARGET}/openimagedenoise/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/openimagedenoise.lib ${HARVEST_TARGET}/openimagedenoise/lib/openimagedenoise.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/common.lib ${HARVEST_TARGET}/openimagedenoise/lib/common.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/mkldnn.lib ${HARVEST_TARGET}/openimagedenoise/lib/mkldnn.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openimagedenoise after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/openimagedenoise.lib ${HARVEST_TARGET}/openimagedenoise/lib/openimagedenoise_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/common.lib ${HARVEST_TARGET}/openimagedenoise/lib/common_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/mkldnn.lib ${HARVEST_TARGET}/openimagedenoise/lib/mkldnn_d.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -69,7 +69,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON

View File

@@ -38,7 +38,7 @@ ExternalProject_Add(external_openjpeg
INSTALL_DIR ${LIBDIR}/openjpeg
)
#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
# On windows ffmpeg wants a mingw build, while oiio needs a msvc build.
if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc

View File

@@ -41,7 +41,6 @@ if(WIN32)
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
-DCMAKE_EXE_LINKER_FLAGS_RELEASE=libcmt.lib
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(OPENSUBDIV_EXTRA_ARGS

View File

@@ -24,7 +24,7 @@ set(OPENVDB_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}

View File

@@ -62,22 +62,22 @@ if(WIN32)
endif()
set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MTd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else()
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")
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
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")
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${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")
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${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(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${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 "/MD ${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 "/MD ${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)
@@ -97,8 +97,8 @@ if(WIN32)
set(CONFIGURE_ENV
cd ${MINGW_PATH} &&
call ${MINGW_SHELL} &&
call ${PERL_SHELL} &&
call ${MINGW_SHELL} &&
set path &&
set CFLAGS=-g &&
set LDFLAGS=-Wl,--as-needed -static-libgcc
@@ -190,7 +190,7 @@ set(DEFAULT_CMAKE_FLAGS
)
if(WIN32)
#we need both flavors to build the thumbnail dlls
# We need both flavors to build the thumbnail dlls
if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64")

View File

@@ -0,0 +1,35 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_opus
URL ${OPUS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPUS_HASH}
PREFIX ${BUILD_DIR}/opus
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/opus
--disable-shared
--enable-static
--with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make install
INSTALL_DIR ${LIBDIR}/opus
)
if(MSVC)
set_target_properties(external_opus PROPERTIES FOLDER Mingw)
endif()

View File

@@ -40,7 +40,7 @@ set(OSL_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
@@ -87,6 +87,7 @@ elseif(APPLE)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DHIDE_SYMBOLS=OFF
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
endif()

View File

@@ -0,0 +1,58 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(MSVC)
set(PYTARGET ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS})
set(PYSRC ${LIBDIR}/python/)
if(BUILD_MODE STREQUAL Release)
add_custom_command(
OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND echo packaging python
COMMAND echo this should ouput at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python.exe ${PYTARGET}/bin/python.exe
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_SHORT_VERSION_NO_DOTS}.dll ${PYTARGET}/bin/python${PYTHON_SHORT_VERSION_NO_DOTS}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_SHORT_VERSION_NO_DOTS}.pdb ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.pdb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/include/ ${PYTARGET}/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/lib/ ${PYTARGET}/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/DLLs/ ${PYTARGET}/DLLs/
COMMAND cd ${PYTARGET}/lib/ && for /d /r . %%d in (__pycache__) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"
)
add_custom_target(Package_Python ALL DEPENDS external_python external_numpy external_python_site_packages OUTPUT ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS}/bin/python${PYTHON_POSTFIX}.exe)
endif()
if(BUILD_MODE STREQUAL Debug)
add_custom_command(
OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND echo packaging python
COMMAND echo this should ouput at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_POSTFIX}.exe ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${PYTARGET}/bin/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.pdb ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.pdb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/include/ ${PYTARGET}/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/lib/ ${PYTARGET}/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYSRC}/DLLs/ ${PYTARGET}/DLLs/
COMMAND cd ${PYTARGET}/lib/ && for /d /r . %%d in (__pycache__) do @if exist "%%d" echo "%%d" && rd /s/q "%%d"
)
add_custom_target(Package_Python ALL DEPENDS external_python external_numpy external_python_site_packages OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe)
endif()
endif()

View File

@@ -19,17 +19,13 @@
set(PYTHON_POSTFIX)
if(BUILD_MODE STREQUAL Debug)
set(PYTHON_POSTFIX _d)
set(PYTHON_EXTRA_INSTLAL_FLAGS -d)
endif()
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(SSL_POSTFIX -x64)
else()
set(SSL_POSTFIX)
endif()
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe)
set(PYTHON_BINARY_INTERNAL ${BUILD_DIR}/python/src/external_python/PCBuild/amd64/python${PYTHON_POSTFIX}.exe)
set(PYTHON_BINARY ${LIBDIR}/python/python${PYTHON_POSTFIX}.exe)
set(PYTHON_SRC ${BUILD_DIR}/python/src/external_python/)
macro(cmake_to_dos_path MsysPath ResultingPath)
string(REPLACE "/" "\\" ${ResultingPath} "${MsysPath}")
endmacro()
@@ -40,31 +36,16 @@ if(WIN32)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
message("Python externals = ${PYTHON_EXTERNALS_FOLDER}")
message("Python externals_dos = ${PYTHON_EXTERNALS_FOLDER_DOS}")
message("Python DOWNLOADS_EXTERNALS_FOLDER = ${DOWNLOADS_EXTERNALS_FOLDER}")
message("Python DOWNLOADS_EXTERNALS_FOLDER_DOS = ${DOWNLOADS_EXTERNALS_FOLDER_DOS}")
ExternalProject_Add(external_python
URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
PATCH_COMMAND
echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" &&
mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}"
CONFIGURE_COMMAND ""
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.pdb ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.pdb &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib &&
${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} &&
${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-underpth --include-stable --include-pip --include-dev --include-launchers --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
)
message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist")
message("POutput = ${PYTHON_OUTPUTDIR}")
else()
if(APPLE)
# disable functions that can be in 10.13 sdk but aren't available on 10.9 target
@@ -107,65 +88,6 @@ else()
BUILD_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${PYTHON_CONFIGURE_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && make install
INSTALL_DIR ${LIBDIR}/python)
add_custom_target(Make_Python_Environment ALL DEPENDS external_python)
endif()
if(MSVC)
add_custom_command(
OUTPUT ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz
OUTPUT ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/lib ${BUILD_DIR}/python/src/external_python/redist/lib
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_asyncio${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_asyncio${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_bz2${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_bz2${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_contextvars${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_contextvars${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ctypes_test${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ctypes_test${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_decimal${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_decimal${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_distutils_findvs${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_distutils_findvs${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_elementtree${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_elementtree${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_hashlib${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_hashlib${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_lzma${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_lzma${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_msi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_msi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_multiprocessing${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_multiprocessing${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_overlapped${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_overlapped${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_queue${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_queue${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_socket${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_socket${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_sqlite3${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_sqlite3${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_ssl${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_ssl${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testbuffer${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testbuffer${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testcapi${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testcapi${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testimportmultiple${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testimportmultiple${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/_testmultiphase${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/_testmultiphase${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/pyexpat${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/pyexpat${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/select${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/select${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/unicodedata${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/unicodedata${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/winsound${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/winsound${PYTHON_POSTFIX}.pyd
#xxlimited is an example extension module, we don't need to ship it and debug doesn't build it
#leaving it commented out, so I won't get confused again with the next update.
#COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/xxlimited${PYTHON_POSTFIX}.pyd" ${BUILD_DIR}/python/src/external_python/redist/lib/xxlimited${PYTHON_POSTFIX}.pyd
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/libssl-1_1${SSL_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/redist/lib/libssl-1_1${SSL_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/libcrypto-1_1${SSL_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/redist/lib/libcrypto-1_1${SSL_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/sqlite3${PYTHON_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/redist/lib/sqlite3${PYTHON_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E chdir "${BUILD_DIR}/python/src/external_python/redist" ${CMAKE_COMMAND} -E tar "cfvz" "${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz" "."
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz
)
add_custom_target(Package_Python ALL DEPENDS external_python ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.tar.gz ${BUILD_DIR}/python/src/external_python/redist/bin/python${PYTHON_POSTFIX}.exe)
add_custom_command(OUTPUT ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/redist ${BUILD_DIR}/python/src/external_python/run
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${BUILD_DIR}/python/src/external_python/run/include
COMMAND ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${BUILD_DIR}/python/src/external_python/run/include/pyconfig.h
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib #missing postfix on purpose, distutils is not expecting it
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib" ${BUILD_DIR}/python/src/external_python/run/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib #other things like numpy still want it though.
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_OUTPUTDIR}/python${PYTHON_POSTFIX}.exe" ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe
COMMAND ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe -m ensurepip --upgrade
)
add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python)
endif()
if(UNIX)

View File

@@ -15,27 +15,16 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(HARVEST_CMD cmd /C FOR /d /r ${BUILD_DIR}/python/src/external_python/run/lib/site-packages %d IN (__pycache__) DO @IF EXIST "%d" rd /s /q "%d" &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi &&
${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests
)
else()
set(HARVEST_CMD echo .)
endif()
ExternalProject_Add(external_python_site_packages
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: && ${HARVEST_CMD}
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all:
)
add_dependencies(
external_python_site_packages
Make_Python_Environment
external_python
)

View File

@@ -21,7 +21,7 @@ set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR
if(WIN32)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
#shared for windows because static libs will drag in a libgcc dependency.
# Shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared )
else()
set(SNDFILE_OPTIONS --enable-static --disable-shared )

View File

@@ -15,13 +15,21 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=Off
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
if(WIN32)
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=On
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=On
-DTBB_BUILD_STATIC=On
)
else()
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
endif()
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
ExternalProject_Add(external_tbb
@@ -39,6 +47,10 @@ if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_tbb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.dll
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tbb/include/ ${HARVEST_TARGET}/tbb/include/
DEPENDEES install
)
@@ -46,6 +58,9 @@ if(WIN32)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tbb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll
DEPENDEES install
)
endif()

View File

@@ -16,20 +16,26 @@
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX)
set(THEORA_CONFIGURE_ENV ${CONFIGURE_ENV} && export HAVE_PDFLATEX=no)
else()
set(THEORA_CONFIGURE_ENV ${CONFIGURE_ENV})
endif()
ExternalProject_Add(external_theora
URL ${THEORA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${THEORA_HASH}
PREFIX ${BUILD_DIR}/theora
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
CONFIGURE_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
--disable-shared
--enable-static
--with-pic
--with-ogg=${LIBDIR}/ogg
--with-vorbis=${LIBDIR}/vorbis
--disable-examples
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make install
BUILD_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && make install
INSTALL_DIR ${LIBDIR}/theora
)

View File

@@ -24,7 +24,7 @@ ExternalProject_Add(external_tinyxml
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${TINYXML_HASH}
PREFIX ${BUILD_DIR}/tinyxml
#patch taken from ocio
# patch taken from ocio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/tinyxml/src/external_tinyxml < ${PATCH_DIR}/tinyxml.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tinyxml ${DEFAULT_CMAKE_FLAGS} ${TINYXML_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/tinyxml

View File

@@ -61,7 +61,7 @@ set(ILMBASE_URI https://github.com/openexr/openexr/releases/download/v${ILMBASE_
set(ILMBASE_HASH 354bf86de3b930ab87ac63619d60c860)
set(OPENEXR_VERSION 2.3.0)
if(WIN32) #release 2.3.0 tarball has broken cmake support
if(WIN32) # release 2.3.0 tarball has broken cmake support
set(OPENEXR_URI https://github.com/openexr/openexr/archive/0ac2ea34c8f3134148a5df4052e40f155b76f6fb.tar.gz)
set(OPENEXR_HASH ed159435d508240712fbaaa21d94bafb)
else()
@@ -86,21 +86,21 @@ set(HDF5_VERSION 1.8.17)
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
set(ALEMBIC_VERSION 1.7.8)
set(ALEMBIC_VERSION 1.7.12)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_MD5 d095c2feb5e183b824904db7b63c1d30)
set(ALEMBIC_MD5 e2b3777f23c5c09481a008cc6f0f8a40)
## hash is for 3.1.2
# hash is for 3.1.2
set(GLFW_GIT_UID 30306e54705c3adae9fe082c816a3be71963485c)
set(GLFW_URI https://github.com/glfw/glfw/archive/${GLFW_GIT_UID}.zip)
set(GLFW_HASH 20cacb1613da7eeb092f3ac4f6b2b3d0)
#latest uid in git as of 2016-04-01
# latest uid in git as of 2016-04-01
set(CLEW_GIT_UID 277db43f6cafe8b27c6f1055f69dc67da4aeb299)
set(CLEW_URI https://github.com/OpenCLWrangler/clew/archive/${CLEW_GIT_UID}.zip)
set(CLEW_HASH 2c699d10ed78362e71f56fae2a4c5f98)
#latest uid in git as of 2016-04-01
# latest uid in git as of 2016-04-01
set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
@@ -143,30 +143,30 @@ set(OSL_VERSION 1.9.9)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 44ad511e424965a10fce051a053b0605)
set(PYTHON_VERSION 3.7.0)
set(PYTHON_VERSION 3.7.4)
set(PYTHON_SHORT_VERSION 3.7)
set(PYTHON_SHORT_VERSION_NO_DOTS 37)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH eb8c2a6b1447d50813c02714af4681f3)
set(PYTHON_HASH d33e4aae66097051c2eca45ee3604803)
set(TBB_VERSION 2018_U5)
set(TBB_VERSION 2019_U9)
set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
set(TBB_HASH ff3ae09f8c23892fbc3008c39f78288f)
set(TBB_HASH 584edbec127c508f2cd5b6e79ad200fc)
set(OPENVDB_VERSION 5.1.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH 5310101f874dcfd2165f9cee68c22624)
set(IDNA_VERSION 2.7)
set(IDNA_VERSION 2.8)
set(CHARDET_VERSION 3.0.4)
set(URLLIB3_VERSION 1.23)
set(CERTIFI_VERSION 2018.8.13)
set(REQUESTS_VERSION 2.19.1)
set(URLLIB3_VERSION 1.25.3)
set(CERTIFI_VERSION 2019.6.16)
set(REQUESTS_VERSION 2.22.0)
set(NUMPY_VERSION v1.15.0)
set(NUMPY_SHORT_VERSION 1.15)
set(NUMPY_URI https://files.pythonhosted.org/packages/3a/20/c81632328b1a4e1db65f45c0a1350a9c5341fd4bbb8ea66cdd98da56fe2e/numpy-1.15.0.zip)
set(NUMPY_HASH 20e13185089011116a98e11c9bf8aa07)
set(NUMPY_VERSION v1.17.0)
set(NUMPY_SHORT_VERSION 1.17)
set(NUMPY_URI https://files.pythonhosted.org/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip)
set(NUMPY_HASH aed49b31bcb44ec73b8155be78566135)
set(LAME_VERSION 3.100)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz)
@@ -192,6 +192,10 @@ set(VPX_VERSION 1.7.0)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 1fec931eb5c94279ad219a5b6e0202358e94a93a90cfb1603578c326abfc1238)
set(OPUS_VERSION 1.3.1)
set(OPUS_URI https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz)
set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
set(X264_URI http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20180811-2245-stable.tar.bz2)
set(X264_HASH ae8a868a0e236a348b35d79f3ee80294b169d1195408b689f9851383661ed7aa)
@@ -199,7 +203,7 @@ set(XVIDCORE_VERSION 1.3.5)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0)
#this has to be in sync with the version in blenders /extern folder
# This has to be in sync with the version in blenders /extern folder.
set(OPENJPEG_VERSION 2.3.0)
set(OPENJPEG_SHORT_VERSION 2.3)
# Use slightly newer commit after release which includes a cmake fix
@@ -230,9 +234,9 @@ set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_HASH 646b5f98ce89ac60cdb060fcd398247c)
#set(HIDAPI_VERSION 0.8.0-rc1)
#set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
#set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
# set(HIDAPI_VERSION 0.8.0-rc1)
# set(HIDAPI_URI https://github.com/signal11/hidapi/archive/hidapi-${HIDAPI_VERSION}.tar.gz)
# set(HIDAPI_HASH 069f9dd746edc37b6b6d0e3656f47199)
set(HIDAPI_UID 89a6c75dc6f45ecabd4ddfbd2bf5ba6ad8ba38b5)
set(HIDAPI_URI https://github.com/TheOnlyJoey/hidapi/archive/${HIDAPI_UID}.zip)
@@ -259,9 +263,9 @@ set(TINYXML_VERSION_DOTS 2.6.2)
set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
set(YAMLCPP_VERSION 0.6.2)
set(YAMLCPP_VERSION 0.6.3)
set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
set(YAMLCPP_HASH 5b943e9af0060d0811148b037449ef82)
set(YAMLCPP_HASH b45bf1089a382e81f6b661062c10d0c2)
set(LCMS_VERSION 2.9)
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
@@ -302,3 +306,15 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(EMBREE_VERSION 3.2.4)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 3d4a1147002ff43939d45140aa9d6fb8)
set(OIDN_VERSION 1.0.0)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.zip)
set(OIDN_HASH 19fe67b0164e8f020ac8a4f520defe60)
set(LIBGLU_VERSION 9.0.1)
set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
set(MESA_VERSION 18.3.1)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)

View File

@@ -49,6 +49,8 @@ ExternalProject_Add(external_vpx
--disable-avx2
--disable-unit-tests
--disable-examples
--enable-vp8
--enable-vp9
${VPX_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install

View File

@@ -39,3 +39,12 @@ ExternalProject_Add(external_webp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/webp -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${WEBP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/webp
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_webp after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp
DEPENDEES install
)
endif()
endif()

View File

@@ -21,7 +21,7 @@ set(YAMLCPP_EXTRA_ARGS
-DYAML_CPP_BUILD_TESTS=OFF
-DYAML_CPP_BUILD_TOOLS=OFF
-DYAML_CPP_BUILD_CONTRIB=OFF
-DMSVC_SHARED_RT=OFF
-DYAML_MSVC_SHARED_RT=ON
)
ExternalProject_Add(external_yamlcpp

View File

@@ -26,17 +26,17 @@ ARGS=$( \
getopt \
-o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
with-all,with-opencollada,with-jack,with-embree,\
with-all,with-opencollada,with-jack,with-embree,with-oidn,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,\
force-all,force-python,force-numpy,force-boost,\
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
force-ffmpeg,force-opencollada,force-alembic,force-embree,\
force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,\
build-all,build-python,build-numpy,build-boost,\
build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
build-ffmpeg,build-opencollada,build-alembic,build-embree,\
build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,\
skip-python,skip-numpy,skip-boost,\
skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree \
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn \
-- "$@" \
)
@@ -57,6 +57,7 @@ WITH_ALL=false
# Do not yet enable opencollada or embree, use --with-opencollada/--with-embree (or --with-all) option to try it.
WITH_OPENCOLLADA=false
WITH_EMBREE=false
WITH_OIDN=false
THREADS=$(nproc)
@@ -69,6 +70,7 @@ Number of threads for building: \$THREADS (automatically detected, use --threads
Full install: \$WITH_ALL (use --with-all option to enable it).
Building OpenCOLLADA: \$WITH_OPENCOLLADA (use --with-opencollada option to enable it).
Building Embree: \$WITH_EMBREE (use --with-embree option to enable it).
Building OpenImageDenoise: \$WITH_OIDN (use --with-oidn option to enable it).
Example:
Full install without OpenCOLLADA: --with-all --skip-opencollada
@@ -118,6 +120,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--with-embree
Build and install the Embree libraries.
--with-oidn
Build and install the OpenImageDenoise libraries.
--with-jack
Install the jack libraries.
@@ -185,6 +190,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--build-embree
Force the build of Embree.
--build-oidn
Force the build of OpenImageDenoise.
--build-ffmpeg
Force the build of FFMpeg.
@@ -240,6 +248,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-embree
Force the rebuild of Embree.
--force-oidn
Force the rebuild of OpenImageDenoise.
--force-ffmpeg
Force the rebuild of FFMpeg.
@@ -288,6 +299,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-Embree
Unconditionally skip Embree installation/building.
--skip-oidn
Unconditionally skip OpenImageDenoise installation/building.
--skip-ffmpeg
Unconditionally skip FFMpeg installation/building.\""
@@ -303,13 +317,13 @@ USE_CXX11=true
CLANG_FORMAT_VERSION_MIN="6.0"
PYTHON_VERSION="3.7.0"
PYTHON_VERSION="3.7.4"
PYTHON_VERSION_MIN="3.7"
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
NUMPY_VERSION="1.15.0"
NUMPY_VERSION="1.17.0"
NUMPY_VERSION_MIN="1.8"
NUMPY_FORCE_BUILD=false
NUMPY_FORCE_REBUILD=false
@@ -374,7 +388,7 @@ OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false
# Alembic needs to be compiled for now
ALEMBIC_VERSION="1.7.8"
ALEMBIC_VERSION="1.7.12"
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
@@ -390,6 +404,11 @@ EMBREE_FORCE_BUILD=false
EMBREE_FORCE_REBUILD=false
EMBREE_SKIP=false
OIDN_VERSION="1.0.0"
OIDN_FORCE_BUILD=false
OIDN_FORCE_REBUILD=false
OIDN_SKIP=false
FFMPEG_VERSION="4.0.2"
FFMPEG_VERSION_MIN="2.8.4"
FFMPEG_FORCE_BUILD=false
@@ -412,6 +431,9 @@ X264_VERSION_MIN=0.118
VPX_USE=false
VPX_VERSION_MIN=0.9.7
VPX_DEV=""
OPUS_USE=false
OPUS_VERSION_MIN=1.1.1
OPUS_DEV=""
MP3LAME_USE=false
MP3LAME_DEV=""
OPENJPEG_USE=false
@@ -526,6 +548,9 @@ while true; do
--with-embree)
WITH_EMBREE=true; shift; continue
;;
--with-oidn)
WITH_OIDN=true; shift; continue
;;
--with-jack)
WITH_JACK=true; shift; continue;
;;
@@ -572,6 +597,7 @@ while true; do
OPENVDB_FORCE_BUILD=true
OPENCOLLADA_FORCE_BUILD=true
EMBREE_FORCE_BUILD=true
OIDN_FORCE_BUILD=true
FFMPEG_FORCE_BUILD=true
ALEMBIC_FORCE_BUILD=true
shift; continue
@@ -616,6 +642,9 @@ while true; do
--build-embree)
EMBREE_FORCE_BUILD=true; shift; continue
;;
--build-oidn)
OIDN_FORCE_BUILD=true; shift; continue
;;
--build-ffmpeg)
FFMPEG_FORCE_BUILD=true; shift; continue
;;
@@ -635,6 +664,7 @@ while true; do
OPENVDB_FORCE_REBUILD=true
OPENCOLLADA_FORCE_REBUILD=true
EMBREE_FORCE_REBUILD=true
OIDN_FORCE_REBUILD=true
FFMPEG_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true
shift; continue
@@ -677,6 +707,9 @@ while true; do
--force-embree)
EMBREE_FORCE_REBUILD=true; shift; continue
;;
--force-oidn)
OIDN_FORCE_REBUILD=true; shift; continue
;;
--force-ffmpeg)
FFMPEG_FORCE_REBUILD=true; shift; continue
;;
@@ -719,6 +752,9 @@ while true; do
--skip-embree)
EMBREE_SKIP=true; shift; continue
;;
--skip-oidn)
OIDN_SKIP=true; shift; continue
;;
--skip-ffmpeg)
FFMPEG_SKIP=true; shift; continue
;;
@@ -746,6 +782,9 @@ fi
if [ "$WITH_ALL" = true -a "$EMBREE_SKIP" = false ]; then
WITH_EMBREE=true
fi
if [ "$WITH_ALL" = true -a "$OIDN_SKIP" = false ]; then
WITH_OIDN=true
fi
if [ "$WITH_ALL" = true ]; then
WITH_JACK=true
fi
@@ -840,6 +879,11 @@ EMBREE_SOURCE=( "https://github.com/embree/embree/archive/v${EMBREE_VERSION}.tar
#~ EMBREE_REPO_UID="4a12bfed63c90e85b6eab98b8cdd8dd2a3ba5809"
#~ EMBREE_REPO_BRANCH="master"
OIDN_USE_REPO=false
OIDN_SOURCE=( "https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz" )
#~ OIDN_SOURCE_REPO=( "https://github.com/OpenImageDenoise/oidn.git" )
#~ OIDN_REPO_UID="dabfd9c80101edae9d25a710160d12d6d963c591"
#~ OIDN_REPO_BRANCH="master"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
@@ -882,6 +926,7 @@ You may also want to build them yourself (optional ones are [between brackets]):
* [OpenVDB $OPENVDB_VERSION_MIN] (from $OPENVDB_SOURCE), [Blosc $OPENVDB_BLOSC_VERSION] (from $OPENVDB_BLOSC_SOURCE).
* [OpenCollada $OPENCOLLADA_VERSION] (from $OPENCOLLADA_SOURCE).
* [Embree $EMBREE_VERSION] (from $EMBREE_SOURCE).
* [OpenImageDenoise $OIDN_VERSION] (from $OIDN_SOURCE).
* [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).\""
if [ "$DO_SHOW_DEPS" = true ]; then
@@ -1065,13 +1110,14 @@ _create_inst_shortcut() {
# ldconfig
run_ldconfig() {
_lib_path="$INST/$1/lib"
_lib64_path="$INST/$1/lib64"
_ldconf_path="/etc/ld.so.conf.d/$1.conf"
PRINT ""
if [ ! $SUDO ]; then
WARNING "--no-sudo enabled, impossible to run ldconfig for $1, you'll have to do it yourself..."
else
INFO "Running ldconfig for $1..."
$SUDO sh -c "echo \"$_lib_path\" > $_ldconf_path"
$SUDO sh -c "/bin/echo -e \"$_lib_path\n$_lib64_path\" > $_ldconf_path"
$SUDO /sbin/ldconfig # XXX OpenSuse does not include sbin in command path with sudo!!!
fi
PRINT ""
@@ -1932,7 +1978,8 @@ compile_OSL() {
cmake_d="$cmake_d -D OSL_BUILD_PLUGINS=OFF"
cmake_d="$cmake_d -D OSL_BUILD_TESTS=OFF"
cmake_d="$cmake_d -D USE_SIMD=sse2"
cmake_d="$cmake_d -D OSL_BUILD_CPP11=1"
cmake_d="$cmake_d -D USE_LLVM_BITCODE=OFF"
cmake_d="$cmake_d -D USE_PARTIO=OFF"
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
@@ -2552,6 +2599,98 @@ compile_Embree() {
fi
}
#### Build OpenImageDenoise ####
_init_oidn() {
_src=$SRC/oidn-$OIDN_VERSION
_git=true
_inst=$INST/oidn-$OIDN_VERSION
_inst_shortcut=$INST/oidn
}
clean_oidn() {
_init_oidn
_clean
}
compile_OIDN() {
if [ "$NO_BUILD" = true ]; then
WARNING "--no-build enabled, OpenImageDenoise will not be compiled!"
return
fi
# To be changed each time we make edits that would modify the compiled results!
oidn_magic=9
_init_oidn
# Clean install if needed!
magic_compile_check oidn-$OIDN_VERSION $oidn_magic
if [ $? -eq 1 -o "$OIDN_FORCE_REBUILD" = true ]; then
clean_oidn
fi
if [ ! -d $_inst ]; then
INFO "Building OpenImageDenoise-$OIDN_VERSION"
prepare_opt
if [ ! -d $_src ]; then
mkdir -p $SRC
if [ "OIDN_USE_REPO" = true ]; then
git clone $OIDN_SOURCE_REPO $_src
else
download OIDN_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking OpenImageDenoise-$OIDN_VERSION"
tar -C $SRC -xf $_src.tar.gz
fi
fi
cd $_src
if [ "$OIDN_USE_REPO" = true ]; then
git pull origin $OIDN_REPO_BRANCH
# Stick to same rev as windows' libs...
git checkout $OIDN_REPO_UID
git reset --hard
fi
# Always refresh the whole build!
if [ -d build ]; then
rm -rf build
fi
mkdir build
cd build
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D WITH_EXAMPLE=OFF"
cmake_d="$cmake_d -D WITH_TEST=OFF"
cmake_d="$cmake_d -D OIDN_STATIC_LIB=ON"
cmake $cmake_d ../
make -j$THREADS && make install
make clean
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "OpenImageDenoise-$OIDN_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set oidn-$OIDN_VERSION $oidn_magic
cd $CWD
INFO "Done compiling OpenImageDenoise-$OIDN_VERSION!"
else
INFO "Own OpenImageDenoise-$OIDN_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-oidn option."
fi
run_ldconfig "oidn"
}
#### Build FFMPEG ####
_init_ffmpeg() {
_src=$SRC/ffmpeg-$FFMPEG_VERSION
@@ -2618,6 +2757,10 @@ compile_FFmpeg() {
extra="$extra --enable-libvpx"
fi
if [ "$OPUS_USE" = true ]; then
extra="$extra --enable-libopus"
fi
if [ "$MP3LAME_USE" = true ]; then
extra="$extra --enable-libmp3lame"
fi
@@ -2855,6 +2998,14 @@ install_DEB() {
install_packages_DEB $VPX_DEV
VPX_USE=true
fi
PRINT ""
OPUS_DEV="libopus-dev"
check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_DEB $OPUS_DEV
OPUS_USE=true
fi
fi
# Check cmake/glew versions and disable features for older distros.
@@ -3148,6 +3299,24 @@ install_DEB() {
fi
fi
if [ "$WITH_OIDN" = true ]; then
_do_compile_oidn=false
PRINT ""
if [ "$OIDN_SKIP" = true ]; then
WARNING "Skipping OpenImgeDenoise installation, as requested..."
elif [ "$OIDN_FORCE_BUILD" = true ]; then
INFO "Forced OpenImageDenoise building, as requested..."
_do_compile_oidn=true
else
# No package currently!
_do_compile_oidn=true
fi
if [ "$_do_compile_oidn" = true ]; then
compile_OIDN
fi
fi
PRINT ""
if [ "$FFMPEG_SKIP" = true ]; then
WARNING "Skipping FFMpeg installation, as requested..."
@@ -3300,7 +3469,7 @@ install_RPM() {
$SUDO dnf -y update
elif [ "$RPM" = "RHEL" ]; then
if [ "`grep '6\.' /etc/redhat-release`" ]; then
if [ "`grep '[^.]6\.' /etc/redhat-release`" ]; then
ERROR "Building with GCC 4.4 is not supported!"
exit 1
else
@@ -3447,8 +3616,17 @@ install_RPM() {
install_packages_RPM $VPX_DEV
VPX_USE=true
fi
PRINT ""
install_packages_RPM libspnav-devel
PRINT ""
OPUS_DEV="libopus-devel"
check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_RPM $OPUS_DEV
OPUS_USE=true
fi
fi
PRINT ""
@@ -3722,6 +3900,24 @@ install_RPM() {
fi
fi
if [ "$WITH_OIDN" = true ]; then
_do_compile_oidn=false
PRINT ""
if [ "$OIDN_SKIP" = true ]; then
WARNING "Skipping OpenImgeDenoise installation, as requested..."
elif [ "$OIDN_FORCE_BUILD" = true ]; then
INFO "Forced OpenImageDenoise building, as requested..."
_do_compile_oidn=true
else
# No package currently!
_do_compile_oidn=true
fi
if [ "$_do_compile_oidn" = true ]; then
compile_OIDN
fi
fi
PRINT ""
if [ "$FFMPEG_SKIP" = true ]; then
WARNING "Skipping FFMpeg installation, as requested..."
@@ -3905,6 +4101,14 @@ install_ARCH() {
install_packages_ARCH $VPX_DEV
VPX_USE=true
fi
PRINT ""
OPUS_DEV="opus"
check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_ARCH $OPUS_DEV
OPUS_USE=true
fi
fi
@@ -4186,6 +4390,24 @@ install_ARCH() {
fi
fi
if [ "$WITH_OIDN" = true ]; then
_do_compile_oidn=false
PRINT ""
if [ "$OIDN_SKIP" = true ]; then
WARNING "Skipping OpenImgeDenoise installation, as requested..."
elif [ "$OIDN_FORCE_BUILD" = true ]; then
INFO "Forced OpenImageDenoise building, as requested..."
_do_compile_oidn=true
else
# No package currently!
_do_compile_oidn=true
fi
if [ "$_do_compile_oidn" = true ]; then
compile_OIDN
fi
fi
PRINT ""
if [ "$FFMPEG_SKIP" = true ]; then
WARNING "Skipping FFMpeg installation, as requested..."
@@ -4372,6 +4594,24 @@ install_OTHER() {
fi
fi
if [ "$WITH_OIDN" = true ]; then
_do_compile_oidn=false
PRINT ""
if [ "$OIDN_SKIP" = true ]; then
WARNING "Skipping OpenImgeDenoise installation, as requested..."
elif [ "$OIDN_FORCE_BUILD" = true ]; then
INFO "Forced OpenImageDenoise building, as requested..."
_do_compile_oidn=true
else
# No package currently!
_do_compile_oidn=true
fi
if [ "$_do_compile_oidn" = true ]; then
compile_OIDN
fi
fi
PRINT ""
if [ "$FFMPEG_SKIP" = true ]; then
WARNING "Skipping FFMpeg installation, as requested..."
@@ -4425,6 +4665,10 @@ print_info_ffmpeglink() {
_packages="$_packages $VPX_DEV"
fi
if [ "$OPUS_USE" = true ]; then
_packages="$_packages $OPUS_DEV"
fi
if [ "$MP3LAME_USE" = true ]; then
_packages="$_packages $MP3LAME_DEV"
fi
@@ -4587,6 +4831,17 @@ print_info() {
fi
fi
if [ "$WITH_OIDN" = true ]; then
_1="-D WITH_OPENIMAGEDENOISE=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/oidn ]; then
_1="-D OPENIMAGEDENOISE_ROOT_DIR=$INST/oidn"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$WITH_JACK" = true ]; then
_1="-D WITH_JACK=ON"
_2="-D WITH_JACK_DYNLOAD=ON"

View File

@@ -192,11 +192,11 @@ if(ILMBASE_CUSTOM)
set(IlmBase_Libraries ${ILMBASE_CUSTOM_LIBRARIES})
separate_arguments(IlmBase_Libraries)
else()
#elseif(${ILMBASE_VERSION} VERSION_LESS "2.1")
# elseif(${ILMBASE_VERSION} VERSION_LESS "2.1")
set(IlmBase_Libraries Half Iex Imath IlmThread)
#else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries Half Iex-${_ilmbase_libs_ver} Imath-${_ilmbase_libs_ver} IlmThread-${_ilmbase_libs_ver})
# else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
# set(IlmBase_Libraries Half Iex-${_ilmbase_libs_ver} Imath-${_ilmbase_libs_ver} IlmThread-${_ilmbase_libs_ver})
endif()

View File

@@ -188,11 +188,11 @@ if(OPENEXR_CUSTOM)
endif()
set(OpenEXR_Library ${OPENEXR_CUSTOM_LIBRARY})
else()
#elseif(${OPENEXR_VERSION} VERSION_LESS "2.1")
# elseif(${OPENEXR_VERSION} VERSION_LESS "2.1")
set(OpenEXR_Library IlmImf)
#else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
# set(OpenEXR_Library IlmImf-${_openexr_libs_ver})
# else()
# string(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
# set(OpenEXR_Library IlmImf-${_openexr_libs_ver})
endif()
# Locate the OpenEXR library

View File

@@ -43,3 +43,34 @@ index 1f9a3ee..d151e9a 100644
return isnan( value );
#else
return std::isnan(value);
diff --git a/DAEValidator/CMakeLists.txt b/DAEValidator/CMakeLists.txt
index 03ad540f..f7d05cfb 100644
--- a/DAEValidator/CMakeLists.txt
+++ b/DAEValidator/CMakeLists.txt
@@ -98,7 +98,7 @@ if (WIN32)
# C4710: 'function' : function not inlined
# C4711: function 'function' selected for inline expansion
# C4820: 'bytes' bytes padding added after construct 'member_name'
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Wall /WX /wd4505 /wd4514 /wd4592 /wd4710 /wd4711 /wd4820")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Wall /wd4505 /wd4514 /wd4592 /wd4710 /wd4711 /wd4820")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
endif ()
diff --git a/DAEValidator/library/src/ArgumentParser.cpp b/DAEValidator/library/src/ArgumentParser.cpp
index 897e4dcf..98a69ff1 100644
--- a/DAEValidator/library/src/ArgumentParser.cpp
+++ b/DAEValidator/library/src/ArgumentParser.cpp
@@ -6,10 +6,10 @@
using namespace std;
-#ifdef _MSC_VER
-#define NOEXCEPT _NOEXCEPT
-#else
+#ifndef _NOEXCEPT
#define NOEXCEPT noexcept
+#else
+#define NOEXCEPT _NOEXCEPT
#endif
namespace opencollada

View File

@@ -0,0 +1,119 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70ec895..e616b63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,7 +178,9 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION "0")
## Open Image Denoise examples
## ----------------------------------------------------------------------------
-add_subdirectory(examples)
+if(WITH_EXAMPLE)
+ add_subdirectory(examples)
+endif()
## ----------------------------------------------------------------------------
## Open Image Denoise install and packaging
Submodule mkl-dnn contains modified content
diff --git a/mkl-dnn/cmake/TBB.cmake b/mkl-dnn/cmake/TBB.cmake
index 0711e699..c14210b6 100644
--- a/mkl-dnn/cmake/TBB.cmake
+++ b/mkl-dnn/cmake/TBB.cmake
@@ -90,8 +90,8 @@ if(WIN32)
NO_DEFAULT_PATH
)
set(TBB_LIB_DIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
- find_library(TBB_LIBRARY tbb PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
endif()
else()
@@ -138,13 +138,13 @@ else()
set(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
if(APPLE)
find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
else()
find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
set(TBB_HINTS HINTS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
- find_library(TBB_LIBRARY tbb ${TBB_HINTS})
- find_library(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
+ find_library(TBB_LIBRARY tbb_static ${TBB_HINTS})
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static ${TBB_HINTS})
endif()
endif()
diff '--ignore-matching-lines=:' -ur '--exclude=*.svn*' -u -r
--- a/cmake/install.cmake 2019-08-12 18:02:20.794402575 +0200
+++ b/cmake/install.cmake 2019-08-12 18:06:07.470045703 +0200
@@ -18,6 +18,13 @@
## Install library
## ----------------------------------------------------------------------------
+if(UNIX)
+install(FILES
+ ${CMAKE_BINARY_DIR}/libOpenImageDenoise.a
+ ${CMAKE_BINARY_DIR}/libmkldnn.a
+ ${CMAKE_BINARY_DIR}/libcommon.a
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
install(TARGETS ${PROJECT_NAME}
EXPORT
${PROJECT_NAME}_Export
@@ -38,6 +45,7 @@
DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
)
endif()
+endif()
## ----------------------------------------------------------------------------
## Install headers
@@ -78,6 +86,7 @@
## Install CMake configuration files
## ----------------------------------------------------------------------------
+if(NOT UNIX)
install(EXPORT ${PROJECT_NAME}_Export
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
#NAMESPACE ${PROJECT_NAME}::
@@ -92,3 +101,4 @@
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel
)
+endif()
diff '--ignore-matching-lines=:' -ur '--exclude=*.svn*' -u -r
--- a/CMakeLists.txt 2019-08-12 14:22:00.974078598 +0200
+++ b/CMakeLists.txt 2019-08-12 18:05:05.949057375 +0200
@@ -14,7 +14,11 @@
## limitations under the License. ##
## ======================================================================== ##
-cmake_minimum_required(VERSION 3.1)
+if(UNIX)
+ cmake_minimum_required(VERSION 3.1)
+else()
+ cmake_minimum_required(VERSION 3.13)
+endif()
set(OIDN_VERSION_MAJOR 1)
set(OIDN_VERSION_MINOR 0)
@@ -32,13 +36,8 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
# Build as shared or static library
-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
- option(OIDN_STATIC_LIB "Build Open Image Denoise as a static library.")
- mark_as_advanced(CLEAR OIDN_STATIC_LIB)
-else()
- set(OIDN_STATIC_LIB OFF CACHE BOOL "Build Open Image Denoise as a static library." FORCE)
- mark_as_advanced(OIDN_STATIC_LIB)
-endif()
+option(OIDN_STATIC_LIB "Build Open Image Denoise as a static library.")
+mark_as_advanced(CLEAR OIDN_STATIC_LIB)
if(OIDN_STATIC_LIB)
set(OIDN_LIB_TYPE STATIC)
else()

View File

@@ -0,0 +1,70 @@
Blender Buildbot
================
Code signing
------------
Code signing is done as part of INSTALL target, which makes it possible to sign
files which are aimed into a bundle and coming from a non-signed source (such as
libraries SVN).
This is achieved by specifying `slave_codesign.cmake` as a post-install script
run by CMake. This CMake script simply involves an utility script written in
Python which takes care of an actual signing.
### Configuration
Client configuration doesn't need anything special, other than variable
`SHARED_STORAGE_DIR` pointing to a location which is watched by a server.
This is done in `config_builder.py` file and is stored in Git (which makes it
possible to have almost zero-configuration buildbot machines).
Server configuration requires copying `config_server_template.py` under the
name of `config_server.py` and tweaking values, which are platform-specific.
#### Windows configuration
There are two things which are needed on Windows in order to have code signing
to work:
- `TIMESTAMP_AUTHORITY_URL` which is most likely set http://timestamp.digicert.com
- `CERTIFICATE_FILEPATH` which is a full file path to a PKCS #12 key (.pfx).
## Tips
### Self-signed certificate on Windows
It is easiest to test configuration using self-signed certificate.
The certificate manipulation utilities are coming with Windows SDK.
Unfortunately, they are not added to PATH. Here is an example of how to make
sure they are easily available:
```
set PATH=C:\Program Files (x86)\Windows Kits\10\App Certification Kit;%PATH%
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;%PATH%
```
Generate CA:
```
makecert -r -pe -n "CN=Blender Test CA" -ss CA -sr CurrentUser -a sha256 ^
-cy authority -sky signature -sv BlenderTestCA.pvk BlenderTestCA.cer
```
Import the generated CA:
```
certutil -user -addstore Root BlenderTestCA.cer
```
Create self-signed certificate and pack it into PKCS #12:
```
makecert -pe -n "CN=Blender Test SPC" -a sha256 -cy end ^
-sky signature ^
-ic BlenderTestCA.cer -iv BlenderTestCA.pvk ^
-sv BlenderTestSPC.pvk BlenderTestSPC.cer
pvk2pfx -pvk BlenderTestSPC.pvk -spc BlenderTestSPC.cer -pfx BlenderTestSPC.pfx
```

View File

@@ -0,0 +1,114 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import argparse
import os
import re
import subprocess
import sys
class Builder:
def __init__(self, name, branch):
self.name = name
self.branch = branch
self.is_release_branch = re.match("^blender-v(.*)-release$", branch) is not None
# Buildbot runs from build/ directory
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
self.build_dir = os.path.abspath(os.path.join('..', 'build', name))
self.install_dir = os.path.abspath(os.path.join('..', 'install', name))
self.upload_dir = os.path.abspath(os.path.join('..', 'install'))
# Detect platform
if name.startswith('mac'):
self.platform = 'mac'
self.command_prefix = []
elif name.startswith('linux'):
self.platform = 'linux'
self.command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
elif name.startswith('win'):
self.platform = 'win'
self.command_prefix = []
else:
raise ValueError('Unkonw platform for builder ' + self.platform)
# Always 64 bit now
self.bits = 64
def create_builder_from_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('builder_name')
parser.add_argument('branch', default='master', nargs='?')
args = parser.parse_args()
return Builder(args.builder_name, args.branch)
class VersionInfo:
def __init__(self, builder):
# Get version information
buildinfo_h = os.path.join(builder.build_dir, "source", "creator", "buildinfo.h")
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
self.version = "%d.%d" % (version_number // 100, version_number % 100)
self.version_char = self._parse_header_file(blender_h, 'BLENDER_VERSION_CHAR')
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
if self.version_cycle == "release":
# Final release
self.full_version = self.version + self.version_char
self.is_development_build = False
elif self.version_cycle == "rc":
# Release candidate
version_cycle = self.version_cycle + self.version_cycle_number
if len(self.version_char) == 0:
self.full_version = self.version + version_cycle
else:
self.full_version = self.version + self.version_char + '-' + version_cycle
self.is_development_build = False
else:
# Development build
self.full_version = self.version + '-' + self.hash
self.is_development_build = True
def _parse_header_file(self, filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
if match:
return match.group(1)
return None
def call(cmd, env=None, exit_on_error=True):
print(' '.join(cmd))
# Flush to ensure correct order output on Windows.
sys.stdout.flush()
sys.stderr.flush()
retcode = subprocess.call(cmd, env=env)
if exit_on_error and retcode != 0:
sys.exit(retcode)
return retcode

View File

@@ -0,0 +1,77 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
from dataclasses import dataclass
from pathlib import Path
from typing import List
@dataclass
class AbsoluteAndRelativeFileName:
"""
Helper class which keeps track of absolute file path for a direct access and
corresponding relative path against given base.
The relative part is used to construct a file name within an archive which
contains files which are to be signed or which has been signed already
(depending on whether the archive is addressed to signing server or back
to the buildbot worker).
"""
# Base directory which is where relative_filepath is relative to.
base_dir: Path
# Full absolute path of the corresponding file.
absolute_filepath: Path
# Derived from full file path, contains part of the path which is relative
# to a desired base path.
relative_filepath: Path
def __init__(self, base_dir: Path, filepath: Path):
self.base_dir = base_dir
self.absolute_filepath = filepath.resolve()
self.relative_filepath = self.absolute_filepath.relative_to(
self.base_dir)
@classmethod
def from_path(cls, path: Path) -> 'AbsoluteAndRelativeFileName':
assert path.is_absolute()
assert path.is_file()
base_dir = path.parent
return AbsoluteAndRelativeFileName(base_dir, path)
@classmethod
def recursively_from_directory(cls, base_dir: Path) \
-> List['AbsoluteAndRelativeFileName']:
"""
Create list of AbsoluteAndRelativeFileName for all the files in the
given directory.
"""
assert base_dir.is_absolute()
assert base_dir.is_dir()
result = []
for filename in base_dir.glob('**/*'):
if not filename.is_file():
continue
result.append(AbsoluteAndRelativeFileName(base_dir, filename))
return result

View File

@@ -0,0 +1,101 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
from pathlib import Path
from codesign.util import ensure_file_does_not_exist_or_die
class ArchiveWithIndicator:
"""
The idea of this class is to wrap around logic which takes care of keeping
track of a name of an archive and synchronization routines between buildbot
worker and signing server.
The synchronization is done based on creating a special file after the
archive file is knowingly ready for access.
"""
# Base directory where the archive is stored (basically, a basename() of
# the absolute archive file name).
#
# For example, 'X:\\TEMP\\'.
base_dir: Path
# Absolute file name of the archive.
#
# For example, 'X:\\TEMP\\FOO.ZIP'.
archive_filepath: Path
# Absolute name of a file which acts as an indication of the fact that the
# archive is ready and is available for access.
#
# This is how synchronization between buildbot worker and signing server is
# done:
# - First, the archive is created under archive_filepath name.
# - Second, the indication file is created under ready_indicator_filepath
# name.
# - Third, the colleague of whoever created the indicator name watches for
# the indication file to appear, and once it's there it access the
# archive.
ready_indicator_filepath: Path
def __init__(
self, base_dir: Path, archive_name: str, ready_indicator_name: str):
"""
Construct the object from given base directory and name of the archive
file:
ArchiveWithIndicator(Path('X:\\TEMP'), 'FOO.ZIP', 'INPUT_READY')
"""
self.base_dir = base_dir
self.archive_filepath = self.base_dir / archive_name
self.ready_indicator_filepath = self.base_dir / ready_indicator_name
def is_ready(self) -> bool:
"""Check whether the archive is ready for access."""
return self.ready_indicator_filepath.exists()
def tag_ready(self) -> None:
"""
Tag the archive as ready by creating the corresponding indication file.
NOTE: It is expected that the archive was never tagged as ready before
and that there are no subsequent tags of the same archive.
If it is violated, an assert will fail.
"""
assert not self.is_ready()
self.ready_indicator_filepath.touch()
def clean(self) -> None:
"""
Remove both archive and the ready indication file.
"""
ensure_file_does_not_exist_or_die(self.ready_indicator_filepath)
ensure_file_does_not_exist_or_die(self.archive_filepath)
def is_fully_absent(self) -> bool:
"""
Check whether both archive and its ready indicator are absent.
Is used for a sanity check during code signing process by both
buildbot worker and signing server.
"""
return (not self.archive_filepath.exists() and
not self.ready_indicator_filepath.exists())

View File

@@ -0,0 +1,385 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Signing process overview.
#
# From buildbot worker side:
# - Files which needs to be signed are collected from either a directory to
# sign all signable files in there, or by filename of a single file to sign.
# - Those files gets packed into an archive and stored in a location location
# which is watched by the signing server.
# - A marker READY file is created which indicates the archive is ready for
# access.
# - Wait for the server to provide an archive with signed files.
# This is done by watching for the READY file which corresponds to an archive
# coming from the signing server.
# - Unpack the signed signed files from the archives and replace original ones.
#
# From code sign server:
# - Watch special location for a READY file which indicates the there is an
# archive with files which are to be signed.
# - Unpack the archive to a temporary location.
# - Run codesign tool and make sure all the files are signed.
# - Pack the signed files and store them in a location which is watched by
# the buildbot worker.
# - Create a READY file which indicates that the archive with signed files is
# ready.
import abc
import logging
import shutil
import time
import zipfile
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Iterable, List
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.archive_with_indicator import ArchiveWithIndicator
logger = logging.getLogger(__name__)
logger_builder = logger.getChild('builder')
logger_server = logger.getChild('server')
def pack_files(files: Iterable[AbsoluteAndRelativeFileName],
archive_filepath: Path) -> None:
"""
Create zip archive from given files for the signing pipeline.
Is used by buildbot worker to create an archive of files which are to be
signed, and by signing server to send signed files back to the worker.
"""
with zipfile.ZipFile(archive_filepath, 'w') as zip_file_handle:
for file_info in files:
zip_file_handle.write(file_info.absolute_filepath,
arcname=file_info.relative_filepath)
def extract_files(archive_filepath: Path,
extraction_dir: Path) -> None:
"""
Extract all files form the given archive into the given direcotry.
"""
# TODO(sergey): Verify files in the archive have relative path.
with zipfile.ZipFile(archive_filepath, mode='r') as zip_file_handle:
zip_file_handle.extractall(path=extraction_dir)
class BaseCodeSigner(metaclass=abc.ABCMeta):
"""
Base class for a platform-specific signer of binaries.
Contains all the logic shared across platform-specific implementations, such
as synchronization and notification logic.
Platform specific bits (such as actual command for signing the binary) are
to be implemented as a subclass.
Provides utilities code signing as a whole, including functionality needed
by a signing server and a buildbot worker.
The signer and builder may run on separate machines, the only requirement is
that they have access to a directory which is shared between them. For the
security concerns this is to be done as a separate machine (or as a Shared
Folder configuration in VirtualBox configuration). This directory might be
mounted under different base paths, but its underlying storage is to be
the same.
The code signer is short-lived on a buildbot worker side, and is living
forever on a code signing server side.
"""
# TODO(sergey): Find a neat way to have config annotated.
# config: Config
# Storage directory where builder puts files which are requested to be
# signed.
# Consider this an input of the code signing server.
unsigned_storage_dir: Path
# Information about archive which contains files which are to be signed.
#
# This archive is created by the buildbot worked and acts as an input for
# the code signing server.
unsigned_archive_info: ArchiveWithIndicator
# Storage where signed files are stored.
# Consider this an output of the code signer server.
signed_storage_dir: Path
# Information about archive which contains signed files.
#
# This archive is created by the code signing server.
signed_archive_info: ArchiveWithIndicator
def __init__(self, config):
self.config = config
absolute_shared_storage_dir = config.SHARED_STORAGE_DIR.resolve()
# Unsigned (signing server input) configuration.
self.unsigned_storage_dir = absolute_shared_storage_dir / 'unsigned'
self.unsigned_archive_info = ArchiveWithIndicator(
self.unsigned_storage_dir, 'unsigned_files.zip', 'ready.stamp')
# Signed (signing server output) configuration.
self.signed_storage_dir = absolute_shared_storage_dir / 'signed'
self.signed_archive_info = ArchiveWithIndicator(
self.signed_storage_dir, 'signed_files.zip', 'ready.stamp')
"""
General note on cleanup environment functions.
It is expected that there is only one instance of the code signer server
running for a given input/output directory, and that it serves a single
buildbot worker.
By its nature, a buildbot worker only produces one build at a time and
never performs concurrent builds.
This leads to a conclusion that when starting in a clean environment
there shouldn't be any archives remaining from a previous build.
However, it is possible to have various failure scenarios which might
leave the environment in a non-clean state:
- Network hiccup which makes buildbot worker to stop current build
and re-start it after connection to server is re-established.
Note, this could also happen during buildbot server maintenance.
- Signing server might get restarted due to updates or other reasons.
Requiring manual interaction in such cases is not something good to
require, so here we simply assume that the system is used the way it is
intended to and restore environment to a prestine clean state.
"""
def cleanup_environment_for_builder(self) -> None:
self.unsigned_archive_info.clean()
self.signed_archive_info.clean()
def cleanup_environment_for_signing_server(self) -> None:
# Don't clear the requested to-be-signed archive since we might be
# restarting signing machine while the buildbot is busy.
self.signed_archive_info.clean()
############################################################################
# Buildbot worker side helpers.
@abc.abstractmethod
def check_file_is_to_be_signed(
self, file: AbsoluteAndRelativeFileName) -> bool:
"""
Check whether file is to be signed.
Is used by both single file signing pipeline and recursive directory
signing pipeline.
This is where code signer is to check whether file is to be signed or
not. This check might be based on a simple extension test or on actual
test whether file have a digital signature already or not.
"""
def collect_files_to_sign(self, path: Path) \
-> List[AbsoluteAndRelativeFileName]:
"""
Get all files which need to be signed from the given path.
NOTE: The path might either be a file or directory.
This function is run from the buildbot worker side.
"""
# If there is a single file provided trust the buildbot worker that it
# is eligible for signing.
if path.is_file():
file = AbsoluteAndRelativeFileName.from_path(path)
if not self.check_file_is_to_be_signed(file):
return []
return [file]
all_files = AbsoluteAndRelativeFileName.recursively_from_directory(
path)
files_to_be_signed = [file for file in all_files
if self.check_file_is_to_be_signed(file)]
return files_to_be_signed
def wait_for_signed_archive_or_die(self) -> None:
"""
Wait until archive with signed files is available.
Will only wait for the configured time. If that time exceeds and there
is still no responce from the signing server the application will exit
with a non-zero exit code.
"""
timeout_in_seconds = self.config.TIMEOUT_IN_SECONDS
time_start = time.monotonic()
while not self.signed_archive_info.is_ready():
time.sleep(1)
time_slept_in_seconds = time.monotonic() - time_start
if time_slept_in_seconds > timeout_in_seconds:
self.unsigned_archive_info.clean()
raise SystemExit("Signing server didn't finish signing in "
f"{timeout_in_seconds} seconds, dying :(")
def copy_signed_files_to_directory(
self, signed_dir: Path, destination_dir: Path) -> None:
"""
Copy all files from signed_dir to destination_dir.
This function will overwrite any existing file. Permissions are copied
from the source files, but other metadata, such as timestamps, are not.
"""
for signed_filepath in signed_dir.glob('**/*'):
if not signed_filepath.is_file():
continue
relative_filepath = signed_filepath.relative_to(signed_dir)
destination_filepath = destination_dir / relative_filepath
destination_filepath.parent.mkdir(parents=True, exist_ok=True)
shutil.copy(signed_filepath, destination_filepath)
def run_buildbot_path_sign_pipeline(self, path: Path) -> None:
"""
Run all steps needed to make given path signed.
Path points to an unsigned file or a directory which contains unsigned
files.
If the path points to a single file then this file will be signed.
This is used to sign a final bundle such as .msi on Windows or .dmg on
macOS.
NOTE: The code signed implementation might actually reject signing the
file, in which case the file will be left unsigned. This isn't anything
to be considered a failure situation, just might happen when buildbot
worker can not detect whether signing is really required in a specific
case or not.
If the path points to a directory then code signer will sign all
signable files from it (finding them recursively).
"""
self.cleanup_environment_for_builder()
# Make sure storage directory exists.
self.unsigned_storage_dir.mkdir(parents=True, exist_ok=True)
# Collect all files which needs to be signed and pack them into a single
# archive which will be sent to the signing server.
logger_builder.info('Collecting files which are to be signed...')
files = self.collect_files_to_sign(path)
if not files:
logger_builder.info('No files to be signed, ignoring.')
return
logger_builder.info('Found %d files to sign.', len(files))
pack_files(files=files,
archive_filepath=self.unsigned_archive_info.archive_filepath)
self.unsigned_archive_info.tag_ready()
# Wait for the signing server to finish signing.
logger_builder.info('Waiting signing server to sign the files...')
self.wait_for_signed_archive_or_die()
# Extract signed files from archive and move files to final location.
with TemporaryDirectory(prefix='blender-buildbot-') as temp_dir_str:
unpacked_signed_files_dir = Path(temp_dir_str)
logger_builder.info('Extracting signed files from archive...')
extract_files(
archive_filepath=self.signed_archive_info.archive_filepath,
extraction_dir=unpacked_signed_files_dir)
destination_dir = path
if destination_dir.is_file():
destination_dir = destination_dir.parent
self.copy_signed_files_to_directory(
unpacked_signed_files_dir, destination_dir)
############################################################################
# Signing server side helpers.
def wait_for_sign_request(self) -> None:
"""
Wait for the buildbot to request signing of an archive.
"""
# TOOD(sergey): Support graceful shutdown on Ctrl-C.
while not self.unsigned_archive_info.is_ready():
time.sleep(1)
@abc.abstractmethod
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
"""
Sign all files in the given directory.
NOTE: Signing should happen in-place.
"""
def run_signing_pipeline(self):
"""
Run the full signing pipeline starting from the point when buildbot
worker have requested signing.
"""
# Make sure storage directory exists.
self.signed_storage_dir.mkdir(parents=True, exist_ok=True)
with TemporaryDirectory(prefix='blender-codesign-') as temp_dir_str:
temp_dir = Path(temp_dir_str)
logger_server.info('Extracting unsigned files from archive...')
extract_files(
archive_filepath=self.unsigned_archive_info.archive_filepath,
extraction_dir=temp_dir)
logger_server.info('Collecting all files which needs signing...')
files = AbsoluteAndRelativeFileName.recursively_from_directory(
temp_dir)
logger_server.info('Signing all requested files...')
self.sign_all_files(files)
logger_server.info('Packing signed files...')
pack_files(files=files,
archive_filepath=self.signed_archive_info.archive_filepath)
self.signed_archive_info.tag_ready()
logger_server.info('Removing signing request...')
self.unsigned_archive_info.clean()
logger_server.info('Signing is complete.')
def run_signing_server(self):
logger_server.info('Starting new code signing server...')
self.cleanup_environment_for_signing_server()
logger_server.info('Code signing server is ready')
while True:
logger_server.info('Waiting for the signing request in %s...',
self.unsigned_storage_dir)
self.wait_for_sign_request()
logger_server.info(
'Got signing request, beging signign procedure.')
self.run_signing_pipeline()

View File

@@ -0,0 +1,57 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Configuration of a code signer which is specific to the code running from
# buildbot's worker.
import sys
from pathlib import Path
from codesign.config_common import *
if sys.platform == 'linux':
SHARED_STORAGE_DIR = Path('/data/codesign')
elif sys.platform == 'win32':
SHARED_STORAGE_DIR = Path('Z:\\codesign')
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
LOGGING = {
'version': 1,
'formatters': {
'default': {'format': '%(asctime)-15s %(levelname)8s %(name)s %(message)s'}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'default',
'stream': 'ext://sys.stderr',
}
},
'loggers': {
'codesign': {'level': 'INFO'},
},
'root': {
'level': 'WARNING',
'handlers': [
'console',
],
}
}

View File

@@ -0,0 +1,33 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
from pathlib import Path
# Timeout in seconds for the signing process.
#
# This is how long buildbot packing step will wait signing server to
# perform signing.
TIMEOUT_IN_SECONDS = 240
# Directory which is shared across buildbot worker and signing server.
#
# This is where worker puts files requested for signing as well as where
# server puts signed files.
SHARED_STORAGE_DIR: Path

View File

@@ -0,0 +1,63 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Configuration of a code signer which is specific to the code signing server.
#
# NOTE: DO NOT put any sensitive information here, put it in an actual
# configuration on the signing machine.
from pathlib import Path
from codesign.config_common import *
# URL to the timestamping authority.
TIMESTAMP_AUTHORITY_URL = 'http://timestamp.digicert.com'
# Full path to the certificate used for signing.
#
# The path and expected file format might vary depending on a platform.
#
# On Windows it is usually is a PKCS #12 key (.pfx), so the path will look
# like Path('C:\\Secret\\Blender.pfx').
CERTIFICATE_FILEPATH: Path
# https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema
LOGGING = {
'version': 1,
'formatters': {
'default': {'format': '%(asctime)-15s %(levelname)8s %(name)s %(message)s'}
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'default',
'stream': 'ext://sys.stderr',
}
},
'loggers': {
'codesign': {'level': 'INFO'},
},
'root': {
'level': 'WARNING',
'handlers': [
'console',
],
}
}

View File

@@ -0,0 +1,72 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# NOTE: This is a no-op signer (since there isn't really a procedure to sign
# Linux binaries yet). Used to debug and verify the code signing routines on
# a Linux environment.
import logging
from pathlib import Path
from typing import List
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.base_code_signer import BaseCodeSigner
logger = logging.getLogger(__name__)
logger_server = logger.getChild('server')
class LinuxCodeSigner(BaseCodeSigner):
def is_active(self) -> bool:
"""
Check whether this signer is active.
if it is inactive, no files will be signed.
Is used to be able to debug code signing pipeline on Linux, where there
is no code signing happening in the actual buildbot and release
environment.
"""
return False
def check_file_is_to_be_signed(
self, file: AbsoluteAndRelativeFileName) -> bool:
if file.relative_filepath == Path('blender'):
return True
if (file.relative_filepath.parts()[-3:-1] == ('python', 'bin') and
file.relative_filepath.name.startwith('python')):
return True
if file.relative_filepath.suffix == '.so':
return True
return False
def collect_files_to_sign(self, path: Path) \
-> List[AbsoluteAndRelativeFileName]:
if not self.is_active():
return []
return super().collect_files_to_sign(path)
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
num_files = len(files)
for file_index, file in enumerate(files):
logger.info('Server: Signed file [%d/%d] %s',
file_index + 1, num_files, file.relative_filepath)

View File

@@ -0,0 +1,47 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import logging.config
import sys
from pathlib import Path
from typing import Optional
import codesign.config_builder
from codesign.base_code_signer import BaseCodeSigner
class SimpleCodeSigner:
code_signer: Optional[BaseCodeSigner]
def __init__(self):
if sys.platform == 'linux':
from codesign.linux_code_signer import LinuxCodeSigner
self.code_signer = LinuxCodeSigner(codesign.config_builder)
elif sys.platform == 'win32':
from codesign.windows_code_signer import WindowsCodeSigner
self.code_signer = WindowsCodeSigner(codesign.config_builder)
else:
self.code_signer = None
def sign_file_or_directory(self, path: Path) -> None:
logging.config.dictConfig(codesign.config_builder.LOGGING)
self.code_signer.run_buildbot_path_sign_pipeline(path)

View File

@@ -0,0 +1,35 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
from pathlib import Path
def ensure_file_does_not_exist_or_die(filepath: Path) -> None:
"""
If the file exists, unlink it.
If the file path exists and is not a file an assert will trigger.
If the file path does not exists nothing happens.
"""
if not filepath.exists():
return
if not filepath.is_file():
# TODO(sergey): Provide information about what the filepath actually is.
raise SystemExit(f'{filepath} is expected to be a file, but is not')
filepath.unlink()

View File

@@ -0,0 +1,75 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import logging
import subprocess
from pathlib import Path
from typing import List
from buildbot_utils import Builder
from codesign.absolute_and_relative_filename import AbsoluteAndRelativeFileName
from codesign.base_code_signer import BaseCodeSigner
logger = logging.getLogger(__name__)
logger_server = logger.getChild('server')
# NOTE: Check is done as filename.endswith(), so keep the dot
EXTENSIONS_TO_BE_SIGNED = {'.exe', '.dll', '.pyd', '.msi'}
BLACKLIST_FILE_PREFIXES = (
'api-ms-', 'concrt', 'msvcp', 'ucrtbase', 'vcomp', 'vcruntime')
class WindowsCodeSigner(BaseCodeSigner):
def check_file_is_to_be_signed(
self, file: AbsoluteAndRelativeFileName) -> bool:
base_name = file.relative_filepath.name
if any(base_name.startswith(prefix)
for prefix in BLACKLIST_FILE_PREFIXES):
return False
return file.relative_filepath.suffix in EXTENSIONS_TO_BE_SIGNED
def get_sign_command_prefix(self) -> List[str]:
return [
'signtool', 'sign', '/v',
'/f', self.config.CERTIFICATE_FILEPATH,
'/t', self.config.TIMESTAMP_AUTHORITY_URL]
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
# NOTE: Sign files one by one to avoid possible command line length
# overflow (which could happen if we ever decide to sign every binary
# in the install folder, for example).
#
# TODO(sergey): Consider doing batched signing of handful of files in
# one go (but only if this actually known to be much faster).
num_files = len(files)
for file_index, file in enumerate(files):
command = self.get_sign_command_prefix()
command.append(file.absolute_filepath)
logger_server.info(
'Running signtool command for file [%d/%d] %s...',
file_index + 1, num_files, file.relative_filepath)
# TODO(sergey): Check the status somehow. With a missing certificate
# the command still exists with a zero code.
subprocess.run(command)
# TODO(sergey): Report number of signed and ignored files.

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# NOTE: This is a no-op signer (since there isn't really a procedure to sign
# Linux binaries yet). Used to debug and verify the code signing routines on
# a Linux environment.
import logging.config
from pathlib import Path
from typing import List
from codesign.linux_code_signer import LinuxCodeSigner
import codesign.config_server
if __name__ == "__main__":
logging.config.dictConfig(codesign.config_server.LOGGING)
code_signer = LinuxCodeSigner(codesign.config_server)
code_signer.run_signing_server()

View File

@@ -0,0 +1,11 @@
@echo off
rem This is an entry point of the codesign server for Windows.
rem It makes sure that signtool.exe is within the current PATH and can be
rem used by the Python script.
SETLOCAL
set PATH=C:\Program Files (x86)\Windows Kits\10\App Certification Kit;%PATH%
codesign_server_windows.py

View File

@@ -0,0 +1,44 @@
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Implementation of codesign server for Windows.
#
# NOTE: If signtool.exe is not in the PATH use codesign_server_windows.bat
import logging.config
import shutil
from pathlib import Path
from typing import List
from codesign.windows_code_signer import WindowsCodeSigner
import codesign.config_server
if __name__ == "__main__":
# TODO(sergey): Consider moving such sanity checks into
# CodeSigner.check_environment_or_die().
if not shutil.which('signtool.exe'):
raise SystemExit("signtool.exe is not found in %PATH%")
logging.config.dictConfig(codesign.config_server.LOGGING)
code_signer = WindowsCodeSigner(codesign.config_server)
code_signer.run_signing_server()

View File

@@ -2,33 +2,22 @@
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
# For libc-2.24 we are using chroot which runs on a 64bit system.
# There we can not use CPU bitness check since it is always 64bit. So instead
# we check for a specific libraries.
#
# Other builders we are runnign in a bare virtual machine, and the libraries
# are installed to /opt/.
# We assume that only 64bit builders exists in such configuration.
if(EXISTS "/lib/x86_64-linux-gnu/libc-2.24.so")
message(STATUS "Building in GLibc-2.24 environment")
set(LIBDIR_NAME "linux_x86_64")
elseif(EXISTS "/lib/i386-linux-gnu//libc-2.24.so")
message(STATUS "Building in GLibc-2.24 environment")
set(LIBDIR_NAME "linux_i686")
else()
message(STATUS "Building in generic 64bit environment")
set(LIBDIR_NAME "linux_x86_64")
endif()
message(STATUS "Building in CentOS 7 64bit environment")
set(LIBDIR_NAME "linux_centos7_x86_64")
set(WITH_CXX11_ABI OFF CACHE BOOL "" FORCE)
# Default to only build Blender
set(WITH_BLENDER ON CACHE BOOL "" FORCE)
# ######## Linux-specific build options ########
# Options which are specific to Linux-only platforms
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
# ######## Official release-specific build options ########
# Options which are specific to Linux release builds only
set(WITH_JACK_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SDL_DYNLOAD ON CACHE BOOL "" FORCE)
set(WITH_SYSTEM_GLEW OFF CACHE BOOL "" FORCE)
@@ -40,7 +29,7 @@ set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
# ######## Release environment specific settings ########
set(LIBDIR "/opt/blender-deps/${LIBDIR_NAME}" CACHE BOOL "" FORCE)
set(LIBDIR "${CMAKE_CURRENT_LIST_DIR}/../../../../lib/${LIBDIR_NAME}" CACHE STRING "" FORCE)
# Platform specific configuration, to ensure static linking against everything.

View File

@@ -0,0 +1,44 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# This is a script which is used as POST-INSTALL one for regular CMake's
# INSTALL target.
# It is used by buildbot workers to sign every binary which is going into
# the final buundle.
# On Windows Python 3 there only is python.exe, no python3.exe.
#
# On other platforms it is possible to have python2 and python3, and a
# symbolic link to python to either of them. So on those platforms use
# an explicit Python version.
if(WIN32)
set(PYTHON_EXECUTABLE python)
else()
set(PYTHON_EXECUTABLE python3)
endif()
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/slave_codesign.py"
"${CMAKE_INSTALL_PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE exit_code
)
if(NOT exit_code EQUAL "0")
message( FATAL_ERROR "Non-zero exit code of codesign tool")
endif()

View File

@@ -0,0 +1,74 @@
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# Helper script which takes care of signing provided location.
#
# The location can either be a directory (in which case all eligible binaries
# will be signed) or a single file (in which case a single file will be signed).
#
# This script takes care of all the complexity of communicating between process
# which requests file to be signed and the code signing server.
#
# NOTE: Signing happens in-place.
import argparse
import sys
from pathlib import Path
from codesign.simple_code_signer import SimpleCodeSigner
def create_argument_parser():
parser = argparse.ArgumentParser()
parser.add_argument('path_to_sign', type=Path)
return parser
def main():
parser = create_argument_parser()
args = parser.parse_args()
path_to_sign = args.path_to_sign
if sys.platform == 'win32':
# When WIX packed is used to generate .msi on Windows the CPack will
# install two different projects and install them to different
# installation prefix:
#
# - C:\b\build\_CPack_Packages\WIX\Blender
# - C:\b\build\_CPack_Packages\WIX\Unspecified
#
# Annoying part is: CMake's post-install script will only be run
# once, with the install prefix which corresponds to a project which
# was installed last. But we want to sign binaries from all projects.
# So in order to do so we detect that we are running for a CPack's
# project used for WIX and force parent directory (which includes both
# projects) to be signed.
#
# Here we force both projects to be signed.
if path_to_sign.name == 'Unspecified' and 'WIX' in str(path_to_sign):
path_to_sign = path_to_sign.parent
code_signer = SimpleCodeSigner()
code_signer.sign_file_or_directory(path_to_sign)
if __name__ == "__main__":
main()

View File

@@ -19,148 +19,98 @@
# <pep8 compliant>
import os
import subprocess
import sys
import shutil
# get builder name
if len(sys.argv) < 2:
sys.stderr.write("Not enough arguments, expecting builder name\n")
sys.exit(1)
import buildbot_utils
builder = sys.argv[1]
def get_cmake_options(builder):
post_install_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'slave_codesign.cmake')
# we run from build/ directory
blender_dir = os.path.join('..', 'blender.git')
config_file = "build_files/cmake/config/blender_release.cmake"
options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
'-DWITH_GTESTS=ON']
if builder.platform == 'mac':
options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.platform == 'win':
options.extend(['-G', 'Visual Studio 15 2017 Win64'])
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"
def parse_header_file(filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
if match:
return match.group(1)
return None
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
if 'cmake' in builder:
# cmake
options.append("-C" + os.path.join(builder.blender_dir, config_file))
options.append("-DCMAKE_INSTALL_PREFIX=%s" % (builder.install_dir))
# Some fine-tuning configuration
blender_dir = os.path.abspath(blender_dir)
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
install_dir = os.path.abspath(os.path.join('..', 'install', builder))
targets = ['blender']
command_prefix = []
return options
bits = 64
def update_git(builder):
# Do extra git fetch because not all platform/git/buildbot combinations
# update the origin remote, causing buildinfo to detect local changes.
os.chdir(builder.blender_dir)
# Config file to be used (relative to blender's sources root)
cmake_config_file = "build_files/cmake/config/blender_release.cmake"
# Set build options.
cmake_options = []
cmake_extra_options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
'-DWITH_GTESTS=ON']
if builder.startswith('mac'):
# Set up OSX architecture
if builder.endswith('x86_64_10_9_cmake'):
cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.startswith('win'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 15 2017 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 15 2017'])
elif builder.startswith('linux'):
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
tokens = builder.split("_")
glibc = tokens[1]
if glibc == 'glibc224':
deb_name = "stretch"
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
elif builder.endswith('i686_cmake'):
bits = 32
chroot_name = 'buildbot_' + deb_name + '_i686'
command_prefix = ['schroot', '-c', chroot_name, '--']
elif glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file))
# Prepare CMake options needed to configure cuda binaries compilation, 64bit only.
if bits == 64:
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=ON")
cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=ON")
else:
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=OFF")
cmake_options.append("-DCMAKE_INSTALL_PREFIX=%s" % (install_dir))
cmake_options += cmake_extra_options
print("Fetching remotes")
command = ['git', 'fetch', '--all']
buildbot_utils.call(builder.command_prefix + command)
def clean_directories(builder):
# Make sure no garbage remained from the previous run
if os.path.isdir(install_dir):
shutil.rmtree(install_dir)
if os.path.isdir(builder.install_dir):
shutil.rmtree(builder.install_dir)
for target in targets:
print("Building target %s" % (target))
# Construct build directory name based on the target
target_build_dir = build_dir
target_command_prefix = command_prefix[:]
if target != 'blender':
target_build_dir += '_' + target
target_name = 'install'
# Tweaking CMake options to respect the target
target_cmake_options = cmake_options[:]
# Do extra git fetch because not all platform/git/buildbot combinations
# update the origin remote, causing buildinfo to detect local changes.
os.chdir(blender_dir)
print("Fetching remotes")
command = ['git', 'fetch', '--all']
print(command)
retcode = subprocess.call(target_command_prefix + command)
if retcode != 0:
sys.exit(retcode)
# Make sure build directory exists and enter it
if not os.path.isdir(target_build_dir):
os.mkdir(target_build_dir)
os.chdir(target_build_dir)
# Configure the build
print("CMake options:")
print(target_cmake_options)
if os.path.exists('CMakeCache.txt'):
print("Removing CMake cache")
os.remove('CMakeCache.txt')
# Remove buildinfo files to force buildbot to re-generate them.
for buildinfo in ('buildinfo.h', 'buildinfo.h.txt', ):
full_path = os.path.join('source', 'creator', buildinfo)
if os.path.exists(full_path):
print("Removing {}" . format(buildinfo))
os.remove(full_path)
retcode = subprocess.call(target_command_prefix + ['cmake', blender_dir] + target_cmake_options)
if retcode != 0:
print('Configuration FAILED!')
sys.exit(retcode)
# Make sure build directory exists and enter it
os.makedirs(builder.build_dir, exist_ok=True)
if 'win32' in builder or 'win64' in builder:
command = ['cmake', '--build', '.', '--target', target_name, '--config', 'Release']
else:
command = ['make', '-s', '-j2', target_name]
# Remove buildinfo files to force buildbot to re-generate them.
for buildinfo in ('buildinfo.h', 'buildinfo.h.txt', ):
full_path = os.path.join(builder.build_dir, 'source', 'creator', buildinfo)
if os.path.exists(full_path):
print("Removing {}" . format(buildinfo))
os.remove(full_path)
print("Executing command:")
print(command)
retcode = subprocess.call(target_command_prefix + command)
def cmake_configure(builder):
# CMake configuration
os.chdir(builder.build_dir)
if retcode != 0:
sys.exit(retcode)
cmake_cache = os.path.join(builder.build_dir, 'CMakeCache.txt')
if os.path.exists(cmake_cache):
print("Removing CMake cache")
os.remove(cmake_cache)
else:
print("Unknown building system")
sys.exit(1)
print("CMake configure:")
cmake_options = get_cmake_options(builder)
command = ['cmake', builder.blender_dir] + cmake_options
buildbot_utils.call(builder.command_prefix + command)
def cmake_build(builder):
# CMake build
os.chdir(builder.build_dir)
# NOTE: CPack will build an INSTALL target, which would mean that code
# signing will happen twice when using `make install` and CPack.
# The tricky bit here is that it is not possible to know whether INSTALL
# target is used by CPack or by a buildbot itaself. Extra level on top of
# this is that on Windows it is required to build INSTALL target in order
# to have unit test binaries to run.
# So on the one hand we do an extra unneeded code sign on Windows, but on
# a positive side we don't add complexity and don't make build process more
# fragile trying to avoid this. The signing process is way faster than just
# a clean build of buildbot, especially with regression tests enabled.
if builder.platform == 'win':
command = ['cmake', '--build', '.', '--target', 'install', '--config', 'Release']
else:
command = ['make', '-s', '-j2', 'install']
print("CMake build:")
buildbot_utils.call(builder.command_prefix + command)
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
update_git(builder)
clean_directories(builder)
cmake_configure(builder)
cmake_build(builder)

View File

@@ -23,46 +23,46 @@
# to the master in the next buildbot step.
import os
import subprocess
import sys
import zipfile
# get builder name
if len(sys.argv) < 2:
sys.stderr.write("Not enough arguments, expecting builder name\n")
sys.exit(1)
from pathlib import Path
builder = sys.argv[1]
# Never write branch if it is master.
branch = sys.argv[2] if (len(sys.argv) >= 3 and sys.argv[2] != 'master') else ''
import buildbot_utils
blender_dir = os.path.join('..', 'blender.git')
build_dir = os.path.join('..', 'build', builder)
install_dir = os.path.join('..', 'install', builder)
buildbot_upload_zip = os.path.abspath(os.path.join(os.path.dirname(install_dir), "buildbot_upload.zip"))
def get_package_name(builder, platform=None):
info = buildbot_utils.VersionInfo(builder)
upload_filename = None # Name of the archive to be uploaded
# (this is the name of archive which will appear on the
# download page)
upload_filepath = None # Filepath to be uploaded to the server
# (this folder will be packed)
package_name = 'blender-' + info.full_version
if platform:
package_name += '-' + platform
if not (builder.branch == 'master' or builder.is_release_branch):
if info.is_development_build:
package_name = builder.branch + "-" + package_name
return package_name
def sign_file_or_directory(path):
from codesign.simple_code_signer import SimpleCodeSigner
code_signer = SimpleCodeSigner()
code_signer.sign_file_or_directory(Path(path))
def parse_header_file(filename, define):
import re
regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
if match:
return match.group(1)
return None
def create_buildbot_upload_zip(builder, package_files):
import zipfile
buildbot_upload_zip = os.path.join(builder.upload_dir, "buildbot_upload.zip")
if os.path.exists(buildbot_upload_zip):
os.remove(buildbot_upload_zip)
# Make sure install directory always exists
if not os.path.exists(install_dir):
os.makedirs(install_dir)
try:
z = zipfile.ZipFile(buildbot_upload_zip, "w", compression=zipfile.ZIP_STORED)
for filepath, filename in package_files:
print("Packaged", filename)
z.write(filepath, arcname=filename)
z.close()
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed: ' + str(ex) + '\n')
sys.exit(1)
def create_tar_bz2(src, dest, package_name):
# One extra to remove leading os.sep when cleaning root for package_root
@@ -80,163 +80,108 @@ def create_tar_bz2(src, dest, package_name):
package.add(entry[0], entry[1], recursive=False)
package.close()
if builder.find('cmake') != -1:
# CMake
if 'win' in builder or 'mac' in builder:
os.chdir(build_dir)
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
for f in files:
os.remove(f)
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
# TODO(sergey): Such magic usually happens in SCon's packaging but we don't have it
# in the CMake yet. For until then we do some magic here.
tokens = result_file.split('-')
blender_version = tokens[1].split('.')
blender_full_version = '.'.join(blender_version[0:2])
git_hash = tokens[2].split('.')[1]
platform = builder.split('_')[0]
if platform == 'mac':
# Special exception for OSX
platform = 'OSX-10.9-'
if builder.endswith('x86_64_10_9_cmake'):
platform += 'x86_64'
if builder.endswith('vc2015'):
platform += "-vc14"
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
# NOTE: Blender 2.7 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.7':
builderified_name = branch + "-" + builderified_name
os.rename(result_file, "{}.zip".format(builderified_name))
# create zip file
try:
if os.path.exists(buildbot_upload_zip):
os.remove(buildbot_upload_zip)
z = zipfile.ZipFile(buildbot_upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write("{}.zip".format(builderified_name))
z.close()
sys.exit(retcode)
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1)
elif builder.startswith('linux_'):
blender = os.path.join(install_dir, 'blender')
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")
# Get version information
blender_version = int(parse_header_file(blender_h, 'BLENDER_VERSION'))
blender_version = "%d.%d" % (blender_version // 100, blender_version % 100)
blender_hash = parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
blender_glibc = builder.split('_')[1]
command_prefix = []
bits = 64
blender_arch = 'x86_64'
if blender_glibc == 'glibc224':
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_stretch_x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_stretch_i686'
bits = 32
blender_arch = 'i686'
command_prefix = ['schroot', '-c', chroot_name, '--']
elif blender_glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
# Strip all unused symbols from the binaries
print("Stripping binaries...")
subprocess.call(command_prefix + ['strip', '--strip-all', blender])
print("Stripping python...")
py_target = os.path.join(install_dir, blender_version)
subprocess.call(command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
# Copy all specific files which are too specific to be copied by
# the CMake rules themselves
print("Copying extra scripts and libs...")
extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra')
mesalibs = os.path.join(extra, 'mesalibs' + str(bits) + '.tar.bz2')
software_gl = os.path.join(blender_dir, 'release', 'bin', 'blender-softwaregl')
icons = os.path.join(blender_dir, 'release', 'freedesktop', 'icons')
os.system('tar -xpf %s -C %s' % (mesalibs, install_dir))
os.system('cp %s %s' % (software_gl, install_dir))
os.system('cp -r %s %s' % (icons, install_dir))
os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl')))
# Construct archive name
package_name = 'blender-%s-%s-linux-%s-%s' % (blender_version,
blender_hash,
blender_glibc,
blender_arch)
# NOTE: Blender 2.7 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.7':
package_name = branch + "-" + package_name
upload_filename = package_name + ".tar.bz2"
print("Creating .tar.bz2 archive")
upload_filepath = install_dir + '.tar.bz2'
create_tar_bz2(install_dir, upload_filepath, package_name)
else:
print("Unknown building system")
sys.exit(1)
def cleanup_files(dirpath, extension):
for f in os.listdir(dirpath):
filepath = os.path.join(dirpath, f)
if os.path.isfile(filepath) and f.endswith(extension):
os.remove(filepath)
if upload_filepath is None:
# clean release directory if it already exists
release_dir = 'release'
def pack_mac(builder):
info = buildbot_utils.VersionInfo(builder)
if os.path.exists(release_dir):
for f in os.listdir(release_dir):
if os.path.isfile(os.path.join(release_dir, f)):
os.remove(os.path.join(release_dir, f))
os.chdir(builder.build_dir)
cleanup_files(builder.build_dir, '.dmg')
# create release package
try:
subprocess.call(['make', 'package_archive'])
except Exception as ex:
sys.stderr.write('Make package release failed' + str(ex) + '\n')
sys.exit(1)
package_name = get_package_name(builder, 'macOS')
package_filename = package_name + '.dmg'
package_filepath = os.path.join(builder.build_dir, package_filename)
# find release directory, must exist this time
if not os.path.exists(release_dir):
sys.stderr.write("Failed to find release directory %r.\n" % release_dir)
sys.exit(1)
release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
bundle_sh = os.path.join(release_dir, 'bundle.sh')
# find release package
file = None
filepath = None
command = [bundle_sh]
command += ['--source', builder.install_dir]
command += ['--dmg', package_filepath]
if info.is_development_build:
background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
command += ['--background-image', background_image]
buildbot_utils.call(command)
for f in os.listdir(release_dir):
rf = os.path.join(release_dir, f)
if os.path.isfile(rf) and f.startswith('blender'):
file = f
filepath = rf
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
if not file:
sys.stderr.write("Failed to find release package.\n")
sys.exit(1)
upload_filename = file
upload_filepath = filepath
def pack_win(builder):
info = buildbot_utils.VersionInfo(builder)
# create zip file
try:
upload_zip = os.path.join(buildbot_upload_zip)
if os.path.exists(upload_zip):
os.remove(upload_zip)
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write(upload_filepath, arcname=upload_filename)
z.close()
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1)
os.chdir(builder.build_dir)
cleanup_files(builder.build_dir, '.zip')
# CPack will add the platform name
cpack_name = get_package_name(builder, None)
package_name = get_package_name(builder, 'windows' + str(builder.bits))
command = ['cmake', '-DCPACK_OVERRIDE_PACKAGENAME:STRING=' + cpack_name, '.']
buildbot_utils.call(builder.command_prefix + command)
command = ['cpack', '-G', 'ZIP']
buildbot_utils.call(builder.command_prefix + command)
package_filename = package_name + '.zip'
package_filepath = os.path.join(builder.build_dir, package_filename)
package_files = [(package_filepath, package_filename)]
if info.version_cycle == 'release':
# Installer only for final release builds, otherwise will get
# 'this product is already installed' messages.
command = ['cpack', '-G', 'WIX']
buildbot_utils.call(builder.command_prefix + command)
package_filename = package_name + '.msi'
package_filepath = os.path.join(builder.build_dir, package_filename)
sign_file_or_directory(package_filepath)
package_files += [(package_filepath, package_filename)]
create_buildbot_upload_zip(builder, package_files)
def pack_linux(builder):
blender_executable = os.path.join(builder.install_dir, 'blender')
info = buildbot_utils.VersionInfo(builder)
blender_glibc = builder.name.split('_')[1]
blender_arch = 'x86_64'
# Strip all unused symbols from the binaries
print("Stripping binaries...")
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
print("Stripping python...")
py_target = os.path.join(builder.install_dir, info.version)
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
# Construct package name
platform_name = 'linux-' + blender_glibc + '-' + blender_arch
package_name = get_package_name(builder, platform_name)
package_filename = package_name + ".tar.bz2"
print("Creating .tar.bz2 archive")
package_filepath = builder.install_dir + '.tar.bz2'
create_tar_bz2(builder.install_dir, package_filepath, package_name)
# Create buildbot_upload.zip
create_buildbot_upload_zip(builder, [(package_filepath, package_filename)])
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
# Make sure install directory always exists
os.makedirs(builder.install_dir, exist_ok=True)
if builder.platform == 'mac':
pack_mac(builder)
elif builder.platform == 'win':
pack_win(builder)
elif builder.platform == 'linux':
pack_linux(builder)

View File

@@ -21,23 +21,17 @@
# Runs on buildbot slave, rsync zip directly to buildbot server rather
# than using upload which is much slower
import buildbot_utils
import os
import sys
# get builder name
if len(sys.argv) < 2:
sys.stderr.write("Not enough arguments, expecting builder name\n")
sys.exit(1)
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
builder = sys.argv[1]
# rsync, this assumes ssh keys are setup so no password is needed
local_zip = "buildbot_upload.zip"
remote_folder = "builder.blender.org:/data/buildbot-master/uploaded/"
remote_zip = remote_folder + "buildbot_upload_" + builder.name + ".zip"
# rsync, this assumes ssh keys are setup so no password is needed
local_zip = "buildbot_upload.zip"
remote_folder = "builder.blender.org:/data/buildbot-master/uploaded/"
remote_zip = remote_folder + "buildbot_upload_" + builder + ".zip"
command = "rsync -avz %s %s" % (local_zip, remote_zip)
print(command)
ret = os.system(command)
sys.exit(ret)
command = ["rsync", "-avz", local_zip, remote_zip]
buildbot_utils.call(command)

View File

@@ -18,59 +18,22 @@
# <pep8 compliant>
import subprocess
import buildbot_utils
import os
import sys
# get builder name
if len(sys.argv) < 2:
sys.stderr.write("Not enough arguments, expecting builder name\n")
sys.exit(1)
def get_ctest_arguments(builder):
args = ['--output-on-failure']
if builder.platform == 'win':
args += ['-C', 'Release']
return args
builder = sys.argv[1]
def test(builder):
os.chdir(builder.build_dir)
# we run from build/ directory
blender_dir = '../blender.git'
command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
buildbot_utils.call(command)
if "cmake" in builder:
print("Automated tests are still DISABLED!")
sys.exit(0)
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
install_dir = os.path.abspath(os.path.join('..', 'install', builder))
# NOTE: For quick test only to see if the approach work.
# n the future must be replaced with an actual blender version.
blender_version = '2.80'
blender_version_dir = os.path.join(install_dir, blender_version)
command_prefix = []
extra_ctest_args = []
if builder.startswith('win'):
extra_ctest_args += ['-C', 'Release']
elif builder.startswith('linux'):
tokens = builder.split("_")
glibc = tokens[1]
if glibc == 'glibc224':
deb_name = "stretch"
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_' + deb_name + '_i686'
command_prefix = ['schroot', '--preserve-environment', '-c', chroot_name, '--']
elif glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
ctest_env = os.environ.copy()
ctest_env['BLENDER_SYSTEM_SCRIPTS'] = os.path.join(blender_version_dir, 'scripts')
ctest_env['BLENDER_SYSTEM_DATAFILES'] = os.path.join(blender_version_dir, 'datafiles')
os.chdir(build_dir)
retcode = subprocess.call(command_prefix + ['ctest', '--output-on-failure'] + extra_ctest_args,
env=ctest_env)
# Always exit with a success, for until we know all the tests are passing
# on all builders.
sys.exit(0)
else:
print("Unknown building system")
sys.exit(1)
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
test(builder)

View File

@@ -0,0 +1,31 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import buildbot_utils
import os
import sys
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
os.chdir(builder.blender_dir)
# Run make update which handles all libraries and submodules.
make_update = os.path.join(builder.blender_dir, "build_files", "utils", "make_update.py")
buildbot_utils.call([sys.executable, make_update, '--no-blender', "--use-tests", "--use-centos-libraries"])

View File

@@ -38,14 +38,14 @@ SET(_icu_SEARCH_DIRS
)
# We don't need includes, only libs to link against...
#FIND_PATH(ICU_INCLUDE_DIR
# NAMES
# utf.h
# HINTS
# ${_icu_SEARCH_DIRS}
# PATH_SUFFIXES
# include/unicode
#)
# FIND_PATH(ICU_INCLUDE_DIR
# NAMES
# utf.h
# HINTS
# ${_icu_SEARCH_DIRS}
# PATH_SUFFIXES
# include/unicode
# )
FIND_LIBRARY(ICU_LIBRARY_DATA
NAMES

View File

@@ -0,0 +1,122 @@
# - Find OpenImageDenoise library
# Find the native OpenImageDenoise includes and library
# This module defines
# OPENIMAGEDENOISE_INCLUDE_DIRS, where to find oidn.h, Set when
# OPENIMAGEDENOISE is found.
# OPENIMAGEDENOISE_LIBRARIES, libraries to link against to use OpenImageDenoise.
# OPENIMAGEDENOISE_ROOT_DIR, The base directory to search for OpenImageDenoise.
# This can also be an environment variable.
# OPENIMAGEDENOISE_FOUND, If false, do not try to use OpenImageDenoise.
#
# also defined, but not for general use are
# OPENIMAGEDENOISE_LIBRARY, where to find the OpenImageDenoise library.
#=============================================================================
# Copyright 2019 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 OPENIMAGEDENOISE_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENIMAGEDENOISE_ROOT_DIR AND NOT $ENV{OPENIMAGEDENOISE_ROOT_DIR} STREQUAL "")
SET(OPENIMAGEDENOISE_ROOT_DIR $ENV{OPENIMAGEDENOISE_ROOT_DIR})
ENDIF()
SET(_openimagedenoise_SEARCH_DIRS
${OPENIMAGEDENOISE_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/openimagedenoise
)
FIND_PATH(OPENIMAGEDENOISE_INCLUDE_DIR
NAMES
OpenImageDenoise/oidn.h
HINTS
${_openimagedenoise_SEARCH_DIRS}
PATH_SUFFIXES
include
)
SET(_openimagedenoise_FIND_COMPONENTS
OpenImageDenoise
)
# These are needed when building statically
SET(_openimagedenoise_FIND_STATIC_COMPONENTS
common
mkldnn
)
SET(_openimagedenoise_LIBRARIES)
FOREACH(COMPONENT ${_openimagedenoise_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_openimagedenoise_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
LIST(APPEND _openimagedenoise_LIBRARIES "${OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FOREACH(COMPONENT ${_openimagedenoise_FIND_STATIC_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_openimagedenoise_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
MARK_AS_ADVANCED(OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY)
IF(OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _openimagedenoise_LIBRARIES "${OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY}")
ENDIF()
ENDFOREACH()
FIND_LIBRARY(OPENIMAGEDENOISE_LIBRARY
NAMES
OpenImageDenoise
HINTS
${_openimagedenoise_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEDENOISE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENIMAGEDENOISE DEFAULT_MSG
OPENIMAGEDENOISE_LIBRARY OPENIMAGEDENOISE_INCLUDE_DIR)
IF(OPENIMAGEDENOISE_FOUND)
SET(OPENIMAGEDENOISE_LIBRARIES ${_openimagedenoise_LIBRARIES})
SET(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE_INCLUDE_DIR})
ELSE()
SET(OPENIMAGEDENOISE_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
OPENIMAGEDENOISE_INCLUDE_DIR
)
FOREACH(COMPONENT ${_openimagedenoise_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
MARK_AS_ADVANCED(OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY)
ENDFOREACH()
UNSET(_openimagedenoise_SEARCH_DIRS)
UNSET(_openimagedenoise_FIND_COMPONENTS)
UNSET(_openimagedenoise_LIBRARIES)

View File

@@ -0,0 +1,57 @@
# - Find OptiX library
# Find the native OptiX includes and library
# This module defines
# OPTIX_INCLUDE_DIRS, where to find optix.h, Set when
# OPTIX_INCLUDE_DIR is found.
# OPTIX_ROOT_DIR, The base directory to search for OptiX.
# This can also be an environment variable.
# OPTIX_FOUND, If false, do not try to use OptiX.
#=============================================================================
# Copyright 2019 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 OPTIX_ROOT_DIR was defined in the environment, use it.
IF(NOT OPTIX_ROOT_DIR AND NOT $ENV{OPTIX_ROOT_DIR} STREQUAL "")
SET(OPTIX_ROOT_DIR $ENV{OPTIX_ROOT_DIR})
ENDIF()
SET(_optix_SEARCH_DIRS
${OPTIX_ROOT_DIR}
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.0.0"
/usr/local
/sw # Fink
/opt/local # DarwinPorts
)
FIND_PATH(OPTIX_INCLUDE_DIR
NAMES
optix.h
HINTS
${_optix_SEARCH_DIRS}
PATH_SUFFIXES
include
)
# handle the QUIETLY and REQUIRED arguments and set OPTIX_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX DEFAULT_MSG
OPTIX_INCLUDE_DIR)
IF(OPTIX_FOUND)
SET(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
ENDIF(OPTIX_FOUND)
MARK_AS_ADVANCED(
OPTIX_INCLUDE_DIR
)
UNSET(_optix_SEARCH_DIRS)

View File

@@ -83,9 +83,9 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
)
FOREACH(_CURRENT_ABI_FLAGS ${_PYTHON_ABI_FLAGS_TEST})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
# SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
#ENDIF()
# IF(CMAKE_BUILD_TYPE STREQUAL Debug)
# SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
# ENDIF()
STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
IF(NOT DEFINED PYTHON_INCLUDE_DIR)

View File

@@ -14,12 +14,15 @@
macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
if(WITH_GTESTS)
set(TARGET_NAME ${NAME}_test)
get_property(_current_include_directories
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY INCLUDE_DIRECTORIES)
set(TEST_INC
${_current_include_directories}
${CMAKE_SOURCE_DIR}/tests/gtests
)
set(TEST_INC_SYS
${GLOG_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/extern/gtest/include
@@ -27,8 +30,10 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
)
unset(_current_include_directories)
add_executable(${NAME}_test ${SRC})
target_link_libraries(${NAME}_test
add_executable(${TARGET_NAME} ${SRC})
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
target_link_libraries(${TARGET_NAME}
${EXTRA_LIBS}
${PLATFORM_LINKLIBS}
bf_testing_main
@@ -41,16 +46,30 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
${GLOG_LIBRARIES}
${GFLAGS_LIBRARIES})
if(WITH_OPENMP_STATIC)
target_link_libraries(${NAME}_test ${OpenMP_LIBRARIES})
target_link_libraries(${TARGET_NAME} ${OpenMP_LIBRARIES})
endif()
set_target_properties(${NAME}_test PROPERTIES
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)
string(REPLACE "\${BUILD_TYPE}" "$<CONFIG>" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
else()
string(REPLACE "\${BUILD_TYPE}" "" TEST_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
endif()
set_target_properties(${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}"
INCLUDE_DIRECTORIES "${TEST_INC}")
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}")
if(${DO_ADD_TEST})
add_test(NAME ${NAME}_test COMMAND ${TESTS_OUTPUT_DIR}/${NAME}_test WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>)
add_test(NAME ${TARGET_NAME} COMMAND ${TESTS_OUTPUT_DIR}/${TARGET_NAME} WORKING_DIRECTORY ${TEST_INSTALL_DIR})
# Don't fail tests on leaks since these often happen in external libraries
# that we can't fix.
set_tests_properties(${TARGET_NAME} PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
endif()
unset(TEST_INC)
unset(TEST_INC_SYS)
unset(TARGET_NAME)
endif()
endmacro()

View File

@@ -145,22 +145,13 @@ if(EXISTS ${SOURCE_DIR}/.git)
unset(_git_changed_files)
endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
# BUILD_PLATFORM is taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
if(UNIX)
if(NOT BUILD_DATE)
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
elseif(WIN32)
if(NOT BUILD_DATE)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_TIME)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT BUILD_DATE)
STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
endif()
if(NOT BUILD_TIME)
STRING(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
endif()
# Write a file with the BUILD_HASH define

View File

@@ -130,7 +130,7 @@ def function_parm_wash_tokens(parm):
)
"""
Return tolens without trailing commands and 'const'
Return tokens without trailing commands and 'const'
"""
tokens = [t for t in parm.get_tokens()]

View File

@@ -28,6 +28,7 @@ if not sys.version.startswith("3"):
from cmake_consistency_check_config import (
IGNORE_SOURCE,
IGNORE_SOURCE_MISSING,
IGNORE_CMAKE,
UTF8_CHECK,
SOURCE_DIR,
@@ -42,6 +43,11 @@ global_h = set()
global_c = set()
global_refs = {}
# Ignore cmake file, path pairs.
global_ignore_source_missing = {}
for k, v in IGNORE_SOURCE_MISSING:
global_ignore_source_missing.setdefault(k, []).append(v)
def replace_line(f, i, text, keep_indent=True):
file_handle = open(f, 'r')
@@ -137,6 +143,13 @@ def cmake_get_src(f):
cmake_base = dirname(f)
cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR))
# Find known missing sources list (if we have one).
f_rel = os.path.relpath(f, SOURCE_DIR)
f_rel_key = f_rel
if os.sep != "/":
f_rel_key = f_rel_key.replace(os.sep, "/")
local_ignore_source_missing = global_ignore_source_missing.get(f_rel_key, [])
while it is not None:
i += 1
try:
@@ -149,6 +162,9 @@ def cmake_get_src(f):
if not l.startswith("#"):
# Remove in-line comments.
l = l.split(" # ")[0].rstrip()
if ")" in l:
if l.strip() != ")":
raise Exception("strict formatting not kept '*)' %s:%d" % (f, i))
@@ -211,7 +227,10 @@ def cmake_get_src(f):
# replace_line(f, i - 1, new_path_rel)
else:
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file))
if l in local_ignore_source_missing:
local_ignore_source_missing.remove(l)
else:
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file))
# print(new_file)
@@ -341,6 +360,12 @@ def main():
if not ignore_used_source[index]:
print("unused ignore: %r" % ig)
# Check ignores aren't stale
print("\nCheck for unused 'IGNORE_SOURCE_MISSING' paths...")
for k, v in sorted(global_ignore_source_missing.items()):
for ig in v:
print("unused ignore: %r -> %r" % (ig, k))
# Check ignores aren't stale
print("\nCheck for unused 'IGNORE_CMAKE' paths...")
for index, ig in enumerate(IGNORE_CMAKE):

View File

@@ -17,8 +17,6 @@ IGNORE_SOURCE = (
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
"intern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
"intern/audaspace/SRC/AUD_SRCResampleReader.cpp",
"doc/doxygen/doxygen.extern.h",
"doc/doxygen/doxygen.intern.h",
@@ -32,8 +30,12 @@ IGNORE_SOURCE = (
"extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.h",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h",
"extern/bullet2/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h",
"intern/audaspace/SRC/AUD_SRCResampleFactory.h",
"intern/audaspace/SRC/AUD_SRCResampleReader.h",
)
# Ignore cmake file, path pairs.
IGNORE_SOURCE_MISSING = (
# Use for cycles stand-alone.
("intern/cycles/util/CMakeLists.txt", "../../third_party/numaapi/include"),
)
IGNORE_CMAKE = (

View File

@@ -238,7 +238,7 @@ def create_nb_project_main():
f.write(' </makeTool>\n')
f.write(' </makefileType>\n')
# finishe makefle info
# finished makefile info
f.write(' \n')

View File

@@ -0,0 +1,19 @@
# Configuration for developers, with faster builds, error checking and tests.
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_developer.cmake ../blender
#
set(WITH_ASSERT_ABORT ON CACHE BOOL "" FORCE)
set(WITH_BUILDINFO OFF CACHE BOOL "" FORCE)
set(WITH_COMPILER_ASAN ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEBUG ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_NATIVE_ONLY ON CACHE BOOL "" FORCE)
set(WITH_GTESTS ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS OFF CACHE BOOL "" FORCE)
set(WITH_PYTHON_SAFETY ON CACHE BOOL "" FORCE)
set(WITH_DOC_MANPAGE OFF CACHE BOOL "" FORCE)
# This may have issues with C++ initialization order, needs to be tested
# on all platforms to be sure this is safe to enable.
# set(WITH_CXX_GUARDEDALLOC ON CACHE BOOL "" FORCE)

View File

@@ -40,13 +40,15 @@ set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEDENOISE ON CACHE BOOL "" FORCE)
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_TBB ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)

View File

@@ -17,6 +17,7 @@ set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
@@ -45,11 +46,13 @@ set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEDENOISE OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
set(WITH_SDL OFF CACHE BOOL "" FORCE)
set(WITH_TBB OFF CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE OFF CACHE BOOL "" FORCE)

View File

@@ -41,13 +41,15 @@ set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEDENOISE ON CACHE BOOL "" FORCE)
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB ON CACHE BOOL "" FORCE)
set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
set(WITH_QUADRIFLOW ON CACHE BOOL "" FORCE)
set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_TBB ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
@@ -55,6 +57,7 @@ set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
# platform dependent options
if(UNIX AND NOT APPLE)

View File

@@ -31,7 +31,18 @@ set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# jemalloc causes linking error on import, disable.
# Depends on Python install, do this to quiet warning.
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
# Note, if linking errors can be resolved, lines below can be removed.
# Until then, disable configurations known to fail.
if(UNIX AND NOT APPLE)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# jemalloc causes linking error on import, disable.
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
endif()
elseif(APPLE)
# OpenMP causes linking error on build, disable.
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
endif()

View File

@@ -147,9 +147,9 @@ function(blender_include_dirs
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC})
# for checking for invalid includes, disable for regular use
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
# if(NOT EXISTS "${_ABS_INC}/")
# message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
# endif()
endforeach()
include_directories(${_ALL_INCS})
endfunction()
@@ -162,9 +162,9 @@ function(blender_include_dirs_sys
foreach(_INC ${ARGV})
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
list(APPEND _ALL_INCS ${_ABS_INC})
##if(NOT EXISTS "${_ABS_INC}/")
## message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
##endif()
# if(NOT EXISTS "${_ABS_INC}/")
# message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
# endif()
endforeach()
include_directories(SYSTEM ${_ALL_INCS})
endfunction()
@@ -173,7 +173,7 @@ function(blender_source_group
sources
)
#if enabled, use the sources directories as filters.
# if enabled, use the sources directories as filters.
if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
foreach(_SRC ${sources})
# remove ../'s
@@ -259,7 +259,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_PROJECT_FOLDERS)
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
@@ -352,6 +352,9 @@ function(SETUP_LIBDIRS)
if(WITH_OPENIMAGEIO)
link_directories(${OPENIMAGEIO_LIBPATH})
endif()
if(WITH_OPENIMAGEDENOISE)
link_directories(${OPENIMAGEDENOISE_LIBPATH})
endif()
if(WITH_OPENCOLORIO)
link_directories(${OPENCOLORIO_LIBPATH})
endif()
@@ -372,7 +375,7 @@ function(SETUP_LIBDIRS)
endif()
if(WITH_OPENCOLLADA)
link_directories(${OPENCOLLADA_LIBPATH})
## Never set
# # Never set
# link_directories(${PCRE_LIBPATH})
# link_directories(${EXPAT_LIBPATH})
endif()
@@ -393,6 +396,7 @@ endfunction()
macro(setup_platform_linker_flags)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
endmacro()
@@ -402,12 +406,15 @@ function(setup_liblinks
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE)
# jemalloc must be early in the list, to be before pthread (see T57998)
if(WITH_MEM_JEMALLOC)
@@ -457,11 +464,17 @@ function(setup_liblinks
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_OPENVDB)
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${BLOSC_LIBRARIES})
endif()
if(WITH_OPENIMAGEIO)
target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES})
endif()
if(WITH_OPENIMAGEDENOISE)
target_link_libraries(${target} ${OPENIMAGEDENOISE_LIBRARIES})
endif()
if(WITH_TBB)
target_link_libraries(${target} ${TBB_LIBRARIES})
endif()
if(WITH_OPENCOLORIO)
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
endif()
@@ -521,9 +534,6 @@ function(setup_liblinks
)
endif()
endif()
if(WITH_MOD_CLOTH_ELTOPO)
target_link_libraries(${target} ${LAPACK_LIBRARIES})
endif()
if(WITH_LLVM)
target_link_libraries(${target} ${LLVM_LIBRARY})
endif()
@@ -560,11 +570,11 @@ function(setup_liblinks
${ZLIB_LIBRARIES}
)
#system libraries with no dependencies such as platform link libs or opengl should go last
# System libraries with no dependencies such as platform link libs or opengl should go last.
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES})
#target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
# target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
target_link_libraries(${target} ${PLATFORM_LINKLIBS})
endfunction()
@@ -713,7 +723,7 @@ macro(remove_strict_flags)
endif()
if(MSVC)
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
endif()
endmacro()
@@ -1058,7 +1068,7 @@ function(data_to_c_simple_icons
add_custom_command(
OUTPUT ${_file_from} ${_file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
#COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py ${_path_from_abs} ${_file_from}
# COMMAND python3 ${CMAKE_SOURCE_DIR}/source/blender/datatoc/datatoc_icon.py ${_path_from_abs} ${_file_from}
COMMAND "$<TARGET_FILE:datatoc_icon>" ${_path_from_abs} ${_file_from}
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
DEPENDS
@@ -1203,7 +1213,9 @@ macro(openmp_delayload
)
if(MSVC)
if(WITH_OPENMP)
if(MSVC_VERSION EQUAL 1800)
if(MSVC_CLANG)
set(OPENMP_DLL_NAME "libomp")
elseif(MSVC_VERSION EQUAL 1800)
set(OPENMP_DLL_NAME "vcomp120")
else()
set(OPENMP_DLL_NAME "vcomp140")
@@ -1216,29 +1228,6 @@ macro(openmp_delayload
endif()
endmacro()
macro(WINDOWS_SIGN_TARGET target)
if(WITH_WINDOWS_CODESIGN)
if(!SIGNTOOL_EXE)
error("Codesigning is enabled, but signtool is not found")
else()
if(WINDOWS_CODESIGN_PFX_PASSWORD)
set(CODESIGNPASSWORD /p ${WINDOWS_CODESIGN_PFX_PASSWORD})
else()
if($ENV{PFXPASSWORD})
set(CODESIGNPASSWORD /p $ENV{PFXPASSWORD})
else()
message(FATAL_ERROR "WITH_WINDOWS_CODESIGN is on but WINDOWS_CODESIGN_PFX_PASSWORD not set, and environment variable PFXPASSWORD not found, unable to sign code.")
endif()
endif()
add_custom_command(TARGET ${target}
POST_BUILD
COMMAND ${SIGNTOOL_EXE} sign /f ${WINDOWS_CODESIGN_PFX} ${CODESIGNPASSWORD} $<TARGET_FILE:${target}>
VERBATIM
)
endif()
endif()
endmacro()
macro(blender_precompile_headers target cpp header)
if(MSVC)
# get the name for the pch output file

View File

@@ -80,22 +80,28 @@ if(APPLE)
endif()
if(WIN32)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Blender Foundation/Blender")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Blender Foundation/Blender")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Blender Foundation/Blender ${MAJOR_VERSION}.${MINOR_VERSION}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Blender Foundation/Blender ${MAJOR_VERSION}.${MINOR_VERSION}")
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt)
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_WIX_UPGRADE_GUID "B767E4FD-7DE7-4094-B051-3AE62E13A17A")
set(BLENDER_NAMESPACE_GUID "507F933F-5898-404A-9A05-18282FD491A6")
string(UUID CPACK_WIX_UPGRADE_GUID
NAMESPACE ${BLENDER_NAMESPACE_GUID}
NAME ${CPACK_PACKAGE_INSTALL_DIRECTORY}
TYPE SHA1 UPPER
)
set(CPACK_WIX_TEMPLATE ${LIBDIR}/package/installer_wix/WIX.template)
set(CPACK_WIX_UI_BANNER ${LIBDIR}/package/installer_wix/WIX_UI_BANNER.bmp)
set(CPACK_WIX_UI_DIALOG ${LIBDIR}/package/installer_wix/WIX_UI_DIALOG.bmp)
#force lzma instead of deflate
set(CPACK_WIX_LIGHT_EXTRA_FLAGS -dcl:high)
set(CPACK_WIX_LIGHT_EXTRA_FLAGS -dcl:medium)
endif()
set(CPACK_PACKAGE_EXECUTABLES "blender" "blender")

View File

@@ -100,8 +100,8 @@ if(WITH_PYTHON)
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}m")
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}m")
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
# set(PYTHON_LIBRARY python${PYTHON_VERSION})
# set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
unset(_py_framework)
endif()
@@ -157,7 +157,7 @@ if(WITH_CODEC_FFMPEG)
avcodec avdevice avformat avutil
mp3lame swscale x264 xvidcore
theora theoradec theoraenc
vorbis vorbisenc vorbisfile ogg
vorbis vorbisenc vorbisfile ogg opus
vpx swresample)
set(FFMPEG_LIBPATH ${FFMPEG}/lib)
endif()
@@ -218,12 +218,12 @@ if(WITH_OPENCOLLADA)
${OPENCOLLADA_LIBPATH}/libxml2.a
)
# PCRE is bundled with openCollada
#set(PCRE ${LIBDIR}/pcre)
#set(PCRE_LIBPATH ${PCRE}/lib)
# set(PCRE ${LIBDIR}/pcre)
# set(PCRE_LIBPATH ${PCRE}/lib)
set(PCRE_LIBRARIES pcre)
# libxml2 is used
#set(EXPAT ${LIBDIR}/expat)
#set(EXPAT_LIBPATH ${EXPAT}/lib)
# set(EXPAT ${LIBDIR}/expat)
# set(EXPAT_LIBPATH ${EXPAT}/lib)
set(EXPAT_LIB)
endif()
@@ -313,16 +313,13 @@ endif()
if(WITH_OPENVDB)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(TBB_INCLUDE_DIRS ${LIBDIR}/tbb/include)
set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/libtbb.a)
set(OPENVDB_LIBRARIES openvdb blosc ${TBB_LIBRARIES})
set(OPENVDB_LIBRARIES openvdb blosc)
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
set(OPENVDB_DEFINITIONS)
endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
set(LLVM_VERSION 3.4)
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
else()
@@ -334,6 +331,9 @@ if(WITH_LLVM)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --includedir
OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -382,6 +382,30 @@ if(WITH_CYCLES_EMBREE)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
endif()
if(WITH_OPENIMAGEDENOISE)
find_package(OpenImageDenoise)
if(NOT OPENIMAGEDENOISE_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "OpenImageDenoise not found")
endif()
endif()
if(WITH_TBB)
find_package(TBB)
endif()
if(NOT WITH_TBB OR NOT TBB_FOUND)
if(WITH_OPENIMAGEDENOISE)
message(STATUS "TBB not found, disabling OpenImageDenoise")
set(WITH_OPENIMAGEDENOISE OFF)
endif()
if(WITH_OPENVDB)
message(STATUS "TBB not found, disabling OpenVDB")
set(WITH_OPENVDB OFF)
endif()
endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
if(WITH_OPENMP)
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")

View File

@@ -22,14 +22,30 @@
# Detect precompiled library directory
if(NOT DEFINED LIBDIR)
# Path to a locally compiled libraries.
set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
# Path to precompiled libraries with known CentOS 7 ABI.
set(LIBDIR_CENTOS7_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_centos7_x86_64)
# Choose the best suitable libraries.
if(EXISTS ${LIBDIR_NATIVE_ABI})
set(LIBDIR ${LIBDIR_NATIVE_ABI})
elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
endif()
# Avoid namespace pollustion.
unset(LIBDIR_NATIVE_ABI)
unset(LIBDIR_CENTOS7_ABI)
endif()
if(EXISTS ${LIBDIR})
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
# NOTE: Make sure "proper" compiled zlib comes first before the one
# which is a part of OpenCollada. They have different ABI, and we
@@ -244,13 +260,8 @@ endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
find_package_wrapper(Blosc)
if(NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "TBB not found, disabling OpenVDB")
elseif(NOT OPENVDB_FOUND)
if(NOT OPENVDB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
@@ -368,6 +379,15 @@ if(WITH_CYCLES_EMBREE)
find_package(Embree 3.2.4 REQUIRED)
endif()
if(WITH_OPENIMAGEDENOISE)
find_package_wrapper(OpenImageDenoise)
if(NOT OPENIMAGEDENOISE_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "OpenImageDenoise not found")
endif()
endif()
if(WITH_LLVM)
if(EXISTS ${LIBDIR})
set(LLVM_STATIC ON)
@@ -407,6 +427,21 @@ if(WITH_OPENSUBDIV)
endif()
endif()
if(WITH_TBB)
find_package_wrapper(TBB)
endif()
if(NOT WITH_TBB OR NOT TBB_FOUND)
if(WITH_OPENIMAGEDENOISE)
message(STATUS "TBB not found, disabling OpenImageDenoise")
set(WITH_OPENIMAGEDENOISE OFF)
endif()
if(WITH_OPENVDB)
message(STATUS "TBB not found, disabling OpenVDB")
set(WITH_OPENVDB OFF)
endif()
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
if(HAIKU)
list(APPEND PLATFORM_LINKLIBS -lnetwork)

View File

@@ -35,6 +35,22 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
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()
# 1) CMake has issues detecting openmp support in clang-cl so we have to provide
# the right switches here.
# 2) While the /openmp switch *should* work, it currently doesn't as for clang 9.0.0
if(WITH_OPENMP)
set(OPENMP_CUSTOM ON)
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "/clang:-fopenmp")
set(OpenMP_CXX_FLAGS "/clang:-fopenmp")
GET_FILENAME_COMPONENT(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE)
set(CLANG_OPENMP_DLL "${LLVMROOT}/bin/libomp.dll")
set(CLANG_OPENMP_LIB "${LLVMROOT}/lib/libomp.lib")
if(NOT EXISTS "${CLANG_OPENMP_DLL}")
message(FATAL_ERROR "Clang OpenMP library (${CLANG_OPENMP_DLL}) not found.")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \"${CLANG_OPENMP_LIB}\"")
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
@@ -96,7 +112,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp
)
@@ -131,21 +147,27 @@ if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
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")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc /bigobj")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT")
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(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
# JMC is available on msvc 15.8 (1915) and up
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
endif()
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 ")
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
# Ignore meaningless for us linker warnings.
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
@@ -157,8 +179,6 @@ else()
set(PLATFORM_LINKFLAGS "/MACHINE:IX86 /LARGEADDRESSAWARE ${PLATFORM_LINKFLAGS}")
endif()
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
if(NOT DEFINED LIBDIR)
# Setup 64bit and 64bit windows systems
@@ -166,28 +186,24 @@ if(NOT DEFINED LIBDIR)
message(STATUS "64 bit compiler detected.")
set(LIBDIR_BASE "win64")
else()
message(STATUS "32 bit compiler detected.")
set(LIBDIR_BASE "windows")
message(FATAL_ERROR "32 bit compiler detected, blender no longer provides pre-build libraries for 32 bit windows, please set the LIBDIR cmake variable to your own library folder")
endif()
# Can be 1910..1912
if(MSVC_VERSION GREATER 1919)
message(STATUS "Visual Studio 2019 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
elseif(MSVC_VERSION GREATER 1909)
message(STATUS "Visual Studio 2017 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
elseif(MSVC_VERSION EQUAL 1900)
message(STATUS "Visual Studio 2015 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
else()
message(STATUS "Visual Studio 2013 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc12)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
endif()
else()
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
endif()
if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'")
message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
endif()
# Mark libdir as system headers with a lower warn level, to resolve some warnings
@@ -343,15 +359,13 @@ if(WITH_PYTHON)
set(PYTHON_VERSION 3.7) # CACHE STRING)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include)
set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include)
set(NUMPY_FOUND On)
unset(_PYTHON_VERSION_NO_DOTS)
# Shared includes for both vc2008 and vc2010
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/include/python${PYTHON_VERSION})
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
@@ -379,11 +393,8 @@ if(WITH_BOOST)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/lib)
if(CMAKE_CL_64)
set(BOOST_POSTFIX "vc140-mt-s-x64-1_68.lib")
set(BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x64-1_68.lib")
else()
set(BOOST_POSTFIX "vc140-mt-s-x32-1_68.lib")
set(BOOST_DEBUG_POSTFIX "vc140-mt-sgd-x32-1_68.lib")
set(BOOST_POSTFIX "vc141-mt-x64-1_68.lib")
set(BOOST_DEBUG_POSTFIX "vc141-mt-gd-x64-1_68.lib")
endif()
set(BOOST_LIBRARIES
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
@@ -419,7 +430,7 @@ endif()
if(WITH_OPENIMAGEIO)
windows_find_package(OpenImageIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO ${LIBDIR}/OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
@@ -460,14 +471,14 @@ if(WITH_LLVM)
endif()
if(WITH_OPENCOLORIO)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO ${LIBDIR}/OpenColorIO)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBPATH ${LIBDIR}/opencolorio/lib)
set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
set(OPENCOLORIO_LIBRARIES
optimized ${OPENCOLORIO_LIBPATH}/OpenColorIO.lib
optimized ${OPENCOLORIO_LIBPATH}/tinyxml.lib
optimized ${OPENCOLORIO_LIBPATH}/libyaml-cpp.lib
debug ${OPENCOLORIO_LIBPATH}/OpenColorIO_d.lib
debug ${OPENCOLORIO_LIBPATH}/OpencolorIO_d.lib
debug ${OPENCOLORIO_LIBPATH}/tinyxml_d.lib
debug ${OPENCOLORIO_LIBPATH}/libyaml-cpp_d.lib
)
@@ -476,35 +487,36 @@ endif()
if(WITH_OPENVDB)
set(BLOSC_LIBRARIES optimized ${LIBDIR}/blosc/lib/libblosc.lib debug ${LIBDIR}/blosc/lib/libblosc_d.lib)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(OPENVDB ${LIBDIR}/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})
set(OPENVDB ${LIBDIR}/openVDB)
set(OPENVDB_LIBPATH ${OPENVDB}/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib ${BLOSC_LIBRARIES})
set(OPENVDB_DEFINITIONS -DNOMINMAX)
endif()
if(WITH_OPENIMAGEDENOISE)
set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include)
set(OPENIMAGEDENOISE_LIBRARIES
optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib
optimized ${OPENIMAGEDENOISE_LIBPATH}/common.lib
optimized ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib)
set(OPENIMAGEDENOISE_DEFINITIONS)
endif()
if(WITH_ALEMBIC)
set(ALEMBIC ${LIBDIR}/alembic)
set(ALEMBIC_INCLUDE_DIR ${ALEMBIC}/include)
set(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
set(ALEMBIC_LIBPATH ${ALEMBIC}/lib)
set(ALEMBIC_LIBRARIES optimized ${ALEMBIC}/lib/alembic.lib debug ${ALEMBIC}/lib/alembic_d.lib)
set(ALEMBIC_LIBRARIES optimized ${ALEMBIC}/lib/Alembic.lib debug ${ALEMBIC}/lib/Alembic_d.lib)
set(ALEMBIC_FOUND 1)
endif()
if(WITH_MOD_CLOTH_ELTOPO)
set(LAPACK ${LIBDIR}/lapack)
# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
set(LAPACK_LIBPATH ${LAPACK}/lib)
set(LAPACK_LIBRARIES
${LIBDIR}/lapack/lib/libf2c.lib
${LIBDIR}/lapack/lib/clapack_nowrap.lib
${LIBDIR}/lapack/lib/BLAS_nowrap.lib
)
endif()
if(WITH_IMAGE_OPENJPEG)
set(OPENJPEG ${LIBDIR}/openjpeg)
set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG}/include/openjpeg-2.3)
@@ -546,20 +558,27 @@ if(WITH_SYSTEM_AUDASPACE)
set(AUDASPACE_PY_LIBRARIES ${LIBDIR}/audaspace/lib/audaspace-py.lib)
endif()
if(WITH_TBB)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
if(WITH_TBB_MALLOC_PROXY)
add_definitions(-DWITH_TBB_MALLOC)
endif()
else()
if(WITH_OPENIMAGEDENOISE)
message(STATUS "TBB disabled, also disabling OpenImageDenoise")
set(WITH_OPENIMAGEDENOISE OFF)
endif()
if(WITH_OPENVDB)
message(STATUS "TBB disabled, also disabling OpenVDB")
set(WITH_OPENVDB OFF)
endif()
endif()
# used in many places so include globally, like OpenGL
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
#find signtool
set(ProgramFilesX86_NAME "ProgramFiles(x86)") #env dislikes the ( )
find_program(SIGNTOOL_EXE signtool
HINTS
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/10/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/10/bin/x86/"
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.1/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/8.1/bin/x86/"
"$ENV{${ProgramFilesX86_NAME}}/Windows Kits/8.0/bin/x86/"
"$ENV{ProgramFiles}/Windows Kits/8.0/bin/x86/"
)
set(WINTAB_INC ${LIBDIR}/wintab/include)
if(WITH_OPENAL)
@@ -582,10 +601,6 @@ if(WITH_CODEC_SNDFILE)
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
endif()
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Builds a debian package from SVN source.
#
# For paralelle builds use:
# For parallel builds use:
# DEB_BUILD_OPTIONS="parallel=5" sh build_files/package_spec/build_debian.sh
# this needs to run in the root dir.

View File

@@ -20,7 +20,7 @@ else
fi
MANIFEST="blender-$VERSION-manifest.txt"
TARBALL="blender-$VERSION.tar.gz"
TARBALL="blender-$VERSION.tar.xz"
cd "$blender_srcdir"
@@ -51,19 +51,26 @@ echo "OK"
# Create the tarball
#
# Without owner/group args, extracting the files as root will
# use ownership from the tar archive.
cd "$blender_srcdir"
echo -n "Creating archive: \"$BASE_DIR/$TARBALL\" ..."
tar --transform "s,^,blender-$VERSION/,g" \
--use-compress-program="gzip --best" \
tar \
--transform "s,^,blender-$VERSION/,g" \
--use-compress-program="xz -9" \
--create \
--file="$BASE_DIR/$TARBALL" \
--files-from="$BASE_DIR/$MANIFEST"
--files-from="$BASE_DIR/$MANIFEST" \
--owner=0 \
--group=0
echo "OK"
# Create checksum file
cd "$BASE_DIR"
echo -n "Creating checksum: \"$BASE_DIR/$TARBALL.md5sum\" ..."
echo -n "Creating checksum: \"$BASE_DIR/$TARBALL.md5sum\" ..."
md5sum "$TARBALL" > "$TARBALL.md5sum"
echo "OK"

76
build_files/utils/make_test.py Executable file
View File

@@ -0,0 +1,76 @@
#!/usr/bin/env python3
#
# "make test" for all platforms, running automated tests.
import argparse
import os
import shutil
import sys
import make_utils
from make_utils import call
# Parse arguments
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--ctest-command", default="ctest")
parser.add_argument("--cmake-command", default="cmake")
parser.add_argument("--svn-command", default="svn")
parser.add_argument("--git-command", default="git")
parser.add_argument("--config", default="")
parser.add_argument("build_directory")
return parser.parse_args()
args = parse_arguments()
git_command = args.git_command
svn_command = args.svn_command
ctest_command = args.ctest_command
cmake_command = args.cmake_command
config = args.config
build_dir = args.build_directory
if make_utils.command_missing(ctest_command):
sys.stderr.write("ctest not found, can't run tests\n")
sys.exit(1)
if make_utils.command_missing(git_command):
sys.stderr.write("git not found, can't run tests\n")
sys.exit(1)
# Test if we are building a specific release version.
branch = make_utils.git_branch(git_command)
release_version = make_utils.git_branch_release_version(branch)
lib_tests_dirpath = os.path.join('..', 'lib', "tests")
if not os.path.exists(lib_tests_dirpath):
print("Tests files not found, downloading...")
if make_utils.command_missing(svn_command):
sys.stderr.write("svn not found, can't checkout test files\n")
sys.exit(1)
if make_utils.command_missing(cmake_command):
sys.stderr.write("cmake not found, can't checkout test files\n")
sys.exit(1)
svn_url = make_utils.svn_libraries_base_url(release_version) + "/tests"
call([svn_command, "checkout", svn_url, lib_tests_dirpath])
# Run cmake again to detect tests files.
os.chdir(build_dir)
call([cmake_command, "."])
# Run tests
tests_dir = os.path.join(build_dir, "tests")
os.makedirs(tests_dir, exist_ok=True)
os.chdir(build_dir)
command = [ctest_command, ".", "--output-on-failure"]
if len(config):
command += ["-C", config]
tests_log = "log_" + config + ".txt"
else:
tests_log = "log.txt"
command += ["-O", os.path.join(tests_dir, tests_log)]
call(command)

223
build_files/utils/make_update.py Executable file
View File

@@ -0,0 +1,223 @@
#!/usr/bin/env python3
#
# "make update" for all platforms, updating svn libraries and tests and Blender
# git repository and submodules.
#
# For release branches, this will check out the appropriate branches of
# submodules and libraries.
import argparse
import os
import shutil
import sys
import make_utils
from make_utils import call, check_output
def print_stage(text):
print("")
print(text)
print("")
# Parse arguments
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--no-libraries", action="store_true")
parser.add_argument("--no-blender", action="store_true")
parser.add_argument("--no-submodules", action="store_true")
parser.add_argument("--use-tests", action="store_true")
parser.add_argument("--svn-command", default="svn")
parser.add_argument("--git-command", default="git")
parser.add_argument("--use-centos-libraries", action="store_true")
return parser.parse_args()
def get_blender_git_root():
return check_output([args.git_command, "rev-parse", "--show-toplevel"])
# Setup for precompiled libraries and tests from svn.
def svn_update(args, release_version):
svn_non_interactive = [args.svn_command, '--non-interactive']
lib_dirpath = os.path.join(get_blender_git_root(), '..', 'lib')
svn_url = make_utils.svn_libraries_base_url(release_version)
# Checkout precompiled libraries
if sys.platform == 'darwin':
lib_platform = "darwin"
elif sys.platform == 'win32':
# Windows checkout is usually handled by bat scripts since python3 to run
# this script is bundled as part of the precompiled libraries. However it
# is used by the buildbot.
lib_platform = "win64_vc15"
elif args.use_centos_libraries:
lib_platform = "linux_centos7_x86_64"
else:
# No precompiled libraries for Linux.
lib_platform = None
if lib_platform:
lib_platform_dirpath = os.path.join(lib_dirpath, lib_platform)
if not os.path.exists(lib_platform_dirpath):
print_stage("Checking out Precompiled Libraries")
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't checkout libraries\n")
sys.exit(1)
svn_url_platform = svn_url + lib_platform
call(svn_non_interactive + ["checkout", svn_url_platform, lib_platform_dirpath])
if args.use_tests:
lib_tests = "tests"
lib_tests_dirpath = os.path.join(lib_dirpath, lib_tests)
if not os.path.exists(lib_tests_dirpath):
print_stage("Checking out Tests")
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't checkout tests\n")
sys.exit(1)
svn_url_tests = svn_url + lib_tests
call(svn_non_interactive + ["checkout", svn_url_tests, lib_tests_dirpath])
# Update precompiled libraries and tests
print_stage("Updating Precompiled Libraries and Tests")
if os.path.isdir(lib_dirpath):
for dirname in os.listdir(lib_dirpath):
dirpath = os.path.join(lib_dirpath, dirname)
if dirname == ".svn":
# Cleanup must be run from svn root directory if it exists.
if not make_utils.command_missing(args.svn_command):
call(svn_non_interactive + ["cleanup", lib_dirpath])
continue
svn_dirpath = os.path.join(dirpath, ".svn")
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
if os.path.isdir(dirpath) and \
(os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't update libraries\n")
sys.exit(1)
# Cleanup to continue with interrupted downloads.
if os.path.exists(svn_dirpath):
call(svn_non_interactive + ["cleanup", dirpath])
# Switch to appropriate branch and update.
call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
call(svn_non_interactive + ["update", dirpath])
# Test if git repo can be updated.
def git_update_skip(args, check_remote_exists=True):
if make_utils.command_missing(args.git_command):
sys.stderr.write("git not found, can't update code\n")
sys.exit(1)
# Abort if a rebase is still progress.
rebase_merge = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-merge'], exit_on_error=False)
rebase_apply = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-apply'], exit_on_error=False)
merge_head = check_output([args.git_command, 'rev-parse', '--git-path', 'MERGE_HEAD'], exit_on_error=False)
if os.path.exists(rebase_merge) or \
os.path.exists(rebase_apply) or \
os.path.exists(merge_head):
return "rebase or merge in progress, complete it first"
# Abort if uncommitted changes.
changes = check_output([args.git_command, 'status', '--porcelain', '--untracked-files=no'])
if len(changes) != 0:
return "you have unstaged changes"
# Test if there is an upstream branch configured
if check_remote_exists:
branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
if len(remote) == 0:
return "no remote branch to pull from"
return ""
# Update blender repository.
def blender_update(args):
print_stage("Updating Blender Git Repository")
call([args.git_command, "pull", "--rebase"])
# Update submodules.
def submodules_update(args, release_version, branch):
print_stage("Updating Submodules")
if make_utils.command_missing(args.git_command):
sys.stderr.write("git not found, can't update code\n")
sys.exit(1)
# Update submodules to latest master or appropriate release branch.
if not release_version:
branch = "master"
submodules = [
("release/scripts/addons", branch),
("release/scripts/addons_contrib", branch),
("release/datafiles/locale", branch),
("source/tools", branch),
]
# Initialize submodules only if needed.
for submodule_path, submodule_branch in submodules:
if not os.path.exists(os.path.join(submodule_path, ".git")):
call([args.git_command, "submodule", "update", "--init", "--recursive"])
break
# Checkout appropriate branch and pull changes.
skip_msg = ""
for submodule_path, submodule_branch in submodules:
cwd = os.getcwd()
try:
os.chdir(submodule_path)
msg = git_update_skip(args, check_remote_exists=False)
if msg:
skip_msg += submodule_path + " skipped: " + msg + "\n"
else:
if make_utils.git_branch(args.git_command) != submodule_branch:
call([args.git_command, "fetch", "origin"])
call([args.git_command, "checkout", submodule_branch])
call([args.git_command, "pull", "--rebase", "origin", submodule_branch])
finally:
os.chdir(cwd)
return skip_msg
if __name__ == "__main__":
args = parse_arguments()
blender_skip_msg = ""
submodules_skip_msg = ""
# Test if we are building a specific release version.
branch = make_utils.git_branch(args.git_command)
release_version = make_utils.git_branch_release_version(branch)
if not args.no_libraries:
svn_update(args, release_version)
if not args.no_blender:
blender_skip_msg = git_update_skip(args)
if blender_skip_msg:
blender_skip_msg = "Blender repository skipped: " + blender_skip_msg + "\n"
else:
blender_update(args)
if not args.no_submodules:
submodules_skip_msg = submodules_update(args, release_version, branch)
# Report any skipped repositories at the end, so it's not as easy to miss.
skip_msg = blender_skip_msg + submodules_skip_msg
if skip_msg:
print_stage(skip_msg.strip())
# For failed submodule update we throw an error, since not having correct
# submodules can make Blender throw errors.
# For Blender itself we don't and consider "make update" to be a command
# you can use while working on uncommitted code.
if submodules_skip_msg:
sys.exit(1)

66
build_files/utils/make_utils.py Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env python3
#
# Utility functions for make update and make tests.
import re
import shutil
import subprocess
import sys
def call(cmd, exit_on_error=True):
print(" ".join(cmd))
# Flush to ensure correct order output on Windows.
sys.stdout.flush()
sys.stderr.flush()
retcode = subprocess.call(cmd)
if exit_on_error and retcode != 0:
sys.exit(retcode)
return retcode
def check_output(cmd, exit_on_error=True):
# Flush to ensure correct order output on Windows.
sys.stdout.flush()
sys.stderr.flush()
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True)
except subprocess.CalledProcessError as e:
if exit_on_error:
sys.stderr.write(" ".join(cmd))
sys.stderr.write(e.output + "\n")
sys.exit(e.returncode)
output = ""
return output.strip()
def git_branch(git_command):
# Test if we are building a specific release version.
try:
branch = subprocess.check_output([git_command, "rev-parse", "--abbrev-ref", "HEAD"])
except subprocess.CalledProcessError as e:
sys.stderr.write("Failed to get Blender git branch\n")
sys.exit(1)
return branch.strip().decode('utf8')
def git_branch_release_version(branch):
release_version = re.search("^blender-v(.*)-release$", branch)
if release_version:
release_version = release_version.group(1)
return release_version
def svn_libraries_base_url(release_version):
if release_version:
svn_branch = "tags/blender-" + release_version + "-release"
else:
svn_branch = "trunk"
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
def command_missing(command):
# Support running with Python 2 for macOS
if sys.version_info >= (3, 0):
return shutil.which(command) is None
else:
return False

View File

@@ -1,12 +1,7 @@
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc15
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc15
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_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%
set BUILD_VS_LIBDIR="%BLENDER_DIR%..\lib\%BUILD_VS_SVNDIR%"
if NOT "%verbose%" == "" (
@@ -14,7 +9,6 @@ if NOT "%verbose%" == "" (
)
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
@@ -43,6 +37,15 @@ if NOT EXIST %BUILD_VS_LIBDIR% (
)
)
)
) else (
if NOT EXIST %PYTHON% (
if not "%SVN%"=="" (
echo.
echo Python not found in external libraries, updating to latest version
echo.
"%SVN%" update %BUILD_VS_LIBDIR%
)
)
)
if NOT EXIST %BUILD_VS_LIBDIR% (
@@ -50,5 +53,8 @@ if NOT EXIST %BUILD_VS_LIBDIR% (
echo Error: Required libraries not found at "%BUILD_VS_LIBDIR%"
echo This is needed for building, aborting!
echo.
if "%SVN%"=="" (
echo This is most likely caused by svn.exe not being available.
)
exit /b 1
)

View File

@@ -1,14 +1,6 @@
set BUILD_GENERATOR_POST=
set BUILD_PLATFORM_SELECT=
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
)
)
set MSBUILD_PLATFORM=x64
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"llvm"

View File

@@ -30,9 +30,15 @@ set LLVM_DIR=
: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 "%BUILD_VS_YEAR%" == "2019" (
rem build and tested against 2019 16.2
set CFLAGS=-m64 -fmsc-version=1922
set CXXFLAGS=-m64 -fmsc-version=1922
) else (
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
)

View File

@@ -6,11 +6,13 @@ if "%BUILD_ARCH%"=="" (
set WINDOWS_ARCH= Win64
set BUILD_ARCH=x64
) else (
set WINDOWS_ARCH=
set BUILD_ARCH=x86
echo Error: 32 bit builds of blender are no longer supported.
goto ERR
)
) else if "%BUILD_ARCH%"=="x64" (
set WINDOWS_ARCH= Win64
) else if "%BUILD_ARCH%"=="x86" (
set WINDOWS_ARCH=
)
:EOF
exit /b 0
:ERR
exit /b 1

View File

@@ -1,13 +1,17 @@
REM find all dependencies and set the corresponding environment variables.
for %%X in (svn.exe) do (set SVN=%%~$PATH:X)
for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X)
for %%X in (ctest.exe) do (set CTEST=%%~$PATH:X)
for %%X in (git.exe) do (set GIT=%%~$PATH:X)
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
if NOT "%verbose%" == "" (
echo svn : "%SVN%"
echo cmake : "%CMAKE%"
echo git : "%GIT%"
echo svn : "%SVN%"
echo cmake : "%CMAKE%"
echo ctest : "%CTEST%"
echo git : "%GIT%"
echo python : "%PYTHON%"
)
if "%CMAKE%" == "" (
echo Cmake not found in path, required for building, exiting...
exit /b 1
)
)

View File

@@ -1,9 +1,5 @@
if EXIST %BLENDER_DIR%\..\lib\win64_vc14\llvm\bin\clang-format.exe (
set CF_PATH=..\lib\win64_vc14\llvm\bin
goto detect_done
)
if EXIST %BLENDER_DIR%\..\lib\windows_vc14\llvm\bin\clang-format.exe (
set CF_PATH=..\lib\windows_vc14\llvm\bin
if EXIST %BLENDER_DIR%\..\lib\win64_vc15\llvm\bin\clang-format.exe (
set CF_PATH=..\lib\win64_vc15\llvm\bin
goto detect_done
)
@@ -13,13 +9,23 @@ exit /b 1
:detect_done
echo found clang-format in %CF_PATH%
REM TODO(sergey): Switch to Python from libraries when available.
set PYTHON="python.exe"
if EXIST %PYTHON% (
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc15\python\37\bin\python.exe
goto detect_python_done
)
echo python not found in lib folder
exit /b 1
:detect_python_done
echo found python (%PYTHON%)
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
REM The formatting script expects clang-format to be in the current PATH.
set PATH=%CF_PATH%;%PATH%
%PYTHON% %FORMAT_PATHS% %FORMAT_ARGS%
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
%PYTHON% -B %FORMAT_PATHS% %FORMAT_ARGS%
:EOF

View File

@@ -13,7 +13,7 @@ if NOT "%1" == "" (
set BUILD_TYPE=Debug
REM Build Configurations
) else if "%1" == "builddir" (
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
set BUILD_DIR_OVERRRIDE=%BLENDER_DIR%..\%2
shift /1
) else if "%1" == "with_tests" (
set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GTESTS=On
@@ -41,10 +41,13 @@ if NOT "%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" == "developer" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\blender_developer.cmake"
) else if "%1" == "asan" (
set WITH_ASAN=1
) else if "%1" == "x86" (
set BUILD_ARCH=x86
) else if "%1" == "x86" (
echo Error: 32 bit builds of blender are no longer supported.
goto ERR
) else if "%1" == "x64" (
set BUILD_ARCH=x64
) else if "%1" == "2017" (
@@ -79,28 +82,31 @@ if NOT "%1" == "" (
REM Non-Build Commands
) else if "%1" == "update" (
SET BUILD_UPDATE=1
set BUILD_UPDATE_SVN=1
set BUILD_UPDATE_GIT=1
set BUILD_UPDATE_ARGS=
) else if "%1" == "code_update" (
SET BUILD_UPDATE=1
set BUILD_UPDATE_SVN=0
set BUILD_UPDATE_GIT=1
set BUILD_UPDATE_ARGS="--no-libraries"
) 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 if "%1" == "test" (
set TEST=1
set NOBUILD=1
) else if "%1" == "format" (
set FORMAT=1
set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
goto EOF
) else (
echo Command "%1" unknown, aborting!
exit /b 1
goto ERR
)
shift /1
goto argv_loop
)
:EOF
exit /b 0
exit /b 0
:ERR
exit /b 1

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