Compare commits

...

739 Commits

Author SHA1 Message Date
dbea6c3507 Fix symmetry in pose brush, add radius preview. 2019-08-28 14:21:27 +02:00
b386d5594a Mask filter: update only modified nodes 2019-08-21 16:06:26 +02:00
2ecb4540f3 Fix merge errors 2019-08-20 19:19:26 +02:00
8c509bb69c Merge branch 'master' into sculpt-mode-features 2019-08-20 19:13:25 +02: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
d6d51674a2 Sculpt: Pose brush
This commit also includes the MOUSE_INBETWEEN events fix for other
brushes.
2019-08-16 00:12:43 +02: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
ba17acf8f4 Tweak mesh preview and cursor line width 2019-08-12 03:36:59 +02:00
12dca31682 Grab active vertex and dynamic mesh preview 2019-08-12 03:35:13 +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
ddccb5411d Set pivot position: update to new sculpt API 2019-08-06 16:48:29 +02:00
194457f332 Fix transform tool mask value 2019-08-06 16:23:09 +02:00
de28610dfa Mask expand: symmetry support 2019-08-06 16:16:19 +02:00
e1b6180e41 Topology automasking: update to new sculpt API 2019-08-06 15:50:58 +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
26e1155ca9 Mesh filters: update to new sculpt API 2019-08-05 19:50:51 +02: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
966f02a8cf Mask filter: add auto iteration count for pie menu 2019-08-05 15:41:41 +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
0ec5917cd1 Mask filter: update to new sculpt API 2019-08-05 15:24:18 +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
f7979585e2 Sculpt edit mask pie menu 2019-08-03 14:53:38 +02: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
881eb3f866 Avoid allocating memory in neighbour iteration 2019-07-31 16:28:44 +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
f4cf8193cb Changes to intern/openvdb 2019-07-31 16:06:15 +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
1bdadef21c Change neighbour array default size 2019-07-30 18:16:27 +02:00
10b2c9051d Sculpt mesh API: replace gsets with static arrays 2019-07-30 18:12:46 +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
95767bade8 Sculpt: Mesh abstaction API [WIP]
Using this API, all new tools for the sculpt branch should work with
both mesh and bmesh. I also ported mask by normal, mask expand and the
transform operator (with its mesh filter cache) in order to test it
2019-07-26 23:53:32 +02: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
84516c806b Merge branch 'master' into sculpt-mode-features 2019-07-25 14:25:22 +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
2c6e50c6c0 Fix PBVH sculpt vertex color drawing 2019-07-15 19:12:17 +02:00
77ce16299d Sculpt vertex colors: Support for Unified paint settings and secondary
color
2019-07-15 19:11:53 +02:00
c7709c8eff Fix blueprint tool matrix calculation
This should fix some plane scaling problems
2019-07-15 18:27:19 +02:00
0a964a62b2 Merge branch 'master' into sculpt-mode-features 2019-07-15 18:24:07 +02:00
cf701b0d2a Fix normal radius versioning 2019-07-09 15:24:00 +02:00
9895675b9b Fix formatting 2019-07-09 15:20:29 +02:00
3539cd38a4 Fix mask extract Windows build 2019-07-08 16:21:54 +02:00
bfff8c8bf5 Fix qex cmake 2019-07-08 16:19:00 +02:00
66cdb4df51 Blueprint tool: Initial implementation
Work in progress

- Geometry generation code is only for testing the operator. It will triangulate any
generated ngon and the normal calculation can fail.
- Snapping options are not integrated with scene settings
- Gird alignment is forced to global X axis. This can cause problems
with rotated objects.
- The tool only works from object mode. It crashes in other modes.
- Some internal grid default values are not set up properly and can make
the operator crash
- The grid preview is not integrated with the gizmo system, you need to
start the operator in order to see it
2019-07-08 16:15:47 +02:00
0997eff30c Sculpt vertex colors: add color blend modes to the paint brush
This makes all color blend modes available from the paint mode dropdown.
Source alpha is currently hardcoded to 1 to avoid confusion. The
viewport can't display it properly.
2019-07-02 15:32:47 +02:00
4ef1b6e717 Remove old mask opacity control and property 2019-06-30 01:13:41 +02:00
81e9011f57 Fix color fill mask intensity
I added this multiplication to fix the pressure sensitivity of my broken
wacom pen while testing the paint brush. I should add separate sculpt
and paint strength factors.
2019-06-30 00:36:43 +02:00
3a7b5693d1 Sculpt: Paint mask extract operator [WIP]
Currently the operator extracts a triangulated mesh from the mask and
applies a solidify modifier.
I would like to avoid using a shrinkwrap or duplicating the sculpt to
create the external edge loop. I think it should be possible to do
something similar to the relax brush to shrink the geometry to fit the
external loop within the mask.
2019-06-29 18:05:00 +02:00
ce83be4832 Cleanup and variable renaming 2019-06-29 17:35:19 +02:00
fa916b7470 Merge branch 'master' into sculpt-mode-features 2019-06-28 01:31:04 +02:00
8d17efaf7b Merge branch 'master' into sculpt-mode-features 2019-06-22 18:30:34 +02:00
5b19ecdc6b Add remesh panel to the topbar
This panel has the same options as the mesh properties remesh panel.
2019-06-16 23:16:07 +02:00
80b4987139 Fix crash with mesh filters and EEVEE 2019-06-16 23:11:24 +02:00
184b8d2bb3 Add front faces only option to the mask lasso tool 2019-06-16 23:05:15 +02:00
450e547298 Merge branch 'master' into sculpt-mode-features 2019-06-16 23:01:16 +02:00
d9fd3be084 Pose tool: Mask expand operator
This operator is designed to use with the transform.rotate tool to
create a pose tool. It generates a mask from the active vertex,
following the topology of the mesh.

The operator has two modes. It can expand the mask to the vertex under
the cursor or to a certain number of iterations. All the iterations are
cached when the operator is invoked, so it should be usable with high
poly meshes.

I also included some hardcoded mask operations when the operator
finishes. In the future, this could be included as an operator macro if
it does not have a significant performance penalty (like redrawing all
nodes each time a new operator is invoked).

It does not support symmetry and it only works with meshes (no dyntopo
or multires).

I also fixed some bugs in the transform code that were breaking EEVEE
compatibility. Undo system still fails sometimes.
2019-06-11 15:28:10 +02:00
ad5ac8c833 Mask filter: Dirty and constrast mask filters
The funcionality should be the same as the dirty vertex colors operator.
This filter can be used to generate cavity mask for sculpting and
painting. I also added a contrast filter to control the cavity mask.
The contrast filter can be implemented with a real time preview in a
future version instead of incrementing the contrast with fixed steps.
2019-06-07 16:27:59 +02:00
097157c881 Fix EEVEE/LookDev viewport updates with filter tools 2019-06-05 16:09:49 +02:00
5fde4ab1c2 Fix build after last commit
I forgot to add a couple of files
2019-06-02 23:01:53 +02:00
e36ae3c1e4 Merge branch 'master' into sculpt-mode-features 2019-05-31 23:10:45 +02:00
d79427986b Sculpt vertex colors: Color filter tool
This tool allows the manipulation of all the colors stored in the
vertices at once. Behavior and implementation are similar to the mesh
filter tool. Sculpt vertex colors are not connected to the renderer, so
the viewport does not update when EEVEE/Cycles is enabled.
I also added some separators to the toolbar to separate brushes from
filters.
2019-05-31 22:46:29 +02:00
c6a3009b15 Merge branch 'master' into sculpt-mode-features 2019-05-31 16:02:26 +02:00
711d1f7591 Merge branch 'master' into sculpt-mode-features 2019-05-21 00:59:16 +02:00
42c0bd2e90 Mask filter: add mask filter tool with iterations
Now it is possible to test the operator without editing the keymap.
By changing the iterations of the filter it should be possible to avoid
adding an unnecessary amount of undo steps when working with high poly
meshes.
2019-05-21 00:29:46 +02:00
839adc7387 Fix Windows build 2019-05-20 18:49:16 +02:00
08c0e2a35d Sculpt mode transform tool: Initial implementation
Work in progress...
- Scaling and orientations are not implemented yet.
- The "move pivot only" option is ignored when the tool is used from the
gizmo.
- Only meshes, no multires or dyntopo.

This commit also includes the operator to set the pivot point position
automatically as well as a refactor of the mesh filter cache to be shared
with the transform tool.
2019-05-19 18:10:41 +02:00
6e558c84e4 Sculpt: Mask by color operator
Similar to mask by normal, this operator generates a mask based on the
color of the active vertex.
2019-05-15 16:28:55 +02:00
c8ce96b1a2 Mesh Filter: Multithreaded initialization and masked node filtering
This should improve performance a lot, making the tool usable on several
millions of vertices. If the mesh is partially masked, only the unmasked
nodes are going to be processed, so it is possible to isolate parts of a
high poly mesh using the mask and work with them in real time.

I also changed the random displacement initialization to avoid
allocating a huge amount of memory (it wasn't really necessary)
2019-05-15 14:46:28 +02:00
485ea73b2b Mesh Filter: Init random displacement only once
The random mesh filter should be much faster now, and it should not do
weird things when adjusting the strength.
2019-05-14 23:42:54 +02:00
303cee750e Mesh Filter: Initial work for relax mesh filter
The mesh filter tool now manages its own orco cache, so there is no need
for a global orco mode using the pbvh proxies. The tool should be much
faster than before.
The code for the relax mesh filter is there, but it is disabled in the
interface until the algorithm is finished.
2019-05-14 19:25:35 +02:00
01b0d4bf31 Cleanup: comments formatting 2019-05-14 00:38:51 +02:00
66f6bd0c24 Relax Brush: Initial implementation
Work in progress. This still has a lot of bugs and I'm not sure if this
approach is the best for this kind of smoothing. The current
implementation can't handle poles with 5 vertices or more, so it doesn't
work properly with the result of the voxel remesher. It does not support
multires.
Also, I'm using gsets to store the smoothing groups. I'm sure that there
is a better way to do it. If for some reason someone enters sculpt mode
and touches a pole with 30 vertices it should not crash, but it adds an
unnecessary overhead when working with properly constructed quad meshes.
2019-05-14 00:35:31 +02:00
5be901f344 Merge branch 'master' into sculpt-mode-features 2019-05-06 18:19:53 +02:00
b66ecaf40c Fix crash on mesh filters 2019-04-29 03:48:34 +02:00
2b32296e17 Fix crash on remesh operator with a multi user mesh data.
I also added some error messages.
2019-04-28 18:53:05 +02:00
e27ab0790f Fix crash when sculpting with EEVEE/LookDev enabled 2019-04-24 17:19:52 +02:00
c47ca6adab Merge branch 'master' into sculpt-mode-features 2019-04-23 20:24:54 +02:00
ab0be1b720 Merge commit 'e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1' into sculpt-mode-features 2019-04-23 17:53:45 +02:00
eab72c5242 Merge commit 'e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1^1' into sculpt-mode-features 2019-04-23 17:50:58 +02:00
1a1152cb1b Brush Stroke: Use world spacing option
Quick hack to compute the stroke step using the world space location of
the brush over the mesh instead of the screen space distance, so the
user can avoid a lot of artifacts when sculpting across curved surfaces.
This would need to be implemented for texture/vertex/weight paint in the
future to keep the stroke system consistent.
It still has some problems with brushes that use original coordinates.
2019-04-22 19:37:49 +02:00
bad96e5c7c Sculpt mask: Mask by normal operator
This is an experimental operator that can be used to generate mask for
faces in hard surface sculpts. It does not have UI and without undo
support the behaviour is unpredictable, but this code can be used to add
another automasking mode to the automasking system.
2019-04-22 01:09:47 +02:00
bc7068c4b9 Add option to control de opacity of the sculpt mask 2019-04-20 00:09:10 +02:00
2fa9e300df further fix attempts for crashing 2019-04-17 22:25:07 +02:00
997980096f attempt to take hard edges into account at quad remeshing
(with mark sharp on edges)
2019-04-17 21:20:19 +02:00
0d3501725c Fix build with QEX disabled 2019-04-16 20:35:40 +02:00
538669942a Merge branch 'sculpt-mode-features' of git.blender.org:blender into sculpt-mode-features 2019-04-16 20:18:01 +02:00
d6acac5af8 Automasking: Open edges automasking and refactor
This new version should allow us to stack multiple automasking
operations in one brush. The UI still needs to be done for supporting
that.

This is still a binary mask, it does not have falloff, but now the code
was done with that in mind.
2019-04-16 20:16:51 +02:00
356e009914 some minor fixes for libQex dependency setup 2019-04-16 20:15:37 +02:00
31ebf10f1b initial implementation of libQex-based quad remeshing
note, still crashes often... has some memory alloc/free issues
2019-04-16 19:58:18 +02:00
a847fa4523 added rebuild levelset after grid resampling
but in general, the current grid resampling approach still seems wrong... needs more thinking
2019-04-13 12:43:39 +02:00
3d288c58d2 first attempt for allowing different voxel sizes on operands
the grids should not have offsets any more, they are being transformed and resampled.
but does not look overly great yet... and is very slow, too.
2019-04-13 01:12:33 +02:00
73da0bdf64 Voxel remesher: Reproject mask option 2019-04-12 16:49:51 +02:00
2a08dae14e added a new live remesh option.
If enabled, the modifier will be continously invoked, as usual. If disabled,
it will return the last automatically cached mesh, so basically the remesh
is "frozen", but still nondestructive / not applied yet.
Note, doesnt work yet in sculpt mode. There you may still need to apply
the modifier to update the base mesh. Or you can disable the modifier in
the stack to work on the base mesh, too. A third alternative is having
live remesh enabled with the modifier enabled, but this will cost some
sculpting performance and works at the moment only in material and rendered
mode.
2019-04-12 10:32:05 +02:00
51582bf565 Sculpt mode: Grow and shrink mask filters 2019-04-12 00:35:38 +02:00
4cd1941bb7 Mesh Filter tool: Initial implementation
This tool applies a deformation to all vertices in the sculpt taking the
mask into account. It is useful for creating surface detail or hard
surface sculpts. It is also the base for the implementation of the
transform tool.

Notes:
- The smooth filter needs multiple iterations. Right now it only applies
one iteration per tool action, so it is unusable in most cases. I don't
know if adding this is possible with the current smooth code while
supporting real-time preview.
- I'm not sure if it is properly integrated with the tool system and the
keymap (probably not).
- Only works with mesh, no dyntopo or multires.
- It still needs to ignore nodes with all vertices fully masked. Adding
this basic optimization will increase performance a lot when working
with high-resolution meshes.
- Previewing the deformation in real time is not the best option for
performance, I could add an operator that applies the filter without
preview.
2019-04-11 15:18:44 +02:00
9f371c5ca3 fix crash with openvdb filters in case the openvdb grid is invalid
invalid can mean the grid is empty or the grid class is not "LevelSet",
happens usually when the volume is empty
2019-04-11 15:01:00 +02:00
d050badf12 Fix naming 2019-04-10 01:25:00 +02:00
e910ac7c3d disabling an operand now skips unnecessary calculations
useful when transforming the disabled operand for example
2019-04-10 00:42:48 +02:00
f23ef4db63 odd transform jumps should be fixed now
instead of restoring the meshtransform on the original, a copy is made
2019-04-09 18:39:24 +02:00
8442fdb8fa fix attempt for bug when moving a shared csg operand (still odd transforms) 2019-04-09 18:24:17 +02:00
92c9111cae odd crashes on deleting objects and on load seem to be solved
turned out I needed to copy the csg operand list as well, so the walk
function has it available when it needs it.
2019-04-09 17:57:50 +02:00
89ff5976fb some improvement of the CSG UI 2019-04-09 10:44:29 +02:00
a171332887 Sculpt vertex colors: Color fill operator 2019-04-09 01:18:08 +02:00
f78f60a84e fix attempt for crashes when loading blends with volume csg objects
Note this isnt solved yet, its some weird stuff going on with pointers not in sync etc.
Must be somewhere in the object linking system...
2019-04-09 00:46:47 +02:00
c3c265a101 Sculpt mode: Mask filter operator
It includes blur and sharpen mask filters. It is not enabled for multires
yet.
2019-04-09 00:14:41 +02:00
d594fd6dc5 removed some unnecessary disabled code 2019-04-08 22:08:34 +02:00
ff98475fcc yay, multi-object volume CSG finally operational :) 2019-04-08 21:54:42 +02:00
4b721f42c8 use refactored functions for voxel remesh modifier, too 2019-04-08 10:41:53 +02:00
deaa664cc0 OpenVDB: Replace dilate and erode with offset on level set
Dilate and erode filters are now working
2019-04-08 02:25:11 +02:00
7f9b00bd46 Refactor: Move remesher functions to blenderkernel 2019-04-08 01:22:39 +02:00
d2e0afdd5e disabled a few not-yet-working options for remesh modifier (dilate/erode) 2019-04-07 22:03:26 +02:00
4c0c29a29e Enable topology automasking for the snake hook brush 2019-04-07 21:25:22 +02:00
18a5d24611 for now, CSG options disabled in python, since not functional yet 2019-04-07 20:39:43 +02:00
ba5577eea9 first attempt for CSG operations via voxels, but not functional yet 2019-04-07 20:38:09 +02:00
42876e5f2d OpenVDB: Add Filters and CSG operations to the Level Set C API
I also refactored the voxel remesher code to use the new API.
2019-04-07 04:08:45 +02:00
ade63efcdf initial implementation of the openvdb remesher inside the remesh modifier
this merges my patch now officially to the sculpt-mode-features branch :)
2019-04-06 19:17:23 +02:00
6e81e5c709 Sculpt vertex colors: Initial implementation
This adds a new CustomDataLayer to store per vertex color data in a way
that can be used from sculpt mode. This vertex paint mode uses the same
brush, pbvh, undo and rendering code as sculpt mode, so it has much
better performance.  It also enables other features like sculpting and
painting at the same time.

I also added some extra features that are needed to start testing this
paint mode, such as:
- New paint brush optimized for painting. It doesn't modify any vertex
position data.
- Sculpt mode sample color operator that uses the active vertex from the
cursor
- Remesh reprojection support: sculpt vertex colors are reprojected into
the new mesh when using the remesh operator if the mesh has that option
enabled.
- Store and load sculpt vertex colors into the regular vertex color
layers to keep compatibility.
- Use the single color display mode to disable sculpt vertex colors in
sculpt mode.

A lot of decisions needs to be made to integrate this in Blender, so I
decided to keep the implementation as unintrusive as possible to start
working on the tools. This has the following limitations:

- Sculpt and paint at the same time is only enabled in the draw brush.
You need to set the Color Mode to Mix in the brush options.
- Dyntopo and multires modes and viewport display are broken
- Only mix as a color blend mode
- No brush texture support
- Sculpt and color share the same strength
- Limited to one layer per object
- No rendering support. You will need to copy the sculpt vertex colors
to the old color layers first.

All of these issues should be addressed once the main workflow, final UI
and behavior are decided.
2019-04-05 17:56:58 +02:00
159bbb7755 Enable OpenVDB by default
The voxel remesher needs OpenVDB to work. Maybe I should add an option
to disable building the voxel remesher in the future.
Patch by Jun Mizutani (@jmztn).
2019-04-03 01:28:07 +02:00
b4902ccc24 Fix crash on vertex and weight paint
I think the crash was related to the new viewport navigation. I'm not
sure if this is the correct way to fix this, but now vertex and weight
paint are working again.
2019-04-03 01:21:45 +02:00
097997c015 Fix pad error after merge 2019-04-03 01:15:22 +02:00
8b54c524be Merge branch 'master' into sculpt-mode-features 2019-04-03 01:03:31 +02:00
b0169056df Ignore normal radius on vertex and weight paint 2019-04-03 00:54:29 +02:00
d14017cdcb View Navigation: 2D viewport zooming
This implements the same concept of 2D viewport panning but for zooming.
It prevents unexpected zoom speeds when working with a pen tablet.
Zoom speed is constant and it is based on the initial distance to the
working area. Speed parameters are hardcoded for now, but they can be
exposed as options or replaced by a variable zoom speed.
I also reduced the rotation speed when 2D viewport panning is enabled
for consistency.
This navigation mode is enabled by activating 2D viewport panning in the
navigation preferences. That option should be renamed in the future.
Enabling and disabling perspective is broken most of the time, but it
also happens in master. I'm not sure if these changes are making the
problem worse.
2019-03-30 21:27:56 +01:00
1df1337dcb Merge branch 'master' into sculpt-mode-features 2019-03-24 04:02:07 +01:00
7c194b367e Automasking System: Topology automasking initial implementation
This commit adds a general automasking system and the topology
automasking option (not topology falloff, that can be added later). It
should be faster and with fewer memory errors that the last version I
made. It is designed to work with every brush and every stroke mode, but
for now, I only added support for draw and grab to avoid changing every
brush until the system is more polished.

The main purpose of adding this in such an early stage of development is
to check if the cursor is working correctly. The purpose of the vertex
preview in the cursor was to show the active vertex for automasking, so
now I can test if the whole system is behaving as it should.

Limitations:
- Only meshes for now (no dyntopo or multires). I still need to think
about what to do with dyntopo. I don't know if brushes that generate new
topology are going to work with this.
- It only stores a binary mask (a vertex can be active or not). This
could be changed if the future to support topological falloff or other
more complex types of automasking.
- As it is now, brushes that use stroke space update the active vertex
dynamically, setting it to the closest vertex to the brush location each
sample. This often causes masking errors with small brushes. I'm
considering changing it to always check topology using the initial
active vertex, but it is going to be much slower.
2019-03-22 16:16:51 +01:00
a92fb8a045 Add proportional editing presets to sculpt brushes
When sculpting, I always found that the behavior of the current curve
falloff system is not correct, so I added the same curves that
proportional editing uses to the brush falloff calculation. Now, curves
are easier to set up and they produce a much better result. You can
easily compare it against the old method by changing the curve preset
option from custom to smooth in the grab brush.

To make the new dam brush behave correctly, you need to select the
sharper curve preset. You can also use it to insert shapes using the
stroke anchored option and changing the curve preset.
2019-03-20 23:17:19 +01:00
55d482bf40 Mask tools: Fix crash with dyntopo and lasso mask
Ignore the front facing option with dyntopo. I will properly fix this
later.
2019-03-20 20:35:28 +01:00
726773588c Voxel Remesher: Add remesher parameters to mesh datablock
I tested several UI integrations:
-Running the remesher from an operator and adjusting the parameters with
the redo panel freezes the interface with high-res meshes. It looks
cool, but it is not that useful.
-Integrating it into a tool does not store per object remesh
configurations. It also forces the user to switch the tool when he/she is
sculpting just to recalculate the topology.

Storing the remesher options per mesh is the best option I found. Now,
the remesher is found in the properties panel under the mesh tab. The
user can assign it to the quick favorites menu or add a keyboard
shortcut.
Remesher parameters can be adjusted there. They are stored per mesh.
This way, remesher parameters of each mesh are preserved when sculpting
different objects at different levels of details. In the future, the user
will be able to choose different remeshing algorithms (triangulation,
quadriflow...) from there and assign them to the mesh. All of them will
be executed by the same remesh operator and some of them will share some
options (like smooth normals).
2019-03-20 03:34:07 +01:00
af8fe4e94e Voxel remesher: Add support for undo from sculpt mode
Only undo for now, no redo.
This will need a lot of work and refactoring in the future (it has a lot
of bugs), but now it is safer to test new features without losing work.
2019-03-19 23:07:22 +01:00
75b1f625dd Mask tools: Option to mask only front faces with lasso mask
It still needs to be added to the keymap or as a tool setting.
2019-03-19 02:13:59 +01:00
00f2700b75 Merge branch 'master' into sculpt-mode-features 2019-03-18 17:30:19 +01:00
378baee498 Dam brush: Initial implementation
The purpose of this brush is to create sharp edges without creasing or
pinching the geometry. It is useful when sculpting cloth wrinkles, hard
surface objects or small cavities.
To avoid artifacts, set the stroke spacing to a lower value than 10 and
enable symmetry feather. This affects performance, so I am not adding it
to the defaults for now.
It does not create new geometry in dyntopo, so you will need to create
the geometry with another tool or switch to the voxel remesher workflow.
I'm not quite happy with the deformation as it is now (maybe it is too
smooth). I also need to try the brush with different pen tablets to
properly calibrate the pressure.
2019-03-18 04:36:35 +01:00
0f1c86542e Brush cursor: Fix smooth stroke line position
Reset the viewport to its original state after drawing the vertex
preview.
2019-03-18 02:31:04 +01:00
45dbf1835f Brush cursor: Fix crash with 2D falloff
Disable the normal preview when 2D falloff is enabled.
2019-03-16 19:27:10 +01:00
b88ba40183 Brush cursor: Fix bug in tiling preview 2019-03-16 03:05:03 +01:00
dc1a17501d Brush cursor: Radial symmetry and tiling preview support 2019-03-16 02:09:04 +01:00
2bf0495d5c Voxel remesher: add option to smooth normals when remeshing 2019-03-15 00:35:31 +01:00
e2f23d91b9 OpenVDB Voxel remesher: Initial implementation
This introduces a new workflow for sculpting. The voxel remesher works
with Dyntopo disabled. The user needs to run it manually once he/she
considers that the topology is too stretched to continue sculpting
normally. OpenVDB evaluates the mesh volume as a level set with a given
voxel size and it always outputs an all quads manifold mesh. It
automatically solves self-intersections and geometry errors produced by
booleans, which Dyntopo can't solve right now. Once the new mesh is
calculated, the user can continue sculpting without the overhead of
having Dyntopo enabled.

It still needs a proper UI and it has some issues. Undo is not working
on a remeshed object.
2019-03-14 21:54:27 +01:00
b342c293a9 Grab Brush: Use smooth curve deformation
For now, this ignores the brush curve. The brush curve does't make sense
in some brushes and in other ones it should be optional (like in the
grab brush). This needs design to integrate with the UI.
2019-03-13 18:09:37 +01:00
72c4264277 Brush Cursor: show minimal mouse cursor by default
The brush cursor is disabled when manipulating the viewport, so you
would not have any mouse feedback if the mouse cursor is completely
disabled. This also displays the cursor position without relying on
internal brush updates when the stroke is active.
2019-03-13 17:34:04 +01:00
91d16ceb56 View Navigation: 2D viewport panning
This option helps to keep the working area under control when working
with brushes, especially if this feature is used with rotate around
selection enabled. Now, panning speed does not depend on zoom level and
it behaves more similarly to a 2D environment.

The option certainly needs a better name and description, and it could
be a good idea to hide and disable it if rotate around selection is
disabled.

Mode info: D3931
2019-03-13 17:26:54 +01:00
9336694916 Add defaults and versioning to normal radius
Patch by @jmztn
2019-03-13 16:32:25 +01:00
d55ea7bf81 New sculpt brush cursor with normal radius
From D3594
2019-03-13 16:18:30 +01:00
1075 changed files with 64514 additions and 39775 deletions

View File

@@ -241,7 +241,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

View File

@@ -182,6 +182,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 +239,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)
@@ -397,6 +400,9 @@ endif()
option(WITH_CPU_SSE "Enable SIMD instruction if they're detected on the host machine" ON)
mark_as_advanced(WITH_CPU_SSE)
option(WITH_QEX "Enable libQEx support" ON)
# Cycles
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
@@ -413,6 +419,8 @@ 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)
@@ -471,7 +479,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
@@ -544,6 +552,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -822,12 +834,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()
@@ -852,7 +858,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 +870,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 +879,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 +890,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()
@@ -1760,6 +1770,7 @@ 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)

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.
@@ -221,6 +223,23 @@ ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake"
endif
ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake"
endif
# -----------------------------------------------------------------------------
# build tool
ifneq "$(findstring ninja, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -G Ninja
BUILD_COMMAND:=ninja
else
ifneq ("$(wildcard $(BUILD_DIR)/build.ninja)","")
BUILD_COMMAND:=ninja
else
BUILD_COMMAND:=make -s
endif
endif
# -----------------------------------------------------------------------------
# Blender binary path
@@ -282,7 +301,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 +313,8 @@ lite: all
cycles: all
headless: all
bpy: all
developer: all
ninja: all
# -----------------------------------------------------------------------------
# Build dependencies
@@ -312,7 +333,7 @@ deps: .FORCE
@echo
@echo Building dependencies ...
$(MAKE) -C "$(DEPS_BUILD_DIR)" -s -j $(NPROCS) $(DEPS_TARGET)
$(BUILD_COMMAND) -C "$(DEPS_BUILD_DIR)" -j $(NPROCS) $(DEPS_TARGET)
@echo
@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
@echo
@@ -548,7 +569,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

@@ -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)
@@ -155,4 +157,9 @@ if(UNIX)
include(cmake/sqlite.cmake)
endif()
include(cmake/openmesh.cmake)
include(cmake/lapack.cmake)
include(cmake/igl.cmake)
include(cmake/qex.cmake)
include(cmake/harvest.cmake)

View File

@@ -33,19 +33,9 @@ if(WIN32)
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_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_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

@@ -166,6 +166,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")
@@ -200,4 +202,13 @@ harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(openmesh/include openmesh/include "*")
harvest(openmesh/lib openmesh/lib "*.a")
harvest(lapack/lib lapack/lib "*.a")
harvest(lapack/include lapack/include "*.h")
harvest(igl/include igl/include "*")
harvest(igl/lib igl/lib "*.a")
harvest(qex/include qex/include "*.h")
harvest(qex/lib qex/lib "*.a")
endif()

View File

@@ -0,0 +1,70 @@
# ***** 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(IGL_EXTRA_ARGS
-DLIBIGL_BUILD_PYTHON=OFF
-DLIBIGL_BUILD_TESTS=OFF
-DLIBIGL_BUILD_TUTORIALS=OFF
-DLIBIGL_USE_STATIC_LIBRARY=ON
-DLIBIGL_WITHOUT_COPYLEFT=OFF
-DLIBIGL_WITH_CGAL=OFF
-DLIBIGL_WITH_COMISO=ON
-DLIBIGL_WITH_CORK=OFF
-DLIBIGL_WITH_EMBREE=OFF
-DLIBIGL_WITH_MATLAB=OFF
-DLIBIGL_WITH_MOSEK=OFF
-DLIBIGL_WITH_OPENGL=OFF
-DLIBIGL_WITH_OPENGL_GLFW=OFF
-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF
-DLIBIGL_WITH_PNG=OFF
-DLIBIGL_WITH_PYTHON=OFF
-DLIBIGL_WITH_TETGEN=OFF
-DLIBIGL_WITH_TRIANGLE=OFF
-DLIBIGL_WITH_XML=OFF
-DBLAS_LIBRARIES=${LIBDIR}/lapack/lib/libblas.a
)
ExternalProject_Add(external_igl
URL ${IGL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${IGL_HASH}
PREFIX ${BUILD_DIR}/igl
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igl -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${IGL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/igl
)
ExternalProject_Add_Step(external_igl after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/igl/src/external_igl/include/igl/copyleft/comiso
${LIBDIR}/igl/include/igl/copyleft/comiso
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/igl/src/external_igl-build/libigl_comiso.a
${LIBDIR}/igl/lib/libigl_comiso.a
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/igl/src/external_igl-build/libCoMISo.a
${LIBDIR}/igl/lib/libCoMISo.a
COMMAND ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/igl/src/external_igl/external/eigen/Eigen
${LIBDIR}/igl/include/eigen/Eigen
DEPENDEES install
)
add_dependencies(
external_igl
external_lapack
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAPACK_EXTRA_ARGS
)
ExternalProject_Add(external_lapack
URL ${LAPACK_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${LAPACK_HASH}
PREFIX ${BUILD_DIR}/lapack
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lapack -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${LAPACK_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/lapack
)

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

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

@@ -0,0 +1,45 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENMESH_EXTRA_ARGS
-DBUILD_APPS=OFF
-DDISABLE_QMAKE_BUILD=ON
)
ExternalProject_Add(external_openmesh
URL ${OPENMESH_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENMESH_HASH}
PREFIX ${BUILD_DIR}/openmesh
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openmesh/src/external_openmesh < ${PATCH_DIR}/openmesh.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmesh -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENMESH_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openmesh
)
if (BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openmesh after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCored.a
${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCore.a
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshToolsd.a
${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshTools.a
DEPENDEES install
)
endif()

View File

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

@@ -0,0 +1,52 @@
# ***** 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(QEX_EXTRA_ARGS
-DOPENMESH_CORE_LIBRARY=${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshCore.a
-DOPENMESH_INCLUDE_DIR=${LIBDIR}/openmesh/include
-DOPENMESH_LIBRARY_DIR=${LIBDIR}/openmesh/lib/OpenMesh
-DOPENMESH_TOOLS_LIBRARY=${LIBDIR}/openmesh/lib/OpenMesh/libOpenMeshTools.a
)
ExternalProject_Add(external_qex
URL ${QEX_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${QEX_HASH}
PREFIX ${BUILD_DIR}/qex
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/qex/src/external_qex < ${PATCH_DIR}/qex.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/qex -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${QEX_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/qex
)
#grr, INSTALL(TARGETS has no exclude pattern, so removing unnecessary empty dirs here
ExternalProject_Add_Step(external_qex after_install
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/lib/src
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/lib/interfaces
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/lib/demo
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/include/src
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/include/interfaces
COMMAND ${CMAKE_COMMAND} -E remove_directory ${LIBDIR}/qex/include/demo
DEPENDEES install
)
add_dependencies(
external_qex
external_igl
external_openmesh
)

View File

@@ -18,7 +18,7 @@
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
-DTBB_BUILD_TBBMALLOC=Off
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)

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

@@ -143,11 +143,11 @@ 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_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
@@ -157,16 +157,16 @@ 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)
@@ -302,3 +302,30 @@ 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)
<<<<<<< HEAD
set(IGL_VERSION 2.0.0)
set(IGL_URI https://github.com/libigl/libigl/archive/v${IGL_VERSION}.tar.gz)
set(IGL_HASH 42518e6b106c7209c73435fd260ed5d34edeb254852495b4c95dce2d95401328)
#should match qex, but what about comiso ?
set(OPENMESH_VERSION 8.0)
set(OPENMESH_URI http://www.openmesh.org/media/Releases/${OPENMESH_VERSION}/OpenMesh-${OPENMESH_VERSION}.tar.gz)
#set(OPENMESH_HASH 96c595c1683b1ad950e80464ae5fc1f3c8dc45c31c8a211122a23e16a076ab23) #3.0
set(OPENMESH_HASH 8974d44026cacaa37b171945b5c96a284bfd32c9df9d671d62931050d057ec82)
#latest uid in git as of 2016-10-25
set(QEX_GIT_UID 1d33e0d6700dd3d00df984aad776d9537fcf16af)
set(QEX_URI https://github.com/hcebke/libQEx/archive/${QEX_GIT_UID}.tar.gz)
set(QEX_HASH a29cf440c7b83c9e803d1f55247cd18e9c277b3845edce5d381c4c91daa90452)
#latest uid in release branch 3.8.0
set(LAPACK_GIT_UID ba3779a6813d84d329b73aac86afc4e041170609)
set(LAPACK_URI https://github.com/Reference-LAPACK/lapack-release/archive/${LAPACK_GIT_UID}.tar.gz)
set(LAPACK_HASH 4bd7a3014ee2b5c7cdcdc8960c9476b689f21796715aa03fd719c92c43faee31)
=======
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)
>>>>>>> master

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
@@ -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
@@ -526,6 +545,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 +594,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 +639,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 +661,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 +704,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 +749,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 +779,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 +876,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 +923,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
@@ -2552,6 +2594,96 @@ 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
}
#### Build FFMPEG ####
_init_ffmpeg() {
_src=$SRC/ffmpeg-$FFMPEG_VERSION
@@ -3148,6 +3280,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..."
@@ -3722,6 +3872,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..."
@@ -4186,6 +4354,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 +4558,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..."
@@ -4587,6 +4791,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

@@ -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,12 @@
--- CMakeLists.txt 2019-04-13 21:03:18.119000842 +0200
+++ CMakeLists.txt 2019-04-13 20:59:01.521760285 +0200
@@ -92,7 +92,7 @@
set (OPENMESH_LIBRARY_DIR "${_OPENMESH_LIBRARY_DIR}" CACHE PATH "The directory where the OpenMesh libraries can be found.")
endif()
-add_subdirectory (Doc)
+#add_subdirectory (Doc)
# ========================================================================
# Bundle generation (Targets exist, now configure them)

View File

@@ -0,0 +1,44 @@
--- CMakeLists.txt 2019-01-13 19:55:24.920548897 +0100
+++ CMakeLists.txt 2019-04-13 23:36:50.517127296 +0200
@@ -129,12 +129,20 @@
add_subdirectory(tests)
endif()
+set_target_properties(QEx PROPERTIES PUBLIC_HEADER "interfaces/c/qex.h")
+set_target_properties(QExStatic PROPERTIES PUBLIC_HEADER "interfaces/c/qex.h")
-find_package(Doxygen)
-if (DOXYGEN_FOUND)
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
- add_custom_target(qex_doc
- ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
- COMMENT "Generating Doxygen documentation" VERBATIM)
-endif()
+install(TARGETS QEx QExStatic
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ PUBLIC_HEADER DESTINATION include
+)
+
+#find_package(Doxygen)
+#if (DOXYGEN_FOUND)
+# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
+# add_custom_target(qex_doc
+# ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
+# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
+# COMMENT "Generating Doxygen documentation" VERBATIM)
+#endif()
--- src/predicates.c 2019-04-14 22:27:37.975746000 +0200
+++ src/predicates.c 2019-04-14 22:27:50.059746000 +0200
@@ -1227,7 +1227,7 @@
/* */
/*****************************************************************************/
-int compress(elen, e, h) /* e and h may be the same. */
+int compress1(elen, e, h) /* e and h may be the same. */
int elen;
REAL *e;
REAL *h;

View File

@@ -6,7 +6,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
# 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
# Other builders we are running 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")

View File

@@ -0,0 +1,96 @@
# - Find IGL library
# Find the native IGL includes and library
# This module defines
# IGL_INCLUDE_DIRS, where to find igl.h, Set when
# IGL_INCLUDE_DIR is found.
# IGL_LIBRARIES, libraries to link against to use IGL.
# IGL_ROOT_DIR, The base directory to search for IGL.
# This can also be an environment variable.
# IGL_FOUND, If false, do not try to use IGL.
#
# also defined, but not for general use are
# IGL_LIBRARY, where to find the IGL library.
#=============================================================================
# Copyright 2015 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 IGL_ROOT_DIR was defined in the environment, use it.
IF(NOT IGL_ROOT_DIR AND NOT $ENV{IGL_ROOT_DIR} STREQUAL "")
SET(IGL_ROOT_DIR $ENV{IGL_ROOT_DIR})
ENDIF()
SET(_igl_SEARCH_DIRS
${IGL_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/igl
/opt/lib/igl
)
FIND_PATH(IGL_INCLUDE_DIR
NAMES
igl/AABB.h #there is no igl.h, but a lot of different headers, just pick the first here
HINTS
${_igl_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(IGL_LIBRARY
NAMES
igl
HINTS
${_igl_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(IGL_COMISO_LIBRARY
NAMES
igl_comiso
HINTS
${_igl_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(COMISO_LIBRARY
NAMES
CoMISo
HINTS
${_igl_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set IGL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IGL DEFAULT_MSG
IGL_LIBRARY IGL_COMISO_LIBRARY COMISO_LIBRARY IGL_INCLUDE_DIR)
IF(IGL_FOUND)
SET(IGL_LIBRARIES ${IGL_LIBRARY}
${IGL_COMISO_LIBRARY}
${COMISO_LIBRARY})
SET(IGL_INCLUDE_DIRS ${IGL_INCLUDE_DIR})
ENDIF(IGL_FOUND)
MARK_AS_ADVANCED(
IGL_INCLUDE_DIR
IGL_LIBRARY
IGL_COMISO_LIBRARY
COMISO_LIBRARY
)
UNSET(_igl_SEARCH_DIRS)

View File

@@ -0,0 +1,83 @@
# - Find LAPACK library
# Find the native LAPACK includes and library
# This module defines
# LAPACK_INCLUDE_DIRS, where to find lapack.h, Set when
# LAPACK_INCLUDE_DIR is found.
# LAPACK_LIBRARIES, libraries to link against to use LAPACK.
# LAPACK_ROOT_DIR, The base directory to search for LAPACK.
# This can also be an environment variable.
# LAPACK_FOUND, If false, do not try to use LAPACK.
#
# also defined, but not for general use are
# LAPACK_LIBRARY, where to find the LAPACK library.
#=============================================================================
# Copyright 2015 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 LAPACK_ROOT_DIR was defined in the environment, use it.
IF(NOT LAPACK_ROOT_DIR AND NOT $ENV{LAPACK_ROOT_DIR} STREQUAL "")
SET(LAPACK_ROOT_DIR $ENV{LAPACK_ROOT_DIR})
ENDIF()
SET(_lapack_SEARCH_DIRS
${LAPACK_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lapack
/opt/lib/lapack
)
#FIND_PATH(LAPACK_INCLUDE_DIR
# NAMES
# lapack/AABB.h #there is no lapack.h, but a lot of different headers, just pick the first here
# HINTS
# ${_lapack_SEARCH_DIRS}
# PATH_SUFFIXES
# include
#)
FIND_LIBRARY(LAPACK_LIBRARY
NAMES
lapack
HINTS
${_lapack_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(BLAS_LIBRARY
NAMES
blas
HINTS
${_lapack_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LAPACK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LAPACK DEFAULT_MSG
LAPACK_LIBRARY BLAS_LIBRARY)
IF(LAPACK_FOUND)
SET(LAPACK_LIBRARIES ${LAPACK_LIBRARY} ${BLAS_LIBRARY})
#SET(LAPACK_INCLUDE_DIRS ${LAPACK_INCLUDE_DIR})
ENDIF(LAPACK_FOUND)
MARK_AS_ADVANCED(
#LAPACK_INCLUDE_DIR
LAPACK_LIBRARY
)
UNSET(_lapack_SEARCH_DIRS)

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,87 @@
# - Find OPENMESH library
# Find the native OPENMESH includes and library
# This module defines
# OPENMESH_INCLUDE_DIRS, where to find openmesh.h, Set when
# OPENMESH_INCLUDE_DIR is found.
# OPENMESH_LIBRARIES, libraries to link against to use OPENMESH.
# OPENMESH_ROOT_DIR, The base directory to search for OPENMESH.
# This can also be an environment variable.
# OPENMESH_FOUND, If false, do not try to use OPENMESH.
#
# also defined, but not for general use are
# OPENMESH_LIBRARY, where to find the OPENMESH library.
#=============================================================================
# Copyright 2015 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 OPENMESH_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENMESH_ROOT_DIR AND NOT $ENV{OPENMESH_ROOT_DIR} STREQUAL "")
SET(OPENMESH_ROOT_DIR $ENV{OPENMESH_ROOT_DIR})
ENDIF()
#SET(OPENMESH_INCLUDE_DIR ${OPENMESH_ROOT_DIR}/include)
SET(_openmesh_SEARCH_DIRS
${OPENMESH_ROOT_DIR}
#${OPENMESH_ROOT_DIR}/include/OpenMesh/Core/Geometry
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/openmesh
/opt/lib/openmesh
)
FIND_PATH(OPENMESH_INCLUDE_DIR
NAMES
OpenMesh
HINTS
${_openmesh_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(OPENMESH_CORE_LIBRARY
NAMES
OpenMeshCore
HINTS
${_openmesh_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib/OpenMesh
)
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY
NAMES
OpenMeshTools
HINTS
${_openmesh_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib/OpenMesh
)
# handle the QUIETLY and REQUIRED arguments and set OPENMESH_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENMESH DEFAULT_MSG
OPENMESH_CORE_LIBRARY OPENMESH_TOOLS_LIBRARY OPENMESH_INCLUDE_DIR)
IF(OPENMESH_FOUND)
SET(OPENMESH_LIBRARIES ${OPENMESH_CORE_LIBRARY} ${OPENMESH_TOOLS_LIBRARY})
SET(OPENMESH_INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR})
ENDIF(OPENMESH_FOUND)
MARK_AS_ADVANCED(
OPENMESH_INCLUDE_DIR
OPENMESH_CORE_LIBRARY
OPENMESH_TOOLS_LIBRARY
)
UNSET(_openmesh_SEARCH_DIRS)

View File

@@ -0,0 +1,74 @@
# - Find QEX library
# Find the native QEX includes and library
# This module defines
# QEX_INCLUDE_DIRS, where to find qex.h, Set when
# QEX_INCLUDE_DIR is found.
# QEX_LIBRARIES, libraries to link against to use QEX.
# QEX_ROOT_DIR, The base directory to search for QEX.
# This can also be an environment variable.
# QEX_FOUND, If false, do not try to use QEX.
#
# also defined, but not for general use are
# QEX_LIBRARY, where to find the QEX library.
#=============================================================================
# Copyright 2015 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 QEX_ROOT_DIR was defined in the environment, use it.
IF(NOT QEX_ROOT_DIR AND NOT $ENV{QEX_ROOT_DIR} STREQUAL "")
SET(QEX_ROOT_DIR $ENV{QEX_ROOT_DIR})
ENDIF()
SET(_qex_SEARCH_DIRS
${QEX_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/qex
/opt/lib/qex
)
FIND_PATH(QEX_INCLUDE_DIR
NAMES
qex.h
HINTS
${_qex_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(QEX_LIBRARY
NAMES
QExStatic
HINTS
${_qex_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set QEX_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QEX DEFAULT_MSG
QEX_LIBRARY QEX_INCLUDE_DIR)
IF(QEX_FOUND)
SET(QEX_LIBRARIES ${QEX_LIBRARY})
SET(QEX_INCLUDE_DIRS ${QEX_INCLUDE_DIR})
ENDIF(QEX_FOUND)
MARK_AS_ADVANCED(
QEX_INCLUDE_DIR
QEX_LIBRARY
)
UNSET(_qex_SEARCH_DIRS)

View File

@@ -50,6 +50,10 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST)
INCLUDE_DIRECTORIES "${TEST_INC}")
if(${DO_ADD_TEST})
add_test(NAME ${NAME}_test COMMAND ${TESTS_OUTPUT_DIR}/${NAME}_test WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>)
# Don't fail tests on leaks since these often happen in external libraries
# that we can't fix.
set_tests_properties(${NAME}_test PROPERTIES ENVIRONMENT LSAN_OPTIONS=exitcode=0)
endif()
endif()
endmacro()

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

@@ -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,6 +40,7 @@ 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)

View File

@@ -45,6 +45,7 @@ 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)

View File

@@ -41,6 +41,7 @@ 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)

File diff suppressed because it is too large Load Diff

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

@@ -382,6 +382,19 @@ if(WITH_CYCLES_EMBREE)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
endif()
if(WITH_OPENIMAGEDENOISE)
find_package(OpenImageDenoise)
find_package(TBB)
if(NOT OPENIMAGEDENOISE_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "OpenImageDenoise not found")
elseif(NOT TBB_FOUND)
set(WITH_OPENIMAGEDENOISE OFF)
message(STATUS "TBB not found")
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

@@ -368,6 +368,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 +416,32 @@ if(WITH_OPENSUBDIV)
endif()
endif()
if(WITH_QEX)
find_package_wrapper(LAPACK)
if(NOT LAPACK_FOUND)
set(WITH_IGL OFF)
message(STATUS "LAPACK/BLAS not found, disabling WITH_QEX")
endif()
find_package_wrapper(OpenMesh)
if(NOT OPENMESH_FOUND)
set(WITH_IGL OFF)
message(STATUS "OpenMesh not found, disabling WITH_QEX")
endif()
find_package_wrapper(Igl)
if(NOT IGL_FOUND)
set(WITH_IGL OFF)
message(STATUS "IGL not found, disabling WITH_QEX")
endif()
find_package_wrapper(Qex)
if(NOT QEX_FOUND)
set(WITH_QEX OFF)
message(STATUS "QEx not found, disabling WITH_QEX")
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

@@ -131,8 +131,8 @@ 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")
@@ -144,6 +144,11 @@ 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")
#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 ")
@@ -166,8 +171,7 @@ 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)
@@ -343,18 +347,16 @@ 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}" )
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
endif()
if(WITH_BOOST)
@@ -381,9 +383,6 @@ if(WITH_BOOST)
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")
endif()
set(BOOST_LIBRARIES
optimized ${BOOST_LIBPATH}/libboost_date_time-${BOOST_POSTFIX}
@@ -419,7 +418,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 +459,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
)
@@ -478,19 +477,32 @@ 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 ${LIBDIR}/openVDB)
set(OPENVDB_LIBPATH ${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_DEFINITIONS -DNOMINMAX)
endif()
if(WITH_OPENIMAGEDENOISE)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(OPENIMAGEDENOISE ${LIBDIR}/OpenImageDenoise)
set(OPENIMAGEDENOISE_LIBPATH ${LIBDIR}/OpenImageDenoise/lib)
set(OPENIMAGEDENOISE_INCLUDE_DIRS ${OPENIMAGEDENOISE}/include ${TBB_INCLUDE_DIR})
set(OPENIMAGEDENOISE_LIBRARIES
optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib ${OPENIMAGEDENOISE_LIBPATH}/common.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib
${TBB_LIBRARIES})
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()

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

@@ -2,11 +2,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_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%" == "" (

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

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

@@ -2,10 +2,6 @@ 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
goto detect_done
)
echo clang-format not found
exit /b 1
@@ -13,8 +9,17 @@ 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 %BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe (
set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\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.

View File

@@ -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" (
@@ -97,10 +100,12 @@ if NOT "%1" == "" (
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

View File

@@ -7,7 +7,6 @@ set BUILD_VS_YEAR=
set BUILD_VS_LIBDIRPOST=
set BUILD_VS_LIBDIR=
set BUILD_VS_SVNDIR=
set BUILD_NGE=
set KEY_NAME=
set MSBUILD_PLATFORM=
set MUST_CLEAN=

View File

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

View File

@@ -17,13 +17,12 @@ echo - format [path] ^(Format the source using clang-format, path is optional, r
echo.
echo Configuration options
echo - verbose ^(enable diagnostic output during configuration^)
echo - developer ^(enable faster builds, error checking and tests, recommended for developers^)
echo - with_tests ^(enable building unit tests^)
echo - nobuildinfo ^(disable buildinfo^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - buildir [newdir] ^(override default build folder^)
echo - x86 ^(override host auto-detect and build 32 bit code^)
echo - x64 ^(override host auto-detect and build 64 bit code^)
echo - 2017 ^(build with visual studio 2017^)
echo - 2017pre ^(build with visual studio 2017 pre-release^)
echo - 2017b ^(build with visual studio 2017 Build Tools^)

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "V2.79"
PROJECT_NUMBER = "V2.81"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -177,7 +177,7 @@ font:
With the new truetype option in Blender, this is used for all font families
When a uiBlock is created, each uiButton that is defined gets the uiBlock properties.
Changing Block properties in between will affact uiButtons defined thereafter.
Changing Block properties in between will effect uiButtons defined thereafter.

View File

@@ -40,7 +40,7 @@ In most cases you can figure out what context an operator needs
simply be seeing how it's used in Blender and thinking about what it does.
Unfortunately if you're still stuck - the only way to **really** know
whats going on is to read the source code for the poll function and see what its checking.
what's going on is to read the source code for the poll function and see what its checking.
For Python operators it's not so hard to find the source
since it's included with Blender and the source file/line is included in the operator reference docs.
@@ -125,7 +125,7 @@ While a script executes Blender waits for it to finish and is effectively locked
while in this state Blender won't redraw or respond to user input.
Normally this is not such a problem because scripts distributed with Blender
tend not to run for an extended period of time,
nevertheless scripts *can* take ages to execute and its nice to see whats going on in the view port.
nevertheless scripts *can* take ages to execute and its nice to see what's going on in the view port.
Tools that lock Blender in a loop and redraw are highly discouraged
since they conflict with Blenders ability to run multiple operators

View File

@@ -317,7 +317,9 @@ To run the script:
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
#. Click on the button **Run Script**.
#. Move your cursor into the 3D view, press spacebar for the operator search menu, and type "Simple".
#. Move your cursor into the 3D Viewport,
open the :ref:`operator search menu <blender_manual:bpy.ops.wm.search_menu>`,
and type "Simple".
#. Click on the "Simple Operator" item found in search.

View File

@@ -239,7 +239,7 @@ Drop Into a Python Interpreter in Your Script
=============================================
In the middle of a script you may want to inspect some variables,
run some function and generally dig about to see whats going on.
run some function and generally dig about to see what's going on.
.. code-block:: python

View File

@@ -1,3 +1,16 @@
diff --git a/extern/bullet2/src/LinearMath/btVector3.h b/extern/bullet2/src/LinearMath/btVector3.h
index 839b19c..3058195 100644
--- a/extern/bullet2/src/LinearMath/btVector3.h
+++ b/extern/bullet2/src/LinearMath/btVector3.h
@@ -39,7 +39,7 @@ subject to the following restrictions:
#endif
-#define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
+#define BT_SHUFFLE(x,y,z,w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)
//#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define bt_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define bt_splat3_ps( _a, _i ) bt_pshufd_ps((_a), BT_SHUFFLE(_i,_i,_i, 3) )
diff --git a/extern/bullet2/src/LinearMath/btScalar.h b/extern/bullet2/src/LinearMath/btScalar.h
--- a/extern/bullet2/src/LinearMath/btScalar.h
+++ b/extern/bullet2/src/LinearMath/btScalar.h

View File

@@ -39,7 +39,7 @@ subject to the following restrictions:
#endif
#define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
#define BT_SHUFFLE(x,y,z,w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)
//#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define bt_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define bt_splat3_ps( _a, _i ) bt_pshufd_ps((_a), BT_SHUFFLE(_i,_i,_i, 3) )

View File

@@ -76,3 +76,8 @@ endif()
if(WITH_OPENVDB)
add_subdirectory(openvdb)
endif()
if(WITH_QEX)
add_definitions(-DWITH_QEX)
add_subdirectory(qex)
endif()

View File

@@ -178,11 +178,13 @@ if(CXX_HAS_AVX2)
endif()
if(WITH_CYCLES_OSL)
# LLVM and OSL need to build without RTTI
if(WIN32 AND MSVC)
set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
endif()
# Definitions and Includes

View File

@@ -1002,6 +1002,9 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
oldcurve_keys.steal_data(mesh->curve_keys);
oldcurve_radius.steal_data(mesh->curve_radius);
/* ensure bvh rebuild (instead of refit) if has_voxel_attributes() changed */
bool oldhas_voxel_attributes = mesh->has_voxel_attributes();
mesh->clear();
mesh->used_shaders = used_shaders;
mesh->name = ustring(b_ob_data.name().c_str());
@@ -1050,7 +1053,8 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph &b_depsgraph,
/* tag update */
bool rebuild = (oldtriangles != mesh->triangles) || (oldsubd_faces != mesh->subd_faces) ||
(oldsubd_face_corners != mesh->subd_face_corners) ||
(oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius);
(oldcurve_keys != mesh->curve_keys) || (oldcurve_radius != mesh->curve_radius) ||
(oldhas_voxel_attributes != mesh->has_voxel_attributes());
mesh->tag_update(scene, rebuild);

View File

@@ -527,7 +527,7 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
builtin_images_load();
/* Attempt to free all data which is held by Blender side, since at this
* point we knwo that we've got everything to render current view layer.
* point we know that we've got everything to render current view layer.
*/
/* At the moment we only free if we are not doing multi-view
* (or if we are rendering the last view). See T58142/D4239 for discussion.

View File

@@ -315,12 +315,21 @@ static ShaderNode *add_node(Scene *scene,
else if (b_node.is_a(&RNA_ShaderNodeRGBToBW)) {
node = new RGBToBWNode();
}
else if (b_node.is_a(&RNA_ShaderNodeMapRange)) {
BL::ShaderNodeMapRange b_map_range_node(b_node);
MapRangeNode *map_range_node = new MapRangeNode();
map_range_node->clamp = b_map_range_node.clamp();
node = map_range_node;
}
else if (b_node.is_a(&RNA_ShaderNodeClamp)) {
node = new ClampNode();
}
else if (b_node.is_a(&RNA_ShaderNodeMath)) {
BL::ShaderNodeMath b_math_node(b_node);
MathNode *math = new MathNode();
math->type = (NodeMath)b_math_node.operation();
math->use_clamp = b_math_node.use_clamp();
node = math;
MathNode *math_node = new MathNode();
math_node->type = (NodeMathType)b_math_node.operation();
math_node->use_clamp = b_math_node.use_clamp();
node = math_node;
}
else if (b_node.is_a(&RNA_ShaderNodeVectorMath)) {
BL::ShaderNodeVectorMath b_vector_math_node(b_node);

View File

@@ -43,8 +43,7 @@ BVHNode *bvh_node_merge_children_recursively(const BVHNode *node)
if (node->is_leaf()) {
return new LeafNode(*reinterpret_cast<const LeafNode *>(node));
}
/* Collect nodes of one layer deeper, allowing us to have more childrem in
* an inner layer. */
/* Collect nodes of one layer deeper, allowing us to have more children in an inner layer. */
assert(node->num_children() <= 2);
const BVHNode *children[4];
const BVHNode *child0 = node->get_child(0);

View File

@@ -194,7 +194,7 @@ string OpenCLDevice::get_build_options(const DeviceRequestedFeatures &requested_
DeviceRequestedFeatures features(requested_features);
enable_default_features(features);
/* Always turn off baking at this point. Baking is only usefull when building the bake kernel.
/* Always turn off baking at this point. Baking is only useful when building the bake kernel.
* this also makes sure that the kernels that are build during baking can be reused
* when not doing any baking. */
features.use_baking = false;

View File

@@ -746,7 +746,7 @@ bool OpenCLInfo::device_supported(const string &platform_name, const cl_device_i
}
VLOG(3) << "OpenCL driver version " << driver_major << "." << driver_minor;
/* It is possible tyo have Iris GPU on AMD/Apple OpenCL framework
/* It is possible to have Iris GPU on AMD/Apple OpenCL framework
* (aka, it will not be on Intel framework). This isn't supported
* and needs an explicit blacklist.
*/

View File

@@ -179,6 +179,7 @@ set(SRC_SVM_HEADERS
svm/svm_blackbody.h
svm/svm_bump.h
svm/svm_camera.h
svm/svm_clamp.h
svm/svm_closure.h
svm/svm_convert.h
svm/svm_checker.h
@@ -198,6 +199,7 @@ set(SRC_SVM_HEADERS
svm/svm_invert.h
svm/svm_light_path.h
svm/svm_magic.h
svm/svm_map_range.h
svm/svm_mapping.h
svm/svm_math.h
svm/svm_math_util.h
@@ -486,6 +488,19 @@ endif()
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
if(WITH_COMPILER_ASAN)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT WITH_CYCLES_KERNEL_ASAN))
# GCC hangs compiling the big kernel files with asan and release, so disable by default.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=all")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# 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_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
endif()
endif()
set_source_files_properties(kernels/cpu/kernel.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
set_source_files_properties(kernels/cpu/kernel_split.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
set_source_files_properties(kernels/cpu/filter.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")

View File

@@ -231,7 +231,7 @@ ccl_device float bssrdf_burley_eval(const float d, float r)
* NOTES:
* - Surface albedo is already included into sc->weight, no need to
* multiply by this term here.
* - This is normalized diffuse model, so the equation is mutliplied
* - This is normalized diffuse model, so the equation is multiplied
* by 2*pi, which also matches cdf().
*/
float exp_r_3_d = expf(-r / (3.0f * d));

View File

@@ -108,7 +108,7 @@ ccl_device_inline void kernel_filter_finalize(int x,
/* The weighted average of pixel colors (essentially, the NLM-filtered image).
* In case the solution of the linear model fails due to numerical issues or
* returns non-sensical negative values, fall back to this value. */
* returns nonsensical negative values, fall back to this value. */
float3 mean_color = XtWY[0] / XtWX[0];
math_trimatrix_vec3_solve(XtWX, XtWY, (*rank) + 1, stride);

View File

@@ -70,9 +70,9 @@ ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buff
filter_calculate_scale(feature_scale, use_time);
/* === Generate the feature transformation. ===
* This transformation maps the num_features-dimentional feature space to a reduced feature
* (r-feature) space which generally has fewer dimensions. This mainly helps to prevent
* overfitting. */
* This transformation maps the num_features-dimensional feature space to a reduced feature
* (r-feature) space which generally has fewer dimensions.
* This mainly helps to prevent over-fitting. */
float feature_matrix[DENOISE_FEATURES * DENOISE_FEATURES];
math_matrix_zero(feature_matrix, num_features);
FOR_PIXEL_WINDOW
@@ -85,7 +85,7 @@ ccl_device void kernel_filter_construct_transform(const float *ccl_restrict buff
math_matrix_jacobi_eigendecomposition(feature_matrix, transform, num_features, 1);
*rank = 0;
/* Prevent overfitting when a small window is used. */
/* Prevent over-fitting when a small window is used. */
int max_rank = min(num_features, num_pixels / 3);
if (pca_threshold < 0.0f) {
float threshold_energy = 0.0f;

View File

@@ -686,8 +686,7 @@ ccl_device_inline const ShaderClosure *shader_bsdf_pick(ShaderData *sd, float *r
if (r < next_sum) {
sampled = i;
/* Rescale to reuse for direction sample, to better
* preserve stratification. */
/* Rescale to reuse for direction sample, to better preserve stratification. */
*randu = (r - partial_sum) / sc->sample_weight;
break;
}
@@ -743,8 +742,7 @@ ccl_device_inline const ShaderClosure *shader_bssrdf_pick(ShaderData *sd,
*throughput *= (sum_bsdf + sum_bssrdf) / sum_bssrdf;
sampled = i;
/* Rescale to reuse for direction sample, to better
* preserve stratifaction. */
/* Rescale to reuse for direction sample, to better preserve stratification. */
*randu = (r - partial_sum) / sc->sample_weight;
break;
}

View File

@@ -1523,7 +1523,7 @@ static_assert_align(KernelShader, 16);
* Queue 1 - Active rays
* Queue 2 - Background queue
* Queue 3 - Shadow ray cast kernel - AO
* Queeu 4 - Shadow ray cast kernel - direct lighting
* Queue 4 - Shadow ray cast kernel - direct lighting
*/
/* Queue names */

View File

@@ -19,6 +19,10 @@
CCL_NAMESPACE_BEGIN
/* Make template functions private so symbols don't conflict between kernels with different
* instruction sets. */
namespace {
template<typename T> struct TextureInterpolator {
#define SET_CUBIC_SPLINE_WEIGHTS(u, t) \
{ \
@@ -523,6 +527,8 @@ ccl_device float4 kernel_tex_image_interp_3d(
}
}
} /* Namespace. */
CCL_NAMESPACE_END
#endif // __KERNEL_CPU_IMAGE_H__

View File

@@ -29,8 +29,6 @@ set(LIB
cycles_render
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})

View File

@@ -13,6 +13,7 @@ set(SRC_OSL
node_bump.osl
node_camera.osl
node_checker_texture.osl
node_clamp.osl
node_combine_rgb.osl
node_combine_hsv.osl
node_combine_xyz.osl
@@ -46,6 +47,7 @@ set(SRC_OSL
node_light_falloff.osl
node_light_path.osl
node_magic_texture.osl
node_map_range.osl
node_mapping.osl
node_math.osl
node_mix.osl

View File

@@ -0,0 +1,22 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stdosl.h"
shader node_clamp(float Value = 1.0, float Min = 0.0, float Max = 1.0, output float Result = 0.0)
{
Result = clamp(Value, Min, Max);
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "stdosl.h"
shader node_map_range(float Value = 1.0,
float FromMin = 0.0,
float FromMax = 1.0,
float ToMin = 0.0,
float ToMax = 1.0,
output float Result = 0.0)
{
if (FromMax != FromMin) {
Result = ToMin + ((Value - FromMin) / (FromMax - FromMin)) * (ToMax - ToMin);
}
}

View File

@@ -18,56 +18,30 @@
float safe_divide(float a, float b)
{
float result;
if (b == 0.0)
result = 0.0;
else
result = a / b;
return result;
return (b != 0.0) ? a / b : 0.0;
}
float safe_modulo(float a, float b)
{
float result;
if (b == 0.0)
result = 0.0;
else
result = fmod(a, b);
return result;
return (b != 0.0) ? fmod(a, b) : 0.0;
}
float safe_sqrt(float a)
{
float result;
if (a > 0.0)
result = sqrt(a);
else
result = 0.0;
return result;
return (a > 0.0) ? sqrt(a) : 0.0;
}
float safe_log(float a, float b)
{
if (a < 0.0 || b < 0.0)
return 0.0;
return log(a) / log(b);
return (a > 0.0 && b > 0.0) ? log(a) / log(b) : 0.0;
}
/* OSL asin, acos, and pow functions are safe by default. */
shader node_math(string type = "add",
int use_clamp = 0,
float Value1 = 0.0,
float Value2 = 0.0,
float Value1 = 0.5,
float Value2 = 0.5,
output float Value = 0.0)
{
/* OSL asin, acos, pow check for values that could give rise to nan */
if (type == "add")
Value = Value1 + Value2;
else if (type == "subtract")
@@ -76,6 +50,32 @@ shader node_math(string type = "add",
Value = Value1 * Value2;
else if (type == "divide")
Value = safe_divide(Value1, Value2);
else if (type == "power")
Value = pow(Value1, Value2);
else if (type == "logarithm")
Value = safe_log(Value1, Value2);
else if (type == "sqrt")
Value = safe_sqrt(Value1);
else if (type == "absolute")
Value = fabs(Value1);
else if (type == "minimum")
Value = min(Value1, Value2);
else if (type == "maximum")
Value = max(Value1, Value2);
else if (type == "less_than")
Value = Value1 < Value2;
else if (type == "greater_than")
Value = Value1 > Value2;
else if (type == "round")
Value = floor(Value1 + 0.5);
else if (type == "floor")
Value = floor(Value1);
else if (type == "ceil")
Value = ceil(Value1);
else if (type == "fraction")
Value = Value1 - floor(Value1);
else if (type == "modulo")
Value = safe_modulo(Value1, Value2);
else if (type == "sine")
Value = sin(Value1);
else if (type == "cosine")
@@ -88,35 +88,8 @@ shader node_math(string type = "add",
Value = acos(Value1);
else if (type == "arctangent")
Value = atan(Value1);
else if (type == "power")
Value = pow(Value1, Value2);
else if (type == "logarithm")
Value = safe_log(Value1, Value2);
else if (type == "minimum")
Value = min(Value1, Value2);
else if (type == "maximum")
Value = max(Value1, Value2);
else if (type == "round")
Value = floor(Value1 + 0.5);
else if (type == "less_than")
Value = Value1 < Value2;
else if (type == "greater_than")
Value = Value1 > Value2;
else if (type == "modulo")
Value = safe_modulo(Value1, Value2);
else if (type == "absolute")
Value = fabs(Value1);
else if (type == "arctan2")
Value = atan2(Value1, Value2);
else if (type == "floor")
Value = floor(Value1);
else if (type == "ceil")
Value = ceil(Value1);
else if (type == "fract")
Value = Value1 - floor(Value1);
else if (type == "sqrt")
Value = safe_sqrt(Value1);
if (use_clamp)
Value = clamp(Value, 0.0, 1.0);
else
warning("%s", "Unknown math operator!");
}

View File

@@ -192,6 +192,8 @@ CCL_NAMESPACE_END
#include "kernel/svm/svm_vector_transform.h"
#include "kernel/svm/svm_voxel.h"
#include "kernel/svm/svm_bump.h"
#include "kernel/svm/svm_map_range.h"
#include "kernel/svm/svm_clamp.h"
#ifdef __SHADER_RAYTRACE__
# include "kernel/svm/svm_ao.h"
@@ -486,6 +488,12 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg,
case NODE_BLACKBODY:
svm_node_blackbody(kg, sd, stack, node.y, node.z);
break;
case NODE_MAP_RANGE:
svm_node_map_range(kg, sd, stack, node.y, node.z, node.w, &offset);
break;
case NODE_CLAMP:
svm_node_clamp(kg, sd, stack, node.y, node.z, node.w, &offset);
break;
# endif /* __EXTRA_NODES__ */
# if NODES_FEATURE(NODE_FEATURE_VOLUME)
case NODE_TEX_VOXEL:

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
CCL_NAMESPACE_BEGIN
/* Clamp Node */
ccl_device void svm_node_clamp(KernelGlobals *kg,
ShaderData *sd,
float *stack,
uint value_stack_offset,
uint parameters_stack_offsets,
uint result_stack_offset,
int *offset)
{
uint min_stack_offset, max_stack_offset;
decode_node_uchar4(parameters_stack_offsets, &min_stack_offset, &max_stack_offset, NULL, NULL);
uint4 defaults = read_node(kg, offset);
float value = stack_load_float(stack, value_stack_offset);
float min = stack_load_float_default(stack, min_stack_offset, defaults.x);
float max = stack_load_float_default(stack, max_stack_offset, defaults.y);
stack_store_float(stack, result_stack_offset, clamp(value, min, max));
}
CCL_NAMESPACE_END

View File

@@ -25,7 +25,7 @@ ccl_device_inline float interpolate_ies_vertical(
* of v (corresponding to the north pole) would result in artifacts. The proper way of dealing
* with this would be to lookup the corresponding value on the other side of the pole, but since
* the horizontal coordinates might be nonuniform, this would require yet another interpolation.
* Therefore, the assumtion is made that the light is going to be symmetrical, which means that
* Therefore, the assumption is made that the light is going to be symmetrical, which means that
* we can just take the corresponding value at the current horizontal coordinate. */
#define IES_LOOKUP(v) kernel_tex_fetch(__ies, ofs + h * v_num + (v))

View File

@@ -0,0 +1,54 @@
/*
* Copyright 2011-2013 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
CCL_NAMESPACE_BEGIN
/* Map Range Node */
ccl_device void svm_node_map_range(KernelGlobals *kg,
ShaderData *sd,
float *stack,
uint value_stack_offset,
uint parameters_stack_offsets,
uint result_stack_offset,
int *offset)
{
uint from_min_stack_offset, from_max_stack_offset, to_min_stack_offset, to_max_stack_offset;
decode_node_uchar4(parameters_stack_offsets,
&from_min_stack_offset,
&from_max_stack_offset,
&to_min_stack_offset,
&to_max_stack_offset);
uint4 defaults = read_node(kg, offset);
float value = stack_load_float(stack, value_stack_offset);
float from_min = stack_load_float_default(stack, from_min_stack_offset, defaults.x);
float from_max = stack_load_float_default(stack, from_max_stack_offset, defaults.y);
float to_min = stack_load_float_default(stack, to_min_stack_offset, defaults.z);
float to_max = stack_load_float_default(stack, to_max_stack_offset, defaults.w);
float result;
if (from_max != from_min) {
result = to_min + ((value - from_min) / (from_max - from_min)) * (to_max - to_min);
}
else {
result = 0.0f;
}
stack_store_float(stack, result_stack_offset, result);
}
CCL_NAMESPACE_END

View File

@@ -16,24 +16,22 @@
CCL_NAMESPACE_BEGIN
/* Nodes */
ccl_device void svm_node_math(KernelGlobals *kg,
ShaderData *sd,
float *stack,
uint itype,
uint f1_offset,
uint f2_offset,
uint type,
uint inputs_stack_offsets,
uint result_stack_offset,
int *offset)
{
NodeMath type = (NodeMath)itype;
float f1 = stack_load_float(stack, f1_offset);
float f2 = stack_load_float(stack, f2_offset);
float f = svm_math(type, f1, f2);
uint a_stack_offset, b_stack_offset;
decode_node_uchar4(inputs_stack_offsets, &a_stack_offset, &b_stack_offset, NULL, NULL);
uint4 node1 = read_node(kg, offset);
float a = stack_load_float(stack, a_stack_offset);
float b = stack_load_float(stack, b_stack_offset);
float result = svm_math((NodeMathType)type, a, b);
stack_store_float(stack, node1.y, f);
stack_store_float(stack, result_stack_offset, result);
}
ccl_device void svm_node_vector_math(KernelGlobals *kg,

View File

@@ -51,64 +51,60 @@ ccl_device void svm_vector_math(
}
}
ccl_device float svm_math(NodeMath type, float Fac1, float Fac2)
ccl_device float svm_math(NodeMathType type, float a, float b)
{
float Fac;
if (type == NODE_MATH_ADD)
Fac = Fac1 + Fac2;
else if (type == NODE_MATH_SUBTRACT)
Fac = Fac1 - Fac2;
else if (type == NODE_MATH_MULTIPLY)
Fac = Fac1 * Fac2;
else if (type == NODE_MATH_DIVIDE)
Fac = safe_divide(Fac1, Fac2);
else if (type == NODE_MATH_SINE)
Fac = sinf(Fac1);
else if (type == NODE_MATH_COSINE)
Fac = cosf(Fac1);
else if (type == NODE_MATH_TANGENT)
Fac = tanf(Fac1);
else if (type == NODE_MATH_ARCSINE)
Fac = safe_asinf(Fac1);
else if (type == NODE_MATH_ARCCOSINE)
Fac = safe_acosf(Fac1);
else if (type == NODE_MATH_ARCTANGENT)
Fac = atanf(Fac1);
else if (type == NODE_MATH_POWER)
Fac = safe_powf(Fac1, Fac2);
else if (type == NODE_MATH_LOGARITHM)
Fac = safe_logf(Fac1, Fac2);
else if (type == NODE_MATH_MINIMUM)
Fac = fminf(Fac1, Fac2);
else if (type == NODE_MATH_MAXIMUM)
Fac = fmaxf(Fac1, Fac2);
else if (type == NODE_MATH_ROUND)
Fac = floorf(Fac1 + 0.5f);
else if (type == NODE_MATH_LESS_THAN)
Fac = Fac1 < Fac2;
else if (type == NODE_MATH_GREATER_THAN)
Fac = Fac1 > Fac2;
else if (type == NODE_MATH_MODULO)
Fac = safe_modulo(Fac1, Fac2);
else if (type == NODE_MATH_ABSOLUTE)
Fac = fabsf(Fac1);
else if (type == NODE_MATH_ARCTAN2)
Fac = atan2f(Fac1, Fac2);
else if (type == NODE_MATH_FLOOR)
Fac = floorf(Fac1);
else if (type == NODE_MATH_CEIL)
Fac = ceilf(Fac1);
else if (type == NODE_MATH_FRACT)
Fac = Fac1 - floorf(Fac1);
else if (type == NODE_MATH_SQRT)
Fac = safe_sqrtf(Fac1);
else if (type == NODE_MATH_CLAMP)
Fac = saturate(Fac1);
else
Fac = 0.0f;
return Fac;
switch (type) {
case NODE_MATH_ADD:
return a + b;
case NODE_MATH_SUBTRACT:
return a - b;
case NODE_MATH_MULTIPLY:
return a * b;
case NODE_MATH_DIVIDE:
return safe_divide(a, b);
case NODE_MATH_POWER:
return safe_powf(a, b);
case NODE_MATH_LOGARITHM:
return safe_logf(a, b);
case NODE_MATH_SQRT:
return safe_sqrtf(a);
case NODE_MATH_ABSOLUTE:
return fabsf(a);
case NODE_MATH_MINIMUM:
return fminf(a, b);
case NODE_MATH_MAXIMUM:
return fmaxf(a, b);
case NODE_MATH_LESS_THAN:
return a < b;
case NODE_MATH_GREATER_THAN:
return a > b;
case NODE_MATH_ROUND:
return floorf(a + 0.5f);
case NODE_MATH_FLOOR:
return floorf(a);
case NODE_MATH_CEIL:
return ceilf(a);
case NODE_MATH_FRACTION:
return a - floorf(a);
case NODE_MATH_MODULO:
return safe_modulo(a, b);
case NODE_MATH_SINE:
return sinf(a);
case NODE_MATH_COSINE:
return cosf(a);
case NODE_MATH_TANGENT:
return tanf(a);
case NODE_MATH_ARCSINE:
return safe_asinf(a);
case NODE_MATH_ARCCOSINE:
return safe_acosf(a);
case NODE_MATH_ARCTANGENT:
return atanf(a);
case NODE_MATH_ARCTAN2:
return atan2f(a, b);
default:
return 0.0f;
}
}
/* Calculate color in range 800..12000 using an approximation

View File

@@ -138,6 +138,8 @@ typedef enum ShaderNodeType {
NODE_VECTOR_DISPLACEMENT,
NODE_PRINCIPLED_VOLUME,
NODE_IES,
NODE_MAP_RANGE,
NODE_CLAMP,
} ShaderNodeType;
typedef enum NodeAttributeType {
@@ -242,7 +244,7 @@ typedef enum NodeMix {
NODE_MIX_CLAMP /* used for the clamp UI option */
} NodeMix;
typedef enum NodeMath {
typedef enum NodeMathType {
NODE_MATH_ADD,
NODE_MATH_SUBTRACT,
NODE_MATH_MULTIPLY,
@@ -265,10 +267,9 @@ typedef enum NodeMath {
NODE_MATH_ARCTAN2,
NODE_MATH_FLOOR,
NODE_MATH_CEIL,
NODE_MATH_FRACT,
NODE_MATH_FRACTION,
NODE_MATH_SQRT,
NODE_MATH_CLAMP /* used for the clamp UI option */
} NodeMath;
} NodeMathType;
typedef enum NodeVectorMath {
NODE_VECTOR_MATH_ADD,

View File

@@ -85,8 +85,6 @@ if(WITH_CYCLES_OSL)
)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})

View File

@@ -565,8 +565,7 @@ float3 Camera::transform_raster_to_world(float raster_x, float raster_y)
BoundBox Camera::viewplane_bounds_get()
{
/* TODO(sergey): This is all rather stupid, but is there a way to perform
* checks we need in a more clear and smart fasion?
*/
* checks we need in a more clear and smart fashion? */
BoundBox bounds = BoundBox::empty;
if (type == CAMERA_PANORAMA) {

View File

@@ -301,7 +301,7 @@ void ConstantFolder::fold_mix(NodeMix type, bool clamp) const
}
}
void ConstantFolder::fold_math(NodeMath type, bool clamp) const
void ConstantFolder::fold_math(NodeMathType type) const
{
ShaderInput *value1_in = node->input("Value1");
ShaderInput *value2_in = node->input("Value2");
@@ -310,25 +310,25 @@ void ConstantFolder::fold_math(NodeMath type, bool clamp) const
case NODE_MATH_ADD:
/* X + 0 == 0 + X == X */
if (is_zero(value1_in)) {
try_bypass_or_make_constant(value2_in, clamp);
try_bypass_or_make_constant(value2_in);
}
else if (is_zero(value2_in)) {
try_bypass_or_make_constant(value1_in, clamp);
try_bypass_or_make_constant(value1_in);
}
break;
case NODE_MATH_SUBTRACT:
/* X - 0 == X */
if (is_zero(value2_in)) {
try_bypass_or_make_constant(value1_in, clamp);
try_bypass_or_make_constant(value1_in);
}
break;
case NODE_MATH_MULTIPLY:
/* X * 1 == 1 * X == X */
if (is_one(value1_in)) {
try_bypass_or_make_constant(value2_in, clamp);
try_bypass_or_make_constant(value2_in);
}
else if (is_one(value2_in)) {
try_bypass_or_make_constant(value1_in, clamp);
try_bypass_or_make_constant(value1_in);
}
/* X * 0 == 0 * X == 0 */
else if (is_zero(value1_in) || is_zero(value2_in)) {
@@ -338,7 +338,7 @@ void ConstantFolder::fold_math(NodeMath type, bool clamp) const
case NODE_MATH_DIVIDE:
/* X / 1 == X */
if (is_one(value2_in)) {
try_bypass_or_make_constant(value1_in, clamp);
try_bypass_or_make_constant(value1_in);
}
/* 0 / X == 0 */
else if (is_zero(value1_in)) {
@@ -352,7 +352,7 @@ void ConstantFolder::fold_math(NodeMath type, bool clamp) const
}
/* X ^ 1 == X */
else if (is_one(value2_in)) {
try_bypass_or_make_constant(value1_in, clamp);
try_bypass_or_make_constant(value1_in);
}
default:
break;

View File

@@ -64,7 +64,7 @@ class ConstantFolder {
/* Specific nodes. */
void fold_mix(NodeMix type, bool clamp) const;
void fold_math(NodeMath type, bool clamp) const;
void fold_math(NodeMathType type) const;
void fold_vector_math(NodeVectorMath type) const;
};

View File

@@ -978,7 +978,7 @@ void ShaderGraph::bump_from_displacement(bool use_object_space)
foreach (NodePair &pair, nodes_dy)
pair.second->bump = SHADER_BUMP_DY;
/* add set normal node and connect the bump normal ouput to the set normal
/* add set normal node and connect the bump normal output to the set normal
* output, so it can finally set the shader normal, note we are only doing
* this for bump from displacement, this will be the only bump allowed to
* overwrite the shader normal */

View File

@@ -944,7 +944,7 @@ void LightManager::tag_update(Scene * /*scene*/)
need_update = true;
}
int LightManager::add_ies_from_file(ustring filename)
int LightManager::add_ies_from_file(const string &filename)
{
string content;
@@ -953,10 +953,10 @@ int LightManager::add_ies_from_file(ustring filename)
content = "\n";
}
return add_ies(ustring(content));
return add_ies(content);
}
int LightManager::add_ies(ustring content)
int LightManager::add_ies(const string &content)
{
uint hash = hash_string(content.c_str());

View File

@@ -92,8 +92,8 @@ class LightManager {
~LightManager();
/* IES texture management */
int add_ies(ustring ies);
int add_ies_from_file(ustring filename);
int add_ies(const string &ies);
int add_ies_from_file(const string &filename);
void remove_ies(int slot);
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress);

View File

@@ -1091,6 +1091,17 @@ bool Mesh::has_true_displacement() const
return false;
}
bool Mesh::has_voxel_attributes() const
{
foreach (const Attribute &attr, attributes.attributes) {
if (attr.element == ATTR_ELEMENT_VOXEL) {
return true;
}
}
return false;
}
float Mesh::motion_time(int step) const
{
return (motion_steps > 1) ? 2.0f * step / (motion_steps - 1) - 1.0f : 0.0f;
@@ -2020,15 +2031,7 @@ void MeshManager::device_update_preprocess(Device *device, Scene *scene, Progres
if (need_update && mesh->has_volume) {
/* Create volume meshes if there is voxel data. */
bool has_voxel_attributes = false;
foreach (Attribute &attr, mesh->attributes.attributes) {
if (attr.element == ATTR_ELEMENT_VOXEL) {
has_voxel_attributes = true;
}
}
if (has_voxel_attributes) {
if (mesh->has_voxel_attributes()) {
if (!volume_images_updated) {
progress.set_status("Updating Meshes Volume Bounds");
device_update_volume_images(device, scene, progress);

View File

@@ -318,6 +318,7 @@ class Mesh : public Node {
bool has_motion_blur() const;
bool has_true_displacement() const;
bool has_voxel_attributes() const;
/* Convert between normalized -1..1 motion time and index
* in the VERTEX_MOTION attribute. */

View File

@@ -1067,10 +1067,10 @@ void IESLightNode::get_slot()
if (slot == -1) {
if (ies.empty()) {
slot = light_manager->add_ies_from_file(filename);
slot = light_manager->add_ies_from_file(filename.string());
}
else {
slot = light_manager->add_ies(ies);
slot = light_manager->add_ies(ies.string());
}
}
}
@@ -5259,6 +5259,140 @@ void OutputNode::compile(OSLCompiler &compiler)
compiler.add(this, "node_output_displacement");
}
/* Map Range Node */
NODE_DEFINE(MapRangeNode)
{
NodeType *type = NodeType::add("map_range", create, NodeType::SHADER);
SOCKET_IN_FLOAT(value, "Value", 1.0f);
SOCKET_IN_FLOAT(from_min, "From Min", 0.0f);
SOCKET_IN_FLOAT(from_max, "From Max", 1.0f);
SOCKET_IN_FLOAT(to_min, "To Min", 0.0f);
SOCKET_IN_FLOAT(to_max, "To Max", 1.0f);
SOCKET_OUT_FLOAT(result, "Result");
return type;
}
MapRangeNode::MapRangeNode() : ShaderNode(node_type)
{
}
void MapRangeNode::expand(ShaderGraph *graph)
{
if (clamp) {
ShaderOutput *result_out = output("Result");
if (!result_out->links.empty()) {
ClampNode *clamp_node = new ClampNode();
clamp_node->min = to_min;
clamp_node->max = to_max;
graph->add(clamp_node);
graph->relink(result_out, clamp_node->output("Result"));
graph->connect(result_out, clamp_node->input("Value"));
}
}
}
void MapRangeNode::constant_fold(const ConstantFolder &folder)
{
if (folder.all_inputs_constant()) {
float result;
if (from_max != from_min) {
result = to_min + ((value - from_min) / (from_max - from_min)) * (to_max - to_min);
}
else {
result = 0.0f;
}
folder.make_constant(result);
}
}
void MapRangeNode::compile(SVMCompiler &compiler)
{
ShaderInput *value_in = input("Value");
ShaderInput *from_min_in = input("From Min");
ShaderInput *from_max_in = input("From Max");
ShaderInput *to_min_in = input("To Min");
ShaderInput *to_max_in = input("To Max");
ShaderOutput *result_out = output("Result");
int value_stack_offset = compiler.stack_assign(value_in);
int from_min_stack_offset = compiler.stack_assign_if_linked(from_min_in);
int from_max_stack_offset = compiler.stack_assign_if_linked(from_max_in);
int to_min_stack_offset = compiler.stack_assign_if_linked(to_min_in);
int to_max_stack_offset = compiler.stack_assign_if_linked(to_max_in);
int result_stack_offset = compiler.stack_assign(result_out);
compiler.add_node(
NODE_MAP_RANGE,
value_stack_offset,
compiler.encode_uchar4(
from_min_stack_offset, from_max_stack_offset, to_min_stack_offset, to_max_stack_offset),
result_stack_offset);
compiler.add_node(__float_as_int(from_min),
__float_as_int(from_max),
__float_as_int(to_min),
__float_as_int(to_max));
}
void MapRangeNode::compile(OSLCompiler &compiler)
{
compiler.add(this, "node_map_range");
}
/* Clamp Node */
NODE_DEFINE(ClampNode)
{
NodeType *type = NodeType::add("clamp", create, NodeType::SHADER);
SOCKET_IN_FLOAT(value, "Value", 1.0f);
SOCKET_IN_FLOAT(min, "Min", 0.0f);
SOCKET_IN_FLOAT(max, "Max", 1.0f);
SOCKET_OUT_FLOAT(result, "Result");
return type;
}
ClampNode::ClampNode() : ShaderNode(node_type)
{
}
void ClampNode::constant_fold(const ConstantFolder &folder)
{
if (folder.all_inputs_constant()) {
folder.make_constant(clamp(value, min, max));
}
}
void ClampNode::compile(SVMCompiler &compiler)
{
ShaderInput *value_in = input("Value");
ShaderInput *min_in = input("Min");
ShaderInput *max_in = input("Max");
ShaderOutput *result_out = output("Result");
int value_stack_offset = compiler.stack_assign(value_in);
int min_stack_offset = compiler.stack_assign(min_in);
int max_stack_offset = compiler.stack_assign(max_in);
int result_stack_offset = compiler.stack_assign(result_out);
compiler.add_node(NODE_CLAMP,
value_stack_offset,
compiler.encode_uchar4(min_stack_offset, max_stack_offset),
result_stack_offset);
compiler.add_node(__float_as_int(min), __float_as_int(max));
}
void ClampNode::compile(OSLCompiler &compiler)
{
compiler.add(this, "node_clamp");
}
/* Math */
NODE_DEFINE(MathNode)
@@ -5288,14 +5422,12 @@ NODE_DEFINE(MathNode)
type_enum.insert("arctan2", NODE_MATH_ARCTAN2);
type_enum.insert("floor", NODE_MATH_FLOOR);
type_enum.insert("ceil", NODE_MATH_CEIL);
type_enum.insert("fract", NODE_MATH_FRACT);
type_enum.insert("fraction", NODE_MATH_FRACTION);
type_enum.insert("sqrt", NODE_MATH_SQRT);
SOCKET_ENUM(type, "Type", type_enum, NODE_MATH_ADD);
SOCKET_BOOLEAN(use_clamp, "Use Clamp", false);
SOCKET_IN_FLOAT(value1, "Value1", 0.0f);
SOCKET_IN_FLOAT(value2, "Value2", 0.0f);
SOCKET_IN_FLOAT(value1, "Value1", 0.5f);
SOCKET_IN_FLOAT(value2, "Value2", 0.5f);
SOCKET_OUT_FLOAT(value, "Value");
@@ -5306,13 +5438,28 @@ MathNode::MathNode() : ShaderNode(node_type)
{
}
void MathNode::expand(ShaderGraph *graph)
{
if (use_clamp) {
ShaderOutput *result_out = output("Value");
if (!result_out->links.empty()) {
ClampNode *clamp_node = new ClampNode();
clamp_node->min = 0.0f;
clamp_node->max = 1.0f;
graph->add(clamp_node);
graph->relink(result_out, clamp_node->output("Result"));
graph->connect(result_out, clamp_node->input("Value"));
}
}
}
void MathNode::constant_fold(const ConstantFolder &folder)
{
if (folder.all_inputs_constant()) {
folder.make_constant_clamp(svm_math(type, value1, value2), use_clamp);
folder.make_constant(svm_math(type, value1, value2));
}
else {
folder.fold_math(type, use_clamp);
folder.fold_math(type);
}
}
@@ -5322,20 +5469,19 @@ void MathNode::compile(SVMCompiler &compiler)
ShaderInput *value2_in = input("Value2");
ShaderOutput *value_out = output("Value");
compiler.add_node(
NODE_MATH, type, compiler.stack_assign(value1_in), compiler.stack_assign(value2_in));
compiler.add_node(NODE_MATH, compiler.stack_assign(value_out));
int value1_stack_offset = compiler.stack_assign(value1_in);
int value2_stack_offset = compiler.stack_assign(value2_in);
int value_stack_offset = compiler.stack_assign(value_out);
if (use_clamp) {
compiler.add_node(NODE_MATH, NODE_MATH_CLAMP, compiler.stack_assign(value_out));
compiler.add_node(NODE_MATH, compiler.stack_assign(value_out));
}
compiler.add_node(NODE_MATH,
type,
compiler.encode_uchar4(value1_stack_offset, value2_stack_offset),
value_stack_offset);
}
void MathNode::compile(OSLCompiler &compiler)
{
compiler.parameter(this, "type");
compiler.parameter(this, "use_clamp");
compiler.add(this, "node_math");
}

View File

@@ -1228,6 +1228,31 @@ class BlackbodyNode : public ShaderNode {
float temperature;
};
class MapRangeNode : public ShaderNode {
public:
SHADER_NODE_CLASS(MapRangeNode)
void constant_fold(const ConstantFolder &folder);
virtual int get_group()
{
return NODE_GROUP_LEVEL_3;
}
void expand(ShaderGraph *graph);
float value, from_min, from_max, to_min, to_max;
bool clamp;
};
class ClampNode : public ShaderNode {
public:
SHADER_NODE_CLASS(ClampNode)
void constant_fold(const ConstantFolder &folder);
virtual int get_group()
{
return NODE_GROUP_LEVEL_3;
}
float value, min, max;
};
class MathNode : public ShaderNode {
public:
SHADER_NODE_CLASS(MathNode)
@@ -1235,11 +1260,12 @@ class MathNode : public ShaderNode {
{
return NODE_GROUP_LEVEL_1;
}
void expand(ShaderGraph *graph);
void constant_fold(const ConstantFolder &folder);
float value1;
float value2;
NodeMath type;
NodeMathType type;
bool use_clamp;
};

View File

@@ -152,7 +152,7 @@ void OSLShaderManager::device_update(Device *device,
{
/* Perform greedyjit optimization.
*
* This might waste time on optimizing gorups which are never actually
* This might waste time on optimizing groups which are never actually
* used, but this prevents OSL from allocating data on TLS at render
* time.
*

View File

@@ -985,7 +985,7 @@ void Session::update_status_time(bool show_pause, bool show_done)
substatus += string_printf(", Prefiltered %d tiles", progress.get_denoised_tiles());
}
}
else if (tile_manager.num_samples == INT_MAX)
else if (tile_manager.num_samples == Integrator::MAX_SAMPLES)
substatus = string_printf("Path Tracing Sample %d", progressive_sample + 1);
else
substatus = string_printf("Path Tracing Sample %d/%d", progressive_sample + 1, num_samples);

View File

@@ -62,7 +62,7 @@ typedef struct SobolDirectionNumbers {
/* Keep simple alignment. */
/* clang-format off */
static SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS - 1] = {
static const SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS - 1] = {
{2, 1, 0, {1}},
{3, 2, 1, {1, 3}},
{4, 3, 1, {1, 3, 1}},
@@ -21279,10 +21279,10 @@ void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions
v[i] = 1 << (31 - i); // all m's = 1
for (int dim = 1; dim < dimensions; dim++) {
SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim - 1];
uint s = numbers->s;
uint a = numbers->a;
uint *m = numbers->m;
const SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim - 1];
const uint s = numbers->s;
const uint a = numbers->a;
const uint *m = numbers->m;
v = vectors[dim];

View File

@@ -29,7 +29,7 @@ CCL_NAMESPACE_BEGIN
* semantic around the units of size, it just should be the same for all
* entries.
*
* This is a generic entry foi all size-related statistics, which helps
* This is a generic entry for all size-related statistics, which helps
* avoiding duplicating code for things like sorting.
*/
class NamedSizeEntry {

View File

@@ -47,46 +47,23 @@ void SVMShaderManager::reset(Scene * /*scene*/)
void SVMShaderManager::device_update_shader(Scene *scene,
Shader *shader,
Progress *progress,
array<int4> *global_svm_nodes)
array<int4> *svm_nodes)
{
if (progress->get_cancel()) {
return;
}
assert(shader->graph);
array<int4> svm_nodes;
svm_nodes.push_back_slow(make_int4(NODE_SHADER_JUMP, 0, 0, 0));
svm_nodes->push_back_slow(make_int4(NODE_SHADER_JUMP, 0, 0, 0));
SVMCompiler::Summary summary;
SVMCompiler compiler(scene->shader_manager, scene->image_manager, scene->light_manager);
compiler.background = (shader == scene->default_background);
compiler.compile(scene, shader, svm_nodes, 0, &summary);
compiler.compile(scene, shader, *svm_nodes, 0, &summary);
VLOG(2) << "Compilation summary:\n"
<< "Shader name: " << shader->name << "\n"
<< summary.full_report();
nodes_lock_.lock();
if (shader->use_mis && shader->has_surface_emission) {
scene->light_manager->need_update = true;
}
/* The copy needs to be done inside the lock, if another thread resizes the array
* while memcpy is running, it'll be copying into possibly invalid/freed ram.
*/
size_t global_nodes_size = global_svm_nodes->size();
global_svm_nodes->resize(global_nodes_size + svm_nodes.size());
/* Offset local SVM nodes to a global address space. */
int4 &jump_node = (*global_svm_nodes)[shader->id];
jump_node.y = svm_nodes[0].y + global_nodes_size - 1;
jump_node.z = svm_nodes[0].z + global_nodes_size - 1;
jump_node.w = svm_nodes[0].w + global_nodes_size - 1;
/* Copy new nodes to global storage. */
memcpy(&(*global_svm_nodes)[global_nodes_size],
&svm_nodes[1],
sizeof(int4) * (svm_nodes.size() - 1));
nodes_lock_.unlock();
}
void SVMShaderManager::device_update(Device *device,
@@ -97,7 +74,9 @@ void SVMShaderManager::device_update(Device *device,
if (!need_update)
return;
VLOG(1) << "Total " << scene->shaders.size() << " shaders.";
const int num_shaders = scene->shaders.size();
VLOG(1) << "Total " << num_shaders << " shaders.";
double start_time = time_dt();
@@ -107,20 +86,17 @@ void SVMShaderManager::device_update(Device *device,
/* determine which shaders are in use */
device_update_shaders_used(scene);
/* svm_nodes */
array<int4> svm_nodes;
size_t i;
for (i = 0; i < scene->shaders.size(); i++) {
svm_nodes.push_back_slow(make_int4(NODE_SHADER_JUMP, 0, 0, 0));
}
/* Build all shaders. */
TaskPool task_pool;
foreach (Shader *shader, scene->shaders) {
task_pool.push(
function_bind(
&SVMShaderManager::device_update_shader, this, scene, shader, &progress, &svm_nodes),
false);
vector<array<int4>> shader_svm_nodes(num_shaders);
for (int i = 0; i < num_shaders; i++) {
task_pool.push(function_bind(&SVMShaderManager::device_update_shader,
this,
scene,
scene->shaders[i],
&progress,
&shader_svm_nodes[i]),
false);
}
task_pool.wait_work();
@@ -128,20 +104,60 @@ void SVMShaderManager::device_update(Device *device,
return;
}
dscene->svm_nodes.steal_data(svm_nodes);
dscene->svm_nodes.copy_to_device();
for (i = 0; i < scene->shaders.size(); i++) {
Shader *shader = scene->shaders[i];
shader->need_update = false;
/* The global node list contains a jump table (one node per shader)
* followed by the nodes of all shaders. */
int svm_nodes_size = num_shaders;
for (int i = 0; i < num_shaders; i++) {
/* Since we're not copying the local jump node, the size ends up being one node lower. */
svm_nodes_size += shader_svm_nodes[i].size() - 1;
}
int4 *svm_nodes = dscene->svm_nodes.alloc(svm_nodes_size);
int node_offset = num_shaders;
for (int i = 0; i < num_shaders; i++) {
Shader *shader = scene->shaders[i];
shader->need_update = false;
if (shader->use_mis && shader->has_surface_emission) {
scene->light_manager->need_update = true;
}
/* Update the global jump table.
* Each compiled shader starts with a jump node that has offsets local
* to the shader, so copy those and add the offset into the global node list. */
int4 &global_jump_node = svm_nodes[shader->id];
int4 &local_jump_node = shader_svm_nodes[i][0];
global_jump_node.x = NODE_SHADER_JUMP;
global_jump_node.y = local_jump_node.y - 1 + node_offset;
global_jump_node.z = local_jump_node.z - 1 + node_offset;
global_jump_node.w = local_jump_node.w - 1 + node_offset;
node_offset += shader_svm_nodes[i].size() - 1;
}
/* Copy the nodes of each shader into the correct location. */
svm_nodes += num_shaders;
for (int i = 0; i < num_shaders; i++) {
int shader_size = shader_svm_nodes[i].size() - 1;
memcpy(svm_nodes, &shader_svm_nodes[i][1], sizeof(int4) * shader_size);
svm_nodes += shader_size;
}
if (progress.get_cancel()) {
return;
}
dscene->svm_nodes.copy_to_device();
device_update_common(device, dscene, scene, progress);
need_update = false;
VLOG(1) << "Shader manager updated " << scene->shaders.size() << " shaders in "
<< time_dt() - start_time << " seconds.";
VLOG(1) << "Shader manager updated " << num_shaders << " shaders in " << time_dt() - start_time
<< " seconds.";
}
void SVMShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *scene)

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