1
1

Compare commits

...

2099 Commits

Author SHA1 Message Date
784da45955 GLDebug: Trim NVidia debug output
These buffer detailed infos are not needed unless going deep into
perf. profiling, in which case you can still disable this compile option.

This makes user report log much more readable.
2020-09-05 16:47:31 +02:00
263ee86fb4 GLTexture: Fix texture creation when using direct state access
There was 2 errors:
- A texture object must have been bound to target_ before use with DSA funcs
- We need to use glTextureSubImage for DSA updating
2020-09-05 16:28:07 +02:00
Clément
d1479c437b GLTexture: Add Feedback loop check
The check is better than before as we take into
consideration the attached mip level.
2020-09-05 14:48:44 +02:00
Clément
0038b598cf Cleanup: GPUFramebuffer: Remove unused variable 2020-09-05 14:08:53 +02:00
Clément
efd00731f5 GLTexture: Add direct state access support 2020-09-05 14:08:02 +02:00
Clément
219e263b59 GLState: Add texture multibind and remove redundant binds 2020-09-05 14:06:50 +02:00
Clément
5265ed7be2 Math Utils: Add bitscan 64bit version 2020-09-05 14:04:00 +02:00
5b314f884d GPUTexture: OCIO: Workaround new missing bind error checking
We cannot change the texture bind point since the interface count
4/5 textures to bind. Changing the uniform to avoid one bind
make the system thinks one texture is missing.

Avoid this by creating a dummy texture and binding it to the empty
slot.
2020-09-05 02:55:30 +02:00
af095ab71f GPUDebug: Only enable resource checking in debug mode 2020-09-05 02:55:30 +02:00
6f998edf2a Cleanup: GPUTexture: Move debug messages outside of creation function
# Conflicts:
#	source/blender/gpu/intern/gpu_framebuffer.cc
2020-09-05 02:55:22 +02:00
bd081711d6 GPUTexture: Change texture creation API
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.

This is a cleanup commit, there is no functional change.
2020-09-05 01:58:07 +02:00
42e5de3f4d Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
2020-09-04 23:13:12 +02:00
fd4f766d58 GLTexture: Add validation for empty slots before drawing
This is to have better error detection in debug builds.
This is not a replacement for a full check like in renderdoc but it
might catch some issues early on.
2020-09-04 22:19:36 +02:00
922abf37b2 OCIO: Use GPUTexture instead of OpenGL calls and remove gl dependency
Simple cleanup. Part of the Vulkan Port T68990.
2020-09-04 22:18:10 +02:00
cfba534403 GPUTexture: Implement back 3D texture resize
But this time implement it outside the texture module.
This makes more sense as only the volume textures need this feature.
2020-09-04 21:10:54 +02:00
1394c0b852 BLI: Math: Add equals_v3v3_int 2020-09-04 21:07:26 +02:00
Clément
84cb571c1f Cleanup: GPUTexture: Clean framebuffer attachment 2020-09-04 16:35:02 +02:00
Clément
34921b47f7 Cleanup: GPUFrameBuffer: Use Texture class instead of gl calls 2020-09-04 13:51:25 +02:00
5f7cc8cf51 GLTexture: Add back texture proxy check
Cleanup the feature itself:
- Check 3D textures size against the correct limit.
- Add check for compressed textures.
2020-09-04 02:45:55 +02:00
ffa351d533 GPUTexture: Add support for samplers
This just add back the support.
This commit also includes a bit of cleanup.
2020-09-04 02:45:55 +02:00
e58408cbaf GPUTexture: GL Backend Isolation
This is a massive cleanup needed for vulkan support T68990. It provides:

- More meaningful enums with conversion functions.
- Less hacky supports of arrays and cubemaps (all considered layered).
- More inline with the stateless design of vulkan and modern GL.
- Methods Fallbacks are using framebuffer functions that are wrapped
  instead of implementing inside the texture module.

What is not in there:
- API change.
- Samplers support (breaks a few effects).
2020-09-04 02:45:53 +02:00
19d056cb85 GPUFramebuffer: Encapsulate single attachement clear
This is in preparation of using it to clear single texture.

Also includes minor cleanups about not using tex target in
assert and adding enum operators.
2020-09-04 02:44:33 +02:00
da306fb2fc Cleanup: EEVEE: Use correct array size and use equals_v2v2_int 2020-09-04 02:41:57 +02:00
63b6e87d98 GPUTexture: Add skeleton of the new GLTexture class 2020-09-04 02:41:53 +02:00
f7e1c007ab GPUTexture: Remove bind to edit calls
This is going to be unecessary after the GPU opengl texture backend refactor.

For now add a save/restore mechanism to leave the state untouched.

Also remove some calls where the caller would bind to particular binding
point and set the shader uniform.
2020-09-04 02:39:05 +02:00
a96283ba51 Fix assert when cleaning constraints in the transform tool
When enabled, the modal key item "Clear Constraint" did not reset
the default orientation.

This does not bring changes in the user's point of view.
2020-09-03 17:57:58 -03:00
ff3a9852a7 Cleanup: Shorten the name of the Auto Constraint modal keymap
It was taking up too much space in the status bar.
2020-09-03 17:57:42 -03:00
953a031f15 UI: Fix use after free for instanced panel expansion
The "set_expand_from_list_data" function has to be called after updating
the panels' custom data pointers. Otherwise the wrong information is
retrieved in the best base and it will cause a crash in the worst case.
2020-09-03 14:33:44 -05:00
88b6dd1392 Fix missing cursor changes with "Lock Object Modes" disabled
Changing the active object would change the mode, but the necessary
toolsystem update to change the cursor was not run.

Steps to recreate were:
* Duplicate default cube
* Enter sculpt mode with one of the cubes
* Disable Edit > Lock Object Modes
* Select back-and-forth between the objects

Same would happen with other modes.
2020-09-03 21:04:17 +02:00
c7b00ef625 MSVC: Fix cmake warnings with MSVC updates
CMake caches the location of the CRT runtime in the
MSVC_REDIST_DIR variable, and uses it to copy the required
dll's during the install phase.

This variable is only initialized when it does not exist.
Leading to issues when compiler updates are installed and
the compiler version slightly changes, cmake still looks
in the old location for the runtime and warns about the
files not existing.

This change fixes the issue by checking if the redist dir
exists and if not unsets it so InstallRequiredSystemLibraries
can have another go at figuring out where they live.
2020-09-03 12:39:49 -06:00
19fff96ef5 Fix T80289: GPencil Opacity modifier not working
This error was introduced in the refactor of the modifier panels.
2020-09-03 20:17:09 +02:00
6d39fd94b4 Fix copy/paste error in Grease Pencil Draw operator tooltip
Also remove capitalization of the term "object".
2020-09-03 19:36:52 +02:00
340cbc7f15 Fix T79803: Wrong Distance To Edge 1D Voronoi
The current 1D Voronoi implementation for the Distance to Edge option
computes the distance to the cells instead. This patch fixes that and
compute the distance to the edge.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D8634
2020-09-03 18:56:27 +02:00
d2c52d4de2 Cleanup: Add/use function to disable buttons with a disabled hint
We do this in a couple of places, so it's worth having the logic wrapped
into a function.
Also, the only way to set the disabled hint for a button from outside of
`interface/` was through `UI_block_lock_set()`/`UI_block_lock_clear()`,
for which the usage isn't obvious when you just try to disable a single
button.
2020-09-03 17:46:23 +02:00
d8a80e5949 Revert "Fix T59358: Wrong status bar keymap for release confirms and right click select."
This reverts commit 17905e89a7.
Fix T80429: Transform Tools cannot be cancelled

rB17905e89 better filtered the key items that should appear in the
status bar.

But it is very restrictive since canceling is still possible in other
cases.


# Conflicts:
#	source/blender/editors/transform/transform.c
2020-09-03 12:33:44 -03:00
afb43b881c Sculpt: Face Set Extract Operator
This implements a Face Set Extract operator, which is similar to mask
extract. This operator uses a picker to select and Face Set in the mesh
and extract the geometry directly to a new object.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8599
2020-09-03 17:26:12 +02:00
c8e5924cbb UI: Expose important settings from file browser popovers
We have established a convention of exposing the most important
settings from popovers, then aligning a popover to control more
detailed settings.

The file browser has powerful display / filtering settings, but
they're hidden in popovers at the moment, so it's sometimes a pain
to use them. The "display as" options are now exposed to the left of
the display settings popover, and the "filter" toggle is exposed to
the left of the filter settings popover. This convention is familiar
and intuitive for users and makes interaction faster.

Note that the "show hidden" item in the filter popover still has an
effect if filtering is disabled.

This commit also:
 - Removes the icons in the "Sort By" enum
 - Uses property split for the "Sort By" enum
 - Very slightly increases the default width of the file browser
   window to make room for the new buttons.

Differential Revision: https://developer.blender.org/D8719
2020-09-03 10:02:09 -05:00
eb82b3947e Sculpt: Remove unused code in Clay Strips
This was doing a matrix inversion per vertex per stroke step and it was
unused.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8791
2020-09-03 16:47:18 +02:00
38737f780a Fix cloth brush not working with anchored stroke
All brushes except for grab need delta for tip orientation in order to
work with anchored stroke, not only snake hook, which is the one that
needs it always.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8789
2020-09-03 16:46:36 +02:00
c05715b03f Sculpt: Sculpt Face Set gestures tools
This implements the sculpt gesture lasso and box operators for face
sets. They work the same way as the mask gesture operator and tools.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8716
2020-09-03 16:44:40 +02:00
10d61f34bb Fix clang tidy errors in tests 2020-09-03 16:26:45 +02:00
519b2f937f BLI: add index_range method for StringRef 2020-09-03 16:26:45 +02:00
e7d3d0219b Fix T79718: Eevee OpenVDB render error when frames miss part of the grids
Improved fix that handles the distinct cases of missing grids and zero
size grids.
2020-09-03 16:12:30 +02:00
f0c376a52a Fix T80332: principle volume shader not working for world in Eevee
The handling of missing volume grids for the principled volume shader was
incomplete, different inputs need different default values.
2020-09-03 15:49:41 +02:00
Yevgeny Makarov
96439de784 UI: Reduce limits for the text size theme options
It was possible to increase the text size quite a lot, making text much
bigger than their containing widgets. These new limits makes the maximum
size of text be closer to the widget size.
Note that there needs to be some extra "wiggle room" since fonts may
have quite different glyph sizes. So you can still set the font size to
be slightly bigger than the widgets.

Addresses T80175 and T79059.
2020-09-03 15:42:44 +02:00
Philipp Oeser
f00cb93dbe Fix T63125: Gpencil: bones cannot be selected in weightpaint mode
Some underlying functionality was not ready for greasepencil:
- BKE_modifiers_get_virtual_modifierlist (now introduce dedicated BKE_gpencil_modifiers_get_virtual_modifierlist)
- BKE_modifiers_is_deformed_by_armature
- checks in drawing code
- checks in (pose) selection code

A couple of changes to make this work:
- `eGpencilModifierType_Armature` has to be respected (not only `eModifierType_Armature`)
- `OB_MODE_WEIGHT_GPENCIL` has to be respected (not only `OB_MODE_WEIGHT_PAINT`) --  (now use new `OB_MODE_ALL_WEIGHT_PAINT`)
- `gpencil_weightmode_toggle_exec` now shares functionality from `wpaint_mode_toggle_exec` -- moved to new `ED_object_posemode_set_for_weight_paint`

This patch will also set the context member "weight_paint_object" for greasepencil (otherwise some appropriate pose operators wont work when in weightpaint mode)

Reviewed By: campbellbarton

Maniphest Tasks: T63125

Differential Revision: https://developer.blender.org/D8483
2020-09-03 15:01:50 +02:00
a505a85873 Fix 3D text cursor alignment without any text
Part of fix for T80340.
2020-09-03 21:20:56 +10:00
930021129a Quick effects: avoid error in builds without OpenVDB
Differential Revision: https://developer.blender.org/D8626
2020-09-03 12:56:27 +02:00
a04ac5b52d Fix T80391: Overrides: wrong check in constraint poll
Condition was flipped, would allow actions on constraints coming from
library, but prevented actions on local constraints.

Mistake in rBS0b49fdd0ee0.

Maniphest Tasks: T80391

Differential Revision: https://developer.blender.org/D8793
2020-09-03 12:47:54 +02:00
09f966ad16 Fix mistake in recent font cleanup
7ff7a9c8fd missed incrementing the pointer used for initializing.
2020-09-03 20:14:55 +10:00
Stefan Werner
c8b84a13a5 Make deps: Disabled assembly for GMP on Apple/arm64.
This appears to be a configuration for which GMP has no assembly,
yet the default configure script tries to build it.
2020-09-03 10:11:59 +02:00
3cbfe96681 Object: add BKE_object_obdata_to_type utility function
Move functionality to get the object type from an ID
into it's own function.
2020-09-03 16:27:15 +10:00
c017e1cb67 Fix T80409: Walk rotation speed depends on view size
Use a fixed speed for rotating the view in walk mode,
Keep the current behavior for tablet input and fly mode.
2020-09-03 14:31:26 +10:00
fc6b0c6f85 Fix crash running remesh modifier without OpenVDB 2020-09-03 13:32:53 +10:00
2820f7be76 Fix T80340: Crash with an empty text with Text on Curve
Avoid divide by zero, based on D8780 by @lichtwerk.
2020-09-03 13:28:01 +10:00
7ff7a9c8fd Cleanup: remove redundant Y bounds calculation for text on path
Also correct some comments.
2020-09-03 12:28:22 +10:00
99c3ac17f2 Modifiers: default to exact boolean method ignoring build options
This change doesn't impact release builds,
in general avoid having defaults depend on build options
since it means files from different builds won't match.
2020-09-03 10:07:39 +10:00
14e2596d21 UI: pixel align axis navigation characters to resolve blurry text
Also increase text size from 11 to 12 since the default
font at 1.0 scale was a little fuzzy too.

Reviewed by: @pablovazquez

Ref D8781
2020-09-03 09:33:31 +10:00
Pablo Dobarro
89cdf4f75d Fix Cloth Snake Hook brush not using pressure
The Snake Hook deformation mode was using the same strength as grab (not
supporting pressure), but this deformation mode supports pressure.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8724
2020-09-02 22:33:24 +02:00
fb09bc3c35 Fix T80311: Sculpt Filters not working when using vertical split
All filters were using prevclicx, which is in screen coordinates and
mval[0], which is in region coordinates to get the filter strength.

This fixes the issue in all filters.

Reviewed By: Severin

Maniphest Tasks: T80311

Differential Revision: https://developer.blender.org/D8776
2020-09-02 22:30:59 +02:00
ba4a2a4c8b UI: Use instanced panel custom data instead of list index
For modifier shortcuts we added a "custom_data" field to panels.
This commit uses the same system for accessing the list data that
corresponds to each panel. This way the context is only used once
and the modifier for each panel can be accessed more easily later.

This ends up being mostly a cleanup commit with a few small changes
in interface_panel.c. The large changes in the UI functions are due
to the fact that the panel custom data is now passed around as a
single pointer instead of being created again for every panel.

The list_index variable in Panel.runtime is removed as it's now
unnecessary.

Differential Revision: https://developer.blender.org/D8559
2020-09-02 14:13:26 -05:00
ff7d742350 Quiet all warnings when building Bullet 2020-09-02 21:06:02 +02:00
4446c3a593 Sync Bullet to upstream
This syncs Bullet to the latest upstream git version as of writing this.
(commit 47b0259b9700455022b5cf79b651cc1dc71dd59e).
2020-09-02 20:41:30 +02:00
6f6f6ee186 Fix missing "extern_bullet" library when building rigidbodies 2020-09-02 19:44:29 +02:00
f5e55c3337 Cleanup: use bool instead of int in various places 2020-09-02 19:10:40 +02:00
f20f82ce3e Fix segfaults when deleting objects with upstream bullet lib
Blender tried to free objects twice from the bullet world sometime.

First we would implicity remove all objects when recreating the bullet
world and then explicity try to remove them again from the now empty
world.

This would wouldn't crash older bullet versions, but the recent versions
will as we will try to free objects that no longer exists in the bullet
world.

Also clear the cache on deletion as the object order changes.
Fix T77181: The cache clearing will fix this issue.
2020-09-02 18:35:16 +02:00
9b1f726248 Cleanup: general cleanup of node.c
- reduce variable scope
- use bool instead of int
- use LISTBASE_FOREACH
2020-09-02 18:28:17 +02:00
a8cf9d2f80 UI: Use property split layout for add torus operator
Continuing the work from D8326, this commit adds a property split
layout to the add torus operator. It also puts the properties common
to all object add operators at the bottom for consistency.

Differential Revision: https://developer.blender.org/D8748
2020-09-02 10:34:44 -05:00
4330f147d0 Fix unused variable warning on Windows with WITH_INPUT_IME disabled 2020-09-02 17:32:58 +02:00
c992fd3a3c Cycles: Support WITH_CYCLES_NATIVE_ONLY with MSVC
This change enables the developer option `WITH_CYCLES_NATIVE_ONLY`
for MSVC. This allows a developer to just build the cycles
CPU kernel for their specific system rather than all kernels,
speeding up development.

Other platforms have had this option for years, but MSVC lacks
the compiler switch to target the host architecture hence it
always build all kernels.

This change uses a small helper program to detect the required
flags.

Only AVX/AVX2 are tested, for the following reasons

- SSE2 is enabled by default and requires no flags
- SSE3/4 have no specific build flags for msvc
- AVX512 is not yet supported by cycles

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

Reviewed by: brecht, sergey
2020-09-02 09:19:44 -06:00
1082edfdfd Cleanup: Clang-format 2020-09-02 09:19:14 -06:00
279f7ad8ac Cleanup: Correction to previous cleanup commit
I somehow undid these changes again before committing, sorry for the
noise...
2020-09-02 16:31:23 +02:00
9c3fa99658 Cleanup: Correct argument names in comment
Names were changed in 66b12ef4ab, but the comment wasn't updated.
2020-09-02 16:26:23 +02:00
09ef199965 PY API doc: fix doc for new override option of properties.
Reported by Demeter Dzadik (@Mets) on blender.chat, thanks.

Candidate to be backported to a potential 2.90.1.
2020-09-02 14:59:58 +02:00
1aa54d4921 Make rigidbody simulation handle animated objects gracefully
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.

Updated the code to use explicit substeps and tie it to the scene frame rate.

Fix T47402: Properly updating the animated objects fixes the reported issue.

Reviewed By: Brecht, Jacques

Differential Revision: http://developer.blender.org/D8762
2020-09-02 14:20:41 +02:00
feb4b645d7 EEVEE: Shader tests for Depth of Field
This patch moves the EEVEE depth of field shaders to eevee_shaders.c and
adds them to the eevee shaders test suite.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8771
2020-09-02 13:03:06 +02:00
d851b38185 Cleanup: improve internal function name in 'ngon_tessellate' 2020-09-02 19:33:47 +10:00
cf67ba848f WM: add use_factory_startup option to read homefile operator
There was no way to reset the current file to factory settings
without reloading the preferences (which disables & re-enables add-ons),
this slows down resetting files and can complicate tests.
2020-09-02 17:50:20 +10:00
428a1aaf73 UI: add back Layout.introspect
Add back this function, removed 2e14b7fb97.

Useful for checking operators used in menus.
2020-09-02 15:58:44 +10:00
89ed6b1293 UI: simplify tool-tip logic for operators
- Use WM_operatortype_description to get the operator description.
- Pass properties to WM_operatortype_name,
  so the operator name callback is used.
- Add UI_but_operatortype_get_from_enum_menu function
  to access the operator from enum menus.
- Change WM_operatortype_description to return NULL when there is no
  description, use WM_operatortype_description_or_name
  when either can be used.
2020-09-02 13:01:04 +10:00
ddea2f234f Fix crash accessing image space properties without an active window 2020-09-02 12:44:37 +10:00
957346694d Cleanup: spelling, rename attachement -> attachment 2020-09-02 10:04:50 +10:00
71aa3c864d Cleanup: spelling 2020-09-02 09:58:26 +10:00
ba188e7218 UI: Remove unecessary panel_free_block function
This function was called when the modifier list changes and the panel
list has to be rebuilt. Originally I thought it was necessary to to remove
the block immediately when the panel was removed, but we can just
leave it and it will be removed later in the UI drawing process.

Removing this results in fewer string lookups.
2020-09-01 17:29:17 -05:00
f6ab6dd91a Cleanup: Reduce indentation level and variable scope
Exit early in some functions to reduce indentation level, declare
variables where they are initialized, and also  clean up some
comment formatting.
2020-09-01 16:39:46 -05:00
Stefan Werner
009971ba7a Cycles: Separate Embree device for each CPU Device.
Before, Cycles was using a shared Embree device across all instances.
This could result in crashes when viewport rendering and material
preview were using Cycles simultaneously.

Fixes issue T80042

Maniphest Tasks: T80042

Differential Revision: https://developer.blender.org/D8772
2020-09-01 21:00:55 +02:00
f2d26409e8 Fix T80233: Extrude manifold can generate invalid geometry
Faces with only 2 sides were sometimes generated.
2020-09-01 15:25:30 -03:00
Imre Palik
f6dc6caa15 Fix Cycles build error when disabling some kernel features
Differential Revision: https://developer.blender.org/D8372
2020-09-01 19:14:31 +02:00
2930d4fcea Fix T80031: UI: Use a more specific label for stencil mask opacity
This is not the opacity of the vertex colors itself but of the stencil 
mask.

Follows up on rBbb4478f2fdd8426d6050bf7b7c09611afeb1bd14
2020-09-01 12:56:22 -04:00
d6a9783b71 Cleanup: GLFrameBuffer: Reduce indentation 2020-09-01 18:42:46 +02:00
7edd60b35b GLFramebuffer: Avoid calling method on a partially destroyed GLContext
This avoid an ASAN runtime error.
2020-09-01 18:42:37 +02:00
3c54db4a4e Audaspace: port compilation fix from upstream. 2020-09-01 18:12:48 +02:00
a92ab93c7d Fix T79553: StretchTo constraint: Apply Pose changes bone length
Recompute Rest Length stored in the StretchTo constraint after applying
the current pose as rest pose.

The "Apply Pose as Rest Pose" operator applies the evaluated pose as
rest pose, which means that the change in bone length from the StretchTo
constraint is applied to the rest pose. The bug was caused by the fact
that the StretchTo constraint wasn't updated for the new pose, and thus
still applied the same scale factor to the new pose, effectively
doubling its effect.

The "Apply Pose as Rest Pose" operator now forces a recompute of the
rest length cached in the StretchTo constraint data. As a result, the
length of the bone before and after the pose is applied remains the
same. The X and Z scale (perpendicular to the bone length) are reset to
1.0, as with the applied pose the bone isn't stretched or squashed any
more.
2020-09-01 17:57:42 +02:00
23767937ef USD: remove library initialisation hack
Remove the hack for library initialisation; this is no longer necessary
as the required information can be passed to the USD library after its
static initialisers have run.

This new approach is compatible with both the patched and original USD
library. This means that platform maintainers don't need to rebuild the
USD library until the next upgrade.

Manifest Task: https://developer.blender.org/T80320
2020-09-01 17:29:01 +02:00
fef1a6c54e USD: move library initialisation from main() to USD module
Initialize the USD library when used (instead of at startup), so that
this can happen inside the IO/USD module. This makes calls to the USD
library local to Blender's USD code.

Note that failure to find the USD JSON files will now only be reported
when the USD exporter is used, and not on every startup of Blender.

This is the first step in cleaning up the way Blender patches and
initialises the USD library.

Manifest Task: https://developer.blender.org/T80320
2020-09-01 17:28:05 +02:00
f1b10477c2 GPUOffscreen: Remove scissor and viewport state tracking
This was a workaround that is not needed anymore.

Fix FT80321 Cropped output with Viewport Render Animation
2020-09-01 17:22:57 +02:00
907a718ebe Fix T80224: Crash after duplicating and hiding vertices while using X Axis Mirror
The mirror map can reference a hidden vertex that is currently ignored
in the transformation.

Thus the mirror element array is not filled.
2020-09-01 12:13:34 -03:00
eb911610d0 Fix ugly alignment of "Mono" option in the Sequencer
Steps to reproduce were:
* Open Sequencer, add a sound strip
* In the sidebar, open the Adjust > Sound sub-panel
* Note the placement of the "Mono" item

The layout code would disable decorators if a property came from a
non-animatable data-block type. Doing so would mess up the alignment
where properties from different data-block types were be mixed.
This is not the case any more.

Note that when actually adding the decorator, a blank icon is inserted
to keep the alignment intact when the data-block type isn't animatable.
So the decorator is still not shown, but the alignment looks fine.

This may affect more cases. If so, and if that's an issue, the
decorators should be explicitly disabled.
2020-09-01 17:10:42 +02:00
ee393f9821 Fix (unreported) GPencil cannot deselect points with box/lasso select
Selecting in empty space wasnt considered as 'changed'.

Differential Revision: https://developer.blender.org/D8770
2020-09-01 17:03:09 +02:00
fec522be6a Fix T79941: mantaflow cache doesn't work with ' character in path
The fix is to escape the `'` character as well.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8773
2020-09-01 16:33:32 +02:00
a708cdabe6 Fix T80328 Commit introduced build warnings in Windows 2020-09-01 16:16:48 +02:00
7e3967ed37 Gizmo: Navigate: Make use of UI_draw_roundbox_4fv
This improves circles AntiAliasing, and line antialiasing.

This keeps the old drawing method (3d spheres) for the selection pipeline.

This was suggested by @harley on devtalk.
2020-09-01 16:08:50 +02:00
998b680e5b UI: Widget: Add conservative raster to avoid cut widget borders
This avoids incorrect AA when the widget is not perfectly alligned with the
pixel grid.
2020-09-01 16:08:50 +02:00
31004ef48e Transform: Keymap: Enable Auto Constraint with Middle Mouse + Shift 2020-09-01 10:59:16 -03:00
c7287ffaec Transform: remove MOD_CONSTRAINT_PLANE
It conflicts with MOD_PRECISION and was not really working properly.
2020-09-01 10:50:50 -03:00
8170c92ed4 Fix constrain plane masking shift event
This prevented transformation with a precision modifier.
2020-09-01 10:38:37 -03:00
26d5c24f0a Fix T80258: UILayout.prop_search() issues with datablock names
If the search menu was used for a string property, and a data-block was
selected from the search, the value set would be an invalid name. The
property would get the modified UI string, not the proper data name set.

This problem was already once solved in rB249ccab111ac, but resurfaced
in rB937d89afba36.

Now only use the modified UI string if requires_exact_data_name is not
true.

Note: the comments in rB249ccab111ac [reg. library hints and string
properties, also that pointer properties are preferred over string
properties when dealing with IDs] still apply.

Reviewers: campbellbarton

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

(cherry picked from 2.90 commit
cb0b0416f4)
2020-09-01 15:24:26 +02:00
9259052e15 Fix T64267: 'Add Snap Point' does not work with Ctrl pressed 2020-09-01 09:53:35 -03:00
Germano Cavalcante
526fbdec3b Transform: Move some hardcoded keyitems to keymap_data in python
Keymaps must be customized by the user.

But this is not the case for hardcoded keymaps.

Also the repetition of hardcoded and user-defined keyitems may induce
the user to think they have made a mistake or it is a bug.

Differential Revision: https://developer.blender.org/D6454
2020-09-01 09:39:06 -03:00
Stefan Werner
17cf500101 Cycles: Fixed Cycles standalone build.
The node refactor in 429afe0c62 was missing in the standalone code.
2020-09-01 14:13:17 +02:00
07899ddd22 Fix double include of gmp.cmake
This fixes `make deps` complaining about the `extern_gmp` project being
defined twice.
2020-09-01 12:39:58 +02:00
d6d2897ef0 Sequencer: Fix crash caused by stereo rendering fix
Caused by rB2e908156d0c7

This was caused by the sequencer timeline area not using a GPUViewport
but still using `sequencer_draw_preview`.
2020-09-01 12:03:52 +02:00
991eb5f79c Cleanup: GPUContext: Remove unused functions 2020-09-01 12:03:52 +02:00
a6185e4fa5 OCIO: Make GLSL implementation use GPUUniformBuf to avoid debug errors
Now that we use internal state info, we require drawing that uses the
GPU api to use it throughout the whole pipeline. This is in order to
track the GL state and do our own error checking.
2020-09-01 12:03:52 +02:00
53a806f6df GPU: Move UBO binding validation to GL backend
This also make the validation quicker by tracking the currently
bound slots.
2020-09-01 12:03:52 +02:00
5ec0250df9 EEVEE: Volumetric: Fix Mesa Compiler error
The compiler does not seems to understand the `const` in the
function declaration and complains about non constant indexing
of unsized array.
2020-09-01 12:03:52 +02:00
ccf476f8af EEVEE: Volumetric: Fix missing UBO
This is undefined behavior on certain system.
2020-09-01 12:03:52 +02:00
f818d1d636 Cleanup: Fix warnings in our intern bullet api wrapper
No functional changes.
2020-09-01 12:01:50 +02:00
Stefan Werner
45da7ce177 Cycles: Followup fixes for node ownership refactor.
There were some places where nodes still would end up without owners.

See D8540 and 429afe0c62
2020-09-01 11:47:54 +02:00
e8be55a485 Fix: Active rigidbodies would not recive updates after the stopped being animated
Because depsgraph isn't rebuild for animated properies, we have to
assume that active bodies will always want to have updates from the
rigidbody simulation.
2020-09-01 11:41:44 +02:00
c2df6658ee CMake: Fix linking errors with gmp library
gmpxx library (C++ version of gmp) uses symbols from libgmp, which means
the libgmp is to be passed to the linker after libgmpxx.
2020-09-01 11:31:47 +02:00
114150e80c Fix compilation error with -Werror=array-bounds
This error happened only with O2 or O3 in my tests.
Casting to uintptr_t and back seems to quiet the compiler.
2020-09-01 11:11:21 +02:00
1449ae042e Cleanup: EEVEE bloom shaders
- moved to eevee_shaders
- added to test suite

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8763
2020-09-01 10:57:20 +02:00
c78c425266 PyAPI: expose 'bl_options' for operators in bpy.ops
Useful for checking which operators are only for internal use.
2020-09-01 17:02:51 +10:00
06ba233374 RNA: rename Area.ui_type 'VIEW' enum identifier to 'IMAGE_EDITOR'
The term makes sense in the image editor, but not among other editors
where we had both VIEW and VIEW_3D.
2020-09-01 16:35:47 +10:00
87aa13d025 PyAPI: prevent leading comma when printing some enums
BPy_enum_as_string (used for creating error messages)
showed a leading comma for enums that used category headings.

While harmless, it looks odd.
2020-09-01 16:32:11 +10:00
76f513f6dc Fix T78601: User count errors when reading home-file
Calling: bpy.ops.wm.read_homefile(use_empty=True)
exposes invalid user-counts in versioning code.

Simplified logic for assigning materials in versioning code.

Caused by 29f3af9527.
2020-09-01 15:00:48 +10:00
a241948ad9 Fix errors ensuring grease pencil palette
- Direct assignment caused ID user counts to be invalid.
- The first palette would always be used,
  even when the named palette searched for was found.

Also pass 'const' string to `hex_to_rgb`, avoid casting to 'non-const'.
2020-09-01 15:00:48 +10:00
d9d0a386cb Cleanup: don't register mix-in menu class
The class is only used as a base for other menus.

This caused complications for tests that inspect menu contents.
2020-09-01 15:00:48 +10:00
8c86c55035 Cleanup: correct doxy sections 2020-09-01 15:00:48 +10:00
bb4478f2fd Fix T80031: UI: "Stencil Opacity" is vague
This affects the mask opacity not the stencil itself.
2020-08-31 23:30:18 -04:00
12c0ecc934 Fix T80100: To sphere tooltip uses "vertices" even in object mode 2020-08-31 23:30:18 -04:00
4e06afb0a1 GL: Fix two GLerror
The gizmo one was only reproducible in debug builds.
The GLImmediate one was only affecting amdpro drivers when --debug-gpu was
enabled.
2020-09-01 00:30:36 +02:00
7f95d780e8 GLImmediate: Use CL_CHECK_ERROR
This provides a bit more debugging info on MacOS.
2020-09-01 00:30:36 +02:00
9d932b426f GL: Move MacOS debug callback to gl_debug.cc
And format to use the same callback as standard debugging layer.
2020-09-01 00:30:36 +02:00
82a197cc7f GPUDebug: Reformat GL debug callbacks and move them to GL backend
Now the callbacks are setup for each debug context.

The formating has been reworked to be less verbose and make errors
and warnings stand out from the notifications.
Errors are most of the time sufficiently explicit in their message.

This also remove the support for AMD_debug_output which is 10 years old.

This is related to the Vulkan port T68990.
2020-09-01 00:30:36 +02:00
058d29ed9a GHOST: Enable debug context on offscreen context too
This was a long standing TODO. This was also preventing debug callbacks
form other context than the main window.
2020-09-01 00:30:36 +02:00
13b0a697a0 Cleanup: GPU: Remove GPU_draw_primitive and default_vao_
These are not used anymore and can be replicated using the GPUBatch API.
2020-09-01 00:30:36 +02:00
052538edc1 Cleanup: Use GPUBatch for icon and area drawing
This is in order to remove GPU_draw_primitive to streamline the drawing
abstraction.
2020-09-01 00:30:36 +02:00
3e7feaff44 Cleanup: Comment formatting in unit.c 2020-08-31 14:18:06 -05:00
fc8533a3c9 New Boolean: Always expose solver propery, add warning
After discussion with @howardt, it seems the solver property should
always be exposed, even in lite builds. This commit removes the
ifdefs for that property and adds a warning if the "Exact" solver is
used when Blender is compiled without GMP.

These changes apply to the boolean modifier as well.
2020-08-31 11:49:22 -05:00
7056f180d3 cleanup: Fix GMP spacing in cmake configurations
It now follows the spacing around it.
2020-08-31 09:42:58 -06:00
3014b5efc8 Fix unused parameter warning in snap_increment_apply_ex()
No functional changes.
2020-08-31 17:37:48 +02:00
f5866f484f Remove patch for HDF5 library
Delete `hdf5.diff`, because it's no longer used. Since Blender 2.90 the
optional support for HDF5 has been dropped, but this file accidentally
wasn't deleted.

See 0102b9d47e and 0c38436227.

No functional changes.
2020-08-31 17:32:28 +02:00
Germano Cavalcante
546b900194 Cleanup/Refactor: Split the snap to increments code
Now we have a better distinction of what is snap to grid and what is
snap to increments.

The code also allows the implementation of mixed snap for these modes.
2020-08-31 11:24:37 -03:00
a1df2fc443 Cleanup: GPU: Remove unused attr_binding and primitive code 2020-08-31 15:15:04 +02:00
1804eb57fd GPUImmediate: GL backend isolation
This is part of the Vulkan backend task T68990.

This is mostly a cleanup, however, there is a small change:
We don't use a special Vertex Array binding function for Immediate
anymore and just reuse the one for batches.
This might create a bit more state changes but this could be fixed
easily if it causes perf regression.

# Conflicts:
#	source/blender/gpu/intern/gpu_context.cc
2020-08-31 15:14:47 +02:00
1b3a0ae231 GLContext: Fix framebuffer deletion to GPUContext
This has more meaning as it's the base class who holds the pointer.

# Conflicts:
#	source/blender/gpu/opengl/gl_context.cc
2020-08-31 15:13:26 +02:00
a54fb081ba Cleanup: GPU_immediate: Change assert to BLI_assert 2020-08-31 15:10:38 +02:00
Germano Cavalcante
a440060142 Fix T79973: Re-ordering face maps messes up the names of other face maps
Use a remap function instead a swap.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D8739
2020-08-31 09:00:48 -03:00
c83ef9d7b2 Cleanup: reduce variable scope 2020-08-31 13:59:33 +02:00
e9da71ae2d Cleanup: reduce variable scope and use LISTBASE_FOREACH 2020-08-31 12:55:51 +02:00
c5b9bf32e9 Fix T80126: Alembic Import dialogue has overwrite protection UI
Use `FILE_OPENFILE` when importing, rather than `FILE_SAVE`.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8715
2020-08-31 12:39:01 +02:00
1c2ade053a Linux: 2.90 release information in appdata 2020-08-31 11:21:01 +02:00
6879798202 Cleanup: Resolve unused variable warning in lite build 2020-08-30 22:47:05 -05:00
596b30a080 Clang Tidy: Fix readability-delete-null-pointer warnings 2020-08-30 18:58:40 -05:00
429afe0c62 Cycles: introduce an ownership system to protect nodes from unwanted deletions.
Problem: the Blender synchronization process creates and tags nodes for usage. It does
this by directly adding and removing nodes from the scene data. If some node is not tagged
as used at the end of a synchronization, it then deletes the node from the scene. This poses
a problem when it comes to supporting procedural nodes who can create other nodes not known
by the Blender synchonization system, which will remove them.

Nodes now have a NodeOwner, which is set after creation. Those owners for now are the Scene
for scene level nodes and ShaderGraph for shader nodes. Instead of creating and deleting
nodes using `new` and `delete` explicitely, we now use `create_node` and `delete_node` methods
found on the owners. `delete_node` will assert that the owner is the right one.

Whenever a scene level node is created or deleted, the appropriate node manager is tagged for
an update, freeing this responsability from BlenderSync or other software exporters.

Concerning BlenderSync, the `id_maps` do not explicitely manipulate scene data anymore, they
only keep track of which nodes are used, employing the scene to create and delete them. To
achieve this, the ParticleSystem is now a Node, although it does not have any sockets.

This is part of T79131.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8540
2020-08-30 23:49:38 +02:00
19363880a6 New boolean: silence an "unused" warning.
Previous commit stopped using some functions. Since I may need
them again for future performance tuning, these are just ifdef'd out
for now.
2020-08-30 14:11:36 -04:00
3fa1280132 Fix T79940 VSE Editor crash when opening a different scene as a strip
This was caused by a double lock of the DRW context mutex.

This changes the logic a bit by releasing the DRW context before rendering
with BKE_sequencer_give_ibuf and restoring it after.

Critical fix for 2.91

Reviewed By: dfelinto
Differential Revision: https://developer.blender.org/D8657
2020-08-30 19:58:54 +02:00
19c9b27ffe New boolean: another performance improvement.
Instead of calculating exact normals for all faces, just do it
for those that potentially intersect. A big improvement for dense
meshes that only intersect in relatively few places.
2020-08-30 13:47:18 -04:00
ade8d84fe3 GPUFrameBuffer: Fix build error on MSVC
This also gets rid of the macro.
2020-08-30 19:07:49 +02:00
0299817e0e Fix T80138 Node Editor: Add Frame turns background gray
The removed `UI_ThemeClearColor` made no sense in this context. It must
have been a leftover from previous refactor.
2020-08-30 18:24:19 +02:00
3699d6fe34 Re-enable modifer and bmesh_boolean tests.
These were disabled in the newboolean merge commit.
This commit renables them, using the original 'FAST' solver
so that the result objects need not change.
A TODO to add more tests using the 'EXACT' solver,
though most functionality there is now covered by unit gtests.
2020-08-30 08:31:40 -04:00
dee665b462 GPUShader: Improve shader compilation log
- Print shader type (fragment, vertex, geom)
- Support for Apple + intel error format.
- Handle formatting a bit more gracefully.
2020-08-30 13:35:25 +02:00
ad5d5d3f3b EEVEE: Fix broken rendering caused by SSR + Alpha blended material
This was affecting Mesa drivers as well as AMD pro driver. But it
might have been noticeable on other config too.

This was introduced by rBa9f2ebb21508.
2020-08-30 13:11:03 +02:00
d98c722a5a GPUFramebuffer: Tag dirty after recursing downsample
Also do not bind automatically. This is fine since the framebuffer will
update next time it's bound.
2020-08-30 13:11:03 +02:00
8527d84d35 GPUState: Move Scissor and Viewport state to framebuffer
This way it is way clearer what each viewport state is. There is
no more save and reset. The scissor test is also saved per
framebuffer.

The only rule to remember is that the viewport state (size and
origin) is reset for both the viewport and scissor when a texture
is attached or detached from an attachment slot.
2020-08-30 13:11:03 +02:00
4f395c84fe BLI_math_vector: Add equals_v4v4_int 2020-08-30 13:11:03 +02:00
0f372f3966 GPUContext: Update internal framebuffer size when activating context
This is to ensure the FrameBuffer extents are always up to date.
2020-08-30 13:11:03 +02:00
bb530a77b6 BLI_utildefines: Fix assignment in binary ops for ENUM_OPERATORS
That was an overlook from the review when we introduced it.
2020-08-30 13:11:02 +02:00
83f144b176 WM: Remove 10year old workaround for buggy drivers
This should have no consequence nowadays.
Can be reverted if needed.
2020-08-30 13:11:02 +02:00
832a975c2c GPUUniformBuf: Fix debug name being shorter than release name 2020-08-30 13:11:02 +02:00
f69c7a7ff9 Cleanup: GPUContext: Remove default_framebuffer_
This is now handled by FrameBuffer wrapping.
2020-08-30 13:11:02 +02:00
807817c0c4 GPUFrameBuffer: Use debug name support
This is to make it easier to navigate captures in renderdoc.
2020-08-30 13:11:02 +02:00
f3a65a1b4a GPUFrameBuffer: GL backend isolation
This is related to the Vulkan port T68990.

This is a full cleanup of the Framebuffer module and a separation
of OpenGL related functions.

There is some changes with how the default framebuffers are handled.
Now the default framebuffers are individually wrapped inside special
GLFrameBuffers. This make it easier to keep track of the currently bound
framebuffer state and have some specificity for operations on these
framebuffers.

Another change is dropping the optimisation of only configuring the
changed attachements during framebuffers update. This does not give
any benefits and add some complexity to the code. This might be brought
back if it has a performance impact on some systems.

This also adds support for naming framebuffers but it is currently not
used.
2020-08-30 13:11:02 +02:00
0850afb34e Cleanup: GPU: Remove unused init/exit functions 2020-08-30 13:11:02 +02:00
6e901fd8fc GPUFramebuffer: Make GPUFrameBuffer an opaque type
This is in preparation of the Framebuffer GL backend.

This is a just changing types and moving some code.
No logic is changed... almost... it just removes the context attach.
i.e: `gpu_context_add/remove_framebuffer()`
This is not needed for now and was even disabled in release.

This is part of T68990.
2020-08-30 13:11:02 +02:00
ed7dbaa5a7 GPUState: Fix missing writemask encapsulation
This was the last remaining.
2020-08-30 13:11:02 +02:00
b1b1be1754 Object: support multiple objects for limit-total vertex groups
Also add this to the "Clean Up" menu.
2020-08-30 18:53:24 +10:00
12bc34b0b8 Object: add ED_object_array_in_mode_or_selected
Use this utility function for render-shading & weight paint modes.

This adds support for edit-mode & pose-mode where all objects in the
mode are used in this case instead of the selected objects.
2020-08-30 18:53:19 +10:00
1a623c183f UI: add "Object -> Clean Up" menu
Useful to perform cleanup operations on many objects at once,
also these operations weren't accessible from the search menu.

This follows the convention for other clean up menus
when editing mesh, curve & grease-pencil.

Resolves issues raised in T80011
2020-08-30 13:48:35 +10:00
530ccde909 Object: support removing unused weights for selected objects
This is useful to run in object-mode, instead of from the property editor,
note that this still only used the current object when activated from
the property editor.
2020-08-30 13:48:35 +10:00
1a650fdcb2 Object: support removing unused material slots for selected objects
This is useful to run in object-mode, instead of from the property editor,
note that this still only used the current object when activated from
the property editor.
2020-08-30 13:48:30 +10:00
47908f0155 Operator: expose ED_operator_object_active_local_editable_ex
Support calling this function with an object argument,
useful for implementing filter functions that loop over objects.
2020-08-30 13:42:28 +10:00
2778937fb6 BKE_layer: add BKE_view_layer_array_selected_objects_params
Useful for similar situations as BKE_view_layer_array_from_bases_in_mode_params
without depending on the active objects mode.
2020-08-30 13:42:28 +10:00
e06050945e Cleanup: pass v3d as const to view layer utilities 2020-08-30 13:42:28 +10:00
3abbae2d7c UI: Use term "Plasticity" instead of "Plastic" 2020-08-29 23:30:53 -04:00
3789aa8506 New Boolean: performance improvement.
Avoided cost of searching for coplanar clusters in many cases.
2020-08-29 17:48:01 -04:00
d8585e184a New boolean: fixed a bug in coplanar intersect.
The code that found coplanar clusters was not updating a bounding box.
Also, code that was detecting non-trivial coplanar intersects was
slightly wrong, but that would not have caused any functional problems.
2020-08-29 11:31:47 -04:00
014276a11c Cleanup: spelling 2020-08-29 18:56:08 +10:00
bfa78aceed Cleanup: remove paranoid 'MDeformVert.totweight < 0' check
This was added in 1cb7267a9f, however the behavior before this
would have failed on negative values already.

Also negative values here would fail in many other places.
2020-08-29 10:48:33 +10:00
141a3e6d47 Boolean Modifier: Reorder properties
Properties that display conditionally depending on other properties
should generally be lower down so the movement of buttons as
settings are tweaked is less intrusive.
2020-08-28 16:41:13 -05:00
f34653e498 Clang Tidy: Fix readability-delete-null-pointer warning 2020-08-28 16:20:25 -05:00
5c5d43fd66 Clang Tidy: Fix no lint marker placement
There was a line between the NOLINTNEXTLINE marker and the function.
2020-08-28 16:12:47 -05:00
91bbf96c1d Revert "tmp"
This reverts commit b78a439e90.

This was committed by mistake, and including BLI_winstuff.h on non-windows
platforms results in an error.
2020-08-28 15:29:10 -05:00
pembem22
d8283a1f89 UI: Improve curve grid drawing code
This patch fixes assert on grid drawing. `for` loops are used instead
of `while` loops to make sure the number of lines is exact. The old
code draws lots of unnecessary lines offscreen. This bug is fixed as
well. See the patch for a comparison without a scissor test.

Differential Revision: https://developer.blender.org/D8745
2020-08-28 15:22:36 -05:00
744eb1172e Fix T80195: crash when invoking tooltips on MacOS
Problem introduced in rBadd48c007428.
`UI_but_string_info_get` can change the value of the args.
2020-08-28 17:09:19 -03:00
b78a439e90 tmp 2020-08-28 17:09:19 -03:00
8f5b9fb519 Fix for T75369: Text Editor Line Color
Use correct text color when syntax highlighting is off but line numbers are on.

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

Reviewed by Hans Goudey
2020-08-28 09:58:48 -07:00
c0eb6faa47 UI: Do Not Display Negative Zero Floats
Display negative zero floats as regular zero. Does not alter underlying value.

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

Reviewed by Brecht Van Lommel
2020-08-28 09:30:51 -07:00
285353c252 Cleanup: clang-format 2020-08-28 10:04:26 -06:00
79e82dbc05 cleanup: Fix style issue in sculpt.c
At first sight this code should not build at all
but due to the use of macro's that look like functions
this seemingly has no issues building.

Clang-format alerted me to this strange bit of code
by placing the `if` on it's own line for some reason.

added the missing brackets, and clang-format is happy
again.
2020-08-28 10:03:52 -06:00
7844486e47 Change cmake configs for full and release to enable WITH_GMP. 2020-08-28 11:49:10 -04:00
1cb7267a9f Cleanup: Fix build error with msvc
`ssize_t` is not a standardized type (it's a posix type)
given the line in question here is calculating the size
of a memory allocation there's no logical way this
should ever be negative.

I do not know this code too well and was unsure if
`mdverts->totweight` could ever be < 0, so I protected
it with a clamp, just in case.
2020-08-28 09:47:52 -06:00
4749bd2277 Fix to previous commit to allow building without WITH_GMP. 2020-08-28 11:43:56 -04:00
9e09b5c418 Merge newboolean branch into master.
This is for design task T67744, Boolean Redesign.
It adds a choice of solver to the Boolean modifier and the
Intersect (Boolean) and Intersect (Knife) tools.
The 'Fast' choice is the current Bmesh boolean.
The new 'Exact' choice is a more advanced algorithm that supports
overlapping geometry and uses more robust calculations, but is
slower than the Fast choice.
The default with this commit is set to 'Exact'. We can decide before
the 2.91 release whether or not this is the right choice, but this
choice now will get us more testing and feedback on the new code.
2020-08-28 11:01:06 -04:00
4a17508c6d Merge branch 'blender-v2.90-release' into master 2020-08-28 16:58:40 +02:00
62e2d92aed Blenloader: add api function for accessing packedfile address map
This is needed to move direct_link_packedfile out of readfile.c for T76372.
2020-08-28 16:57:34 +02:00
ddbf41d88d Fix T80104: Crash on making material local.
Problem is again with the embedded data, we want to make those local
together with their owner ID, but sometimes we are actually dealing with
copies here, which are inheritently already local.

Code did not considered that possibility before, leading to access to a
NULL `lib` pointer.

This should also be back-ported to 2.83 LTS release.

Maniphest Tasks: T80104

Differential Revision: https://developer.blender.org/D8731
2020-08-28 16:51:16 +02:00
5086bdfe0b Fix T80064: Adding mask curve points doesn't work around endpoints 2020-08-28 11:50:21 -03:00
368f8f7404 Blenloader: new api function to check if reading is for undo 2020-08-28 16:29:55 +02:00
7b2fe4c9ec Refactor: move Lattice .blend I/O to IDTypeInfo callbacks 2020-08-28 16:10:17 +02:00
8815996418 Refactor: move Mesh .blend I/O to IDTypeInfo callbacks
I'm also adding `BKE_id_blend_write`, so that it can be accessed
outside of `readfile.c`.
2020-08-28 15:49:14 +02:00
5db5ac611a GPU: Fix Segmentation Fault Freeing Failed Shader
The CPP Shader class does not initialize the interface attribute.
What will crash when deleting the shader.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8740
2020-08-28 15:45:07 +02:00
b8f990b0b4 Revert "GPU: Fix Segmentation Fault Freeing Failed Shader"
This reverts commit c284326809.
2020-08-28 15:43:14 +02:00
0ed7aedc71 Fix building without bullet support
The new BKE_rigidbody_is_affected_by_simulation function was in side the
WITH_BULLET ifdef guard.
2020-08-28 15:28:15 +02:00
b4a608c11c Merge branch 'blender-v2.90-release' into master 2020-08-28 15:09:42 +02:00
4fdd8452a6 DNA: add pragma once to dna_type_offsets.h
Sometimes, this generated file is included more than once,
so it should have an include guard.
2020-08-28 15:05:47 +02:00
8726354d46 Fix Rigidbody depsgraph passive and constraint transform relations.
We need to have transforms from passive objects if they are animated or
driven by parent relations. This is not immediately obvious as the
object transform matrix will still be available, it is just one frame
behind in some cases.

Fixed dependency cycles if there is a constraint between two rigid
bodies. Because bullet keeps track of its simulated bodies, we do not
need to supply objects transforms as bullet should already have them.

I need combine these two fixes because otherwise we will get depsgraph
warnings that nodes are missing that it expects to be there.

Reviewed By: Sergey, Jacques

Differential Revision: http://developer.blender.org/D8732
2020-08-28 14:55:59 +02:00
df8a63bb9c Fix T80078: Overrides: Crash with animated IK control on linked armature.
Issue was with our dear posebones again... when applying overrides we
keep the same address/pointer for the IDs themselves, (which avoids us
the need to remap their usages), but their inner data is often
re-allocated.

Therefore, we need once again to go over armature objects and invalidate
their posebone pointers.

This should also be back-ported to Blender LTS 2.83.

Maniphest Tasks: T80078

Differential Revision: https://developer.blender.org/D8734
2020-08-28 14:53:22 +02:00
Jeroen Bakker
0852ecd844 DrawEngine: Shader Test Suite
A test case that compiles all the GLSL shaders for workbench, gpencil, overlay and some
of eevee. Compilation is still platform dependent, but when run on a test-farm
with different hardware we will be able to detect GLSL compilation
errors early on.

The test will be compiled when `WITH_GTEST` and `WITH_OPENGL_DRAW_TESTS`
are On.

For eevee only the shaders inside eevee_shaders.c are included. EEVEE has some shaders
located inside the submodule. They aren't accessible to the outside and aren't added
to the test case. We should see how we want to add them. For the test cases it is better
to move them to eevee_shaders.c, but for eevee perspective it is better to keep them in
the submodule. Keeping them in the submodule could lead to situations that is harder to test.
as the shader could already have been initialized.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8667
2020-08-28 14:47:27 +02:00
Jeroen Bakker
2654e9c9c1 Fix T80141: Fix Compiling Workbench Volume Shaders (Mesa 20.0.8)
Default mesa driver for ubuntu 20.04 fails when a name is defined twice.
M_PI is defined in both `common_workbench_lib` and `common_math_lib`. This patch
remove the define out of common_workbench_lib

For reference it fails on https://github.com/mesa3d/mesa/blob/mesa-20.0.8/src/compiler/glsl/glcpp/glcpp-parse.y#L1186
during the check if the macros are the same.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8741
2020-08-28 14:41:41 +02:00
Jeroen Bakker
922aac999d Fix T79920: Fix Compiling EEVEE Volume Shaders
There were some missing UBO bindings, what asserted in debug mode.
This patch fixes this by binding the missing UBO's

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8742
2020-08-28 14:40:06 +02:00
Jeroen Bakker
3198fec1fe Fix T80160: Workbench shadows are broken
In recent refactoring {a9f2ebb21508} an issue was introduced that the
opengl rasterizer would be disabled when only writing to a stencil
buffer.

This fix adds stencil writing to the write mask and set it. This makes
the write map not evaluate to GPU_WRITE_NONE and the rasterizer will be
enabled in `GLStateManager::set_write_mask`.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8743
2020-08-28 14:38:33 +02:00
df8e2c76c9 Merge branch 'blender-v2.90-release' 2020-08-28 14:35:04 +02:00
Jeroen Bakker
c284326809 GPU: Fix Segmentation Fault Freeing Failed Shader
The CPP Shader class does not initialize the interface attribute.
What will crash when deleting the shader.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8740
2020-08-28 14:32:29 +02:00
a48d78ce07 Refactor: move CustomData .blend I/O to blenkernel
This is part of T76372.
2020-08-28 14:30:45 +02:00
3dc222ea7b Refactor: move defvert .blend IO to blenkernel
This is part of T76372.
2020-08-28 14:30:45 +02:00
65dcf812a5 Fix T80182: Curve [Edit Mode] : Can't Deselect Control Point with Select Box
Caused by rB49f59092e7c8: Curves: Implement Handles for selected points
only

Changes from deselecting all were not considered as changes anymore.

Maniphest Tasks: T80182

Differential Revision: https://developer.blender.org/D8744
2020-08-28 14:28:57 +02:00
2bb60db94a Merge branch 'blender-v2.90-release' 2020-08-28 14:00:51 +02:00
0e021414fe Cleanup: improve function names
With this change, the three .blend read operations: data reading, lib reading
and expanding are more grouped together.
2020-08-28 13:18:24 +02:00
a443287908 IDTypeInfo: add .blend file io callbacks
This is part of T76372.
It adds the `blend_write`, `blend_read_data`, `blend_read_lib`
and `blend_read_expand` which correspond to the various
steps when reading and writing .blend files.
Having these callbacks allows us to decentralize the blenloader
code a lot more. This has the affect that code related to any
specific ID type is less scattered.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D8670
2020-08-28 13:05:48 +02:00
d3f2037966 Fix T80149: Cycles OpenCL baking broken after changes to uses tiles for baking
We forgot to update this code as part of D3108. I'd like to include this in 2.90,
it's entirely broken now so can't really get any worse.

Differential Revision: https://developer.blender.org/D8738
2020-08-28 12:53:50 +02:00
346023b457 Cleanup 'make vertex parent' operator code.
More localized variables, avoid ugly 'offset by one' index usage in
favor of explicit `INDEX_UNSET` define, etc.

No behavior change expected from this commit.
2020-08-28 11:08:03 +02:00
94d6b54826 Merge branch 'blender-v2.90-release' into master 2020-08-28 14:37:05 +10:00
1725e46cee Fix T80135: Duplicate doesn't preserve active spline
Checks to preserve the active spline on duplication
required an active vertex too.

Now having no active vertex doesn't prevent duplicate
from keeping the spline active.

Reviewed by: @mano-wii

Ref D8729
2020-08-28 14:35:30 +10:00
bc2830a3ce Cleanup: use doxy sections in interface_panels.c 2020-08-28 14:25:23 +10:00
84ae44138d Cleanup: spelling 2020-08-28 14:25:19 +10:00
5ee60c9815 Fix (unreported): Walk expansion on scene collection
Left walk navigation while the scene collection is active would collapse
the subtree which shouldn't be allowed. This adds another check to
`outliner_item_openclose` to prevent collapsing the scene collection.

Introduced in rBb077de086e14.
2020-08-27 18:49:47 -06:00
e726ed3c6b Fix: Outliner walk navigation in Data API mode
Because the subtrees in Data API mode are empty for performance reasons,
it was impossible to move through the tree with walk navigation. This
adds an exception to allow walk navigation to expand subtrees in that
mode.
2020-08-27 18:25:51 -06:00
2a0e996d77 Fix T80159: Custom Normals Averaging crash after clearing
custom split normals data

Clearing custom split normals would get rid of the CD_CUSTOMLOOPNORMAL
layer - but editing data `lnor_spacearr` would be kept.

Adding a CD_CUSTOMLOOPNORMAL layer (if none exists yet) should be done
in `edbm_average_normals_exec` / `BKE_editmesh_lnorspace_update` /
`BM_lnorspace_update` / `BM_lnorspacearr_store`. The thing is that if
the editing data `lnor_spacearr` would still be valid after `Clear
Custom Split Normals Data`, blender would happily call
`BM_lnorspace_rebuild` instead. Doing that without a CD_CUSTOMLOOPNORMAL
layer is asking for trouble.

Now clear lnor_spacearr on `Clear Custom Split Normals Data` as well.

Thx @mont29 for feedback here.

Maniphest Tasks: T80159

Differential Revision: https://developer.blender.org/D8730
2020-08-27 22:12:12 +02:00
770cc66f75 UI: Avoid redundant loops in region panel handler
Currently the panel handler loops through every block and every button
for every single panel. This commit moves that check to happen a single
time at the beginning.
2020-08-27 14:36:01 -05:00
a8766de5d5 Fix T68317: Panel "A" key doesn't collapse subpanels properly
We need to only collapse or expand the first panel under the cursor
rather than all of them. Note that whether the parent panel or
the subpanel is first depends on the order of the uiBlocks in the
region's list.
2020-08-27 14:22:28 -05:00
714dbf273c Clang Tidy: Fix warning
Fix readability-static-definition-in-anonymous-namespace in new code
2020-08-27 14:18:06 -05:00
f1565e7f73 UI: Cleanup / refactor region panel event handling
The code for handling panel events was much more complicated than it
needed to be. This commit removes some unecessary function calls and
variables, reduces indentation levels by returning early, and does
some other general cleanup.
2020-08-27 14:02:14 -05:00
0649ed7fa2 GPencil: Don't convert color to sRGB
The color is linear, so the conversion is breaking the real color.
2020-08-27 20:13:51 +02:00
e74a24f0bb Fix T77382: zooming into adjust last operation panel clips contents
This panel should not have zoom functionality at all, just like headers and
many other regions don't have it either.
2020-08-27 19:52:56 +02:00
9d6789115a Cleanup: Move panel category drawing to proper section
Somehow the panel category drawing functions ended up in the middle
of the region event handling code. This commit moves them to their
own section next to the rest of the drawing code.
2020-08-27 12:33:27 -05:00
eed8ea1b73 Cleanup: Fix white space in versions.cmake 2020-08-27 11:03:31 -06:00
9b0ef34534 Fix Outliner allowing to enter Pose Mode on linked armature
If a different object was active, clicking on a linked armature's pose
in the Outliner would enter Pose Mode for it.
This would actually cause a failed assert, but in release builds the
armature would just enter pose mode.

Steps to reproduce were:
* Link in armature object
* Activate a different object
* In the Outliner, un-collapse the armature object
* Activate Pose Mode by clicking on its pose there
2020-08-27 16:40:56 +02:00
8a984ddd0f Cleanup: Fix build warning on windows
MSBuild on windows currently spews a warning about
buildinfo.h_fake not being generated.

For build info we use a non existing file to trigger a
custom_command on every build, which has worked well for
years now, however in recent versions of MSBuild it has
started issuing warnings about files that should be
generated but are not.

CMake is actually aware of this being a problem and states
in the documentation that "If the output of the custom command
is not actually created as a file on disk it should be marked
with the SYMBOLIC source file property."

This change fixes the build warning by properly marking the
buildinfo.h_fake as symbolic resolving the warning.
2020-08-27 08:10:37 -06:00
e51c721315 Fix crash of alembic tests after recent depsgraph builder change
Need to make sure node factories are initialized prior to the dependency
graph allocation.

The regression was initially introduced in 5b021dff41

Thanks Brecht for testing!
2020-08-27 14:52:58 +02:00
1131328aeb Fix: Mantaflow always builds openvdb statically
This would lead to problems when we build a dynamic openvdb library.
2020-08-27 14:49:34 +02:00
91aeb452ab Fix: FindEmbree.cmake looking for non existing dynamic libraries and failing
It is now possible to build against a shared embree library.
Before it was only possible to build against static Embree libraries.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D8702
2020-08-27 11:55:40 +02:00
54b47da565 Cleanup: clang-format 2020-08-27 15:33:33 +10:00
8b82693898 MSVC: Set proper flags for C++17 support.
MSVC already builds with the /std:c++17 flag but for
'reasons' [1] MSVC still gives the wrong value for the
__cplusplus define.

This change sets an additional cxx flag on supported
compilers to allow the compiler properly identify
C++17 support.

This resolves 2 warnings coming out of bullet about
the register keyword being deprecated.

[1] https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
2020-08-26 22:25:40 -06:00
bbf00a6231 Cleanup: Fix build warning with MSVC and OSL
OSL requires RTTI to be off, this is done with the /GR- flag for
MSVC, however /GR is in the default CXX flags leading to warning

D9025 : overriding '/GR' with '/GR-'

which cannot be suppressed.

/GR is on by default and this flag is not required, so removing
it from the default CXX flags makes it possible later use /GR-
without generating warnings.
2020-08-26 22:20:34 -06:00
7f3febf4c0 Fix (unreported): Outliner Data API tree subtree expansion
The changes in rB70151e41dc02 broke subtree expansion in the Data API
display mode because the closed subtrees are empty lists. Move the empty
subtree check from `outliner_item_openclose` to the walk navigation
code to prevent the issue.
2020-08-26 21:29:45 -06:00
489b5790cf Cleanup: Fix build warning with MSVC
`IDTypeForeachCacheFunctionCallback` lists the `flags` parameter
as `uint`, having these functions use `eIDTypeInfoCacheCallbackFlags`
results in the following warning when building with MSVC:

warning C4028: formal parameter 4 different from declaration

This change resolves this warning by changing the parameter to
the appropriate type.
2020-08-26 19:14:17 -06:00
6438fc4f79 Cleanup: Fix MSVC warning in mantaflow
This resolves the following MSVC warning:

warning C4805: '&=': unsafe mix of type 'int' and type 'bool' in operation
2020-08-26 19:07:24 -06:00
Red Mser
479ce00809 UI: Use alternating row theme color in file browser
The outliner already uses the alternating row theme color as an
overlay for every other row. This uses the same color for the file
browser, instead of a hardcoded shading.

The file browser background color is slightly tweaked to match the
outliner, and the Blender Light theme is updated to use a lighter
background color like the outliner.

Reviewed by: Hans Goudey, Julian Eisel

Differential Revision: https://developer.blender.org/D8717
2020-08-26 16:53:58 -05:00
8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
d8cf6ee316 install_deps: add fontconfig to installed libs/tools. 2020-08-26 20:44:53 +02:00
f807b27b67 Cleanup: Fix const warning with BLI_array_free
when you call the BLI_array_free macro with a const pointer you get a
warning when the macro calls `MEM_freeN` (warning C4090: 'function':
different 'const' qualifiers)

This was warning originating from
`smart_uv_project_calculate_project_normals` in `uvedit_unwrap_ops.c`

Normally we resolve these with a non const cast at the callsite
but given BLI_array_free is a macro not a function this is not
an option here and it has to be resolved in the macro.
2020-08-26 11:42:40 -06:00
0498feb0df Fix T80129: Cycles shadow catcher viewport error with exposure other than 1 2020-08-26 19:26:38 +02:00
bd678918ae Fix T80080: improve tooltip for render number of threads
Since the switch to TBB, the threads value specificies the maximum number of
CPU cores used while rendering, it is not longer possible to use more threads
than cores. Change the tooltip to make this more clear.
2020-08-26 19:26:38 +02:00
f699ba3d30 Cleanup: better naming and no bad level access in BLI_winstuff 2020-08-26 19:26:38 +02:00
9de18c361b Outliner: Use shift for restrict button child toggle
The `ctrl` key was mapped to recursive bone selectable and visibility
toggling. This changes the key to `shift` to be consistent with objects
and collections. Also adds an explanation to the tooltip.

Part of T77408

Differential Revision: https://developer.blender.org/D8650
2020-08-26 11:19:19 -06:00
70151e41dc Outliner: Left and right walk navigation
Previously the left and right arrow keys would close and open the active
tree element, but a subsequent key press would not select up or
down the tree as is common in tree-based interfaces.

Walking left and right now does a selection action after opening or closing
the active tree item. For example, a right key press on a closed element
will open it's subtree, and an additional right key press will select
the first child element.

A left key press anywhere in a subtree will first close the active
element if it's subtree is expanded. Walking left again will select the
parent element.

Part of T77408

Differential Revision: https://developer.blender.org/D8650
2020-08-26 10:58:23 -06:00
b028a43245 Cleanup:Remove C++14 flags from extern/quadriflow
The main CMakeLists.txt specifies C++17, quadriflow tries to add C++14
flags leading to the following warnings when building with MSVC

Command line warning D9025 : overriding '/std:c++17' with '/std:c++14`

This change removes the C++14 flags, and fixes a build error caused
by the removal of `std::unary_function` in C++17 in the .obj loader
(which isn't used by blender)

Reviewed By: zeddb

Differential Revision: https://developer.blender.org/D8720
2020-08-26 10:04:24 -06:00
3185e17844 Logging: change error to warning
This is in preparation for https://developer.blender.org/D8665.
2020-08-26 17:48:20 +02:00
14608c5e86 Cleanup: Fix MSVC warning regarding flags in bullet
For bullet we compile at /W0 for MSVC but we did not
remove the standard /W3 flag. Leading to the following
warning:

Command line warning D9025 : overriding '/W3' with '/W0'

This change removes the W3 flag for bullet to get rid
of the warning.
2020-08-26 09:16:21 -06:00
Yevgeny Makarov
2ef5fabec9 Fix T77900: File Browser in macOS fullscreen crashes
When Blender is started in fullscreen mode from the command line,
or if the fullscreen state is saved in the startup file, all temporary windows
will also open in fullscreen mode. When closing the fullscreen File Browser,
Blender would either crash or parent window becomes black.

This does not happen if the Blender switches to full screen manually.

`NSWindowCollectionBehaviorFullScreenPrimary` should be set for windows that
can enter full-screen mode. Otherwise macOS will turn the wrong window into
full-screen.

Similar fix: rB4b39de677d20

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

Reviewed by: Julian Eisel
2020-08-26 16:27:05 +02:00
239b0ba750 Clenaup: Refactor Sculpt gesture mask operators
This refactors Box Mask and Lasso mask making both functions share the
same code. After this change it should be easier to add new
functionality, new gesture tools or implement new gesture modes.

No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8707
2020-08-26 15:44:54 +02:00
08ec9b71df Merge branch 'blender-v2.90-release' into master 2020-08-26 23:28:44 +10:00
e0772c6607 Fix T80098: Mesh deform doesn't update in edit mode
Use BKE_mesh_wrapper API access to access mesh coordinates
for modifier evaluation.

Call BKE_mesh_wrapper_ensure_mdata when binding
since it's a one off operation.

Regression from deaff945d0.

Reviewed by: @brecht

Ref D8709
2020-08-26 23:20:37 +10:00
826bd46e66 GPencil: Hide Boundary strokes in Render
This change hides the boundary strokes used for closing filled areas in render mode (viewport and final render).

Related to T80128
2020-08-26 15:05:54 +02:00
d4f7c7f4cc GPencil: Fix Assert using fill tool
With the new changes in the Draw Manager, GPU_depth_mask must be set to ON, before clear depth.
2020-08-26 13:32:57 +02:00
a7e1963b63 Cleanup: remove G.debug_value check for old mesh-deform behavior
Added in 2007, it doesn't seem useful to support alternate behavior.
2020-08-26 21:04:00 +10:00
7773663eb7 Cleanup: remove unused UvVertMap.flag 2020-08-26 21:01:28 +10:00
70d48255ae Fix T79992: Error calling context.copy() in Properties Editor
This was an oversight in rB83e3d25bcae3.

Basically we still have the "hair" and "point_cloud" entries for the
context. However they were ifdef'ed.

Note this would mostly happen in 2.90 since we always build without hair
and particles there.

Differential Revision: https://developer.blender.org/D8712
2020-08-26 11:34:12 +02:00
e414afbaf6 Cleanup: typos 2020-08-26 11:24:10 +02:00
c44251c7d7 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-26 11:18:41 +02:00
Evan Wilson
8ddf8cfa6f Fix #ifdef WITH_PARTICLE_NODES and WITH_HAIR_NODES mixup in rna_internal.h
Differential Revision: https://developer.blender.org/D8711
2020-08-26 11:16:48 +02:00
0e50b6529c BLI: support removing multiple elements from a vector 2020-08-26 10:52:43 +02:00
6a10e69d27 UV: match 3D mesh editing behavior for edge-loop select
- Cycling between part of the boundary & the entire UV boundary.
- Include pole vertices in the selection.

Edge loop selection was rewritten to use BMesh connectivity data.
2020-08-26 18:39:25 +10:00
8f545375f9 Cleanup: simplify edge loop/boundary select cycling logic 2020-08-26 16:56:24 +10:00
7fb11f22a2 Docs: comments for interface_handlers.c
Explain why some features have defines,
also use doxy sections for defines & prototypes.
2020-08-26 10:31:50 +10:00
add48c0074 Cleanup: use const variables in interface code 2020-08-26 10:31:44 +10:00
88ada5e218 Cleanup: add SEQ_ALL_BEGIN, SEQ_CURRENT_BEGIN to .clang-format
These were missed in 70500121b4 which caused reformatting.
2020-08-26 09:59:15 +10:00
be4abb42c1 Cleanup: spelling 2020-08-26 09:41:30 +10:00
bbb6ec9e51 Cleanup: build without USE_KEYNAV_LIMIT defined 2020-08-26 09:41:09 +10:00
396d39c6b9 Cleanup: Declare variables where they are initialized
Further changes to interface_handlers.c to avoid a block of variable
declarations at the beginning of functions. Also use const in some
situations. I only made changes where the variable's intended scope
was obvious.
2020-08-25 14:28:04 -05:00
Valentin
6e06936c0e Cleanup in interface_handlers.c
- Reduce variables scope
 - Use some const prefixes
 - Initialize variables at declaration
 - Use comparison to boolean false instead of 0

Differential Revision: https://developer.blender.org/D8678
2020-08-25 13:15:57 -05:00
72bcb900d0 install_deps: also clear BLOSC cmake variables.
Otherwise when switching from self-built to distro packages for OpenVDB,
Blosc CMake cached variables break building...
2020-08-25 19:54:22 +02:00
999667a8c5 Fix T79494 Refrence Image reflects object after source got deleted
Silly typo was causing the error texture to not be bound.
2020-08-25 19:25:39 +02:00
97f75ca87f GPUState: Move state limits getter to the area they belong
This fix a GL_INVALID_VALUE error on startup due to 0.0f max line width.

Also moves the max anisotropy filter to the sampler creation.

This reduces code fragmentation.
2020-08-25 18:18:55 +02:00
2c34e09b08 Outliner: Include gpencil modifiers and effects in the tree
Grease pencil modifiers already had defined outliner icons, but had
never been included in the tree. This adds the modifiers and the shader
effects to the tree.

Part of T68498
2020-08-25 10:04:15 -06:00
21cb6f09ff Fix T77298: Cycles multiple object making not working with multiple samples
The previous fix loaded the pixels so existing tiles were not overwritten.
However the Cycles render buffer is expected to be scaled by the number of
sample, which was not taken into account.

This is not ideal in that previews could have a mismatched number of samples
between multiple objects, though the result will be correct. The better solution
would be to bake all objects together per tile, rather than one after the other.
But that is a bigger change than we can do in 2.90.

Differential Revision: https://developer.blender.org/D8704
2020-08-25 18:00:35 +02:00
949d92ad5d Fix T79811 MacOS: Edit Mode - vertex/edge/face selection is missing
The VAO reconfiguration from the offset workaround was not working.
2020-08-25 17:42:07 +02:00
b2b4f9fc9b Fix buildbot failing due to non-existent git submodule hash
The wrong hash was committed in 95cc709612, presumably due to local changes
to the submodule repository.
2020-08-25 16:13:58 +02:00
c336947dbb Merge branch 'blender-v2.90-release' into master 2020-08-25 23:56:34 +10:00
33ac3582bb Fix T77359: Crash adding UV's in edit-mode with linked duplicates
This prevents UV layer mix up in
MeshBatchCache.cd_used/cd_needed/cd_used_over_time which depends on the
extraction method.

One object's mesh can be accessed with MR_EXTRACT_MESH, another object
that uses the same mesh can use MR_EXTRACT_BMESH based on
(Object.mode & OB_MODE_EDIT), this causes a problem as the edit-mesh
and the mesh aren't always in sync, the custom data layers wont
necessarily match up, causing T77359.

Reviewed by @jbakker, @brecht

Ref D8645
2020-08-25 23:54:26 +10:00
9dd4d87f18 GPU: Fix compilation issue caused by rBb43f4fda19b9 2020-08-25 15:16:06 +02:00
b43f4fda19 GL: Add error checking function
This is to ease the debugging process on Apple GL implementation.
2020-08-25 15:02:34 +02:00
e51c428be6 GPUSelect: Avoid assert caused by clearing without a depth mask
This should not cause any problem since the depth test is required
in order to draw to the depth buffer and this is not altered by
this change.

To be on the safe side, we still restor the mask after altering it.
2020-08-25 15:02:34 +02:00
5f86a10477 Fix T80012: Bevel Shader node Samples value has too low hardcoded limit
Up the hard limit, keep the UI range max at 16

Maniphest Tasks: T80012

Differential Revision: https://developer.blender.org/D8701
2020-08-25 12:34:10 +02:00
8657c6cb71 Merge branch 'blender-v2.90-release' 2020-08-25 12:17:49 +02:00
Red Mser
3ea324488a Fix T80016: Shape key animation is linked when duplicating object
Fix T80016

Caused by a typo in rB7b1c406b5431ce65d84ddb5f2c53977c25c18373

Reviewed By: mont29, dfelinto

Maniphest Tasks: T80016

Differential Revision: https://developer.blender.org/D8693
2020-08-25 12:11:59 +02:00
ac8825621f Merge branch 'blender-v2.90-release' 2020-08-25 11:56:27 +02:00
263cf2ea94 Enabled workaround to solve threading issues in draw manager
This workaround addresses T79533 and T79038 for Blender 2.90. The
solution isn't clear and needs more research and work. In order to
continue with blender 2.90 release it was proposed to add this work
around.

It has been tested with the test files provided in the reports.

Reviewed By: Dalai Felinto, Clément Foucault

Differential Revision: https://developer.blender.org/D8695
2020-08-25 11:48:48 +02:00
024a9d17d2 Revert "Enabled workaround to solve threading issues in draw manager"
This reverts commit 141a8ff6b3.
2020-08-25 11:29:20 +02:00
8bb93ca80a Fix T79915: crash when changing to white noise texture
Reviewers: brecht, OmarSquircleArt

Differential Revision: https://developer.blender.org/D8697
2020-08-25 11:23:35 +02:00
Jeroen Bakker
141a8ff6b3 Enabled workaround to solve threading issues in draw manager
This workaround addresses T79533 and T79038 for Blender 2.90. The
solution isn't clear and needs more research and work. In order to
continue with blender 2.90 release it was proposed to add this work
around.

It has been tested with the test files provided in the reports.

Reviewed By: Dalai Felinto, Clément Foucault

Differential Revision: https://developer.blender.org/D8695
2020-08-25 08:18:25 +02:00
189ba40e9b Cleanup: use doxy sections 2020-08-25 15:10:36 +10:00
5eb7aa5ebb Fix T80077: Objects disappear when joining with a zero scaled axis
Use invert_m4_m4_safe_ortho when joining objects so zero scaled axis
doesn't cause all points to be scaled to zero.

Instead geometry is left un-scaled on degenerate axes.

Report a warning in this case since users may want to adjust the
active objects scale.
2020-08-25 14:32:10 +10:00
96401e2ef8 BLI_math_matrix: add invert_m4_m4_safe_ortho (m3 version too)
Unlike invert_m4_m4_safe, this calculates zeroed axes.
Useful when we need to use the inverse of an objects matrix,
keeping the valid axis, only filling in the zeroed ones.
2020-08-25 12:57:56 +10:00
46eca3366e Sculpt: Cloth Snake Hook Brush
This implements Snake Hook as a deform type for the cloth brush. This
brush changes the strength of the deformation constraints per brush step
to avoid affecting the results of the simulation as much as possible. It
allows to grab the cloth without producing any artifacts in the surface
and create more natural looking folds than any of the other deformation
modes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8621
2020-08-24 23:28:01 +02:00
5a634735e6 Fix T80008: Smooth brush not deforming mesh boundaries correctly
In 2.83 and previous versions there was a bug that was causing boundary
vertices to be detected incorrectly that was preventing the smooth brush
to work on boundaries if there was a pole on them.
In 2.90 the boundary vertex detection was fixed, but it was still using a
simplified version of the algorithm without any boundary smoothing. This
patch implements a similar smoothing algorithm to what I think it was
the intention of 2.83 and previous versions, but working correctly.

Reviewed By: sergey

Maniphest Tasks: T80008

Differential Revision: https://developer.blender.org/D8680
2020-08-24 23:09:10 +02:00
ed4c83f61f T79811 MacOS: Edit Mode - vertex/edge/face selection is missing
This is quite embarassing... it was returning the base instance instead of
the correct vao. No wonder that it was causing crash and at most drawing
issues.
2020-08-24 19:25:43 +02:00
f5ca34d0b4 BLI: simplify lookup methods in Map
No functional changes expected.
2020-08-24 19:02:41 +02:00
975fc39457 Merge branch 'blender-v2.90-release' 2020-08-24 18:28:58 +02:00
1bced5884c Fix T80039: Do not subdivide with Multires is mesh has no faces
This skips the subdivision operation if the mesh has no loops, avoiding
the crash.

Reviewed By: sergey

Maniphest Tasks: T80039

Differential Revision: https://developer.blender.org/D8696
2020-08-24 18:27:49 +02:00
dc74d60915 Fix T79819: crash with OSL trace() and getmessage() after Embree changes
The return value of scene_intersect must be checked, the isect struct members
can't be assumed to be initialized if that returns false.

Differential Revision: https://developer.blender.org/D8692
2020-08-24 17:54:25 +02:00
8e18a99845 BLI: improve exception safety of Set and Map
For more information see rB2aff45146f1464ba8899368ad004522cb6a1a98c.
2020-08-24 17:24:13 +02:00
5303509354 Fix T80076: Cycles Alembic Motion Blur Problem
The problem occurs when a deforming modifier is added to the object
after the MeshSequenceCache modifier. We should only consider the cached
velocities if the MeshSequenceCache modifier is the last one on the
object and we also need to check for the correct vertex count before
adding the motion vertex attribute.
2020-08-24 16:56:23 +02:00
734abaa252 Cycles: cleanup, remove unused parameter
This parameter was introduced during a revision of the Alembic motion
blur patch, and is not needed anymore.
2020-08-24 16:56:23 +02:00
950d857505 Merge branch 'blender-v2.90-release' 2020-08-24 10:40:12 -04:00
9498eb2692 API Docs: Update Changelog from 2.83 2020-08-24 10:38:17 -04:00
39a09b536e Workbench: Fix assert with sculpt in textured color mode 2020-08-24 16:26:29 +02:00
5b021dff41 Fix T80035: Fix crash switching/adding scenes
Ensure that time source always is in the dependency graph, allowing to
tag the graph for time update prior it was fully built.

Collaboration of Philipp Oeser, Jacques Lucke and myself.
Thanks everyone :)
2020-08-24 15:55:07 +02:00
ee2e2f14ac numaapi: Sync with upstream
Fixes potential build error in some build configurations
2020-08-24 07:45:39 -06:00
Jeroen Bakker
95cc709612 Theme: Remove TH_UV_OTHERS from bTheme
`TH_UV_OTHERS` is a theme option that isn't hooked to anything since
blender 2.80. This patch will remove the option and related code.

Reviewed By: Campbell Barton

Differential Revision: https://developer.blender.org/D8669
2020-08-24 15:19:49 +02:00
1cac6fe542 Fix selected UV vertex drawing ignoring size 2020-08-24 22:51:31 +10:00
be920fe786 UVEdit: Fix assert caused by depth mask not being set before clear
This happened when using the shading panel when a uv editor opened.
2020-08-24 14:14:17 +02:00
7ce764c9ec Fix T79896 Awful performance with Dyntopo on
Regression caused by rB9443da6166f5. Forgot to clear the flag.
2020-08-24 13:52:01 +02:00
cb8da6efce GPUState: Fix scissor state being overwritten when changing scissor bounds
Fix T79899 viewport artifacts when sculpting
2020-08-24 12:28:54 +02:00
4883cc5728 BLI: add Array.last method
This makes it consistent with Vector and Span.
2020-08-24 11:51:41 +02:00
Imre Palik
afbc727da2 Cycles: Fix missing dependencies in libcycles_device
The code uses OpenGL functionality, so is to be linked against
OpenGL libraries.

This makes it easier to integrate with cycles using CMake.

Differential Revision: https://developer.blender.org/D8371
2020-08-24 11:45:47 +02:00
6b1b2ded77 Merge branch 'blender-v2.90-release' into master
# Conflicts:
#	source/blender/editors/space_node/node_draw.c
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-24 11:31:06 +02:00
35ef42d967 Fix T79970 EEVEE: Camera Animation Breaks Motion Blur (Two Steps or More)
This was caused by motion blur camera movement tagging the view as
invalid and thus resetting the temporal sampling.

Critical fix for 2.90. Need second look, but quite confident. This function
is only called once when Motion blur is off.

Reviewed by: jbakker

Differential Revision: https://developer.blender.org/D8676
2020-08-24 11:24:33 +02:00
40edb84dcf Revert "Fix T77564: VSE (and compositor background) lost stereoscopy preview"
This reverts commit d5b5b228e4.
This reverts commit 47c6f41b89.
2020-08-24 11:17:52 +02:00
e4932d1167 Fix T80034 Crash using material panel on 2.91.0 alpha
This was caused by a NULL name.
2020-08-23 14:48:44 +02:00
e74ba9e09e Fix T79872: VSE - splitting strip shows the channel number when unused
This operator is dependent on mouse position (if the Use Cursor Position
option is used). The Channel property is irrelevant/unused in this case.
So it is not optimal displaying this property when calling this from the
menu (or even using the shortcut with default settings).

Now use a custom UI in the Adjust Last Operation panel in this case.
The properties are now drawn in relation to another then (Channel
underneath Use Cursor Position) next to some other minor layout
improvements.

Thx @HooglyBoogly for feedback (also providing UI code)

Maniphest Tasks: T79872

Differential Revision: https://developer.blender.org/D8625
2020-08-23 13:17:49 +02:00
833bc70399 Fix T79874: VSE - error clearing fades without animation data
Maniphest Tasks: T79874

Differential Revision: https://developer.blender.org/D8624
2020-08-23 13:09:57 +02:00
f18e537451 Cleanup: GPU: Use explicit clear value in GPU_clear* commands
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`.
Since we always set the clear value before clearing, it is unecessary
to track the clear color state.
Moreover, it makes it clearer what we clear the framebuffer to.
2020-08-23 12:04:24 +02:00
846cac94db GPUFramebuffer: Use GPUState to temporary change write mask in clear fn
This avoid breaking sync of the state object. Also avoid more hazard.
2020-08-23 12:04:24 +02:00
72e78df464 GPUState: Expose Stencil mask and test
This is to be used by framebuffer clearing.
2020-08-23 12:04:24 +02:00
ed288a5786 Fix T79989: File browser Return doesn't open a directory
Regression in e4a50e3f47.
2020-08-23 16:32:33 +10:00
8f8ed8f567 Fix T80028: Crash opening a file from a timer 2020-08-23 13:44:18 +10:00
2cf930adf3 Cleanup: remove unused UvNearestHit struct members 2020-08-23 12:13:48 +10:00
010c1370af CMake: Fix policy warning about OSL_ROOT being set.
When the OSL_ROOT variable is set this is ignored
by findpackage on cmake < 3.12. CMake 3.12 and up
also  ignore it and warn about it. This change
tells cmake it is OK to use the variable and
stop warning
2020-08-22 16:24:09 -06:00
8f48a32f9f UI: In-line layout for camera passepartout
No need for a sub-panel when there is just one setting.
2020-08-22 21:53:16 +02:00
1885bf77b6 Fix T80013: Crash when toggling maximized area
Error renaming variable in 75aeb4b881
2020-08-22 11:30:51 -04:00
e26301f4d1 Fix T79971 Regression: Transform Gizmos doesnt work anymore
This changes the state of occlusion queries quite a bit. Now scissors is
explicitely disabled and we enabled color write.

I still don't understand why we now need this. This patch is just trial and
error on an affected setup. Note that on the same computer, renderdoc
was not able to capture the regression (the regression did not manifest
during capture).

Regression likely introduced by rB5f414234ddea
2020-08-22 01:42:15 +02:00
a204324966 DRW: Fix state not being locked
Regression introduced by rBe12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
2020-08-22 01:42:15 +02:00
a1f54be042 Cleanup: Remove unused variables 2020-08-21 15:33:40 -04:00
53d1f89322 Fix T79987: Crash when joining objects
Mistake in b077de086e. I did the same fix for a few operators there,
but missed the object "Join" one.

The joining operator changes the layer content. So it must send a
notifier for that.
Before b077de086e that didn't cause a noticeable issue, because the
Outliner happened to listen to other notifiers (active/selection
changes) the operator sent and fully rebuilt its tree in response. Now
missing these notifiers can be more problematic, since we try to avoid
more rebuilds.

Added comments to the notifier types to avoid at least this pitfall.
2020-08-21 19:46:15 +02:00
70500121b4 Cleanup: rename iterators over sequences to be more clear about what they do.
No functional changes expected.
2020-08-21 18:55:27 +02:00
74ded456b3 Merge branch 'blender-v2.90-release' into master 2020-08-21 17:43:59 +02:00
ebf10b72b0 Fix critical bug in foreach ID looper of Scene data-block.
Since stone age of lib_query, the code would iterate over the current
list of active sequences (from a meta strip e.g.), and not over the
whole list of those.

This is a critical issue as it means in some cases (editing a meta strip
typically), some ID pointers would be missed/ignored by this foreach
looper, which is now at the center of most of our ID management code.

This caused a bug here at the studio, leading to loss of all sound IDs
used by sound strips when editing and undoing inside a meta strip, since
ID refcounting would not happen properly on strips using sounds outside
the meta-strip context during file reading of the undo steps.

To be backported to 2.83.

Differential Revision: https://developer.blender.org/D8671
2020-08-21 17:35:18 +02:00
661ba642f2 Cleanup: spelling 2020-08-22 00:10:52 +10:00
eed43a89dd Cleanup: use doxy sections for fcurve.c 2020-08-22 00:10:52 +10:00
c00707c18d Cleanup: remove f-string use 2020-08-22 00:10:52 +10:00
995725c681 Cleanup: remove duplicated code from previously unnoticed merge conflict
`BKE_animdata_blend_expand` is called in `expand_id` already.
2020-08-21 16:01:30 +02:00
0de48f8550 Refactor: move animdata code from blenloader to blenkernel 2020-08-21 15:58:28 +02:00
bed634c4f9 Refactor: move nla code from blenloader to blenkernel 2020-08-21 15:42:26 +02:00
71634d94ca Cleanup: remove LodLevel
This was part of the game engine and is not used anymore.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8666
2020-08-21 15:24:36 +02:00
79d678e677 Refactor: move fcurve/fmodifier code from blenloader to blenkernel
This is part of T76372.
2020-08-21 15:23:33 +02:00
76689e8517 Cleanup: use LISTBASE_FOREACH in readfile.c 2020-08-21 14:39:39 +02:00
2e630297af GPUShader: Fix linking working even if one shader compilation failed
Linking without valid shaders works on some drivers. Avoid this case by
forcing linking step to return false.
2020-08-21 14:25:58 +02:00
3a6e981bcd Cleanup: GPU: Update classes comments
This should avoid confusion about what is a class and what is an opaque
pointer.
2020-08-21 14:16:42 +02:00
220fbdf593 GPUShader: Make GPUShader* an opaque pointer to blender::gpu::Shader
This avoids the misleading inheritance.

Also cleanup by setting the blender::gpu::Shader as active shader to
avoid some casting.
2020-08-21 14:16:42 +02:00
1e95a7402c GPUShader: Fix NULL string used as shader name.
The shader name is required with the latest changes.
2020-08-21 14:16:42 +02:00
c4f122ac8f GPUUniformBuf: GL backend isolation
This is in preparation of vulkan backend. We move all opengl
functionnalities behind an abstract class.

This also cleansup the "dynamic" ubo create and rename it to
`GPU_uniformbuf_from_list()`

Contains, no functional change.

Part of T68990 Vulkan support.
2020-08-21 14:16:42 +02:00
7edd8a7738 GPUUniformBuf: Rename struct and change API a bit
This follows the GPU module naming of other buffers.
We pass name to distinguish each GPUUniformBuf in debug mode.
Also remove DRW_uniform_buffer interface.
2020-08-21 14:16:42 +02:00
4f0a749489 Cleanup: use LISTBASE_FOREACH in writefile.c 2020-08-21 13:14:41 +02:00
933f0caec6 Blenloader: move IDProperty read/write code to blenkernel
This is part of T76372.
2020-08-21 12:45:41 +02:00
27f0a19bdc Cleanup: remove exec() calls from custom property editor
Remove `exec()` and `eval()` calls from `WM_OT_properties_edit` where
possible. This not only results in simpler, cleaner code, but also
removes the necessity for `repr(value)` to evaluate to a Python
expression that in turn evaluates to `value` again.

No functional changes.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D8658
2020-08-21 12:34:41 +02:00
3bc09c1c1e Cleanup: split BKE_scene_get_depsgraph() into two functions
Split the depsgraph allocation into a separate function
`BKE_scene_ensure_depsgraph()`. Parameters are only passed to those
functions that actually need them. This removes the the "if that boolean
is `false` this pointer is allowed to be `NULL`" logic and more cleanly
decouples code.

No functional changes.
2020-08-21 12:23:13 +02:00
e7767ba6be Cleanup: Reduce nesting of scene_get_depsgraph_p()
Reduce nesting by flipping conditions and returning early. It's now much
clearer that it's actually a linear function (rather than a nested one).

No functional changes.
2020-08-21 12:18:48 +02:00
7aeaf5da0e Fix crash when accessing view_layer.depsgraph through BPY
For the sanity checks to work we don't actually need to check other
scenes. So this function can be simplified so that it does not require
a `Main *`.

Mistake in 5cc08510e0.
2020-08-21 11:31:15 +02:00
41d31e100d Cleanup: remove MeshBatchCache from MeshRenderData
Was noted as a hack, this can be passed as an argument instead.
2020-08-21 17:19:25 +10:00
6755464527 UI: Fix panel collapse all behavior inverted
Ctrl click on a panel should collapse all other panels but leave that panel
expanded. In a recent cleanup commit that was mistakenly reversed.
2020-08-20 23:41:10 -04:00
4ed8bd88d9 UI: Cleanup in interface_panel.c
- Use const in some places where applicable
- Use consistent variable names in some places
- Use "r_" prefix for return arguments
- Declare variables in smaller scope where they are used
2020-08-20 23:38:39 -04:00
75aeb4b881 Cleanup: Use LISTBASE_FOREACH in editors/screen directory
Differential Revision: https://developer.blender.org/D8653
2020-08-20 20:47:44 -04:00
ce0bcd5fbf Fix incorrect notifier value
Wouldn't actually cause an issue since the value was unused within the
subtype bits.
Own mistake in dc2df8307f.
2020-08-20 20:28:54 +02:00
b077de086e Outliner: Avoid rebuilding tree on selection/active changes
We can avoid the rather expensive outliner tree rebuilds and only redraw
if nothing but the selection or active item changes. This should give a
bit of speedup for heavy scenes.

For this to work I had to correct a few notifiers, some were only
sending selection/active change notifiers that actually did things like
adding objects. I also added a more precise notifier type for when the
active collection changes. At the notifier subtype/action level we're
not even close to running out of bits, so this should be fine.
Also had to correct a wrong notifier check (was using `&` rather than
`==`).
2020-08-20 20:22:47 +02:00
2e6d5e6c6b Cleanup: Clang Tidy: Resolve readability-delete-null-pointer error 2020-08-20 13:33:17 -04:00
e5fd2a3888 Merge branch 'blender-v2.90-release' into master 2020-08-20 17:59:05 +02:00
5a957c0299 GPUShaderInterface: Fix use after free crash 2020-08-20 17:57:05 +02:00
05e1ccf108 Fix T79931: Infinite loop in scene "Full Copy" in 2.90.
Code dealing with object copy of master collection was bugy in case one
of the new object copy would get a name lesser than the original object,
leading to new copy being inserted before original one in lists.

Maniphest Tasks: T79931

Differential Revision: https://developer.blender.org/D8656
2020-08-20 17:47:56 +02:00
Wayde Moss
89ee260ef2 Fix T63675: Keying outside NLA strip not possible
Allow adding keys outside of the NLA strip, when Sync Length is
activated. Before this, an animator would have to exit tweak mode,
adjust the strip length, then enter tweak mode again.

Now the animator can freely insert and modify keys outside of the strip
bounds. They will never have to touch the strip bounds directly.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D7533
2020-08-20 17:19:36 +02:00
7d79b06fa7 Cleanup: Mesh Filter invoke refactor
This moves the allocation for filter to separate functions, removes all
repeated calls to RNA_enum_get an fixes some other code quality issues.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8639
2020-08-20 17:03:15 +02:00
5f414234dd GPUState: Use state setters inside selection code
This fixes T79945 Gizmos don't work in Edit Mode
2020-08-20 17:02:39 +02:00
8228356f50 DRW: Fix remaining glDisable 2020-08-20 17:02:39 +02:00
e23ef8753a GPUState: Use explicit depth test enum 2020-08-20 17:02:39 +02:00
c85144934a Fix T79924: Update the view rotation origin after setting the sculpt pivot
This updates the view navigation origin after modifying the pivot
position.

Reviewed By: sergey

Maniphest Tasks: T79924

Differential Revision: https://developer.blender.org/D8632
2020-08-20 17:01:12 +02:00
d74c495838 Fix variable simulation steps with cloth deform brushes
Cloth deform brushes (both in cloth brush or other tools with cloth
simulation targets) should not have their spacing as a value relative
the brush radius to avoid affecting the simulation speed when changing
the brush radius.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8620
2020-08-20 17:00:12 +02:00
b3bd121dd4 Sculpt: Add orientation modes to the Cloth Filter
This adds the orientation modes to the Cloth Filter.
Similar to the mesh filter, they set the orientation of the axis when
limiting the forces.

When using the gravity mesh filter, the orientation also sets the gravity
direction. In world orientation, cloth will always fall towards the
ground plane. In view mode, cloth will always fall down relative to the
view.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8618
2020-08-20 16:58:26 +02:00
Wayde Moss
50919413fe NLA: Fix strip Sync Length moving animation data
Change the way Sync Length works so that it keeps keyframes at the same
key as before the sync. Now when the user exits tweak mode, the overall
NLA result is unchanged.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D7602
2020-08-20 16:44:38 +02:00
Red Mser
12dd08ef52 UI: Fix aligned popovers not always turning inactive
Popovers which are aligned with properties should turn themself
(and the panel they open) inactive when the corresponding property
toggle is turned off. A notable exception is the snap settings
popover, as snapping can still be used when the toggle is off.

Differential Revision: https://developer.blender.org/D8584
2020-08-20 10:34:55 -04:00
263148dbac Depsgraph: refactor tagging after time changes
This reverts {rB1693a5efe91999b60b3dc0bdff727473b3bd00bb}
and implements an alternative solution.

The old patch had the problem that the depsgraph would always
evaluate at the current frame of the original scene (even when
`DEG_evaluate_on_framechange` was used). Now it is possible
to evaluate the depsgraph at a specific frame without having to
change the original scene.

Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8616
2020-08-20 16:29:34 +02:00
Sybren A. Stüvel
948e080fc5 Silence -Wmaybe-uninitialized warning on GCC/Linux
Add `-Wno-maybe-uninitialized` option to `CMAKE_CXX_FLAGS_RELEASE` and
`CMAKE_CXX_FLAGS_RELWITHDEBINFO` variables on GCC/Linux.

In Release builds GCC's `-Wmaybe-uninitialized` warning is unreliable,
and thus causes noise that can drown out other warnings. These warnings
are now silenced in release mode builds.a

Debug builds seem fine, so flags for debug builds are not touched by
this commit.

No functional changes.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8615
2020-08-20 16:12:28 +02:00
7fac0f9cd5 Selection: Fix lasso selection invisible 2020-08-20 16:11:14 +02:00
121d3181f9 GPU: Fix some more remaining GL enums scattered outside of GL module
This fixes an assert inside the lasso selection drawing.
2020-08-20 16:11:14 +02:00
19d72175ba GPUShaderInterface: GL backend isolation 2020-08-20 16:11:14 +02:00
14fcd46ca7 GPU: Use GPUShader setters for uniforms removing uses of ShaderInterface 2020-08-20 16:11:14 +02:00
5e65498e3d DRW: Remove some more direct gl state modification. 2020-08-20 16:11:14 +02:00
f364d181e3 UI: Fix collapsed panels not drawing header buttons
Error in rB940b239ad473 left a check for open panels after the
"vertical" check was removed.
2020-08-20 10:04:17 -04:00
f9697543e4 Revert "Cleanup: Use LISTBASE_FOREACH in editors screen directory"
This reverts commit 52f40bcff2.

Apologies for the noise. I caught a problem with this that I hadn't before. I will
commit later after thorough testing.
2020-08-20 09:34:09 -04:00
52f40bcff2 Cleanup: Use LISTBASE_FOREACH in editors screen directory
Differential Revision: https://developer.blender.org/D8653
2020-08-20 09:29:01 -04:00
a12d046910 Merge branch 'blender-v2.90-release' into master 2020-08-20 22:00:51 +10:00
c74b4caa72 Fix incorrect mask use with curves
Ref D8652
2020-08-20 21:51:35 +10:00
5e85c9878b Fix cloth collision clamp having no effect
And rename `cloth_selfcollision_impulse_vert` to `cloth_collision_impulse_vert`
2020-08-20 08:24:32 -03:00
f9b4fb7206 Cleanup: Outliner: LibOverride tools.
Remove useless extra-processing, comments, etc.
2020-08-20 12:41:14 +02:00
4aa04b6490 LibOverride: Add 'delete and use linked data' operation.
This will re-link all usages of a library override data-block
(including all of its override dependencies) to its reference linked
IDs, and delete those liboverrides.

As usual, it is available in the ID sub-menu of the outliner context
right-click menu.

Part of T76555.
2020-08-20 12:35:16 +02:00
59180ff153 Merge branch 'blender-v2.90-release' into master
Conflicts:
	source/blender/makesrna/intern/rna_scene.c
2020-08-20 11:54:46 +02:00
0fae682d61 Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.
RNA update function would only update objects from 'main' instantiated
collection, not those from sub-collections.

This should be comitted to 2.90 (and backported to 2.83 too).

Maniphest Tasks: T79935

Differential Revision: https://developer.blender.org/D8654
2020-08-20 11:52:12 +02:00
341ff17326 Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.
RNA update function would only update objects from 'main' instantiated
collection, not those from sub-collections.

This should be comitted to 2.90 (and backported to 2.83 too).

Maniphest Tasks: T79935

Differential Revision: https://developer.blender.org/D8654
2020-08-20 10:39:28 +02:00
efa7aaa97f Cleanup: use const variables where possible in the Python API 2020-08-20 16:10:13 +10:00
8877e3aa62 Cleanup: clang-format 2020-08-20 16:09:48 +10:00
07753fa825 Docs: Update BPY to manual mappings 2020-08-19 21:47:36 -04:00
48325306d9 Cleanup: Outliner active indicator repeated code
Refactor the code to draw the roundrect behind outliner icons for active
elements into a single function.

No functional changes.
2020-08-19 19:35:47 -06:00
940b239ad4 Cleanup: Remove unused variables for horizontal panels
Continuing the work of eb9055a572, remove remaining unecessary
variables and arguments that were related tabbing and horizontal
alignment of panels. For example, "vertical" was always true, and
removing that exposed other unused variables.
2020-08-19 18:55:04 -04:00
50b435cbaa Cleanup: Remove unused variable 2020-08-19 18:05:03 -04:00
4f6051e8c4 BLI: fix memory leak in delaunay 2d
Differential Revision: https://developer.blender.org/D8633
2020-08-19 18:45:48 +02:00
48bd6e7102 Tests: use guarded allocator in tests
This helps finding memory leaks in tests.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8631
2020-08-19 18:18:20 +02:00
eb9055a572 UI: Remove panel X axis closing code
Horizontal panel alignment hasn't been used for years, and we have no
plans to use it in the future. It adds a fair amount of complexity to
the panel code which makes adding features take longer.

This code removes the X closing flag, and all of the logic / variables
unused without it.

This commit includes a file subversion bump.

Differential Revision: https://developer.blender.org/D8601
2020-08-19 11:37:21 -04:00
f61927d946 BLI: improve leak detection in tests
This actually found a bug in my previous commit.
2020-08-19 17:27:58 +02:00
1dafa87eb5 GPUState: Fix signed / bitfield conversion leading to wrong enum value
This was creating drawing issues on windows builds.
2020-08-19 17:13:53 +02:00
fccb38cf19 Fix warning from narrowing conversion 2020-08-19 16:56:36 +02:00
2aff45146f BLI: improve exception safety of Vector, Array and Stack
Using C++ exceptions in Blender is difficult, due to the large
number of C functions in the call stack. However, C++ data
structures in blenlib should at least try to be exception safe,
so that they can be used if someone wants to use exceptions
in some isolated area.

This patch improves the exception safety of the Vector, Array
and Stack data structure. This is mainly achieved by reordering
some lines and doing some explicit exception handling.
I don't expect performance of common operations to be affected
by this change.

The three containers are supposed to provide at least the
basic exception guarantee for most methods (except for e.g.
`*_unchecked` methods). So, resources should not leak when
the contained type throws an exception.

I also added new unit tests that test the exception handling
in various cases.
2020-08-19 16:44:59 +02:00
aeaf2b0dd4 LibOverride: Add initial version of 'resync' operation.
Available from the usual ID submenu in the Outliner context menu.

The goal of this operator is to re-create the override from the linked
data, while preserving existing defined overrides.

This allows to update local opverrides when relations between datablocks
are changed in source library linked data.

Part of T76555.
2020-08-19 16:27:49 +02:00
aa1e4baa22 Cycles : add a Volume Geometry Node
This splits the volume related data (properties for rendering and attributes) of the Mesh node
into a new `Volume` node type.

This `Volume` node derives from the `Mesh` class since we generate a mesh for the bounds of the
volume, as such we can safely work on `Volumes` as if they were `Meshes`, e.g. for BVH creation.
However such code should still check for the geometry type of the object to be `MESH` or `VOLUME`
which may be bug prone if this is forgotten.

This is part of T79131.

Reviewed By: brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8538
2020-08-19 15:47:09 +02:00
3e56dd8fd9 GPencil: Change default Onion Keyframe mode to ALL
Now by default the selection mode is All keyframes types.

Also removed the icon for All option and renamed from `All Types`to `All`.

UI review by @pablovazquez
2020-08-19 15:30:38 +02:00
5cc08510e0 RNA: Validate scene/view-layer combination for statistics query
Users may input an invalid scene/view-layer combination via Python. We
can easily detect that and fail gracefully.

Besides checking input parameters in RNA, also assert the
scene/view-layer combination is valid in lower level Depsgraph lookup
function (called by statistics query).
2020-08-19 12:37:59 +02:00
8cbfc4c76e Fix T79816: Restore scene.statistics() BPY function
This RNA/BPY function was removed in c08d847488. For understandable
reasons really-- getting scene statistics from a string displayed in the
status bar is not exactly the best design. But we have committed to not
changing the RNA API too much for the 2.90 release, so we would like to
keep this functionality.

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

Reviewd by: Julian Eisel
2020-08-19 12:37:59 +02:00
5549ee2e08 Fix incorrect number of recent items displayed in splash
After recent code cleanup in rB349eebd7.
2020-08-19 12:26:49 +02:00
83c78529b9 Fix T79816: Restore scene.statistics() BPY function
This RNA/BPY function was removed in c08d847488. For understandable
reasons really-- getting scene statistics from a string displayed in the
status bar is not exactly the best design. But we have committed to not
changing the RNA API too much for the 2.90 release, so we would like to
keep this functionality.

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

Reviewd by: Julian Eisel
2020-08-19 12:14:03 +02:00
c5d33070fd Cleanup: compiler warnings 2020-08-19 12:11:48 +02:00
e9e493977c GPUShader: Fix apple clang warnings 2020-08-19 11:57:28 +02:00
d412a5e6fa DRW: Fix crash drawing gpencil 2020-08-19 11:54:05 +02:00
90ee622830 Turn experimental features ON for master
During alpha the user preferences > experimental featuers are available
to prevent merge issues and allow developers to seek feedback.

This needs to be manually turned off when we branch for beta, otherwise
the RNA of the incomplete features will be exposed.
2020-08-19 10:23:21 +02:00
ffb8fca751 Revert "Turn experimental features on for master (alpha)"
I turned on the wrong feature in cmake.
This reverts commit bdf43213b2.
2020-08-19 10:22:00 +02:00
97dc370c50 Fix compiler error in MSVSC
Introduced in: rB20a8edaa725ddbae16179d2f7cea88c097c61615

It broke building on windows, initializing a static may not be done with a function in C.
2020-08-19 08:58:29 +02:00
638fa188b7 Merge branch 'blender-v2.90-release' into master 2020-08-19 14:45:21 +10:00
Hans Goudey
04ca28a6e0 Fix T77300: Some scientific notation evaluation has incorrect results
Ref D7922
2020-08-19 14:44:42 +10:00
d3bf4929de Cleanup: update mball.c comments
Some errors in comments, references to old function names.
2020-08-19 14:16:25 +10:00
7a602fb525 Cleanup: spelling 2020-08-19 14:04:36 +10:00
3f43f57731 Cleanup: warnings 2020-08-19 13:52:48 +10:00
33a4a6dd66 Merge branch 'blender-v2.90-release' into master 2020-08-19 13:51:14 +10:00
762e4cf221 BLI_listbase: add utility macro for looping over lists with an index
Add to the 2.90 branch to avoid problems if fixes from master use it.
2020-08-19 13:43:51 +10:00
349eebd7d1 UI Code Quality: Use LISTBASE_FOREACH in interface directory
I only skipped a few loops in the monstrous ui_handle_menu_event
function. Also, I only changed variable names where necessary to
prevent redeclarations.

Differential Revision: https://developer.blender.org/D8586
2020-08-18 21:47:00 -04:00
ffa8e75799 BLI Listbase: Add iterator macro that increments an index 2020-08-18 21:38:18 -04:00
78d6c273b7 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-18 21:30:52 +02:00
33fde699e2 Cleanup: GPUState: Remove GPU_state_init() 2020-08-18 21:30:11 +02:00
e5796233c7 GPUState: Use GPU_viewport to set viewport state in GPU_framebuffer
also fix a small issue in GPU_texture_clear.
2020-08-18 21:30:11 +02:00
adca09b643 GPUState: Port default state to StateManager constructor 2020-08-18 21:30:11 +02:00
a9f2ebb215 Cleanup: DRW: Use GPUState instead of raw opengl calls
Should not break anything! Huh!
2020-08-18 21:30:10 +02:00
536c2e0ec9 GPUState: Only apply state before drawing 2020-08-18 21:30:10 +02:00
482a51aabf Cleanup: GPUState: Remove stack from the state manager and rename it 2020-08-18 21:30:10 +02:00
d10f000322 GPUState: Remove gpuPushAttr/gpuPopAttr
And use manual save/restore mechanism.

The stack method is not used so much to be considered useful.
2020-08-18 21:30:10 +02:00
f30df15edc GPUState: Make use of GPUStateStack class
This isolate most GL calls to the GL backend. Still a few remains.
2020-08-18 21:30:10 +02:00
298329554a Cleanup: GPUState: remove double GPU_blend calls 2020-08-18 21:30:10 +02:00
bf1b622dd9 GPUState: GPU_blend final API renaming
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
2020-08-18 21:30:10 +02:00
10558d6973 Cleanup: GPUState: remove use of GPU_blend_set_func 2020-08-18 21:30:10 +02:00
969bcf0793 Cleanup: GPUState: Replace blend func separate by enum 2020-08-18 21:30:10 +02:00
a1459b2f7a Cleanup: GPU: Move towards an explicit Blend state
This make use of the GLStateStack functions for:
- `GPU_blend()`
- `GPU_blend_set_func()`
- `GPU_blend_set_func_separate()`

The goal is to unify them using an explicit state setting.
This will remove the need to use obscure blend functions
2020-08-18 21:30:10 +02:00
2ae1c895a2 GPUState: Add GL backend and state tracking but do not use it
This is just the backend work. It is not plugged in yet because it
needs more external cleanup/refactor.
2020-08-18 21:30:10 +02:00
2eddfa85e0 Cleanup: GPU: Remove uneeded depth precision getter.
We always use 24bit framebuffers nowadays.
2020-08-18 21:30:10 +02:00
0f292dc072 Cleanup: GPUState: remove float variant of GPU_scissor_get 2020-08-18 21:30:10 +02:00
c78ea96528 GPUShader: Add debug labels
This allow better debugging inside renderdoc.
2020-08-18 21:30:10 +02:00
ba3c18f4b2 GPUShader: Add back vertformat_from_shader() 2020-08-18 21:30:10 +02:00
e8c48ce075 GPUShader: Improve auto name
Use macro to get calling function name. Helps debugging shaders.
2020-08-18 21:30:10 +02:00
e43e9caf1b GPUShader: Rewrite error printing
Now error printing only display the line related to the error.
We also put char marker if present.

Example:
```
-- Shader Compilation Errors : MAMaterial --

10414 |  node_fresnel(, facingnormal, viewposition, tmp34);
      |               ^
      | error: syntax error, unexpected ',', expecting ')'

----------------------------------
```
2020-08-18 21:30:10 +02:00
216d78687d GPUShader: GL backend isolation 2020-08-18 21:30:09 +02:00
df28d2c27e Cleanup: GPU: Replace Batch uniform by shader uniform using macro
This is a first step into removing uniforms from GPU_batch and Imm.
2020-08-18 21:30:09 +02:00
d5b5b228e4 UI: Fix protential stray GPU state preventing correct drawing
Fix potential issue with nodetree introduced in rB47c6f41b8926.
2020-08-18 21:29:47 +02:00
b8b56ee172 BLI_kdopbvh: Adjust epsilon according to the axis
This corrects the overlap detection for cloths since in this case kdop26
is used and epsilon represents the distance.
2020-08-18 14:08:58 -03:00
80face1be5 Depsgraph: simplify DEG_evaluate_* API
This mainly removes the bmain argument, which can be
retrieved from the graph itself.

Also, I removed some outdated/unnecessary comments.

Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8614
2020-08-18 17:40:56 +02:00
c2f0522760 Sculpt: Enable Cloth Simulation Target for Pose and Boundary
This adds a new brush property called "Deformation Target" which
controls how the brush deformations is going to affect the mesh data. By
default is set to Geometry, which makes the brushes displace the
vertices. When set to Cloth Simulation, the deformation of the brush is
applied to the cloth solver constraints, so the simulation is
responsible to apply the final deformation. This allows to add cloth
simulation effects to other sculpt tools with minor modifications to their
code.

This patch enables Cloth Simulation deformation target for Pose and
Boundary brushes, which are tools that are already designed to work in
low poly counts and produce large deformations. This allows creating the
most common cloth effects, like bending and compressing folds, without
relying on collisions.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8578
2020-08-18 17:16:35 +02:00
bedd6f90ca Sculpt: Erase Displacement Mesh Filter
Same concept as the Multires Displacement Eraser Brush but implemented
as a mesh Filter. This allows to delete the displacement of an entire
area uniformly.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8608
2020-08-18 17:04:24 +02:00
0957189d4a Sculpt: Enhance Details Mesh Filter
Exact same operation as D8509, implemented as a Mesh Filter.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8510
2020-08-18 16:56:44 +02:00
55087b84b8 Cleanup: Node: Use checker shader for preview background
Removes many drawcalls which might have slowdown the UI.
2020-08-18 16:15:34 +02:00
3e5431fdf4 Sculpt: Invert Smooth to Enhance Details
This enables the invert mode in the smooth brush as Enhance Details.
The operation is similar to the Sharpen Filter intensify details parameter,
which consist in applying the laplacian smooth displacement in the opposite
direction calculated using the original coordinates.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8509
2020-08-18 16:14:10 +02:00
872efd8d73 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/editors/space_node/node_draw.c
#	source/blender/editors/space_sequencer/sequencer_draw.c
2020-08-18 16:04:41 +02:00
b3b67a61b7 Fix compiler error in MSVSC
Introduced in: rB20a8edaa725ddbae16179d2f7cea88c097c61615

It broke building on windows, initializing a static may not be done with a function in C.
2020-08-18 15:59:03 +02:00
5195d346f4 Fix T79714: Projecting texture from camera fails
The evaluated mesh is now only recomputed when the required data layers
are missing. Previously the evaluated mesh was re-evaluated incorrectly,
which caused the stippled result and the failing assert.

Since now only the evaluated mesh is used, and never a temporary mesh,
there is also no more need to keep track of whether the mesh needs
freeing or not.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8574
2020-08-18 15:53:28 +02:00
6a4f5e6a8c Depsgraph: simplify build API
Reviewers: sergey, sybren

Differential Revision: https://developer.blender.org/D8611
2020-08-18 15:51:32 +02:00
47c6f41b89 Fix T77564: VSE (and compositor background) lost stereoscopy preview
Issue introduced on fe045b2b77.

Since the stereoscopy compositing (anaglyph, ...) is only done for
viewports the VSE preview and compositor need to use viewports.

Reviewed by: dfelinto

Differential Revision: https://developer.blender.org/D8472
2020-08-18 15:50:49 +02:00
d9f7cbb8af Cleanup: remove bmain argument from BKE_scene_graph_update_for_newframe
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8613
2020-08-18 15:45:58 +02:00
f653a4f349 Cleanup: remove outdated comments 2020-08-18 15:41:26 +02:00
2922f9b83d Cleanup: remove TimeSourceNode->cfra which is never read 2020-08-18 15:40:29 +02:00
2e908156d0 Fix T77564: VSE (and compositor background) lost stereoscopy preview
Issue introduced on fe045b2b77.

Since the stereoscopy compositing (anaglyph, ...) is only done for
viewports the VSE preview and compositor need to use viewports.

Reviewed by: dfelinto

Differential Revision: https://developer.blender.org/D8472
2020-08-18 15:39:27 +02:00
63998d3522 Cleanup: remove unused TimeSourceNode->offset 2020-08-18 15:32:43 +02:00
89a374cd96 Sculpt: Sculpt Filter Orientation Options
Previously, the XYZ deform axis of the Mesh Filter were limited to
object space (which is the default for sculpt mode). Now it is possible
to limit the XYZ displacement in Local, Global or View space.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8582
2020-08-18 15:19:54 +02:00
017941057f Fix T79800: Split vertex size for grease pencil
Differential Revision: https://developer.blender.org/D8607
2020-08-18 15:13:53 +02:00
bdf43213b2 Turn experimental features on for master (alpha)
Remember to turn this off again when we branch out for the next beta (2.91)
2020-08-18 14:56:22 +02:00
8ab0d0e399 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-18 14:55:44 +02:00
83e3d25bca Remove (ifdef) RNA for simulation, point cloud and particles
For 2.90 release this should not be exposed in the RNA API.

In master this needs to be ON by default, that's all.

Differential Revision: https://developer.blender.org/D8589
2020-08-18 14:41:16 +02:00
c526a34fc2 Cleanup: Fix strict compiler warning 2020-08-18 14:38:07 +02:00
1da0685076 Cycles: add a Pass Node
The Pass struct is now a Node and the passes are moved from the Film
class to the Scene class.

The Pass Node only has `type` and `name` as sockets as those seem to be
the only properties settable by exporters (other properties are implicit
and depend on the pass type).

This is part of T79131.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8591
2020-08-18 14:28:59 +02:00
673b1930d8 Merge branch 'blender-v2.90-release' 2020-08-18 14:05:26 +02:00
20a8edaa72 No experimental feature (but debug ones) to work for blender beta/release
Final releases (including beta) should strictly show features that are
finalized to prevent loss of data, old API clanging around, and the
overall quality of the product (Blender) presented.

Note that rendering should never be affected by user preferences, so
this is only changing things in the UI level.

Development note: This is reset experimental UI on file load.
Also note: to hide RNA (needed for hair and particles) will be done as a
separate patch.

Differential Revision: https://developer.blender.org/D8606
2020-08-18 14:02:47 +02:00
aba46371a1 GPUTexture: Extend CUBE_MAP_ARRAY_ARB proxy workaround to all Apple gpus
Related to T79716
2020-08-18 14:01:14 +02:00
41235eed1d GPU: Avoid invalid GL API usage
Drawing with 0 sized buffer is prohibited.
2020-08-18 13:53:07 +02:00
fe1827df82 Fix T79782 GPU: Crash cause by shadow batch reference
After drawing, the batch could be reset and draw again using other
parameters.

Avoid having to track references by setting the batch pointer to NULL after
drawing.
2020-08-18 13:53:07 +02:00
4814836120 Sculpt: Option to limit the forces axis in the Cloth Filter
This uses the same concept of the Mesh Filter but for applying the cloth
filter forces, so now it can be limited to a specific axis.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8567
2020-08-18 13:28:37 +02:00
976f0113e0 Multires: Base Mesh Sculpting
This adds an option to the Multires modifier to sculpt directly on the
base mesh while previewing the displacement of a higher subdivisions
level. What this does it considering Multires as a regular modifier
without exposing the grid displacement to sculpt mode.

This allows to see the propagation happening in real time, which enables
to use complex tools like Cloth or Pose in much higher resolutions and
without surface noise and artifacts.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D8555
2020-08-18 13:11:23 +02:00
df495e758d Cleanup: use Span instead of separate pointer and length
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8605
2020-08-18 13:06:31 +02:00
fc5eab3570 Mesh: merge mesh_create_eval_final_{view,render} functions
Functions `mesh_create_eval_final_view()` and
`mesh_create_eval_final_render()` were doing the exact same thing,
except for a hack introduced in d3eb9dddd6 (2012-10-08, Better fix for
T32846: dupligroup messes up particle instancing on rendering) that
appears to be no longer necessary. Besides that, these functions had
confusing names. Their functionality changed over time, and whether to
do for-render or for-viewport evaluation is now actually determined by
the depsgraph evaluation mode. This means that the `..._render` function
could evaluate a mesh with viewport settings, and vice versa.

The functions are now merged into `mesh_create_eval_final()`, and the
hack has been removed. The `OB_NO_PSYS_UPDATE` flag has been removed
entirely (instead of keeping it around as deprecated flag), because it
was always only temporarily set on objects during mesh evaluation and
thus not saved to the blend file.

No expected functional changes as far as users are concerned.
2020-08-18 12:58:48 +02:00
e371378c8b Cleanup: rename bdata to boundary
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8556
2020-08-18 12:48:56 +02:00
701a026d95 Merge branch 'blender-v2.90-release' into master 2020-08-18 12:46:17 +02:00
6df4b00f5f Fix IDProps definition still being editable in liboverrides.
One should be able to edit overridable IDProps values, but never their
settings/definitions.

Note that being able to add new IDProps to overrides is still a TODO.

Reported by Josephbburg (@Josephbburg) over blenderchat, thanks.
2020-08-18 12:43:42 +02:00
5aecc4b57b Fix Cloth Brush Grab deform types not working with spacing
Even the Cloth Brush grab works like a regular grab brush, it makes
sense to support spacing just in this brush in order to prevent creating
more brush steps that update the simulation. This way, it is possible to
create grab brushes that update the simulation constantly while grabbing
(using the dots stroke mode) or brushes that only update the simulation
when the cursor moves (using spacing).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8568
2020-08-18 12:36:48 +02:00
Pablo Dobarro
e3eb53a5b3 Cleanup: Remove unused code in the Paint Cursor
This code was left here after the refactor, it was doing nothing and it
was causing an assert.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8579
2020-08-18 12:35:37 +02:00
762daacbc7 Fix Face Set Visibility operator using wrong active Face Set
The Face Set visibility operator was using the last active Face Set
updated by the paint cursor, so when the paint cursor is not used (when
using a filter or a transform tool), the active Face Set was not updating
and it was hidding the wrong Face Set based on the last cursor position
with a brush tool active. Now the Face Set Visitility operator has an
invoke callback wich forces a active vertex and face set update
regardless of the active tool, so it should always work correctly.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8580
2020-08-18 12:33:54 +02:00
cfeadaa295 Fix Mesh Filter deformation axis UI layout
This uses a single row for the three axis instead of a row per axis.

Reviewed By: sergey, Severin

Differential Revision: https://developer.blender.org/D8581
2020-08-18 12:32:58 +02:00
6a6cb83eb3 Fix T79568 EEVEE: Film transparent not working
Since world shader use the same standard output and are considered opaque,
we need to set alpha as holdout.
2020-08-18 12:26:22 +02:00
ca7414c4cb Fix Mask Slice deleting the Face Sets
This was a TODO in the code. Previously the Face Set datalayer was
deleted and recreated with a constant ID of 0. Now the datalayer is
preserved and set to the SculptSession after slicing the mask and a new
ID is calculated for the new faces that the slicing operation produced,
so they can be easily isolated for further tweaking.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8583
2020-08-18 12:20:05 +02:00
db4e08dfdc Sculpt: Expose the functions to create and init a SculptClothSimulation
This will be used for new features like supporting cloth deformation in
other brushes and tools outside of the cloth brush code.
No functional changes.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8602
2020-08-18 12:17:14 +02:00
c82166ffcd Cycles: move some Scene related methods out of Session
This moves `Session::get_requested_device_features`,
`Session::load_kernels`, and `Session::update_scene` out of `Session`
and into `Scene`, as mentioned in D8544.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8590
2020-08-18 11:50:37 +02:00
286fc2233d Merge branch 'blender-v2.90-release' into master 2020-08-18 11:39:36 +02:00
0b49fdd0ee Fix/cleanup Constraint poll function in liboverride cases.
Some constraint-specific operators, like set/clear inverse matrix of
childof constraint, are also valid on original, linked/overridden
constraints.

Similar change to what was done to modifiers poll function a few days
ago.

Reported by Josephbburg (@Josephbburg) over IRC, thanks.
2020-08-18 11:36:34 +02:00
400ab19702 Build deps: Enable SSE optimization for FFmpeg
The description is self-explanatory: enable SSE optimizations in the
FFmpeg library. They were disabled from the very beginning of the
dependency builder, possibly due to portability concerns.

FFmpeg does perform runtime check for available CPU microarchitectures,
so the codecs will still run on older hardware, but they will run way
faster on newer hardware.

For example, re-encoding 3405 2560x1376 frames on Xeon E5-2699 V4 CPU
went down from 313sec to 210.

Differential Revision: https://developer.blender.org/D8594
2020-08-18 11:17:26 +02:00
be30023c68 Merge branch 'blender-v2.90-release' 2020-08-18 09:52:20 +02:00
567e333ea4 Fix T79580: Control Mesh Only Partially Drawn After Filling a Surface From a Cage of Surface Curves
Differential Revision: https://developer.blender.org/D8600
2020-08-18 09:51:36 +02:00
ff3ecf4aa9 Merge branch 'blender-v2.90-release' 2020-08-18 08:39:13 +02:00
f94e322ab7 Fix T79770: Crash opening 2.83 .blend with linked collection containing greasepencil object in 2.91
The scene was null and could not be patched.
2020-08-18 08:36:26 +02:00
a8a048915e Cleanup: use view-zoom enum type 2020-08-18 12:30:10 +10:00
3c690aa4bc Merge branch 'blender-v2.90-release' into master 2020-08-18 12:29:15 +10:00
d1057890c4 Fix incorrect pixelsize use where DPI scale was intended
Changing line-width shouldn't scale cursor motion. Related to T79787.

Use dpi_fac for scaling curve error threshold & number button drag
threshold calculation.
2020-08-18 12:09:30 +10:00
6978635622 Fix T79787: orbit/zoom sensitivity depends on line-width
Use 'dpi_fac' instead of 'pixelsize' to scale input sensitivity
based on the interface scale.
Also use dpi_fac for view zoom operator.

Thanks to @ISS for investigating.
2020-08-18 11:44:16 +10:00
9085fb8073 Cleanup: expand UserDef pixel-size & DPI documentation
Avoid misunderstandings with UI scaling.
2020-08-18 11:17:15 +10:00
c65c66320f Merge branch 'blender-v2.90-release' 2020-08-17 21:11:29 +02:00
e157573fab Fix T77683: Cycles baking crash with motion blur enabled and no camera
specified

Maniphest Tasks: T77683

Differential Revision: https://developer.blender.org/D8593
2020-08-17 21:04:55 +02:00
45da0d20e6 VSE: make transform effect multithreaded
Multithreaded implementation can provide significant performance gain
on CPU's that can handle more parallel tasks.

On my 8 core system I got about 3.5x faster processing speed.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8585
2020-08-17 20:52:59 +02:00
8556e801a7 Fix T79594: Define rounding for armature edit props
Define `RNA_def_property_ui_range` for head and tail transform properties.
Step of 10 should match original behavior when tweaking value.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D8513
2020-08-17 20:49:38 +02:00
Stefan Werner
1c892e6814 Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 20:41:34 +02:00
118e78a844 Merge branch 'blender-v2.90-release' 2020-08-17 20:39:07 +02:00
4b69e55da3 Fix T79757: Crash on prefetch when renaming strips
Original sequence lookup failed, becase name changed in another thread.
Fix is same as 0471349c90 - stop prefetching before changing content
of seqbase.

I have covered more cases, and added assert so it is more obvious that
issue is in lookup, and it shouldn't fail.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8592
2020-08-17 20:19:11 +02:00
ac41215f07 Tests: fix Alembic export test on Windows
Convert all `subprocess.run()` arguments to string, to prevent breaking
"does this argument need quoting" checks on Windows.
2020-08-17 20:08:01 +02:00
c6a99e021a Clang tidy: Fix else after return 2020-08-17 14:00:42 -04:00
2b896fc481 Fix T79052: Cycles new sky texture fails with sun size zero
Clamp to a minimum angle to avoid precision issues.
2020-08-17 17:57:29 +02:00
108f3284a7 USD: Allow exporting of invisible objects
The fix for T75936 made it possible to export invisible objects to
Alembic. This commit applies the same approach to the USD exporter.

The USD and Alembic code is slightly different in terms of where in the
exported file the visibility attribute is stored. In USD the visibility
is used to prune the scene graph, and thus there are only two options:
"hidden" and "inherited". Setting the visiblity of a node in the scene
graph to "hidden" immediately hides all its children. To allow hidden
parents with visible children, the visibility is stored on the object
data (so the geometry/camera/lamp/etc) instead.
2020-08-17 17:56:05 +02:00
271361e31f IO: Add test for iterating over invisible objects
Add a test that checks invisible objects are iterated over by the
`IO::AbstractHierarchyIterator` class, when a suitable depsgraph is given.

No functional changes.
2020-08-17 17:56:05 +02:00
a95f863596 Fix T75936: Alembic, allow exporting of invisible objects
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.

Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8595
2020-08-17 17:56:05 +02:00
fd3086833a Cleanup: IO, reduce code duplication in USD and Alembic exporters
Move the object visibility check from Alembic/USD-specific code into the
`io/common` module.

No functional changes.
2020-08-17 17:56:05 +02:00
04ae290024 Cleanup: Alembic, rename test in CMake for consistency
Rename test `alembic_tests` to `alembic_export_tests`, so that its name
is consistent with the Python file containing the tests,
`alembic_export_tests.py`.

No functional changes.
2020-08-17 17:56:05 +02:00
9c241eae48 Fix T79597: Crash with dyntopo after paint cursor refactor
The paint cursor now uses a single call to
SCULPT_cursor_geometry_info_update and the Sculpt API to update both the
radius and the SculptSession data, so random access needs to be
initialized for dyntopo before using API functions.

Reviewed By: sergey

Maniphest Tasks: T79597

Differential Revision: https://developer.blender.org/D8489
2020-08-17 17:34:08 +02:00
fd6725cbfb Merge branch 'blender-v2.90-release' into master 2020-08-17 16:45:30 +02:00
c7a7a38b65 Fix T79633: ovrride apply code broken with RNA-defined runtime IDProps in some cases.
When copying between a set RNA runtime property and an unset one, code
would not behave properly.

We have to also consider NULL 'override apply' callback pointer as a
valid 'use default override apply function' case.
2020-08-17 16:44:36 +02:00
Stefan Werner
d88721879b Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 16:04:01 +02:00
449ccb7b30 Fix typo: missing f string prefix in Alembic export test 2020-08-17 15:16:20 +02:00
6b6de5beba Cleanup: Alembic tests, add note explaining how the export tests work
No functional changes.
2020-08-17 14:07:45 +02:00
ad459302ce Cleanup: rename alembic_tests.py to alembic_tests_export.py
Rename `alembic_tests.py` to `alembic_tests_export.py`, as this makes it
clearer what is being tested.

No functional changes.
2020-08-17 14:07:45 +02:00
4a2ff0fef8 Tests: Better error reporting in AbstractAlembicTest
Instead of checking for the length of a list, just handle the error that
occurs when the length is incorrect.

No functional changes to any actual test.
2020-08-17 14:07:45 +02:00
38752944f8 Fix formatting bug in AbstractAlembicTest class
Replace `formatstring, value` with the correct `formatstring % value`.

No functional changes to any actual tests.
2020-08-17 14:07:45 +02:00
e14de692fc UI: Only draw node menu search if categories exist
Currently, the search operator in the node add menu NODE_MT_add is drawn
even if no node categories exists. This patch only draws the operator if
at least one node category passes the poll.

This patch is needed because some add-ons use custom search operator and
do not register node categories. In this case, it is undesirable to have
a search operator drawn that do nothing and is not used. One such add-on
is Animation Nodes.

Reviewed By: Jacques Lucke

Differential Revision: https://developer.blender.org/D8576
2020-08-17 13:43:19 +02:00
8fda93a405 Cleanup: Change BLI_bitmap for BLI_edgeset for internal springs
The BLI_bitmap had the potential to eat a lot of memory as it was a
dense map between all the vertices in the mesh.

Now we instead use BLI_edgeset so that we only store data when needed
(creating a spare map instead of a dense).
2020-08-17 12:39:40 +02:00
b2d9020aa5 Fix T77340: nested nodes alpha issues
Reviewers: Severin

Differential Revision: https://developer.blender.org/D8573
2020-08-17 12:34:49 +02:00
68651534c2 Fix T77267: Render EEVEE AO pass when AO disabled.
In EEVEE the AO renderpass influenced other render passes. Until now the
pass wasn't selectable when AO was disabled in the scene to remove these
render artifacts.

This patch allows rendering EEVEE AO pass without enabling it in the
scene. It does this by binding a fallback texture that is used by the
surface shaders.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7956
2020-08-17 11:10:32 +02:00
3d47da9e4c Fix error in recent bpy_interface.c split (missed moving define)
Error in 7341ceb674, this missed moving a local-define when splitting.
2020-08-17 18:53:21 +10:00
6b5582c7f7 Fix: Workbench Depth Of Field Crash
Depth of field compilation failed due to recent refactoring. This only
happened in blender 2.91. This change uses the shader lib to find
dependencies.
2020-08-17 10:50:22 +02:00
0967935b42 Cleanup: split BPY_run_string_ex into two functions
Using a boolean to select between eval/exec behavior wasn't very
readable.
2020-08-17 18:32:20 +10:00
7341ceb674 Cleanup: move Python script execution into BPY_extern_run.h
This commit renames 'execute' to 'run' because:

- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
  making naming awkward (for future API refactoring).
2020-08-17 18:32:20 +10:00
397cec6a4d Cleanup: Pass 'FILE *' instead of 'void *' for BPY_python_backtrace
This was committed as a temporary workaround in 82150f5641
as release builds were failing (only debug builds worked).

This adds `stdio.h` to the header which is now split into a file that
contains more specialized functionality.

Also move function body inside BPY_python_backtrace,
removing PyC_StackPrint as we have PyC_StackSpit() for
similar functionality that can be called from a debugger.
2020-08-17 18:31:04 +10:00
f8c0d63cdb Cleanup: split BPY_extern_python into it's own header
Currently BPY_extern.h includes too much mixed functionality.
2020-08-17 17:20:12 +10:00
0b4a365183 Cleanup: sort CMake path lists 2020-08-17 12:40:03 +10:00
9a4c019255 Cleanup: header order, trailing space 2020-08-17 12:39:08 +10:00
bee4a2f97c Cleanup: use 'use_' prefix for RNA booleans 2020-08-17 12:35:26 +10:00
9762c3892e Cleanup: spelling 2020-08-17 12:34:05 +10:00
cafe5cd9b0 Cleanup: explain why checking the enabled state twice is needed
Address concern raised with the commit that added this extra check.
2020-08-17 12:33:07 +10:00
5c78c16b14 UI: Simplify cloth filter type description
Remove extra words in the message and avoid repeating
the name in the description.
2020-08-16 08:57:46 -04:00
4f57e1aaea Merge branch 'blender-v2.90-release' 2020-08-16 08:54:27 -04:00
8010cbe620 Fix T79823: Typo in cloth filter type description 2020-08-16 08:54:07 -04:00
b0b0d9f2cf Merge branch 'blender-v2.90-release' into master 2020-08-16 21:21:20 +10:00
59bc71d69b Fix popups opening in the wrong direction over headers
Checks for header alignment didn't account for tool-header & header
having different alignment.

There is no reason to use a lookup function on the area
(ED_area_header_alignment) as we already have region.

Check the regions alignment directly, remove access functions.
2020-08-16 21:14:26 +10:00
d5d83b71f7 Merge branch 'blender-v2.90-release' into master 2020-08-16 14:21:04 +10:00
73fb445b8d Fix T78426: Header flips when changing editors
The existing header flip detection didn't account for mixed
tool-header and header flipping & visibility between space-types.

Now alignment syncing handles any combination of header,
tool-header & footer flipped state, in a way that can be extended
to other region types in the future.
2020-08-16 14:18:40 +10:00
93304b483a Cleanup: Quiet GCC maybe uninitialized warning
There was a false positive here. Thankfully, marking the button's type
as constant can quiet the warning.
2020-08-15 22:20:40 -04:00
2c61c3d733 deps_builder: Fix boost::python linking release python library
By default boost::python in debug configuration links the release
python libraries. Which leads to loading issues with the produced
modules in a debug blender (which does use the debug python libs)

Bjam has an option to switch this to the debug libraries but when
you switch that on it changes the library names for *all* boost
libraries, even ones that don't have anything to do with python
and even the release libraries.

therefore an alternative way has been chosen and we're dealing
with this by adding a define rather than asking bjam to do it.
2020-08-15 11:06:16 -06:00
199e308670 Fix T79790: GPencil sculpt strength icon changed in recent cleanup
This commit restores the vertex colors which were lost in the cleanup.
2020-08-14 16:53:14 -04:00
80982941bd Merge branch 'blender-v2.90-release' 2020-08-14 16:39:35 -04:00
c300fc56c3 UI: Fix type in multires modifier subpanel
Thanks to @zanqdo for reporting "Subdivions"

Also remove the empty space I left for the "Delete Lower" operator that
never made it into 2.90.
2020-08-14 16:34:48 -04:00
36e4d4af5b Fix T79772: Gpencil. Additive drawing doesn't work when creating fills
This option was not supported in Fill tool
2020-08-14 19:05:05 +02:00
f491442eb0 Merge branch 'blender-v2.90-release' 2020-08-14 13:01:05 -04:00
9ab3b8f7f4 UI: Remove cutoff text in popovers for 2.90 release
Many of these popovers could use a design pass in 2.91, but for 2.90 we
don't want to change any UI strings at this point, so the best way to
solve the cutoff text is to widen the popovers. Sadly this won't affect
popovers when other languages besides English have longer strings, but
solving that is a much larger task.

Another benefit is that tweaking sculpt / paint brush options feels much
less cramped with slightly wider popovers.

I only know of one string that is still slightly cutoff by default with
this patch, the "Max Element Distance" property of the pose brush in the
sculpt mode brush settings popover. But I didn't think it was worth
widening that popover more to deal with that one case.

Differential Revision: https://developer.blender.org/D8575
2020-08-14 12:58:24 -04:00
e037c7230d Merge branch 'blender-v2.90-release' 2020-08-14 17:58:05 +02:00
04f703fca6 Fix warning when compiling on Linux with WITH_XR_OPENXR enabled 2020-08-14 17:57:24 +02:00
e8dfe91767 Merge branch 'blender-v2.90-release' 2020-08-14 17:18:09 +02:00
b3c08a3a0a Fix constant lighting change in VR view when rotating head
We have to explicitly enable fixed world space lighting. This was in
fact already done, but overridden by the code to sync the 3D View
shading settings to the VR view.
2020-08-14 17:03:10 +02:00
c074943dfd Fix undefined behavior with --debug-xr
Mistake in cb578ca104. Before that, the extension vector was static,
to make sure the extension name strings wouldn't get destructed when
leaving the function. I didn't think that was an issue and couldn't
recreate one, because until the previous commit we wouldn't actually
add any extensions to the vector on Windows (the system I tested
with).

Use C++17's `std::string_view` now, which avoids the string copies
`std::string` creates for itself and thus its destruction when leaving
the local scope.
2020-08-14 17:03:10 +02:00
77e4905b17 Fix --debug-xr not outputting OpenXR debug prints on Windows
The OpenXR debug extension was disabled on Windows as a workaround. This
was an old leftover from when there was only the Windows Mixed Reality
runtime on Windows. The debug extension didn't work for it and we didn't
have a way to disable it just for Windows Mixed Reality.
Now it seems to work though, so we remove the workaround. If specific
runtimes still have trouble with the extension, we can disable it
specifically for these runtimes now.
2020-08-14 17:03:10 +02:00
d958ab62e7 Fix NULL pointer access in render engine reported by address sanitizer
This may not have caused an actual bug.
2020-08-14 16:49:22 +02:00
690d76c624 Fix T79769, T79768: crash tweaking volume settings with Cycles viewport render
Refitting the BVH does not work in this case, it needs to be fully rebuilt.
2020-08-14 16:49:08 +02:00
d117520aa2 Merge branch 'blender-v2.90-release' 2020-08-14 16:00:54 +02:00
cb578ca104 Fix/workaround graphics issues breaking SteamVR use with Blender
Windows only workaround. I'll have to investigate Linux separately.

Steam's OpenGL compatibility is still new and doesn't work for us yet
(neither does it for standard OpenXR examples from what I've heard and
seen myself). We can work around that by falling back to our DirectX
compatibility layer.
Note that this DirectX compatibility still doesn't work for some
systems, see T76082.

Implementation note: Since the graphics binding extensions have to be
enabled before we can find out which runtime is in use (e.g. SteamVR vs.
Oculus, etc), we can now enable multiple graphics binding extensions but
settle for a single one to use later.

Once the SteamVR OpenGL backend works, we can remove this workaround
again.

Fixes T78267.
2020-08-14 16:00:03 +02:00
6a561367d0 Merge branch 'blender-v2.90-release' 2020-08-14 13:29:03 +02:00
ab3a651515 Fix offset applied on top of VR landmark with no positional tracking
On VR session start with positional tracking disabled, the pose would
have an offset applied but it was supposed to start exactly at the
landmark position.

Issue is that we applied the offset to cancel out the position offset
reported by the OpenXR runtime incorrectly. We only want to do that if
positional tracking is enabled, because if not we don't even apply the
runtime's position offset. So we'd cancel something out that wasn't
there.
2020-08-14 13:27:09 +02:00
cc6c52768a BLI: add reverse iterators, iterator constructor and Vector.insert/prepend
The new reverse iterators behave as the reverse iterators for contains from
the standard library. Have a look at the tests to see how to use them.
Using them will hopefully become easier with ranges in C++20.

A Vector can now be constructed from two iterators, which is very common
in the standard library.

New Vector.insert methods allow adding elements in the middle of a vector.
These methods should not be used often in practice, because they has a linear running time.

New Vector.prepend methods allow adding elements to the beginning of a vector.
These methods are O(n) as well.
2020-08-14 13:16:44 +02:00
2d65336408 Cleanup: C++ code style for Ghost-XR
* Avoid deep copy of vectors (technically more than a cleanup).
* Use `std::make_unique` for allocating unique pointers, rather than
  manual `new`.
* Use `std::optional` for optional by-value return values, rather than
  C-style `bool` to indicate success + return-argument.
* Use references rather than pointers for non-optional arguments.
* Avoid manual `new`/`delete`. Use `std::unique_ptr` for local scope
  bound lifetime.
* Use C++ `nullptr` rather than C's `NULL`.
* Remove unnecessary friend declaration.

These changes are generally considered good practise and move us more to
a "modern C++" style. We can still go much further of course.
See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.
2020-08-14 12:37:53 +02:00
1ff1b7fcea Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-14 11:38:54 +02:00
4c625df759 Fix: Increase Viewport Sculpt Options panel width
The "Delay Viewport Update" label was showing only:
"Delay Viewport U..."
2020-08-14 11:36:40 +02:00
24f7f33c25 Merge branch 'blender-v2.90-release' 2020-08-14 10:40:57 +02:00
a5cf71fa5d Fix (unreported) sculpt vertex color panel visible for all object types
Since DATA_PT_sculpt_vertex_colors has its own poll() we need to call
the poll() of MeshButtonsPanel as well

Differential Revision: https://developer.blender.org/D8563
2020-08-14 10:35:30 +02:00
d0c0a2e392 UI: Correct grammar in property name and description 2020-08-13 22:13:43 -04:00
cd179b5048 UI Code Quality: Use derived struct for color ramp buttons
The same changes as rB570044e9f412 and rB0ab21bf06ae0.
2020-08-13 22:00:50 -04:00
0ab21bf06a UI Code Quality: Use derived struct for curve mapping buttons
The same changes as in rB570044e9f412.
2020-08-13 21:33:47 -04:00
570044e9f4 UI Code Quality: Use derived struct for curve profile buttons
Continuing the work from rB49f088e2d093.

Differential Revision: https://developer.blender.org/D8561
2020-08-13 21:00:54 -04:00
275f1039d2 GPencil: Fix keymap error for Fill Boundary strokes
The key to enable it is `Alt`
2020-08-13 20:18:30 +02:00
ebf5ff8afb GPencil: Display Fill Boundary strokes with stroke color
This feature was removed during the refactor, but it's needed for this type of strokes to display the line using the stroke color without checking if the stroke is enabled or not in the material.

This color is used only for these special strokes.
2020-08-13 20:18:29 +02:00
e691a3a9b7 Deps_builder: Update openvdb to a dynamic library
This patch changes openvdb from a static to a dynamic library.
this is in preparation for enabling pyopenvdb at some point
in the future.

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

Reviewed by: brecht
2020-08-13 11:42:05 -06:00
aabbb515d6 UI: Use consistent geometry icon color
The grease pencil weight sculpt icon was using a slightly different
shade of blue than the other icons.
2020-08-13 12:13:21 -04:00
0664194497 UI: Simplify more geometry icons
Again, no visual changes, just removed internal vertices where they
were unecessary.
2020-08-13 12:09:20 -04:00
c5519d4b6f Fix T78065: OSL shader compilation fails on macOS 2020-08-13 17:53:48 +02:00
4ff414d40d Merge branch 'blender-v2.90-release' into master 2020-08-13 17:48:41 +02:00
9813778a2d Fix T79591: Liboverride: do not update overrides on missing linked data.
It makes no sense to generate/update overrides from missing (broken
linked) reference data, just keep existing ones unchanged then.
2020-08-13 17:41:33 +02:00
53683dec7d UI: Simplify geometry icons
Many of the icons had lots of interior geometry left over from
subdivision. In these cases we should remove the interior geometry
and leave the object with the modifier for the future.
2020-08-13 10:30:08 -04:00
52e7d0bebe Merge branch 'blender-v2.90-release' 2020-08-13 10:05:20 -04:00
4e103101f7 UI: Add sculpt cloth filter tool icon
This icon mimics the details of the cloth brush icon while using the
frame style extablished for the other "filter" tools.

Differential Revision: https://developer.blender.org/D8467
2020-08-13 10:04:48 -04:00
f66fc94da6 UI: Add sculpt cloth filter tool icon
This icon mimics the details of the cloth brush icon while using the
frame style extablished for the other "filter" tools.

Differential Revision: https://developer.blender.org/D8467
2020-08-13 10:03:44 -04:00
6fe609d4c3 Sequencer: Implement zoom-to-fit view mode
In this mode the preview image is always using the most of the preview
area space: it is scaled to fit, preserving aspect ratio. This makes it
possible to always have maximum of the preview region even after resize
of other areas.

This mode is enabled by default, is available in the View -> Zoom to Fit
menu. It is enabled when View All (Home key) is used, and is disabled
when manual navigation ([panning, zooming) is performed.

There is no versioning code, which means existing files will open as-is,
but new projects will have this option enabled.

Ref T78987

Maniphest Tasks: T78987

Differential Revision: https://developer.blender.org/D8549
2020-08-13 15:24:21 +02:00
0df28e8c20 View2D: Inform region type on current view changes
Allows to hook per-space code which is to be run on view navigation.
This is required to have zoom-to-fit implemented in the sequencer.

There might be more cases where the clalback is to be called from,
but it could be easier to address those on the case-by-case basis
when its needed.
2020-08-13 15:24:21 +02:00
c27123632b View2D: Centralize handling of changes to v2d->cur
Currently there are no functional changes, preparing code to add more
functionality which is to be run from navigation/zoom operators.
2020-08-13 15:24:21 +02:00
4f209fab2c Fix T79082: Softbody self-collision does not work on lattices
Reviewers: zeddb

Differential Revision: https://developer.blender.org/D8562
2020-08-13 14:41:44 +02:00
b89521de21 UVEdit: Fix drawing after recent refactor 2020-08-13 14:27:16 +02:00
a6447ca72d GPU: Fix MSVC warning 2020-08-13 14:20:24 +02:00
d52f28380b GPU: Fix issue with MDI and recent refactor 2020-08-13 14:20:24 +02:00
f349ea5508 GPUDrawList: Fix gl error with drawing without the correct VAO bound 2020-08-13 14:20:24 +02:00
985070b1ce GPUShader: Add more uniform functions 2020-08-13 14:20:24 +02:00
ac60a67b3f Cleanup: GPU: Remove Batch vao cache reset
This is done at drawtime automatically.
2020-08-13 14:20:24 +02:00
efc97b3919 GPUBatch: GL backend isolation
This changes the drawing paradigm a bit. The VAO configuration is done
JIT-style and depends on context active shader.

This is to allow more flexibility for implementations to do optimization
at lower level.

The vao cache is now its own class to isolate the concept. It is this
class that is reference by the GLContext for ownership of the containing
VAO ids.
2020-08-13 14:20:24 +02:00
47bfb0f7ad GPUBatch: Move allocator to backend 2020-08-13 14:20:24 +02:00
9443da6166 GPUBatch: Merge phase and ownership flags and cleanup there usage
Also add new flags to communicate specific behavior to future backend.
2020-08-13 14:20:24 +02:00
e0f5f95e66 DRW: InstanceData: Remove hacks of batch freeing callback
We instead use a handle reference counter on the GPUVertBufs used by
the instancing batches. This make sure that if an update happens on the
GPUVertBuf used to contruct the batch, they will never have the same
memory address than the previously allocated ones (since they are still
pending deletion thanks to the refcounter).

This avoid the linear search to update the GPUBatch in the case a
batch is deleted (which was even a bad option since they could be only
cleared)
2020-08-13 14:20:24 +02:00
157f2a20e6 GPU: Use GPU_vertbuf_create & GPU_indexbuf_calloc instead of manual alloc 2020-08-13 14:20:23 +02:00
00a3c297d2 GPUVertBuf: Add handle refcount
A handle refcount is here to avoid freeing of the GPUVertBuf datablock
if it is still referenced somewhere else.

This does not prevent deleting the actual data. This is to avoid too
much zombie data usage.

This is in order to avoid most hacks inside `draw_instance_data.c`.
2020-08-13 14:20:23 +02:00
93165cbf47 GPUBatch: Remove most use of GPU_batch_draw_advanced()
This is in order to better encapsulate / isolate the drawing code.
2020-08-13 14:20:23 +02:00
de4eb115ac Cleanup: GPUBatch: Remove GL functions from uniform assignment 2020-08-13 14:20:23 +02:00
b0f30bd684 Cleanup: GPUBatch: Move gpu_batch_private.h to CPP header 2020-08-13 14:20:23 +02:00
16b28ff974 Cleanup: GPUShader: Remove unused code 2020-08-13 14:20:23 +02:00
854c999d82 GPUShader: Change shader state tracking to be part of the GPUContext
This remove the use of batch->program and replace it with batch->shader.

This will allow GL abstraction latter.
2020-08-13 14:20:23 +02:00
186abf7d3b GPUBatch: Remove usage of gl_prim_type outside of GPU module 2020-08-13 14:20:23 +02:00
38ef35b1ed GPUDrawList: GL backend isolation 2020-08-13 14:20:23 +02:00
cb2565195e Fix T65148: Drivers can't access shape keys
It was impossible for drivers to use shape key properties, modifiers
generate a new mesh. After mesh evaluation the shape keys are no longer
necessary, and because of this the `key` pointer was not copied. As
drivers work on evaluated data, however, they do need this `key`
pointer.

This commit makes the `key` pointer available in evaluated meshes, but
this is somewhat dangerous. There was an explicit reason why the key on
result was kept at null pointer: to have the evaluated mesh in a
consistent state. Assigning this pointer makes it potentially
inconsistent, as the evaluated mesh and the original shape key may have
different topologies.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7785
2020-08-13 13:56:41 +02:00
46aa302400 Merge branch 'blender-v2.90-release' 2020-08-13 11:50:07 +02:00
ada98869df Preferences: correct property description for keyitem restore
Spotted while checking T79657.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8517
2020-08-13 11:44:57 +02:00
0843d5b024 Fix T79743: baking still uses cage object after removal 2020-08-13 11:30:56 +02:00
28c1300115 Fix T79653: Change soft min frame start of cache from 1 to 0
It was always possible to set it to zero by typing in the value.
This new soft limit is more consistent with the fluid cache
and the Scene.frame_start property.
2020-08-13 11:03:05 +02:00
7c380119a7 GPencil: Remove unused parameter and fix warning 2020-08-13 08:39:46 +02:00
29c28ac022 Cleanup: incorrect comment wrapping
Missed this comment when updating fix for T77409.
2020-08-13 16:38:01 +10:00
e84ffae7ba Cleanup: warnings 2020-08-13 16:23:43 +10:00
357547b010 Cleanup: spelling 2020-08-13 16:21:10 +10:00
608ec79bc3 Cleanup: clang-format 2020-08-13 16:01:38 +10:00
38b5f56dad Merge branch 'blender-v2.90-release' into master 2020-08-13 15:46:55 +10:00
f875d3e504 Merge branch 'blender-v2.90-release' into master 2020-08-13 15:46:46 +10:00
ad05e1100f Fix T77409: Crash showing vertex/face duplicators in edit-mode
This was a regression in deaff945d0 which skips copying a mesh.
Dupli-verts/faces were not updated to account for this.

This supports iterating over edit-mesh vertices & faces,
since falling back to a full copy (as we do in some places)
will be slow while transforming geometry.

This commit looks as if it would change behavior with orcos,
since any edit-mesh deformation causes them to be assigned.
However in practice there is no functional change, details in comments.
2020-08-13 15:41:57 +10:00
9bf8b6799d Cleanup: remove two sided face check
Two sided faces aren't supported and would cause many issues elsewhere.
2020-08-13 15:41:57 +10:00
ee909783de Cleanup: use 'inst_ob' variable name for consistency
Dupli verts/faces named these arguments differently.
2020-08-13 15:41:57 +10:00
494560f19d Cleanup: remove unused struct members from dupli-face/vert
Replace the evaluated mesh with VertexDupliData.mvert since only
vertices are used. This makes dupli-vert similar to how dupli-face
was already working.
2020-08-13 15:41:57 +10:00
a45f2fd1fb Cleanup: move mesh access for dupli vert/face into shared function
De-duplicate mesh access & comments.
2020-08-13 15:41:57 +10:00
12c24ecf6e Cleanup: pass normal as a float to dupli-vert function
Needed for supporting edit-mode dupli-verts.

Currently the un-scaled short values are used to avoid
changing behavior (noted in comments).
2020-08-13 15:41:57 +10:00
51a461dcab Cleanup: spelling, use full sentences for object_dupli.c 2020-08-13 15:41:52 +10:00
f0285e347e Cleanup: use const for dupli vert/face, 'r_' prefix for return value
Make it obvious which values are used read-only, which are written to.
2020-08-13 14:03:46 +10:00
536b6b6376 Merge branch 'blender-v2.90-release' 2020-08-12 21:04:19 -04:00
pembem22
bb2908472c UI: Fix curve widget fill artifacts
Disable antialiasing which caused artifacts.

Differential Revision: https://developer.blender.org/D8497
2020-08-12 21:02:05 -04:00
579cb774da Fix hair collision error introduced in recent commit 2020-08-12 18:40:48 -03:00
5319eb36a5 Cleanup: Silence some arithmetic overflow warnings 2020-08-12 18:25:45 -03:00
c5e469a3e4 Cleanup: Move definitions of some variables closer to their use 2020-08-12 18:25:45 -03:00
7d16db417b Cleanup: move assignment out of loop 2020-08-12 18:25:45 -03:00
6d9358d453 Cleanup: Rename variable 'cloth1' to 'cloth' 2020-08-12 18:25:45 -03:00
ca827e36ac Fix Boundary Brush symmetry with no constant falloff
When using constant falloff symmetry was working fine because the same
deformation is applied twice on the same vertices. When using no
constant falloffs, the deformation is different between symmetry passes,
so vertices need to be separated by symmetry areas to get the right
deformation from its symmetry pass without being overwriten by the next
one.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8541
2020-08-12 23:07:52 +02:00
1260baf16b GPencil: Remove unused variable and fix memory leak
This was missing in previous commit
2020-08-12 23:07:27 +02:00
c77bf95221 Sculpt: Boundary Brush Falloff Types and Offset
This adds the boundary_falloff_type and boundary_offset to control how the
falloff of the Boundary Brush is applied.

Boundary Origin Offset is the same concept as the Pose Origin offset in
the Pose Brush. It is a multiplier that adds extra length to the brush
radius to locate the deformation pivot further from the boundary without
affecting the falloff.

The Falloff type includes Constant (previous default), brush radius, loop
and loop and invert. Loop and Loop and Invert can be used to create
deformation patterns in a mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8526
2020-08-12 23:06:42 +02:00
db7cfd03b0 GPencil: Remove unused parameter in convert curve
The only_stroke parameter is not used
2020-08-12 22:48:19 +02:00
e188a798c6 GPencil: Clean material list when convert a curve
Now the list of materials is cleanup and any duplicated material is removed.
2020-08-12 22:48:14 +02:00
cd49c7b5ea GPencil: Move merge similar materials code to BKE
This is required in other places and need to be shared.
2020-08-12 22:48:10 +02:00
01636ed159 GPencil: Fix unreported problem in merge similar materials
When two similar colors were adjacent, the colors were not merged.
2020-08-12 22:48:06 +02:00
b126e38f6b GPencil: Fix unreported error in merge similar materials
When the color was black, the original value was not initialized and get a NaN value with unexpected results.

Also cleanup code.
2020-08-12 22:48:00 +02:00
3d247abb78 GPencil: Remove unused lines 2020-08-12 22:47:56 +02:00
145445c6b4 GPencil: Recode all material management when convert SVG 2020-08-12 22:47:51 +02:00
504c257dae GPencil: Add Sample parameter to Convert curve
This allows to resample the stroke to avoid too dense geometry.
2020-08-12 22:47:47 +02:00
9abdafe840 GPencil: Add parameters to scale thickness when convert Curves
This parameter allows to scale the thickness.
2020-08-12 22:47:43 +02:00
19cef4073d GPencil: Interpolate thickness when convert Curve to GPencil
The curve was using only the last point radius of the segment. Now, the value is interpolated between start and end points.
2020-08-12 22:47:38 +02:00
54b3168c4a Fix T77424 Overlay: Editmode: Issue with multi edit and in-front option
This is a nice addition to the refactor. Now any combination of in-front
/ not in-front will work in non x-ray edit mode.
2020-08-12 19:57:23 +02:00
f21cdf0d12 Clenaup: Deduplicate cloth collision code
And do the clamp by vertex instead of triangle.
2020-08-12 14:49:59 -03:00
633b0d6d25 Merge branch 'blender-v2.90-release' 2020-08-12 19:26:31 +02:00
ba2d1c8898 Fix T79738: Double Click does not opening folders in File Browser
If the File Browser was used in regular editor mode (e.g. not through an
operation like File > Open), the operator that usually opens files and
directories wouldn't execute. We need to keep two operators for
double-click in the keymap so selecting and opening works in all cases.

Caused by c606044157.
2020-08-12 19:26:04 +02:00
eee88f7cec Merge branch 'blender-v2.90-release' into master 2020-08-12 19:03:32 +02:00
b3165fb8b5 Fix (unreported) glitch when making liboverride of object from IDtemplate.
We need to ensure new override is instantiated in the scene...

Reported by @Severin, thanks.
2020-08-12 19:03:03 +02:00
337b6d0758 Cleanup: Use const for context 2020-08-12 12:59:19 -04:00
1da053956a UI: Category support for instanced panels
This adds support for panel categories to the instanced panel system
used for modifiers and others. The change is pulled from D7997 where
it is needed for FCurve modifiers, but it is unused now.

The change is simple and basically amounts to checking the panel
category where it was overlooked before.
2020-08-12 12:56:10 -04:00
6238eabcd4 Merge branch 'blender-v2.90-release' 2020-08-12 18:50:40 +02:00
54c2c14921 CMake: clarify that the modules are licensed BSD 3-Clause
Many of these are derived from similar modules in the CMake project, which
have this license.

Fixes T79715
2020-08-12 18:49:16 +02:00
655091297f Fix T79736: install_deps.sh failing to download OpenImageIO due to wrong version 2020-08-12 18:38:29 +02:00
478ea4c898 Sculpt: Multires Displacement Eraser Brush
This brush deletes displacement information of the Multires Modifier,
resetting the mesh to the subdivision limit surface.
This can be use to easily delete parts of the sculpt or to fix
reprojection artifacts after applying a shrinkwrap.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8543
2020-08-12 18:26:56 +02:00
6a95f05d65 deps_builder: Optionally build boost::python
This this adds the option of building boost::python
in the libs builder, in preparation for future
dependencies that require it (ie pyopenvdb)

disabled by default, can be enabled with the
`WITH_BOOST_PYTHON` cmake option.

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

Reviewed by: brecht
2020-08-12 10:17:38 -06:00
240ac779d5 Merge branch 'blender-v2.90-release'
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_motion_blur.c
2020-08-12 18:16:47 +02:00
58a457da3d Fix T79680, T79680: confusing viewport denoise start sample behavior 2020-08-12 18:10:50 +02:00
6f502136c7 Fix T79718: Eevee OpenVDB render error when frames miss part of the grids 2020-08-12 18:10:50 +02:00
77e40708c2 Sculpt: Expose Edit Face Set as a tool
Previously the way to use this operations was using the shortcut Ctrl +
W and Ctrl + Alt + W, which was not very discoverable and it was
limiting the amount of options that can be added to the operator.Now the
same functionality of the operator is available as a tool, which will
make easier to add other editing operations and options without adding
more entries to the keymap.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8545
2020-08-12 18:09:27 +02:00
bff91b32aa Fix T79706: Delta Transform Animation not working
The object "delta_" rna variables were not added to the depsgraph search
and thus it would not trigger updates of the object during animation
playback.
2020-08-12 18:09:00 +02:00
051f067fb8 Fix T79706: Delta Transform Animation not working
The object "delta_" rna variables were not added to the depsgraph search
and thus it would not trigger updates of the object during animation
playback.
2020-08-12 18:07:29 +02:00
2218b61e8e Fix T79637 Motion blur gives artifacts when changing the camera
DRW_render_set_time is calling RE_engine_frame_set will in turn calls
BKE_scene_camera_switch_update.

To workaround this, we get the original camera object at render init and
get the evaluated version from it after each time change.
2020-08-12 18:06:36 +02:00
879ed5a165 EEVEE: Motion Blur: Fix issue with batch overflowing with VBOs 2020-08-12 18:06:36 +02:00
bea79e0c7b EEVEE: Fix dupli recursion constant 2020-08-12 18:06:36 +02:00
1eab858dbc EEVEE: Rework deformation motion blur
This change how motion data are indexed inside the ghash.
We follow cycles closely now and use evaluated ID pointers.

By removing the hack, it fixes T78561 (No Motion Blur on linked objects)
2020-08-12 18:06:36 +02:00
2b042d885a EEVEE: Motion Blur: Use evaluated object as key to motion data
This fix issues with instanced geometry and modifiers. Since the
depsgraph will duplicate the objects when they have different modifiers,
the evaluated object are garanteed to be unique.
2020-08-12 18:06:36 +02:00
ff4b5d00e4 Cleanup: Remove explicit float casts in sculpt code
Differential Revision: https://developer.blender.org/D8553
2020-08-12 18:04:06 +02:00
010911d722 Clenaup: Rename random_access_init to random_access_ensure
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8529
2020-08-12 18:02:47 +02:00
9f288490d5 Subdiv CCG: Cleanup, remove redundant casts
If one of the operands of a binary operator a float, integer
operand gets promoted to float as well.

Differential Revision: https://developer.blender.org/D8552
2020-08-12 17:51:15 +02:00
697c449578 Cleanup: Use clamp_f instead of CLAMP in sculpt code
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8528
2020-08-12 17:49:55 +02:00
2476b31c71 Fix Sculpt Filters operator naming
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8523
2020-08-12 17:43:14 +02:00
1813a99447 UI: Fix typo "subdivion" -> subdivision
In the Multires panel, use singular Subdivision instead of Subdivisions.
2020-08-12 17:23:56 +02:00
841d779322 Increase hard limit for Remesher octree depth
Adding more precision to help making watertight objects to be printed.

Differential Revision: https://developer.blender.org/D8551
2020-08-12 17:05:04 +02:00
df12e6778a deps_builder: Fix python build on windows
Issue introduced in the boost.cmake cleanup in
rB5c563cd903ddceebfffbb1e86af2b406bbb2c457
2020-08-12 08:40:24 -06:00
b0dc413f4d deps_builder: Cleanup options.cmake for windows
We no longer build the thumbnail dll in the builder
and these variables are no longer used.
2020-08-12 08:26:42 -06:00
84076260da Merge branch 'blender-v2.90-release' into master 2020-08-12 16:25:18 +02:00
5c563cd903 deps_builder: Cleanup boost.cmake on windows
There were some remnants from previous boost::python support
and support for building 32 bit libs on windows, neither are
needed currently.
2020-08-12 08:21:37 -06:00
cfbea0e09d LibOverride and modifiers: Add copying of linked modifiers.
It also enables copying of linked modifiers (generating new local ones).
2020-08-12 16:16:37 +02:00
707c81cd11 Merge branch 'blender-v2.90-release' 2020-08-12 16:05:23 +02:00
21118fb610 Fix T79622: Mesh Filter on a locked Shape crashes
For a locked shapekey, a SculptSession's orig_cos / deform_cos /
deform_imats are not initialized (they only are when
deform_modifiers_active is true -- this in turn is only true for
shapekeys if they are //not// locked [and for deforming modifiers of
course])

We can just update that keyblock with sculpt_update_keyblock() in case
of a locked shapekey

Maniphest Tasks: T79622

Differential Revision: https://developer.blender.org/D8499
2020-08-12 15:53:22 +02:00
6ef58099d4 Merge branch 'blender-v2.90-release' 2020-08-12 15:34:18 +02:00
08286ef8ba Fix T79712: Color Changes do not record in Auto-Key Mode
Caused by rBfffba2b6530.

In above commit, the buttons rnaindex [-1 for entire arrays like colors]
was not used anymore for the entire function body of
`ED_autokeyframe_property` (previously in `ui_but_anim_autokey`).
Replacing the index with 0 (in the array case) is indeed necessary for
`BKE_fcurve_find_by_rna_context_ui`, prior to rBfffba2b6530 this was
taken care of by using `ui_but_get_fcurve` instead [which did this
internally].

But using an index of 0 (instead of -1) for the entire function body of
`ED_autokeyframe_property` fails for the array part later, namely
`insert_keyframe` needs -1 here.
Now just replace the index for //finding the FCurve//, but use the
original for //inserting the keyframe//.

Could be backported to 2.83 LTS.

Reviewers: campbellbarton, sybren

Subscribers:
2020-08-12 15:28:12 +02:00
d6570fcaed Cleanup: compiler warnings 2020-08-12 12:15:01 +02:00
1f8cb90828 Merge branch 'blender-v2.90-release' 2020-08-12 12:12:12 +02:00
Kévin Dietrich
9280fb19e4 Fixes T77882: artifacts rendering OpenVDB volumes with multiple grids in Cycles
The previous algorithm was not using all of the requested grids to build a mesh
around the volume due to limitations regarding the use of a dense buffer to
gather information about the volume's topology. This resulted in artefacts during
rendering.

The mesh generation is now done by merging all of the input grids and using the
resulting grid's topology to create the mesh. The generation of the mesh
is still done in index space as before, and the vertices are converted to object
space by using the merged topology grid indexToWorld transform.

To be able to merge the grids together we have to make sure that their transformation
matrices and their index spaces match, thus, if they do not match we simply resample
the grids. This behaviour should tackle one other limitation of the current algorithm,
which is that only one transformation matrix was used to generate the final mesh.

If we do not have an OpenVDB grid for the requested volume data, we generate
a temporary OpenVDB grid for it.

Differential Revision: https://developer.blender.org/D8401
2020-08-12 11:52:12 +02:00
da95fa8344 Fix UV unwrap not working with only one pinned vertex
Now the one vertex defines the position of the UV chart, while rotation and
shape is still determined automatically.

Initial patch by Willis (wlssirius).

Differential Revision: https://developer.blender.org/D8484
2020-08-12 11:52:09 +02:00
a1a81e3b88 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-12 11:47:59 +02:00
cbb1bb90fd Bump the minimum required version for 2.90
This is particular important because 2.90 will coexist with 2.83 LTS, so
we should warn the users of potential loss of data when going from 2.90
to 2.83 and back.

Differential Revision: https://developer.blender.org/D8488
2020-08-12 11:43:29 +02:00
05cb4cf26e Merge branch 'blender-v2.90-release' into master 2020-08-12 11:13:10 +02:00
d070d33aa3 Cleanup: Use proper bool type and literals for operators poll functions. 2020-08-12 11:11:48 +02:00
4e31b5b173 Fix (unreported) broken Poll function of GPencile mods and ShaderFX operators in liboverride case.
Those where assuming we always get a valid modifier data from context,
which is not always true...

Also  fix similar issue with shortcuts as reported in T79635.
2020-08-12 11:11:48 +02:00
b3702f5918 Fix part of T79635: Disable by default operation on unknown mod from liboverride object.
It is unfortunate that we cannot get active modifier from context when
operator is called from a shortcut, but we'd need an event for this to
work... So for now forbid any modifier operation of liboverride objects
in that case.
2020-08-12 11:11:48 +02:00
00a7113e61 Merge branch 'blender-v2.90-release' 2020-08-12 10:45:42 +02:00
9b58a41a92 Fix T79708: ShapeKey value greyed out
Mistake in rB0e9999a93edd.

Maniphest Tasks: T79708

Differential Revision: https://developer.blender.org/D8539
2020-08-12 10:35:06 +02:00
ec5f392087 Merge branch 'blender-v2.90-release' 2020-08-11 22:18:39 +02:00
2c7394acce Cleanup: Reduce indentation level
Check the simpler case first and return early.
2020-08-11 16:17:11 -04:00
90b8df8a99 Cleanup: Remove unecessary variables 2020-08-11 16:14:26 -04:00
dbf5bb7af2 Fix T79640: "Assign Shortcut" doesn't work for "View 2D Zoom"
'VIEW2D_OT' operators were not respected in WM_keymap_guess_opname().
This was seemingly done on purpose (see comment "Op types purposely
skipped  for now"), but dont really see the reason for doing so.

Since the "View2D" keymap is not bound to a specific spacetype, we can
still find it using WM_keymap_find_all() [and passing 0 as spacetype].

Reviewers: Severin

Subscribers:
2020-08-11 22:06:15 +02:00
18b1d1af95 Cleanup: Use sizeof first in allocations 2020-08-11 15:58:04 -04:00
185ed9980c Merge branch 'blender-v2.90-release' 2020-08-11 21:52:54 +02:00
3eebdf8a2d Cleanup: Reduce indentation level
Exit early if the bevel width is zero instead of putting
the main function in an if statement.
2020-08-11 15:51:24 -04:00
2fc2a0a56b Fix T79700: skin modifier: prevent error for vert-only mesh
Vert-only mesh is valid input for the skin modifier (displays isolated
cubes), prevent error message about missing root vertex in that case.

Maniphest Tasks: T79700

Differential Revision: https://developer.blender.org/D8533
2020-08-11 21:41:52 +02:00
29852cf320 Merge branch 'blender-v2.90-release' 2020-08-11 21:25:18 +02:00
aec0cfaf08 Fix T79676: Video Sequencer image sequence strip source path breaks when
saving with 'Remap Relative' option

Caused by rBf7386b97571e.

Logic in BKE_bpath_traverse_main calls the callback multiple times [as
often as there are images in the strip].

Prior to above commit, the callback was
'bpath_relative_convert_visit_cb' [this one did not have this problem -
since it returned early if the path was already made relative once]

After rBf7386b97571e though, the 'bpath_relative_rebase_visit_cb' is
used [this one should not be entered multiple times, it would modifiy the
directy again and again].

Luckily, we have a flag (BKE_BPATH_TRAVERSE_SKIP_MULTIFILE) that can be
used to prevent this (this will take care of only calling the callback
once in BKE_bpath_traverse_main for the VSE case)

Could be backported to 2.83 I think.

Maniphest Tasks: T79676

Differential Revision: https://developer.blender.org/D8536
2020-08-11 21:21:40 +02:00
7e9f47c06c Cleanup: Reduce scope of variable declarations in bmesh_bevel.c
This commit generally moves variable declarations to the smallest scope
the variables are used in. This makes the code more readable by
making it clearer when variables are used and by removing the block
of variable declarations at the top of each function.
2020-08-11 15:08:04 -04:00
b0485d47ef Cleanup: Resolve clang tidy warning / error 2020-08-11 14:58:01 -04:00
2b6d4325ac Merge branch 'blender-v2.90-release' 2020-08-11 20:07:20 +02:00
74556a5a17 Fix T79703 EEVEE: Crash on Macos due to lightcache baking 2020-08-11 20:07:03 +02:00
7219abc5bd Fix T79672 EEVEE: Motion blur steps value broken after recent change
Was just an issue of `taa_render_sample` being reset to 1 when it shouldn't.
2020-08-11 20:07:03 +02:00
cae4041878 Fix T79683: Dim GPencil points created by modifiers
This change makes the generated points a light dimmer than selectable points.

Before:

{F8765593}

After:
{F8765585}

Maniphest Tasks: T79683

Differential Revision: https://developer.blender.org/D8515
2020-08-11 19:13:15 +02:00
48c0a82f7a Sculpt: Option to not modify hidden Face Sets in Face Sets Edit
This options allows to perform Face Sets operations while preserving the
mesh visibility. Edit hidden face sets is enabled by default in order to
expand the visible area of the mesh with the grow/shrink operator, but
this can be changed in the keymap per edit operation as more operations
are supported.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8029
2020-08-11 19:04:37 +02:00
b95aa48156 Merge branch 'blender-v2.90-release' into master 2020-08-11 18:49:17 +02:00
d2c150772a Fix T79692: Full copy of scene makes Blender freeze if there is content directly in the master collection.
Old and new collections are the same data in Master collection case
here, so we cannot consider the `gobject` listbase of `collection_old`
as always immutable.
2020-08-11 18:46:47 +02:00
20ca7122f0 install_deps: update some libs, and various improvements/fixes.
This commits:
- Updates some libraries to latest officially supported versions:
** Numpy: 1.17.5
** OCIO: 1.1.1
** OIIO: 2.1.15
** OSL: 1.10.10
** OIDN: 1.2.1

- Re-enables some distro packages (like OSL, OIIO, OCIO...).

- Add missing 'CMake cleanup commands' for generated CMake update
  command, for Embree, OIDN and OpenXR.

- Generalizes using min/max versions of accepted libraries, if no
  package can be found in specified range then it is built from sources.

The later point should help keeping things a bit in better conditions,
although current maximal accepted versions are somewhat arbitrary guess
currently.
2020-08-11 18:11:45 +02:00
72b9d0de51 Cleanup some building errors with ClangTidy. 2020-08-11 18:11:45 +02:00
11509c14c3 Fix T75588: Missing loop cuts preview for edges without quads
The preview of points was only done when the edge is wire.

Now the preview of points is done when the edge is not connected to any
quad.

Also to avoid edge slide in this case, all new vertices created in this
specific case are not selected.

Differential Revision: https://developer.blender.org/D7457
2020-08-11 13:02:37 -03:00
304f0f56c5 Merge branch 'blender-v2.90-release' into master 2020-08-11 17:52:12 +02:00
c300a994b1 Merge branch 'blender-v2.90-release' 2020-08-11 17:00:50 +02:00
eca062b9cb Fix T79563: Compositor's Stabilize 2D in invert mode does not work correctly
Is not only the values of translation/scale/rotation which are to be inverted,
but also the order of operations.

Differential Revision: https://developer.blender.org/D8518
2020-08-11 17:00:30 +02:00
e84e6e12ed Fix T79616: Sort by column in filebrowser is broken
After changes in rBc606044157a3, mouse press events would be blocked by
the selection operator. This only worked by chance before.
2020-08-11 16:55:35 +02:00
a3af59f8e3 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-11 16:14:15 +02:00
1c294fb1fd Revert "Fix T77409: Crash showing vertex/face duplicators in edit-mode"
This reverts commit 9adedb2605. It changes
how duplis work, and by that altered how Alembic and USD files are
written. This was signalled by a failing Alembic unit test.
2020-08-11 16:12:44 +02:00
90baead979 GPencil: Split Primitive operators and add number of points to Topbar
Now the operators are split to define different default values. This is also required for the future Bezier primitive tools.

This allows to show in the Topbar the number of subdivisions. Before this value was totally hidden and it was number of Edges. The wheelmouse can be used to override the value while running, but does not change the default value.

{F8766270}

All operators share same code.

Also, fixed some bad practices done with Toolbar in python.

Reviewed By: mendio, pepeland

Differential Revision: https://developer.blender.org/D8506
2020-08-11 15:27:07 +02:00
344a6a4b80 Cleanup: rename variables 'gizmo_snap' to 'snap_gizmo'
And a minor fix when there is no `USE_SNAP_DETECT_FROM_KEYMAP_HACK`.
2020-08-11 10:08:43 -03:00
24c2c488e7 Merge branch 'blender-v2.90-release' into master 2020-08-11 21:48:51 +10:00
023151868f Merge branch 'blender-v2.90-release' into master 2020-08-11 21:48:46 +10:00
18c9f7ef72 Fix T79517: Data Transfer modifier fails in edit-mode 2020-08-11 21:48:02 +10:00
6b573d9877 Fix mesh data-transfer tracking if a change was made 2020-08-11 21:48:02 +10:00
d8d4c8b6cc Fix compile error after recent cleanup 2020-08-11 13:36:14 +02:00
e738d0ec6c Merge branch 'blender-v2.90-release' into master 2020-08-11 13:32:41 +02:00
e11aa3eddd Python: don't remove existing context overrides when calling an operator
Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D8532
2020-08-11 13:32:07 +02:00
6d888133da Timers: set first window as context in timer
This avoids some crashes when running Python code in timers.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8531
2020-08-11 13:24:52 +02:00
1b8778e314 Cleanup: Strict compiler flags
Mainly caused by moving tests to source folder, which brings
new compiler flags.

Also, no need to extend include directories (to the non-existing paths,
btw) since this is done by the CmakeList.txt which is in the blenlib folder.
2020-08-11 12:48:33 +02:00
aa4fb22cac Depsgraph: Use UUID to match modifiers
Solves possible pointer-based comparison fiasco.

Another nice outcome of this is that topology cache will now be
preserved throughout the undo system. For example, undo of object
transform will not require topology cache to be re-created.

Differential Revision: https://developer.blender.org/D8493
2020-08-11 12:17:22 +02:00
6f99dfc0c6 Modifier: Maintain per-modifier session UUID
Allows to keep track of modifiers, which is required, for example,
for runtime data preservation in depsgraph.
2020-08-11 12:17:13 +02:00
ca2c4907fb Fix path regression test build failure on Windows
The file was including BKE. It was a required fix for another
compilation error a while back. It is a bad level include, and
seems is not needed anymore.
2020-08-11 10:36:21 +02:00
15abd58b15 Merge branch 'blender-v2.90-release' into master 2020-08-11 17:11:22 +10:00
bb5cc3bccf Fix memory leak setting error text in the data-transfer modifier 2020-08-11 17:10:36 +10:00
90c6a38cbb Merge branch 'blender-v2.90-release' into master 2020-08-11 16:36:05 +10:00
77c4ed1d04 Merge branch 'blender-v2.90-release' into master 2020-08-11 16:34:50 +10:00
fb049a7976 Merge branch 'blender-v2.90-release' into master 2020-08-11 16:34:39 +10:00
9adedb2605 Fix T77409: Crash showing vertex/face duplicators in edit-mode
Support duplicators in edit-mode without creating a mesh copy.
2020-08-11 16:21:19 +10:00
23a6b5d91e BMesh: add UV calculate center call
Move uv_poly_center to BM_face_uv_calc_center_median as
it was only defined in uvedit_intern.h
2020-08-11 15:11:31 +10:00
fc5ff99770 Cleanup: use doxy sections for object_dupli.c 2020-08-11 14:57:20 +10:00
7f15120e9c Cleanup: GCC warning in guardedalloc_overflow_test 2020-08-11 13:22:59 +10:00
0c0f972e86 Cleanup: spelling 2020-08-11 13:19:09 +10:00
acd4687063 Merge branch 'blender-v2.90-release' 2020-08-10 23:16:25 +02:00
bc5d144855 Fix T77298: Can't bake texture with multiple objects
The problem here is that the baking code uses tiles to exchange pixel data with
the renderer since a recent-ish refactor, but the code that sent data to the
renderer did not initialize the bake result pixels.

Therefore, when the baking process for the second object started, Cycles
received empty tiles and sent them back as-is if the second object did not
cover them.

By initializing the tiles with the result of the previous bakes, we avoid this
problem.
2020-08-10 22:54:01 +02:00
784adccf47 Merge branch 'blender-v2.90-release' 2020-08-10 18:30:53 +02:00
8ef05d3180 Fix T79636: Inserting special characters with Ctrl+Alt broken on Windows
We can't exactly follow what we do for macOS here. On Windows special
characters can be inserted with Ctrl+Alt. So make sure we expect UTF-8
characters when Alt is held.

Mistake in 87062d4d67.
2020-08-10 18:29:02 +02:00
3b08cb3236 Cleanup: follow code style regarding braces 2020-08-10 18:18:59 +02:00
c521b69ffb BLI: improve StringRef for C++17
Since C++17 there is also std::string_view, which is similar to StringRef.
This commit does a couple of things:
* New implicit conversions between StringRef and std::string_view.
* Support std::string_view in blender::DefaultHash.
* Support most of the methods that std::string_view has.
* Add StringRef::not_found which can be used instead of -1 in some places.
* Improve/fix the description at the top of BLI_string_ref.hh.
2020-08-10 18:17:07 +02:00
53d203dea8 Tests: move remaining gtests into their own module folders
And make them part of the blender_test runner. The one exception is blenlib
performance tests, which we don't want to run by default. They remain in their
own executable.

Differential Revision: https://developer.blender.org/D8498
2020-08-10 18:14:00 +02:00
af77bf1f0f Sculpt: Option to mask front faces only using Lasso and Box Mask
This adds a property that checks the normals of each vertex against the
view direction to decide if they should be masked (similar to the
"Front Faces Only" option works for brushes.

Reviewed By: sergey

Maniphest Tasks: T77637

Differential Revision: https://developer.blender.org/D8448
2020-08-10 18:10:45 +02:00
ed9c0464ba Sculpt: Boundary Brush
This brush includes a set of deformation modes designed to deform and
control the shape of the mesh boundaries, which are really hard to do
with regular sculpt brushes (and even in edit mode). This is useful
for creating cloth assets and hard surface base meshes.

The brush detects the mesh boundary closest to the active vertex and
propagates the deformation using the brush falloff into the mesh.
It includes bend, expand, inflate, grab and twist deform modes.

The main use cases of this brush are the Bend and Expand deformation
modes, which depend on a grid topology to create the best results.
In order to do further adjustments and tweaks to the result of these
deformation modes, the brush also includes the Inflate, Grab and
Twist deformation modes, which do not depend that much on the topology.

Grab and Inflate are the same operation that is implemented in the
Grab and Inflate tools, they are also available in the boundary brush
as producing deformations with regular brushes in these areas is very
hard to control.

Even if this brush can produce deformations in triangle meshes and
meshes with a non-regular quad grid, the more regular and clean the
topology is, the better. Most of the assets this brush is intended to
deform are always created from a cylindrical or plane quad grid, so it
should be fine. Also, its algorithms can be improved in future versions
to handle more corner cases and topology patterns.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8356
2020-08-10 18:04:00 +02:00
71639cc862 Merge branch 'blender-v2.90-release' 2020-08-10 17:40:42 +02:00
9c093a5d9a Fix T79324: Crash when changing View Layer while VR session runs
Proper handling of View Layers for the VR session was never implemented.
Now the View Layer of the VR session follows the window the session was
started in.
Note that if this window is closed, we fallback to another window. This
is done to avoid the overhead it would take to maintain a separate
depsgraph for the VR view. Instead we always share some already visible
View Layer (and hence the depsgraph).
2020-08-10 17:39:36 +02:00
01537f7a9d Merge branch 'blender-v2.90-release' 2020-08-10 12:06:33 -03:00
c0340ec893 Fix T78113: Random explosions of cloth with self collision
The problem is caused by a lack of prediction in the `isect_line_segment_tri_v3`
that incorrectly confirms some intersections of coplanar segments to the triangle.

The solution is to use another algorithm to detect intersections.

This also resulted in a slight improvement in the performance:
- 1min 17sec to 1min 6sec in my test file

Differential Revision: https://developer.blender.org/D8500
2020-08-10 12:05:37 -03:00
1baba83bb0 GPencil: Fix warning text 2020-08-10 16:41:15 +02:00
4ada290956 GPencil: Invert Filled area pressing Ctrl key
This feature was suggested in https://blender.community/c/rightclickselect/rggbbc/

When press `Ctrl+LMB`, the filled area is inverted.

{F8749306}

{F8749307}

Filling several areas:

{F8759399}

Differential Revision: https://developer.blender.org/D8477
2020-08-10 16:34:26 +02:00
3fe2fceb4e GPencil: Change default Stroke thickness when convert curves
The thickness by default was using the old Draw Engine values and it was too thick in new engine.
2020-08-10 15:33:16 +02:00
3a3dc45e7b GPencil: Remove color conversion when convert curve
In previous versions, grease pencil used sRGB and a color conversion was needed, but now all is Linear and the conversion changes the color wrongly.
2020-08-10 15:33:09 +02:00
cfba3cb121 Merge branch 'blender-v2.90-release' into master 2020-08-10 14:35:22 +02:00
ab2dbafd8b Fix T77847: "Add plane > align" causes crash when certain rigs are in the scene (2.83, fixed in 2.90).
Root of the issue was not fixed in 2.90, only hidden by the fact that we
now re-read much less data during undo's that we used to, when some new
datablock gets added or removed.

This is not an ideal solution (as usual when dealing with data pointers
shared across data-blocks), but it's decent enough. thanks a lot to
@brecht for it!

To be backported to 2.83 too.
2020-08-10 14:34:55 +02:00
659f7f1981 Merge branch 'blender-v2.90-release' 2020-08-10 13:52:39 +02:00
2e5c877056 Fix pose offset on VR session start for some OpenXR runtimes
We want the session to start exactly at the landmark position, with
no additional offset. Some runtimes (e.g. Windows Mixed Reality) may
give an initial non-[0,0,0] position at session start though.

Also add a comment explaining the purpose of the eye offset variable.
2020-08-10 13:52:13 +02:00
f1cb3dfbaa Fix broken behavior on active VR Landmark change
There would always be an unintended offset applied. Per design there
should not be any offset when changing VR Landmarks, the view should
just jump exactly to the Landmark.

Due to the recent changes, we don't have to add, but substract the eye
offset we apply to get the wanted behavior.

Mistake in 607d745a79.
2020-08-10 13:51:43 +02:00
9c1f140a47 Fix pose offset on VR session start for some OpenXR runtimes
We want the session to start exactly at the landmark position, with
no additional offset. Some runtimes (e.g. Windows Mixed Reality) may
give an initial non-[0,0,0] position at session start though.

Also add a comment explaining the purpose of the eye offset variable.
2020-08-10 13:49:34 +02:00
727a744e3c Fix broken behavior on active VR Landmark change
There would always be an unintended offset applied. Per design there
should not be any offset when changing VR Landmarks, the view should
just jump exactly to the Landmark.

Due to the recent changes, we don't have to add, but substract the eye
offset we apply to get the wanted behavior.

Mistake in 607d745a79.
2020-08-10 13:40:11 +02:00
342a6b5f93 Fix T77685: object transforms from rigid body simulation are ignored by modifiers
This does not fix all the cases in the bug report, because there are multiple
different issues. Only the first two are fixed. The third is probably a known
issue for now.

Before this patch, the rigid body simulation was always done after modifiers
are evaluated, because to perform the simulation, the final geometry of the
object was required. However, the geometry is not required in all cases,
depending on the selected collisions shape.

This patch changes it so that when the simulation does not need the
evaluated geometry, the simulation will be done before the modifiers
are evaluated. This gives the modifiers access to the simulated positions.
When the rigid body simulation does depend on the evaluated geometry,
it will still be performed after modifiers are evaluated.

The simulation will be performed after modifiers are evaluated, iff
the collision shape is "Convex Hull" or "Mesh" and the source is set
to "Deform" or "Final".

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8487
2020-08-10 10:54:28 +02:00
52a57af3d5 Cleanup: use doxy sections for object_dupli.c 2020-08-10 18:30:47 +10:00
f15d33d585 Fix T79619: Sequencer window not updating whilst playing animation
Reverted Playhead optimizations for VSE. Needs more investigation to
detect which settings in the VSE would require a redraw of the area.
2020-08-10 09:28:18 +02:00
e2d5e8d584 Merge branch 'blender-v2.90-release' 2020-08-10 09:09:49 +02:00
6640ed92c0 Fix T79346: VSE custom proxy file is broken
In last set of refactoring patches, code implementing this feature
has been accidentally removed.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8449
2020-08-10 08:11:09 +02:00
Eitan
4fd73e7465 Remove Video Proxy Resolution limitation
Height and width of video proxies was limited to multiples of 8 with
comment "JPEG requires this".

I could not find any resource that would confirm this to be the case
with FFMPEG and MJPEG codec.

I have looked in:
https://ffmpeg.org/ffmpeg-all.html
https://ffmpeg.org/ffmpeg-formats.html
https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html

Reviewed By: ISS, sergey, sybren

Differential Revision: https://developer.blender.org/D6507
2020-08-10 07:54:51 +02:00
00162e6b7b Fix T79246 GPUShader: compile error on AWS Elastic Graphics 2020-08-09 14:07:00 +02:00
b522e834ec msvc: Fix build error with msvc 2017
`using blender;` Was required to get the Vector type.
2020-08-08 18:04:46 -06:00
a1d57e3f05 Cleanup: replace sizeof division with ARRAY_SIZE macro 2020-08-08 14:08:37 +10:00
171e77c3c2 Cleanup: use array syntax for sizeof with fixed values
Also order sizeof(..) first to promote other values to size_t.
2020-08-08 13:38:00 +10:00
4bf3ca2016 Cleanup: replace elem_strcmp with elem_streq
This is used for equality and didn't have the same behavior as strcmp.
2020-08-08 13:38:00 +10:00
61a045b7d3 Clenup: use STREQ macro 2020-08-08 13:38:00 +10:00
586a308467 Cleanup: remove redundant return parenthesis 2020-08-08 13:37:55 +10:00
f1b1a0745f Cleanup: GPU: Change gpu_context_private.h to C++ only header 2020-08-08 03:05:39 +02:00
f742a7ac79 DRW: Fix runtime error: shifting signed 32bits int 2020-08-08 01:46:51 +02:00
cb7ea2ccfb GPUBackend: Add new GPUBackend object to manage GL object allocations
This just set a global object responsible for allocating new objects
in a thread safe way without needing any GPUContext bound to this
thread.

This also introduce the GLContext which will contain all the GL related
functions for the current context.

# Conflicts:
#	source/blender/gpu/intern/gpu_context.cc
2020-08-08 01:30:33 +02:00
1dd7377596 GPUBackend: Add new GPUBackend object to manage GL object allocations
This just set a global object responsible for allocating new objects
in a thread safe way without needing any GPUContext bound to this
thread.

This also introduce the GLContext which will contain all the GL related
functions for the current context.
2020-08-08 01:16:40 +02:00
0ccf3f89d2 GPU: Move ghost default framebuffer getter to context creation 2020-08-08 01:15:28 +02:00
0255f1e022 GPUBatch: Use custom allocator
This is needed for the new GPU abstraction.
2020-08-08 01:15:27 +02:00
0063d1befc DRW: Instance Data: Replace GPUBatch bulk allocation by separate alloc
This is suboptimal but needed for the new GPU abstraction.

Maybe a better solution will be needed if performance is impacted.
2020-08-08 01:15:27 +02:00
994ab8985b Cleanup: Fix reported clang-tidy code-style issues.
This resolves `error: statement should be inside braces` in some
windows specific code that previously was unchecked by clang-tidy.
2020-08-07 14:53:42 -06:00
915cc956ba Cleanup: Rename soops to space_outliner
No functional changes. Rename soops, soutliner, and so to
space_outliner.
2020-08-07 11:49:58 -06:00
2597c12b0c Cleanup: Remove outliner statement with no effect
No functional changes. The memory dupalloc will already carry over the
flags.
2020-08-07 11:49:57 -06:00
dc5c616cca Cleanup: use _fn for outliner callback functions
No functional changes.
2020-08-07 11:49:57 -06:00
e3f369e13f Cleanup: fix some clang tidy warnings 2020-08-07 19:19:38 +02:00
c50e5fcc34 Cleanup: use C++ style casts in various places 2020-08-07 18:42:21 +02:00
28b1022434 Fix compile error with WITH_INPUT_NDOF after last own commit
Caused by dcff28e1e7.
2020-08-07 18:41:15 +02:00
ad6e63cb96 Cleanup: enable Clang-Tidy bugprone-parent-virtual-call rule
I added a single `NOLINT` exception with explanation.

No functional changes.
2020-08-07 17:59:26 +02:00
dcff28e1e7 UI Code Quality: Use derived struct for HSV Cube buttons
For the main rationale behind this design, see 49f088e2d0. Further,
this removes users of uiBut.a1, which is a very ugly design
choice (hard to reason about).

Part of T74432.
2020-08-07 17:46:58 +02:00
60b42ef117 Cleanup: enabled Clang-Tidy bugprone-suspicious-missing-comma rule
No functional changes because no code changed.
2020-08-07 17:46:32 +02:00
ca85da075b Cleanup: enabled Clang-Tidy bugprone-not-null-terminated-result rule
No functional changes because no code changed.
2020-08-07 17:38:45 +02:00
a9c91ce331 Cleanup: fixed Clang-Tidy bugprone-suspicious-string-compare warnings
No functional changes.
2020-08-07 17:16:49 +02:00
7309ee4df7 Merge branch 'blender-v2.90-release' 2020-08-07 17:12:00 +02:00
a93be410c9 Fix previous commit, we first need to be sure we actually get a mesh... 2020-08-07 17:11:21 +02:00
c4b1ef45a0 Merge branch 'blender-v2.90-release' 2020-08-07 17:08:44 +02:00
8fa42f0bd4 Fix T79604: Switching to edit mode on boolean object runs out of memory.
Note that this is a dummy safe fix for now, far from optimal.
2020-08-07 17:07:30 +02:00
be83b8f456 Cleanup: CMake warnings related to "find package" modules
Fix package name missmatch in a few module files. IE "ALEMBIC" was
defined in the file but the find_package commands used "Alembic"

Some modules state that they set and use the _LIBRARY variable but the
do in fact not do this. Removed these comments from those files.
2020-08-07 16:56:38 +02:00
4c2ce816aa Cleanup: enabled Clang-Tidy rule bugprone-infinite-loop
Enabling it and doing a full rebuild didn't cause any warnings, so nothing
else to do here.

No functional changes.
2020-08-07 16:46:26 +02:00
7aeab6f6aa Cleanup: added explanation of why incircleadapt is allowed to be long
This is a followup of d4bd0789ab, as it was
lacking a bit of an explanation.

No functional changes.
2020-08-07 16:38:28 +02:00
6414da0381 Cleanup: enable and silence Clang-Tidy readability-function-size
Enable Clang-Tidy's `readability-function-size` rule and add a few
`NOLINT` markers to explicitly silence warnings for three functions.
These functions are huge and would IMO benefit from splitting up, but
are hard to without intimate knowledge of the code.

At least by enabling the rule, we can start tweaking the values and
refactoring other functions that bubble up as being too long/complex.

No functional changes.
2020-08-07 16:23:17 +02:00
2a0bc4d23e Cleanup: Nodes, silence Clang-Tidy readability-function-size
Add a `NOLINT` marker to explicitly silence a warning from Clang-Tidy's
`readability-function-size` rule for the `node_type_base()` function.
This function is indeed huge, but that is because a lot of macros are
expanded. Before expansion things are still not small, but still
understandable & expandable.

No functional changes.
2020-08-07 16:23:02 +02:00
4ce298b3c0 Cleanup: Clang-Tidy. readability-non-const-parameter in pixel drawing 2020-08-07 16:13:11 +02:00
17dbdcc552 Fix T79571: "Assign Shortcut" doesn't work for "Clear Keyframes"
In the 3D View, the "Animation" keymap is not used, but the mode
specific ones. So the shortcut editing code should use these too, just
like the default keymap does.
2020-08-07 16:11:30 +02:00
d4bd0789ab Cleanup: Delaunay 2D, silence Clang-Tidy readability-function-size
This adds a `NOLINT` marker to explicitly silence a warning from
Clang-Tidy's `readability-function-size` rule for the `incircleadapt()`
function in `delaunay_2d.c`.

No functional changes.
2020-08-07 15:54:28 +02:00
b27a953798 Cleanup: Versioning: silence Clang-Tidy readability-function-size
This adds `NOLINT` markers to explicitly silence warnings from Clang-Tidy's
`readability-function-size` rule for versioning functions. Technically
these could be refactored and split up into smaller bits, but generally
they are hardly ever looked at once they're a few releases old.

No functional changes.
2020-08-07 15:54:28 +02:00
3090b52f8c Cleanup: PyBGL, Clang-Tidy readability-function-size fixes
This addresses warnings from Clang-Tidy's `readability-function-size`
rule in the `source/blender/python` module.

It's just `BPyInit_bgl()` that's been split up into one or two smaller
functions per OpenGL version.

No functional changes.
2020-08-07 15:54:28 +02:00
24d8ab1556 Merge branch 'blender-v2.90-release' 2020-08-07 15:50:42 +02:00
c2691c93d5 Fix T79201: Mantaflow: Fluid guides don't affect simulation.
This broke during the OpenVDB update for 2.90. Just making sure that guiding velocity files are being read correctly.
2020-08-07 15:33:51 +02:00
076a93b855 UI Code Quality: Use derived struct for progessbar buttons
For the main rationale behind this design, see 03b122e2a18df. Further,
this removes users of `uiBut.a1`, which is a very ugly design
choice (hard to reason about).

Part of T74432.
2020-08-07 15:17:52 +02:00
9f475db6c9 Fix failing assert when entering Texture Paint mode
Was unbinding the shader twice.
2020-08-07 15:17:52 +02:00
68c00e6f8f UI Code Quality: Use derived struct for color buttons
For the main rationale behind this design, see 03b122e2a18df. Further,
this removes users of `uiBut.a1`/`uiBut.a2`, which is a very ugly design
choice (hard to reason about).

Part of Part of T74432.
2020-08-07 15:17:52 +02:00
49f088e2d0 UI Code Quality: Use derived structs for search buttons and decorators
The current on-size-fits-all `uiBut` creates quite a mess, where it's
hard to reason about which members are free for use, under which
conditions they are used and how.
`uiBut` also has members that aren't used at times, violating the "don't
pay for what you don't use" principle.

To address this, we want to move to typed buttons, where `uiBut` is just
a base struct and each type extends it as needed. That structures data
better and type specific data is only available if it's actually used by
a button type.

Two trade-offs:
* Many casts to the derived type have to be done.
* Sometimes we change the button type after it's created. So I had to
  add logic to reallocate the button for use with the new, possibly
  derived struct. Ideally that wouldn't be needed, but for now that's
  what we have.

Part of T74432.

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

Reviewed by: Brecht Van Lommel, Campbell Barton
2020-08-07 15:17:52 +02:00
48e089375e Cleanup: pass arrays const where possible 2020-08-07 22:56:13 +10:00
b134434224 Cleanup: declare arrays arrays where possible 2020-08-07 22:37:39 +10:00
3db67fd670 Revert "Cleanup: Cycles, applied Clang-Format"
This reverts commit 88cc3f167f. It was
caused by running Clang-Format version 10, instead of 9 from the
precompiled libs directory.
2020-08-07 13:38:07 +02:00
c04088fed1 Cleanup: Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule. This should be the final commit of the series of commits that
addresses this particular rule.

No functional changes.
2020-08-07 13:38:07 +02:00
3d48d99647 Cleanup: Python, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.

No functional changes.
2020-08-07 13:38:07 +02:00
44b7354742 Cleanup: Nodes, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/nodes` module.

No functional changes.
2020-08-07 13:38:06 +02:00
47f8c444a4 Cleanup: Modifiers, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/modifiers` module.

No functional changes.
2020-08-07 13:38:06 +02:00
dee359e26e Cleanup: IO, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/io` module.

No functional changes.
2020-08-07 13:38:06 +02:00
dbf4f52fe0 Cleanup: ImBuf, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/imbuf` module.

No functional changes.
2020-08-07 13:38:06 +02:00
c889d93c80 Cleanup: GPU, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/gpu` module.

No functional changes.
2020-08-07 13:38:06 +02:00
326e137a8c Cleanup: Freestyle, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/freestyle` module.

No functional changes.
2020-08-07 13:38:06 +02:00
94eaaf097c Cleanup: Depsgraph, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/depsgraph` module.

No functional changes.
2020-08-07 13:38:06 +02:00
f453ee7d3a Cleanup: Compositor, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/compositor` module.

No functional changes.
2020-08-07 13:38:06 +02:00
fb18e48a84 Cleanup: Blenloader, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenloader` module.

No functional changes.
2020-08-07 13:38:06 +02:00
1b272a649b Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.

No functional changes.
2020-08-07 13:38:06 +02:00
cfc6f9eb18 Clang-Tidy: Address readability-redundant-string-init 2020-08-07 12:18:15 +02:00
156448ba4b Cleanup: Draw, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/draw` module. Not all warnings are addressed
in this commit.

No functional changes.
2020-08-07 12:01:40 +02:00
88cc3f167f Cleanup: Cycles, applied Clang-Format
No functional changes.
2020-08-07 12:01:40 +02:00
4ba9d7d71e Fix fast clicks on File Browser sort columns not changing sorting
Clicking on the column header is supposed to enable sorting by this
column, or switch the sort order if already enabled.
The double-click event would be blocked by the `file.execute()`
operator, which is not supposed to act if the user clicked outside the
file list.
2020-08-07 11:39:04 +02:00
5809dc6b5b Fix T79616: Sort by column in filebrowser is broken
After changes in rBc606044157a3, mouse press events would be blocked by
the selection operator. This only worked by chance before.
2020-08-07 11:39:04 +02:00
a29686eeb3 Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.

No functional changes.
2020-08-07 11:23:02 +02:00
e0c51b466f Merge branch 'blender-v2.90-release' into master 2020-08-07 10:23:33 +02:00
1b1129f82a Code Style: use "#pragma once" in intern/ghost
More information can be found in D8466.
2020-08-07 10:18:01 +02:00
8198dbb888 Code Style: use "#pragma once" in some newer headers
Those were missing from the previous commit, because these headers
only exist in the `master` and not in the `blender-v2.90-release` branch.
2020-08-07 10:10:37 +02:00
af88cc0701 Cleanup: make format 2020-08-07 10:07:36 +02:00
7283e6fb73 Merge branch 'blender-v2.90-release' into master 2020-08-07 10:04:57 +02:00
91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
21fec95139 Merge branch 'blender-v2.90-release' 2020-08-07 01:23:20 +02:00
58909abc68 EEVEE: Render: Fix regression caused by previous Motion blur fix
Caused by rB4f59e4bddcb0c06e441adf68a5f252a4e5b4b260
2020-08-07 00:59:14 +02:00
6e226275fd Merge branch 'blender-v2.90-release' 2020-08-06 23:06:33 +02:00
4f59e4bddc Fix T78452 EEVEE: Motion Blur: Crash when using camera switching
This was caused by the ViewLayer being freed with all its
engine data.
2020-08-06 23:06:18 +02:00
3dcaca93a0 Fix T78160 EEVEE: Motion Blur: Bug with Follow Path animation
Follow path seems to not be catched by `BKE_object_moves_in_time`.
For this reason, we cache all transforms for all object and check
ourselves if an animation occurs. This is almost what cycles does.

We also fix the rigid body case if the rigid body use deformation.
2020-08-06 23:06:18 +02:00
9a1ff4445b Merge branch 'blender-v2.90-release' 2020-08-06 19:52:49 +02:00
3d35012a05 GPencil: Fix unreported wrong Polyline bottom tooltip
It was mising the Wheelmouse option and the name of the tool was wrong.
2020-08-06 19:52:30 +02:00
6f87a7ad9f GPencil: Fix unreported wrong Polyline bottom tooltip
It was mising the Wheelmouse option and the name of the tool was wrong.
2020-08-06 19:44:41 +02:00
8123b12006 Fix T79586: "rendering paused" not shown when viewport render starts paused 2020-08-06 19:19:22 +02:00
Vincent Blankfield
8fbfc150a0 Fix T77885: crash rendering grease pencil from compositor with multiple scenes 2020-08-06 19:19:22 +02:00
8719ac990f Merge branch 'blender-v2.90-release' 2020-08-06 19:15:35 +02:00
cc3cb52b23 Fix Pose Brush FK mode detecting wrong rotation origin
The Pose FK mode assings the rotation origin to the boundary of the last
visited face set in the floodfill operation. In some cases, the topology
of the model may make the flood fill operation to visit a face set as the
first one (assinging it to target) and visit it again as the last one
(assinging it to origin). This will make the pose brush to default the
origin and target to the brush location and not to the face sets as it
considers that there is only one possible boundary.
This adds a GSet to ensure that a particular face set is not visited
twice in the flood fill, fixing these cases.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7984
2020-08-06 19:14:39 +02:00
d693d77fed Sculpt: Cloth Brush simulation area property
This makes possible to choose between a local and a global simulation
when the cloth brush is used. Local simulation is the current default.
When global simulation is enabled, the cloth brush simulates the entire
mesh without taking any simulation limits into account.

This was possible before by setting the simulation limits to 10 (the
current maximum value allowed) so the entire mesh was inside the limits,
but this was a hack as the limits scale with the radius and there should
not be any limitation on how big the simulated area can be to be able to
simulate an entire object. This also allows to make a more clear
distinction between cloth brush presets that are intended to be used in
local areas to add details or globally to generate the base shape of the
mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8481
2020-08-06 18:03:56 +02:00
97c56b7628 Merge branch 'blender-v2.90-release' 2020-08-06 17:29:28 +02:00
96e460ed9b GPencil: Patch old files after the change in how the first frame is used
This patching duplicates the first frame of the layer if the first frame number is not equals to the scene first frame number.

Related to T79567

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

Some minor cleanup in the patch.
2020-08-06 17:28:59 +02:00
5f51438185 Cleanup: Paint Cursor Refactor
The paint_draw_cursor function was handling the cursor drawing for 2D
and 3D views of all paint modes, calculating the brush radius, updating
the SculptSession data and updating and drawing all sculpt cursor
overlays for different tools. It was almost impossible to understand when
and what was being drawn and in which state the GPU matrix was.

Now everyting is organized into different functions, with clear
separation between modes, sculpt tool overlays and different drawing
setups. Update and drawing functions are also separated (this allows to
skip one PBVH query on each cursor drawing).

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8206
2020-08-06 17:27:57 +02:00
56af04d31f Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-06 16:44:21 +02:00
bc8168f4a2 Cleanup: Remove bad level calls from space image
Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
45e6ca3661 Cleanup: Stop accessing gpu_batch_presets_reset()
The current code is accessing this from outside the gpu "namespace". As
such it should be accessing GPU_ functions, not gpu_ functions.

This is also a place to centralize the XXX message that will be
addressed upon refactor. So we can reuse this call in other places that
need the same temporary workaround.

Groundwork for upcoming fix (D8472)
2020-08-06 16:44:03 +02:00
5e6119ddca Cycles: load OpenVDB file earlier in Blender export
In an upcoming bugfix we'll use OpenVDB data structures directly to build mesh
for sparse OpenVDB volumes, loading them OpenVDB grids earlier and removing any
references to Blender data structures makes that easier.

This also makes changes to Blender volumes to support this, so Cycles can take
ownership of a grid without Blender having to keep its own reference to it.
This should also be useful in a future Python API.

Ref D8401
2020-08-06 15:13:05 +02:00
9696239762 Merge branch 'blender-v2.90-release' 2020-08-06 15:05:00 +02:00
77d71cc113 Move CDData debug print helper from DM to CustomData 'namespace'/files. 2020-08-06 15:03:49 +02:00
86f586636d Merge branch 'blender-v2.90-release' into master 2020-08-06 22:58:48 +10:00
30d3d4fbc1 Merge branch 'blender-v2.90-release' into master 2020-08-06 22:58:44 +10:00
Yevgeny Makarov
91be94d465 UI: Fixes and small improvements to some labels and UI messages
Small tweaks to make labels and texts more correct, consistent and
polished.

Reviewed by: Aaron Carlisle, Julian Eisel

Differential Revision: https://developer.blender.org/D8346
2020-08-06 14:50:45 +02:00
e4f400f0d6 Cleanup: undeclared warnings 2020-08-06 22:50:38 +10:00
ba20da7214 Cleanup: avoid debug-only includes for BLI_assert.h
Having includes in debug builds makes it possible to accidentally
break release builds.

Avoid this by moving calls to other modules out of BLI_assert.h
into BLI_assert.c
2020-08-06 22:49:28 +10:00
cb1096163a Merge branch 'blender-v2.90-release' 2020-08-06 14:15:19 +02:00
73a43c9d8a Fix buffer-overflow when drawing Curve Guide objects
Was passing an array of length 3 to `where_on_path()` that expected
length 4.
2020-08-06 14:14:55 +02:00
cb294c3a01 Fix buffer-overflow when drawing Curve Guide objects
Was passing an array of length 3 to `where_on_path()` that expected
length 4.
2020-08-06 14:12:23 +02:00
Matias Herrero
8f34bf5ebb UI: Name force fields using the type of force by default
When adding multiple force fields of different types they are all called
"Field", making it difficult to tell them apart.
Lights were already named based on their type. This follows the light
code.

New names:
  - Force
  - Vortex
  - Magnet
  - Wind
  - Guide
  - TextureField
  - Harmonic
  - Charge
  - Lennard-Jones
  - Boid
  - Turbulence
  - Drag
  - Fluid
  - Field

Reviewed by: Julian Eisel

Differential Revision: https://developer.blender.org/D8420
2020-08-06 14:09:10 +02:00
690d61cf78 Merge branch 'blender-v2.90-release' 2020-08-06 13:39:09 +02:00
574bd866c8 Fix T78520 EEVEE: No viewport update when changing material nodetree
This was comming from rBd82c3d86155ea3c7831c7b5ef5d07bc8e2d99394
2020-08-06 13:37:41 +02:00
c4e606e386 Merge branch 'blender-v2.90-release' 2020-08-06 13:35:06 +02:00
Red Mser
b313710c10 Fix padding when multi-editing aligned widgets
Similar to T58668, labels were not aligned when multi-editing widgets
that are not center-aligned.

Reviewed by: Hans Goudey, Julian Eisel

Differential Revision: https://developer.blender.org/D8441
2020-08-06 13:34:40 +02:00
2d95a23aa6 Merge branch 'blender-v2.90-release' into master 2020-08-06 12:55:49 +02:00
769ec7ffe6 Fix T79408: ungroup operation update animation data incorrectly
Reviewers: sybren, sergey

Differential Revision: https://developer.blender.org/D8464
2020-08-06 12:50:08 +02:00
95fb3dc5ca Depsgraph: refactor dot exporter to use utility library from blenlib
Reviewers: sybren, sergey

Differential Revision: https://developer.blender.org/D8473
2020-08-06 12:40:37 +02:00
Yevgeny Makarov
b2e0c8f902 UI: Reduce item padding in the edit mesh context menus
Align items in the edit mesh context menus (reducing padding), for
consistency with other menus.
The root layout of menus doesn't add the padding, for sub-layouts
`align` has to be enabled.

{F8749633}

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D8480
2020-08-06 12:33:28 +02:00
d71cb229d0 Fix T79484: Crash when viewing Movie Clip as a Background Image in a Camera
This seems to be caused by a change to the logic of movieclip_get_gputexture_ptr in rB97b597c.

Differential Revision: https://developer.blender.org/D8469
2020-08-06 11:52:59 +02:00
3439cbcc69 Merge branch 'blender-v2.90-release' into master 2020-08-06 19:20:32 +10:00
82150f5641 Workaround release builds failing
Issue caused by e9c4325515.
2020-08-06 19:19:25 +10:00
8a8c3e0972 Merge branch 'blender-v2.90-release' into master 2020-08-06 19:01:07 +10:00
c872e87bd4 Fix T79309: Safe Areas are not visible 2020-08-06 18:59:20 +10:00
6158f56f52 Merge branch 'blender-v2.90-release' into master 2020-08-06 17:19:01 +10:00
d4804f00fb Fix T79575: Crash loading nested set-scenes 2020-08-06 17:15:20 +10:00
14dc1aecf0 Merge branch 'blender-v2.90-release' into master 2020-08-06 15:48:42 +10:00
Daniel Bailey
e9c4325515 Python: include Python stack trace in the crash log
This helps Python developers troubleshoot errors when
Python causes a crash.
2020-08-06 15:44:00 +10:00
c86fed79d5 Cleanup: use doxy sections for py_capi_utils.c 2020-08-06 13:51:28 +10:00
85ddba475b Cleanup: no need for plural for term 'collision' 2020-08-06 09:38:25 +10:00
675700d948 Sculpt: Cloth Brush/Filter Collisions
This implements collisions in the solver of the cloth brush/filter. It
uses the scene colliders as a regular physics simulation.

There are still some parameters (friction, distance to the surface...)
that can be exposed as properties in later patches.

Thanks to Sebastian Parborg for helping me with the implementation.

Reviewed By: sergey, zeddb

Differential Revision: https://developer.blender.org/D8019
2020-08-06 00:29:22 +02:00
8c98684e22 Merge branch 'blender-v2.90-release' 2020-08-05 17:38:48 -04:00
c5b6b3d82f Fix T78698: Move cursor stuck after removing modifier
The panels are rebuilt when a modifier is removed so the button handlers need
to properly finish. By adding a context argument to the panel_delete function
this will happen properly.
2020-08-05 17:36:16 -04:00
3570173d0f Sculpt: Sharpen Mesh Filter curvature smoothing and intensify details
This adds a curvature smoothing and intensify details properties to control
the result of the Sharpen Mesh Filter.

Curvature smoothing removes high frequency details from the precalculated
sharpen data, so the filter result has much smoother surfaces and cleaner
sharpen lines;

Intensify details displaces the vertices of creases and valleys in the direction
opposite to its neighbors average, so it intensifies high frequency details
in those areas, producing more noisy and sharp shapes:

Both this properties can be used in combination to achieve a good balance of
high and low frequency details depending on the shape and the desired result.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8447
2020-08-05 23:16:42 +02:00
ad3838e1e0 Fix Squash and Stretch naming in the Pose Brush deform mode
Previusly it was using the / character, which implies that there is one
deformation mode and and invert deformation mode like in the other two
deformation, but squash and stretch is only one deformation mode and
does not have an invert mode.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8463
2020-08-05 23:00:38 +02:00
9ea77f5232 Sculpt: Option to lock the rotation in the Pose Brush scale deform mode
The scale deform mode includes rotation by default, so when when scaling
down a part of the models it becomes harder to control as the effect of
the rotation less predictable (similar to using trackball rotation in a
very small radius). This locks the rotation of the segment, so parts of
the model can be scaled down in a more predictable way.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8465
2020-08-05 22:59:27 +02:00
3474b0968a Merge branch 'blender-v2.90-release' 2020-08-05 22:29:40 +02:00
59861db763 Fix T77517 EEVEE: Collection Holdout doesn't work in 2.90
The default material was missing its init code.
2020-08-05 22:29:21 +02:00
29ef7142dd EEVEE: Fix previous commit
Small mistake in rB5249a813f22f

Now for fix it real!
2020-08-05 22:18:26 +02:00
2b7d39c3f1 Merge branch 'blender-v2.90-release' 2020-08-05 22:13:15 +02:00
5249a813f2 Fix T78954 EEVEE: Motion Blur: Bug with hair particles on linked objects
The cache key for particle system was the original Object data. But this
is incorrect for particle systems as modifiers are not shared.
2020-08-05 22:12:53 +02:00
492235903d Merge branch 'blender-v2.90-release' 2020-08-05 21:58:03 +02:00
315ae005c3 Fix file name sometimes not visible immediately after renaming
Steps to reproduce were:
* Open File Browser
* Create a new directory
* Cancel renaming with Esc

File selection flags were modified during drawing when the rename button
got removed, but the file name label drawing wasn't checking the
modified state.
2020-08-05 21:57:51 +02:00
f41eb8b2a9 Merge branch 'blender-v2.90-release' 2020-08-05 21:34:15 +02:00
c606044157 Fix double-click not opening directories on some touch-pads
The file.execute() operator is the one that actually opened directories
and files, not file.select() with the "open" option, as it was assumed
when changing the keymap to double-click for opening. It only acts on
the current selection though, so we have to ensure the selection is set
on the first click.
Now, some touch-pads have a delay until they register a click event, so
the double-click would be registered instead, before the selection is
set. Always select on mouse-down now and remove the unnecessary select
operator call on double-click.
2020-08-05 21:34:00 +02:00
82343037f5 Merge branch 'blender-v2.90-release' 2020-08-05 15:48:29 -03:00
Deep Majumder
c323f3e90a Fix T77548: Crash when using Add Object Tool with Normal Orientation and zero objects in scene
The crash is caused by the fact that a NULL Object pointer is passed to
calculate the transform orientation, which has been set to normal.

A check has been include to detect the same.

Differential Revision: https://developer.blender.org/D7951
2020-08-05 15:45:46 -03:00
7aec56204b Merge branch 'blender-v2.90-release' 2020-08-05 20:33:40 +02:00
f3e724b93d Fix T79370 EEVEE: Texture paint does not update during stroke
Was caused by rBd82c3d86155e
2020-08-05 20:33:24 +02:00
854f73b4a2 Fix T78592: Shear operator fails to affect curve control point handles
Use `td->iloc` as the coordinates of the transformed element.

It is more accurate and other transformation modes, such as scale, also
operate on `td->iloc`.
2020-08-05 15:06:23 -03:00
d9b72a96b3 Merge branch 'blender-v2.90-release' 2020-08-05 19:41:04 +02:00
1b593edf1d Fix T78907: Renaming file doesn't work while mouse is over file icon
The icons are label buttons. Usually these are not editable and can not
become active. These are draggable ones though (so dragging files can be
dragged by dragging the icon) which creates an exception to this rule.
So hovering the icon would activate its label and when executing the
rename operator via shortcut it wouldn't get exited properly. This broke
the invariant of only allowing a single active button at a time.
Added an assert to check that invariant now.

Letting the code to activate the text button ensure any currently active
button is exited seems sensible.
2020-08-05 19:40:40 +02:00
38e9a349de Workbench: Fix broken id pass 2020-08-05 19:37:41 +02:00
cf3431e0e8 Fix T79509 Workbench: Object color mode broken if more than 4096 objects
This was due to the new DRWShadingGroup not being saved and reused for
the next objects.
2020-08-05 19:37:41 +02:00
93f4f96818 Merge branch 'blender-v2.90-release' 2020-08-05 20:21:08 +03:00
a316d3b6c6 Eevee: do not rely on the SOCK_HIDE_VALUE flag for node group sockets.
When disconnecting links for defaulted node group inputs, recurse
into the nested node group nodes, instead of checking the socket
flag. Otherwise the behavior is confusing and differs from Cycles.

Differential Revision: https://developer.blender.org/D8455
2020-08-05 20:20:48 +03:00
9118df1ecd Merge branch 'blender-v2.90-release' into master 2020-08-05 10:46:12 -06:00
d84dce85f3 Fix T72297: disabled buttons toggling on drag
Disabled buttons would incorrectly toggle state when a drag toggle
passed over them. This adds a check to prevent a drag toggle on disabled
buttons.

Differential Revision: https://developer.blender.org/D8476
2020-08-05 10:42:43 -06:00
9e644b98a6 GPencil: Reorganize Advanced Brush panel
The Ignore Transparent Strokes and the Factor are related, so it's better disable factor if the checkbox is disabled.
2020-08-05 18:25:58 +02:00
e03d53874d Fix T79127: crash on scene.ray_cast() with non-viewport view layer
The `rna_Scene_ray_cast()` function tried to find the current depsgraph. To
this end, it required the scene, the view layer, and bmain. Scene has a cache
of per-view-layer depsgraphs, to speed up switching between view layers. This
cache does not contain render depsgraphs, and evaluated view layers also don't
have a depsgraph here.

When a suitable depsgraph cannot be found, a new depsgraph is created. However,
this depsgraph is not evaluated, and has an unexpanded scene pointer with a
`NULL` `view_layer`. Using this then crashes Blender. Also, there was no way
for the code to get the render depsgraph.

The solution is to pass the depsgraph to the `ray_cast()` function, instead of
the view layer. This avoids the depsgraph lookup, and also works correctly when
rendering.

Some add-ons also need updating, which I'll do in the `addons`
repository soon.

Reviewed By: Sergey

Differential Revision: https://developer.blender.org/D8475
2020-08-05 18:14:06 +02:00
fff12be945 GPencil: Rename Default Fill Boundary option to All 2020-08-05 18:00:34 +02:00
927b1e9fa2 Merge branch 'blender-v2.90-release' 2020-08-05 17:51:41 +02:00
531a3f6c4e Sculpt: Use vertices instead of faces to limit the grids in each PBVH node
This uses the vertices per grid instead of quads to set the limit of
grids per PBVH Node. This should create more leaf nodes in lower
subdivisions levels where the duplicates count is high, producing more
uniform performance across different levels.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8454
2020-08-05 17:50:28 +02:00
8fc7c3539a GPencil: Add Fill option to determine the layers used for boundary strokes
This is a patch suggested in https://blender.community/c/rightclickselect/qggbbc/

The valid values are:

* Visible Layers.
* Active Layer.
* Layer Above active.
* Layer Below active.
* All layers Above active.
* All layers Below active.

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

Some minor UI changes done in the original patch.
2020-08-05 17:46:34 +02:00
f3acfc97d9 Functions: fix multi function test
There were two issues. First, I made a mistake when I switched from unsigned
to signed integers. Second, two classes with the same name were defined in
separate files. Those classes are in an anonymus namespace now, so that they
don't leak into other files.
2020-08-05 17:19:02 +02:00
b3d35d2039 Fix Cycles + grease pencil render failing after recent GPU refactoring
GPU_texture_update_sub now requires the texture to be bound already.
2020-08-05 17:17:21 +02:00
055af3a489 Merge branch 'blender-v2.90-release' 2020-08-05 16:56:59 +02:00
adfde60831 Fix T79524: Button alignment broken in some cases
ad4928a171 disabled alignment for too many cases. Still try to avoid
aligning many items, to avoid thousands of redundant alignment
calculations. But now we're much more picky adding an sub-row with
alignment.
2020-08-05 16:56:24 +02:00
2ca006f6c1 Merge branch 'blender-v2.90-release' 2020-08-05 15:59:04 +02:00
87062d4d67 Fix T78412: Ctrl+Spacebar does not maximize Python console on Windows
On windows, spacebar would be passed as UTF-8 text input, despite the
control key being pressed. On macOS, there already was an explicit
exception for this (command key in this case), on Linux XInput already
handled this case for us.
Note that Alt should still allow text input, for special character
sequences.

Issue also happened in the Text Editor if a text data-block was set.
2020-08-05 15:50:58 +02:00
ee351cb74d Fix T78869: denoising performance regression on Windows
Optimization was disabled in this function to work around a bug in MSVC, use
a different solution that does not come with such a big performance regression.
2020-08-05 15:46:44 +02:00
Jeroen Bakker
f7d38e2e64 Fix T77346: GPU Workaround Always Render Using Main Context
In Blender 2.90 EEVEE materials were refactored that introduced crashes on Intel
GPUs on Windows. The crash happened in the `local_context_workaround` that temporary
stored compiled materials in a binary form to reload it in the main GL context.

It has been tested that the workaround isn't needed anymore for HD6xx GPUs, but it
is still needed for HD4000.

After several unsuccesfull fixes we came to the conclusion that we could not support
the local context workaround and needed to come with a different workaround. The idea
of this patch is that in these cases there is only a single context that is used for
rendering. Threads that uses these contextes are guarded by a mutex and will block.

Impact on User Level:
* Due to main mutex lock the UI freezes when rendering or baking or feel less snappy

Reviewed By: Clément Foucault, Brecht van Lommel

Differential Revision: https://developer.blender.org/D8410
2020-08-05 15:45:42 +02:00
43d41675a4 Merge branch 'blender-v2.90-release' 2020-08-05 15:39:08 +02:00
56d7e39b92 Fix T79520: Data Transfer modifier: crash/assert going into editmode on a source object. 2020-08-05 15:36:24 +02:00
40ad989059 BLI: improve dot exporter interface 2020-08-05 15:30:22 +02:00
754a663f68 Cleanup: remove some private fields that are currently unused 2020-08-05 14:59:06 +02:00
c961bf8975 GPUTexture: Fix missing break 2020-08-05 14:17:34 +02:00
42f4233871 Merge branch 'blender-v2.90-release' 2020-08-05 14:10:08 +02:00
229fe01a15 PyDoc: use glClearColor before glClear in gpu docs
ref T79491

Maniphest Tasks: T79491

Differential Revision: https://developer.blender.org/D8471
2020-08-05 14:09:00 +02:00
1cf5c5085e Merge branch 'blender-v2.90-release' into master 2020-08-05 14:04:11 +02:00
f9aba4f6e1 Fix T79374: Render audio produces random clipping
Port of the bugfix from audaspace upstream.
2020-08-05 14:02:59 +02:00
396abbbfe7 Audaspace: port documentation bugfix from upstream. 2020-08-05 14:02:59 +02:00
a6b0a2356a Merge branch 'blender-v2.90-release' 2020-08-05 13:06:11 +02:00
f96afde3bd Fix T79544: No sound in video sequencer preview.
Directly caused by rB2bb73787791a, but actual issue was a pre-exiting
typo that never caused problems so far apparently...
2020-08-05 13:05:51 +02:00
2c5c39d53c Merge branch 'blender-v2.90-release' 2020-08-05 13:00:15 +02:00
02ccc37144 Correct recent fix for Cycles motion blur test
Need to only compare directory name, not the whole path.
2020-08-05 12:59:28 +02:00
85e11ca7fb Fix possible fall-through after recent change 2020-08-05 12:25:12 +02:00
e4a4dc5309 BLI: add dot::Edge.set_label method
This method sets the label of an edge in a dot graph.
2020-08-05 12:22:45 +02:00
fc9f7e3e51 Merge branch 'blender-v2.90-release' 2020-08-05 12:19:28 +02:00
c3113724ed Fix T78630: Custom icons not grayed out in inactive layouts
For regular icons this worked because they used the text color, which
was already grayed out by the caller.
2020-08-05 12:19:14 +02:00
ec9ab00fcb Fix failing USD test on macOS after becoming part of blender test runner 2020-08-05 12:15:17 +02:00
de53178b26 Fix T78777: Cycles motion blur test differences between AVX/AVX2
This appears to be slight precision differences in the Embree implementation,
simply increase the diff threshold a little for these motion blur tests.
2020-08-05 11:45:31 +02:00
7088422283 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:28 +10:00
3562978c35 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:25 +10:00
79cb0105cd Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:23 +10:00
8e5a4e3645 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:20 +10:00
db907ea888 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:17 +10:00
baf015be31 Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:14 +10:00
05fbbfec0b Merge branch 'blender-v2.90-release' into master 2020-08-05 16:48:03 +10:00
4a289081a5 Keymap: add back Shift-K to cut-through selected faces
Resolves T78540
2020-08-05 16:24:26 +10:00
ef7b804e26 Cleanup: missing 'initialize' -> 'init' from previous cleanup 2020-08-05 11:56:14 +10:00
006698167b Cleanup: spelling 2020-08-05 11:49:31 +10:00
7198e9d10e Fix unreported crash in gpu_free_unused_buffers
As far as I can see, this problem was introduced with the gpu_free_unused_buffers() changes in rB97b597c.

The code checks the returned pointer to stop looping, but the last iteration will return the last GPUTexture and set the queue to NULL, meaning that the next pop() will crash.

Differential Revision: https://developer.blender.org/D8468
2020-08-05 02:35:23 +02:00
fce71a255c EEVEE: LightCache: Add warning if the cache cannot be saved 2020-08-05 02:26:44 +02:00
6390b530d0 Fix T78529: Blend file corrupted during save caused by high Cubemap Size
This just avoid the corruption. A better fix still need to be finished.

See P1564
2020-08-05 02:26:44 +02:00
6be8b6af40 EEVEE: LightCache: Prevent crash when using a lightcache too big
Some implementation have different maximum texture size.
This patch avoid crash when texture allocation fails when:
- trying to bake a lightcache too big for the OpenGL imeplementaion.
- loading a cache from file that is too big for the OpenGL imeplementation.
2020-08-05 02:26:44 +02:00
d1b3da697d GPUTexture: Check PROXY textures for cubemap types
It can happen than some textures are not supported on some implementation
even if they fix the `GPU_max_texture_size` and `GPU_max_texture_layers`.
2020-08-05 02:26:44 +02:00
de947c5c50 GPUTexture: Improve debug print 2020-08-05 02:26:44 +02:00
3a522f7a7f Fix T79213 EEVEE: rendering with motion blur can change current frame
It seems to be expected that the render engine reset to the right CFRA
if it modifies it.
2020-08-05 02:26:44 +02:00
1ccb997c6d Fix T79497: Crash when removing strips with prefetching
This was already fixed by 0471349c90 but accidentally removed in refactor.
2020-08-05 01:40:02 +02:00
deb76548c1 Merge branch 'blender-v2.90-release' 2020-08-04 23:34:55 +02:00
3ebe97c06b Fix T78665: Face Set visibility reverted when chaning Multires Levels
Face Sets where only set and updated on the PBVH after starting a sculpt
tool. In order to preserve the visibility they store when changing
levels, they need to be updated and sync also on PBVH creation

Reviewed By: sergey

Maniphest Tasks: T78665

Differential Revision: https://developer.blender.org/D8225
2020-08-04 23:33:51 +02:00
50e6d56e4e Fix missing duplicates in the subdiv_ccg neighbors function
Duplicates of a grid corner adjacent to an edge which are on the
adjacent grid of the same face were not added when requested.

Needed for D8356 to work, it may also fix some other bug in Multires.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8385
2020-08-04 23:21:12 +02:00
bf65820782 Sculpt: Cloth brush Pin Simulation Boundary property
The cloth brush has a defined simulated area with a falloff. In the falloff
area (the area between the dashed white circle and the exterior white
circle), simulation properties change in order to fade out the
simulation deformation effects towards the boundary.
With some brushes and stroke types (like anchored strokes with pinching
or grabbing with full strength), it is possible to apply more force than
what the boundary falloff can compensate, so the simulation breaks when
this happens.
This option pins the falloff area with softbody constraints, This
produces a much better deformation falloff and it is no longer possible
to move the vertices near the simulation boundary, so the simulation
won't break no matter the strength of the forces applied inside the
simulated areas.
This is an option as it is particularly useful for some brushes to add
localized details, but for brushes that are supposed to deform the
entire mesh (like the grab brush in D8424), this can add unwanted
softbody constraints that affect the simulation result.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8435
2020-08-04 23:06:14 +02:00
6faa765af8 Sculpt: Split Box Mask into its own operator
Box mask is not a selection, so it should not be part of the select
operator. This allows to add more sculpt mode specific functionality and
properties and to share more code with the lasso mask operator in a
later refactor.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8456
2020-08-04 22:52:20 +02:00
1ae9960a15 Merge branch 'blender-v2.90-release' into master 2020-08-04 12:15:14 -06:00
304767dcd3 Fix T78688: Crash changing workspace with specific fullscreen setup
When switching workspaces we need to have an unused screen layout that
we can activate. The other window now showed the only available screen
layout in fullscreen though.
Usually when there's no unused screen layout we duplicate an existing
one, but that code didn't respect the fullscreen case properly.

This also tries to clean up the logic a bit, but things are still rather
complicated to follow.

Changes in this code are always risky. Of course things worked fine in
my tests, but I wouldn't be surprised if something breaks.
2020-08-04 20:12:07 +02:00
97be726f93 Fix T74796: Outliner child objects hidden when collections are filtered
Filtering Collections when also filtering object children would only
display the parent object. Add a check for the NO_CHILDREN filter before
creating the object-parent hierarchy.
2020-08-04 12:05:05 -06:00
e4370eccdf Fix T71488: Flipping Custom Split Normal Data leads to artifacts
The winding order of the faces changes when flipping the faces.
This lead to the loop indices changing as well.

Now we take this into account when restoring and flipping the custom
normals. Before the normals would be swapped.
2020-08-04 19:43:34 +02:00
0d3b5a5068 Fix T71488: Flipping Custom Split Normal Data leads to artifacts
The winding order of the faces changes when flipping the faces.
This lead to the loop indices changing as well.

Now we take this into account when restoring and flipping the custom
normals. Before the normals would be swapped.
2020-08-04 19:32:24 +02:00
205cf0500d Fluid: Minor cleanup in addition to fix for TT72192
Make curly brackets consistent.
2020-08-04 18:20:49 +02:00
df28a68e70 Fix T72192: Mantaflow does not render flame when flow source is hidden from Renders
The problem in this case was that the flag for active fire was not set. With hidden flow sources the flag was not updated in update_flowsflags().

The solution for this is to take the active field from the config cache file.
2020-08-04 18:09:17 +02:00
f2ac432467 Cleanup: Bevel: Split two case for loop into separate function
Previously a for loop with two iterations was used to calculate the
3D segment locations for the input number and the higher power of 2.
Splitting off the inside of the for loop to a separate function makes
the code more readable.

This commit also includes a simple timer for bevel, enabled with a
define. Interestingly, the cleanup in this commit happended to give
a 3% speedup on a Ryzen 3700x for a bevel calculation with 64
segments.
2020-08-04 11:43:42 -04:00
e818f1274b Fix T78932: fix linking reroute nodes of different type
Reviewers: mano-wii

Differential Revision: https://developer.blender.org/D8460
2020-08-04 17:36:50 +02:00
93d8373edb Merge branch 'blender-v2.90-release' 2020-08-04 17:14:06 +02:00
a4a814a180 Fix buildbot macOS packaging error after recent changes 2020-08-04 17:13:09 +02:00
f130cd1169 Point Clouds: basic support for instancing objects on points
Same exact system as instancing on vertices for a mesh. More powerful ways
of instancing will be added at some later point, but this makes the basics
works and is consistent with other geometry types.
2020-08-04 17:11:00 +02:00
89baafc8e2 Merge branch 'blender-v2.90-release' 2020-08-04 16:57:50 +02:00
9538e38704 Fix buildbot packaging error after recent changes 2020-08-04 16:54:18 +02:00
21c31885ed Merge branch 'blender-v2.90-release' 2020-08-04 16:39:03 +02:00
b1976d131c Fix broken Alembic tests following motion blur commit
The tests were broken because of an extra call to
RNA_def_struct_name_property which set the name of the velocity
attribute to be the string used to identify CacheFiles in
bpy.data.cachefiles.
2020-08-04 16:10:51 +02:00
7bad5e0d18 Cleanup: clang-format after recent cleanup commit
Remember to run `make format` after any massive cleanup please.

This "issue" introduced on 901ee66ea1.
2020-08-04 16:01:26 +02:00
16c7b6a7fe Buildbot: make code signing of packages optional with --codesign parameter
This is in preparation of doing builds per commit that will not be code signed.

Ref D8438

Differential Revision: https://developer.blender.org/D8451
2020-08-04 15:44:41 +02:00
0e87a35f8e Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-04 15:37:49 +02:00
e8483f9bd7 Fix T78758 Alembic export: crash when file is in use by another application
In cases when the output file cannot be opened, an exception is thrown that
was not caught.
2020-08-04 15:23:43 +02:00
f5919a7ad1 Merge branch 'blender-v2.90-release' 2020-08-04 15:05:39 +02:00
e1a10b5e53 Fix T79234: Material preview does not update
When changing the material while the properties editor temporarily isn't
visible (e.g. because another editor is in full-screen or a different
workspace is active), the preview wouldn't be updated on changes.

Always trigger a material preview update on screen layout or editor type
changes.
2020-08-04 15:05:24 +02:00
5270462953 Fix T79234: Material preview does not update
When changing the material while the properties editor temporarily isn't
visible (e.g. because another editor is in full-screen or a different
workspace is active), the preview wouldn't be updated on changes.

Always trigger a material preview update on screen layout or editor type
changes.
2020-08-04 14:55:55 +02:00
675fa2ee13 Refactor: rename SpaceType->new to SpaceType->create
The data member `new` was conflicting with the `new` keyword
when `BKE_screen.h` was included in C++ files.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8459
2020-08-04 14:40:15 +02:00
7fbbe71922 Depsgraph: Fix wrong forward declarations 2020-08-04 14:25:13 +02:00
5f621a12c6 Merge branch 'blender-v2.90-release'
Conflicts:
	source/blender/editors/gpencil/gpencil_primitive.c
2020-08-04 13:36:58 +02:00
ca606bf551 Merge branch 'blender-v2.90-release' into master 2020-08-04 21:28:21 +10:00
701a9d3917 Cleanup: typos & co in UI messages (and some other places). 2020-08-04 13:26:58 +02:00
0dff6b2b4b Cleanup: unused main argument 2020-08-04 21:25:28 +10:00
164f40c50a Fix T79503: Selecting edit-bones while holding Ctrl crashes 2020-08-04 21:23:53 +10:00
d6762bedee Merge branch 'blender-v2.90-release' 2020-08-04 12:59:20 +02:00
f921ae4665 Fix T79453: Motion Tracking: marker does not remember 'enabled' state
Caused by rB63ee3db96107.

While above commit corrected the clip offset, it also removed logic to
ensure a marker on a particular frame. This is needed though, otherwise
changes on a particular frame are applied to the marker being returned
by 'BKE_tracking_marker_get' which can be a completely different marker
if none exist for that frame yet.

This patch partly reverts rB63ee3db96107 and reintroduces the framenr
for the MarkerUpdateCb and uses that to ensure a marker on that frame.

Candidate for backporting to 2.83 LTS?

Reviewers: sergey, jacqueslucke

Subscribers:
2020-08-04 12:52:40 +02:00
a9e0aeaf65 Fix crash switching render slots when there is only one slot 2020-08-04 20:11:57 +10:00
778f0aca52 Merge branch 'blender-v2.90-release' 2020-08-04 12:08:09 +02:00
03c2439d96 Fluid: Do not show fluid if frame is out of cache range
Before: If the current frame is out of the cache start/end range, the viewport will show the fluid as it was on the last frame that was still in the cache frame range.

Now: If the current frame is out of the cache start/end range, the viewport will show no fluid at all (even if there are cache files present for this frame).

This fix is related / in response to T79423.
2020-08-04 11:45:05 +02:00
8d3b8bc835 Depsgraph: Use UUID to identify pose channels
Fixes possible fiasco caused by re-allocation re-using pointers between
pose channels.

Differential Revision: https://developer.blender.org/D8453
2020-08-04 11:40:09 +02:00
52c2f296bc Pose channel: Add session UUID
Allows to identify pose channels more reliably than by the pointer.
2020-08-04 11:40:09 +02:00
51af20b856 Cycles: Fix nan in decomposed transform for degenerated input
The decomposed transform would have consists of nan values if the input
transform had zero scale.

Now the decomposition will check for zero scale, and if it is detected
then the result will be ensured to be finite. Additionally, rotation
value will be copied from previous/next time step to help avoiding
obscure interpolation.

The latter step can become more comprehensive than the current simple
implementation.

Differential Revision: https://developer.blender.org/D8450
2020-08-04 11:40:09 +02:00
7f6530e5bd Cycles: Add finite checks for float4 and transforms
Currently unused, preparing for an upcoming development.
2020-08-04 11:40:09 +02:00
b38c04aebe Cleanup: fixed unused parameter warning
No functional changes.
2020-08-04 11:36:28 +02:00
3642cbb1d2 Cleanup: converted Depsgraph Building Pipeline to object-oriented code
This will make it easier & cleaner to make custom-built depsgraph (for
example for exporting invisible objects to USD or Alembic, see T75936).

No functional changes.

Reviewed by: sergey

Differential Revision: https://developer.blender.org/D8423
2020-08-04 11:36:24 +02:00
15ad4f6f1f Merge branch 'blender-v2.90-release' 2020-08-04 11:57:09 +03:00
9306037ed3 Node Groups: expose the SOCK_HIDE_VALUE flag for node group inputs.
This flag specifies that even when the socket is not connected,
the node should not display the input field for the constant input
value. This is useful for inputs like Normal, which have special
handling for the missing input case and don't use a constant value.
Currently there is no way to change this flag from Python, and
through UI it can only be done by re-creating the socket.

This patch exposes the flag through RNA and UI, makes sure it
is properly updated when changed, and adds special handling to
ensure that it is correctly set when creating a node group from
a node set that includes reroute nodes.

Differential Revision: https://developer.blender.org/D8395
2020-08-04 11:29:16 +03:00
b016e7f258 Node Groups: fix placement of the Output node when creating a group.
Instead of assuming the node width, compute the actual right bound.
Otherwise BSDF nodes tend to be too wide, and intersect Output.

Differential Revision: https://developer.blender.org/D8395
2020-08-04 11:29:01 +03:00
f5eae90277 Fix T79493: EEVEE LightProbe Display
Introduced by recent EEVEE GLSL refactoring {da741013a1e1}
2020-08-04 10:09:31 +02:00
105ed22b95 Merge branch 'blender-v2.90-release' into master 2020-08-04 15:35:03 +10:00
c1386795a9 Modifier: bypass mesh conversion for hooks in edit-mode
Avoid the conversion for the hook modifier as riggers
may need to enable this modifier in edit-mode.

The speedup of the modifier alone is significant since the hook
operation is simple compared to conversion that took over 99.9%
of the time in my tests, however the overall speedup was around to 1.6x.
2020-08-04 15:34:04 +10:00
6791b88d28 Merge branch 'blender-v2.90-release' 2020-08-03 18:28:59 -04:00
9de5adc6a1 Fix: Remove debug print added mistakenly
This print whenever units are evaluated in number input was added in
45dbc38a8b mistakenly.
2020-08-03 18:28:39 -04:00
4b99df20d5 Merge branch 'blender-v2.90-release' 2020-08-03 18:18:02 -04:00
fbc3c1b24d Fix (unreported): Bevel tool custom profile uses wrong segments number
The bevel code initialized the CurveProfile with the "higher power of 2"
segments after the normal number of segments, leaving the widget in an
incorrect state after the calculation. A simple fix is to re-order the
initializations, doing the input number second.
2020-08-03 18:12:24 -04:00
862d79fffc Cleanup: Reduce indentation in function 2020-08-03 17:40:07 -04:00
452b896f2d Ocean Modifier: Fix render resolution only used for baking
The modifier needs to check that the cached ocean has the correct
resolution.
2020-08-03 15:33:32 -04:00
b5c737469d Cleanup: Avoid double operator name lookup 2020-08-03 14:00:14 -04:00
Adrian Newton
8356012068 UI: Change Header Position Label 'Default' to 'Keep Existing'
'Default' actually means 'Keep Existing' and it makes more sense to
display the more descriptive label.

Differential Revision: https://developer.blender.org/D7614
2020-08-03 12:37:48 -04:00
10590b0500 Fix missing shortcut indicators and crash on shortcut change
Fixes T78346.

The shortcut display and change code is context sensitive. To make it
work correctly the context needs to be set properly.
When executing operators from the dropdowns, the active region is the
header, but the shortcut handlers are set for the main region. So make
sure that is used instead.

This also sets the main region active for context menu operators, where
this issue shouldn't be present. Doing it anyway shouldn't hurt though
and fixes this issue in case somebody displays the context menu in the
header as dropdown too.
2020-08-03 18:26:06 +02:00
e9bcf09819 Cleanup: Typos in comments. 2020-08-03 17:42:45 +02:00
3593dff147 Fix T79374: Render audio produces random clipping
Port of the bugfix from audaspace upstream.
2020-08-03 17:42:36 +02:00
d66009f179 Fluid: Adjustments to force component reset
Instead of clearing forces at the end of the simulation step, they will now be cleared before writing to them, i.e. at the beginning of a step.

Also cleaned up minor areas that I looked at while making this change.
2020-08-03 17:39:56 +02:00
f24920790d Merge branch 'blender-v2.90-release' 2020-08-03 16:24:34 +02:00
473d9507fa Fix T78536: Crash calling object.modifier_apply on an empty
Caused by rB6add0cc88a0d.

Maniphest Tasks: T78536

Differential Revision: https://developer.blender.org/D8440
2020-08-03 16:20:46 +02:00
Phil Stopford
a44299ccd1 Ocean Modifier: Add viewport resolution
Following work done in 2.83, the resolution control is now a real
level-of-detail parameter. It is now useful to be able to set the
resolution for display independently from render. This is true for
both mesh generation and mesh deformation modes.

For compatibility with old scenes, resolution is retained and is the
render resolution. Old modifiers loaded have the value of resolution
also applied to viewport resolution. This allows newer modifiers to
be used in older versions without trouble

Differential Revision: https://developer.blender.org/D8336
2020-08-03 10:08:31 -04:00
30b52b6a4a Merge branch 'blender-v2.90-release' 2020-08-03 15:15:54 +02:00
2bb7378779 Fix T79222: Assert due to multiple building of same scene sequencer in depsgraph.
Just check and skip building if it has already been done before.

Thanks to @sergey for the help.
2020-08-03 15:11:05 +02:00
92f6f6d30e Audaspace: port documentation bugfix from upstream. 2020-08-03 14:21:54 +02:00
61eec61adb Merge branch 'blender-v2.90-release' into master 2020-08-03 21:14:49 +10:00
3f94f47113 Fix T79482: Triangulate quads with 'Beauty' can make zero area faces 2020-08-03 21:12:46 +10:00
1c4a695d70 Merge branch 'blender-v2.90-release' 2020-08-03 13:01:21 +02:00
14b77b37cb Fix T78428: Checkbox labels don't highlight on mouse-over in popovers
The text colors set by the general widget state function
(`widget_state()`) would always be overriden by the menu-back text
colors to avoid contrast issues. This would only respect the selected
state, not other states.

Address this now by changing the input theme colors to use the menu-back
ones, rather than overriding after the fact (calling `widget_state()`).
2020-08-03 13:00:53 +02:00
3c9cb62d82 Merge branch 'blender-v2.90-release' 2020-08-03 12:40:06 +02:00
33e6562a8a Fix T78266: Mantaflow: changing flow type (fire -> fire + smoke) resets Surface Emission
Changing the surface distance through the flow type is inappropriate here. It had been added to ensure that liquids / smoke use a different emission value.

Now the value will only be changed when changing from a gas to a liquid emitter or, vice-versa, when changing from a liquid to a gas emitter.
2020-08-03 12:38:07 +02:00
db5915d863 Merge branch 'blender-v2.90-release' 2020-08-03 12:36:52 +02:00
nutti
b5e3451540 Fix parameters in bpy.props.StringProperty Python API docs
There is a parameter typo in Python API document about bpy.props.StringProperty.
This patch fixes this.

Also this patch should apply to 2.90 branch as well.

Reviewed By: Grische, mont29

Differential Revision: https://developer.blender.org/D8430
2020-08-03 12:35:54 +02:00
633e9cef8c Merge branch 'blender-v2.90-release' 2020-08-03 12:11:52 +02:00
057f3f2f3d Fix T78575: Assert when using UILayout.prop_tabs_enum
Code required the tabs to be placed in an aligned region. Code should
work fine even for unaligned regions though, so I don't see a reason to
forbid this.
2020-08-03 11:57:20 +02:00
e17befe368 Install_deps: add libgmp as default dependency.
This is a common system library, no need for fancy building this time...

Part of D8384.
2020-08-03 10:44:07 +02:00
977f89ef2d Merge branch 'blender-v2.90-release' 2020-08-03 10:30:59 +02:00
fe70605a2a Building: Add ceres to Ninja's heavy jobs pool.
Some files in this library require more than 1.5Gb to build, so they
also belong to the 'heavy' pool.
2020-08-03 10:30:33 +02:00
040d7872e8 Merge branch 'blender-v2.90-release' into master 2020-08-03 18:03:49 +10:00
8f22feefbc Fix T79440: Deform modifiers fail in edit-mode when not first
Lattice, armature & curve only worked when an edit-mesh was passed in,
the mesh argument was being ignored.

Regression in 9f5833798c
2020-08-03 18:01:34 +10:00
144f780c71 Cleanup: remove unused code, update comments 2020-08-03 15:14:08 +10:00
83d6290800 Cleanup: remove trailing space, newlines at eof 2020-08-03 15:14:02 +10:00
21f150cc90 Merge branch 'blender-v2.90-release' into master 2020-08-03 15:13:52 +10:00
d406edf1ee Mesh: correct negative material indices when validating
Fixes corrupt mesh from T79451.
2020-08-03 14:48:16 +10:00
b5dcf74636 Cycles: add support for rendering deformation motion blur from Alembic caches.
This patch adds the ability to render motion blur from Alembic caches.
The motion blur data is derived from a velocity attribute whose name has
to be defined by the user through the MeshSequenceCache modifier, with a
default value of ".velocities", which is the standard name in Alembic
for the velocity property, although other software may ignore it and
write velocity with their own naming convention (e.g. "v" in Houdini).

Furthermore, a property was added to define how the velocity vectors
are interpreted with regard to time : frame or second. "Frame"
means that the velocity is already scaled by the time step and we do not
need to modify it for it to look proper. "Second" means that the unit
the velocity was measured in is in seconds and so has to be scaled by
some time step computed here as being the time between two frames (1 /
FPS, which would be typical for a simulation). This appears to be
common, and is the default behavior.

Another property was added to control the scale of the velocity to
further modify the look of the motion blur.

Reviewed By: brecht, sybren

Differential Revision: https://developer.blender.org/D2388
2020-08-03 03:44:40 +02:00
396d0b5cd0 Particles: new Age Reached Event, Kill Particle and Random Float node
The hardcoded age limit is now gone. The behavior can be implemented
with an Age Reached Event and Kill Particle node. Other utility nodes
to handle age limits of particles can be added later. Adding an
Age Limit attribute to particles on birth will be useful for some effects,
e.g. when you want to control the color or size of a particle over its
life time.

The Random Float node takes a seed currently. Different nodes will
produce different values even with the same seed. However, the same
node will generate the same random number for the same seed every
time. The "Hash" of a particle can be used as seed. Later, we'd want
to have more modes in the node to make it more user friendly.
Modes could be: Per Particle, Per Time, Per Particle Per Time,
Per Node Instance, ...
Also a Random Vector node will be useful, as it currently has to be
build using three Random Float nodes.
2020-08-02 22:10:47 +02:00
d1063575b5 Merge branch 'blender-v2.90-release' 2020-08-02 21:00:09 +02:00
0264f53e30 Fix T67181: Only the first added movie strip will have audio below
Find free slot first for sound strips then for movie strips.
This patch also fixes issue where all strips were added to channel 2 by default.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8339
2020-08-02 20:54:37 +02:00
189eb2550d Fix T66805: No cache invalidation with remove gaps operator
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8379
2020-08-02 20:53:55 +02:00
4f27e94146 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:15 +10:00
422954b708 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:11 +10:00
ed6bec8d1a Merge branch 'blender-v2.90-release' into master 2020-08-02 18:13:05 +10:00
89167dd304 Merge branch 'blender-v2.90-release' into master 2020-08-02 18:12:58 +10:00
nutti
cc0d8ab036 Docs: add translation keyword argument default for msgctxt 2020-08-02 18:12:31 +10:00
nutti
c442ff0017 Fix RST syntax for freestyle documentation 2020-08-02 18:12:22 +10:00
f349a53c08 Fix T78691: Fly/Walk navigation ignores object channel locks 2020-08-02 18:10:07 +10:00
70d7805fa9 Cleanup: pass const matrices
Also order return matrices last.
2020-08-02 18:02:20 +10:00
a3a6b71a9d Cleanup: pass const matrices
Also order return matrices last.
2020-08-02 17:17:31 +10:00
0e308b07a0 Merge branch 'blender-v2.90-release' into master 2020-08-02 16:20:51 +10:00
ba6ed01058 Fix UV face dot refresh when toggling sync-select 2020-08-02 16:11:07 +10:00
8305dd9499 Cleanup: localize creator.c definitions
As creator.c is used for the 'main' function,
avoid obscure declarations being placed so prominently.

- Move Blender as a Python module declarations into it's own section.
- Move USD declaration to an 'extern' just before it's called.
2020-08-02 13:11:30 +10:00
6a444830a3 GPU: Convert gpu_matrix.c to C++ 2020-08-02 02:10:22 +02:00
6941e27f4a GPU: Convert gpu_shader_interface.c to C++ 2020-08-02 02:10:22 +02:00
de097b28cc Cleanup: OCIO: Remove extern "C" around blender headers 2020-08-02 02:10:22 +02:00
7cd2c1fd2e Particles: support custom particle events in solver
Previously, there were only particle-birth and time-step events.
Now the solver can handle custom events. On the user level
this does not change anything yet. This feature of the solver
will be used by an upcoming Age Reached Event node and
possibly others. When this node exists, I can finally remove
the hardcoded maximum particle age.
2020-08-01 21:56:05 +02:00
6141549fee Fix error in recent rename
This function is defined outside of Blender.
2020-08-01 20:04:22 +10:00
6119f3cad1 Cleanup: spelling (initialized) 2020-08-01 13:57:27 +10:00
901ee66ea1 Cleanup: use term init instead of initialize/initialise
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
2020-08-01 13:51:05 +10:00
006e850a84 Cleanup: spelling 2020-08-01 12:52:11 +10:00
03afffc96a Merge branch 'blender-v2.90-release' into master 2020-08-01 12:18:29 +10:00
06f3312b04 Merge branch 'blender-v2.90-release' into master 2020-08-01 12:18:24 +10:00
72b422c1e1 UV: support select linked with sync-select in vert/edge modes 2020-08-01 12:15:05 +10:00
732434cb1f Fix T46568: UV select-linked failure to de-select
Shift-L was de-selecting all instead of the linked UV's.
2020-08-01 12:14:42 +10:00
106e7654e8 Fluid: Another adjustment for Python pointers
Yet another update to ensure that pointer variables are always up to date, i.e. those referencing the memory allocated by Mantaflow. Outdated pointers usually show up through flickering in viewport.
2020-07-31 23:27:51 +02:00
251ae108e7 Merge branch 'blender-v2.90-release' 2020-07-31 18:20:51 +02:00
71683be4bb Fix T78884: GPencil weight paint crash when painting over modifier generated points
The weight must be added only to the real points, not to the autogenerated points by modifiers. This affects, not only to subdivide, but to any modifier that generate points.
2020-07-31 18:20:39 +02:00
7e64f6cee4 Fluid: Fix for Python pointer update (flickering in smoke/fire issue)
In f2b04302cd the pointer update was refactored. It was sufficient to update pointers just in replay mode at the end of a step since the 'ensure()' functions from manta_fluid_API.cpp had their own pointer update call. These were removed in 51f4bee5a5, however, and so in order to still have some sort of update, the given update call needs to be available to all cache types.
2020-07-31 17:42:08 +02:00
83f8223543 Deps builder: Add support for building GMP
Required for the new boolean code, disabled by default
until all platforms have landed the libs and the boolean
code actually lands in master.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8384
2020-07-31 09:34:26 -06:00
a2c6c51647 Merge branch 'blender-v2.90-release' 2020-07-31 16:46:35 +02:00
cab9673bed Fix T79111: Cycles: Image Sequence not rendering
Caused by c7aa0f9d74.

Since above commit, BKE_image_user_frame_calc requires an image (not
just the iuser) to get the framenumber.

Cycles used to call this with NULL image (in `image_user_file_path` and
`image_user_frame_number`), now pass the image as well.

Maniphest Tasks: T79111

Differential Revision: https://developer.blender.org/D8439
2020-07-31 16:39:22 +02:00
2a0a2c1054 Fluid: Cleanup and improved readability
A collection of multiple changes that had been living in my stash:

- Use nullptr instead of NULL in C++ files
- Removed unused/deprecated functions from headers
- Cleared animatable flag in cache UI
- Comment cleanups
2020-07-31 16:32:02 +02:00
51f4bee5a5 Fluid: Refactored Python fluid initialization functions
Initialization functions now have a return type which will be asserted during fluid object creation.
2020-07-31 16:32:02 +02:00
f2b04302cd Fluid: Refactored Python pointer update function
Use static_cast() where possible and refresh pointers for every frame when in replay mode. The latter is particularly important as this seems to have caused the issue where smoke in the viewport was flickering when loading data from pointers after loading them from disk for the frame before (e.g. when resuming a bake job).
2020-07-31 16:32:02 +02:00
227e20f370 Merge branch 'blender-v2.90-release' 2020-07-31 11:25:56 -03:00
1ff1a2be9c Fix T78600: Crash when transforming doubles with mirroring on
`EDBM_verts_mirror_cache_begin_ex` could do a better work avoiding these
duplicates, but this is a separate problem.
2020-07-31 11:24:34 -03:00
201b4051ba Fluid: Fix missing WITH_FLUID in draw code
The new draw code from 486c7b87fb  was just missing a WITH_FLUID flag.
2020-07-31 15:19:29 +02:00
81caec8c60 Fix blender_test runner build on the buildbot on Linux and macOS
Add our own copy of the gtest discovery scripts from CMake a few reasons:
* Use the very latest version which supports PRE_TEST for Windows
* Fix usage of [] symbols in file paths that fail with the zsh shell
* Disable asan leak checker when discovering tests

This means Windows also no longer requires the very latest CMake 3.18.
2020-07-31 14:41:13 +02:00
5628aaeee1 Fix build of blender_test runner on macOS 2020-07-31 14:15:42 +02:00
3785dc59d1 Merge branch 'blender-v2.90-release' 2020-07-31 13:47:46 +02:00
feaed44ef6 GPencil: Fix unreported missing last point in NURBS conversion
The last point of the curve was missing.
2020-07-31 13:47:12 +02:00
c565f16afb Fix T79397: blurry icons at some UI scales, after recent refactor
Solution found by Yevgeny Makarov.
2020-07-31 12:39:58 +02:00
ded4b72002 Merge branch 'blender-v2.90-release' 2020-07-31 12:20:27 +02:00
627b294317 Fix build error with clang 2020-07-31 12:03:11 +02:00
db24e289b2 Merge branch 'blender-v2.90-release' 2020-07-31 11:53:22 +02:00
de68880e79 Cleanup: Remove unused original pointer in Sequence 2020-07-31 11:45:40 +02:00
1e7afea2bb Fix T78835: Ghosting audio after using undo
The root of the issue comes to the fact that sub-data pointers were
used to match strips before/after copy-on-write. The undo system might
re-use sub-data pointers after re-allocating them, making it so that,
for example, pointer used by sound strip is later re-used by video
strip.

This fix takes an advantage of recently introduced per-sequence UUID
and uses it to match sequences before/after copy-on-write.
2020-07-31 11:45:40 +02:00
9ea6228b07 Sequencer: Ensure UUIDs are updated when needed
Document cases where it seems that they need to be updated, but where
the proper behavior is to not update the UUID.
2020-07-31 11:45:40 +02:00
eb8cbb6d7c Depsgraph: Add command line argument to debug UUIDs
Will trigger code paths which makes sure UUIDs are generated and
are unique.

Enabled with --debug-depsgraph-uuid (which is also implied by
--debug-depsgraph).
2020-07-31 11:45:00 +02:00
cc63897c22 Sequencer: Add session UUID check function
Is aimed for use during development and debug, to help
verifying that operations do not leave sequences with
invalid UUIDs.
2020-07-31 11:44:59 +02:00
3305a94fa1 Sequencer: Add session UUID management to Sequence
This is the first step for having sequences covered with session UUID
with the goal to remove code which uses original sequence pointer to
match sequences.

Currently this UUID is maintained on file load, allocation and leaf
duplication function.There are more cases to cover and ensure UUID
is re-generated or re-used when needed. It will be done as follow-up
development.
2020-07-31 11:44:59 +02:00
44b32e0e4a Sequencer: Add session UUID field to the Sequence DNA 2020-07-31 11:29:55 +02:00
de21ddf821 BLI: Initial implementation of generic session UUID API
Covers basics like generation of new UUID.

Also contains code needed to use the SessionUUID as a key in the Map.
2020-07-31 11:24:03 +02:00
cd579c4996 Add generic session UUID structures to DNA
Allows to use pre-defined structure for session UUIDs in all data
structures which needs it: pose channels, sequencer strips, modifiers.

The goal of all this is to have a reliable way of matching original
and copy-on-written versions of data, so that it's possible to
preserve runtime caches.
2020-07-31 11:22:05 +02:00
f379bb368b BLI: fix float3 in-place operators 2020-07-31 11:17:33 +02:00
585c9c2f23 Merge branch 'blender-v2.90-release' 2020-07-31 10:51:00 +02:00
298d5eb669 UI: fix buttons ranges not properly updated when tabbing to next/previous
button

This was reported for the FCurve modifier restrict ranges, but might fail
elsewhere, too. Reason is that the post_but has its range (hardmin/
hardmax etc) set before the updates to the active button take place, so
changes here dont end up on the post_but (even though the RNA range
function is properly called for a new defined button - new one is not the
same as the post_but though).

Now update the ranges on the post_but when that gets active.

Fixes T78763

Maniphest Tasks: T78763

Differential Revision: https://developer.blender.org/D8265
2020-07-31 10:47:52 +02:00
f3e8326453 Cleanup: fix function signature 2020-07-31 10:13:33 +02:00
59c14c1a62 Merge branch 'blender-v2.90-release' 2020-07-30 22:08:54 -04:00
8c375113b5 UI: Label Fixes
These were added in rB146473f08335e8cb774ccaf1baad82a1d308fbe1 however 
there were a few errors with the labels:

1. Underscore in label
2. Abbreviation when not needed
2020-07-30 22:05:25 -04:00
44928a2a8f Fix: Blender_test not working on windows.
This bumps the minimum requirement for cmake from 3.10 to 3.18 on windows
if `WITH_GTESTS` is enabled.

Reviewed By: sergey brecht sybren campbellbarton

Differential Revision: https://developer.blender.org/D8405
2020-07-30 13:18:05 -06:00
848cbe889b Fix T79347 GPU: Segfault starting blender 2020-07-30 19:43:53 +02:00
9132fd8825 Merge branch 'blender-v2.90-release' into master 2020-07-30 11:24:39 -06:00
f45f8a7a89 Fix T79278: Selected object filter skipping collection instances
Collection instance datablocks were not filtered out when only showing
the selected object. They were treated as a collection (which should
show when filtering objects). Adds a case to check if the parent is an
object.
2020-07-30 11:19:07 -06:00
David Vogel
820ca419e0 Add compound shape for rigid body simulation
This patch adds a new compound shape entry to the shape selection
dropdown. It also corrects wrong inertia calculation for convex hulls,
that resulted in strange behavior for small objects.

The compound shape take the collision shapes from its object children
and combines them. This makes it possible to create concave shapes from
primitive shapes. Using this instead of the mesh collision shape is
often many times faster.

Reviewed By: Sergey, Sebastian Parborg

Differential Revision: http://developer.blender.org/D5797
2020-07-30 18:53:35 +02:00
d3944940f9 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-30 18:38:08 +02:00
Valentin
4089b07aa0 Cleanup: Remove pre 2.80 headers
Review: D8341
2020-07-30 18:37:36 +02:00
8dc2fbd7b6 Fix T79117: dependency cycle with passive rigid body objects
Reviewers: zeddb

Differential Revision: D8431
2020-07-30 18:22:29 +02:00
27d50d6f67 Enable header auto-complete suggestions in Xcode
Description of `USER_HEADER_SEARCH_PATHS` build setting:
"
This is a list of paths to folders to be searched by the compiler
for included or imported user header files (those headers listed
in quotes) when compiling C, Objective-C, C++, or Objective-C++.
Paths are delimited by whitespace, so any paths with spaces in
them need to be properly quoted. See Always Search User Paths
(Deprecated) (ALWAYS_SEARCH_USER_PATHS) for more details
on how this setting is used. If the compiler doesn't support the
concept of user headers, then the search paths are prepended to
the any existing header search paths defined in Header Search
Paths (HEADER_SEARCH_PATHS).
"

http://help.apple.com/xcode/mac/current/#/itcaec37c2a6

Xcode doesn't use `HEADER_SEARCH_PATHS` for auto-complete. Only the
header files in the same directory as the current file are suggested.

CMake as of now correctly sets `SYSTEM_HEADER_SEARCH_PATHS` and lumps the
rest in `HEADER_SEARCH_PATHS`.  The standard way is to use
`USER_HEADER_SEARCH_PATHS` & `SYSTEM_HEADER_SEARCH_PATHS` and let
`HEADER_SEARCH_PATHS` be used as a fallback for compilers which do not
distinguish between `<*.h>` and `"*.h"` syntax.

So set `USER_HEADER_SEARCH_PATHS` to the include paths specified
in the `CMakeLists.txt` files of all targets.
2020-07-30 21:13:26 +05:30
168653ed1d Merge branch 'blender-v2.90-release' 2020-07-30 17:36:20 +02:00
ff1d599172 Fix T79357: VSE crash on prefetching when performing cuts
Caused by {rBa1a333a1e92e}

`BKE_sequencer_prefetch_get_original_sequence` cant get a sequence in
`BKE_sequencer_cache_put`.

rBa1a333a1e92e moved multiple NULL checks (including the one checking
seq) above BKE_sequencer_prefetch_get_original_sequence (this should
never return NULL really, but this is for another fix).

So solution suggested by @ISS is to just stop prefetching all together
before changing content of seqbase.

Maniphest Tasks: T79357

Differential Revision: https://developer.blender.org/D8421
2020-07-30 17:29:48 +02:00
b1bfcf9f6b GPU: Fix compilation error (missed one) 2020-07-30 17:17:16 +02:00
2d38ff67d3 GPU: Fix compilation error 2020-07-30 17:08:23 +02:00
d7a28b3d1a Cleanup: IMB: Put lowercase prefix on static functions 2020-07-30 16:55:42 +02:00
da741013a1 EEVEE: GLSL refactor/cleanup
- add the use of DRWShaderLibrary to EEVEE's glsl codebase to reduce code
complexity and duplication.
- split bsdf_common_lib.glsl into multiple sub library which are now shared
with other engines.
- the surface shader code is now more organised and have its own files.
- change default world to use a material nodetree and make lookdev shader
more clear.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D8306
2020-07-30 16:44:58 +02:00
55401fbb3d IMB: Refactor util_gpu.c to not expose enum getters
This was causing compiler error on MSVC and is not a good idea
in general.
2020-07-30 16:44:57 +02:00
008ccacdfc Cleanup: Use MEM_calloc_arrayN in the Cloth Brush
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8432
2020-07-30 16:23:19 +02:00
2e33c5ca15 Sculpt: Use constraints in cloth deform brushes
Previously, deform brushes were modifying the final positions in the
simulation directly, which was causing all sorts of artifacts in the
deformed area and problems with other features of the solver.
Now these brushes deform a separate array of positions and the solver
adds constraints to them, so the real vertices are moved when solving
the constraints. This prevents those artifacts and gives the brush a
much better behavior.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8424
2020-07-30 16:10:15 +02:00
49c1359b55 Sculpt: Enable persistent base for the cloth brush
The cloth brush builds the constraints when the stroke starts usign the
current state of the mesh. This means that deformations profuced by the
simulattion will accumulate after multiple strokes as it will always
start from the previous deformed state. While this is useful in many
cases, for other uses it is convenient to always simulate the same
initial shape, but applying different forces to it.

The persistent base options work like the persistent base in the layer
brush and allows the cloth brush to not accumulate deformation after
each stroke. When enabled, constraints are created for the shape stored
in the persistent base instead of from the current state of the mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8428
2020-07-30 15:59:35 +02:00
27b643d27a Merge branch 'blender-v2.90-release' 2020-07-30 14:27:07 +02:00
9cac158e96 Fix T78730: CLOG writes/reads outside allocated memory.
Fix several issues in CLOG code:
* In `clg_str_reserve`, allocated memory may be bigger than requested
  one, do not assign the latter back to `cstr->len_alloc`.
* `clg_str_vappendf` was mis-interpreting returned value from
  `vsnprintf`, and completely mixing total allocated memory and extra
  needed amount of memory to allocate...

Simplified code of `clg_str_vappendf` to only have allocating code
handled in one place, makes things easier to follow too.

Think this should also be beckported to 2.83.
2020-07-30 14:26:44 +02:00
19175f4757 GPUBatch & GPUImmediate: Use GPUShader instead of using raw OGL handle 2020-07-30 13:28:50 +02:00
3eff2b44db Merge branch 'blender-v2.90-release' 2020-07-30 13:02:29 +02:00
4251a87bf6 Fix usercount not decrementing in gpencil_stroke_separate_exec
This is part of T79273 where separating a stroke would result in
multiuser gpencil data for the original object.
Real underlying issue seems to be that gpencil multiuser objects (also
the ones created by Alt+D duplicating) have a problem evaluating
modifiers correctly [this will need further investigation].
Not sure if this is a limitation of D5470?

This patch only corrects the usercount on separating [which already fixes
the scenario reported because singleuser gpencil modifiers work
correctly].

Note: we could have also called `ED_object_add_duplicate` with the
`USER_DUP_GPENCIL` dupflag -- that would have taken care of the usercount
--, but then the whole following logic in `gpencil_stroke_separate_exec`
would need to change from **adding** layers/frames/strokes to
**removing** these.

Part of T79273

Maniphest Tasks: T79273

Differential Revision: https://developer.blender.org/D8419
2020-07-30 12:47:54 +02:00
742ad5acbc Merge branch 'blender-v2.90-release' into master 2020-07-30 17:45:26 +10:00
2bc017ece1 Fix T79207: Crash converting curve to mesh 2020-07-30 17:42:09 +10:00
5893a1562f Cleanup: split curve bevel into separate file 2020-07-30 14:54:39 +10:00
24d035b383 Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:54 +10:00
1f48e67002 Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:49 +10:00
422e5e372e Merge branch 'blender-v2.90-release' into master 2020-07-30 14:21:41 +10:00
0ab66dd63f Fix T79369: BMesh.calc_volume() gave incorrect result 2020-07-30 14:20:18 +10:00
69ec7ab873 UV: path select support with sync-select enabled
Also improve region fill with edge-select enabled which often failed
to include both vertices from each edge in the resulting region.
2020-07-30 12:07:10 +10:00
ff0112bcb2 Fix UV select with sync select enabled wasn't setting active 2020-07-30 11:02:03 +10:00
dc3baf2c78 Cleanup: spelling 2020-07-30 08:43:40 +10:00
929c94ee20 Cleanup: warnings 2020-07-30 08:43:40 +10:00
2181028292 Merge branch 'blender-v2.90-release' 2020-07-29 19:19:25 -03:00
699cefefd0 Fix ghash return value on 'Correct Face Attributes' with 'Keep Connect'
The result was somewhat unpredictable.
This error was recently introduced.
2020-07-29 19:17:56 -03:00
486c7b87fb Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRW 2020-07-29 23:21:33 +02:00
5f6fb5bb41 Cleanup: Split gpu_texture_image.c into BKE and IMB modules
This is in order to disolve GPU_draw.h into more meaningful code blocks.

All the Image related function are in `image_gpu.c`.
All the MovieClip related function are in `movieclip.c`.

The IMB module now has a connection with GPU. This is not strickly
necessary and the code could be move to `image_gpu.c` if needed.

The Image garbage collection is also ported to `image_gpu.c`.
2020-07-29 23:06:37 +02:00
7e8d493730 GPU_draw.h: cleanup before splitting 2020-07-29 23:06:37 +02:00
c09f61a915 RNA: Image API: Fix error in NULL check in rna_Image_gl_touch
This check was always returning true.
2020-07-29 23:06:37 +02:00
5f46a0fbce Cleanup: Rename define
*_LEN follows names elsewhere in Blender more closely than "_N_"
2020-07-29 17:01:46 -04:00
81ce8481b2 Fix failing PLY test, update hash because metadata changed 2020-07-29 19:49:53 +02:00
8c10e56331 Sculpt: Cloth Brush Soft Body Influence property
This property adds constraints to the simulation using the initial
location of the vertices, making it behave like a soft body. The
strength of these constraints can be modified with the brush parameter.
This makes some deformation modes more subtle and predictable, making it
possible to use the cloth brush to add surface detail in a more
controllable way without loosing completely the original shape of the
mesh.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7845
2020-07-29 19:14:03 +02:00
ebda95953c Merge branch 'blender-v2.90-release' 2020-07-29 18:22:33 +02:00
3274ce0a8e Fix T79119: Hook modifier deformation not shown in edit mode.
Missing temp `BKE_mesh_wrapper_ensure_mdata` hack for the Hook
modifier...
2020-07-29 18:21:27 +02:00
f62c7c546a Merge branch 'blender-v2.90-release' 2020-07-29 17:39:59 +02:00
Bastien Montagne
4e6975ffd6 Fix T78285: Invalid thread safety in shrinkwrap modifier code.
This uses mesh's runtime mutex for both `BKE_mesh_runtime_looptri_ensure`
(was using its own global RW mutex before), and `BKE_mesh_wrapper_ensure_mdata`
(was not protected at all before).

This is more like a band-aid than a proper fix, as mentioned in the report
proper fix would be for the modifier to request those data (the relevant
BVHTree, which would implicitely also call the tow others) through flags,
just like it does for regular CDData layers. But this is a much bigger
refactor to be done outside of bugfix scope.

Reviewed By: sergey

Maniphest Tasks: T78285

Differential Revision: https://developer.blender.org/D8415
2020-07-29 17:36:46 +02:00
03acbc7b71 Merge branch 'blender-v2.90-release' 2020-07-29 17:22:50 +02:00
54a2fcc0f3 Fix Cloth Brush global Sculpt gravity applied in the wrong falloff
Previously, gravity was only applied in the real brush radius, not in
the whole simulation radius. For most deformation modes, applying
gravity to the entire simulation instead of just to the brush radius and
scaled by the radius (like a regular sculpt brush) makes more sense.
After this fix and with the cloth collisions patch applied, it is possible
to do things like this with the cloth grab brush.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8406
2020-07-29 17:21:41 +02:00
6e5278c3da Fix T79054: Crash with Cloth Brush and anchored stroke
As the comment says, anchored stroke can't rely on the first stroke
iteration for creating the simulation data. Probably lost in a cleanup.

I also made that anchored stroke doesn't restore the mesh state in the
cloth brush, so it can create the simulation effect.

Reviewed By: sergey

Maniphest Tasks: T79054

Differential Revision: https://developer.blender.org/D8348
2020-07-29 17:19:10 +02:00
83f01db7a9 Compositor: Fix node preview when input resolution is not known
The final render will use scene resolution in this case.

For example, when Color Input is plugger to preview and composite output
nodes, final render will flood-fill the final image which is a size of
scene resolution with this color. Before this fix the node preview was
empty. After this fix the node preview will be flood-filled with the
color.

Fixes T78586

Differential Revision: https://developer.blender.org/D8263
2020-07-29 17:18:35 +02:00
66df8fff32 Compositor: Fix calculation of preview resolution
Were two issues:

- Divider was calculated in integer domain, causing rounding issues in
  general case, and causing singularity in a corner case when input is
  smaller than the preview size.

- The resolution was scaled down by 1 pixel for no obvious reason.
2020-07-29 17:18:35 +02:00
b9c7c904ed GPUShader: Fix linking with MSVC 2020-07-29 16:07:51 +02:00
f0687d4665 Cleanup: GPUTexture: Use UNPACK3 in texture_fluid 2020-07-29 15:54:51 +02:00
1804a6d040 GPUState: Fix compilation error on MSVC 2020-07-29 15:54:51 +02:00
2d89cd7dd5 Cleanup: GPU: Move Image based function to GPU_draw.h
This makes it less confusing what functions are for blender
structures.
2020-07-29 15:54:51 +02:00
99d0b3b793 Cleanup: GPU: Rename gpu_texture_smoke to fluid, and move back to C
The file do not have a reason to be C++ anymore.
2020-07-29 15:54:51 +02:00
7becd283cc GPencil: New Brush predefined mode
it's good to have an option to ' pin' a mode to the brush, to use that mode always, independent of the current viewport selected mode.

{F8723224}

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D8399
81a002
2020-07-29 15:34:54 +02:00
ade7603379 Cleanup: Remove deprecated comment. 2020-07-29 15:30:10 +02:00
e2e87efea2 Cleanup: Always keep unlock at same level as lock.
This was fine in those cases with current code, but that kind of
assumption is always risky, and an open door to hard-to-track bugs when
code changes in the future...
2020-07-29 15:30:10 +02:00
e749643793 GPU: Refactor gpu_texture_image to not use GL calls
This is also a bit of code cleanup, reorganisation.

Tried to be DRYed but avoid too much code change to (hopefully) minimize
breakage.

- GPU: remove TEXTARGET_CUBE_MAP, this is no longer used in the codebase.
- GPUTexture: Move compressed texture upload to gpu_texture.cc
- GPUTexture: Add per texture Anisotropic filtering switch
2020-07-29 15:03:02 +02:00
e4ee9de638 GPU: Move gpu_shader.c to C++
We split builtin shader support to its own file to avoid
converting code (lack of designated initializer in C++)
and to reduce file size.
2020-07-29 15:03:02 +02:00
18d2db22ff GPU: Move gpu_state.c to C++ 2020-07-29 15:03:02 +02:00
45d61bdc03 GPU: Move gpu_texture.c to C++
# Conflicts:
#	source/blender/gpu/GPU_texture.h
2020-07-29 15:03:02 +02:00
56d0a554a8 GPU: Move gpu_uniformbuffer.c to C++
This also rewrite and simplify the module a bit.
2020-07-29 15:03:02 +02:00
f84342d7e1 GPU: Move gpu_vertex_buffer.c to C++ 2020-07-29 15:03:02 +02:00
959529d4b8 GPU: Move gpu_vertex_format.c to C++ 2020-07-29 15:03:02 +02:00
18caaff149 Merge branch 'blender-v2.90-release' 2020-07-29 09:10:07 -03:00
84f7de432c Fix T78826: Move constraint is not fully disabled
Caused by rB45f17e10ec50
2020-07-29 09:09:34 -03:00
9c807325dd Particles: rename Size attribute to Radius
Doing this change for consistency with the point cloud attributes.
2020-07-29 12:03:30 +02:00
91150c9ef5 Workbench/Eeevee: Minor refactor in smoke draw function
More concise this way.
2020-07-29 11:22:35 +02:00
659db0592d GPencil: Consider extrude point as last
Before, when extrude a point, the extruded point is considered as the first point of the stroke, but this was not logic.

Now, the extrude point is considered as last.

Related to T79313
2020-07-29 11:19:35 +02:00
4cad74e589 Particles: add Size attribute 2020-07-29 10:05:27 +02:00
3e82500509 Fix T79355: switch to texture paint workspace changes image in other workspaces
Only automatically change image in editor to follow texture paint editors and
workspaces that are visible.
2020-07-29 09:06:23 +02:00
7a07683060 Cleanup: rename uiBut.dt, uiBlock.dt to 'emboss'
Use 'emboss' instead of 'draw_type' as enum, layout & functions use
the term emboss.

This issue was noted by @Poulpator in D8414, as `dt` is also an
abbreviation for delta-time.
2020-07-29 12:05:27 +10:00
a3c6304a27 Cleanup: quiet possible comma misuse warning in feestyle PyAPI 2020-07-29 11:00:32 +10:00
1e76441dd6 Clanup: unused return 2020-07-29 10:50:43 +10:00
dcad6c9db8 Cleanup: correct assert in GPU_offscreen_read_pixels 2020-07-29 10:50:31 +10:00
ac6fbf6ba8 Cleanup: declare static variables 2020-07-29 10:50:10 +10:00
012ed9ca9f Fix incorrect flag check in overlay relationship lines 2020-07-29 10:45:53 +10:00
nutti
0f075c25c4 Docs: add translation keyword argument default for msgctxt 2020-07-29 10:01:42 +10:00
nutti
55c6cc46b5 Fix RST syntax for freestyle documentation 2020-07-29 09:49:08 +10:00
7dfc2f5137 Cleanup: Doxygen sections, comment formatting 2020-07-28 17:20:41 -04:00
a0bc3596f0 Cleanup: class -> struct 2020-07-28 20:56:45 +02:00
cd3be9c46d Cleanup: too small loop variable 2020-07-28 20:56:34 +02:00
c3f6227f30 Cleanup: Use bool instead of int 2020-07-28 14:24:25 -04:00
e5e97d0fe0 Merge branch 'blender-v2.90-release' 2020-07-28 18:46:38 +02:00
d8919d12f7 GPencil: Fix typo error in RIM VFX panel
The vertical axis must be named Y, not Z because it works in 2D space.
2020-07-28 18:46:22 +02:00
814ca40c63 Merge branch 'blender-v2.90-release' 2020-07-28 16:37:01 +02:00
fcf91bbf0d Merge branch 'blender-v2.90-release' 2020-07-28 18:32:11 +02:00
9c1da81a4c Fix T54544: "Copy Materials to Selected" only works when materials are defined on the mesh.
Build a temp matarray storing materials from obdata and source object
(depending on slots 'allocation' of source object), and assign those to
targets.

Also remove limitation of 'using same obdata is forbidden', just never
edit obdata materials in that case...

Certainly not perfect, but already much better than existing code.
2020-07-28 18:31:51 +02:00
cf243e0980 Merge branch 'blender-v2.90-release' 2020-07-28 17:56:26 +02:00
5d88f8eba2 Fix T61607: OpenEXR files with less common RGB channels names not loaded
Previously there would have to be 3 channels R,G,B. Now also support cases
where there are fewer channels or other names like Red, AR and RA are used.
2020-07-28 17:55:37 +02:00
556252f1fe Fix T79067: Cycles panorama viewport render stretched after recent changes 2020-07-28 17:34:51 +02:00
80539723b9 Fix T79219: Cycles NLM denoiser clean passes broken after recent changes 2020-07-28 17:34:44 +02:00
67c33caeec Fix: remove error in previous commit 2020-07-28 16:35:31 +02:00
b274d18aec Cleanup: correct usage of extern-C blocks in various places
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
2020-07-28 16:33:43 +02:00
cbeb2e55ed Merge branch 'blender-v2.90-release' 2020-07-28 16:24:53 +02:00
dcf7a05077 GPencil: Fix unreported missing strokes in interpolation
Sometimes the interpolated stroke was tagged and removed.
2020-07-28 16:23:45 +02:00
8fbed7f7f5 Merge branch 'blender-v2.90-release' 2020-07-28 15:46:09 +02:00
9ff7820f62 Fix T79259: OptiX render with fisheye camera is different to CUDA
The fisheye camera setup causes the edges of the image to not shoot primary rays. This was not
respected by OptiX because of an optimization that tried to reduce conditionals around trace calls.
Removing that does not seem to have an impact on performance anymore however and it fixes
the issue.
2020-07-28 15:45:46 +02:00
bc0b75ea37 Merge branch 'blender-v2.90-release' 2020-07-28 09:55:27 -03:00
5e232d7a0b Fix bad 'Correct Face Attributes' behavior when extruding faces
A face must have area in order to be possible calculate interpolation weights.
The same to the reference UVs.
But the new faces created with the extrude operator, have no area (before moving).

The solution was to get the loop data from some neighbor face.

Differential Revision: https://developer.blender.org/D8278
2020-07-28 09:53:44 -03:00
6a689b5047 Transform: Correct Face Attributes: Option to merge attributes
Keeping face attributes connected is now optional.

Keeping UV's connected is useful for organic modeling, but bad for
architectural.

Differential Revision: https://developer.blender.org/D8360
2020-07-28 09:53:23 -03:00
47b82fc02f Fix precision issues in 'interp_weights_poly_v2'
These precision issues were evident in corrected uvs when the option
`"Correct Face Attributes"` is enabled.
2020-07-28 09:53:07 -03:00
26bc8f4935 Merge branch 'blender-v2.90-release' 2020-07-28 14:44:54 +02:00
b99358315e Fix T79180: Object disappears when scaled, set origin etc after applying smooth modifier.
Very dummy mistake in modifier code would generate invalid number
(divisions by zero)...

Should also be ported to 2.83.
2020-07-28 14:44:17 +02:00
76d489fe23 Bump minimum CMake version to 3.10
This bumps the minimally required CMake version from 3.5 to 3.10, as
discussed in D8405.

Since D7649 landed, there has been the `gtest_discover_tests()` call to
discover individual unit tests in `bin/tests/blender_test`. This
function was introduced in CMake 3.10.

Since there were no complaints about this incompatibility, I suspect
that a newer version is already in use by the majority of the
Blender-building people.
2020-07-28 14:17:13 +02:00
9d412a92f5 Cleanup: incorrect spelling of 'manhattan' 2020-07-28 22:06:44 +10:00
2a52c2d001 Cleanup: spelling, comments 2020-07-28 21:49:37 +10:00
82c38a7df0 Fix T79067: Cycles panorama viewport render stretched after recent changes 2020-07-28 13:35:45 +02:00
75e16c22d7 Fix T79219: Cycles NLM denoiser clean passes broken after recent changes 2020-07-28 13:16:44 +02:00
f0c4566ce3 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-28 12:40:05 +02:00
ec80f1d376 Cleanup: Commented BKE_object_moves_in_time() does not consider physics
When an object is moved only by the rigid body physics system, the
function `BKE_object_moves_in_time()` will incorrectly return `false`.
This commit adds a comment to make this behaviour more explicit.

No functional changes.
2020-07-28 12:39:52 +02:00
19de9d1a9e Cleanup: spelling fix in comment 2020-07-28 12:39:52 +02:00
050de1fb8e Fix T79263: Alembic, exported rigid body animation not moving
The root cause was that `BKE_object_moves_in_time()` incorrectly returns
`false` when an object is moved by the physics system.

This also fixes the same issue in the USD exporter.
2020-07-28 12:38:31 +02:00
3b9e16a4f7 Particles: initial support for the Time input node 2020-07-28 12:10:37 +02:00
c8e45c3fe9 Merge branch 'blender-v2.90-release' 2020-07-28 12:02:59 +02:00
d738e47b0d Clip Editor: Make filter labels consistent
This was done for the regular dopesheet in rB9ccc73ade8a2, this just
makes that label consistent across all anim views.

Differential Revision: https://developer.blender.org/D8255
2020-07-28 12:00:47 +02:00
34125ce507 Merge branch 'blender-v2.90-release' 2020-07-28 11:54:51 +02:00
e296c9e24e Fix T79031: Batch Generate-Previews doesn't work anymore
Caused by rB19785b96c43f.

Maniphest Tasks: T79031

Differential Revision: https://developer.blender.org/D8400
2020-07-28 11:52:38 +02:00
8a60e920f4 Merge branch 'blender-v2.90-release' 2020-07-28 11:47:55 +02:00
290b372aac Fix T79264: Mantaflow Field weights cannot be animated
rna_EffectorWeight_path() needs to point to "domain_settings" (instead
of "settings"), was a missing change when switching the FluidModifier to
mantaflow.

Maniphest Tasks: T79264

Differential Revision: https://developer.blender.org/D8398
2020-07-28 11:36:07 +02:00
da32c17631 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-28 11:08:10 +02:00
617e67529c Tests: show debugging hint when USDStageCreationTest fails
Setting the environment variable `PXR_PATH_DEBUG` non-empty will make the
USD library print the directories it uses to find its JSON files. This can
aid in debugging when this unit test fails. Now the failure message also
tells you about this.

No functional changes.
2020-07-28 11:02:05 +02:00
e7dd89b50b Cleanup: remove redundant return statement
This was found by clang-tidy.
2020-07-28 11:00:08 +02:00
1675969152 Merge branch 'blender-v2.90-release' 2020-07-28 17:57:56 +10:00
a2a29327d9 Fix T79341: Crash evaluating curve 2020-07-28 17:53:22 +10:00
289aac723a Merge branch 'blender-v2.90-release' 2020-07-27 21:17:03 -06:00
ed19781a2a Fix T77951: Remove duplicate outliner menu entries
Move the common entries (View and Area) into a static method to be
called from other menus to avoid duplicating the New Collection and ID
Paste operators.
2020-07-27 21:08:28 -06:00
6ad75949b9 Fix: Wrong outliner restrict column for gpencil layer hide
The icon was drawing in the viewport disable rather than the viewport
hide column. Unreported.
2020-07-27 20:07:55 -06:00
ace832bf7c Merge branch 'blender-v2.90-release' 2020-07-27 22:21:57 +02:00
221604cdd6 Fix Sculpt Relax operation when deforming mesh boundaries
Previously, mesh boundaries were relaxed as any other vertex, which was
causing artifacts and unwanted deformation. In order to prevent this,
the mesh filter was using the automasking system to lock the boundary
vertices, which was hacked into the tool. For the brush, the only
solution was to enable boundary automasking to lock those vertices
in plance.

Now the relax vertex function slides the boundary vertices along the
mesh boundary edges, relaxing all the topology correctly while
preserving the shape of the mesh. The automasking hack in the relax
mesh filter was also removed as now vertices slide correctly along
the boundary.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8350
2020-07-27 22:19:35 +02:00
0006526952 Fix T79074: Mesh Topology info not being updated after changes
All these data arrays are created for a specific topology, so they should be
freed and updated when the PBVH rebuilds. Previously, this was only
happening when freeing the SculptSession, but it also needs to happen in
BKE_sculpt_update_object_before_eval to avoid reusing out of date data.

Reviewed By: sergey

Maniphest Tasks: T79074

Differential Revision: https://developer.blender.org/D8357
2020-07-27 22:04:31 +02:00
7eebebebc7 Fix T79164: Sculpting with smooth shading doesn't update normals
Just a missing update flag

Reviewed By: sergey

Maniphest Tasks: T79164

Differential Revision: https://developer.blender.org/D8364
2020-07-27 22:02:35 +02:00
4f3233dd53 Fix T78242: Crash when using a Sculpt color tools that needs connectivity for the first time
When there is no color layer available,
BKE_sculpt_update_object_for_edit creates a new one and tags the mesh
with ID_RECLAC_GEOMETRY, so this layer is inmediatly available when the
tool starts. This also deletes the PBVH and when it is created again in
BKE_sculpt_update_object_after_eval, the pmap is not initialized, making
the tool crash.

This moves the color layer creation to a separate function outside
BKE_sculpt_update_object_for_edit, which now runs after the color
layer is available, so it won't need to update again and the pmap will
still be available when the tool is used.

Reviewed By: sergey

Maniphest Tasks: T78242

Differential Revision: https://developer.blender.org/D8135
2020-07-27 21:58:59 +02:00
a0b0a47d81 GPencil: Scale stroke thickness when use Offset modifier scale 2020-07-27 19:09:44 +02:00
e8869d9c71 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 19:02:44 +02:00
2584a2a4e7 Fix USD unit test on buildbot
The buildbot uses a separate `CMAKE_INSTALL_PREFIX`. This means that
the unit test could not find its USD JSON files in the build directory.
Using `${CMAKE_INSTALL_PREFIX}` instead of `$<TARGET_FILE_DIR:blender>`
solved this.
2020-07-27 19:02:22 +02:00
e893430a63 Partly revert "Fix T77276: Generating Python API docs raises many warnings"
This commit reverts the "noindex" part of the original commit.
using noindex made it imposible to link to a specific property.

The original warnings do not pose an issue so until a proper solution is 
found I am reverting this commit.

This reverts commit 953c232db3
2020-07-27 13:01:28 -04:00
729da8bfac CTest: Fix blender_test not working on windows.
MSVC does need the wholearchive flag but it was not set,
so no tests were actually linked into the binary.

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D8404
2020-07-27 10:55:34 -06:00
e54289cdf3 Merge branch 'blender-v2.90-release' 2020-07-27 18:15:56 +02:00
1ae8855f8e Fix T78308: Weight Transfer Operator "Deform Pose Bones" destination setting doesn't work.
Some modes were working by mere chance in that ugly 'reversed' case, but
the to/from selection modes were not properly swapped...

Should also be safe for 2.83.
2020-07-27 18:12:40 +02:00
7fd68db841 Merge branch 'blender-v2.90-release' 2020-07-27 17:40:10 +02:00
960ce1e394 Fix T78306: Weight Transfer Operator target mesh doesn't update when transforming bones.
Data transfer operator was missing tagging DEG for relations updates.

Should be portable to 2.83 as well.
2020-07-27 17:39:49 +02:00
2e376cfcc8 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 17:32:28 +02:00
a5b2aa96e4 CMake: reject older GCC version when using precompiled Linux libraries
In the situation where the precompiled libraries are used on Linux +
GCC, a version of GCC older than 9.3 is guaranteed to cause problems.

This just implents a fatal error message when we know it doesn't make
sense to continue. We could do more checks and add some warnings, but
it's very likely that these will be ignored amongst the other noise.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D8396
2020-07-27 17:29:13 +02:00
9a53d4a882 Particles: support Clamp node 2020-07-27 17:12:15 +02:00
bd4b29d63d Cleanup: fixed compiler warning about strncat
`strncat(command, "x", 1)` is the same as `strcat(command, "x")`, except
that the latter form doesn't trigger a GCC warning.

No functional changes.
2020-07-27 17:03:32 +02:00
c7ee66e517 Cleanup: remove outdated comment 2020-07-27 16:42:04 +02:00
6f5d01779a Functions: add some tests for virtual spans 2020-07-27 16:35:54 +02:00
38e65331a8 Particles: initial support for events and actions
The following nodes work now (although things can still be improved of course):
Particle Birth Event, Praticle Time Step Event, Set Particle Attribute and Execute Condition.

Multiple Set Particle Attribute nodes can be chained using the "Execute" sockets.
They will be executed from left to right.
2020-07-27 16:26:43 +02:00
a83bb170b0 Merge branch 'blender-v2.90-release' 2020-07-27 16:18:44 +02:00
d64e171c4b Cycles: Enable OptiX on first generation Maxwell GPUs again 2020-07-27 16:11:00 +02:00
4c5e1f1c25 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 15:49:02 +02:00
79312962de Cleanup: Fix compiler warning about function without prototype
No functional changes.
2020-07-27 15:48:47 +02:00
81a0027f13 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 15:26:08 +02:00
f8a0a5a350 PointCloud: Fix viewport issue when using radius attrib after not using it
This was a simple issue with the static GPUVertFormat being the same for
both cases.
2020-07-27 15:41:16 +02:00
71506698de Cleanup: Fix compiler warning about missing parentheses
The code was well-defined, given that `&&` binds stronger than `||`, but
still GCC warns about this.

No functional changes.
2020-07-27 15:25:33 +02:00
565d7f75cc UI: improve errors when evaluating a number button fails
Showing the Python error without any explanation is often
not enough information and doesn't hint that the error was in the
user input.

The error report from a invalid expression such as '..1' used to be:
   ('invalid syntax', ('<string>', 1, 1, '..1'))

Now reads:
   Error evaluating number, see Info editor for details: invalid syntax

Address issue raised by T78913.
2020-07-27 21:00:50 +10:00
7beef1fd33 PyAPI: simplify syntax error reports
The result of syntax errors read poorly in reports,
resulting in cryptic and unhelpful information.

Change PyC_ExceptionBuffer_Simple only to extract the initial text,
making syntax errors when entering invalid numeric expressions into
buttons easier to follow.
2020-07-27 21:00:50 +10:00
d7cb67454d Cleanup: match call signature for UI unit number evaluation
Also rename ui_but_string_set_eval_num to ui_but_string_eval_number
as it doesn't set any of the buttons values.
2020-07-27 21:00:49 +10:00
9ce2c5bf50 Cleanup: remove workaround for old BLI_dynstr_vappendf bug
Remove workaround from 1c806f6bb4
as this doesn't seem to be needed anymore.
2020-07-27 21:00:49 +10:00
b18c376946 Cleanup: quiet warnings without DDS 2020-07-27 21:00:49 +10:00
0b04f0e4e6 GPU: Fix crash and missing texture due to recent C++ port
Fix T79306 DRW: small issues with yesterday commits modifying TEXTARGET
Fix T79303 Image texture node crashes EEVEE when connected to a shader output
2020-07-27 13:37:22 +02:00
bfeb94eccc Cleanup: quiet warning 2020-07-27 11:41:51 +02:00
418753b6a6 GPU: fix build error due to wrong linkage specification 2020-07-27 11:40:47 +02:00
382b9007f8 GPencil: New operator to Cleanup duplicated frames
This operator cleanup any frame that is equal to the previous one. This is very handy when convert a mesh animation to Gpencil and the mesh is static for several frames.

Differential Revision: https://developer.blender.org/D8149
2020-07-27 10:47:04 +02:00
f31fa3eb97 Merge branch 'blender-v2.90-release' 2020-07-27 10:32:38 +02:00
ea4a00e93b Fluid: Fix warnings from max particle option
-Wreorder was the issue.
2020-07-27 10:32:12 +02:00
93e6ed9b45 Merge branch 'blender-v2.90-release' 2020-07-27 10:26:00 +02:00
d906116eba Cleanup: comments. 2020-07-27 10:25:43 +02:00
041904ceb8 Cleanup: Minor renaming. 2020-07-27 10:25:43 +02:00
40a9524637 Merge branch 'blender-v2.90-release' 2020-07-27 10:24:53 +02:00
87fb12d16e Allocator: fix build error with -Werror=format-security
Doing it again here, because I fixed this only in master branch before..
2020-07-27 10:23:20 +02:00
6d42ffe03c Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-07-27 09:06:00 +02:00
9b867f2e90 Fix T79121: Dependency cycle when driver points to prop with 'scale' in name
This makes `RNANodeQuery::construct_node_identifier()` more strict in
its matching of certain property names.

The downside of this approach is that it's not possible any more to use
`"rotation"` and expect a match for `"rotation_euler"` and friends, so
the list of strings to test against is now 3x as long.

Reviewed By: sergey

Maniphest Tasks: T79121

Differential Revision: https://developer.blender.org/D8375
2020-07-27 08:53:32 +02:00
3bcec7c142 Cleanup: Alembic, fix maybe-uninitialized warning
No functional changes.
2020-07-27 08:52:53 +02:00
d62250a3e0 UI: Show message in transform panel when no metaball elements are selected
The complete lack of a transform panel was confusing enough to spawn
this question: https://blender.stackexchange.com/q/169074/599
Displaying a message instead of nothing is more consistent with the
behavior of the mesh transform panel anyway.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8390
2020-07-26 21:20:37 -04:00
9e7ee39385 Merge branch 'blender-v2.90-release' 2020-07-26 21:09:24 -04:00
344be1fcfa RNA to Manual: Update links 2020-07-26 21:06:35 -04:00
ba9c88ce18 GPUFramebuffer: Fix compilation issue with designated initializer in C++ 2020-07-27 00:08:48 +02:00
2c2082cc62 GPU: Fix MSVC compile errors 2020-07-26 23:50:29 +02:00
e76f64a532 Fluid: Added new option to control the maximum number fluid particles in the simulation
New option that lets users the define the maximum number of fluid particles that will be allowed in the simulation. This can come in handy, for example, to ensure that the particle count will not exceed the hardware capabilities, or to avoid excessive amounts of particles in a scene.
2020-07-26 22:04:59 +02:00
c9cc5ad1c0 Fluid: Updated Mantaflow source files
New files contain updated sampling function (support for maximum number of particles cap).
2020-07-26 22:04:59 +02:00
65e1d43f0b Fluid: Cleanup unsed file format options
File format options for noise and particles are not needed anymore (since OpenVDB update).
2020-07-26 22:04:59 +02:00
04195b1e74 Fluid: Added new option to control the maximum number fluid particles in the simulation
New option that lets users the define the maximum number of fluid particles that will be allowed in the simulation. This can come in handy, for example, to ensure that the particle count will not exceed the hardware capabilities, or to avoid excessive amounts of particles in a scene.
2020-07-26 22:02:10 +02:00
2ebf263f5c Fluid: Updated Mantaflow source files
New files contain updated sampling function (support for maximum number of particles cap).
2020-07-26 22:02:10 +02:00
9386dd66ff Fluid: Cleanup unsed file format options
File format options for noise and particles are not needed anymore (since OpenVDB update).
2020-07-26 22:02:10 +02:00
94afe7671c Cleanup: GPU: Remove glew headers part2 2020-07-26 21:07:25 +02:00
54237994d8 Cleanup: Image: Rename redundant enum for clarity 2020-07-26 21:07:25 +02:00
487eaeed7e GPUTexture: Replace GL textarget enum by Image enum 2020-07-26 21:07:25 +02:00
025dc31d28 GPU: Remove GL constant from BIF_glutil 2020-07-26 21:07:25 +02:00
18cca0e704 Cleanup: GPU: Remove GPU_glew.h outside of GPU module
Remove use of GL* constants and types inside the codebase. There is still
a few occurence to get rid of.
2020-07-26 17:29:49 +02:00
9e23dbd060 Cleanup: GPU_codegen.c: Use LISTBASE_FOREACH macro instead of for loops 2020-07-26 17:28:48 +02:00
15655aa1dd Cleanup: GPU: Remove unused code and header 2020-07-26 17:28:48 +02:00
cc7d5e1fe6 GPU: Move gpu_platform.c to C++ 2020-07-26 17:28:48 +02:00
c276ef61d4 GPU: Move gpu_immediate.c to C++ 2020-07-26 17:28:48 +02:00
b296b68ff2 GPU: Move gpu_framebuffer.c to C++ 2020-07-26 17:28:48 +02:00
9905db5557 GPU: Move gpu_extensions.c to C++ 2020-07-26 17:28:48 +02:00
7c3eaffbbd GPU: Move gpu_element.c to C++ 2020-07-26 17:28:48 +02:00
97b597cd04 GPU: Move and rename gpu_draw*.c to C++
`gpu_draw.c` was a misleading name, `gpu_texture_image.cc` is better
suited.
2020-07-26 17:28:48 +02:00
8b7802db85 GPU: Move gpu_debug.c to C++ 2020-07-26 17:28:48 +02:00
56803e2754 GPU: Rename gpu_context.cpp to .cc suffix 2020-07-26 17:28:48 +02:00
7b4a21077a GPU: Move gpu_batch.c to C++ 2020-07-26 17:28:48 +02:00
d3cecc5007 GPU: Move gpu_attr_binding.c to C++ 2020-07-26 17:28:48 +02:00
13afc81f6d BLI: Add MACRO for enum usage in C++
This is handy to add support for enums used in both C and C++
files. This removes the need to typecast each time for every
operation.

Only support bitwise operators for now.
2020-07-26 17:28:48 +02:00
a77175c9b6 GPU: Add extern "C" to intern headers 2020-07-26 17:28:48 +02:00
076d033e10 VSE: Refactor delete operator and API
Operator logic is limited to iterating over selection and executing
same code as python API does.

Functional changes:

 - No attempt to preserve effects is made. Dependant effects are deleted.
 - No attempt to change meta strip boundaries.

Partially fixes T73828

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D6892
2020-07-26 16:07:34 +02:00
f0e370a650 Merge branch 'blender-v2.90-release' 2020-07-26 15:04:56 +02:00
7ceb6ffe57 Fix T74958: Infinite loop on using strip as modifier mask
Add recursion check before assigning strip as a mask for modifier.
Same check is used for recursion check when reassigning effect input, so it
should not be possible to create recursion at all.
2020-07-26 15:00:37 +02:00
f2907b06f4 Fix T78999: Crash when adjusting sequencer property
Sequencer was not initialized yet, and RNA update function tried to clean up cache.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8323
2020-07-26 15:00:37 +02:00
5414ccbd4c Merge branch 'blender-v2.90-release' 2020-07-26 22:00:13 +10:00
28b1c70895 Fix T79272: Dimensions fail on negative scaled axis 2020-07-26 21:58:47 +10:00
850234c1b1 UV: port smart project from Python to C
Use C for faster operation on high poly models,
in my tests this gave ~27x speedup.

D8311 by @andreasterrius with edits.
2020-07-26 21:27:32 +10:00
9482cc6865 UV: support creating ParamHandle without checking UV selection
Needed for unwrapping from the 3D view.
2020-07-26 20:42:11 +10:00
fd7e31b3e5 Particles: don't mark Particle Attribute node as mockup
It is actually doing something already.
2020-07-26 12:32:28 +02:00
6cecdf2ade Functions: move tests closer to code 2020-07-26 12:19:11 +02:00
13abacaaf3 Particles: show which nodes are only mockups in the Add menu
More nodes will be implemented step by step. I don't remove/disable these nodes,
so that it is still possible to add them.
2020-07-25 21:01:57 +02:00
14326619a1 Cleanup: avoid using namespace name in many cases 2020-07-25 20:39:21 +02:00
1e999c7bdb Particles: initial Quick Particles operator
This operator automates the following steps:
1. Create a point cloud object.
2. Create a simulation data block.
3. Add a small particle simulation to the node tree.
4. Add a Simulation modifier to the point cloud object.
5. Reference the particle simulation from the modifier.

You have to go back to frame 1 to start the simulation.
The simulation is not yet cached and cannot be rendered.

The bounding box of the point cloud object is enabled for now,
because otherwise it is hard to select the object.
2020-07-25 20:24:36 +02:00
04d46bdb83 Pointcloud: workaround for a viewport drawing issue 2020-07-25 20:19:55 +02:00
89f4191a53 Allocator: fix build error with -Werror=format-security 2020-07-25 15:10:24 +02:00
0ae2a1d12a Particles: improve emitter when object is animated 2020-07-25 14:51:15 +02:00
d52e45c89e Merge branch 'blender-v2.90-release' 2020-07-25 21:31:16 +10:00
a8d058dbf4 Fix T79260: Crash displaying the same mesh in two windows 2020-07-25 21:30:08 +10:00
790d3804d0 Merge branch 'blender-v2.90-release' 2020-07-25 20:50:38 +10:00
4ca8f25fa8 Fix T79239: UV path select crash 2020-07-25 20:48:40 +10:00
82db64ed80 Merge branch 'blender-v2.90-release' 2020-07-25 20:36:31 +10:00
537c57136f Fix T79254: FCurve editor crash when zooming out to limit 2020-07-25 20:32:07 +10:00
eeaa4379aa Simulation: cleanup dna data 2020-07-25 11:54:06 +02:00
ddd4fec386 Merge branch 'blender-v2.90-release' 2020-07-25 17:19:49 +10:00
2308668bac Fix T72622: Transform object origin ignores shape keys
D8367 by @paul2t with edits.
2020-07-25 17:19:13 +10:00
273f50a333 Merge branch 'blender-v2.90-release' 2020-07-24 13:13:42 -03:00
d7c4e96493 Cleanup: Rename 'isect_ray_seg_v3' to 'isect_ray_line_v3'
The name was misleading as it returns true whenever it intersects the
line represented by the points.
2020-07-24 12:07:58 -03:00
9a117fcdae GPencil: Add more randomness to random stroke color
The old method produce a small range of similar colors.
2020-07-24 16:24:04 +02:00
704d581aea Merge branch 'blender-v2.90-release' 2020-07-24 15:39:11 +02:00
c64b12c0b8 Fix OptiX being shown as available on first generation Maxwell GPUs
The OptiX kernels are compiled for target "compute_sm_52", which is only available on second
generation Maxwell GPUs, so disable support for older ones.
2020-07-24 15:36:09 +02:00
50ff450202 Cleanup: can use guarded instead of raw allocator now 2020-07-24 13:47:57 +02:00
74fcb4d4c2 Particles: initial particle birth action
A particle action is some function that is triggered by some event.
Right now, users cannot control this. There is just a
randomize-velocity on-birth action. So the direction of spawned
particles is slightly randomized now.

This also adds a new integer attribute called "Hash" which is
useful for a number of things. Mainly for generating random numbers
for a specific particle. The ID of a particle is not necessarily a good source
of randomness.
2020-07-24 13:37:55 +02:00
f495b583be Merge branch 'blender-v2.90-release' 2020-07-24 12:40:20 +02:00
ec17b45034 Depsgraph: use construct on first use idiom for graph registry
This is necessary to avoid false positive memory leaks.
2020-07-24 12:38:04 +02:00
236ca8fbe8 Allocator: make leak detection work with static variables
When definining static variables that own memory, you should
use the "construct on first use" idiom. Otherwise, you'll get
a warning when Blender exits.

More details are provided in D8354.

Differential Revision: https://developer.blender.org/D8354
2020-07-24 12:26:11 +02:00
b53c46d760 BLI: add MultiValueMap
This is a convenience wrapper for `Map<Key, Vector<Value>>`.
It does not provide any performance benefits (yet). I need this
kind of map in a couple of places and before I was duplicating
the lookup logic in many places.
2020-07-24 12:15:13 +02:00
141deeefff DNA: disable 'int8_t' since it's not properly supported
Currently negative values from this type will be changed if the
int8_t changes to a int16_t for e.g.
2020-07-24 19:41:50 +10:00
22b8ac80d2 Merge branch 'blender-v2.90-release' 2020-07-24 11:24:57 +02:00
3886392430 Fix interface artifacts on Intel GPUs
This is a continuation of fix for T78307. Turns out instancing do not
work at all, so enforce single widget drawing on macOS and Intel GPU.

It was also reported that certain AMD and Mesa driver suffer from
similar issue, so disabled instancing for this configuration as well.

Differential Revision: https://developer.blender.org/D8374
2020-07-24 11:23:39 +02:00
13fa4b9898 Cleanup: remove redundant glReadBuffer call when reading pixels 2020-07-24 19:01:13 +10:00
1a5945e2c3 Merge branch 'blender-v2.90-release' 2020-07-24 16:21:47 +10:00
2bd2db120e Fix T79209: Empties have disabled viewport display settings 2020-07-24 16:20:30 +10:00
2a186af2b3 Merge branch 'blender-v2.90-release' 2020-07-24 15:58:30 +10:00
0e9999a93e Fix shape key pin toggle drawing as disabled in edit-mode
Pin can be used in edit-mode when shape key in edit-mode is enabled.
2020-07-24 15:55:11 +10:00
ba99b12287 Cleanup: use doxy sections, update comments missed from refactor 2020-07-24 13:58:32 +10:00
698af2e774 Try to fix build error
Not sure if this is the correct fix, because I can't reproduce the error.
2020-07-24 00:35:51 +02:00
0b50ea51cc Particles: simulate partial time steps on newly emitted particles 2020-07-23 23:03:19 +02:00
f359672c35 Particles: spawn particles on mesh surface 2020-07-23 22:30:22 +02:00
c049fe7979 Merge branch 'blender-v2.90-release' 2020-07-23 12:50:59 -06:00
9cbf43801b Fix T79187: Outliner "Make Single User" crash
When "ID Data" -> "Make Single User" is chosen with selected elements
that are not curves, there is a crash. This fix ensures that the id in the
callback function is an Action.
2020-07-23 12:40:33 -06:00
5ccb0f46dd Merge branch 'blender-v2.90-release' 2020-07-23 18:10:28 +02:00
954aa441bf Fix: Incorrect VR pose after changing landmark
Once the base pose was changed (e.g. by changing the active landmark), we'd always run the logic to reset to the base pose. That would mess up the final viewer pose.
Think this only got exposed through 607d745a79.
2020-07-23 18:08:24 +02:00
149bb0c26d Cleanup: unify naming between different spans 2020-07-23 18:07:44 +02:00
87c0a38a39 GPencil: Fix unreported missing frames in interpolation
When interpolate, the temp frames are tagged, and later removed. If for any reason any stroke was tagged in other area of Blender (this tag is used for temp tagging), the stroke could be removed by error when run interpolation.

In a previous fix, the tag was cleared before, but only for the frame range of the interpolation. Now, the clear is done for all frames.

Also, instead to clear for each stroke sampling, now it's done only once at invoke time.
2020-07-23 17:59:18 +02:00
766edbdf1f Particles: improve mesh emitter
Particles are now emitted from vertices of the mesh.
2020-07-23 17:57:11 +02:00
67857b5d9f Cleanup: avoid zero byte memcpy
Asan reports warnings because of this.
2020-07-23 17:55:05 +02:00
cf123da640 BLI: Add MutableSpan.copy_from method 2020-07-23 17:54:31 +02:00
4619562e2f Merge branch 'blender-v2.90-release' 2020-07-23 17:15:58 +02:00
ad586e7eeb LibOverride: Add update of overrides when reloading library data.
Pretty straight-forward, although it does not rebuild relationships
(this is a heavy process we do not want to automate for now, will be a
separate operator in near future).

Fix T78179: Library Overrides - Additional geometry not updating without reloading scene.
2020-07-23 17:15:32 +02:00
50cb693f1d Cleanup: Clang format. 2020-07-23 17:15:32 +02:00
ad6cfcef01 Fix (unreported) crash in reload library code related to shpaekeys.
Once again, we need lots of unatural twisting and convolutions to get
those nasty things to work...

Note that in previous versions of Blender, this would not crash, but was
still broken (shapekeys were never actually reloaded from libraries).
2020-07-23 17:15:32 +02:00
706b690ec6 Fix (unreported) bad handling of pointers in overrides with shapekeys. 2020-07-23 17:15:32 +02:00
6f3c37a3ff UI: Move properties tab list creation from RNA to editor
This is a change I pulled from the property-search-ui branch,
where I have to use the list of tabs to search the inactive tabs
and it makes more sense to use the array directly.

It is also an improvement to have this fundamental code to the
properties editor in the editor code rather than an RNA callback.

There are no functional changes.

Differential Revision: https://developer.blender.org/D8368
2020-07-23 11:01:59 -04:00
c9975d19b5 Merge branch 'blender-v2.90-release' 2020-07-23 15:47:47 +02:00
8d35dceb14 DNA: support fixed size integers
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8373
2020-07-23 15:42:45 +02:00
c8b24af1b2 BLI: move some tests into blenlib/tests
Reviewers: sybren

Differential Revision: https://developer.blender.org/D8315
2020-07-23 15:23:55 +02:00
ee98dc8d0f Fix T77277: building depsgraph inter-driver relations is slow
The extra depsgraph relations that were added to prevent threading
issues during evaluation (rB4c30dc343165) caused a considerable slowdown
on complex scenes with many drivers (T77277, T78615). This commit
improves this as follows.

Only the following drivers are considered for execution serialisation:
- Drivers on Array elements, and
- Drivers on Boolean or Enum properties.

Relations between drivers of the same arrays are added blindly, i.e.
without checking for transitive or cyclic relations. This is possible as
other relations will just target the `PROPERTIES_ENTRY` or
`PROPERTIES_EXIT` nodes.

Checking whether a driver is on an array is first done by checking
`array_index > 0`, and then falling back to resolving the RNA path to an
RNA property and inspecting that.

The code also avoids circular dependencies when there are multiple
drivers on the same property. This not something that is expected to
happen (both the UI and the Python API prevent duplicate drivers), it
did happen in a file (F8669945, example file of T78615) and it is easy
to deal with here.

Reviewers: sergey

Subscribers: mont29

Comment update
2020-07-23 14:52:46 +02:00
37ad90c35f Fix T29189 bevel crash.
New code to calculate UV islands made an incorrect assumption about
maximum stack size.
2020-07-23 08:44:34 -04:00
4ae24c0b57 Fix T79189 bevel crash.
New code to calculate UV islands made an incorrect assumption about
the maximum size of a stack.
2020-07-23 08:27:10 -04:00
be1969d2a4 Merge branch 'blender-v2.90-release' 2020-07-23 08:42:40 -03:00
b64ae920e4 Fix T79158: Eevee cubemaps shows black
Same as T75943 that was fixed by rBff97545c50f4
2020-07-23 08:41:35 -03:00
65aba4fc7a Fix T79158: Eevee cubemaps shows black
Same as T75943 that was fixed by rBff97545c50f4
2020-07-23 08:37:41 -03:00
634585aa68 Simulation: add depsgraph relations for ids referenced by node tree
I'll really have to refactor `ntreeUpdateTree` soon to avoid scanning
all node trees multiple times.
2020-07-23 12:09:36 +02:00
6596891121 Merge branch 'blender-v2.90-release' 2020-07-23 11:45:44 +02:00
bfeff73252 LibOverride: Add reset operations to the outliner menu. 2020-07-23 11:33:24 +02:00
60b80ce142 LibOverride: Add core functions to reset a library override.
This means that we delete all override properties except for those over
ID pointers *if* the assigned pointer matches the linked data hierarchy.

Then we reload affected datablocks.
2020-07-23 11:33:24 +02:00
79440c37ac LibOverride: Store RNA prop type in override properties.
Storing this info will help with dealing with reset operations and the
like (as we do not want to reset overrides of ID pointers essentially).
2020-07-23 11:33:24 +02:00
fa21ba0179 LibOverride: Outliner override creation: Better checks.
Enhance checks for which ID is valid for the override creation
operation.
2020-07-23 11:33:24 +02:00
d998258fa6 LibOverride: Make ID_IS_OVERRIDABLE_LIBRARY macro more correct. 2020-07-23 11:33:24 +02:00
ef17e7e51b LibOverride: Move override operations into own section of the ID outliner menu.
Also cleanup naming in outliner's override callbacks.
2020-07-23 11:33:24 +02:00
85157e74b3 LibOverride: Fix missing ID update tag in BKE_lib_override_library_update. 2020-07-23 11:33:24 +02:00
ad602a3f03 LibOverride: change runtime data into a real struct.
Needed for upcoming changes.
2020-07-23 11:33:24 +02:00
c8653e516d LibOverride: Optimize/fix new generic 'relation-based' make override code.
This commit mostly avoids following 'loop back' ID pointers, since those
should never define an actual relationship.
2020-07-23 11:33:24 +02:00
8a5da947dc Fix error in 'preferences.copy_prev' checking for the last version
The check to avoid updating between major releases prevented
2.90 files being copied to 2.91
2020-07-23 18:43:37 +10:00
944df0c784 Cleanup: remove incorrect comment 2020-07-23 10:39:22 +02:00
62e53788aa Merge branch 'blender-v2.90-release' 2020-07-23 17:35:40 +10:00
67002402bd Fix T79162: 'prop_search' includes ID prefix in string properties
Regression from d6cefef98f

This also fixes an unreported issue where finding an exact match
wasn't being detected for items that contained an ID prefix.
2020-07-23 17:24:17 +10:00
8438ef4d8e Cleanup: update comments, remove disabled code 2020-07-23 14:04:18 +10:00
19afb0ea67 Cleanup: remove redundant static variable use
This hasn't been needed since Python 3.7x.
2020-07-23 13:59:07 +10:00
797820fc20 Cleanup: replace wchar_t with char32_t 3D text accent input 2020-07-23 12:39:03 +10:00
ce4c2b8f0b Merge branch 'blender-v2.90-release' 2020-07-23 12:24:55 +10:00
4b31f4ace7 UI: disable add-object tool for 2.90 release
This needs improvements which need user testing before this can
be considered finished, even on a basic level.
2020-07-23 12:23:43 +10:00
e5cd770e9f Cleanup: rename Curve.len_wchar to len_char32
The name was misleading as the length is for char32_t, not wchar_t.
2020-07-23 11:50:03 +10:00
06e84fef88 Cleanup: unused argument 2020-07-23 11:39:49 +10:00
a51048a5d3 Simulation: add todo comment 2020-07-22 19:29:38 +02:00
4d6ac72264 Nodes: add missing update tags in the case of simulation node trees 2020-07-22 19:16:33 +02:00
e77644982c Depsgraph: build ids referenced by sockets 2020-07-22 19:16:33 +02:00
e0400d0a1c Simulation: move responsibility of updating persistent data handles
This solver should not be responsible for updating the handles.
2020-07-22 19:16:33 +02:00
0a5ef40c2c Simulation: fix memory leak 2020-07-22 19:16:33 +02:00
750899fd31 Simulation: improve depsgraph integration
A simulation data block has an embedded node tree, which requires
special handling in a couple of places. Some of those places were
missing beforehand.

This also adds a relation to make sure that the simulation is evaluated
after animations on the embedded node tree are evaluated.
2020-07-22 19:16:33 +02:00
921c95ab5e Fix T79144: Snapping bypassing the viewport backface culling
Silently activate the backface culling when the viewport is using.
2020-07-22 12:00:02 -03:00
72fc70879c Cleanup: Fix strict compiler warning 2020-07-22 16:52:00 +02:00
6f3ba033f8 Merge branch 'blender-v2.90-release' 2020-07-22 10:12:51 -04:00
0e280b96ca Fix T79160: Bevel modifier set to vertices by default
Need to properly initialize the affect_type field.
2020-07-22 10:02:52 -04:00
Nathan Letwory
5a1a4f4dd2 master is now 2.91.0 alpha. 2020-07-22 16:48:29 +03:00
Nathan Letwory
62a0e1d54f Merge branch 'blender-v2.90-release' 2020-07-22 16:47:26 +03:00
Nathan Letwory
a4e3943a08 Release branch is now in beta. 2020-07-22 16:41:29 +03:00
1fb9b6b1a1 UI: Use property split for simulation modifier 2020-07-22 09:16:17 -04:00
Nathan Letwory
0c0a9dabc7 Ensure submodules are at their correct commits. 2020-07-22 16:15:53 +03:00
4950022e7d Object: add-object option to place on the surface normal
Optionally use the surface normal under the mouse cursor.
2020-07-22 22:38:40 +10:00
980dd43bd4 Particles: give emitter its own state
High quality emitters need to maintain state themselves. For example,
this it needs to remember when it spawned the last particle.
This is especially important when the birth rate is changing over time.
Otherwise, there will be very visible artifacts.

It is quite likely that other components of the simulation need their own
state as well. Therefore, I refactored the `SimulationState` type a bit,
to make it more extensible. Instead of using hardcoded type numbers, a
string is used to identify the state type. Also, instead of having switch
statements in many places, there is a new `SimulationStateType` that
encapsulates information about how a specific state is created/freed/copied/...

I removed the integration with the point cache for now, because it was
not used anyway in it's current state.
2020-07-22 14:16:08 +02:00
47b6c33258 GPencil: New BKE function for setting random vertex color
This function is very handy for debug purposes.
2020-07-22 11:16:45 +02:00
Yevgeny Makarov
8f658ec27c UI: use term 'Vertex' instead of 'Vert' 2020-07-22 16:22:23 +10:00
ef52a9f791 Fix UV select flush error in recent loop select cleanup
Regression from d99b343b31
2020-07-22 16:02:46 +10:00
077a2f7bbb Cleanup: minor changes to doxy sections and naming
Use py_bl_math prefix instead of M_Math.
2020-07-22 15:24:10 +10:00
Cody Winchester
5c28955d3a Modifiers: option to preserve custom normals for subsurf & multires 2020-07-22 15:07:21 +10:00
a197b81090 Docs: include 'bl_math' module 2020-07-22 14:36:30 +10:00
b5194520e3 Fix T79148: UV Edge ring select doesn't select edges
While UV doesn't yet support edge selection, it can
when sync select is enabled.
2020-07-22 14:33:26 +10:00
83cb4f5f8f Cleanup: spelling 2020-07-22 11:57:04 +10:00
7fc9666c89 Cleanup: use elif for sculpt tool checks 2020-07-22 11:29:53 +10:00
59e48d8fe4 Wayland: draw opaque background when OpenGL alpha is enabled 2020-07-22 10:57:42 +10:00
cfa788cf9a GPU: clear color with 1.0 alpha
This impacts GHOST/Wayland which draws windows using alpha.
2020-07-22 10:57:41 +10:00
607d745a79 VR: Change how landmarks affect viewer pose
* Changing to a landmark moves the view exactly to it, rather than
  keeping the current position offset.
* Disabling positional tracking moves the viewer back to the landmark
  position.
This is a more predictable and practical way to use landmarks. See
feedback in T71347.

On the code side, I did some cleanup so the logic flow is more clear.

Note: This is entirely untested. I currently don't have access to a
device. There might be issues, tomorrow I'll hopefully get feedback.
2020-07-22 00:05:56 +02:00
878d191bae Sculpt: Add extra deform types to Slide
This adds extra deform modes to the slide mode of the Topology
Slide/Relax brush (both slide and smear are almost identical).
This is useful to move topology to a specific area to add more localized
details

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8349
2020-07-21 22:59:07 +02:00
46b126a2c8 UI: Small changes to bevel active tool layout
- Exposes affect enum in the header instead of profile type.
 - Add two missing options from the operator
2020-07-21 16:47:58 -04:00
69afdf6970 Sculpt: Support pen pressure modulation in Paint Brush properties
This allows to use pen pressure modulation in hardness, wet mix, wet
persistence, flow and density, as well as inverting the modulation (more
pressure, less density...). With this, it is possible to create brushes
that mix paint or apply a new color based on the pressure.

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D8267
2020-07-21 22:43:39 +02:00
4aa2a5481c Bevel: Refactor "Vertex Only" to an enum
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.

 This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.

Tests are adjusted and still pass.
2020-07-21 16:32:00 -04:00
a39da2cbca Fix T79056: Topology automasking artifacts in multires
Both to_v and form_v need to be included. From_v is needed to include
the active vertex when there is only one vertex in the radius of the
brush, to_v needs to be included to add all grids duplicates

Reviewed By: sergey

Maniphest Tasks: T79056

Differential Revision: https://developer.blender.org/D8347
2020-07-21 22:27:44 +02:00
7aabd74222 Fix T79007: Smooth brushes crasing in dyntopo
The custom smooth functions for bmesh and meshes where removed and
replaced by a generic smooth function using the sculpt API, which needs
to initialize the bmesh indices in order to be used

Reviewed By: sergey

Maniphest Tasks: T79007

Differential Revision: https://developer.blender.org/D8333
2020-07-21 22:26:42 +02:00
b453e9e3a4 Cleanup: move 'int i' declaration
It is preferable that the value used for interators is defined
close to where it is used.
2020-07-21 14:02:13 -03:00
f8cc01595d Drivers: add lerp and clamp functions to namespace.
Implementation of lerp without a function requires repeating one of
the arguments, which is not ideal. To avoid that, add a new function
to the driver namespace. In addition, provide a function for clamping
between 0 and 1 to support easy clamped lerp, and a smoothstep function
from GLSL that is somewhat related.

The function implementations are added to a new bl_math module.
As an aside, add the round function and two-argument log to the
pylike expression subset.

Differential Revision: https://developer.blender.org/D8205
2020-07-21 19:01:50 +03:00
8369adabc0 Particles: initial object socket and emitter node support
Object sockets work now, but only the new Object Transforms and the
Particle Mesh Emitter node use it. The emitter does not actually
use the mesh surface yet. Instead, new particles are just emitted around
the origin of the object.

Internally, handles to object data blocks are passed around in the network,
instead of raw object pointers. Using handles has a couple of benefits:
* The caller of the function has control over which handles can be resolved
  and therefore limit access to specific data. The set of data blocks that
  is accessed by a node tree should be known statically. This is necessary
  for a proper integration with the dependency graph.
* When the pointer to an object changes (e.g. after restarting Blender),
  all handles are still valid.
* When an object is deleted, the handle is invalidated without causing crashes.
* The handle is just an integer that can be stored per particle and can be cached easily.

The mapping between handles and their corresponding data blocks is
stored in the Simulation data block.
2020-07-21 17:35:09 +02:00
6c7e62ef9b UI: Adjust Multiresolution Modifier Layout
Adjusting the layout for this modifier is the final part of the modifier UI
project for 2.90. This layout exposes the most important information,
the levels and subdivision controls, by default, putting other contols
in collapsed subpanels.

Note that there is empty space for the "Delete Lower" button
that is still planned for 2.90. And there will also eventually be more
items added to the "Shape" panel, maybe for 2.90.

Differential Revision: https://developer.blender.org/D8187
2020-07-21 11:27:05 -04:00
17ebbdf1c1 UI: Use consistent layout for custom operator UI
Operators are one of the last places in Blender to use older UI designs
that don't fit in with recent style conventions. This commit updates
these custom operator UI callbacks for consistency and clarity.

Some of the code is also simplified a lot. Some of the older operator layouts
were much more complex (in terms of code) than they needed to be.

See the differential revision for a before and after screenshot
of each operator.

Differential Revision: https://developer.blender.org/D8326
2020-07-21 11:13:18 -04:00
c2b0c64843 UI: Add an outer boundary for edge panning, use in outliner
Currently if you drag and drop an item from the outliner elsewhere in
the Blender window, the outliner will scroll the entire time, even if the
mouse is far away. This commit adds optional behavior for the edge pan
operator that makes it only act if the mouse is close enough to the region.

Differential Revision: https://developer.blender.org/D8193
2020-07-21 10:12:35 -04:00
696c23f284 Cleanup: Comments. 2020-07-21 16:00:39 +02:00
cd6250c220 Fix (unreported) broken code in recent override operator enhancements.
When overriding a whole linked collection from a single object in
3DView, said 'reference' object would be removed by code. We only want
that behavior when overriding from an instanciating Empty.
2020-07-21 16:00:39 +02:00
d42530824e Fix T78994: Clear selected pose doesn't work without animation
It looks like the code left this as a todo, but the basic solution is to
add an extra parameter to BKE_bose_rest to check whether bones
are selected before reseting them.

I also corrected the operator description which said it acted on only
selected bones even when there is an option to turn that off. The
"act on selected" is generally implied for Blender's operators anyway.

Differential Revision: https://developer.blender.org/D8319
2020-07-21 09:51:27 -04:00
6b6e2e742f Fluid: Updated Mantaflow source files
Updated files include fixes for the mesh IO - read/write success was not propagated.
2020-07-21 15:22:40 +02:00
727e569ac3 Cleanup: CodeQuality: Replace OB_DRAWXRAY by OB_DRAW_IN_FRONT
This is to match the option name and to avoid confusion with
workbench xray mode.
2020-07-21 14:44:37 +02:00
3fe5c0e5df Fluid: Cleanup unused variables 2020-07-21 14:38:26 +02:00
5904953d22 Tests: IO, fixed a memory leak in the USDHierarchyIteratorTest
No functional changes to Blender.
2020-07-21 14:10:42 +02:00
269c184ac9 Cleanup: IO, renamed delete_object_writer()release_writer()
The function is called for all writers, not just 'object' writers.
Furthermore, it's called by the function `release_writers()`, so now the
name is consistent with that as well.

No functional changes.
2020-07-21 14:10:42 +02:00
6b6970d43f Tests: fix link errors when USD and Alembic are disabled
The unit tests for `bf_io_common` didn't actually link against
`bf_io_common`, so when both USD and Alembic were disabled, nothing
would link against that library and building the tests would fail.
2020-07-21 14:10:42 +02:00
bafe22e8ce Fix T79112: Redo shrink/fatten uses negative values
The numbers in the redo panel were negated compared to the value
entered while transforming.
2020-07-21 21:36:10 +10:00
6778ef4dcc Fix T78867: Crash related to viewing video files
Any time FFmpeg was used to get a picture Blender would crash
when FFmpeg 4.3 is used. This affects thumbnails, VSE, Clip Editor.

Caused by a bug in FFmpeg which lead to crashes when unaligned
buffer was passed to sws_scale(). It got fixed later on in FFmpeg,
but for portability and compatibility reasons still nice to avoid
crash, especially since it's not so difficult to do.

FFmpeg ticked number is #8747
The FFmpeg Git hash with the fix: ba3e771a42c2

Differential Revision: https://developer.blender.org/D8355
2020-07-21 12:49:20 +02:00
1c0fa3aff6 GPencil: Reorganize Snap pie menu
Put the options in the same position of meshes.

related to T79094
2020-07-21 12:36:22 +02:00
494a6a0bf2 Cleanup: layer_collection_sync: use LISTBASE_FOREACH_MUTABLE. 2020-07-21 12:18:08 +02:00
629726177a Cleanup: layer_collection_sync: use proper naming.
Previous ones were extremely confusing and innacurate (probably
inherited from older versions of scene collections?).

Also, use named fields in struct initialization, much much safer and
cleaner than anonymous, positionned-based thing.
2020-07-21 12:18:08 +02:00
0bfec04cd5 Fix T72621: Transform object origin support for grease-pencil
Added support for transforming only origins with greasepencil objects.

The new functions is based on BKE_gpencil_transform. That is why there is FIXME statements in there.

Reviewed By: Campbell, Antonio

Differential Revision: http://developer.blender.org/D8303
2020-07-21 12:13:03 +02:00
ece6d8b25a Fix (unreported) bad handling of detection of what to override from 3DView in some cases.
Having a directly linked object does not always mean it should be
considered as really overridable...
2020-07-21 11:59:50 +02:00
b277a75a3b Fix (unreported) LibOverride creation adding things to linked collections.
This is strictly forbidden, and sill cause crashes with undo in some
cases...
2020-07-21 11:59:50 +02:00
8c916a3aec Fix T79066: Entering Edit Mode when Viewport Display set as Wire or Bounds leads to crash 2020-07-21 11:50:21 +02:00
fdc3f56234 Cleanup: convert unsigned to signed comparison in assert
Thanks to Campbell for pointing this out.
2020-07-21 09:03:37 +02:00
c46663ad66 Cleanup: spelling 2020-07-21 16:02:58 +10:00
b31d3d1202 Fix UV edge/face sync selection from recent sticky select cleanup 2020-07-21 15:46:14 +10:00
2bc1fd7e91 Cleanup: simplify sticky UV selection
Use BMesh connectivity information instead of looping over all
geometry to flush the sticky selection.
2020-07-21 14:54:41 +10:00
b88dd3b8e7 UV: remove selection threshold for nearby coordinates
Internally UV selection considered close UV's to be connected.
While this could be convenient in some cases,
it complicates logic for more advanced selection operations that
need to check when UV's should be considered part of the same vertex
since simple threshold checks would give different results depending
on the order of UV's tested.

Users must now run "Merge by Distance" instead of relying
on this selection threshold.
2020-07-21 14:32:21 +10:00
50fe187443 Cleanup: improve comment for disabled readfile allocation naming
Also allocate the required amount instead of a fixed size.
2020-07-21 12:25:20 +10:00
731d9f0bfa Fix T78733 Bevel sometimes produces zero-area UV face with odd segments.
A bug introduced when I made the choice of interpolation face cleverer.
2020-07-20 16:08:43 -04:00
ed870f87b9 Fix weird placement of "Motion Tracking" in 3D View overlay popup
There was a weird looking gap between the checkbox and the "Motion Tracking"
label. Plus, the label could not be clicked to change the value, unlike
usually.

Issue is that the row is actually a sub-panel header. The checkbox being drawn
with the draw_header() callback, and the label being added as separate item by
the popover panel code. This adds a hack so the checkbox can add the panel
label itself (the popup drawing skips adding the label then). That addresses
mentioned issues.
2020-07-20 19:54:43 +02:00
d40c39fca0 Cycles: adjust Sky texture intensity to follow physical units
The sky will appear brighter than before by default. To compensate for this,
lower exposure in the Film panel. The default altitude was also changed from
90 to 15 degrees.

Patch contributed by Marco with the help of Ryan Jones.

Differential Revision: https://developer.blender.org/D8285
2020-07-20 19:31:42 +02:00
Miguel Pozo
52543be9a6 Python API: option to use OpenGL context in RenderEngine.render
When bl_use_gpu_context is set, an OpenGL context will be available for
OpenGL based render engines.

Differential Revision: https://developer.blender.org/D8305
2020-07-20 19:31:42 +02:00
a9644c812f Cycles: Use pre-compiled PTX kernel for older generation when no matching one is found
This patch changes the discovery of pre-compiled kernels, to look for any PTX, even if
it does not match the current architecture version exactly. It works because the driver can
JIT-compile PTX generated for architectures less than or equal to the current one.
This e.g. makes it possible to render on a new GPU architecture even if no pre-compiled
binary kernel was distributed for it as part of the Blender installation.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8332
2020-07-20 19:25:27 +02:00
a5ded0720c Fix (unreported) broken deletion of Shapekeys alongside their owner ID.
Trying to get shape key pointer after having unlinked its owner from
Main data-base is rather useless... So those shapekeys ended up never
being deleted.
2020-07-20 19:18:45 +02:00
bb63ce9839 Fix (unreported) bad handling of shapekeys when applying override rules.
We need to do a full proper swap of those shape keys as well, previous
code ended up breaking relationships between data-blocks...
2020-07-20 19:18:45 +02:00
62a819202e Fluid: Refactored smoke noise system
This refactor is in response to reports in which the adaptive domain with noise caused a crash (e.g. T79009). It should also fix issues where the smoke appeared to be cut off when using the adaptive domain together with noise. It is also possible that some of these changes improve the lines issue from T74559.
2020-07-20 18:35:52 +02:00
Adrian Newton
7d85495ab9 UI: Fix File Broswer filter checkbox not connected to label
Differential Revision: https://developer.blender.org/D8168

Reviewed by: Hans Goudey, Julian Eisel
2020-07-20 17:36:43 +02:00
4432209849 Fix T78321 Eevee: Motion blur crash rendering animation with high steps count
This was caused by `BPy_*_ALLOW_THREADS` being used when it shouldn't.

Implemented the simple fix suggested by @brecht :

> The simplest solution may be to ensure that Python stuff is only done
> when called through the RNA API, and not when Eevee calls it directly.
2020-07-20 17:23:28 +02:00
7484e45297 Fix T78960: 2.83.2 not opening a 2.82a project correctly.
That project cannot be opened correctly ayway, it has recursive
collections intanciating themselves...

But at least now we have a check at startup to detect and 'fix' those
nasty cycles in collections.
2020-07-20 17:04:16 +02:00
ccc2a7996b BLI: add typedefs for containers that use raw allocators
Those are useful when you have to create containers with static
storage duration. If those would use Blender's guarded allocator,
it would report memory leaks, that are not actually leaks.
2020-07-20 16:03:14 +02:00
ed184050b6 Fix T78958: Library Override crash: undo make local. 2020-07-20 15:36:31 +02:00
4f4af0cbe1 Particles: support removing particles during the simulation
This still cannot be controlled by the user. Currently, all particles are
killed after two seconds
2020-07-20 15:31:05 +02:00
9016a29f19 Fix T79107: Crash changing brush size in GPencil sculpt
Reviewed By: fclem

Maniphest Tasks: T79107

Differential Revision: https://developer.blender.org/D8353
2020-07-20 15:23:00 +02:00
230f7d79ce Fix signed/unsigned comparison 2020-07-20 14:04:09 +02:00
cbf2278266 Fix T79075: Tool popup fails with experimental vertex colors enabled
Register key-maps from tools in functions.
2020-07-20 21:55:48 +10:00
ac5f011e9c Fix T70455: Knife Tool failing to cut edges
Analyzing the cuts, the points shown in the viewport (indicating the
previous and current cuts) do not correspond to the final cuts.

Sometimes a point, even snapped to a vert, is a point that cuts an edge and
sometimes a point, even snapped to an edge, is a point that cuts only the face.

This is because the detection of snapping vertices from mouse is different
from the "snap" that detects vertices that are cut.

So small projection inaccuracies can result in detection failures.

The solution for this is simply to confirm the cuts whose vertices
indicate the `prev` ou and `cur` point.

The tolerance distance does not need to be calculated in these cases.
2020-07-20 08:52:11 -03:00
33ad95b677 Animation: Fix MSVC warning about C incompatibility of AnimationEvalContext
Thanks @JacquesLucke for pointing this out.

No functional changes.
2020-07-20 13:14:00 +02:00
579b180053 BLI: add Vector/Array.fill methods 2020-07-20 13:02:10 +02:00
8cbbdedaf4 Refactor: Update integer type usage
This updates the usage of integer types in code I wrote according to our new style guides.

Major changes:
* Use signed instead of unsigned integers in many places.
* C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`).
* Hash values for C++ containers are 64 bit wide now (instead of 32 bit).

I do hope that I broke no builds, but it is quite likely that some compiler reports
slightly different errors. Please let me know when there are any errors. If the fix
is small, feel free to commit it yourself.
I compiled successfully on linux with gcc and on windows.
2020-07-20 12:16:20 +02:00
Sybren A. Stüvel
686ab4c940 T77086 Animation: Passing Dependency Graph to Drivers
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.

Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:

```
typedef struct AnimationEvalContext {
  struct Depsgraph *const depsgraph;
  const float eval_time;
} AnimationEvalContext;
```

These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.

FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.

There are two functions that allow creation of `AnimationEvalContext`
objects:

- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
  eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
  *anim_eval_context, float eval_time)`, which can be used to create a
  `AnimationEvalContext` with the same depsgraph, but at a different
  time. This makes it possible to later add fields without changing any
  of the code that just want to change the eval time.

This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D8047
2020-07-20 11:51:09 +02:00
6fbfa522e6 GPencil: Fix unreported wrong SNAP menu in Point Context menu
It was using the mesh menu instead of GPencil one.
2020-07-20 11:10:47 +02:00
e4daac84b6 Fix T79094: GPencil Snap menu with Shift+S not pie menu
In order to keep UI consistency, now it's a pie menu.
2020-07-20 11:07:28 +02:00
eb5cd628bd Fix T79089: Crash changing themes
Regression from 2840782d84.
2020-07-20 17:52:58 +10:00
b219ae4498 Fix T79077: Off-screen rendering ignores shading argument
Thumbnails used the 3D view shading mode when a camera wasn't used.
2020-07-20 11:32:26 +10:00
615af4e239 DRW: draw hook relationship lines
This wasn't added back from 2.7x, making "Recenter Hook" applier to
do nothing.
2020-07-20 09:25:26 +10:00
9db4e44961 DRW: overlay engine support for drawing isolated points
This matches similar functionality for drawing lines.
2020-07-20 09:19:50 +10:00
Yevgeny Makarov
78e40ad21f UI: use "Recalculate" instead of "Recalc" 2020-07-20 07:23:16 +10:00
6247ec7827 Fix T78977 GPU: blf fonts are not gamma corrected 2020-07-19 23:00:22 +02:00
3884d78e49 Particles: Make it easier to add attributes internally 2020-07-19 22:06:35 +02:00
5063820c9b Particles: Emit particles over time
This adds a basic internal emitter for every particle simulation.
The emitter cannot be controlled by the user yet. That will
come next.
2020-07-19 13:58:58 +02:00
8c90910dcc Fix T66937: Blank view on navigation with auto-deph & large clip-end 2020-07-19 21:27:13 +10:00
ccd2af43b3 Fix T78624: Crash running operators from Python in background mode 2020-07-19 18:59:14 +10:00
52a7c724b5 Cleanup: unused argument warning 2020-07-19 17:43:59 +10:00
71d0f6f896 Cleanup: spelling 2020-07-19 17:37:02 +10:00
b8601b64c7 Correct Blender version after last commit
c08d847488 incremented the patch version instead of the file subversion
for versioning code when adding new options. This commit resets the patch
version and instead bumps the file subversion.
2020-07-18 12:26:32 -04:00
c08d847488 UI: Status Bar Statistics and Other Options
Status Bar can show scene statistics, memory usage, version, etc set by context menu. Part two of T75672.

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

Reviewed by Julian Eisel
2020-07-18 07:49:25 -07:00
fe49e4139c Simulation: cleanup deduplicating attribute input nodes 2020-07-18 10:51:38 +02:00
9eaa48f520 Simulation: cleanup how data inputs are handled 2020-07-18 10:19:26 +02:00
fd67b521b9 Simulation: deduplicate code that finds particle simulation names 2020-07-18 10:08:53 +02:00
63db971a00 Simulation: fix memory leak 2020-07-18 10:06:36 +02:00
1dd381828f UV: edge-ring selection support
Matches edit-mesh edge-ring selection.
2020-07-18 16:09:17 +10:00
c48ccb38cb BMesh: utility for checking shared edge with limit argument 2020-07-18 15:54:04 +10:00
4e73ba2cab Cleanup: split UV loop select out of mouse picking function 2020-07-18 15:43:37 +10:00
f24ccedc18 UV: utility functions for sticky select setting
Support setting vert/edge/face selection, using the sticky option
without performing a second loop over all faces to flush selection.

Existing selection code didn't take advantage of BMesh connectivity
since the logic is from before BMesh was included.
2020-07-18 15:37:33 +10:00
016253a648 Cleanup: spelling 2020-07-18 14:27:53 +10:00
fd08d6f391 Cleanup: unused warning 2020-07-18 14:27:30 +10:00
d99b343b31 Cleanup: UV selection
Remove commented code, move penalty calculation into own function.
2020-07-18 14:15:02 +10:00
d9228c557b Cleanup: KnifeTool: Replace glPolygonOffset by GPU_polygon_offset 2020-07-18 03:46:12 +02:00
4c28b1c74e Cleanup: GPU: Encapsulate clipDistances
This also remove some non functionnal state changes that were left
from legacy code.
2020-07-18 03:43:52 +02:00
59975b0adf Cleanup: WM: Encapsulate stereo draw buffers binding 2020-07-18 03:43:52 +02:00
8dfc31f61f Cleanup: GPU: Encapsulate glProvokingVertex 2020-07-18 03:43:52 +02:00
264b1e1e15 Cleanup: GPU: Encapsulate glFrontFace 2020-07-18 03:43:52 +02:00
5993c53a6d Cleanup: GPU: Encapsulate Backface culling 2020-07-18 03:43:52 +02:00
c14e6cdd56 Cleanup: View3D: Encapsulate OpenGL calls
Removes GL_DEPTH_RANGE query as it is not changed anywhere.
2020-07-18 03:43:52 +02:00
1f2edba1fb Cleanup: GPU: Encapsulate scissor test 2020-07-18 03:43:52 +02:00
d19b3019d9 Cleanup: GPU: Encapsulate glScissor 2020-07-18 03:43:52 +02:00
a6bd7777c2 Cleanup: GPU: Encapsulate glViewport calls 2020-07-18 03:43:52 +02:00
35f1b3e43b Cleanup: GPU: Wrap GL_UNPACK_ROW_LENGTH in GPU_state
Also go back to default value of 0 after usage.
2020-07-18 03:43:52 +02:00
faeaf53255 Cleanup: Sequencer: Use GPUTexture instead of opengl calls 2020-07-18 03:43:52 +02:00
e2305690eb Cleanup: WM: Use GPUTexture for radial control drawing 2020-07-18 03:43:52 +02:00
2d9eee15c5 Cleanup: GPU: Set default GL_UNPACK_ALIGNMENT to 1
Ogl default is 4 but for almost all cases, blender use tightly
packed format. This avoid confusion and state change for the
common case.

The only case that __might__ need alignement is DDS loader
(untested) so leaving this as it is.
2020-07-18 03:43:52 +02:00
0ef57d3fc0 Cleanup: glutil: Use GPUTexture in immDrawPixelsTexScaled_clipping
This also cleanup the code for readability.
2020-07-18 03:43:51 +02:00
122d0c8f4b Cleanup: ClipDraw: Use GPUTexture api and fix a vmem leak
Leak was silent as it was an opengl handle.
2020-07-18 03:43:51 +02:00
dcf6e12a60 Cleanup: GPUShader: Remove unused builtin shader 2020-07-18 03:43:51 +02:00
7e66616b7e Cleanup: ClipDraw: Remove usage of GPU_SHADER_3D_IMAGE_MODULATE_ALPHA 2020-07-18 03:43:51 +02:00
6d160f199c Cleanup: PaintCursor: Use GPUTexture instead of opengl calls 2020-07-18 03:43:51 +02:00
99b424334d GPU: Add immBindTexture and immBindTextureSampler 2020-07-18 03:43:51 +02:00
5b4a862f83 GPUTexture: Add better swizzle support 2020-07-18 03:43:51 +02:00
2840782d84 Cleanup: GPU: Make icon drawing use GPUTexture
This remove all gl function calls. Adds a new sampler only
for icon drawing.
2020-07-18 03:43:51 +02:00
02c09773ea Cleanup: GPU: rename bglPolygonOffset to GPU_polygon_offset
And move it to GPU module.
2020-07-18 03:43:51 +02:00
acad0d75b1 Cleanup: GPU: Replace glBlendFunc by GPU equivalent 2020-07-18 03:43:51 +02:00
3d536f69f6 UI: Use property split for custom property edit popover
The panel looks out of place with the rest of Blender's UI and the
text is cropped. With property split turned on and a few smaller
tweaks these issues are fixed.

|  Before  |  After   |
|{F8700181}|{F8700183}|

Differential Revision: https://developer.blender.org/D8322
2020-07-17 19:54:11 -04:00
aa8279648e Simulation: extract node tree parsing code to separate file 2020-07-17 21:20:51 +02:00
25582aef61 Simulation: separate code from node tree parsing and solver 2020-07-17 21:20:51 +02:00
69d14c0ddb Fix T78959: Show current frame indicator when interface is locked
When the playhead drawing moved to an overlay, a check was added to keep
it from drawing with a locked interface. This is necessary for some overlays,
but not this one, so this removes the check, making it the responsibility of
the editor.

A context function is added to make that check easier in the future.

Differential Revision: https://developer.blender.org/D8313
2020-07-17 15:18:54 -04:00
8b0df381d9 Transform: use GHASH_ITER when restoring customdata 2020-07-17 14:33:40 -03:00
d8a6eec1a3 Cleanup: Removed incorrect // namespace DEG comment
No functional changes.
2020-07-17 16:49:00 +02:00
893eb30730 Fluid: Numpy support for Mantaflow build system
Adjusted the fluid build system so that plugins that depend on numpy can be compiled as well.

Note that in this commit numpy support is still disabled. It can be enabled by re-running the Mantaflow update script with USE_NUMPY=1 and enabling WITH_MANTA_NUMPY in extern/mantaflow/CMakeLists.txt. This will happen in a future commit.
2020-07-17 16:11:21 +02:00
0cdc75ccd2 Fluid: Cleanup build system for extern mantaflow
No longer including unused dependencies. Should numpy IO be needed at some point, the Manta source update script can be configured so that the required dependencies are included again.
2020-07-17 15:58:13 +02:00
e3f8768d8a Refactor: move ParticleFunction to separate file 2020-07-17 14:23:57 +02:00
2679236047 Cleanup: avoid static initialization order issues when accessing CPPTypes
Instead of depending on static initialization order of globals use
static variables within functions. Those are initialized on first use.
This is every so slighly less efficient, but avoids a full class of problems.
2020-07-17 14:15:06 +02:00
3ef59121a4 Simulation: move initial simulation code from bf_blenkernel to bf_simulation
I removed bf_blenkernel from `nodes/CMakeLists.txt` again (added it yesterday),
because now this was causing me unresolved symbol errors... Without it, cmake
seems to link the libraries bf_simulation, bf_blenkernel and bf_nodes in the right
order. Not sure if that is just luck or if it is guaranteed.

It was possible to fix the issue by using cmakes `LINK_INTERFACE_MULTIPLICITY`,
but that is probably bad style.
2020-07-17 13:49:18 +02:00
Jeroen Bakker
9582797d4b Fix T77867: Link Duplicate Object crashes during batch creation
When using link duplicated objects it could happen that one object is
calculating the GPUBuffers and the second object is marking these
buffers invalid. This introduces threading issues.

This patch fixes this by combining the surface and surface per material
batches. Most likely the surface per material batches are used and when
requested you will most likely need the surface batch for the depth
tests and overlays.

During tests it slightly improves performance as batches aren't thrown
away without using it.

After this patch we can add a quick path for meshes with one material
and two materials.

Alternative approaches that have been checked:
- sync extraction per object: reduced performance to much (-15%)
  ({D8292})
- post checks: reduced the threading issues, but didn't solve it.
- separating preparation and execution of the extraction ({D8312})

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8329
2020-07-17 13:47:53 +02:00
bf2bb6db26 Cleanup: silence unused variable warning
Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8328
2020-07-17 17:12:46 +05:30
0e3d34e48f BLI: add StringRefNull.c_str() method
This should be used whenever you rely on the fact, that the
returned pointer points to the beginning of a null-terminated array.
2020-07-17 12:38:15 +02:00
0fcd23a388 Simulation: use better api for adding and removing simulation states 2020-07-17 12:36:23 +02:00
c5f61fbf48 Cleanup: avoid warning about redundant access specifier
No functional changes.
2020-07-17 11:49:51 +02:00
5910dbdbf7 Nodes: move some code from blenkernel directory to nodes
This also introduces the `blender::nodes` namespace. Eventually,
we want to move most/all of the node implementation files into
this namespace.

The reason for this file-move is that the code fits much better
into the `nodes` directory than in the `blenkernel` directory.
2020-07-17 11:36:59 +02:00
0a40c671b0 Cleanup: consistent ordering for scene argument to UV functions 2020-07-17 17:39:47 +10:00
83e204702d Cleanup: remove f-string use in favor of percentage for formatting 2020-07-17 17:39:47 +10:00
618f31312c Fix vertex selection error from recent refactor
Temporary fix for regression in 8084b7e6e2.
2020-07-17 17:37:35 +10:00
89a7a1c156 Cleanup: extract draw cache sanity checks to own function 2020-07-17 08:31:03 +02:00
608d9b5aa1 UI: Add shortcuts for constraint panels
Only the delete shortcut applies here, although the move up and down
operators can optionally be assigned in the keymap.

See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
grease pencil modifier panel implementation, which is the same.
Some refactoring of the constraint delete operator was necessary,
including adding an invoke function.

Differential Revision: https://developer.blender.org/D8238
2020-07-16 14:07:47 -04:00
b13bbb22e4 Fix link error in bf_nodes
I got undefined reference errors on the `NodeMFNetworkBuilder::get_default_fn`
function under some circumstances. This symbol is definitely defined in bf_blenkernel.
The error seemed a bit undeterministic and was probably caused by some incorrect
link order. I don't get the error with this change.
2020-07-16 19:52:28 +02:00
02a3720000 Simulation: rename bf_physics to bf_simulation
Also see {rB9363c4de0635394548fa2eb8d205581313029775}.
2020-07-16 18:49:59 +02:00
93f21ebb13 Fluid: Update Mantaflow source files
Includes cleanup that resolves a -Wunused-but-set-variable warning.
2020-07-16 18:04:44 +02:00
e7c1a32a78 Tests: disable ASAN when discovering tests
CMake, when it's configuring the project, runs the `blender_test` test
runner (if it exists from a previous build) to discover which tests it
contains. At this time none of the tests themselves are run, so it's not
that useful to run ASAN and have it break things when there are memory
leaks.

This commit disables ASAN by injecting `ASAN_OPTIONS="detect_leaks=0"` in
the environment variables.

It is not enough to use `set(ENV{ASAN_OPTIONS} "detect_leaks=0")` in
`tests/gtests/runner/CMakeLists.txt`, as it wouldn't be passed to the child
process.
2020-07-16 17:38:29 +02:00
a138bf57c9 Tests: move tests from USD test directory into io/common and io/usd
This commit is a followup of {D7649}, and ports the USD tests to the new
testing approach. It moves test code from `tests/gtests/usd` into
`source/blender/io/common` and `source/blender/io/usd`, and adjusts the
use of namespaces to be consistent with the other tests.

I decided to put one test into `io/usd/tests`, instead of
`io/usd/intern`. The reason is that this test does not correspond with a
single file in that directory; instead, it tests Blender's integration
with the USD library itself.

There are two new CLI arguments for the Big Test Runner:

- `--test-assets-dir`, which points to the `lib/tests` directory in the
  SVN repository. This allows unit tests to find test assets.
- `--test-release-dir`, which points to `bin/{BLENDER_VERSION}` in the
  build directory. At the moment this is only used by the USD test.

The CLI arguments are automatically passed to the Big Test Runner when
using `ctest`. When manually running the tests, the arguments are only
required when there is a test run that needs them.

For more info about splitting some code into 'common', see
rB084c5d6c7e2cf8.

No functional changes to the tests themselves, only to the way they are
built & run.

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

Reviewed by: brecht, mont29
2020-07-16 17:38:29 +02:00
Francesco Siddi
09a483a3aa macOS: improve design of .dmg background
Differential Revision: https://developer.blender.org/D8300
2020-07-16 17:28:27 +02:00
671c6d8afd Cleanup: Gizmo: Remove non matched glDisable
We use the polyline shader for drawing the rotation gizmo now.
This shader supports clipping without hardware clip planes.
2020-07-16 18:01:44 +02:00
07d70a76df Cleanup: WM: Use GPUTexture API instead of raw ogl calls 2020-07-16 18:01:44 +02:00
5099cbeec9 Cleanup: GPU: Move depth/color masks functions to GPU_state 2020-07-16 18:01:44 +02:00
436d38bb54 Cleanup: GPU: Move XOR logic op to gpu_state.c 2020-07-16 18:01:44 +02:00
3481f6eaf2 Cleanup: GPU: Remove GL_DITHER usage 2020-07-16 18:01:44 +02:00
71ac137662 Cleanup: GPU: Move quad buffer stereo check to GPU module 2020-07-16 18:01:44 +02:00
8084b7e6e2 Cleanup: GPU: Replace all glReadPixels by GPU equivalent 2020-07-16 18:01:44 +02:00
ab19abe223 Cleanup: Port glClear calls to GPU module functions 2020-07-16 18:01:44 +02:00
bc85081156 Cleanup: DRW: remove uneeded double bind
Now that binds are permanent there is no need to setup the same
texture for each subgroups.
2020-07-16 18:01:44 +02:00
56b8adb9e2 Particles: avoid crash when connected unimplemented node 2020-07-16 16:43:42 +02:00
1494ad20b9 Particles: add implicit covnersions between Vector and Color
Not sure if these conversions are a good idea. However, we have them
in Cycles, so they be available in the simulation node tree for consistency
reasons.
2020-07-16 16:43:42 +02:00
76bf050853 Particles: simplify adding new implicit conversions between sockets 2020-07-16 16:43:42 +02:00
aa547ce88b Fluid: Update Mantaflow source files
Refactored various functions after noticing new warnings when compiling on Apple DTK devices - there should now be fewer warnings when building.
2020-07-16 16:39:49 +02:00
f64710a518 Particles: change initial velocity of particles
This is only temporary, but makes testing the system a bit easier.
2020-07-16 16:09:19 +02:00
4249d6f58e Particles: support Separate/Combine RGB nodes 2020-07-16 16:09:19 +02:00
ada173ebfd Particles: simplify Combine XYZ node 2020-07-16 16:09:19 +02:00
72df7c23c4 Particles: support Color Ramp node 2020-07-16 16:09:19 +02:00
c7aa0f9d74 Fix T78537: too much memory usage rendering animation with persistent images
For still images, always return 0 for the current frame number. This ensures
Cycles can detects that the image did not change.

Based on patch by Vincent Blankfield.

Differential Revision: https://developer.blender.org/D8242
2020-07-16 15:50:43 +02:00
279cc34343 Keymap: disable 'Alt' click for tools prompt by default
Based on feedback from artists in the Blender Studio this is too
easy to access by accident.

This is still accessible as a preference.
2020-07-16 23:48:38 +10:00
83955d6769 Particles: support Map Range node
Only linear interpolation mode is supported for now.
2020-07-16 13:26:20 +02:00
99fda4d31e deps builder: Fix typo in windows harvesting 2020-07-16 07:22:52 -06:00
9b6088cb9d Simulation: Change BPH prefix to SIM
In a previous commit the `physics` folder has been renamed to `simulation`.
This commit updates the function/file prefix accordingly.
2020-07-16 14:37:21 +02:00
9363c4de06 Simulation: Rename physics directory to simulation
Function names will be updated in a separate commit.

This will be the place for the new particle system and other
code related to the Simulation data block. We don't want
to have all that code in blenkernel.

Approved by brecht.
2020-07-16 14:28:38 +02:00
66b48ad8fb Fix git tag warning when running make update after recent changes 2020-07-16 14:26:37 +02:00
f3ea6a5b28 Particles: implement more vector math operations 2020-07-16 14:15:24 +02:00
3d8f8085fb UI: show connected icon for proportional editing in the image space 2020-07-16 22:07:53 +10:00
b882f89fe3 Particles: support for most math node operations 2020-07-16 13:41:47 +02:00
2ddb3dc617 Nodes: support default function for partially implemented nodes 2020-07-16 13:38:23 +02:00
56aa5b0d8c T73268: Link C/C++ unit tests into single executable
This commit introduces a new way to build unit tests. It is now possible
for each module to generate its own test library. The tests in these
libraries are then bundled into a single executable.

The test executable can be run with `ctest`. Even though the tests
reside in a single executable, they are still exposed as individual
tests to `ctest`, and thus can be selected via its `-R` argument.

Not yet ported tests still build & run as before.

The following rules apply:

- Test code should reside in the same directory as the code under test.
- Tests that target functionality in `somefile.{c,cc}` should reside in
  `somefile_test.cc`.
- The namespace for tests is the `tests` sub-namespace of the code under
  test. For example, tests for `blender::bke` should be in
  `blender::bke:tests`.
- The test files should be listed in the module's `CMakeLists.txt` in a
  `blender_add_test_lib()` call. See the `blenkernel` module for an
  example.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7649
2020-07-16 12:58:49 +02:00
065a00ee3e Fix T78920: missing depsgraph relation when using sound strips in VSE
Having a sound strip in the VSE caused a missing relation error to be
logged on the console. This was caused by the AUDIO depsgraph component
not having an entry node. This commits adds that node, and sets up
relations correctly.

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

Reviewed By: Sergey
2020-07-16 11:51:39 +02:00
d4ce777aed BLI: move inline include to the bottom to avoid redeclaration warning 2020-07-16 11:33:35 +02:00
d897228682 BLI: move safe math functions to separate header 2020-07-16 11:28:31 +02:00
f6f93b5b12 BLI: add safe_divide, safe_modf and safe_logf
Those are defined exactly as their corresponding functions in Cycles.
2020-07-16 11:05:30 +02:00
7e0bf7a0f1 LibOverride: Fix getting proper RNA path and ID from embedded ones.
Master collections and root node trees should now be working as expected
in that regard.
2020-07-16 11:04:03 +02:00
35bfe1702c BLI: add safe_powf function
The same function is also used by cycles.
2020-07-16 10:46:18 +02:00
Yevgeny Makarov
4a9d903e2b Fix View3D "Mirror" menu, both "Global" and "Local" items are GLOBAL 2020-07-16 18:08:25 +10:00
Stefan Werner
9715ad5aca macOS: Support arm64 architecture.
Enabling all `make deps` dependencies with the exception of Embree and OIDN.
After that, Blender can be compiled on an Apple Silicon Mac just like on any
Intel based Mac. There are still compiler warnings that need to be
investigated and there are probably a couple of bug still to be discovered
and to be fixed.

Most patches to the dependencies are simple and are about disabling SSE and
setting the proper architecture to compiile for. Notable exception is Python,
where I back ported a yet to be accepted PR for upstream Python:
https://github.com/python/cpython/pull/21249

Cross compiling or buliding a Universal Binary is not supported yet.
The minimum macOS target version for x86_64 remains at 10.13, the target
for arm64 is 11.00.

Differential Revision: https://developer.blender.org/D8236
2020-07-16 09:37:38 +02:00
ad4928a171 UI: avoid aligning labels for ui_item_with_label
Key-map display was doing thousands of redundant alignment operations.
Set the spacing instead as align was only set to use zero spacing.

This would have prevented the crash reported by T78636.
2020-07-16 17:00:16 +10:00
75520894c7 Fix T78636: Crash displaying many aligned buttons
Displaying user preferences search crashed on macOS when the search
contained a common character such as 'E'.
This caused alignment to 'alloca' too much memory.

Replace with a heap allocation fallback.
2020-07-16 16:38:07 +10:00
2811de6e5c Cleanup: fix building without USE_UIBUT_SPATIAL_ALIGN defined 2020-07-16 13:48:01 +10:00
5b099a25d7 Fix T78966: Center cursor doesn't refresh the UI 2020-07-16 13:27:50 +10:00
123e29c274 Cleanup: missing CMake headers from source lists 2020-07-16 13:17:31 +10:00
54abab53bf Cleanup: undeclared function warning, unused argument 2020-07-16 11:14:27 +10:00
a3d90337b8 Cleanup: spelling 2020-07-16 11:09:39 +10:00
d11a2dfe71 Cleanup: minor change to grease pencil material access
Rename for clarity and avoid passing in the prefix length.
2020-07-16 11:09:39 +10:00
75a09ba2ed Fix T78837: Prefetching can corrupt .blend files
This happened because of typo in seq_dupli() when duplicating effect data.
Instead of duplicating data to new sequence, it was duplicated into original.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8295
2020-07-16 02:24:37 +02:00
974e36d7d0 Fix T78647 UVEdit: Crash when entering edit mode with UV Editor open
Only affects MacOS.
2020-07-15 21:14:46 +02:00
058514aa0a PointCloud: Initial rendering support for Workbench
Also includes outline overlays. Removes the temp overlay drawing

We make the geometry follow camera like billboards this uses less
geometry. Currently we use half octahedron for now. Goal would be
to use icospheres.

This patch also optimize the case when pointcloud has uniform radius.
However we should premultiply the radius prop by the default radius
beforehand to avoid a multiplication on CPU.

Using geometry instead of pseudo raytraced spheres is more scalable as
we can render as low as 1 or 2 triangle to a full half sphere and can
integrate easily in the render pipeline using a low amount of code.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8301
2020-07-15 20:10:45 +02:00
d4d810f817 Cleanup: EEVEE: Remove concentric samples. 2020-07-15 19:51:55 +02:00
37a8c6d809 Cleanup: EEVEE: Remove unused IRRADIANCE_CUBEMAP 2020-07-15 19:51:55 +02:00
47885abbe6 Workbench: Replace viewvecs caculation by DRWView 2020-07-15 19:51:55 +02:00
cd8f3c9ee7 DRW: Add glsl math libraries
Copied from eevee bsdf_common_lib.glsl
2020-07-15 19:51:55 +02:00
2c1edcf3ef EEVEE: Fix undefined behavior in world output 2020-07-15 19:51:55 +02:00
24c846b2b4 GPU: Shader: Move IN_OUT define to shader GPU_shader_create_ex
This adds the opportunity to use it in multiple places.
2020-07-15 19:51:55 +02:00
987d14a3b2 DRW: Shader: Fix const correctness and print better debug output 2020-07-15 19:51:55 +02:00
8e16873086 DRW: Shader: Add DRW_shader_create(_fullscreen)_with_shaderlib
Some convenience function for using DRWShaderLibrary.
2020-07-15 19:51:55 +02:00
5dcf60e053 DRW: View: Add ViewVecs calculation
This will remove some code duplication between draw engines.
2020-07-15 19:51:55 +02:00
f1104c2828 Fix T78369: Sculpt Vertex Colors not rendering in EEVEE
The vertex colors node was using the M_COL attribute type but Sculpt
Vertex Colors use CD_PROP_COLOR
Now the Vertex Color node also fallbacks to legacy vertex colors if
Scultp Vertex Colors are not enabled as experimental.

Reviewed By: brecht

Maniphest Tasks: T78369

Differential Revision: https://developer.blender.org/D8185
2020-07-15 18:55:33 +02:00
eb54624a9a LibOverride: make outliner's 'override hierarchy' use same logic as 3DView operator.
So now one can create a 'full', 'complete' override of a character from
the outliner as well.
2020-07-15 18:17:34 +02:00
5057b28a2f LibOverride: move most of 'complete override creation' from ED_object to BKE_lib_override.
This code is fairly complex and can be used in more places, better not
duplicate that logic and just have it in BKE area.
2020-07-15 18:17:34 +02:00
ba100c883c BKE collection: add util to add a collection using another collection as 'template'.
Similar to what we already had using an object as 'template'.
2020-07-15 18:17:34 +02:00
a082e49671 Cleanup: remove debug prints. 2020-07-15 18:17:34 +02:00
cda6da4957 Fix error in recent commit
Obviously a copy paste error of mine...
2020-07-15 18:14:03 +02:00
ae4098e234 GPencil: Fix unreported error baking mesh animation
When the mesh is linked, the materials can not be available or be the same assigned to mesh. Now, if the mesh is linked, a simple two materials conversion is used.

To get the full list of materials, the mesh must not be linked.

Also checked some indexes to be sure never get a wrong value and that materials are not created again and again.
2020-07-15 17:26:27 +02:00
36e836d0e9 Fluid: Adjusted Mantaflow version number
Version number was increased after recent OpenVDB IO changes.
2020-07-15 17:04:56 +02:00
19d17b217a Particles: use CD_PROP_FLOAT3 instead of CD_LOCATION
`CD_LOCATION` was only used temporarily due to the lack
of a better alternative. This also removes the name from
`CD_LOCATION` again, because at most one layer of this
type should exist.
2020-07-15 16:48:30 +02:00
57ec1f37e9 CustomData: add float2 and float3 data types
This adds `CD_PROP_FLOAT2` and `CD_PROP_FLOAT3`.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8251
2020-07-15 16:42:17 +02:00
e06a346458 Fix T78747: Fix mesh boundary detection and automasking
This issue was produced by a hack in the sculpt mode code from 2.80
 when the sculpt API for connectivity info was not available.
The smooth brush was the only brush that needed connectivity info,
so there were 3 different smooth functions with the connectivity
queries implemented for dyntopo, meshes and grids. The mesh version
of smoothing was checking the number of connected faces to a vertex
to mask the mesh boundaries, which was not covering all cases and
was hardcoded in the smooth function itself.

This patch removes all those legacy functions and unifies all
smooth functions into a single one using the new API and the
automasking system. In order to achieve this, there were needed
some extra changes:

- The smooth brush now does not automasks the boundaries by default,
so its default preset needs to be updated to enable automasking

- The mesh boundary info is extracted once and cached in a
bitmap, similar to the disconnected elements IDs. This makes
boundary detection work as expected in all cases, solving a lot
of known issues with the smooth brush. In multires, this info is
extracted and cached only at the base mesh level, so it is much
more memory efficient than the previous automasking system.

- In order to keep the brushes responsive as they were before,
the automasking system can now skip creating the cache when it
is not needed for the requested options. This means that for
high poly meshes and simple automasking options the brushes
won't lag on start.

Reviewed By: sergey

Maniphest Tasks: T78747

Differential Revision: https://developer.blender.org/D8260
2020-07-15 16:33:25 +02:00
10cacbbb15 Fix T77417: Topology Automasking not working with individual vertices
The flood fill operation was setting the mask using to_v, so in the first
iteration when the floodfill callback was using the active vertex as
from_v and any other neighbor as to_v, the mask for the active vertex
was never set.

Now the mask is set using from_v and it checks if it should continue
propagating to the next neighbor using to_v.

Reviewed By: sergey

Maniphest Tasks: T77417

Differential Revision: https://developer.blender.org/D8294
2020-07-15 16:15:41 +02:00
613d314251 UV: support region fill for path select
This matches edit-mesh region selection (Ctrl-Shift-Select).
2020-07-15 23:20:25 +10:00
b3c34011c0 Cleanup: Replace 0 with False for boolean argument 2020-07-15 09:11:01 -04:00
efc6f6e1ae Clang-Tidy: ignore some newer checks
Those checks have been added to clang tidy within the last year.
They fail when I use a clang tidy version I built from source.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D8302
2020-07-15 14:24:24 +02:00
5a11c8ba24 Fix T68845: Follow Active Quads, divide by zero error 2020-07-15 21:48:28 +10:00
87f8949f0e Fix T78930: Cycles OpenCL error on graphics cards that don't support half float 2020-07-15 13:38:04 +02:00
44bb73e765 Revert "Cleanup: simplify Weld Modifier logic"
This reverts commit 98b1a716d6.

That commit broke a few modifiers.py tests
(Screw+Weld and a weld merge threshold).

And some pairs may be lost in the first loop.
2020-07-15 08:10:41 -03:00
ff2fa59689 Fix T76690: Incorrect liquid particle count displayed
Reviewers: sergey, sebbas

Differential Revision: https://developer.blender.org/D7852
2020-07-15 12:53:05 +02:00
4e8fc14120 GPencil: Fix name typo error 2020-07-15 12:47:55 +02:00
7e2ffbfb25 Add missing NULL assignment to D8293
Missed reseting "next_td" in that patch.
Shouldn't have caused any issues in practice, but it is nice to be
extra clear and safe in the code.
2020-07-15 12:36:48 +02:00
50c6448781 Fix T78909: Curve-edit proportional connected-only broken
Now it calculates the actual distance when traveling along the curve.

I addition to this, it also now supports cyclic curves.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D8293
2020-07-15 12:29:45 +02:00
e8b26a0501 Fix signed/unsigned comparison 2020-07-15 11:06:54 +02:00
680a81fc49 LibOverride: rework 'make override' 3DView operator.
Removed the 'select main object to override' menu when overriding an
instanced collection, this was no more used anyway.

Added new behavior allowing to select which directly linked collection
to override when trying to override an inderctly linked object. This
allows to link collections without instancing them with an empty object,
select one of their objects, and call override operator.
2020-07-15 11:01:40 +02:00
eb87b1c8f6 Cleanup: remove assignment from a NULL struct
Quiet ASAN 'member access within null pointer' warning.

While this doesn't crash, access to 'shading'
without checking if the 'v3d' would have.
2020-07-15 15:37:03 +10:00
Liam Scaife
920b138f83 UI: Add manifold extrude to extrude menu 2020-07-15 15:20:34 +10:00
e062def3b4 Cleanup: spelling 2020-07-15 13:11:22 +10:00
061d76f55c Revert "Cleanup: remove public unused function."
This reverts commit 03c8b048a1.

This commit re-introduced T76837.

While there is a comment explaining why this function is needed,
the naming of the poll function does make this confusing.
The API could be changed to avoid confusion here.
2020-07-15 13:09:06 +10:00
d493fc43bd Fix T78875: Numerical display of delta of translation is not updating in 3d view 2020-07-14 17:45:57 -03:00
7f67e3200a Fluid: Fix liquid mesh scaling
Fixes issue with .bobj.gz and .obj mesh files not always being scaled correctly in the viewport.
2020-07-14 22:21:15 +02:00
7e0289b618 Fluid: Updated Mantaflow source files
New files include fixes for obj mesh import and minor cleanups.
2020-07-14 22:21:15 +02:00
98b1a716d6 Cleanup: simplify Weld Modifier logic
The original code to rearrange the weld vertices map was confusing.

It traverses the overlap result multiple times within a loop.

This part of the code has therefore been rethought, simplified and commented.

This also results in a slight improvement in the performance of the modifier.
2020-07-14 15:18:22 -03:00
dbcc74f801 Fix T77263: Mantaflow: Cache gets deleted at changing upres factor under Particles section.
Moved fluid simulation reset to separate functions based on type.
2020-07-14 18:11:35 +02:00
0b100e21fb Fix T78704: RenderPass normals disapear when view isn't updated
When the view isn't updated the renderpass thought that it was rendering
the next sample, skipping the conversion from encoded to blender
normals.

This patch resets the current sample when only rendering single sample
layers.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8280
2020-07-14 17:42:15 +02:00
6cc88e330b Fix T78431: Update mesh_cd_layers_type_ to support 8 bytes.
Sculpt vertex colors changed the `DRW_MeshCDMask` from 4 bytes to 8 bytes, but
the functions assumed it still was 4 bytes. This patch updates the functions and
adds a compile time check.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8215
2020-07-14 17:41:05 +02:00
2ba1cf4b40 Fix T78880: UV Editor - Match prop edit connected behavior with mesh editing and fix Rip Region double proportional checkbox
This fixes the double prop edit checkbox in the redo menu.

This also makes it so that proportional edit in connected mode now
matches how it behaves in mesh edit mode.

Without this change, ripping in UV edit mode with proportional edit on
would be useless as the UV verts you ripped will still be stuck together
even if they were not connected anymore.

Reviewed By: Campbell

Differential Revision: http://developer.blender.org/D8289
2020-07-14 17:27:48 +02:00
797027be6b Fluid: Fix missing flag update for cache
These flags need to be set correctly in order to distinguish between data that comes from cache files and raw data that comes directly from pointers to the data in Mantaflow.
2020-07-14 16:30:15 +02:00
14eaa9ed63 LibOverride: fix for removing use_override_library in rB3d587efef2872.
Thanks to @JacquesLucke for the heads up.
2020-07-14 16:04:44 +02:00
8e9dd5492a Gpencil: Simplify modifier sample mode minimal vert count fix.
For this mode is possible use strokes of 2 points.

Differential revision: https://developer.blender.org/D8138
2020-07-14 15:59:49 +02:00
c8a62e4f50 Cleanup: function name not following its module conventions. 2020-07-14 15:28:08 +02:00
6068f49c33 BLI: remove static assert noexcept move constructors
The move constructor of `mpq_class` from GMP currently
allocates when it is moved. So, it cannot be noexcept.
Since we want to use this type, this static assert cannot
stay there.
2020-07-14 15:23:40 +02:00
2e8a78f4d1 Fluid bake: fix memory leak when path validation fails
Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D8284
2020-07-14 15:21:08 +02:00
78148e20fa Cleanup: remove tab indention 2020-07-14 22:52:50 +10:00
fa7ace2215 PyAPI: support element multiplication for vector, matrix, quaternions
This was disabled during 2.8x for smooth porting of 2.7x scripts,

Now '@' is used for matrix multiplication,
support '*' to multiple vector elements.

See T56276.
2020-07-14 22:52:50 +10:00
e3fd60b182 LibOverride: Outliner: Add an operation to override the selected ID and its parents.
This will override all linked data-blocks in the tree branch leading to
the selected one.
2020-07-14 14:51:13 +02:00
140b26909e LibOverride: Move code tagging reauired dependencies of an override into BKE.
This is fairly generic code that can be re-used in other places.
2020-07-14 14:51:13 +02:00
1e5ce39156 Fix T78900: Single vertex sliding crashes
As we can see in `initVertSlide_ex`, `sld` can be `NULL`.
`sld` is dereferenced, but can still be `NULL`.
2020-07-14 09:31:05 -03:00
01ec76842f Fix T77766: support animated global gravity toggle
Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8281
2020-07-14 13:47:32 +02:00
4096330b81 Cleanup: typo 2020-07-14 13:01:46 +02:00
25fc84bf2e Fix wrong vector size functions used in knife tool
Should not use copy_v3_v3 on a 2 element vectors.
2020-07-14 10:43:32 +02:00
26793d619c GPencil: Cleanup Build modifier and fix potential div by zero errors 2020-07-14 10:26:19 +02:00
0fb08b7cc4 Cleanup: sort header, cmake paths 2020-07-14 16:04:18 +10:00
93e14e5935 Fix T78883: New bezier curve points to uninitialized memory 2020-07-14 15:53:56 +10:00
5338b36fcc Cleanup: spelling 2020-07-14 15:19:52 +10:00
b818f6b55f Fix T78902: Only check main modifier panel for expansion property
Internally the "show_expanded" property stores the expansion for every
subpanel, but for RNA we should only check the first bit of the flag that
corresponds to the main panel.
2020-07-13 20:10:49 -04:00
0b24930541 UI: Add missing row in curve profile template 2020-07-13 17:16:01 -04:00
37fb586a0b Cleanup: remove unnecessary member
`Kfv-> sco` was being treated as a local variable, and can be
confusing since this value is not updated when navigating the viewport.
2020-07-13 16:10:45 -03:00
70992ae270 Fix: Fix build error with MSVC in BLI_span_test
span.size() returns an uint, causing a signed/unsigned comparison
using 3u sidesteps the issue
2020-07-13 12:29:53 -06:00
6e74a8b69f Fix T78881: Cycles OpenImageDenoise not using albedo and normal correctly
Properly normalize buffers now. Also expose option to not use albedo and normal
just like OptiX.
2020-07-13 19:38:49 +02:00
2b5e21fe00 Sculpt: Add extra deform types to Smear
The smear brush was using the stroke direction to slide colors across
the mesh surface (this is called drag in other sculpt tools). Similarly,
other deformations can be included. The most common ones in image
editing are pinch and expand, which can be used to sharpen transitions
between colors.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8270
2020-07-13 17:53:24 +02:00
1076952209 Fix wrong variable name in Sculpt Vertex Colors experimental check
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8269
2020-07-13 17:52:11 +02:00
eb3f74a0fe Sculpt: Enable color palettes for sculpt vertex colors
Enables the color palette subpanel for brushes that have color
capabilities (only the paint brush for now)

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8268
2020-07-13 17:51:12 +02:00
8dd2386a68 IDTemplate: Minor tweak to 'make local/override' code.
Only update pointer of the template if we actually changed it...
2020-07-13 17:43:22 +02:00
fcc91faf3f Fix (unreported) bad handling of undo for some IDTemplates operations. 2020-07-13 17:03:39 +02:00
91e67c7bda Cleanup: remove some incorrectly placed consts
Clang-tidy reported that those parameters could be const,
but that is not true on windows.
2020-07-13 16:55:39 +02:00
3d587efef2 LibOverride: Cleanup: Remove option to disable library overrides.
Code is mature enough now to not need this anymore, people who do not
want to use liboverrides can just not create them.
2020-07-13 16:45:55 +02:00
5c8dd2a703 Cleanup: silence warnings 2020-07-13 11:40:21 -03:00
3dcc7c73e2 MSVC: Fix build error with the 8.1 SDK
shobjidl_core.h only exists in the windows 10 SDK in the 8.1
SDK ShObjIdl.h will have the definitions we need, which still
exists in the 10 SDK and implicitly includes shobjidl_core.h.

so ShObjIdl.h will work on both SDK versions.
2020-07-13 08:38:31 -06:00
Szymon Ulatowski
29da019cb3 EEVEE: Fix sky zenith bug
Careless use of acos() in spherical coordinates transformation was
deteriorating the precision near zenith (and nadir) and producing
glitchy pixels (best seen in longer focal lengths).

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D8266
2020-07-13 17:08:58 +02:00
16989c4d1d Fix T78037: fresh install of blender 2.83.0 not able to save user startup file.
Simply remove that check ob userdef's themes, we are never read any
userdef from startup file anymore, so this check makes no more sense.

To be backported to 2.83.
2020-07-13 16:17:35 +02:00
952279a366 Fix T76687: [Mantaflow] low domain transformation performance
Implemented G.moving suggestion from comments.
2020-07-13 16:15:43 +02:00
5ecefc6a07 Build: make update support for git tags
Previously it only picked the appropriate version with the
blender-vX.XX-release branches.
2020-07-13 15:54:12 +02:00
2be7a11e43 Python API: new RNA property Screen.is_scrubbing
This commit adds a new read-only boolean property `Screen.is_scrubbing`.

The related property `Screen.is_animation_playing` is set to `True` in
two situations:

- Animation is actually playing (for example via the Play button in the
  timeline)
- The user is scrubbing through time (in the timeline, dopesheet, graph
  editor, etc.)

To distinguish between these two cases, the property
`Screen.is_scrubbing` has been added.

Concept approved by @brecht.
2020-07-13 15:26:00 +02:00
b9f565881e VSE: Python API, allow creation of VSE Movie strips with missing file
It was already possible to create Sound and Image strips that reference
non-existing files. Now it's also possible to create Movie strips
referencing missing files via the Python API call
`Sequences.new_movie()`. In this case, the duration of the strip will be
set to 1 frame.

Note that this commit does not change anything in the user interface.

The Python API of the `MovieStrip` class is extended with a function
`reload_if_needed()`. This function only performs disk I/O if the movie
strip cannot produce frames, that is either when its filepath points to
a non-existing file, or when the video sequence editor has not been
shown yet (for example because it is in an inactive workspace).

This allows for the following:

```
import bpy

scene = bpy.context.scene
vse = scene.sequence_editor_create()

filepath = bpy.path.abspath('//demo.mkv')
strip = vse.sequences.new_movie("movie", filepath,
    channel=2,
    frame_start=47,
    file_must_exist=False)
strip.frame_final_end = 327
```

This will create a new movie strip, even when `demo.mkv` does not exist.

Once `demo.mkv` has appeared at the expected location, either
`strip.reload_if_needed()` or `strip.filepath = strip.filepath` will
load it.

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

Reviewed By: Sergey, ISS
2020-07-13 15:09:18 +02:00
9db0c36af1 LibOverride: add more polling checks to operators not supposed to work on overrides.
This is long work, we are still likely missing a lot of cases...
2020-07-13 14:29:54 +02:00
03c8b048a1 Cleanup: remove public unused function. 2020-07-13 14:29:54 +02:00
9c9eb03d78 Fix T78855: Knife tool crashes when the geometry has no face
I don't see the need for a BVH Tree to have root but not have leafs.
But apparently this case is possible.
2020-07-13 08:59:47 -03:00
f019164f1f Optimization: Use dedicated function to restore customdata
Called when canceling a transform operation.
2020-07-13 08:59:47 -03:00
8074a18964 Cleanup: move unchanged condition out of loop 2020-07-13 08:58:04 -03:00
7b558a20a9 Fix Extrude Manifold losing original UV 2020-07-13 08:48:35 -03:00
976a0ff691 RNA code cleanup: Fix wrong usages of rna_idproperty_check().
This function is more expansive than the simpler `rna_ensure_property()`
one, and should only be used when IDProperty data is actually needed.

If one only needs to ensure it has a valid PropertyRNA pointer,
`rna_ensure_property()` is much more efficient.

Also add compiler warnings when results of those functions are unused,
this should never be the case.
2020-07-13 12:51:29 +02:00
f8afbb7657 RNA property management: tweak to 'is set' information.
Only consider a full IDProperty as set if it actually exists in given
PointerRNA data.
2020-07-13 12:51:29 +02:00
0158571b34 I18n utils: fix broken case when 'settings' argument is default NULL one. 2020-07-13 12:51:29 +02:00
7453ff73ad Cleanup: quiet warnings by adding const in some places
The warnings were introduced in rB725973485a909c2b732c5.
2020-07-13 12:48:51 +02:00
725973485a Clang Tidy: enable readability-non-const-parameter warning
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.

Differential Revision: https://developer.blender.org/D8199
2020-07-13 11:27:09 +02:00
a19584a471 BLI: fix constructor regression for Vector and Array
This was introduced in rB403384998a6bb5f428e15ced5.
2020-07-13 10:51:46 +02:00
644a915b1b BLI: don't allow mutable span of initializer list 2020-07-13 10:49:59 +02:00
0718c6fae0 Cleanup: fix clang tidy warning
The code was actually correct, but clang tidy complaint about
using the Vector after it was moved from.
2020-07-13 10:40:05 +02:00
91c763af3e Cleanup: typo 2020-07-13 10:34:44 +02:00
6dabfacb38 Sky: Code style and formatting fixes
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:11 +02:00
6a3c91f7ad Cycles: Clamp Sky Texture altitude to avoid numerical issues
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:11 +02:00
7aacf2e119 Cycles: Account for Sky Texture mapping in the sun sampling code
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:11 +02:00
192bd2605f Cycles: Change precomputed Sky Texture mapping to prioritize the horizon
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:11 +02:00
41e6f9bd43 Cycles: Add control for sun intensity in Sky Texture and change altitude to km
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:11 +02:00
e2736afdbe Cycles: Add versioning code for the new Sky Texture model
Differential Revision: https://developer.blender.org/D8091
2020-07-13 03:08:07 +02:00
77cd8182f8 Cycles: Remove Vector input on Sky texture when using the included sun
When using the sun, we need to sun sampling logic to avoid excessive
sampling map resolution, but that logic assumes that the Vector input
comes from the view direction.
That is the case in the vast majority of cases anyways, so the easiest
solution is to just remove the input for that case.

Differential Revision: https://developer.blender.org/D8091
2020-07-13 02:00:38 +02:00
474dcbcf12 Cycles: Remove limits on the Sky texture's sun rotation
For animation/driver purposes, being able to go outside of the 0-360
range makes things easier.

Differential Revision: https://developer.blender.org/D8091
2020-07-13 02:00:24 +02:00
f319eec881 Cleanup: disable debug code 2020-07-12 11:05:43 +02:00
30ed51d60a Cleanup: unused debug variable 2020-07-12 12:50:19 +02:00
21b20ae5ec Particles: initial support for forces in simulation node trees
The force node can now be used to control the behavior of particles.
Forces can access particles attributes. Currently, there are three attributes:
`Position` (vector), `Velocity` (vector) and `ID` (integer).

Supported nodes are: Math, Vector Math, Separate Vector, Combine Vector and Value.

Next, I'll have to split `simulation.cc` into multiple files and move
some stuff out of blenkernel into another folder.
2020-07-12 12:38:57 +02:00
ebf9082e1c Nodes: support more implicit conversions in simulation node tree 2020-07-12 12:38:30 +02:00
838b1742fb Functions: minor improvements 2020-07-12 12:38:03 +02:00
404486e66c Functions: minor api improvements 2020-07-12 10:01:37 +02:00
ee5c2f6ead GPencil: Replace "ShaderFX" with "Shader Effects" in RNA prop text 2020-07-11 20:41:21 +02:00
c7eada103c Nodes: support implicit conversions and incorrectly linked sockets 2020-07-11 18:02:06 +02:00
06401157a6 Fix: incorrect attribute type in network 2020-07-11 17:59:43 +02:00
46b79b3d4a Nodes: support vector math node in simulation node tree 2020-07-11 16:55:57 +02:00
b920875893 Nodes: support math node in simulation node tree 2020-07-11 16:47:53 +02:00
8fae58ce0b Nodes: support Value node in simulation node tree 2020-07-11 16:39:17 +02:00
16d4373158 Nodes: move Math, Vector Math and Value shader nodes to c++ files
This required a little bit of refactoring, because we were using c-only
syntax for the gpu shader names. All tests are still passing.
2020-07-11 16:24:53 +02:00
415d3ee05b UV: add path select operator that uses the selection
Instead of using the mouse cursor position,
this selects between existing selected elements.

Access this since picking a selection path doesn't
work from the menu.
2020-07-11 22:09:45 +10:00
6e698653df Cleanup: remove unused function 2020-07-11 20:34:17 +10:00
651db1b26f Cleanup: spelling 2020-07-11 15:32:59 +10:00
020e0f11ff Docs: remove reference to PYTHONHOME
This is no longer used by default, when '--python-use-system-env' is set
there are many Python environment variables, don't list them in
Blender's help message.
2020-07-11 14:50:47 +10:00
d2b910fafe UI: UV: Add Select Shortest Path to menu
This matches the 3D Viewport
2020-07-10 16:07:31 -04:00
3dc0178390 Fix T78662: Cycles baking fails if denoising is enabled, after recent changes
This is not supported yet.
2020-07-10 20:08:46 +02:00
6fbacd6048 Fix build error building without OpenImageDenoise 2020-07-10 19:56:53 +02:00
48f10319c6 Fix T78801: Eevee missing setting to enable/disable freestyle per view layer
This was only visible when Cycles was enabled.
2020-07-10 18:41:16 +02:00
4e8fc15586 UI: Improve transform constraint layout
- Remove the "mapping" subpanel and moves the source axis
    selection ot the destination subpanel.
  - Rename "Source" and "Destination" to "Map From" and "Map To" to
    make the action more clear
  - Gray out source axes when their data isn't selected.

  These changes were discussed in D8041.
2020-07-10 12:21:32 -04:00
3e4f49fe71 Revert "Fix T78296: Performance - Use Binary Search for MDeformWeight"
This reverts commit 39b525e0f0 and
3121015dce as tests are failing.
2020-07-10 18:03:21 +02:00
d5208c45fa GPencil: Fix unreported Use Falloff curve for active frame not working
For the active frame it was using always a value of 1.0 and it was not using the curve.
2020-07-10 17:56:35 +02:00
6eeb32706a Cycles: support OpenImageDenoise in final renders
Performance is not great currently due to the API not seeming to support
efficient denoising of multiple tiles at the same time. So in many cases
only one or a few threads will actually be denoising at the same time.

In renders with many samples this is not a big problem, but for faster
renders it's a signficant overhead.

We should try to optimize this still, possibly by batching denoising of
a bigger neighborhood of multiple tiles at once.
2020-07-10 17:10:05 +02:00
93791381fe Cleanup: reduce hardcoded numbers in denoising neighbor tiles code 2020-07-10 17:10:05 +02:00
e65c78cd43 Cleanup: minor refactoring in Cycles update detection code 2020-07-10 17:10:05 +02:00
Milan Jaros
ad45b8d6a4 Cycles: optimize camera inside volume tests
Only run when there are volumes in the scene, and compute in parallel.

Ref T56939

Differential Revision: https://developer.blender.org/D8261
2020-07-10 17:10:05 +02:00
d8e648c352 Fix T78776: Cycles OpenCL error after recent changes for holdouts 2020-07-10 17:10:05 +02:00
9dbe9a753a Fix T78766: Blender crashes after deleting vertices with Custom Normals.
Some core BMesh topology changing functions were not properly tagging
custom normal runtime caches as dirty...
2020-07-10 16:51:37 +02:00
5372924983 Fix T78579: Proxy produces wrong preview when using Offset or Crop
Make sure that proxy and original images are scaled to same size before
applying offset or crop.

During testing, I discovered, that raw cache will lose information whether
this image was proxy or not. Because of this, proxy images will not create
this cache type. It would be fairly easy to implement this functionality for
cache, but I have decided to not do it now, because I did not want to pass yet
another mostly hard-coded bool flag to cache system. Since image is proxy, it
should be fast to read anyway.

In case of using offset property, code was modified to make sure we scale
image only once. I also tried to make code more readable and streamlined and
cleaned up surrounding functions a bit.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8203
2020-07-10 16:16:42 +02:00
77f823a240 Fix T78573: Crash when removing strips with prefetching
Stop prefetching before changing content of seqbase.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8256
2020-07-10 16:16:42 +02:00
47e71f4623 Fix T69440: Memory leak adding strips via python
seq->strip was overwritten in python API function.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8204
2020-07-10 16:16:42 +02:00
cbfedf2139 BLI: add C++ random number generator
This adds `blender::RandomNumberGenerator` in `BLI_rand.hh`.
Furthermore, `RNG` is now implemented in terms of this new generator.
No functional changes are expected, the generated random numbers
are not changed by this commit.

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D8259
2020-07-10 15:54:01 +02:00
c2304d2f02 Expose override flags to python RNA properties definition.
Time will tell whether we need to expose more RNA override flags here.

Implements/Fix T78534.

Differential Revision: https://developer.blender.org/D8250
2020-07-10 15:50:21 +02:00
4d1c3c029e Cleanup: declaration and implementation function signature did not match 2020-07-10 15:48:46 +02:00
f93e0f1a9e Refactor override code to properly deal with runtime rna properties too.
The triplet static RNA / runtime RNA / custom properties is a real pain to
deal with...

Using the new `PropertyRNAOrID` struct helps clarifying and properly
dealing with all three cases.

Note that this makes override of py-defined RNA properties working
(support for that will be committed next).

Differential Revision: https://developer.blender.org/D8249
2020-07-10 15:23:52 +02:00
337e2c9029 RNA: refactor how we get 'ensured' RNA properties.
Introduce new PropertyRNAOrID structure, storing most useful data about
an 'opaque' PropertyRNA in relation with a given PointerRNA struct.

It deals with all the three cases (pure static RNA, runtime RNA where
data is actually stored in IDProperties, and pure IDProperties, aka
custom data.
2020-07-10 15:19:40 +02:00
6c1157201a Cleanup: simplify platform define checks
Platforms besides WIN32 were in a single else clause, use elif instead.
2020-07-10 23:01:21 +10:00
45287f909c Fix for building on systems besides apple/windows/linux 2020-07-10 23:00:17 +10:00
26d28ade26 Cleanup: follow code style 2020-07-10 14:40:23 +02:00
c806db6313 Functions: add utility to find dependencies of input sockets 2020-07-10 14:23:13 +02:00
60133ff98d Functions: store derived node tree and network in map for future access 2020-07-10 14:23:13 +02:00
295b3aefb0 Functions: make constant folding work on unfinished networks 2020-07-10 14:23:13 +02:00
7bae599232 Nodes: add redundant name check in debug builds to prevent errors 2020-07-10 14:23:13 +02:00
3121015dce Fix Crash due to recent changes
{39b525e0f07fa25dcda54226ade789959b642dec} could write in unallocated
space.
2020-07-10 13:38:38 +02:00
00eb6a56aa GPencil: Fix tooltip error
The tooltip was copied by error from Lattice modifier.
2020-07-10 13:30:21 +02:00
8fd65a2252 Functions: use new is-equal and hash function of CPPType 2020-07-10 12:57:28 +02:00
3edd2832b2 Functions: make generic types hashable 2020-07-10 12:57:28 +02:00
f62204718b BLI: initial hash function for Color4b and float4x4 2020-07-10 12:57:28 +02:00
8f6c0f2242 Functions: make generic types equality comparable 2020-07-10 12:57:28 +02:00
52636c3059 Cleanup: various cleanups in for CPPType 2020-07-10 12:57:28 +02:00
39b525e0f0 Fix T78296: Performance - Use Binary Search for MDeformWeight
Use binary search for querying deform weights.

Spring 02_020_A.anim.blend on Ryzen 1700X goes from 12.4 to 12.7fps.

During profiling it was detected that adding new items to the head was faster than adding to the tail.

Reviewed By: Campbell Barton

Differential Revision: https://developer.blender.org/D8127
2020-07-10 12:09:40 +02:00
77a646279d Cleanup: structure CPPType according to code style guide 2020-07-10 12:04:49 +02:00
9c25731781 LibOverride: Fix improper tagging of more of the backward pointers in RNA nodetrees. 2020-07-10 11:53:11 +02:00
582a0b7e5a Fix T78756: White UV drawing is displayed as Dashed 2020-07-10 19:02:18 +10:00
7a9028cad1 Fix UV rip failing to disable proportional edit-mode 2020-07-10 18:58:36 +10:00
a148c4676b Cleanup: spelling 2020-07-10 16:04:09 +10:00
03f5acd445 Cleanup: clang-format 2020-07-10 16:03:12 +10:00
8b660ea0ec Fix UV path redo in vert/edge mode
Redo was only working in some situations,
some options were also not being forwarded.
2020-07-10 13:41:51 +10:00
96068324cd Fix BM_loop_at_index_find lookup 2020-07-10 13:35:44 +10:00
89cb41faa0 UV: allow ripping face-regions
This changes the behavior of rip when entire faces are selected.
Now face regions are isolated and moved instead of ripping the edge-loop
extracted from the selection boundary.

This is a convenient alternative to separate selection & move.
Resolves T78751.
2020-07-10 13:01:46 +10:00
3fdd092649 Cleanup: face-center mesh calculation
Loop over faces and calculate their centers instead of zeroing the
face center array and accumulating all faces vertex corners.

Move subsurf face center extraction into it's own loop since it works
differently.
2020-07-10 12:44:42 +10:00
b0378440ce Fix missing adjacent UV check for recent UV path select
Path selection could cross UV islands if the destination element was
on an island boundary.
2020-07-10 12:19:30 +10:00
8f24ec2e26 Cleanup: add BLI_linklist_find_last
This makes adding to the end of a linked list simpler,
In most cases we avoid this in favor of BLI_linklist_append.

For one off operations it's OK.
2020-07-10 12:14:32 +10:00
3dd460aa7f Cleanup: spelling 2020-07-10 11:49:46 +10:00
a0d3b60015 Cleanup: use FLT_MAX for the maximum path selection cost
A large number below FLT_MAX was used to avoid overflow,
however this doesn't cause any problems.
2020-07-10 11:49:46 +10:00
0b77e2f4c4 Cleanup: variable names, use define for maximum path cost 2020-07-10 11:49:46 +10:00
92bc277950 Cleanup: undeclared warnings 2020-07-10 11:49:46 +10:00
3623db7784 BLI: add more operator overloads for float2 2020-07-09 19:04:47 +02:00
03a00bda2b Sculpt: Make Sculpt Vertex Colors features experimental
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8239
2020-07-09 18:24:50 +02:00
1e3247c078 Fix: add missing extern "C" 2020-07-09 18:19:39 +02:00
a90b69d065 Build: add more libc compatibility functions for upcoming libraries update
These are needed by the x264 library.
2020-07-09 18:10:05 +02:00
6778949e01 Fix repeated Face Sets IDs when joining meshes
As Face Sets IDs start from 0 and increase by 1 each time a new face set
is created in a mesh, when joining multiple meshes it could happen that
the same ID is used by several unrelated areas in multiple objects. This
checks the Face Sets IDs when joining meshes and ensures that they are
not repeated between different objects when joining them, so in the
resulting mesh all previous face sets will have different IDs.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8224
2020-07-09 17:56:56 +02:00
7b1c406b54 Implement T77959: Never duplicate linked data during deep-copy.
Note that this behavior is enforced on user level for now, but on code
side it is controlled with a flag, which should make it easy to refine
that behavior if needed.

Only exception is when we duplicate a linked ID directly (then we assume
user wants a local deep-copy of that linked data, and we always also
duplicate linked sub-data-blocks).

Note that this commit also slightly refactor the handling of actions of
animdata, by simplifying `BKE_animdata_copy_id_action()` and adding an
explicit new `BKE_animdata_duplicate_id_action()` to be used during ID
duplication (deep copy).

This also allows us to get rid of the special case for liboverrides.
2020-07-09 17:56:05 +02:00
78b629a98f Sculpt: Skip fully hidden nodes in sculpt tools
As tools iterators skip not visible vertices, fully hidden nodes can
also be skipped and considered as masked.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8244
2020-07-09 17:51:09 +02:00
1fb667da01 Fix wrong upate flag when updating the PBVH visibility
This function was using the wrong flag to update the visibility state of
the nodes, so I assume that most of the partially visible optimizations
were not working.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8243
2020-07-09 17:50:10 +02:00
e5ebaa9fd6 Fix T78664: Implement Mesh and Face Set boundary automasking in Multires
This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.

This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...

Reviewed By: sergey

Maniphest Tasks: T78664

Differential Revision: https://developer.blender.org/D8227
2020-07-09 17:48:24 +02:00
bd84b2cbcc Fix Sculpt Vertex Colors sample color changing brush alpha
It is not practical to change the alpha of the paint color with the
color picker as with the current brush design alpha is the main strength
control for the brush.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8208
2020-07-09 17:42:27 +02:00
13b1374497 Fix crash when using Mask by Color in Multires
Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8207
2020-07-09 17:41:14 +02:00
78d48343ae Make deps: Fix compilation error on CentOS
There were two issues.

First is related on ISPC's CMake configuration forcing C and C++
compilers to be clang and clang++. This goes against of desired
behavior when we use our own compiled clang compilers.

The second issue was related on linker failure: CLang libraries
are linked statically, and they need some of C++ 11 STL symbols
which are coming from libstdc++.

Differential Revision: https://developer.blender.org/D8258
2020-07-09 17:24:49 +02:00
2be0ae7c99 Fix Cycles unnecessary updates to camera in viewport render
Problem identified by Milan Jaros.
2020-07-09 16:53:28 +02:00
Szymon Ulatowski
9de09220fc EEVEE: Implement the missing Sky texture
I'm not sure if the Sky was deliberately left out or was just waiting for a
better moment, but so many I was disappointed that Sky in EEVEE is
completely white.

There are already 2 implementations (osl and gpu) so this is the third one.
Looking at other cases it seems that we are not supposed to share sources
between cycles and the rest? So the new util_sky_model files are just
copies of what is already in cycles, except that the data file uses the RGB
variant of the Hosek/Wilkie model, because we output RGB anyway (but can be
easily changed to XYZ if desired - the results are nearly identical).
I am not sure if it is okay to pass 3*9 float values as 3 mat4 uniforms (I
wanted to use mat3 but it does not work).
Also, should I cache the sky model data between renders if the parameters
do not change?

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D7108
2020-07-09 17:31:36 +02:00
42c99ec15b BLI: rename rand.c to rand.cc 2020-07-09 16:37:44 +02:00
580d50091c Particles: Create a simulation state for every Particle Simulation node
Every Particle Simulation node has a name (or a path when it is in a node group).
This name has to be used in the Simulation modifier on a point cloud to see
the particles.

Caching has been disabled for now, because it was holding back development
a bit. To reset the simulation, go back to frame 1.

Currently, there is no way to influence the simulation. There are just some
randomly moving points. Changing that is the next step.
2020-07-09 15:40:27 +02:00
31ad43a3c7 Blenloader: make BLO_read_data_address work in C++ 2020-07-09 15:29:25 +02:00
544c435fdd Fix T78745: Cycles error baking with multiple materials 2020-07-09 12:28:33 +02:00
8ddf7556a5 Fix T78718: Crash when deleting particle system modifier with the X Shortcut.
Duplication and deletion code of modifiers was totally wrong for
particle system, that special weird thing needs its own custom
management.

Note that for now I chose not to duplicate the particle settings ID when
duplicating the modifier...
2020-07-09 11:46:28 +02:00
ea5fe7abc1 UV: path selection support
This adds support for path selection for vertex edge & face selection
modes, matching mesh editing behavior, useful with the UV rip tool.

Region select & edge tagging are currently not supported,
although they could be added eventually.
2020-07-09 18:43:23 +10:00
0b8221683f BMesh: add utility functions
- BM_edge_uv_share_vert_check
- BM_face_uv_calc_center_median_weighted
- BM_loop_at_index_find
2020-07-09 18:23:16 +10:00
0b3bf69d3c Cleanup: move BMesh UV queries into their own file 2020-07-09 13:33:15 +10:00
754c5d6a14 Cleanup: clang-format 2020-07-09 13:29:48 +10:00
31bc76ea4e Cleanup: remove unnecessary calls to as_span
This uses the new implicit conversions and constructors
that have been committed in the previous commit.

I tested these changes on Linux with gcc and on Windows.
2020-07-08 22:30:23 +02:00
403384998a BLI: improve constructors and conversions to span
This allows us to avoid many calls to `as_span()` methods. I will
remove those in the next commit. Furthermore, constructors
of Vector and Array can convert from one type to another now.

I tested these changes on Linux with gcc and on Windows.
2020-07-08 22:27:25 +02:00
4b85ed819d Cleanup: remove unused function
This is not necessary in C++17 anymore.
2020-07-08 20:41:00 +02:00
f7d5d4ee3b Cleanup: use c++17 helper variable templates 2020-07-08 20:39:20 +02:00
e4926c167b Fix T78718: Crash when deleting particle system modifier with the X Shortcut.
Again those backward pointers not properly flagged in RNA, hence
generating infinite loops.
2020-07-08 18:08:08 +02:00
f4a39cafa1 Functions: add AttributesRef class
This is the same as MutableAttributesRef, but the data in it cannot be changed.
2020-07-08 17:05:52 +02:00
439c238bb4 Cleanup: use different internal socket name 2020-07-08 17:05:52 +02:00
05365d1376 Functions: support hashing MFDataType and CPPType 2020-07-08 17:05:52 +02:00
2de5de57c5 Build: fix stack linker warning with ffmpeg on macOS
The ff_cfhd_init_vlcs() function was using a lot of stack space, which
made linker on macOS unhappy. Using heap allocation allows to silence
the warning without causing other side-effects.

Kept the patch enabled for all platforms to avoid difference in behavior
and performance on different platforms, which could make certain types
of investigation very tricky.

Differential Revision: https://developer.blender.org/D8248
2020-07-08 15:49:55 +02:00
cb3c4218bf Minor cleanup in rna override code. 2020-07-08 15:43:57 +02:00
d1f4546a59 Functions: implement common subnetwork elimination optimization
This was the last of the three network optimizations I developed in
the functions branch. Common subnetwork elimination and constant
folding together can get rid of most unnecessary nodes.
2020-07-08 15:10:30 +02:00
e3e42c00cb Functions: Support getting MFSocket based on its id 2020-07-08 15:10:30 +02:00
2b9d62b73a Functions: Support accessing socket index of MFSocket 2020-07-08 15:10:30 +02:00
34d175f372 Functions: initial hash/equals implementation for constant multi-functions 2020-07-08 15:10:30 +02:00
840941215d Functions: allow multi-functions to override a hash and equals function 2020-07-08 15:10:30 +02:00
36a547af7b Cleanup: add correct license header to tests 2020-07-08 15:10:30 +02:00
ff133bbd33 BLI: add disjoint set data structure
This can be used to find separate islands in meshes efficiently (as is
done in cycles already). Furthermore, this helps to implement some
algorithms on node trees more efficiently.
2020-07-08 15:10:30 +02:00
a8ff8b64dc BLI: add comparison operators and hash functions for float3, etc. 2020-07-08 15:10:30 +02:00
ff444da7c4 macOS: upgrade minimum required version to 10.13 High Sierra
C++17 does not work on 10.12, and Apple extended support ended for 10.12 in
October 2019.

Maniphest Tasks: T76783, T76184

Differential Revision: https://developer.blender.org/D8179
2020-07-08 14:43:28 +02:00
6435acd8f6 Cycles: support shader transparency for holdout objects
Now transparent areas of the object will render objects behind.

Fixes T78728.
2020-07-08 13:18:19 +02:00
643196cc37 CMake: Fix spelling of Embree passed to find package
The spelling and capitalization of package name passed to find_package()
and find_package_handle_standard_args() needs to match.

Silences CMake warning about mismatch.

Differential Revision: https://developer.blender.org/D8247
2020-07-08 12:35:56 +02:00
45004d82e0 Functions: add dead node removal and constant folding optimization
Those optimizations work on the multi-function network level.
Not only will they make the network evaluation faster, but they also
simplify the network a lot. That makes it easier to understand the
exported dot graph.
2020-07-08 11:18:43 +02:00
50d7c00d9c Cleanup: fix comment 2020-07-08 10:16:56 +02:00
01c8aa12a1 Apply Modifier: support applying as shape key and keeping the modifier.
This can be useful to save the result of a cloth simulation as a
shape key without destroying the simulation, so it's possible to
e.g. re-run it to get other shapes, or simply use the new shape
key to start the simulation already in a draped state.

It also makes sense to allow applying as shape key even when the
mesh is shared, because the operation itself just adds a shape
key. To support this, split the apply operator into Apply and
Apply As Shapekey so that they can have different poll callbacks.

Differential Revision: https://developer.blender.org/D8173
2020-07-08 11:06:57 +03:00
7fcb6bc59c Fix T78324: Different Sky Texture results between CPU and GPU
The problem here was numerical precision: The code calculates the angle between
sun and view direction, and the usual acos(dot(a, b)) approach for that has
poor numerical performance for almost parallel angles.

As a result, the generally tiny difference between floating point computation
between CPU and GPU was enough to make the sun vanish at different radii,
causing different results.

The new version fixes the difference by making the computation much more robust
on both platforms.
2020-07-08 02:15:37 +02:00
afcb41a0aa BLI: simplify copy constructor of Array 2020-07-07 20:32:40 +02:00
eb5fb1741d Cleanup: don't end description with a '.' 2020-07-07 20:29:35 +02:00
8713109212 Cleanup: fix typo 2020-07-07 20:27:34 +02:00
902ee4d13c Functions: cleanup loop that traverses the MFNetwork 2020-07-07 19:46:10 +02:00
22158162ef Functions: add generic functions that output constants 2020-07-07 19:34:35 +02:00
f4633cf46c BLI: simplify copy constructor of vector 2020-07-07 19:16:31 +02:00
67042aa6a1 Functions: extend multi-function network api 2020-07-07 18:45:34 +02:00
adfae89f96 BLI: provide access to underlying node in dot exporter 2020-07-07 18:40:42 +02:00
a8627ea66d Functions: Add debug print and destruct callback to CPPType 2020-07-07 18:39:24 +02:00
4990e4dd01 Nodes: Generate multi-function network from node tree
This adds new callbacks to `bNodeSocketType` and `bNodeType`.
Those are used to generate a multi-function network from a node
tree. Later, this network is evaluated on e.g. particle data.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8169
2020-07-07 18:23:33 +02:00
ff97545c50 Fix T75943 EEVEE: Cubemaps shows black
Caused by faulty driver implementation. Force fallback method.
2020-07-07 18:38:21 +02:00
1e2ff4f81b Cleanup: Add braces for clang tidy 2020-07-07 11:10:42 -04:00
0edf2fc128 BLI: Correct spin lock definition
The MSVC atomic function is defined for an unsigned type.

Not sure why this became an issue after switch to TBB by default,
maybe some CFLAGS changed to be more strict after that.
2020-07-07 16:51:03 +02:00
dad3de89dc Fix: remove accidental code
`v1` and `v2` are already set.
2020-07-07 11:27:23 -03:00
d352902758 Make deps: Use own nasm for ffmpeg and x264
Fixes the warning: building for macOS, but linking in object file

Differential Revision: https://developer.blender.org/D8235
2020-07-07 16:26:47 +02:00
1e3c0b4b03 Make deps: Compile own version of nasm for Apple
The upstream version of nasm does not put version information to the
generated object files, which makes linker to show the following
warning:

  building for macOS, but linking in object file

Using own patched version of nasm which puts required information to
the object file, making linker happy.

The plan is to either streamline the patch and provide it to the
upstream, or, it that takes too long, get an independent fix from the
upstream.
2020-07-07 16:26:13 +02:00
202e7ccaae Fix T77455: Blender Freezes when using the 3d Scale Gizmo
Issue is reported on Linux ith Intel HD6xx iGPU. Inside
`gpu_select_sample_query.c` the call to `glGetQueryObjectuiv` froze. After
bisecting this lead to the polyline shader. When using a 3d color shader
in stead of the polyline shader during selection seems to fix the issue.

Other parts of blender might also be effective, but I wasn't able to
freeze blender in these areas. When it does, we might want to add
a similar work-around to button2d, cage2d, cage3d & move3d, navigate.

Backport this patch to 2.83.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D8217
2020-07-07 16:22:05 +02:00
d1dcd2b464 BLI: Fix mistake in SpinLock TBB migration
Copy-paste mistake.
2020-07-07 16:17:58 +02:00
20558848d3 Optimization: use BLI_bvhtree_intersect_plane to detect faces that will be affected by the knife tool
The knife code currently calls the `BLI_bvhtree_overlap` function that
tests the overlap between the mesh tree and an AABB that encompasses the
points projected in the clip_start, clip_end and or clip_planes of the
view.

This resulted in many false positives since the AABB is very large.
Often all the triangles "overlapped".

The solution was to create a new function that actually tests the
intersection of AABB with a plane.

Even not considering the clip_planes of the view, this solution is more
appropriate than using overlap.

Differential Revision: https://developer.blender.org/D8229
2020-07-07 10:55:57 -03:00
630c6226e2 Fix T78307 UI: Drawing artifacts in the Blender UI on macOS
This was due to a bad driver which was not respecting this bit of the
specification:

`If the current primitive does not originate from an instanced draw command, the value of gl_InstanceID is zero.`
2020-07-07 16:26:01 +02:00
737bd549b6 Cycles: Add support for native OptiX curve primitive
This patch adds support for the curve primitive from OptiX to Cycles. It's currently hidden
behind a debug option, since there can be some slight rendering differences still (because no
backface culling is performed and something seems off with endcaps). The curve primitive
was added with the OptiX 7.1 SDK and requires a r450 driver or newer, so this also updates
the codebase to be able to build with the new SDK.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8223
2020-07-07 15:39:02 +02:00
95f0f31279 Fix T78692: improve UI regarding the effect of the denoiser on denoising passes
It wasn't obvious that the choice of Cycles denoiser also generates different
denoising data passes for compositing.
2020-07-07 15:12:41 +02:00
a394aac8b4 Fix T78666: Cycles non-uniformly scaled hair renders wrong for static objects
Don't apply the matrix transform optimization in this case, curve points and
radius can't represent non-uniform scale the way is possible with triangle
meshes and vertices.

This would cause abrupt change if objects had e.g. motion blur in one frame
and not in the next.
2020-07-07 15:08:21 +02:00
98bee41c8a IO: Reversed persistent ID order in exports to Alembic and USD
Each duplicated (a.k.a. instanced) object has a Persistent ID, which
identifies a dupli within the context of its duplicator. This ID
consists of several numbers when there are nested duplis (for example a
mesh instancing empties on its vertices, where each empty instances a
collection). When exporting to Alembic/USD, these are used to uniquely
name the duplicated objects in the export.

This commit reverses the order of the persistent ID numbers, so that the
first number identifies the first level of recursion. This produces
trees like this:

    ABC
     `--Triangle
         |--Triangle
         |--Empty-1
         |    `--Pole-1-0
         |        |--Pole
         |        `--Block-1-1
         |            `--Block
         |--Empty
         |    `--Pole-0
         |        |--Pole
         |        `--Block-1
         |            `--Block
         |--Empty-2
         |    `--Pole-2-0
         |        |--Pole
         |        `--Block-2-1
         |            `--Block
         `--Empty-0
             `--Pole-0-0
                 |--Pole
                 `--Block-0-1
                     `--Block

It is now clearer that `Pole-2-0` and `Block-2-1` are instanced by
`Empty-2`. Before this commit, they would have been named `Pole-0-2` and
`Block-1-2`.
2020-07-07 14:30:55 +02:00
70b1c09d7a IO: Fix bug exporting dupli parent/child relations
Exporting a scene to USD or Alembic would fail when there are multiple
duplicates of parent & child objects, duplicated by the same object. For
example, this happens when such a hierarchy of objects is contained in a
collection, and that collection is instanced multiple times by mesh
vertices. The problem here is that the 'parent' pointer of each
duplicated object points to the real parent; Blender would not figure
out properly which duplicated parent should be used.

This is now resolved by keeping track of the persistent ID of each
duplicated instance, which makes it possible to reconstruct the
parent-child relations of duplicated objects. This does use up some
memory for each dupli, so it could be heavy to export a Spring scene
(with all the pebbles and leaves), but it's only a small addition on top
of the USD/Alembic writer objects that have to be created anyway. At
least with this patch, they're created correctly.

Code-wise, the following changes are made:

- The export graph (that maps export parent to its export children) used
  to have as its key (Object, Duplicator). This is insufficient to
  correctly distinguish between multiple duplis of the same object by
  the same duplicator, so this is now extended to (Object, Duplicator,
  Persistent ID). To make this possible, new classes `ObjectIdentifier`
  and `PersistentID` are introduced.
- Finding the parent of a duplicated object is done via its persistent
  ID. In Python notation, the code first tries to find the parent
  instance where `child_persistent_id[1:] == parent_persistent_id[1:]`.
  If that fails, the dupli with persistent ID `child_persistent_id[1:]`
  is used as parent.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8233
2020-07-07 13:01:07 +02:00
f2175e06a7 Mae deps: Ensure Brotli is disabled for FreeType
We don't need it and it was optionally enabled, causing Blender to fail
to link on certain configuration (when Brotli is installed via Homebrew
for example).
2020-07-07 12:44:12 +02:00
02cd159539 Cleanup: add comment explaining operator delete 2020-07-07 12:31:25 +02:00
cc311e4a52 IO: print export name instead of object name in debug export graph output
This is just a change in `AbstractHierarchyIterator::debug_print_export_graph()`
to aid in debugging. It'll make it possible to distinguish between
different duplicates of the same object.

No functional changes to Blender itself.
2020-07-07 12:02:49 +02:00
5761cb9ee2 Guarded Allocator: add missing operator delete
This resolves warning C4291 on windows.
2020-07-07 11:52:45 +02:00
Johan Walles
80fe5e1b15 UI: Add units to motion tracking solve errors
The unit being "pixels".

Before this change the solve errors were unitless in the UI.

With this change in place, the UI is now clear on that the unit of the
reprojection errors is pixels (px).

Differential Revision: https://developer.blender.org/D8000
2020-07-07 11:22:12 +02:00
6d9a6f12b3 Make deps: Fix compilation error of Python on macOS
The configuration was confused about gettext installed via Homebrew
and isysroot passed to Python's compilation but not to test programs.

After this change `import gettext` still works, but it is unclear how
to test it further,

Differential Revision: https://developer.blender.org/D8231
2020-07-07 11:17:47 +02:00
955abbeff2 Fix sign conversion error 2020-07-07 09:01:01 +02:00
e233ee1c1f Fix T78186: Dyntopo panel error with tools that dont have a brush
Maniphest Tasks: T78186

Differential Revision: https://developer.blender.org/D8120
2020-07-07 10:38:56 +02:00
19d4e265b6 Cleanup: remove redundant comments
Searching in these files for "_as" will reveal a comment at the
top, that explains what these methods are for. There is no need
to duplicate that knowledge all over the place.
2020-07-07 10:35:55 +02:00
6e609f0eb0 Cleanup: use doxy comments 2020-07-07 17:52:05 +10:00
62774baded UI: add merge/split menus
This makes the menus and keymap match the edit-mesh
(M for merge, Alt-M for split).
2020-07-07 17:52:05 +10:00
d212b3dc43 Make deps: Fixes for macOS platform
Set of fixes which had to be made in order to have dependencies built
on own laptop:

- Require bison as a dependent software. It is required by ISPC.

  On macOS it is required to be installed via Homebrew. This is because
  Bison from Xcode toolchain is too old.

- Made sure Boost is compiled using clang.

  Without this gcc was used, and some unsupported command line argument
  was passed to it.

- Modify OGG in a way which does in fact pull fixed sized types.
  They are defined in stdint.h.

  Without this fix FFmpeg will not detect presence of OGG because the
  test program fails to compile.

- Force disable zstd compression and make wepb optional for the TIFF
  library. Without this TIFF might pick up development libraries from
  Homebrew.

Differential Revision: https://developer.blender.org/D8221
2020-07-07 09:31:46 +02:00
b28683b8b5 Cleanup: remove unused arguments 2020-07-07 16:04:10 +10:00
0c58970da7 Cleanup: spelling 2020-07-07 12:49:13 +10:00
ad0edc626d Cleanup: unused World struct members linfac, logfac 2020-07-07 12:44:20 +10:00
e20171e59f Fix build error with tests for removed functions
These GHash functions were removed in 12817083ec,
so the tests should be removed too.
2020-07-06 16:39:28 -04:00
d557f05502 Cleanup: Use bool instead of int 2020-07-06 16:07:54 -04:00
053e0c0af3 UI: Add shortcuts for shader effect panels
Only the delete shortcut applies here, although the move up and down
operators can optionally be assigned in the keymap.

See rB1fa40c9f8a81 for more details and rB5d2005cbb54b for the
grease pencil modifier panel implementation, which is the same.
2020-07-06 15:35:21 -04:00
12817083ec Cleanup: Use the BLI_edgehash API in the sewing simulation of cloths
Also remove the code in the ghash that is no longer used.

This change simplifies the existing code.

Differential Revision: https://developer.blender.org/D8219
2020-07-06 14:44:30 -03:00
a856de700b Fix T77730: ShaderFx Missing Update Notifier
This adds a notification type for shaderfx so the properties editor can
be properly notified to redraw.

Another possible solution would be to also redraw the shaderfx tab
 with a ND_MODIFIER update, but this solution allows us to avoid
 some unecessary redraws too. There were no existing cases of
ND_OBJECT | NC_MODIFIER updates, so those cases were
removed from buttons_area_listener.

Differential Revision: https://developer.blender.org/D8159
2020-07-06 13:17:07 -04:00
f6f4043924 BLI: add methods to lookup a stored key in a set 2020-07-06 17:59:27 +02:00
1562c9f031 Fix OptiX viewport denoising not working when rendering scene (without OptiX) that uses unsupported features
Denoising devices do not need to load the full feature set of kernels, so only activate the denoising
feature for them (so that it is possible to use features that are supported by the render devices, but
not the denoising devices).
2020-07-06 17:33:04 +02:00
aabfd2fb9b Cleanup: readfile: remove old deprecated OldNewMap for runtime caches. 2020-07-06 16:55:38 +02:00
ee3eba902a Runtime cache preservation during undo: add support for nodes and embedded IDs. 2020-07-06 16:55:38 +02:00
bfc644dcfb Reduce DupliObject::persistent_id from 16 to 8 items
For historical reasons, `DupliObject::persistent_id` was of size
`2*MAX_DUPLI_RECUR`. These reasons are now gone, and the persistent ID
always gets exactly one array element for every dupli-recursion.

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

Reviewed by: brecht
2020-07-06 16:52:28 +02:00
0b07f9b717 Fix T78608: Memory leak in Material properties: "Data from SCE".
Caused by recent own refactor of cache presevation handling in readfile,
EEVEE's lightcache are weird birds that can also be saved in .blend
files, need a special handling for those 'persistent' caches...
2020-07-06 15:09:39 +02:00
99feb10b8b Cleanup: warning, spelling 2020-07-06 23:07:18 +10:00
20446f07f6 Docs: reference bl_rna_get_subclass_py instead of bl_rna_get_subclass
bl_rna_get_subclass only works for Nodes at the moment.
2020-07-06 23:07:18 +10:00
ffaf294c3f Fix alignment/size issue on ARM/RPi architecture
Addresses 964305 from Debian bug tracker.
2020-07-06 14:53:39 +02:00
924578ce19 Optimization: Don't compute the snap to face on the knife tool twice
Both `knife_find_closest_vert` and `knife_find_closest_edge` call
`knife_find_closest_face`. Thus, running the raycast twice and setting
values like `kcd->curr.bmface` and `kcd->curr.is_space` repeatedly.

So:
- separate `knife_find_closest_face` from `knife_find_closest_vert` and `knife_find_closest_edge`.
- rename `knife_find_closest_vert` to `knife_find_closest_vert_of_face`
- rename `knife_find_closest_edge `to `knife_find_closest_edge_of_face`.
- do not set parameters previously set.

Differential Revision: https://developer.blender.org/D8198
2020-07-06 09:49:00 -03:00
073c426900 Fix faces disappearing when AutoMerge & Split 2020-07-06 09:03:33 -03:00
c632cf9ccd Fix UV select separate not refreshing the display 2020-07-06 21:23:35 +10:00
2c0cab03ca UV: add rip region to toolbar 2020-07-06 21:15:18 +10:00
dbe171fb26 Cleanup: spelling, comments 2020-07-06 21:03:45 +10:00
18b6c49a90 Cleanup: rename namespace TimeIt to timeit
According to our style guide, namespaces should have
lower case names.
2020-07-06 12:37:11 +02:00
572c48cf98 BLI: improve exception safety of memory utils
Even if we do not use exception in many places in Blender, our core C++ library
should become exception safe. Otherwise, we don't even have the option
to work with exceptions if we decide to do so.
2020-07-06 09:08:53 +02:00
703a73fa84 BLI: refactor how buffers for small object optimization are stored
Previously, there was an error when operator-> was returning an
invalid type. See error C2839.
2020-07-06 10:56:26 +02:00
80393a0eba UV: add rip tool
New rip tool matching edit-mesh rip functionality.

Useful as disconnecting UV's, especially for loops is inconvenient
without this.

This uses 'V' to rip, changing stitch to 'Alt-V'.
2020-07-06 18:27:51 +10:00
9353477383 BMesh: add BM_face_calc_uv_cross 2020-07-06 18:23:38 +10:00
b51b893df8 BMesh: add BM_loop_other_vert_loop_by_edge 2020-07-06 18:23:38 +10:00
705015e0a4 Fix T78481: Workbench Shadow effects XRay
When in XRay some effects (shadow, cavity & depth of field) aren't supported.
This patch makes sure that these effects aren't enabled.
2020-07-06 10:21:14 +02:00
4f3045999d Cleanup: warnings, spelling 2020-07-06 17:35:41 +10:00
0f617cd67e GPU: Remove local shaders workaround for Intel/Windows
It has been tested that local shaders workaround isn't needed for the
latest Windows/Intel 6xx GPU's.

Currently the local shaders workaround doesn't work anymore during the
investigation it was detected that the intel drivers didn't need it
anymore.

Local shaders should still be fixed as it is also used for some legacy
iGPU's. The current work around crashes when doing preview renders in
EEVEE as the default materials aren't available but for the work around
they should. (See T77346 for more information)
2020-07-06 07:45:10 +02:00
baf124c753 RNA Manual Reference: Update links 2020-07-05 16:45:56 -04:00
247a28f242 Revert "BLI: refactor how buffers for small object optimization are stored"
This reverts commit 5d79f9f276.

This was introducing build errors in windows. Need a bit more time to check it.
2020-07-05 15:08:26 +02:00
5d79f9f276 BLI: refactor how buffers for small object optimization are stored 2020-07-05 16:30:26 +02:00
464aaf2701 Fix T78603: GPencil Noise modifier Vertex Group influence filter missing
This was removed by error during the last refactor of modiifers.
2020-07-04 17:31:15 +02:00
169bb4b9ce BLI: fix mistake in move constructor of Stack 2020-07-04 17:28:25 +02:00
8e97694c8a Fix T78588: Material preview not visible in selection list
Logic to determine if the library icon should be used was too general.
2020-07-04 17:06:57 +02:00
9168ea8aab Cleanup: Fix small typo error 2020-07-04 11:15:11 +02:00
17603816f2 GPencil: Cleanup some comments typo 2020-07-04 11:04:21 +02:00
b0da78084b UI: Attempt to fix OSX widget shader issue
Some OSX GL driver implementation needs a dummy vbo read. This fixed issues
with the Hair shaders in the past.

Related to T78307
2020-07-04 01:27:59 +02:00
cad98923d0 Cleanup: spelling 2020-07-04 01:03:34 +02:00
ea65c6a153 Fix T78433: Adding Fade Generates Python Exception
This was caused by typo in rB67a822e08684.
2020-07-04 00:59:09 +02:00
4bf56b37ca Cleanup: Use C-style comments in outliner files
No functional changes. Convert all C++ style comments to C comments.
Also capitalize and add full stops.

The comments themselves were not cleaned up. Some could be removed or
reworded.
2020-07-03 13:40:12 -06:00
59ef43147e Cleanup: Remove unused outliner activation code
No functional changes. Remove commented calls to extern_set_butspace
and unused text activation code.
2020-07-03 13:40:12 -06:00
57a48bd0ca Cleanup: Use _fn suffix for outliner button callbacks
No functional changes. Use _fn instead of _cb.
2020-07-03 13:40:12 -06:00
d7dbf90a02 Clang-tidy: Enable braces-around-statements warning 2020-07-03 21:23:33 +02:00
185fe9cd8b Cleanup: compiler warning 2020-07-03 19:12:37 +02:00
46fcc12e83 Fix error in new Hair data type file reading 2020-07-03 19:12:36 +02:00
d2db481dc7 Cleanup: Blendkernel, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module. Not all warnings are
addressed in this commit.

No functional changes.
2020-07-03 18:18:16 +02:00
a21cb22f8b Cleanup: Deduplicate code for finding context object
Instead of manually checking the pinned object, use the existing
ED_object_active_context function. This requires adding const
to the context in that function.
2020-07-03 11:58:43 -04:00
33a74941c5 Cleanup: Editors, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors` module.

No functional changes.
2020-07-03 17:42:46 +02:00
367034f210 Cleanup: Editors/Space/UV-Edit, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/uv_edit` module.

No functional changes.
2020-07-03 17:42:45 +02:00
651d1aa7c8 Cleanup: Editors/Transform, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/transform` module.

No functional changes.
2020-07-03 17:42:45 +02:00
35ce16939c Cleanup: Editors/Space/sequencer, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_sequencer` module.

No functional changes.
2020-07-03 17:42:45 +02:00
a201020cd3 Cleanup: Editors/Space/Clip, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_clip` module.

No functional changes.
2020-07-03 17:42:45 +02:00
f254f66587 Cleanup: Editors/Space/Outliner, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_outliner` module.

No functional changes.
2020-07-03 17:42:45 +02:00
3aa53b361d Cleanup: Editors/Space/Node, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_node` module.

No functional changes.
2020-07-03 17:42:45 +02:00
bf532b1106 Cleanup: Editors/Space/Text, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_text` module.

No functional changes.
2020-07-03 17:42:45 +02:00
2f6fc5a7e8 Cleanup: Editors/Space/View3D, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/space_view3d` module.

No functional changes.
2020-07-03 17:42:45 +02:00
b61ecb785c Cleanup: Explicit return in each else if block in buttons_context()
This is a similar change as in rB4283da83cc9.

No functional changes.
2020-07-03 17:42:45 +02:00
f43fedd400 Cleanup: remove side effect in assertion 2020-07-03 17:35:40 +02:00
4a48939f04 UI: Fix bevel modifier not showing vertex group 2020-07-03 11:18:24 -04:00
cad2d32be6 Clang-Tidy: Enable bugprone-misplaced-widening-cast 2020-07-03 17:10:27 +02:00
4a5389816b Clang-Tidy: enable readability-named-parameter 2020-07-03 17:07:13 +02:00
fac2e63bc0 Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c
Treat those as pure runtime code, reset to NULL by reading code, for
now.

Think those could be handled like Image gputextures (i.e. considered
runtime cache and preserved across undo steps), but probably not
critical for now.
2020-07-03 17:01:21 +02:00
1bdabd7b4f Move MovieClip to new undo cache management system. 2020-07-03 17:01:21 +02:00
1019c9f582 Clang-Tidy: enable bugprone-too-small-loop-variable 2020-07-03 16:54:08 +02:00
883f9dd6e5 Clang-Tidy: enable bugprone-assert-side-effect
Looks like we have no assertions with side effects.
2020-07-03 16:48:16 +02:00
9739fc4d1b Clang-Tidy: More fixed of redundant check before delete
For some reason got unnoticed in the original cleanup pass.
2020-07-03 16:47:59 +02:00
14fd91e7e8 Clang-Tidy: enable bugprone-argument-comment
It was called `inverted` in the header.
2020-07-03 16:39:06 +02:00
f4fdb8efc5 Cleanup: Remove redundant logic 2020-07-03 10:38:49 -04:00
f66aafa391 Fix memory leak when dragging shaderfx 2020-07-03 10:37:58 -04:00
f891d4e2ad Clang-Tidy: Fix readability-delete-null-pointer warnings
Also enable it in the configuration.
2020-07-03 16:32:51 +02:00
53d41e1a6f UI: Use sliders and [0, 1] ranges in ocean modifier
The ocean modifier has two properties that use a [0, 10] hard min and
hard max. The values act as factors though, so it makes more sense to
use sliders and a 0 to 1 range.

This commit also bumps the file subversion to avoid repeatedly applying
the change to the properties' range.

Differential Revision: https://developer.blender.org/D8186
2020-07-03 10:28:13 -04:00
2a39b34a09 Cleanup: Editors/Sculpt/Paint, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/sculpt_paint` module.

No functional changes.
2020-07-03 16:15:01 +02:00
fd5b093f84 Cleanup: Editors/Screen, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/screen` module.

No functional changes.
2020-07-03 16:15:01 +02:00
4283da83cc Cleanup: Explicit return in each else if block in ed_screen_context()
The `ed_screen_context()` function is approximately 700 lines long, and
its main structure is a huge chain of `else if` statements. Some of the
bodies did not return, but rather fell through and relied on the `return
-1;` at the bottom of the function. This means that in order to truly
understand what is going on in one of those `else if` blocks, it could
be required to scroll past all the following `else if` blocks,
double-checking that they all had an `else`, and then see what happens
below.

By adding explicit `return -1;` everywhere this happened, this is all
avoided, increasing local understandability of the code. Furthermore, it
makes the upcoming cleanup with the Clang-Tidy rule
`readability-else-after-return` a lot easier to do.

No functional changes.
2020-07-03 16:15:01 +02:00
de7c9f41e6 Cleanup: Editors/Object, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/object` module.

No functional changes.
2020-07-03 16:15:01 +02:00
19483125f8 Cleanup: Editors/Mesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/mesh` module.

No functional changes.
2020-07-03 16:15:00 +02:00
7d0a0b8a6d Cleanup: Editors/Armature, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/armature` module.

No functional changes.
2020-07-03 16:15:00 +02:00
f82e52ebc8 Cleanup: Editors/Animation, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/animation` module.

No functional changes.
2020-07-03 16:15:00 +02:00
17ba566018 Fix Pose Brush crashing after disabling connected only in FK mode
This function was returning the ik_chain before disabling the
fake_neighbors, so when the brush was used again with fake neighbors
disabled after rebuilding the PBVH and free them, they were still
enabled in the SculptSession, causing a the crash.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8195
2020-07-03 16:13:49 +02:00
3a59c184b9 Move Scene's cache management during undo to new system. 2020-07-03 16:10:33 +02:00
a33756d783 Cleanup: Unused variables in non-debug build 2020-07-03 10:09:19 -04:00
6a58e15548 Cleanup: Remove obsolete code in interface_panel.c
Some code delt with panel merging in earlier versions of Blender,
which is no longer needed. Other code delt with controls that aren't
used anymore, and in some cases have region-level equivalents.

There's a surprising amount of this unused code in this file, so removing it
will be helpful for the future.

Differential Revision: https://developer.blender.org/D7938
2020-07-03 10:03:16 -04:00
88d358902f Clang-Tidy: Enable readability-redundant-string-cstr 2020-07-03 15:55:09 +02:00
405e6c6cc9 Fix T78555: GPencil bake animation operator loose frame setting
The values were reset for each run
2020-07-03 15:53:44 +02:00
19ff145e66 Clang-Tidy: Enable readability-redundant-control-flow 2020-07-03 09:41:55 -04:00
ffef562bf7 Disable clang-tidy for code-generated RNA files
This needs some extra care, which is probably easier once the initial
pass over integration is done.
2020-07-03 15:33:27 +02:00
c9975088a9 Move volume to new cache management system for undo. 2020-07-03 15:28:09 +02:00
1e255ce031 Fix T72214: Fluids: noise does not work with negative frame numbers
The issue is duplicated code. There are two functions that zero-fill
the frame number. They worked the same for positive frames numbers, but
behaved differently for negative ones.

On frame `-100`, `BLI_path_frame` outputs `-0100` and
`fluid_cache_get_framenr_formatted_$ID$` outputted `-100`.

I changed the behavior of the latter, because we depend on the behavior
of the former for much longer already.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8107
2020-07-03 15:27:02 +02:00
2633683b52 Clang-tidy: enable readability-container-size-empty warning
Reviewers: sergey

Differential Revision: https://developer.blender.org/D8197
2020-07-03 14:59:27 +02:00
93da09d717 Cleanup: add const in various places 2020-07-03 14:53:06 +02:00
9dce2c9d14 Cleanup: Editors/GPencil, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/gpencil` module.

No functional changes.
2020-07-03 14:48:38 +02:00
20869065b8 Cleanup: BMesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/bmesh` module.

No functional changes.
2020-07-03 14:48:37 +02:00
f3b8792b96 Cleanup: Interface, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/interface` module.

No functional changes.
2020-07-03 14:48:37 +02:00
86e7648f0e Cleanup: Mark overriding function with override keyword
No functional changes.
2020-07-03 14:48:37 +02:00
7704e6a678 Cleanup: bring operator overloads closer together 2020-07-03 14:31:26 +02:00
395b294b61 Cleanup: use nested namespaces 2020-07-03 14:25:20 +02:00
5fbf70b0d0 Cleanup: use trailing underscore for non-public data members 2020-07-03 14:20:42 +02:00
d64803f63b Cleanup: Use trailing underscore for non-public data members
This makes the code conform better with our style guide.
2020-07-03 14:16:02 +02:00
e797c4f28f Fix T78570: Vert/Edge slide doesn't adjust UVs 2020-07-03 09:01:32 -03:00
dfbb13b593 GPencil: Cleanup more comments (cont) 2020-07-03 13:52:04 +02:00
6fea8ec183 Clang-Tidy: Enable redundant static qualifier warning
This change enables readability-static-definition-in-anonymous-namespace
warning in .clang-tidy configuration.
2020-07-03 12:58:13 +02:00
aab41401f9 Move bSound cache handling during undo to new system. 2020-07-03 12:56:21 +02:00
ae5529c848 Cleanup: do not use magic values for enums... 2020-07-03 12:56:21 +02:00
8e0f8bb3e1 New undo cache management: Add Image IDs.
Some notes:
* `Image.cache` acts as some kind of 'main' cache, when it is NULL
  (could not be restored), other caches should also be cleared. Oddly
  enough, previous code was not clearing **all** caches, could not find
  any reason for that behavior, so new code does a full clear.
* `imamap` is still used for Node previews from scenes' compositor,
  however this is actually fully disabled in `direct_link_node()`.
* For render slots we cannot use offsetof as third part of the cache
  key, so we are using a hash of the slot's name instead.

As far as I can tell, this fixes T76989: Visual glitches when undo after
reload multiple images by script (in Material Preview).
2020-07-03 12:56:21 +02:00
5fa6bd8a8d Readfile/Undo: initial refactor of cache preservation code.
Main goal here is to have better specificity using cache keys, to avoid
same memroy address being re-used messing up with cache pointers
restoration after undo had to re-read a data-block.

Once all caches handling are ported  to this new system, it should fix
random issues like the one reported in T76989.

Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
6cb796e98e IDTypeInfo: add new callback to loop over all cache pointers of an ID.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
5dda6cefb6 Add key structure and hashing utils for ID caches.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
2020-07-03 12:56:21 +02:00
a06d95987e GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
972d1700cd GPencil: Cleanup more comments (cont) 2020-07-03 12:55:47 +02:00
4ccd96f1a4 Cycles: rename viewport denoise Fastest option to Automatic and extend tooltip 2020-07-03 12:36:17 +02:00
83eeaddce8 Clang-tidy: Enable bugprone-lambda-function-name warning 2020-07-03 12:30:20 +02:00
bbeb1b2b52 Depsgraph: Use C++ style of guarded allocation of objects 2020-07-03 12:30:20 +02:00
468adfa4fd Guarded allocator: Override placement new operator
Allows to in-place construct objects which are using guarded allocator.
2020-07-03 12:30:20 +02:00
cdea648117 GPencil: Cleanup move functions to geom from modifier 2020-07-03 11:54:07 +02:00
2193c37768 GPencil: Cleanup Doxygen comments (cont) 2020-07-03 11:54:07 +02:00
b1d3850333 Cleanup: Fluid renaming from old 'manta' naming to new 'fluid' naming
Changed variable names from mmd, mds, mfs, and mes to fmd, fds, ffs, and fes. The author of this commits lights a candle for all the merge conflicts this will cause.
2020-07-03 11:52:08 +02:00
868d6ba1a7 GPencil: Cleanup Doxygen comments 2020-07-03 11:20:00 +02:00
746aec51a7 Cycles: Use TBB's spin mutex
First benefit is reduced boilerplate code.

Second benefit is fixed warnings about using deprecated spin lock
on macOS when using SDK 10.12 and above.

Differential Revision: https://developer.blender.org/D8182
2020-07-03 11:14:26 +02:00
0e1ee29f77 BLI: Use TBB spin_mutex as SpinLock implementation
When building without TBB use native to the platform spin lock
implementation. For Windows it is an atomic-based busy-wait,
for Linux it is pthreads' spin lock.

For macOS it is a mutex lock. The reason behind this is to stop
using atomics library which has been declared deprecated in SDK
version 10.12. So this changes fixes a lot of noisy warnings on
the newer SDK.

Differential Revision: https://developer.blender.org/D8180
2020-07-03 11:14:17 +02:00
0f4049db5f BLI: Switch threads implementation file to C++
Allows to use C++ primitives in the primitive implementation.
2020-07-03 11:14:06 +02:00
edb49d3dc2 Clang-Tidy: Allow use with GCC but warn about possible failure
The compilation using GCC + Clang-Tidy succeeded for me and Sybren
(with some linker caveats for Sybren) but seems that it is doable
to make GCC + Clang-Tidy to officially work for Blender.

Now it should be possible to enable Clang-Tidy doing something like

  make developer debug BUILD_CMAKE_ARGS='-DWITH_CLANG_TIDY=ON'
2020-07-03 10:58:24 +02:00
dfdd23bae6 Clang-Tidy: Silence warning affecting newer code
For now Clang-Tidy should be passable with the codebase as is. This warning
will be addressed as quality day task.
2020-07-03 10:23:44 +02:00
9ea5469178 Initial support of clang-tidy toolchain
Clang Tidy is a Clang based "linter" tool which goal is to help
fixing typical programming errors.

It is run as a separate compile step of every file, which slows
compilation down but allows to fully analyze the file the same
way as compiler does and catch non-trivial bugprone cases.

This change includes:

- CMake option called `WITH_CLANG_TIDY` which enables Clang Tidy
  linter tool on all source in the `source/` directory.

  This option is only available on Linux, as it is currently the
  easiest platform to get the Clang Tidy toolchain to work.

- CMake module which is aimed to find latest available Clang Tidy.

- Set of rules which allows to have Blender fully compiled without
  extra issues.

The goal of this change is to provide a base ground so that solving
all the warnings can happen later on, as a team effort.

It should be possible to use Clang Tidy side-by-side with both GCC
and Clang, but there seems to be some tweaks to be done in CMake to
make it really work for Blender. For now use Clang toolchain if
there are issues with GCC+Clang Tidy.

It will be worked on in the nearest future to bring seamless
experience for all configurations.

Currently there is no official way of getting Clang Tidy on macOS,
and on Windows there are some difficulties of hooking up Clang Tidy
from LLVM package to the MSVC compiler toolchain.

The actual warnings in the code will be addressed as a part of the
Code Quality Days, task T78535.

Differential Revision: https://developer.blender.org/D7937
2020-07-03 09:57:41 +02:00
a272a2a6cd Cleanup: spelling 2020-07-03 11:58:13 +10:00
0fdb79fe58 UI: Add Edge Loopcut Slide to edge menu
This was exposed in the context menu but not the main edge menu.
2020-07-02 20:33:49 -04:00
a68fd2561e Fix T78551 EEVEE: Fix memleak from renderpass ubo 2020-07-03 02:28:06 +02:00
0961ce04cb Fix T78124 Overlay: Image: Camera background image transparency not working
This changes to premultiplied blending for all cases and put the premult
in the shader.
2020-07-03 01:48:39 +02:00
5a13f682ee Fix T77559 Avoid wrong ob->imat leading to several bugs
This fixes T77559 Scale to zero in object mode unable to select
2020-07-03 00:21:56 +02:00
Philip Holzmann
a07922159d Fix T78527: GPencil Mirror modifier is inconsistent with Mesh Mirror (redo)
Simply the same code the regular mesh mirror modifier uses.

Differential Revision: https://developer.blender.org/D8188
2020-07-02 23:02:02 +02:00
Juan
1278657cc2 UI: rename Alpha to Opacity
There was a discrepancy between the Tooltip of the Camera's Background Image that controls the opacity of the image and the operator's name that reads Alpha. The tooltip says **"Image opacity to blend the image against the background color"**, so it was renamed to Opacity to follow the tooltip.
The decision for this change is that the naming Alpha is not the most appropriated, since it has nothing to do if a loaded image has an embedded Alpha channel or not.

{F8540101}

Reviewed By: #user_interface, pablovazquez

Differential Revision: https://developer.blender.org/D7760
2020-07-02 16:47:46 -04:00
Nicola De Mitri
3ea302cf8e UI: Replace "Grease Pencil" with "Annotation" in user-facing options in the Clip editor
This revision affects the menu under: Clip > Track > Detect Features > Placement.
A bit of UI that was probably missed when the legacy GP was renamed to Annotation

{F8647693}

In this state, it may be confusing for the user.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D8139
2020-07-02 16:40:42 -04:00
Valentin
f3e4a3473e Cleanup: Remove useless duplicated lines
I spotted a duplicate struct declaration, so I had to check for other duplicated as well
There might be some other but i am not confident enough for deleting them

this regex search for duplicate ^(.*;)$\n(\1)$

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D8146
2020-07-02 16:36:39 -04:00
ef0ec01461 UI: Dont abbriviate location & rotation
This resolves one of the last few areas where we still use inappropriate
abbreviations. Reading abbreviated words is usually slower, because
users must parse, guess and translate the words. Using abbreviations
such as 'rot' is also especially bad since it's a word in itself too.

The main advantage of abbreviations is that they are faster to *write*,
which just isn't a concern for text in the UI.

Differential Revision: https://developer.blender.org/D8174
2020-07-02 16:28:45 -04:00
33f36b453a GPencil: Cleanup - More rename from gp_ to gpencil_ 2020-07-02 20:04:56 +02:00
c5ec8d91bd Sculpt: Mask By Color
This tool generates masks based on the sculpt vertex colors by clicking
on the model, similar to automatic selection tools in image editing
software.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D8157
2020-07-02 18:20:47 +02:00
85980743b0 Cleanup: Fix build error with clang on windows.
Header and implementation signature for ED_object_add_duplicate
were not the same leading to a build error with clang on windows.
2020-07-02 10:16:54 -06:00
95f3397a68 Fix T78525: Status bar not reset after Edit Voxel Size
Reviewed By: sergey

Maniphest Tasks: T78525

Differential Revision: https://developer.blender.org/D8181
2020-07-02 18:08:38 +02:00
7099459245 UI: Use consistent order in ocean modifier 2020-07-02 11:55:37 -04:00
Phil Stopford
17b89f6dac Ocean modifier: Expose eigenvectors for use as map
The eigenvectors in the ocean modifier (plus and minus) can be useful,
but are not exposed. Assuming the particle system was capable, the
eigenvectors could be used to drive spray emission velocities.

This exposes the controls to allow a map to be generated from these
eigenvectors. Currently, the values are mapped into a 0-255 range
similar to foam.

Differential Revision: https://developer.blender.org/D7182
2020-07-02 11:49:15 -04:00
35481fde40 GPUOffScreen: Remove the sample parameter
This is because the DRW module is no longer compatible with drawing using
MSAA.

This also change the Python API.
2020-07-02 17:28:41 +02:00
a4fe8ef236 Fix T78527: GPencil Mirror modifier is inconsistent with Mesh Mirror
The grease pencil mirror was using the current axis rotation but the mesh modifier doesn't use it.
2020-07-02 16:57:20 +02:00
06de1bddae UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:

Renaming Options:
  - Build: "Start" -> "Start Frame"
  - Curve: "From Radius" -> "Size from Radius"
  - Screw: "Calc Order" -> "Calculate Order"
  - Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"

Move Mode Toggle to Top & Expand:
  - Bevel, Boolean, Normal Edit, Subdivision

Use Columns for Tighter Spacing:
  - Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
    Solidify, Warp, Weighted Normal, Wave

Misc:
  - Bevel: Set inactive properties for vertex bevel
  - Mesh Sequence Cache: Remove box for cache file
  - Skin: Don't align "Mark Loose" and "Clear Loose"
  - Array: Expand relative offset subpanel by default
  - Array: Move start cap, end cap to a new subpanel
  - Bevel: Move width type above width

Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
3974 changed files with 202544 additions and 140956 deletions

View File

@@ -238,6 +238,7 @@ ForEachMacros:
- LISTBASE_FOREACH_BACKWARD
- LISTBASE_FOREACH_MUTABLE
- LISTBASE_FOREACH_BACKWARD_MUTABLE
- LISTBASE_FOREACH_INDEX
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
- NODE_SOCKET_TYPES_BEGIN
@@ -252,8 +253,8 @@ ForEachMacros:
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQP_BEGIN
- SEQ_BEGIN
- SEQ_ALL_BEGIN
- SEQ_CURRENT_BEGIN
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter

36
.clang-tidy Normal file
View File

@@ -0,0 +1,36 @@
Checks: >
-*,
readability-*,
-readability-uppercase-literal-suffix,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-convert-member-functions-to-static,
-readability-implicit-bool-conversion,
-readability-avoid-const-params-in-decls,
-readability-simplify-boolean-expr,
-readability-make-member-function-const,
-readability-misleading-indentation,
-readability-inconsistent-declaration-parameter-name,
-readability-redundant-preprocessor,
-readability-redundant-member-init,
-readability-const-return-type,
-readability-static-accessed-through-instance,
-readability-redundant-declaration,
-readability-qualified-auto,
-readability-use-anyofallof,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-incorrect-roundings,
-bugprone-copy-constructor-init,
WarningsAsErrors: '*'

View File

@@ -41,7 +41,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()
endif()
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)
# Prever LEGACY OpenGL to eb compatible with all the existing releases and
# platforms which don't hare GLVND yet. Only do it if preference was not set
@@ -102,6 +102,11 @@ if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
# find_package() uses <PackageName>_ROOT variables.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
#-----------------------------------------------------------------------------
# Load some macros.
include(build_files/cmake/macros.cmake)
@@ -183,6 +188,7 @@ if(APPLE)
else()
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
endif()
option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON)
# Compositor
option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON)
@@ -214,6 +220,8 @@ if(WITH_GHOST_X11)
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
endif()
option(WITH_GMP "Use the gmp library for more accurate booleans" OFF)
# Misc...
option(WITH_HEADLESS "Build without graphical support (renderfarm, server mode only)" OFF)
mark_as_advanced(WITH_HEADLESS)
@@ -367,7 +375,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 compute_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
@@ -415,6 +423,11 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" ON)
mark_as_advanced(WITH_ASSERT_ABORT)
if(UNIX AND NOT APPLE)
option(WITH_CLANG_TIDY "Use Clang Tidy to analyze the source code (only enable for development on Linux using Clang)" OFF)
mark_as_advanced(WITH_CLANG_TIDY)
endif()
option(WITH_BOOST "Enable features depending on boost" ON)
option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON)
@@ -423,6 +436,10 @@ if(WIN32)
option(WITH_TBB_MALLOC_PROXY "Enable the TBB malloc replacement" ON)
endif()
# This should be turned off when Blender enter beta/rc/release
option(WITH_EXPERIMENTAL_FEATURES "Enable experimental features (still need to enable them in the user preferences)" ON)
mark_as_advanced(WITH_EXPERIMENTAL_FEATURES)
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
@@ -895,7 +912,7 @@ if(MSVC)
# endianess-detection and auto-setting is counterproductive
# so we just set endianness according CMAKE_OSX_ARCHITECTURES
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64 OR CMAKE_OSX_ARCHITECTURES MATCHES arm64)
add_definitions(-D__LITTLE_ENDIAN__)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)
add_definitions(-D__BIG_ENDIAN__)
@@ -1555,6 +1572,12 @@ endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
# Make MSVC properly report the value of the __cplusplus preprocessor macro
# Available MSVC 15.7 (1914) and up, without this it reports 199711L regardless
# of the C++ standard chosen above
if(MSVC_VERSION GREATER 1913)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
elseif(
CMAKE_COMPILER_IS_GNUCC OR
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
@@ -1623,10 +1646,6 @@ endif()
#-----------------------------------------------------------------------------
# Libraries
if(WITH_GTESTS)
include(GTestTesting)
endif()
if(WITH_BLENDER)
add_subdirectory(intern)
add_subdirectory(extern)
@@ -1721,6 +1740,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_option(WITH_GMP)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)

View File

@@ -30,7 +30,7 @@
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
@@ -57,7 +57,6 @@ include(cmake/zlib.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/boost.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/openexr.cmake)
@@ -76,6 +75,7 @@ include(cmake/llvm.cmake)
include(cmake/clang.cmake)
if(APPLE)
include(cmake/openmp.cmake)
include(cmake/nasm.cmake)
endif()
include(cmake/openimageio.cmake)
include(cmake/tiff.cmake)
@@ -88,14 +88,18 @@ include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/numpy.cmake)
include(cmake/usd.cmake)
# Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
endif()
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
endif()
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
@@ -114,6 +118,7 @@ if(WIN32)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)

View File

@@ -19,17 +19,6 @@
set(BOOST_ADDRESS_MODEL 64)
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PYTHON_ARCH x64)
set(PYTHON_ARCH2 win-AMD64)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/amd64/)
else()
set(PYTHON_ARCH x86)
set(PYTHON_ARCH2 win32)
set(PYTHON_OUTPUTDIR ${BUILD_DIR}/python/src/external_python/pcbuild/win32/)
set(BOOST_ADDRESS_MODEL 32)
endif()
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
@@ -44,7 +33,7 @@ if(WIN32)
elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS toolset=darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .)
set(BOOST_PATCH_COMMAND echo .)
else()
@@ -60,6 +49,21 @@ else()
endif()
endif()
if(WITH_BOOST_PYTHON)
set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
configure_file(${PATCH_DIR}/boost.user.jam.in ${JAM_FILE})
set(BOOST_PYTHON_OPTIONS
--with-python
--user-config=${JAM_FILE}
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(BOOST_PYTHON_OPTIONS
${BOOST_PYTHON_OPTIONS}
define=BOOST_DEBUG_PYTHON
)
endif()
endif()
set(BOOST_OPTIONS
--with-filesystem
--with-locale
@@ -76,6 +80,7 @@ set(BOOST_OPTIONS
-sNO_LZMA=1
-sNO_ZSTD=1
${BOOST_TOOLSET}
${BOOST_PYTHON_OPTIONS}
)
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
@@ -92,3 +97,11 @@ ExternalProject_Add(external_boost
BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
)
if(WITH_BOOST_PYTHON)
add_dependencies(
external_boost
external_python
external_numpy
)
endif()

View File

@@ -30,6 +30,7 @@ if(UNIX)
nasm
yasm
tclsh
bison
)
foreach(_software ${_required_software})
@@ -40,6 +41,12 @@ if(UNIX)
unset(_software_find CACHE)
endforeach()
if(APPLE)
if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
set(_software_missing "${_software_missing} bison")
endif()
endif()
if(_software_missing)
message(
"\n"
@@ -50,7 +57,7 @@ if(UNIX)
" apt install autoconf automake libtool yasm nasm tcl\n"
"\n"
"On macOS (with homebrew):\n"
" brew install cmake autoconf automake libtool yasm nasm\n"
" brew install cmake autoconf automake libtool yasm nasm bison\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")

View File

@@ -30,6 +30,11 @@ else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
ExternalProject_Add(external_clang
URL ${CLANG_URI}

View File

@@ -50,7 +50,8 @@ if(APPLE)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--target-os=darwin
)
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
endif()
ExternalProject_Add(external_ffmpeg
@@ -94,8 +95,6 @@ ExternalProject_Add(external_ffmpeg
--disable-version3
--disable-debug
--enable-optimizations
--disable-sse
--disable-ssse3
--enable-ffplay
--disable-openssl
--disable-securetransport
@@ -143,6 +142,12 @@ if(WIN32)
external_zlib_mingw
)
endif()
if(APPLE)
add_dependencies(
external_ffmpeg
external_nasm
)
endif()
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_ffmpeg after_install

View File

@@ -24,7 +24,8 @@ set(FREETYPE_EXTRA_ARGS
-DFT_WITH_HARFBUZZ=OFF
-DFT_WITH_BZIP2=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE)
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
ExternalProject_Add(external_freetype
URL ${FREETYPE_URI}

View File

@@ -0,0 +1,95 @@
# ***** 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(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32)
# Shared for windows because static libs will drag in a libgcc dependency.
set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
else()
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
endif()
ExternalProject_Add(external_gmp
URL ${GMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
INSTALL_DIR ${LIBDIR}/gmp
)
if(MSVC)
set_target_properties(external_gmp PROPERTIES FOLDER Mingw)
endif()
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
DEPENDEES install
)
endif()
if(WIN32)
# gmpxx is somewhat special, it builds on top of the C style gmp library but exposes C++ bindings
# given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
# with MSVC, while GMP can only be build with mingw.
ExternalProject_Add(external_gmpxx
URL ${GMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmpxx
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmpxx ${DEFAULT_CMAKE_FLAGS} -DGMP_LIBRARY=${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib -DGMP_INCLUDE_DIR=${BUILD_DIR}/gmp/src/external_gmp -DCMAKE_DEBUG_POSTFIX=_d
INSTALL_DIR ${LIBDIR}/gmpxx
)
set_target_properties(external_gmpxx PROPERTIES FOLDER Mingw)
add_dependencies(
external_gmpxx
external_gmp
)
ExternalProject_Add_Step(external_gmpxx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmpxx/ ${HARVEST_TARGET}/gmp
DEPENDEES install
)
endif()

View File

@@ -42,7 +42,7 @@ if(BUILD_MODE STREQUAL Release)
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
@@ -89,6 +89,8 @@ harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
@@ -132,8 +134,12 @@ 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")
if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
endif()
harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h")
@@ -168,8 +174,6 @@ harvest(vpx/lib ffmpeg/lib "*.a")
harvest(webp/lib ffmpeg/lib "*.a")
harvest(x264/lib ffmpeg/lib "*.a")
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a")
harvest(usd/include usd/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*")
harvest(usd/plugin usd/plugin "*")

View File

@@ -22,6 +22,17 @@ if(WIN32)
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
)
elseif(APPLE)
# Use bison installed via Homebrew.
# The one which comes which Xcode toolset is too old.
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
)
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/clang/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/clang/bin/clang++
)
endif()
set(ISPC_EXTRA_ARGS
@@ -36,6 +47,8 @@ set(ISPC_EXTRA_ARGS
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
)
ExternalProject_Add(external_ispc
@@ -60,4 +73,3 @@ if(WIN32)
external_flexbison
)
endif()

View File

@@ -16,11 +16,17 @@
#
# ***** END GPL LICENSE BLOCK *****
if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(LLVM_TARGETS AArch64)
else()
set(LLVM_TARGETS X86)
endif()
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS}
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF

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 *****
ExternalProject_Add(external_nasm
URL ${NASM_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${NASM_HASH}
PREFIX ${BUILD_DIR}/nasm
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install
INSTALL_DIR ${LIBDIR}/nasm
)

View File

@@ -38,6 +38,7 @@ ExternalProject_Add(external_numpy
PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND ""
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff
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 ""

View File

@@ -21,6 +21,7 @@ ExternalProject_Add(external_ogg
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && make install

View File

@@ -30,6 +30,13 @@ set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_STATIC_JNIGLUE=OFF
)
if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_SSE=OFF
)
endif()
if(WIN32)
set(OCIO_PATCH opencolorio_win.diff)
set(OPENCOLORIO_EXTRA_ARGS

View File

@@ -22,6 +22,7 @@ ExternalProject_Add(external_openmp
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp

View File

@@ -20,6 +20,14 @@ if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d)
endif()
if(WIN32)
set(OPENVDB_SHARED ON)
set(OPENVDB_STATIC OFF)
else()
set(OPENVDB_SHARED OFF)
set(OPENVDB_STATIC ON)
endif()
set(OPENVDB_EXTRA_ARGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
@@ -42,8 +50,10 @@ set(OPENVDB_EXTRA_ARGS
-DOPENEXR_LIBRARYDIR=${LIBDIR}/openexr/lib
# All libs live in openexr, even the ilmbase ones
-DILMBASE_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_SHARED=Off
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d
)
if(WIN32)
@@ -87,13 +97,15 @@ if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/libopenvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/libopenvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb_d.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb_d.dll ${HARVEST_TARGET}/openvdb/bin/openvdb_d.dll
DEPENDEES install
)
endif()

View File

@@ -20,6 +20,7 @@ if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)
@@ -113,16 +114,32 @@ else()
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.11)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT CMAKE_OSX_ARCHITECTURES)
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Detected native architecture ${ARCHITECTURE}.")
set(CMAKE_OSX_ARCHITECTURES "${ARCHITECTURE}")
endif()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(OSX_DEPLOYMENT_TARGET 10.13)
else()
set(OSX_DEPLOYMENT_TARGET 11.00)
endif()
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin15.0.0) # OS X 10.11
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
else()
set(PLATFORM_BUILD_TARGET --build=aarch64-apple-darwin20.0.0) # macOS 11.00
endif()
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
)
@@ -155,6 +172,7 @@ else()
set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${PLATFORM_LDFLAGS}
@@ -177,18 +195,6 @@ set(DEFAULT_CMAKE_FLAGS
${PLATFORM_CMAKE_FLAGS}
)
if(WIN32)
# We need both flavors to build the thumbnail dlls
if(MSVC12)
set(GENERATOR_32 "Visual Studio 12 2013")
set(GENERATOR_64 "Visual Studio 12 2013 Win64")
elseif(MSVC14)
set(GENERATOR_32 "Visual Studio 14 2015")
set(GENERATOR_64 "Visual Studio 14 2015 Win64")
endif()
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Debug)
set(ZLIB_LIBRARY zlibstaticd${LIBEXT})

View File

@@ -22,6 +22,10 @@ set(PNG_EXTRA_ARGS
-DPNG_STATIC=ON
)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
endif()
ExternalProject_Add(external_png
URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}

View File

@@ -42,13 +42,18 @@ if(WIN32)
URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python
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}
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE}
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-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
)
else()
if(APPLE)
# disable functions that can be in 10.13 sdk but aren't available on 10.9 target
# Disable functions that can be in 10.13 sdk but aren't available on 10.9 target.
#
# Disable libintl (gettext library) as it might come from Homebrew, which makes
# it so test program compiles, but the Python does not. This is because for Python
# we use isysroot, which seems to forbid using libintl.h.
# The gettext functionality seems to come from CoreFoundation, so should be all fine.
set(PYTHON_FUNC_CONFIGS
export ac_cv_func_futimens=no &&
export ac_cv_func_utimensat=no &&
@@ -60,13 +65,21 @@ else()
export ac_cv_func_getentropy=no &&
export ac_cv_func_mkostemp=no &&
export ac_cv_func_mkostemps=no &&
export ac_cv_func_timingsafe_bcmp=no)
export ac_cv_func_timingsafe_bcmp=no &&
export ac_cv_header_libintl_h=no &&
export ac_cv_lib_intl_textdomain=no
)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(PYTHON_FUNC_CONFIGS ${PYTHON_FUNC_CONFIGS} && export PYTHON_DECIMAL_WITH_MACHINE=ansi64)
endif()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_macos.diff)
else()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
endif()
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
endif()
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
@@ -76,7 +89,6 @@ else()
export CPPFLAGS=${PYTHON_CFLAGS} &&
export LDFLAGS=${PYTHON_LDFLAGS} &&
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
ExternalProject_Add(external_python
URL ${PYTHON_URI}

View File

@@ -51,7 +51,7 @@ ExternalProject_Add(external_sqlite
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA1=${SQLITE_HASH}
PREFIX ${BUILD_DIR}/sqlite
PATCH_COMMAND ${SQLITE_PATCH_CMD}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/sqlite/src/external_sqlite < ${PATCH_DIR}/sqlite.diff
CONFIGURE_COMMAND ${SQLITE_CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/sqlite ${SQLITE_CONFIGURATION_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sqlite/src/external_sqlite/ && make install

View File

@@ -20,7 +20,7 @@ set(SSL_CONFIGURE_COMMAND ./Configure)
set(SSL_PATCH_CMD echo .)
if(APPLE)
set(SSL_OS_COMPILER "blender-darwin-x86_64")
set(SSL_OS_COMPILER "blender-darwin-${CMAKE_OSX_ARCHITECTURES}")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(SSL_EXTRA_ARGS enable-ec_nistp_64_gcc_128)

View File

@@ -12,4 +12,9 @@ my %targets = (
inherit_from => [ "darwin64-x86_64-cc" ],
cflags => add("-fPIC"),
},
"blender-darwin-arm64" => {
inherit_from => [ "darwin-common" ],
cxxflags => add("-fPIC -arch arm64"),
cflags => add("-fPIC -arch arm64"),
},
);

View File

@@ -27,6 +27,7 @@ ExternalProject_Add(external_theora
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${THEORA_HASH}
PREFIX ${BUILD_DIR}/theora
PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/theora/src/external_theora < ${PATCH_DIR}/theora.diff
CONFIGURE_COMMAND ${THEORA_CONFIGURE_ENV} && cd ${BUILD_DIR}/theora/src/external_theora/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/theora
--disable-shared
--enable-static

View File

@@ -16,6 +16,12 @@
#
# ***** END GPL LICENSE BLOCK *****
if(WITH_WEBP)
set(WITH_TIFF_WEBP ON)
else()
set(WITH_TIFF_WEBP OFF)
endif()
set(TIFF_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
@@ -23,6 +29,8 @@ set(TIFF_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-Dlzma=OFF
-Djbig=OFF
-Dzstd=OFF
-Dwebp=${WITH_TIFF_WEBP}
)
ExternalProject_Add(external_tiff

View File

@@ -305,9 +305,18 @@ set(MESA_VERSION 18.3.1)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)
set(NASM_VERSION 2.15.02)
set(NASM_URI https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz)
set(NASM_HASH f4fd1329b1713e1ccd34b2fc121c4bcd278c9f91cc4cb205ae8fcd2e4728dd14)
set(XR_OPENXR_SDK_VERSION 1.0.8)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
set(ISPC_VERSION v1.13.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
set(GMP_VERSION 6.2.0)
set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)

View File

@@ -24,7 +24,11 @@ if(WIN32)
endif()
else()
if(APPLE)
set(VPX_EXTRA_FLAGS --target=x86_64-darwin13-gcc)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(VPX_EXTRA_FLAGS --target=generic-gnu)
else()
set(VPX_EXTRA_FLAGS --target=x86_64-darwin17-gcc)
endif()
else()
set(VPX_EXTRA_FLAGS --target=generic-gnu)
endif()

View File

@@ -21,12 +21,26 @@ if(WIN32)
endif()
if(APPLE)
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(X264_EXTRA_ARGS ${X264_EXTRA_ARGS} "--disable-asm")
set(X264_CONFIGURE_ENV echo .)
else()
set(X264_CONFIGURE_ENV
export AS=${LIBDIR}/nasm/bin/nasm
)
endif()
else()
set(X264_CONFIGURE_ENV echo .)
endif()
ExternalProject_Add(external_x264
URL ${X264_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${X264_CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic
--disable-lavf
@@ -39,3 +53,10 @@ ExternalProject_Add(external_x264
if(MSVC)
set_target_properties(external_x264 PROPERTIES FOLDER Mingw)
endif()
if(APPLE)
add_dependencies(
external_x264
external_nasm
)
endif()

View File

@@ -374,71 +374,96 @@ NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=true
# Note about versions: Min is inclusive, Max is exclusive (i.e. XXX_VERSION_MIN <= ACTUAL_VERSION < XXX_VERSION_MAX)
# XXX_VERSION is officially supported/used version in official builds.
# XXX_VERSION_SHORT is used for various things, like preferred version (when distribution provides several of them),
# and to name shortcuts to built libraries' installation directories...
CLANG_FORMAT_VERSION_MIN="6.0"
CLANG_FORMAT_VERSION_MAX="10.0"
PYTHON_VERSION="3.7.7"
PYTHON_VERSION_SHORT="3.7"
PYTHON_VERSION_MIN="3.7"
PYTHON_VERSION_MAX="3.9"
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_MIN
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
NUMPY_VERSION="1.17.0"
NUMPY_VERSION="1.17.5"
NUMPY_VERSION_SHORT="1.17"
NUMPY_VERSION_MIN="1.8"
NUMPY_VERSION_MAX="2.0"
NUMPY_FORCE_BUILD=false
NUMPY_FORCE_REBUILD=false
NUMPY_SKIP=false
BOOST_VERSION="1.70.0"
BOOST_VERSION_SHORT="1.70"
BOOST_VERSION_MIN="1.49"
BOOST_VERSION_MAX="2.0"
BOOST_FORCE_BUILD=false
BOOST_FORCE_REBUILD=false
BOOST_SKIP=false
TBB_VERSION="2019"
TBB_VERSION_SHORT="2019"
TBB_VERSION_UPDATE="_U9" # Used for source packages...
TBB_VERSION_MIN="2018"
TBB_VERSION_MAX="2021"
TBB_FORCE_BUILD=false
TBB_FORCE_REBUILD=false
TBB_SKIP=false
OCIO_VERSION="1.1.0"
OCIO_VERSION="1.1.1"
OCIO_VERSION_SHORT="1.1"
OCIO_VERSION_MIN="1.0"
OCIO_VERSION_MAX="1.2"
OCIO_FORCE_BUILD=false
OCIO_FORCE_REBUILD=false
OCIO_SKIP=false
OPENEXR_VERSION="2.4.0"
OPENEXR_VERSION_SHORT="2.4"
OPENEXR_VERSION_MIN="2.3"
OPENEXR_VERSION_MAX="3.0"
OPENEXR_FORCE_BUILD=false
OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
OIIO_VERSION="1.8.13"
OIIO_VERSION_MIN="1.8.13"
OIIO_VERSION_MAX="99.99.0" # UNKNOWN currently # Not supported by current OSL...
OIIO_VERSION="2.1.15.0"
OIIO_VERSION_SHORT="2.1"
OIIO_VERSION_MIN="1.8"
OIIO_VERSION_MAX="3.0"
OIIO_FORCE_BUILD=false
OIIO_FORCE_REBUILD=false
OIIO_SKIP=false
LLVM_VERSION="9.0.1"
LLVM_VERSION_SHORT="9.0"
LLVM_VERSION_MIN="6.0"
LLVM_VERSION_MAX="11.0"
LLVM_VERSION_FOUND=""
LLVM_FORCE_BUILD=false
LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
OSL_VERSION="1.10.9"
OSL_VERSION_MIN=$OSL_VERSION
OSL_VERSION="1.10.10"
OSL_VERSION_SHORT="1.10"
OSL_VERSION_MIN="1.10"
OSL_VERSION_MAX="2.0"
OSL_FORCE_BUILD=false
OSL_FORCE_REBUILD=false
OSL_SKIP=false
# OpenSubdiv needs to be compiled for now
OSD_VERSION="3.4.3"
OSD_VERSION_MIN=$OSD_VERSION
OSD_VERSION_SHORT="3.4"
OSD_VERSION_MIN="3.4"
OSD_VERSION_MAX="4.0"
OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false
OSD_SKIP=false
@@ -447,46 +472,69 @@ OSD_SKIP=false
OPENVDB_BLOSC_VERSION="1.5.0"
OPENVDB_VERSION="7.0.0"
OPENVDB_VERSION_MIN=$OPENVDB_VERSION
OPENVDB_VERSION_SHORT="7.0"
OPENVDB_VERSION_MIN="7.0"
OPENVDB_VERSION_MAX="8.0"
OPENVDB_FORCE_BUILD=false
OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false
# Alembic needs to be compiled for now
ALEMBIC_VERSION="1.7.12"
ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
ALEMBIC_VERSION_SHORT="1.7"
ALEMBIC_VERSION_MIN="1.7"
ALEMBIC_VERSION_MAX="2.0"
ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
USD_VERSION="20.05"
USD_VERSION_SHORT="20.05"
USD_VERSION_MIN="20.05"
USD_VERSION_MAX="20.06"
USD_FORCE_BUILD=false
USD_FORCE_REBUILD=false
USD_SKIP=false
OPENCOLLADA_VERSION="1.6.68"
OPENCOLLADA_VERSION_SHORT="1.6"
OPENCOLLADA_VERSION_MIN="1.6.68"
OPENCOLLADA_VERSION_MAX="1.7"
OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
EMBREE_VERSION="3.10.0"
EMBREE_VERSION_SHORT="3.10"
EMBREE_VERSION_MIN="3.10"
EMBREE_VERSION_MAX="4.0"
EMBREE_FORCE_BUILD=false
EMBREE_FORCE_REBUILD=false
EMBREE_SKIP=false
OIDN_VERSION="1.0.0"
OIDN_VERSION="1.2.1"
OIDN_VERSION_SHORT="1.2"
OIDN_VERSION_MIN="1.2.0"
OIDN_VERSION_MAX="1.3"
OIDN_FORCE_BUILD=false
OIDN_FORCE_REBUILD=false
OIDN_SKIP=false
ISPC_VERSION="1.14.0"
FFMPEG_VERSION="4.2.3"
FFMPEG_VERSION_MIN="2.8.4"
FFMPEG_VERSION_SHORT="4.2"
FFMPEG_VERSION_MIN="3.0"
FFMPEG_VERSION_MAX="5.0"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
XR_OPENXR_VERSION="1.0.8"
XR_OPENXR_VERSION_SHORT="1.0"
XR_OPENXR_VERSION_MIN="1.0.8"
XR_OPENXR_VERSION_MAX="2.0"
XR_OPENXR_FORCE_BUILD=false
XR_OPENXR_FORCE_REBUILD=false
XR_OPENXR_SKIP=false
@@ -634,36 +682,43 @@ while true; do
--ver-ocio)
OCIO_VERSION="$2"
OCIO_VERSION_MIN=$OCIO_VERSION
OCIO_VERSION_SHORT=$OCIO_VERSION
shift; shift; continue
;;
--ver-oiio)
OIIO_VERSION="$2"
OIIO_VERSION_MIN=$OIIO_VERSION
OIIO_VERSION_SHORT=$OIIO_VERSION
shift; shift; continue
;;
--ver-llvm)
LLVM_VERSION="$2"
LLVM_VERSION_MIN=$LLVM_VERSION
LLVM_VERSION_SHORT=$LLVM_VERSION
shift; shift; continue
;;
--ver-osl)
OSL_VERSION="$2"
OSL_VERSION_MIN=$OSL_VERSION
OSL_VERSION_SHORT=$OSL_VERSION
shift; shift; continue
;;
--ver-osd)
OSD_VERSION="$2"
OSD_VERSION_MIN=$OSD_VERSION
OSD_VERSION_SHORT=$OSD_VERSION
shift; shift; continue
;;
--ver-openvdb)
OPENVDB_VERSION="$2"
OPENVDB_VERSION_MIN=$OPENVDB_VERSION
OPENVDB_VERSION_SHORT=$OPENVDB_VERSION
shift; shift; continue
;;
--ver-xr-openxr)
XR_OPENXR_VERSION="$2"
XR_OPENXR_VERSION_MIN=$XR_OPENXR_VERSION
XR_OPENXR_VERSION_SHORT=$XR_OPENXR_VERSION
shift; shift; continue
;;
--build-all)
@@ -1005,6 +1060,8 @@ OIDN_SOURCE=( "https://github.com/OpenImageDenoise/oidn/releases/download/v${OID
#~ OIDN_REPO_UID="dabfd9c80101edae9d25a710160d12d6d963c591"
#~ OIDN_REPO_BRANCH="master"
ISPC_BINARY=( "https://github.com/ispc/ispc/releases/download/v${ISPC_VERSION}/ispc-v${ISPC_VERSION}-linux.tar.gz" )
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
XR_OPENXR_USE_REPO=false
@@ -1030,7 +1087,7 @@ Those libraries should be available as packages in all recent distributions (opt
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
* libsdl2, libglew, [libglewmx].\""
* libsdl2, libglew, [libgmp], [libglewmx], fontconfig.\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -1270,7 +1327,7 @@ _init_python() {
_src=$SRC/Python-$PYTHON_VERSION
_git=false
_inst=$INST/python-$PYTHON_VERSION
_inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
_inst_shortcut=$INST/python-$PYTHON_VERSION_SHORT
}
_update_deps_python() {
@@ -1345,7 +1402,7 @@ compile_Python() {
INFO "If you want to force rebuild of this lib, use the --force-python option."
fi
run_ldconfig "python-$PYTHON_VERSION_MIN"
run_ldconfig "python-$PYTHON_VERSION_SHORT"
}
# ----------------------------------------------------------------------------
@@ -1355,8 +1412,8 @@ _init_numpy() {
_src=$SRC/numpy-$NUMPY_VERSION
_git=false
_inst=$INST/numpy-$NUMPY_VERSION
_python=$INST/python-$PYTHON_VERSION
_site=lib/python$PYTHON_VERSION_MIN/site-packages
_python=$INST/python-$PYTHON_VERSION_SHORT
_site=lib/python$PYTHON_VERSION_SHORT/site-packages
_inst_shortcut=$_python/$_site/numpy
}
@@ -1435,7 +1492,7 @@ compile_Numpy() {
_init_boost() {
_src=$SRC/boost-$BOOST_VERSION
_git=false
_inst=$INST/boost-$BOOST_VERSION
_inst=$INST/boost-$BOOST_VERSION_SHORT
_inst_shortcut=$INST/boost
}
@@ -1528,7 +1585,7 @@ compile_Boost() {
_init_tbb() {
_src=$SRC/TBB-$TBB_VERSION
_git=false
_inst=$INST/tbb-$TBB_VERSION
_inst=$INST/tbb-$TBB_VERSION_SHORT
_inst_shortcut=$INST/tbb
}
@@ -1656,7 +1713,7 @@ _init_ocio() {
else
_git=false
fi
_inst=$INST/ocio-$OCIO_VERSION
_inst=$INST/ocio-$OCIO_VERSION_SHORT
_inst_shortcut=$INST/ocio
}
@@ -1781,7 +1838,7 @@ compile_OCIO() {
_init_openexr() {
_src=$SRC/OpenEXR-$OPENEXR_VERSION
_git=false
_inst=$INST/openexr-$OPENEXR_VERSION
_inst=$INST/openexr-$OPENEXR_VERSION_SHORT
_inst_shortcut=$INST/openexr
}
@@ -1911,7 +1968,7 @@ compile_OPENEXR() {
_init_oiio() {
_src=$SRC/OpenImageIO-$OIIO_VERSION
_git=true
_inst=$INST/oiio-$OIIO_VERSION
_inst=$INST/oiio-$OIIO_VERSION_SHORT
_inst_shortcut=$INST/oiio
}
@@ -2066,7 +2123,7 @@ _init_llvm() {
_src=$SRC/LLVM-$LLVM_VERSION
_src_clang=$SRC/CLANG-$LLVM_VERSION
_git=false
_inst=$INST/llvm-$LLVM_VERSION
_inst=$INST/llvm-$LLVM_VERSION_SHORT
_inst_shortcut=$INST/llvm
}
@@ -2178,7 +2235,7 @@ compile_LLVM() {
_init_osl() {
_src=$SRC/OpenShadingLanguage-$OSL_VERSION
_git=true
_inst=$INST/osl-$OSL_VERSION
_inst=$INST/osl-$OSL_VERSION_SHORT
_inst_shortcut=$INST/osl
}
@@ -2323,7 +2380,7 @@ compile_OSL() {
_init_osd() {
_src=$SRC/OpenSubdiv-$OSD_VERSION
_git=true
_inst=$INST/osd-$OSD_VERSION
_inst=$INST/osd-$OSD_VERSION_SHORT
_inst_shortcut=$INST/osd
}
@@ -2537,7 +2594,7 @@ compile_BLOSC() {
_init_openvdb() {
_src=$SRC/openvdb-$OPENVDB_VERSION
_git=false
_inst=$INST/openvdb-$OPENVDB_VERSION
_inst=$INST/openvdb-$OPENVDB_VERSION_SHORT
_inst_shortcut=$INST/openvdb
}
@@ -2655,7 +2712,7 @@ compile_OPENVDB() {
_init_alembic() {
_src=$SRC/alembic-$ALEMBIC_VERSION
_git=false
_inst=$INST/alembic-$ALEMBIC_VERSION
_inst=$INST/alembic-$ALEMBIC_VERSION_SHORT
_inst_shortcut=$INST/alembic
}
@@ -2760,7 +2817,7 @@ compile_ALEMBIC() {
_init_usd() {
_src=$SRC/USD-$USD_VERSION
_git=false
_inst=$INST/usd-$USD_VERSION
_inst=$INST/usd-$USD_VERSION_SHORT
_inst_shortcut=$INST/usd
}
@@ -2859,7 +2916,7 @@ compile_USD() {
_init_opencollada() {
_src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
_git=true
_inst=$INST/opencollada-$OPENCOLLADA_VERSION
_inst=$INST/opencollada-$OPENCOLLADA_VERSION_SHORT
_inst_shortcut=$INST/opencollada
}
@@ -2965,7 +3022,7 @@ compile_OpenCOLLADA() {
_init_embree() {
_src=$SRC/embree-$EMBREE_VERSION
_git=true
_inst=$INST/embree-$EMBREE_VERSION
_inst=$INST/embree-$EMBREE_VERSION_SHORT
_inst_shortcut=$INST/embree
}
@@ -3075,10 +3132,83 @@ compile_Embree() {
# ----------------------------------------------------------------------------
# Build OpenImageDenoise
_init_ispc() {
_src=$SRC/ispc-v$ISPC_VERSION
_inst=$INST/ispc-v$ISPC_VERSION
_inst_shortcut=$INST/ispc
}
_update_deps_ispc() {
OIDN_FORCE_REBUILD=true
if [ "$_is_building" = true ]; then
OIDN_FORCE_BUILD=true
fi
}
clean_ispc() {
_init_ispc
if [ -d $_inst ]; then
_update_deps_ispc
fi
_clean
}
install_ISPC() {
# To be changed each time we make edits that would modify the compiled results!
ispc_magic=0
_init_ispc
# Clean install if needed!
magic_compile_check ispc-$ISPC_VERSION $ispc_magic
if [ $? -eq 1 ]; then
clean_ispc
fi
if [ ! -d $_inst ]; then
INFO "Installing Implicit SPMD Program Compiler v$ISPC_VERSION"
_is_building=true
# Rebuild dependencies as well!
_update_deps_ispc
prepare_opt
if [ ! -d $_src ]; then
mkdir -p $SRC
download ISPC_BINARY[@] "$_src.tar.gz"
INFO "Unpacking ISPC-v$ISPC_VERSION"
tar -C $SRC --transform "s,(.*/?)ispc-v$ISPC_VERSION-linux[^/]*(.*),\1ispc-v$ISPC_VERSION\2,x" \
-xf $_src.tar.gz
fi
mkdir -p $_inst
cp -r $_src/bin $_inst/bin
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "ISPC-v$ISPC_VERSION failed to install, exiting"
exit 1
fi
magic_compile_set ispc-$ISPC_VERSION $ispc_magic
cd $CWD
INFO "Done compiling ISPC-v$ISPC_VERSION!"
_is_building=false
else
INFO "Own ISPC-v$ISPC_VERSION is up to date, nothing to do!"
fi
_ispc_path_bin=$_inst/bin
run_ldconfig "ispc"
}
_init_oidn() {
_src=$SRC/oidn-$OIDN_VERSION
_git=true
_inst=$INST/oidn-$OIDN_VERSION
_inst=$INST/oidn-$OIDN_VERSION_SHORT
_inst_shortcut=$INST/oidn
}
@@ -3100,6 +3230,9 @@ compile_OIDN() {
return
fi
# Latest OIDN requires ISPC compiler tool...
install_ISPC
# To be changed each time we make edits that would modify the compiled results!
oidn_magic=9
_init_oidn
@@ -3152,6 +3285,7 @@ compile_OIDN() {
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_d="$cmake_d -D ISPC_DIR_HINT=$_ispc_path_bin"
if [ -d $INST/tbb ]; then
make_d="$make_d TBB_ROOT=$INST/tbb"
@@ -3187,7 +3321,7 @@ compile_OIDN() {
_init_ffmpeg() {
_src=$SRC/ffmpeg-$FFMPEG_VERSION
_inst=$INST/ffmpeg-$FFMPEG_VERSION
_inst=$INST/ffmpeg-$FFMPEG_VERSION_SHORT
_inst_shortcut=$INST/ffmpeg
}
@@ -3316,7 +3450,7 @@ compile_FFmpeg() {
_init_xr_openxr_sdk() {
_src=$SRC/XR-OpenXR-SDK-$XR_OPENXR_VERSION
_git=true
_inst=$INST/xr-openxr-sdk-$XR_OPENXR_VERSION
_inst=$INST/xr-openxr-sdk-$XR_OPENXR_VERSION_SHORT
_inst_shortcut=$INST/xr-openxr-sdk
}
@@ -3520,11 +3654,12 @@ install_DEB() {
THEORA_DEV="libtheora-dev"
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
git libfreetype6-dev libx11-dev flex bison libxxf86vm-dev \
git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
libgmp-dev"
# libglewmx-dev (broken in deb testing currently...)
VORBIS_USE=true
@@ -3554,13 +3689,18 @@ install_DEB() {
PRINT ""
CLANG_FORMAT="clang-format"
check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION
if [ $? -eq 0 ]; then
_packages="$_packages $CLANG_FORMAT"
else
PRINT ""
WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
PRINT ""
check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
if [ $? -eq 0 ]; then
_packages="$_packages $CLANG_FORMAT"
else
PRINT ""
WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
PRINT ""
fi
fi
if [ "$WITH_JACK" = true ]; then
@@ -3675,7 +3815,7 @@ install_DEB() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
check_package_version_ge_DEB python3-dev $PYTHON_VERSION_MIN
check_package_version_ge_lt_DEB python3-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -3717,7 +3857,7 @@ install_DEB() {
INFO "Forced Boost building, as requested..."
compile_Boost
else
check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
check_package_version_ge_lt_DEB libboost-dev $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libboost-dev
@@ -3738,7 +3878,7 @@ install_DEB() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_DEB libtbb-dev $TBB_VERSION_MIN
check_package_version_ge_lt_DEB libtbb-dev $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libtbb-dev
clean_TBB
@@ -3755,14 +3895,13 @@ install_DEB() {
INFO "Forced OpenColorIO building, as requested..."
compile_OCIO
else
# XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)!
#check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
#if [ $? -eq 0 ]; then
#install_packages_DEB libopencolorio-dev
#clean_OCIO
#else
check_package_version_ge_lt_DEB libopencolorio-dev $OCIO_VERSION_MIN $OCIO_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopencolorio-dev
clean_OCIO
else
compile_OCIO
#fi
fi
fi
@@ -3773,7 +3912,7 @@ install_DEB() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
check_package_version_ge_DEB libopenexr-dev $OPENEXR_VERSION_MIN
check_package_version_ge_lt_DEB libopenexr-dev $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopenexr-dev
OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
@@ -3792,14 +3931,13 @@ install_DEB() {
INFO "Forced OpenImageIO building, as requested..."
compile_OIIO
else
# XXX Debian Testing / Ubuntu 16.04 pulls in WAY too many deps (gtk2/opencv ?!) incl. OCIO build against libyaml-cpp0.3 so build for now...
#check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
#if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
# install_packages_DEB libopenimageio-dev
# clean_OIIO
#else
check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
install_packages_DEB libopenimageio-dev
clean_OIIO
else
compile_OIIO
#fi
fi
fi
@@ -3813,11 +3951,12 @@ install_DEB() {
INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true
else
check_package_DEB clang-$LLVM_VERSION_MIN
check_package_version_ge_lt_DEB llvm-dev $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB llvm-$LLVM_VERSION_MIN-dev clang-$LLVM_VERSION_MIN
install_packages_DEB llvm-dev clang
have_llvm=true
LLVM_VERSION_FOUND=$LLVM_VERSION_MIN
LLVM_VERSION=`get_package_version_DEB llvm-dev`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
_do_compile_llvm=true
@@ -3843,8 +3982,13 @@ install_DEB() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
# No package currently!
_do_compile_osl=true
check_package_version_ge_lt_DEB libopenshadinglanguage-dev $OSL_VERSION_MIN $OSL_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopenshadinglanguage-dev
clean_OSL
else
_do_compile_osl=true
fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -3876,7 +4020,7 @@ install_DEB() {
INFO "Forced OpenVDB building, as requested..."
compile_OPENVDB
else
check_package_version_ge_DEB libopenvdb-dev $OPENVDB_VERSION_MIN
check_package_version_ge_lt_DEB libopenvdb-dev $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopenvdb-dev libblosc-dev
clean_OPENVDB
@@ -3937,8 +4081,14 @@ install_DEB() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
# No package currently!
_do_compile_embree=true
# There is a package, but it does not provide everything that Blender needs...
#~ check_package_version_ge_lt_DEB libembree-dev $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
#~ if [ $? -eq 0 ]; then
#~ install_packages_DEB libembree-dev
#~ clean_Embree
#~ else
_do_compile_embree=true
#~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -3974,7 +4124,7 @@ install_DEB() {
# XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
check_package_DEB ffmpeg
if [ $? -eq 0 ]; then
check_package_version_ge_DEB ffmpeg $FFMPEG_VERSION_MIN
check_package_version_ge_lt_DEB ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libavdevice-dev
clean_FFmpeg
@@ -4170,12 +4320,12 @@ install_RPM() {
OGG_DEV="libogg-devel"
THEORA_DEV="libtheora-devel"
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison fontconfig-devel \
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel"
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel gmp-devel"
OPENJPEG_USE=true
VORBIS_USE=true
@@ -4298,7 +4448,7 @@ install_RPM() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
check_package_version_ge_RPM python3-devel $PYTHON_VERSION_MIN
check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -4308,7 +4458,7 @@ install_RPM() {
if [ "$NUMPY_SKIP" = true ]; then
WARNING "Skipping NumPy installation, as requested..."
else
check_package_version_ge_RPM python3-numpy $NUMPY_VERSION_MIN
check_package_version_ge_lt_RPM python3-numpy $NUMPY_VERSION_MIN $NUMPY_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM python3-numpy
else
@@ -4341,7 +4491,7 @@ install_RPM() {
INFO "Forced Boost building, as requested..."
_do_compile_boost=true
else
check_package_version_ge_RPM boost-devel $BOOST_VERSION_MIN
check_package_version_ge_lt_RPM boost-devel $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM boost-devel
clean_Boost
@@ -4368,7 +4518,7 @@ install_RPM() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_RPM tbb-devel $TBB_VERSION_MIN
check_package_version_ge_lt_RPM tbb-devel $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM tbb-devel
clean_TBB
@@ -4386,7 +4536,7 @@ install_RPM() {
compile_OCIO
else
if [ "$RPM" = "SUSE" ]; then
check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN
check_package_version_ge_lt_RPM OpenColorIO-devel $OCIO_VERSION_MIN $OCIO_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM OpenColorIO-devel
clean_OCIO
@@ -4406,7 +4556,7 @@ install_RPM() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
check_package_version_ge_RPM openexr-devel $OPENEXR_VERSION_MIN
check_package_version_ge_lt_RPM openexr-devel $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM openexr-devel
OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
@@ -4424,7 +4574,6 @@ install_RPM() {
INFO "Forced OpenImageIO building, as requested..."
compile_OIIO
else
# XXX RPM distros pulls in too much and depends on old libs, so better to build for now...
#check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
#if [ $? -eq 0 -a $_with_built_openexr == false ]; then
# install_packages_RPM OpenImageIO-devel
@@ -4450,10 +4599,11 @@ install_RPM() {
else
CLANG_DEV="clang-devel"
fi
check_package_version_match_RPM $CLANG_DEV $LLVM_VERSION
check_package_version_ge_lt_RPM llvm-devel $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM llvm-devel $CLANG_DEV
have_llvm=true
LLVM_VERSION=`get_package_version_RPM llvm-devel`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
@@ -4480,8 +4630,18 @@ install_RPM() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
# No package currently!
_do_compile_osl=true
if [ "$RPM" = "SUSE" ]; then
OSL_DEV="OpenShadingLanguage-devel"
else
OSL_DEV="openshadinglanguage-devel"
fi
check_package_version_ge_lt_RPM $OSL_DEV $OSL_VERSION_MIN $OSL_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM $OSL_DEV
clean_OSL
else
_do_compile_osl=true
fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -4569,8 +4729,14 @@ install_RPM() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
# No package...
_do_compile_embree=true
# There is a package, but it does not provide everything that Blender needs...
#~ check_package_version_ge_lt_RPM embree-devel $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
#~ if [ $? -eq 0 ]; then
#~ install_packages_RPM embree-devel
#~ clean_Embree
#~ else
_do_compile_embree=true
#~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -4603,7 +4769,7 @@ install_RPM() {
INFO "Forced FFMpeg building, as requested..."
compile_FFmpeg
else
check_package_version_ge_RPM ffmpeg-devel $FFMPEG_VERSION_MIN
check_package_version_ge_lt_RPM ffmpeg-devel $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM ffmpeg ffmpeg-devel
clean_FFmpeg
@@ -4732,10 +4898,10 @@ install_ARCH() {
BASE_DEVEL=`pacman -Sgq base-devel | sed -e 's/^gcc$/gcc-multilib/g' | paste -s -d' '`
fi
_packages="$BASE_DEVEL git cmake \
_packages="$BASE_DEVEL git cmake fontconfig \
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
libxml2 yaml-cpp tinyxml python-requests jemalloc"
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp"
OPENJPEG_USE=true
VORBIS_USE=true
@@ -4823,7 +4989,7 @@ install_ARCH() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -4833,7 +4999,7 @@ install_ARCH() {
if [ "$NUMPY_SKIP" = true ]; then
WARNING "Skipping NumPy installation, as requested..."
else
check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN
check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN $NUMPY_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH python-numpy
else
@@ -4865,7 +5031,7 @@ install_ARCH() {
INFO "Forced Boost building, as requested..."
compile_Boost
else
check_package_version_ge_ARCH boost $BOOST_VERSION_MIN
check_package_version_ge_lt_ARCH boost $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH boost
clean_Boost
@@ -4882,7 +5048,7 @@ install_ARCH() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_ARCH intel-tbb $TBB_VERSION_MIN
check_package_version_ge_lt_ARCH intel-tbb $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH intel-tbb
clean_TBB
@@ -4899,7 +5065,7 @@ install_ARCH() {
INFO "Forced OpenColorIO building, as requested..."
compile_OCIO
else
check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
check_package_version_ge_lt_ARCH opencolorio $OCIO_VERSION_MIN $OCIO_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH opencolorio
clean_OCIO
@@ -4916,7 +5082,7 @@ install_ARCH() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
check_package_version_ge_ARCH openexr $OPENEXR_VERSION_MIN
check_package_version_ge_lt_ARCH openexr $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH openexr
OPENEXR_VERSION=`get_package_version_ARCH openexr`
@@ -4955,7 +5121,7 @@ install_ARCH() {
INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true
else
check_package_version_match_ARCH llvm $LLVM_VERSION_MIN
check_package_version_ge_lt_ARCH llvm $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH llvm clang
have_llvm=true
@@ -4986,14 +5152,13 @@ install_ARCH() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
# XXX Compile for now due to requirement of LLVM 3.4 ...
#check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
#if [ $? -eq 0 ]; then
# install_packages_ARCH openshadinglanguage
# clean_OSL
#else
check_package_version_ge_lt_ARCH openshadinglanguage $OSL_VERSION_MIN $OSL_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH openshadinglanguage
clean_OSL
else
_do_compile_osl=true
#fi
fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -5013,7 +5178,7 @@ install_ARCH() {
INFO "Forced OpenSubdiv building, as requested..."
compile_OSD
else
check_package_version_ge_ARCH opensubdiv $OSD_VERSION_MIN
check_package_version_ge_lt_ARCH opensubdiv $OSD_VERSION_MIN $OSD_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH opensubdiv
clean_OSD
@@ -5030,7 +5195,7 @@ install_ARCH() {
INFO "Forced OpenVDB building, as requested..."
compile_OPENVDB
else
check_package_version_ge_ARCH openvdb $OPENVDB_VERSION_MIN
check_package_version_ge_lt_ARCH openvdb $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH openvdb
clean_OPENVDB
@@ -5095,13 +5260,14 @@ install_ARCH() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
check_package_ARCH embree
if [ $? -eq 0 ]; then
install_packages_ARCH embree
clean_Embree
else
# There is a package, but it does not provide everything that Blender needs...
#~ check_package_version_ge_lt_ARCH embree $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
#~ if [ $? -eq 0 ]; then
#~ install_packages_ARCH embree
#~ clean_Embree
#~ else
_do_compile_embree=true
fi
#~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -5134,7 +5300,7 @@ install_ARCH() {
INFO "Forced FFMpeg building, as requested..."
compile_FFmpeg
else
check_package_version_ge_ARCH ffmpeg $FFMPEG_VERSION_MIN
check_package_version_ge_lt_ARCH ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH ffmpeg
clean_FFmpeg
@@ -5411,7 +5577,8 @@ print_info() {
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
_1="-D WITH_CODEC_SNDFILE=ON"
PRINT " $_1"

View File

@@ -91,3 +91,41 @@ diff -Naur external_blosc.orig/blosc/blosc.c external_blosc/blosc/blosc.c
/* Some useful units */
diff --git a/blosc/shuffle.c b/blosc/shuffle.c
index 84b5095..23053b4 100644
--- a/blosc/shuffle.c
+++ b/blosc/shuffle.c
@@ -490,12 +490,12 @@ void unshuffle(size_t bytesoftype, size_t blocksize,
#else /* no __SSE2__ available */
void shuffle(size_t bytesoftype, size_t blocksize,
- uint8_t* _src, uint8_t* _dest) {
+ const uint8_t* _src, uint8_t* _dest) {
_shuffle(bytesoftype, blocksize, _src, _dest);
}
void unshuffle(size_t bytesoftype, size_t blocksize,
- uint8_t* _src, uint8_t* _dest) {
+ const uint8_t* _src, uint8_t* _dest) {
_unshuffle(bytesoftype, blocksize, _src, _dest);
}
--- a/cmake/FindSSE.cmake
+++ b/cmake/FindSSE.cmake
@@ -49,6 +49,17 @@
set(AVX_FOUND false CACHE BOOL "AVX available on host")
ENDIF (AVX_TRUE)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Detected architecture ${ARCHITECTURE}")
+ IF("${ARCHITECTURE}" STREQUAL "arm64")
+ set(SSE2_FOUND false CACHE BOOL "SSE2 available on host")
+ set(SSE3_FOUND false CACHE BOOL "SSE3 available on host")
+ set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host")
+ set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host")
+ set(AVX_FOUND false CACHE BOOL "AVX available on host")
+ return()
+ ENDIF()
+
EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE
CPUINFO)

View File

@@ -0,0 +1,4 @@
using python : @PYTHON_SHORT_VERSION@ : @PYTHON_BINARY@
: @LIBDIR@/python/include @LIBDIR@/python/include/python@PYTHON_SHORT_VERSION@m/
: @LIBDIR@/python/libs
;

View File

@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.1)
project(libgmpxx)
include_directories(. cxx ${GMP_INCLUDE_DIR})
add_definitions(-D__GMP_WITHIN_GMPXX)
add_library(libgmpxx SHARED
cxx/dummy.cc
cxx/isfuns.cc
cxx/ismpf.cc
cxx/ismpq.cc
cxx/ismpz.cc
cxx/ismpznw.cc
cxx/limits.cc
cxx/osdoprnti.cc
cxx/osfuns.cc
cxx/osmpf.cc
cxx/osmpq.cc
cxx/osmpz.cc
)
target_link_libraries(libgmpxx ${GMP_LIBRARY})
install(TARGETS libgmpxx DESTINATION lib)

View File

@@ -0,0 +1,668 @@
/* config.h. Generated from config.in by configure. */
/* config.in. Generated from configure.ac by autoheader. */
/*
Copyright 1996-2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* 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.
or both in parallel, as here.
The GNU MP Library 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 copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/.
*/
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* The gmp-mparam.h file (a string) the tune program should suggest updating.
*/
#define GMP_MPARAM_H_SUGGEST "./mpn/x86_64/coreisbr/gmp-mparam.h"
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
/* Define to 1 if alloca() works (via gmp-impl.h). */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
//#define HAVE_ATTRIBUTE_CONST 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
//#define HAVE_ATTRIBUTE_MALLOC 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
*/
//#define HAVE_ATTRIBUTE_MODE 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
//#define HAVE_ATTRIBUTE_NORETURN 1
/* Define to 1 if you have the `attr_get' function. */
/* #undef HAVE_ATTR_GET */
/* Define to 1 if tests/libtests has calling conventions checking for the CPU
*/
/* #undef HAVE_CALLING_CONVENTIONS */
/* Define to 1 if you have the `clock' function. */
#define HAVE_CLOCK 1
/* Define to 1 if you have the `clock_gettime' function */
/* #undef HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the `cputime' function. */
/* #undef HAVE_CPUTIME */
/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
*/
#define HAVE_DECL_FGETC 1
/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
*/
#define HAVE_DECL_FSCANF 1
/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
*/
#define HAVE_DECL_OPTARG 1
/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
don't. */
#define HAVE_DECL_SYS_ERRLIST 0
/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
don't. */
#define HAVE_DECL_SYS_NERR 0
/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
*/
#define HAVE_DECL_UNGETC 1
/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
don't. */
#define HAVE_DECL_VFPRINTF 1
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */
/* Define one of the following to 1 for the format of a `double'.
If your format is not among these choices, or you don't know what it is,
then leave all undefined.
IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
swapped, as used by ARM CPUs in little endian mode. */
/* #undef HAVE_DOUBLE_IEEE_BIG_ENDIAN */
#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1
/* #undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED */
/* #undef HAVE_DOUBLE_VAX_D */
/* #undef HAVE_DOUBLE_VAX_G */
/* #undef HAVE_DOUBLE_CRAY_CFP */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */
/* Define to 1 if you have the `getsysinfo' function. */
/* #undef HAVE_GETSYSINFO */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
and __attribute__ ((alias)) */
#define HAVE_HIDDEN_ALIAS 1
/* Define one of these to 1 for the host CPU family.
If your CPU is not in any of these families, leave all undefined.
For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
/* #undef HAVE_HOST_CPU_FAMILY_alpha */
/* #undef HAVE_HOST_CPU_FAMILY_m68k */
/* #undef HAVE_HOST_CPU_FAMILY_power */
/* #undef HAVE_HOST_CPU_FAMILY_powerpc */
/* #undef HAVE_HOST_CPU_FAMILY_x86 */
#define HAVE_HOST_CPU_FAMILY_x86_64 1
/* Define one of the following to 1 for the host CPU, as per the output of
./config.guess. If your CPU is not listed here, leave all undefined. */
/* #undef HAVE_HOST_CPU_alphaev67 */
/* #undef HAVE_HOST_CPU_alphaev68 */
/* #undef HAVE_HOST_CPU_alphaev7 */
/* #undef HAVE_HOST_CPU_m68020 */
/* #undef HAVE_HOST_CPU_m68030 */
/* #undef HAVE_HOST_CPU_m68040 */
/* #undef HAVE_HOST_CPU_m68060 */
/* #undef HAVE_HOST_CPU_m68360 */
/* #undef HAVE_HOST_CPU_powerpc604 */
/* #undef HAVE_HOST_CPU_powerpc604e */
/* #undef HAVE_HOST_CPU_powerpc750 */
/* #undef HAVE_HOST_CPU_powerpc7400 */
/* #undef HAVE_HOST_CPU_supersparc */
/* #undef HAVE_HOST_CPU_i386 */
/* #undef HAVE_HOST_CPU_i586 */
/* #undef HAVE_HOST_CPU_i686 */
/* #undef HAVE_HOST_CPU_pentium */
/* #undef HAVE_HOST_CPU_pentiummmx */
/* #undef HAVE_HOST_CPU_pentiumpro */
/* #undef HAVE_HOST_CPU_pentium2 */
/* #undef HAVE_HOST_CPU_pentium3 */
/* #undef HAVE_HOST_CPU_pentium4 */
/* #undef HAVE_HOST_CPU_core2 */
/* #undef HAVE_HOST_CPU_nehalem */
/* #undef HAVE_HOST_CPU_westmere */
/* #undef HAVE_HOST_CPU_sandybridge */
#define HAVE_HOST_CPU_ivybridge 1
/* #undef HAVE_HOST_CPU_haswell */
/* #undef HAVE_HOST_CPU_broadwell */
/* #undef HAVE_HOST_CPU_skylake */
/* #undef HAVE_HOST_CPU_silvermont */
/* #undef HAVE_HOST_CPU_goldmont */
/* #undef HAVE_HOST_CPU_k8 */
/* #undef HAVE_HOST_CPU_k10 */
/* #undef HAVE_HOST_CPU_bulldozer */
/* #undef HAVE_HOST_CPU_piledriver */
/* #undef HAVE_HOST_CPU_steamroller */
/* #undef HAVE_HOST_CPU_excavator */
/* #undef HAVE_HOST_CPU_zen */
/* #undef HAVE_HOST_CPU_bobcat */
/* #undef HAVE_HOST_CPU_jaguar */
/* #undef HAVE_HOST_CPU_s390_z900 */
/* #undef HAVE_HOST_CPU_s390_z990 */
/* #undef HAVE_HOST_CPU_s390_z9 */
/* #undef HAVE_HOST_CPU_s390_z10 */
/* #undef HAVE_HOST_CPU_s390_z196 */
/* Define to 1 iff we have a s390 with 64-bit registers. */
/* #undef HAVE_HOST_CPU_s390_zarch */
/* Define to 1 if the system has the type `intmax_t'. */
#define HAVE_INTMAX_T 1
/* Define to 1 if the system has the type `intptr_t'. */
#define HAVE_INTPTR_T 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <invent.h> header file. */
/* #undef HAVE_INVENT_H */
/* Define to 1 if you have the <langinfo.h> header file. */
/* #undef HAVE_LANGINFO_H */
/* Define one of these to 1 for the endianness of `mp_limb_t'.
If the endianness is not a simple big or little, or you don't know what
it is, then leave both undefined. */
/* #undef HAVE_LIMB_BIG_ENDIAN */
#define HAVE_LIMB_LITTLE_ENDIAN 1
/* Define to 1 if you have the `localeconv' function. */
#define HAVE_LOCALECONV 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if the system has the type `long double'. */
#define HAVE_LONG_DOUBLE 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mmap' function. */
/* #undef HAVE_MMAP */
/* Define to 1 if you have the `mprotect' function. */
#define HAVE_MPROTECT 1
/* Define to 1 each of the following for which a native (ie. CPU specific)
implementation of the corresponding routine exists. */
#define HAVE_NATIVE_mpn_add_n 1
/* #undef HAVE_NATIVE_mpn_add_n_sub_n */
#define HAVE_NATIVE_mpn_add_nc 1
/* #undef HAVE_NATIVE_mpn_addaddmul_1msb0 */
#define HAVE_NATIVE_mpn_addlsh1_n 1
#define HAVE_NATIVE_mpn_addlsh2_n 1
#define HAVE_NATIVE_mpn_addlsh_n 1
#define HAVE_NATIVE_mpn_addlsh1_nc 1
#define HAVE_NATIVE_mpn_addlsh2_nc 1
#define HAVE_NATIVE_mpn_addlsh_nc 1
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_n_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip2 */
/* #undef HAVE_NATIVE_mpn_addmul_1c */
#define HAVE_NATIVE_mpn_addmul_2 1
/* #undef HAVE_NATIVE_mpn_addmul_3 */
/* #undef HAVE_NATIVE_mpn_addmul_4 */
/* #undef HAVE_NATIVE_mpn_addmul_5 */
/* #undef HAVE_NATIVE_mpn_addmul_6 */
/* #undef HAVE_NATIVE_mpn_addmul_7 */
/* #undef HAVE_NATIVE_mpn_addmul_8 */
/* #undef HAVE_NATIVE_mpn_addmul_2s */
#define HAVE_NATIVE_mpn_and_n 1
#define HAVE_NATIVE_mpn_andn_n 1
#define HAVE_NATIVE_mpn_bdiv_dbm1c 1
#define HAVE_NATIVE_mpn_bdiv_q_1 1
#define HAVE_NATIVE_mpn_pi1_bdiv_q_1 1
#define HAVE_NATIVE_mpn_cnd_add_n 1
#define HAVE_NATIVE_mpn_cnd_sub_n 1
#define HAVE_NATIVE_mpn_com 1
#define HAVE_NATIVE_mpn_copyd 1
#define HAVE_NATIVE_mpn_copyi 1
/* #undef HAVE_NATIVE_mpn_div_qr_1n_pi1 */
/* #undef HAVE_NATIVE_mpn_div_qr_2 */
#define HAVE_NATIVE_mpn_divexact_1 1
/* #undef HAVE_NATIVE_mpn_divexact_by3c */
#define HAVE_NATIVE_mpn_divrem_1 1
/* #undef HAVE_NATIVE_mpn_divrem_1c */
#define HAVE_NATIVE_mpn_divrem_2 1
/* #undef HAVE_NATIVE_mpn_gcd_1 */
#define HAVE_NATIVE_mpn_gcd_11 1
/* #undef HAVE_NATIVE_mpn_gcd_22 */
#define HAVE_NATIVE_mpn_hamdist 1
#define HAVE_NATIVE_mpn_invert_limb 1
#define HAVE_NATIVE_mpn_ior_n 1
#define HAVE_NATIVE_mpn_iorn_n 1
#define HAVE_NATIVE_mpn_lshift 1
#define HAVE_NATIVE_mpn_lshiftc 1
/* #undef HAVE_NATIVE_mpn_lshsub_n */
/* #undef HAVE_NATIVE_mpn_mod_1 */
#define HAVE_NATIVE_mpn_mod_1_1p 1
/* #undef HAVE_NATIVE_mpn_mod_1c */
#define HAVE_NATIVE_mpn_mod_1s_2p 1
#define HAVE_NATIVE_mpn_mod_1s_4p 1
#define HAVE_NATIVE_mpn_mod_34lsub1 1
#define HAVE_NATIVE_mpn_modexact_1_odd 1
#define HAVE_NATIVE_mpn_modexact_1c_odd 1
#define HAVE_NATIVE_mpn_mul_1 1
#define HAVE_NATIVE_mpn_mul_1c 1
#define HAVE_NATIVE_mpn_mul_2 1
/* #undef HAVE_NATIVE_mpn_mul_3 */
/* #undef HAVE_NATIVE_mpn_mul_4 */
/* #undef HAVE_NATIVE_mpn_mul_5 */
/* #undef HAVE_NATIVE_mpn_mul_6 */
#define HAVE_NATIVE_mpn_mul_basecase 1
#define HAVE_NATIVE_mpn_mullo_basecase 1
#define HAVE_NATIVE_mpn_nand_n 1
#define HAVE_NATIVE_mpn_nior_n 1
#define HAVE_NATIVE_mpn_popcount 1
#define HAVE_NATIVE_mpn_preinv_divrem_1 1
/* #undef HAVE_NATIVE_mpn_preinv_mod_1 */
#define HAVE_NATIVE_mpn_redc_1 1
/* #undef HAVE_NATIVE_mpn_redc_2 */
#define HAVE_NATIVE_mpn_rsblsh1_n 1
#define HAVE_NATIVE_mpn_rsblsh2_n 1
#define HAVE_NATIVE_mpn_rsblsh_n 1
#define HAVE_NATIVE_mpn_rsblsh1_nc 1
/* #undef HAVE_NATIVE_mpn_rsblsh2_nc */
/* #undef HAVE_NATIVE_mpn_rsblsh_nc */
#define HAVE_NATIVE_mpn_rsh1add_n 1
#define HAVE_NATIVE_mpn_rsh1add_nc 1
#define HAVE_NATIVE_mpn_rsh1sub_n 1
#define HAVE_NATIVE_mpn_rsh1sub_nc 1
#define HAVE_NATIVE_mpn_rshift 1
/* #undef HAVE_NATIVE_mpn_sbpi1_bdiv_r */
#define HAVE_NATIVE_mpn_sqr_basecase 1
/* #undef HAVE_NATIVE_mpn_sqr_diagonal */
#define HAVE_NATIVE_mpn_sqr_diag_addlsh1 1
#define HAVE_NATIVE_mpn_sub_n 1
#define HAVE_NATIVE_mpn_sub_nc 1
#define HAVE_NATIVE_mpn_sublsh1_n 1
#define HAVE_NATIVE_mpn_sublsh2_n 1
/* #undef HAVE_NATIVE_mpn_sublsh_n */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc */
/* #undef HAVE_NATIVE_mpn_sublsh_nc */
/* #undef HAVE_NATIVE_mpn_sublsh1_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_n_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh1_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh2_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_sublsh_nc_ip1 */
/* #undef HAVE_NATIVE_mpn_submul_1c */
/* #undef HAVE_NATIVE_mpn_tabselect */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd */
/* #undef HAVE_NATIVE_mpn_udiv_qrnnd_r */
/* #undef HAVE_NATIVE_mpn_umul_ppmm */
/* #undef HAVE_NATIVE_mpn_umul_ppmm_r */
#define HAVE_NATIVE_mpn_xor_n 1
#define HAVE_NATIVE_mpn_xnor_n 1
/* Define to 1 if you have the `nl_langinfo' function. */
/* #undef HAVE_NL_LANGINFO */
/* Define to 1 if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */
/* Define to 1 if you have the `obstack_vprintf' function. */
/* #undef HAVE_OBSTACK_VPRINTF */
/* Define to 1 if you have the `popen' function. */
#define HAVE_POPEN 1
/* Define to 1 if you have the `processor_info' function. */
/* #undef HAVE_PROCESSOR_INFO */
/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
`psp_iticksperclktick'. */
/* #undef HAVE_PSP_ITICKSPERCLKTICK */
/* Define to 1 if you have the `pstat_getprocessor' function. */
/* #undef HAVE_PSTAT_GETPROCESSOR */
/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1
/* Define to 1 if the system has the type `quad_t'. */
/* #undef HAVE_QUAD_T */
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
/* Define to 1 if you have the `read_real_time' function. */
/* #undef HAVE_READ_REAL_TIME */
/* Define to 1 if you have the `sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if you have the `sigaltstack' function. */
/* #undef HAVE_SIGALTSTACK */
/* Define to 1 if you have the `sigstack' function. */
/* #undef HAVE_SIGSTACK */
/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
#define HAVE_SPEED_CYCLECOUNTER 2
/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1
/* Define to 1 if the system has the type `stack_t'. */
/* #undef HAVE_STACK_T */
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if the system has the type `std::locale'. */
#define HAVE_STD__LOCALE 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */
/* Define to 1 if you have the `sysctl' function. */
/* #undef HAVE_SYSCTL */
/* Define to 1 if you have the `sysctlbyname' function. */
/* #undef HAVE_SYSCTLBYNAME */
/* Define to 1 if you have the `syssgi' function. */
/* #undef HAVE_SYSSGI */
/* Define to 1 if you have the <sys/attributes.h> header file. */
/* #undef HAVE_SYS_ATTRIBUTES_H */
/* Define to 1 if you have the <sys/iograph.h> header file. */
/* #undef HAVE_SYS_IOGRAPH_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* #undef HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/processor.h> header file. */
/* #undef HAVE_SYS_PROCESSOR_H */
/* Define to 1 if you have the <sys/pstat.h> header file. */
/* #undef HAVE_SYS_PSTAT_H */
/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
/* #undef HAVE_SYS_SYSCTL_H */
/* Define to 1 if you have the <sys/sysinfo.h> header file. */
/* #undef HAVE_SYS_SYSINFO_H */
/* Define to 1 if you have the <sys/syssgi.h> header file. */
/* #undef HAVE_SYS_SYSSGI_H */
/* Define to 1 if you have the <sys/systemcfg.h> header file. */
/* #undef HAVE_SYS_SYSTEMCFG_H */
/* Define to 1 if you have the <sys/times.h> header file. */
/* #undef HAVE_SYS_TIMES_H */
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `times' function. */
/* #undef HAVE_TIMES */
/* Define to 1 if the system has the type `uint_least32_t'. */
#define HAVE_UINT_LEAST32_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vsnprintf' function and it works properly. */
/* #undef HAVE_VSNPRINTF */
/* Define to 1 for Windos/64 */
#define HOST_DOS64 1
/* Assembler local label prefix */
#define LSYM_PREFIX "L"
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Define to 1 to disable the use of inline assembly */
/* #undef NO_ASM */
/* Name of package */
#define PACKAGE "gmp"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU MP"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU MP 6.2.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gmp"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
/* Define to the version of this package. */
#define PACKAGE_VERSION "6.2.0"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* The size of `mp_limb_t', as computed by sizeof. */
#define SIZEOF_MP_LIMB_T 8
/* The size of `unsigned', as computed by sizeof. */
#define SIZEOF_UNSIGNED 4
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 4
/* The size of `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* Define to 1 if sscanf requires writable inputs */
/* #undef SSCANF_WRITABLE_INPUT */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
/* #undef TUNE_SQR_TOOM2_MAX */
/* Version number of package */
#define VERSION "6.2.0"
/* Define to 1 to enable ASSERT checking, per --enable-assert */
/* #undef WANT_ASSERT */
/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
/* #undef WANT_FAKE_CPUID */
/* Define to 1 when building a fat binary. */
/* #undef WANT_FAT_BINARY */
/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
#define WANT_FFT 1
/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
--enable-old-fft-full */
/* #undef WANT_OLD_FFT_FULL */
/* Define to 1 if --enable-profiling=gprof */
/* #undef WANT_PROFILING_GPROF */
/* Define to 1 if --enable-profiling=instrument */
/* #undef WANT_PROFILING_INSTRUMENT */
/* Define to 1 if --enable-profiling=prof */
/* #undef WANT_PROFILING_PROF */
/* Define one of these to 1 for the desired temporary memory allocation
method, per --enable-alloca. */
#define WANT_TMP_ALLOCA 1
/* #undef WANT_TMP_REENTRANT */
/* #undef WANT_TMP_NOTREENTRANT */
/* #undef WANT_TMP_DEBUG */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if the assembler understands the mulx instruction */
/* #undef X86_ASM_MULX */
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
/* #undef YYTEXT_POINTER */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
#define restrict __restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
__restrict__, even though the corresponding Sun C compiler ends up with
"#define restrict _Restrict" or "#define restrict __restrict__" in the
previous line. Perhaps some future version of Sun C++ will work with
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

View File

@@ -9,3 +9,62 @@
enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
enabled libopus && {
enabled libopus_decoder && {
--- a/libavcodec/cfhddata.c
+++ b/libavcodec/cfhddata.c
@@ -276,10 +276,10 @@
av_cold int ff_cfhd_init_vlcs(CFHDContext *s)
{
int i, j, ret = 0;
- uint32_t new_cfhd_vlc_bits[NB_VLC_TABLE_18 * 2];
- uint8_t new_cfhd_vlc_len[NB_VLC_TABLE_18 * 2];
- uint16_t new_cfhd_vlc_run[NB_VLC_TABLE_18 * 2];
- int16_t new_cfhd_vlc_level[NB_VLC_TABLE_18 * 2];
+ uint32_t *new_cfhd_vlc_bits = av_calloc(sizeof(uint32_t), NB_VLC_TABLE_18 * 2);
+ uint8_t *new_cfhd_vlc_len = av_calloc(sizeof(uint8_t), NB_VLC_TABLE_18 * 2);
+ uint16_t *new_cfhd_vlc_run = av_calloc(sizeof(uint16_t), NB_VLC_TABLE_18 * 2);
+ int16_t *new_cfhd_vlc_level = av_calloc(sizeof(int16_t), NB_VLC_TABLE_18 * 2);
/** Similar to dv.c, generate signed VLC tables **/
@@ -305,8 +305,13 @@
ret = init_vlc(&s->vlc_9, VLC_BITS, j, new_cfhd_vlc_len,
1, 1, new_cfhd_vlc_bits, 4, 4, 0);
- if (ret < 0)
+ if (ret < 0) {
+ av_free(new_cfhd_vlc_bits);
+ av_free(new_cfhd_vlc_len);
+ av_free(new_cfhd_vlc_run);
+ av_free(new_cfhd_vlc_level);
return ret;
+ }
for (i = 0; i < s->vlc_9.table_size; i++) {
int code = s->vlc_9.table[i][0];
int len = s->vlc_9.table[i][1];
@@ -346,8 +351,14 @@
ret = init_vlc(&s->vlc_18, VLC_BITS, j, new_cfhd_vlc_len,
1, 1, new_cfhd_vlc_bits, 4, 4, 0);
- if (ret < 0)
+ if (ret < 0) {
+ av_free(new_cfhd_vlc_bits);
+ av_free(new_cfhd_vlc_len);
+ av_free(new_cfhd_vlc_run);
+ av_free(new_cfhd_vlc_level);
return ret;
+ }
+
av_assert0(s->vlc_18.table_size == 4572);
for (i = 0; i < s->vlc_18.table_size; i++) {
@@ -367,5 +378,10 @@
s->table_18_rl_vlc[i].run = run;
}
+ av_free(new_cfhd_vlc_bits);
+ av_free(new_cfhd_vlc_len);
+ av_free(new_cfhd_vlc_run);
+ av_free(new_cfhd_vlc_level);
+
return ret;
}

View File

@@ -1,11 +0,0 @@
--- UserMacros.cmake
+++ UserMacros.cmake
@@ -16,6 +16,8 @@
if (BUILD_USER_DEFINED_LIBS)
MACRO_USER_DEFINED_LIBS ()
endif (BUILD_USER_DEFINED_LIBS)
+
+include(Config/cmake/usermacros/windows_mt.cmake)
#-----------------------------------------------------------------------------
#------------------- E X A M P L E E N D -----------------------------------
#-----------------------------------------------------------------------------

View File

@@ -34,3 +34,52 @@ diff -Naur orig/cmake/GenerateBuiltins.cmake.txt external_ispc/cmake/GenerateBui
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")
set(target_arch "x86_64")
elseif ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "arm")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46a8db8..f53beef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,8 +36,12 @@
cmake_minimum_required(VERSION 3.13)
if (UNIX)
- set(CMAKE_C_COMPILER "clang")
- set(CMAKE_CXX_COMPILER "clang++")
+ if (NOT CMAKE_C_COMPILER)
+ set(CMAKE_C_COMPILER "clang")
+ endif()
+ if (NOT CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER "clang++")
+ endif()
endif()
set(PROJECT_NAME ispc)
@@ -412,6 +416,29 @@ else()
endif()
endif()
+# Link against libstdc++.a which must be provided to the linker after
+# LLVM and CLang libraries.
+# This is needed because some of LLVM/CLang dependencies are using
+# std::make_shared, which is defined in one of those:
+# - libclang-cpp.so
+# - libstdc++.a
+# Using the former one is tricky because then generated binary depends
+# on a library which is outside of the LD_LIBRARY_PATH.
+#
+# Hence, using C++ implementation from G++ which seems to work just fine.
+# In fact, from investigation seems that libclang-cpp.so itself is pulling
+# std::_Sp_make_shared_tag from G++'s libstdc++.a.
+if(UNIX AND NOT APPLE)
+ execute_process(
+ COMMAND g++ --print-file-name libstdc++.a
+ OUTPUT_VARIABLE GCC_LIBSTDCXX_A
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(GCC_LIBSTDCXX_A AND EXISTS ${GCC_LIBSTDCXX_A})
+ target_link_libraries(${PROJECT_NAME} ${GCC_LIBSTDCXX_A})
+ endif()
+endif()
+
# Build target for utility checking host ISA
if (ISPC_INCLUDE_UTILS)
add_executable(check_isa "")

View File

@@ -0,0 +1,129 @@
diff --git a/output/macho.h b/output/macho.h
index 538c531e..fd5e8849 100644
--- a/output/macho.h
+++ b/output/macho.h
@@ -60,6 +60,8 @@
#define LC_SEGMENT 0x1
#define LC_SEGMENT_64 0x19
#define LC_SYMTAB 0x2
+#define LC_VERSION_MIN_MACOSX 0x24
+#define LC_BUILD_VERSION 0x32
/* Symbol type bits */
#define N_STAB 0xe0
diff --git a/output/outmacho.c b/output/outmacho.c
index 08147883..de6ec902 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -38,6 +38,8 @@
#include "compiler.h"
+#include <stdlib.h>
+
#include "nctype.h"
#include "nasm.h"
@@ -64,6 +66,8 @@
#define MACHO_SYMCMD_SIZE 24
#define MACHO_NLIST_SIZE 12
#define MACHO_RELINFO_SIZE 8
+#define MACHO_BUILD_VERSION_SIZE 24
+#define MACHO_VERSION_MIN_MACOSX_SIZE 16
#define MACHO_HEADER64_SIZE 32
#define MACHO_SEGCMD64_SIZE 72
@@ -1224,6 +1228,46 @@ static void macho_layout_symbols (uint32_t *numsyms,
}
}
+static bool get_full_version_from_env (const char *variable_name,
+ int *r_major,
+ int *r_minor,
+ int *r_patch) {
+ *r_major = 0;
+ *r_minor = 0;
+ *r_patch = 0;
+
+ const char *value = getenv(variable_name);
+ if (value == NULL || value[0] == '\0') {
+ return false;
+ }
+
+ const char *current_value = value;
+ const char *end_value = value + strlen(value);
+
+ char *endptr;
+
+ *r_major = strtol(current_value, &endptr, 10);
+ if (endptr >= end_value) {
+ return true;
+ }
+ current_value = endptr + 1;
+
+ *r_minor = strtol(current_value, &endptr, 10);
+ if (endptr >= end_value) {
+ return true;
+ }
+ current_value = endptr + 1;
+
+ *r_patch = strtol(current_value, &endptr, 10);
+
+ return true;
+}
+
+static bool need_version_min_macosx_command (void) {
+ return getenv("MACOSX_DEPLOYMENT_TARGET") &&
+ getenv("MACOSX_SDK_VERSION");
+}
+
/* Calculate some values we'll need for writing later. */
static void macho_calculate_sizes (void)
@@ -1270,6 +1314,12 @@ static void macho_calculate_sizes (void)
head_sizeofcmds += fmt.segcmd_size + seg_nsects * fmt.sectcmd_size;
}
+ /* LC_VERSION_MIN_MACOSX */
+ if (need_version_min_macosx_command()) {
+ ++head_ncmds;
+ head_sizeofcmds += MACHO_VERSION_MIN_MACOSX_SIZE;
+ }
+
if (nsyms > 0) {
++head_ncmds;
head_sizeofcmds += MACHO_SYMCMD_SIZE;
@@ -1653,6 +1703,33 @@ static void macho_write (void)
else
nasm_warn(WARN_OTHER, "no sections?");
+#define ENCODE_BUILD_VERSION(major, minor, patch) \
+ (((major) << 16) | ((minor) << 8) | (patch))
+
+ if (0) {
+ fwriteint32_t(LC_BUILD_VERSION, ofile); /* cmd == LC_BUILD_VERSION */
+ fwriteint32_t(MACHO_BUILD_VERSION_SIZE, ofile); /* size of load command */
+ fwriteint32_t(1, ofile); /* platform */
+ fwriteint32_t(ENCODE_BUILD_VERSION(10, 13, 0), ofile); /* minos, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(ENCODE_BUILD_VERSION(10, 15, 4), ofile); /* sdk, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(0, ofile); /* number of tool entries following this */
+ }
+
+ if (need_version_min_macosx_command()) {
+ int sdk_major, sdk_minor, sdk_patch;
+ get_full_version_from_env("MACOSX_SDK_VERSION", &sdk_major, &sdk_minor, &sdk_patch);
+
+ int version_major, version_minor, version_patch;
+ get_full_version_from_env("MACOSX_DEPLOYMENT_TARGET", &version_major, &version_minor, &version_patch);
+
+ fwriteint32_t(LC_VERSION_MIN_MACOSX, ofile); /* cmd == LC_VERSION_MIN_MACOSX */
+ fwriteint32_t(MACHO_VERSION_MIN_MACOSX_SIZE, ofile); /* size of load command */
+ fwriteint32_t(ENCODE_BUILD_VERSION(version_major, version_minor, version_patch), ofile); /* minos, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ fwriteint32_t(ENCODE_BUILD_VERSION(sdk_major, sdk_minor, sdk_patch), ofile); /* sdk, X.Y.Z is encoded in nibbles xxxx.yy.zz */
+ }
+
+#undef ENCODE_BUILD_VERSION
+
if (nsyms > 0) {
/* write out symbol command */
fwriteint32_t(LC_SYMTAB, ofile); /* cmd == LC_SYMTAB */

View File

@@ -0,0 +1,27 @@
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index ba2b1f4..b10f7df 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -2164,8 +2164,8 @@ class accelerate_info(system_info):
'accelerate' in libraries):
if intel:
args.extend(['-msse3'])
- else:
- args.extend(['-faltivec'])
+# else:
+# args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
@@ -2174,8 +2174,8 @@ class accelerate_info(system_info):
'veclib' in libraries):
if intel:
args.extend(['-msse3'])
- else:
- args.extend(['-faltivec'])
+# else:
+# args.extend(['-faltivec'])
args.extend([
'-I/System/Library/Frameworks/vecLib.framework/Headers'])
link_args.extend(['-Wl,-framework', '-Wl,vecLib'])

View File

@@ -0,0 +1,12 @@
diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h
index eb8a322..6f73b72 100644
--- a/include/ogg/os_types.h
+++ b/include/ogg/os_types.h
@@ -71,6 +71,7 @@
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
+# include <stdint.h>
typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;

View File

@@ -86,3 +86,47 @@ index 1f9a3ee..d151e9a 100644
return isnan( value );
#else
return std::isnan(value);
diff --git a/DAEValidator/library/src/Dae.cpp b/DAEValidator/library/src/Dae.cpp
index 9256ee1..241ad67 100644
--- a/DAEValidator/library/src/Dae.cpp
+++ b/DAEValidator/library/src/Dae.cpp
@@ -304,7 +304,7 @@ namespace opencollada
if (auto root_node = root())
{
const auto & nodes = root_node.selectNodes("//*[@id]");
- for (const auto & node : nodes)
+ for (const auto node : nodes)
{
string id = node.attribute("id").value();
mIdCache.insert(id);
@@ -312,4 +312,4 @@ namespace opencollada
}
}
}
-}
\ No newline at end of file
+}
diff --git a/DAEValidator/library/src/DaeValidator.cpp b/DAEValidator/library/src/DaeValidator.cpp
index 715d903..24423ce 100644
--- a/DAEValidator/library/src/DaeValidator.cpp
+++ b/DAEValidator/library/src/DaeValidator.cpp
@@ -162,7 +162,7 @@ namespace opencollada
// Find xsi:schemaLocation attributes in dae and try to validate against specified xsd documents
const auto & elements = dae.root().selectNodes("//*[@xsi:schemaLocation]");
- for (const auto & element : elements)
+ for (const auto element : elements)
{
if (auto schemaLocation = element.attribute("schemaLocation"))
{
@@ -274,7 +274,7 @@ namespace opencollada
int result = 0;
map<string, size_t> ids;
const auto & nodes = dae.root().selectNodes("//*[@id]");
- for (const auto & node : nodes)
+ for (const auto node : nodes)
{
string id = node.attribute("id").value();
size_t line = node.line();

View File

@@ -0,0 +1,23 @@
diff --git a/runtime/src/z_Linux_asm.S b/runtime/src/z_Linux_asm.S
index 0d8885e..42aa5ad 100644
--- a/runtime/src/z_Linux_asm.S
+++ b/runtime/src/z_Linux_asm.S
@@ -1540,10 +1540,12 @@ __kmp_unnamed_critical_addr:
.comm .gomp_critical_user_,32,8
.data
.align 8
- .global __kmp_unnamed_critical_addr
-__kmp_unnamed_critical_addr:
+ .global ___kmp_unnamed_critical_addr
+___kmp_unnamed_critical_addr:
.8byte .gomp_critical_user_
- .size __kmp_unnamed_critical_addr,8
+# if !(KMP_OS_DARWIN)
+ .size ___kmp_unnamed_critical_addr,8
+# endif
#endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */
#if KMP_OS_LINUX

View File

@@ -1,6 +1,6 @@
diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
--- orig/cmake/FindIlmBase.cmake 2019-12-06 13:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-01-16 09:06:32 -0700
--- orig/cmake/FindIlmBase.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindIlmBase.cmake 2020-08-12 12:48:44 -0600
@@ -225,6 +225,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.lib"
@@ -15,8 +15,8 @@ diff -Naur orig/cmake/FindIlmBase.cmake openvdb/cmake/FindIlmBase.cmake
if(ILMBASE_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 13:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-01-16 09:06:39 -0700
--- orig/cmake/FindOpenEXR.cmake 2019-12-06 12:11:33 -0700
+++ openvdb/cmake/FindOpenEXR.cmake 2020-08-12 12:48:44 -0600
@@ -218,6 +218,12 @@
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
"-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.lib"
@@ -31,9 +31,20 @@ diff -Naur orig/cmake/FindOpenEXR.cmake openvdb/cmake/FindOpenEXR.cmake
if(OPENEXR_USE_STATIC_LIBS)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES
diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
--- orig/openvdb/CMakeLists.txt 2019-12-06 13:11:33 -0700
+++ openvdb/openvdb/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -193,11 +193,12 @@
--- orig/openvdb/CMakeLists.txt 2019-12-06 12:11:33 -0700
+++ openvdb/openvdb/CMakeLists.txt 2020-08-12 14:12:26 -0600
@@ -105,7 +105,9 @@
# http://boost.2283326.n4.nabble.com/CMake-config-scripts-broken-in-1-70-td4708957.html
# https://github.com/boostorg/boost_install/commit/160c7cb2b2c720e74463865ef0454d4c4cd9ae7c
set(BUILD_SHARED_LIBS ON)
- set(Boost_USE_STATIC_LIBS OFF)
+ if(NOT WIN32) # blender links boost statically on windows
+ set(Boost_USE_STATIC_LIBS OFF)
+ endif()
endif()
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS iostreams system)
@@ -193,6 +195,7 @@
if(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
@@ -41,33 +52,69 @@ diff -Naur orig/openvdb/CMakeLists.txt openvdb/openvdb/CMakeLists.txt
endif()
# @todo Should be target definitions
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
@@ -383,7 +386,12 @@
# imported targets.
if(OPENVDB_CORE_SHARED)
- add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ if(WIN32)
+ configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
+ else()
+ add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES})
+ endif()
endif()
##### Core library configuration
diff -Naur orig/openvdb/cmd/CMakeLists.txt openvdb/openvdb/cmd/CMakeLists.txt
--- orig/openvdb/cmd/CMakeLists.txt 2019-12-06 13:11:33 -0700
+++ openvdb/openvdb/cmd/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -53,7 +53,7 @@
endif()
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
endif()
# rpath handling
diff -Naur orig/openvdb/unittest/CMakeLists.txt openvdb/openvdb/unittest/CMakeLists.txt
--- orig/openvdb/unittest/CMakeLists.txt 2019-12-06 13:11:33 -0700
+++ openvdb/openvdb/unittest/CMakeLists.txt 2020-01-16 08:56:25 -0700
@@ -49,7 +49,7 @@
endif()
if(WIN32)
- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL)
+ add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_STATICLIB)
endif()
##### VDB unit tests
if(OPENVDB_CORE_STATIC)
diff -Naur orig/openvdb/version.rc.in openvdb/openvdb/version.rc.in
--- orig/openvdb/version.rc.in 1969-12-31 17:00:00 -0700
+++ openvdb/openvdb/version.rc.in 2020-08-12 14:15:01 -0600
@@ -0,0 +1,48 @@
+#include <winver.h>
+
+#define VER_FILEVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_FILEVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@.@OpenVDB_PATCH_VERSION@.0\0"
+
+#define VER_PRODUCTVERSION @OpenVDB_MAJOR_VERSION@,@OpenVDB_MINOR_VERSION@,@OpenVDB_PATCH_VERSION@,0
+#define VER_PRODUCTVERSION_STR "@OpenVDB_MAJOR_VERSION@.@OpenVDB_MINOR_VERSION@\0"
+
+#ifndef DEBUG
+#define VER_DEBUG 0
+#else
+#define VER_DEBUG VS_FF_DEBUG
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_PRODUCTVERSION
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS (VER_DEBUG)
+FILEOS VOS__WINDOWS32
+FILETYPE VFT_DLL
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileDescription", "OpenVDB"
+ VALUE "FileVersion", VER_FILEVERSION_STR
+ VALUE "InternalName", "OpenVDB"
+ VALUE "ProductName", "OpenVDB"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* The following line should only be modified for localized versions. */
+ /* It consists of any number of WORD,WORD pairs, with each pair */
+ /* describing a language,codepage combination supported by the file. */
+ /* */
+ /* For example, a file might have values "0x409,1252" indicating that it */
+ /* supports English language (0x409) in the Windows ANSI codepage (1252). */
+
+ VALUE "Translation", 0x409, 1252
+
+ END
+END

View File

@@ -0,0 +1,289 @@
diff -ru a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
--- a/Doc/library/ctypes.rst 2020-03-10 07:11:12.000000000 +0100
+++ b/Doc/library/ctypes.rst 2020-07-14 08:10:10.000000000 +0200
@@ -1551,6 +1551,13 @@
value usable as argument (integer, string, ctypes instance). This allows
defining adapters that can adapt custom objects as function parameters.
+ .. attribute:: variadic
+
+ Assign a boolean to specify that the function takes a variable number of
+ arguments. This does not matter on most platforms, but for Apple arm64
+ platforms variadic functions have a different calling convention than
+ normal functions.
+
.. attribute:: errcheck
Assign a Python function or another callable to this attribute. The
diff -ru a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
--- a/Modules/_ctypes/_ctypes.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/_ctypes.c 2020-07-14 08:14:41.000000000 +0200
@@ -3175,6 +3175,35 @@
}
static int
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict);
+ int r = PyObject_IsTrue(ob);
+ if (r == 1) {
+ dict->flags |= FUNCFLAG_VARIADIC;
+ return 0;
+ } else if (r == 0) {
+ dict->flags &= ~FUNCFLAG_VARIADIC;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+static PyObject *
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->flags & FUNCFLAG_VARIADIC)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+
+static int
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
{
PyObject *converters;
@@ -5632,6 +5661,7 @@
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
PyModule_AddStringConstant(m, "__version__", "1.1.0");
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
diff -ru a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
--- a/Modules/_ctypes/callproc.c 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/callproc.c 2020-07-14 08:18:33.000000000 +0200
@@ -767,7 +767,8 @@
ffi_type **atypes,
ffi_type *restype,
void *resmem,
- int argcount)
+ int argcount,
+ int argtypecount)
{
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
PyObject *error_object = NULL;
@@ -793,15 +794,38 @@
if ((flags & FUNCFLAG_CDECL) == 0)
cc = FFI_STDCALL;
#endif
- if (FFI_OK != ffi_prep_cif(&cif,
- cc,
- argcount,
- restype,
- atypes)) {
- PyErr_SetString(PyExc_RuntimeError,
- "ffi_prep_cif failed");
- return -1;
- }
+#if HAVE_FFI_PREP_CIF_VAR
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
+ * lots of existing code will not. If there's at least one arg and more
+ * args are passed than are defined in the prototype, then it must be a
+ * variadic function. */
+ if ((flags & FUNCFLAG_VARIADIC) ||
+ (argtypecount != 0 && argcount > argtypecount))
+ {
+ if (FFI_OK != ffi_prep_cif_var(&cif,
+ cc,
+ argtypecount,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif_var failed");
+ return -1;
+ }
+ } else {
+#endif
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+#if HAVE_FFI_PREP_CIF_VAR
+ }
+#endif
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
error_object = _ctypes_get_errobj(&space);
@@ -1185,9 +1209,8 @@
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
rtype, resbuf,
- Py_SAFE_DOWNCAST(argcount,
- Py_ssize_t,
- int)))
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
goto cleanup;
#ifdef WORDS_BIGENDIAN
diff -ru a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
--- a/Modules/_ctypes/ctypes.h 2020-03-10 07:11:12.000000000 +0100
+++ b/Modules/_ctypes/ctypes.h 2020-07-14 08:30:53.000000000 +0200
@@ -285,6 +285,7 @@
#define FUNCFLAG_PYTHONAPI 0x4
#define FUNCFLAG_USE_ERRNO 0x8
#define FUNCFLAG_USE_LASTERROR 0x10
+#define FUNCFLAG_VARIADIC 0x20
#define TYPEFLAG_ISPOINTER 0x100
#define TYPEFLAG_HASPOINTER 0x200
diff -ru a/configure b/configure
--- a/configure 2020-03-10 07:11:12.000000000 +0100
+++ b/configure 2020-07-14 08:03:27.000000000 +0200
@@ -3374,7 +3374,7 @@
# has no effect, don't bother defining them
Darwin/[6789].*)
define_xopen_source=no;;
- Darwin/1[0-9].*)
+ Darwin/[12][0-9].*)
define_xopen_source=no;;
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
@@ -9251,6 +9251,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
;;
diff -ru a/configure.ac b/configure.ac
--- a/configure.ac 2020-03-10 07:11:12.000000000 +0100
+++ b/configure.ac 2020-07-14 08:03:27.000000000 +0200
@@ -2456,6 +2456,9 @@
ppc)
MACOSX_DEFAULT_ARCH="ppc64"
;;
+ arm64)
+ MACOSX_DEFAULT_ARCH="arm64"
+ ;;
*)
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
;;
diff -ru a/setup.py b/setup.py
--- a/setup.py 2020-03-10 07:11:12.000000000 +0100
+++ b/setup.py 2020-07-14 08:28:12.000000000 +0200
@@ -141,6 +141,13 @@
os.unlink(tmpfile)
return MACOS_SDK_ROOT
+
+def is_macosx_at_least(vers):
+ if host_platform == 'darwin':
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ if dep_target:
+ return tuple(map(int, dep_target.split('.'))) >= vers
+ return False
def is_macosx_sdk_path(path):
"""
@@ -150,6 +157,13 @@
or path.startswith('/System/')
or path.startswith('/Library/') )
+def grep_headers_for(function, headers):
+ for header in headers:
+ with open(header, 'r') as f:
+ if function in f.read():
+ return True
+ return False
+
def find_file(filename, std_dirs, paths):
"""Searches for the directory where a given file is located,
and returns a possibly-empty list of additional directories, or None
@@ -1972,7 +1986,11 @@
return True
def detect_ctypes(self, inc_dirs, lib_dirs):
- self.use_system_libffi = False
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
+ self.use_system_libffi = True
+ else:
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
+
include_dirs = []
extra_compile_args = []
extra_link_args = []
@@ -2016,32 +2034,48 @@
ext_test = Extension('_ctypes_test',
sources=['_ctypes/_ctypes_test.c'],
libraries=['m'])
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
+ ffi_lib = None
+
self.extensions.extend([ext, ext_test])
if host_platform == 'darwin':
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
+ if not self.use_system_libffi:
return
- # OS X 10.5 comes with libffi.dylib; the include files are
- # in /usr/include/ffi
- inc_dirs.append('/usr/include/ffi')
-
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
- if not ffi_inc or ffi_inc[0] == '':
- ffi_inc = find_file('ffi.h', [], inc_dirs)
- if ffi_inc is not None:
- ffi_h = ffi_inc[0] + '/ffi.h'
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
+ if os.path.exists(ffi_in_sdk):
+ ffi_inc = ffi_in_sdk
+ ffi_lib = 'ffi'
+ else:
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+ ffi_inc_dirs.append('/usr/include/ffi')
+
+ if not ffi_inc:
+ found = find_file('ffi.h', [], ffi_inc_dirs)
+ if found:
+ ffi_inc = found[0]
+ if ffi_inc:
+ ffi_h = ffi_inc + '/ffi.h'
if not os.path.exists(ffi_h):
ffi_inc = None
print('Header file {} does not exist'.format(ffi_h))
- ffi_lib = None
- if ffi_inc is not None:
+ if ffi_lib is None and ffi_inc:
for lib_name in ('ffi', 'ffi_pic'):
if (self.compiler.find_library_file(lib_dirs, lib_name)):
ffi_lib = lib_name
break
if ffi_inc and ffi_lib:
- ext.include_dirs.extend(ffi_inc)
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
+ try:
+ sources.remove('_ctypes/malloc_closure.c')
+ except ValueError:
+ pass
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
+ ext.include_dirs.append(ffi_inc)
ext.libraries.append(ffi_lib)
self.use_system_libffi = True

View File

@@ -0,0 +1,14 @@
Only in external_sqlite_orig: config.log
diff -ru external_sqlite_orig/config.sub external_sqlite/config.sub
--- external_sqlite_orig/config.sub 2020-07-10 14:06:42.000000000 +0200
+++ external_sqlite/config.sub 2020-07-10 14:10:24.000000000 +0200
@@ -314,6 +314,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
Only in external_sqlite: mksourceid
Only in external_sqlite: sqlite3session.h

View File

@@ -0,0 +1,18 @@
--- config.sub
+++ config.sub
@@ -226,6 +226,7 @@
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
@@ -286,6 +287,7 @@
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \

View File

@@ -10,77 +10,6 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
add_definitions(${TBB_DEFINITIONS})
# --math
diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plug/initConfig.cpp
--- usd.orig/pxr/base/plug/initConfig.cpp.orig 2020-06-12 17:20:07.478199779 +0200
+++ external_usd/pxr/base/plug/initConfig.cpp 2020-06-12 17:25:28.648588552 +0200
@@ -69,10 +69,40 @@
ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void)
{
+ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */
+}
+
+}; // end of anonymous namespace
+
+/**
+ * The contents of this function used to be in the static constructor Plug_InitConfig.
+ * This static constructor made it impossible for Blender to pass a path to the USD
+ * library at runtime, as the constructor would run before Blender's main() function.
+ *
+ * This function is wrapped in a C function of the same name (defined below),
+ * so that it can be called from Blender's main() function.
+ *
+ * The datafiles_usd_path path is used to point to the USD plugin path when Blender
+ * has been installed. The fallback_usd_path path should point to the build-time
+ * location of the USD plugin files so that Blender can be run on a development machine
+ * without requiring an installation step.
+ */
+void
+usd_initialise_plugin_path(const char *datafiles_usd_path)
+{
std::vector<std::string> result;
std::vector<std::string> debugMessages;
+ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory.
+ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') {
+ std::string datafiles_usd_path_str(datafiles_usd_path);
+ if (datafiles_usd_path_str.back() != '/') {
+ datafiles_usd_path_str += "/";
+ }
+ result.push_back(datafiles_usd_path_str);
+ }
+
// Determine the absolute path to the Plug shared library. Any relative
// paths specified in the plugin search path will be anchored to this
// directory, to allow for relocatability. Note that this can fail when pxr
@@ -114,9 +144,24 @@
_AppendPathList(&result, installLocation, binaryPath);
#endif // PXR_INSTALL_LOCATION
- Plug_SetPaths(result, debugMessages);
-}
+ if (!TfGetenv("PXR_PATH_DEBUG").empty()) {
+ printf("USD Plugin paths: (%zu in total):\n", result.size());
+ for(const std::string &path : result) {
+ printf(" %s\n", path.c_str());
+ }
+ }
+ Plug_SetPaths(result, debugMessages);
}
PXR_NAMESPACE_CLOSE_SCOPE
+
+/* Workaround to make it possible to pass a path at runtime to USD. */
+extern "C" {
+void
+usd_initialise_plugin_path(
+ const char *datafiles_usd_path)
+{
+ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path);
+}
+}
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700
@@ -97,3 +26,36 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h
index f3cabf4..ebc8a69 100644
--- a/pxr/base/arch/align.h
+++ b/pxr/base/arch/align.h
@@ -77,7 +77,11 @@ ArchAlignMemory(void *base)
/// The size of a CPU cache line on the current processor architecture in bytes.
///
/// \hideinitializer
+#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
+#define ARCH_CACHE_LINE_SIZE 128
+#else
#define ARCH_CACHE_LINE_SIZE 64
+#endif
///@}
diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h
index 3e66c37..64a052c 100644
--- a/pxr/base/arch/math.h
+++ b/pxr/base/arch/math.h
@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE
/// \addtogroup group_arch_Math
///@{
-#if defined (ARCH_CPU_INTEL) || defined(doxygen)
+#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen)
/// This is the smallest value e such that 1+e^2 == 1, using floats.
/// True for all IEEE754 chipsets.

View File

@@ -33,10 +33,11 @@ def is_tool(name):
return which(name) is not None
class Builder:
def __init__(self, name, branch):
def __init__(self, name, branch, codesign):
self.name = name
self.branch = branch
self.is_release_branch = re.match("^blender-v(.*)-release$", branch) is not None
self.codesign = codesign
# Buildbot runs from build/ directory
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
@@ -67,8 +68,9 @@ def create_builder_from_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('builder_name')
parser.add_argument('branch', default='master', nargs='?')
parser.add_argument("--codesign", action="store_true")
args = parser.parse_args()
return Builder(args.builder_name, args.branch)
return Builder(args.builder_name, args.branch, args.codesign)
class VersionInfo:

View File

@@ -82,6 +82,10 @@ def create_argument_parser():
type=Path,
help="Optional path to applescript to set up folder looks of DMG."
"If not provided default Blender's one is used.")
parser.add_argument(
'--codesign',
action="store_true",
help="Code sign and notarize DMG contents.")
return parser
@@ -395,7 +399,8 @@ def create_final_dmg(app_bundles: List[Path],
dmg_filepath: Path,
background_image_filepath: Path,
volume_name: str,
applescript: Path) -> None:
applescript: Path,
codesign: bool) -> None:
"""
Create DMG with all app bundles
@@ -421,7 +426,8 @@ def create_final_dmg(app_bundles: List[Path],
#
# This allows to recurs into the content of bundles without worrying about
# possible interfereice of Application symlink.
codesign_app_bundles_in_dmg(mount_directory)
if codesign:
codesign_app_bundles_in_dmg(mount_directory)
copy_background_if_needed(background_image_filepath, mount_directory)
create_applications_link(mount_directory)
@@ -434,7 +440,8 @@ def create_final_dmg(app_bundles: List[Path],
compress_dmg(writable_dmg_filepath, dmg_filepath)
writable_dmg_filepath.unlink()
codesign_and_notarize_dmg(dmg_filepath)
if codesign:
codesign_and_notarize_dmg(dmg_filepath)
def ensure_dmg_extension(filepath: Path) -> Path:
@@ -521,6 +528,7 @@ def main():
source_dir = args.source_dir.absolute()
background_image_filepath = get_background_image(args.background_image)
applescript = get_applescript(args.applescript)
codesign = args.codesign
app_bundles = collect_and_log_app_bundles(source_dir)
if not app_bundles:
@@ -535,7 +543,8 @@ def main():
dmg_filepath,
background_image_filepath,
volume_name,
applescript)
applescript,
codesign)
if __name__ == "__main__":

View File

@@ -24,7 +24,7 @@ import shutil
import buildbot_utils
def get_cmake_options(builder):
post_install_script = os.path.join(
codesign_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
config_file = "build_files/cmake/config/blender_release.cmake"
@@ -36,7 +36,8 @@ def get_cmake_options(builder):
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.platform == 'win':
options.extend(['-G', 'Visual Studio 16 2019', '-A', 'x64'])
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
if builder.codesign:
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + codesign_script])
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"

View File

@@ -117,6 +117,8 @@ def pack_mac(builder):
if info.is_development_build:
background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
command += ['--background-image', background_image]
if builder.codesign:
command += ['--codesign']
command += [builder.install_dir]
buildbot_utils.call(command)
@@ -150,7 +152,8 @@ def pack_win(builder):
package_filename = package_name + '.msi'
package_filepath = os.path.join(builder.build_dir, package_filename)
sign_file_or_directory(package_filepath)
if builder.codesign:
sign_file_or_directory(package_filepath)
package_files += [(package_filepath, package_filename)]

View File

@@ -12,12 +12,8 @@
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If ALEMBIC_ROOT_DIR was defined in the environment, use it.
@@ -51,7 +47,7 @@ FIND_LIBRARY(ALEMBIC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALEMBIC DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})

View File

@@ -11,6 +11,13 @@
# AUDASPACE_PY_INCLUDE_DIRS - the audaspace's python binding include directories
# AUDASPACE_PY_LIBRARIES - link these to use audaspace's python binding
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
IF(NOT AUDASPACE_ROOT_DIR AND NOT $ENV{AUDASPACE_ROOT_DIR} STREQUAL "")
SET(AUDASPACE_ROOT_DIR $ENV{AUDASPACE_ROOT_DIR})
ENDIF()

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2018 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If BLOSC_ROOT_DIR was defined in the environment, use it.
@@ -53,7 +49,7 @@ FIND_LIBRARY(BLOSC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Blosc DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)

View File

@@ -0,0 +1,100 @@
# - Find clang-tidy executable
#
# Find the native clang-tidy executable
#
# This module defines
# CLANG_TIDY_EXECUTABLE, the ful lpath to clang-tidy executable
#
# CLANG_TIDY_VERSION, the full version of the clang-tidy in the
# major,minor.patch format
#
# CLANG_TIDY_VERSION_MAJOR,
# CLANG_TIDY_VERSION_MINOR,
# CLANG_TIDY_VERSION_PATCH, individual components of the clang-tidy version.
#
# CLANG_TIDY_FOUND, If false, do not try to use Eigen3.
#=============================================================================
# Copyright 2020 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If CLANG_TIDY_ROOT_DIR was defined in the environment, use it.
if(NOT CLANG_TIDY_ROOT_DIR AND NOT $ENV{CLANG_TIDY_ROOT_DIR} STREQUAL "")
set(CLANG_TIDY_ROOT_DIR $ENV{CLANG_TIDY_ROOT_DIR})
endif()
set(_clang_tidy_SEARCH_DIRS
${CLANG_TIDY_ROOT_DIR}
/usr/local/bin
)
# TODO(sergey): Find more reliable way of finding the latest clang-tidy.
find_program(CLANG_TIDY_EXECUTABLE
NAMES
clang-tidy-10
clang-tidy-9
clang-tidy-8
clang-tidy-7
clang-tidy
HINTS
${_clang_tidy_SEARCH_DIRS}
)
if(CLANG_TIDY_EXECUTABLE)
# Mark clang-tidy as found.
set(CLANG_TIDY_FOUND TRUE)
# Setup fallback values.
set(CLANG_TIDY_VERSION_MAJOR 0)
set(CLANG_TIDY_VERSION_MINOR 0)
set(CLANG_TIDY_VERSION_PATCH 0)
# Get version from the output.
#
# NOTE: Don't use name of the executable file since that only includes a
# major version. Also, even the major version might be missing in the
# executable name.
execute_process(COMMAND ${CLANG_TIDY_EXECUTABLE} -version
OUTPUT_VARIABLE CLANG_TIDY_VERSION_RAW
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Parse parts.
if(CLANG_TIDY_VERSION_RAW MATCHES "LLVM version .*")
# Strip the LLVM prefix and get list of individual version components.
string(REGEX REPLACE
".*LLVM version ([.0-9]+).*" "\\1"
CLANG_SEMANTIC_VERSION "${CLANG_TIDY_VERSION_RAW}")
string(REPLACE "." ";" CLANG_VERSION_PARTS "${CLANG_SEMANTIC_VERSION}")
list(LENGTH CLANG_VERSION_PARTS NUM_CLANG_TIDY_VERSION_PARTS)
# Extract components into corresponding variables.
if(NUM_CLANG_TIDY_VERSION_PARTS GREATER 0)
list(GET CLANG_VERSION_PARTS 0 CLANG_TIDY_VERSION_MAJOR)
endif()
if(NUM_CLANG_TIDY_VERSION_PARTS GREATER 1)
list(GET CLANG_VERSION_PARTS 1 CLANG_TIDY_VERSION_MINOR)
endif()
if(NUM_CLANG_TIDY_VERSION_PARTS GREATER 2)
list(GET CLANG_VERSION_PARTS 2 CLANG_TIDY_VERSION_PATCH)
endif()
# Unset temp variables.
unset(NUM_CLANG_TIDY_VERSION_PARTS)
unset(CLANG_SEMANTIC_VERSION)
unset(CLANG_VERSION_PARTS)
endif()
# Construct full semantic version.
set(CLANG_TIDY_VERSION "${CLANG_TIDY_VERSION_MAJOR}.\
${CLANG_TIDY_VERSION_MINOR}.\
${CLANG_TIDY_VERSION_PATCH}")
unset(CLANG_TIDY_VERSION_RAW)
message(STATUS "Found clang-tidy ${CLANG_TIDY_EXECUTABLE} (${CLANG_TIDY_VERSION})")
else()
set(CLANG_TIDY_FOUND FALSE)
endif()

View File

@@ -10,12 +10,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If EIGEN3_ROOT_DIR was defined in the environment, use it.

View File

@@ -7,19 +7,12 @@
# EMBREE_ROOT_DIR, The base directory to search for Embree.
# This can also be an environment variable.
# EMBREEFOUND, If false, do not try to use Embree.
#
# also defined, but not for general use are
# EMBREE_LIBRARY, where to find the Embree library.
#=============================================================================
# Copyright 2018 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If EMBREE_ROOT_DIR was defined in the environment, use it.
@@ -66,23 +59,22 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
PATH_SUFFIXES
lib64 lib
)
IF (NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
IF (EMBREE_EMBREE3_LIBRARY)
# If we can't find all the static libraries, try to fall back to the shared library if found.
# This allows building with a shared embree library
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
BREAK()
ENDIF ()
ENDIF ()
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FIND_LIBRARY(EMBREE_LIBRARY
NAMES
libembree3
HINTS
${_embree_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EMBREE DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Embree DEFAULT_MSG
_embree_LIBRARIES EMBREE_INCLUDE_DIR)
IF(EMBREE_FOUND)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If FFTW3_ROOT_DIR was defined in the environment, use it.

View File

@@ -13,12 +13,8 @@
#=============================================================================
# Copyright 2014 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If GLEW_ROOT_DIR was defined in the environment, use it.
@@ -51,7 +47,7 @@ FIND_LIBRARY(GLEW_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
GLEW_LIBRARY GLEW_INCLUDE_DIR)
IF(GLEW_FOUND)

View File

@@ -0,0 +1,92 @@
# - Find GMP library
# Find the native GMP includes and library
# This module defines
# GMP_INCLUDE_DIRS, where to find gmp.h, Set when
# GMP_INCLUDE_DIR is found.
# GMP_LIBRARIES, libraries to link against to use GMP.
# GMP_ROOT_DIR, The base directory to search for GMP.
# This can also be an environment variable.
# GMP_FOUND, If false, do not try to use GMP.
#
# also defined, but not for general use are
# GMP_LIBRARY, where to find the GMP library.
#=============================================================================
# Copyright 2011 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If GMP_ROOT_DIR was defined in the environment, use it.
IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "")
SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR})
ENDIF()
SET(_gmp_SEARCH_DIRS
${GMP_ROOT_DIR}
/opt/lib/gmp
)
FIND_PATH(GMP_INCLUDE_DIR
NAMES
gmp.h
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
include/gmp
)
FIND_PATH(GMPXX_INCLUDE_DIR
NAMES
gmpxx.h
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
include/gmp
)
FIND_LIBRARY(GMP_LIBRARY
NAMES
gmp
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(GMPXX_LIBRARY
NAMES
gmpxx
HINTS
${_gmp_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
if(GMP_INCLUDE_DIR)
SET(_version_regex "^#define[ \t]+__GNU_MP_VERSION[ \t]+\"([^\"]+)\".*")
file(STRINGS "${GMP_INCLUDE_DIR}/gmp.h"
GMP_VERSION REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1"
GMP_VERSION "${GMP_VERSION}")
unset(_version_regex)
endif()
# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
GMP_LIBRARY GMPXX_LIBRARY GMP_INCLUDE_DIR GMPXX_INCLUDE_DIR)
IF(GMP_FOUND)
SET(GMP_LIBRARIES ${GMPXX_LIBRARY} ${GMP_LIBRARY})
SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
ENDIF(GMP_FOUND)
MARK_AS_ADVANCED(
GMP_INCLUDE_DIR
GMP_LIBRARY
GMPXX_INCLUDE_DIR
GMPXX_LIBRARY
)

View File

@@ -12,12 +12,8 @@
#=============================================================================
# Copyright 2012 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If ICU_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If JACK_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If JEMALLOC_ROOT_DIR was defined in the environment, use it.

View File

@@ -13,12 +13,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
if(LLVM_ROOT_DIR)

View File

@@ -14,12 +14,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If LZO_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2014 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OSL_ROOT_DIR was defined in the environment, use it.

View File

@@ -7,19 +7,12 @@
# OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
# This can also be an environment variable.
# OPENCOLLADA_FOUND, If false, do not try to use OpenCOLLADA.
#
# also defined, but not for general use are
# OPENCOLLADA_LIBRARY, where to find the OpenCOLLADA library.
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# note about include paths, there are 2 ways includes are set

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2012 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENCOLORIO_ROOT_DIR was defined in the environment, use it.

View File

@@ -21,12 +21,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENEXR_ROOT_DIR was defined in the environment, use it.

View File

@@ -10,6 +10,13 @@
# OPENGLES_LIBRARIES - all libraries needed for OpenGLES
# OPENGLES_INCLUDES - all includes needed for OpenGLES
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENGLES_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENGLES_ROOT_DIR AND NOT $ENV{OPENGLES_ROOT_DIR} STREQUAL "")
SET(OPENGLES_ROOT_DIR $ENV{OPENGLES_ROOT_DIR})

View File

@@ -14,12 +14,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENIMAGEDENOISE_ROOT_DIR was defined in the environment, use it.

View File

@@ -16,12 +16,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENIMAGEIO_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENJPEG_ROOT_DIR was defined in the environment, use it.

View File

@@ -7,19 +7,12 @@
# OPENSUBDIV_ROOT_DIR, the base directory to search for OpenSubdiv.
# This can also be an environment variable.
# OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv.
#
# also defined, but not for general use are
# OPENSUBDIV_LIBRARY, where to find the OpenSubdiv library.
#=============================================================================
# Copyright 2013 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENSUBDIV_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPENVDB_ROOT_DIR was defined in the environment, use it.
@@ -53,7 +49,7 @@ FIND_LIBRARY(OPENVDB_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENVDB DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB DEFAULT_MSG
OPENVDB_LIBRARY OPENVDB_INCLUDE_DIR)
IF(OPENVDB_FOUND)

View File

@@ -10,12 +10,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If OPTIX_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PCRE_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2014 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PUGIXML_ROOT_DIR was defined in the environment, use it.

View File

@@ -25,12 +25,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If PYTHON_ROOT_DIR was defined in the environment, use it.

View File

@@ -13,12 +13,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If SDL2_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If SPACENAV_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If TBB_ROOT_DIR was defined in the environment, use it.

View File

@@ -12,12 +12,8 @@
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If USD_ROOT_DIR was defined in the environment, use it.

View File

@@ -14,12 +14,8 @@
#=============================================================================
# Copyright 2011 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If XML2_ROOT_DIR was defined in the environment, use it.

View File

@@ -20,12 +20,8 @@
# XR_OPENXR_SDK_LOADER_LIBRARY, where to find the OpenXR-SDK loader library.
#=============================================================================
# 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#=============================================================================
# If XR_OPENXR_SDK_ROOT_DIR was defined in the environment, use it.
@@ -59,7 +55,7 @@ FIND_LIBRARY(XR_OPENXR_SDK_LOADER_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set XR_OPENXR_SDK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OPENXR_SDK DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OpenXR_SDK DEFAULT_MSG
XR_OPENXR_SDK_LOADER_LIBRARY XR_OPENXR_SDK_INCLUDE_DIR)
IF(XR_OPENXR_SDK_FOUND)

View File

@@ -0,0 +1,550 @@
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#[=======================================================================[.rst:
GoogleTest
----------
.. versionadded:: 3.9
This module defines functions to help use the Google Test infrastructure. Two
mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
around for some time, originally via ``find_package(GTest)``.
:command:`gtest_discover_tests` was introduced in CMake 3.10.
The (older) :command:`gtest_add_tests` scans source files to identify tests.
This is usually effective, with some caveats, including in cross-compiling
environments, and makes setting additional properties on tests more convenient.
However, its handling of parameterized tests is less comprehensive, and it
requires re-running CMake to detect changes to the list of tests.
The (newer) :command:`gtest_discover_tests` discovers tests by asking the
compiled test executable to enumerate its tests. This is more robust and
provides better handling of parameterized tests, and does not require CMake
to be re-run when tests change. However, it may not work in a cross-compiling
environment, and setting test properties is less convenient.
More details can be found in the documentation of the respective functions.
Both commands are intended to replace use of :command:`add_test` to register
tests, and will create a separate CTest test for each Google Test test case.
Note that this is in some cases less efficient, as common set-up and tear-down
logic cannot be shared by multiple test cases executing in the same instance.
However, it provides more fine-grained pass/fail information to CTest, which is
usually considered as more beneficial. By default, the CTest test name is the
same as the Google Test name (i.e. ``suite.testcase``); see also
``TEST_PREFIX`` and ``TEST_SUFFIX``.
.. command:: gtest_add_tests
Automatically add tests with CTest by scanning source code for Google Test
macros::
gtest_add_tests(TARGET target
[SOURCES src1...]
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[SKIP_DEPENDENCY]
[TEST_LIST outVar]
)
``gtest_add_tests`` attempts to identify tests by scanning source files.
Although this is generally effective, it uses only a basic regular expression
match, which can be defeated by atypical test declarations, and is unable to
fully "split" parameterized tests. Additionally, it requires that CMake be
re-run to discover any newly added, removed or renamed tests (by default,
this means that CMake is re-run when any test source file is changed, but see
``SKIP_DEPENDENCY``). However, it has the advantage of declaring tests at
CMake time, which somewhat simplifies setting additional properties on tests,
and always works in a cross-compiling environment.
The options are:
``TARGET target``
Specifies the Google Test executable, which must be a known CMake
executable target. CMake will substitute the location of the built
executable when running the test.
``SOURCES src1...``
When provided, only the listed files will be scanned for test cases. If
this option is not given, the :prop_tgt:`SOURCES` property of the
specified ``target`` will be used to obtain the list of sources.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same source files are being used in
multiple calls to ``gtest_add_test()`` but with different ``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``SKIP_DEPENDENCY``
Normally, the function creates a dependency which will cause CMake to be
re-run if any of the sources being scanned are changed. This is to ensure
that the list of discovered tests is updated. If this behavior is not
desired (as may be the case while actually writing the test cases), this
option can be used to prevent the dependency from being added.
``TEST_LIST outVar``
The variable named by ``outVar`` will be populated in the calling scope
with the list of discovered test cases. This allows the caller to do
things like manipulate test properties of the discovered tests.
.. code-block:: cmake
include(GoogleTest)
add_executable(FooTest FooUnitTest.cxx)
gtest_add_tests(TARGET FooTest
TEST_SUFFIX .noArgs
TEST_LIST noArgsTests
)
gtest_add_tests(TARGET FooTest
EXTRA_ARGS --someArg someValue
TEST_SUFFIX .withArgs
TEST_LIST withArgsTests
)
set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)
For backward compatibility, the following form is also supported::
gtest_add_tests(exe args files...)
``exe``
The path to the test executable or the name of a CMake target.
``args``
A ;-list of extra arguments to be passed to executable. The entire
list must be passed as a single argument. Enclose it in quotes,
or pass ``""`` for no arguments.
``files...``
A list of source files to search for tests and test fixtures.
Alternatively, use ``AUTO`` to specify that ``exe`` is the name
of a CMake executable target whose sources should be scanned.
.. code-block:: cmake
include(GoogleTest)
set(FooTestArgs --foo 1 --bar 2)
add_executable(FooTest FooUnitTest.cxx)
gtest_add_tests(FooTest "${FooTestArgs}" AUTO)
.. command:: gtest_discover_tests
Automatically add tests with CTest by querying the compiled test executable
for available tests::
gtest_discover_tests(target
[EXTRA_ARGS arg1...]
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
[NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
[PROPERTIES name1 value1...]
[TEST_LIST var]
[DISCOVERY_TIMEOUT seconds]
[XML_OUTPUT_DIR dir]
[DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
)
``gtest_discover_tests()`` sets up a post-build command on the test executable
that generates the list of tests by parsing the output from running the test
with the ``--gtest_list_tests`` argument. Compared to the source parsing
approach of :command:`gtest_add_tests`, this ensures that the full list of
tests, including instantiations of parameterized tests, is obtained. Since
test discovery occurs at build time, it is not necessary to re-run CMake when
the list of tests changes.
However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
in order to function in a cross-compiling environment.
Additionally, setting properties on tests is somewhat less convenient, since
the tests are not available at CMake time. Additional test properties may be
assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
more fine-grained test control is needed, custom content may be provided
through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
directory property. The set of discovered tests is made accessible to such a
script via the ``<target>_TESTS`` variable.
The options are:
``target``
Specifies the Google Test executable, which must be a known CMake
executable target. CMake will substitute the location of the built
executable when running the test.
``EXTRA_ARGS arg1...``
Any extra arguments to pass on the command line to each test case.
``WORKING_DIRECTORY dir``
Specifies the directory in which to run the discovered test cases. If this
option is not provided, the current binary directory is used.
``TEST_PREFIX prefix``
Specifies a ``prefix`` to be prepended to the name of each discovered test
case. This can be useful when the same test executable is being used in
multiple calls to ``gtest_discover_tests()`` but with different
``EXTRA_ARGS``.
``TEST_SUFFIX suffix``
Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
``NO_PRETTY_TYPES``
By default, the type index of type-parameterized tests is replaced by the
actual type name in the CTest test name. If this behavior is undesirable
(e.g. because the type names are unwieldy), this option will suppress this
behavior.
``NO_PRETTY_VALUES``
By default, the value index of value-parameterized tests is replaced by the
actual value in the CTest test name. If this behavior is undesirable
(e.g. because the value strings are unwieldy), this option will suppress
this behavior.
``PROPERTIES name1 value1...``
Specifies additional properties to be set on all tests discovered by this
invocation of ``gtest_discover_tests()``.
``TEST_LIST var``
Make the list of tests available in the variable ``var``, rather than the
default ``<target>_TESTS``. This can be useful when the same test
executable is being used in multiple calls to ``gtest_discover_tests()``.
Note that this variable is only available in CTest.
``DISCOVERY_TIMEOUT num``
Specifies how long (in seconds) CMake will wait for the test to enumerate
available tests. If the test takes longer than this, discovery (and your
build) will fail. Most test executables will enumerate their tests very
quickly, but under some exceptional circumstances, a test may require a
longer timeout. The default is 5. See also the ``TIMEOUT`` option of
:command:`execute_process`.
.. note::
In CMake versions 3.10.1 and 3.10.2, this option was called ``TIMEOUT``.
This clashed with the ``TIMEOUT`` test property, which is one of the
common properties that would be set with the ``PROPERTIES`` keyword,
usually leading to legal but unintended behavior. The keyword was
changed to ``DISCOVERY_TIMEOUT`` in CMake 3.10.3 to address this
problem. The ambiguous behavior of the ``TIMEOUT`` keyword in 3.10.1
and 3.10.2 has not been preserved.
``XML_OUTPUT_DIR dir``
If specified, the parameter is passed along with ``--gtest_output=xml:``
to test executable. The actual file name is the same as the test target,
including prefix and suffix. This should be used instead of
``EXTRA_ARGS --gtest_output=xml`` to avoid race conditions writing the
XML result output when using parallel test execution.
``DISCOVERY_MODE``
Provides greater control over when ``gtest_discover_tests()`` performs test
discovery. By default, ``POST_BUILD`` sets up a post-build command
to perform test discovery at build time. In certain scenarios, like
cross-compiling, this ``POST_BUILD`` behavior is not desirable.
By contrast, ``PRE_TEST`` delays test discovery until just prior to test
execution. This way test discovery occurs in the target environment
where the test has a better chance at finding appropriate runtime
dependencies.
``DISCOVERY_MODE`` defaults to the value of the
``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not
passed when calling ``gtest_discover_tests()``. This provides a mechanism
for globally selecting a preferred test discovery behavior without having
to modify each call site.
#]=======================================================================]
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
#------------------------------------------------------------------------------
function(gtest_add_tests)
if (ARGC LESS 1)
message(FATAL_ERROR "No arguments supplied to gtest_add_tests()")
endif()
set(options
SKIP_DEPENDENCY
)
set(oneValueArgs
TARGET
WORKING_DIRECTORY
TEST_PREFIX
TEST_SUFFIX
TEST_LIST
)
set(multiValueArgs
SOURCES
EXTRA_ARGS
)
set(allKeywords ${options} ${oneValueArgs} ${multiValueArgs})
unset(sources)
if("${ARGV0}" IN_LIST allKeywords)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(autoAddSources YES)
else()
# Non-keyword syntax, convert to keyword form
if (ARGC LESS 3)
message(FATAL_ERROR "gtest_add_tests() without keyword options requires at least 3 arguments")
endif()
set(ARGS_TARGET "${ARGV0}")
set(ARGS_EXTRA_ARGS "${ARGV1}")
if(NOT "${ARGV2}" STREQUAL "AUTO")
set(ARGS_SOURCES "${ARGV}")
list(REMOVE_AT ARGS_SOURCES 0 1)
endif()
endif()
# The non-keyword syntax allows the first argument to be an arbitrary
# executable rather than a target if source files are also provided. In all
# other cases, both forms require a target.
if(NOT TARGET "${ARGS_TARGET}" AND NOT ARGS_SOURCES)
message(FATAL_ERROR "${ARGS_TARGET} does not define an existing CMake target")
endif()
if(NOT ARGS_WORKING_DIRECTORY)
unset(workDir)
else()
set(workDir WORKING_DIRECTORY "${ARGS_WORKING_DIRECTORY}")
endif()
if(NOT ARGS_SOURCES)
get_property(ARGS_SOURCES TARGET ${ARGS_TARGET} PROPERTY SOURCES)
endif()
unset(testList)
set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
foreach(source IN LISTS ARGS_SOURCES)
if(NOT ARGS_SKIP_DEPENDENCY)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
endif()
file(READ "${source}" contents)
string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}")
foreach(hit ${found_tests})
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
# Parameterized tests have a different signature for the filter
if("x${test_type}" STREQUAL "xTEST_P")
string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTYPED_TEST")
string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" gtest_test_name ${hit})
else()
message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
continue()
endif()
# Make sure tests disabled in GTest get disabled in CTest
if(gtest_test_name MATCHES "(^|\\.)DISABLED_")
# Add the disabled test if CMake is new enough
# Note that this check is to allow backwards compatibility so this
# module can be copied locally in projects to use with older CMake
# versions
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401)
string(REGEX REPLACE
"(^|\\.)DISABLED_" "\\1"
orig_test_name "${gtest_test_name}"
)
set(ctest_test_name
${ARGS_TEST_PREFIX}${orig_test_name}${ARGS_TEST_SUFFIX}
)
add_test(NAME ${ctest_test_name}
${workDir}
COMMAND ${ARGS_TARGET}
--gtest_also_run_disabled_tests
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
list(APPEND testList ${ctest_test_name})
endif()
else()
set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
add_test(NAME ${ctest_test_name}
${workDir}
COMMAND ${ARGS_TARGET}
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
list(APPEND testList ${ctest_test_name})
endif()
endforeach()
endforeach()
if(ARGS_TEST_LIST)
set(${ARGS_TEST_LIST} ${testList} PARENT_SCOPE)
endif()
endfunction()
#------------------------------------------------------------------------------
function(gtest_discover_tests TARGET)
cmake_parse_arguments(
""
"NO_PRETTY_TYPES;NO_PRETTY_VALUES"
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
"EXTRA_ARGS;PROPERTIES"
${ARGN}
)
if(NOT _WORKING_DIRECTORY)
set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT _TEST_LIST)
set(_TEST_LIST ${TARGET}_TESTS)
endif()
if(NOT _DISCOVERY_TIMEOUT)
set(_DISCOVERY_TIMEOUT 5)
endif()
if(NOT _DISCOVERY_MODE)
if(NOT CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "POST_BUILD")
endif()
set(_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
endif()
get_property(
has_counter
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
SET
)
if(has_counter)
get_property(
counter
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
)
math(EXPR counter "${counter} + 1")
else()
set(counter 1)
endif()
set_property(
TARGET ${TARGET}
PROPERTY CTEST_DISCOVERED_TEST_COUNTER
${counter}
)
# Define rule to generate test list for aforementioned test executable
# Blender: use _ instead of [] to avoid problems with zsh regex.
set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_${counter}_")
set(ctest_include_file "${ctest_file_base}_include.cmake")
set(ctest_tests_file "${ctest_file_base}_tests.cmake")
get_property(crosscompiling_emulator
TARGET ${TARGET}
PROPERTY CROSSCOMPILING_EMULATOR
)
if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
add_custom_command(
TARGET ${TARGET} POST_BUILD
BYPRODUCTS "${ctest_tests_file}"
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
-D "TEST_EXECUTOR=${crosscompiling_emulator}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
-D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
-D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
-D "TEST_LIST=${_TEST_LIST}"
-D "CTEST_FILE=${ctest_tests_file}"
-D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
-D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
-P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
VERBATIM
)
file(WRITE "${ctest_include_file}"
"if(EXISTS \"${ctest_tests_file}\")\n"
" include(\"${ctest_tests_file}\")\n"
"else()\n"
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
"endif()\n"
)
elseif(_DISCOVERY_MODE STREQUAL "PRE_TEST")
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL
PROPERTY GENERATOR_IS_MULTI_CONFIG
)
if(GENERATOR_IS_MULTI_CONFIG)
set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
endif()
string(CONCAT ctest_include_content
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
" include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
" gtest_discover_tests_impl(" "\n"
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
" TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
" TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
" TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
" TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
" TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
" TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
" NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
" NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
" TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
" CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n"
" TEST_DISCOVERY_TIMEOUT" " [==[" "${_DISCOVERY_TIMEOUT}" "]==]" "\n"
" TEST_XML_OUTPUT_DIR" " [==[" "${_XML_OUTPUT_DIR}" "]==]" "\n"
" )" "\n"
" endif()" "\n"
" include(\"${ctest_tests_file}\")" "\n"
"else()" "\n"
" add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)" "\n"
"endif()" "\n"
)
if(GENERATOR_IS_MULTI_CONFIG)
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
endforeach()
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
else()
file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
endif()
else()
message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
endif()
# Add discovered tests to directory TEST_INCLUDE_FILES
set_property(DIRECTORY
APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
)
endfunction()
###############################################################################
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/GTestAddTests.cmake
)
# Restore project's policies
cmake_policy(POP)

View File

@@ -0,0 +1,191 @@
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
# Blender: disable ASAN leak detection when trying to discover tests.
set(ENV{ASAN_OPTIONS} "detect_leaks=0")
cmake_minimum_required(VERSION ${CMAKE_VERSION})
# Overwrite possibly existing ${_CTEST_FILE} with empty file
set(flush_tests_MODE WRITE)
# Flushes script to ${_CTEST_FILE}
macro(flush_script)
file(${flush_tests_MODE} "${_CTEST_FILE}" "${script}")
set(flush_tests_MODE APPEND)
set(script "")
endmacro()
# Flushes tests_buffer to tests
macro(flush_tests_buffer)
list(APPEND tests "${tests_buffer}")
set(tests_buffer "")
endmacro()
macro(add_command NAME)
set(_args "")
foreach(_arg ${ARGN})
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
string(APPEND _args " [==[${_arg}]==]")
else()
string(APPEND _args " ${_arg}")
endif()
endforeach()
string(APPEND script "${NAME}(${_args})\n")
string(LENGTH "${script}" _script_len)
if(${_script_len} GREATER "50000")
flush_script()
endif()
# Unsets macro local variables to prevent leakage outside of this macro.
unset(_args)
unset(_script_len)
endmacro()
function(gtest_discover_tests_impl)
cmake_parse_arguments(
""
""
"NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_EXECUTOR;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
"TEST_EXTRA_ARGS;TEST_PROPERTIES"
${ARGN}
)
set(prefix "${_TEST_PREFIX}")
set(suffix "${_TEST_SUFFIX}")
set(extra_args ${_TEST_EXTRA_ARGS})
set(properties ${_TEST_PROPERTIES})
set(script)
set(suite)
set(tests)
set(tests_buffer)
# Run test executable to get list of available tests
if(NOT EXISTS "${_TEST_EXECUTABLE}")
message(FATAL_ERROR
"Specified test executable does not exist.\n"
" Path: '${_TEST_EXECUTABLE}'"
)
endif()
execute_process(
COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
OUTPUT_VARIABLE output
RESULT_VARIABLE result
)
if(NOT ${result} EQUAL 0)
string(REPLACE "\n" "\n " output "${output}")
message(FATAL_ERROR
"Error running test executable.\n"
" Path: '${_TEST_EXECUTABLE}'\n"
" Result: ${result}\n"
" Output:\n"
" ${output}\n"
)
endif()
# Preserve semicolon in test-parameters
string(REPLACE [[;]] [[\;]] output "${output}")
string(REPLACE "\n" ";" output "${output}")
# Parse output
foreach(line ${output})
# Skip header
if(NOT line MATCHES "gtest_main\\.cc")
# Do we have a module name or a test name?
if(NOT line MATCHES "^ ")
# Module; remove trailing '.' to get just the name...
string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
if(line MATCHES "#" AND NOT _NO_PRETTY_TYPES)
string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
else()
set(pretty_suite "${suite}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
# Test name; strip spaces and comments to get just the name...
string(REGEX REPLACE " +" "" test "${line}")
if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
else()
string(REGEX REPLACE "#.*" "" pretty_test "${test}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
string(REGEX REPLACE "#.*" "" test "${test}")
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
else()
unset(TEST_XML_OUTPUT_PARAM)
endif()
# sanitize test name for further processing downstream
set(testname "${prefix}${pretty_suite}.${pretty_test}${suffix}")
# escape \
string(REPLACE [[\]] [[\\]] testname "${testname}")
# escape ;
string(REPLACE [[;]] [[\;]] testname "${testname}")
# escape $
string(REPLACE [[$]] [[\$]] testname "${testname}")
# ...and add to script
add_command(add_test
"${testname}"
${_TEST_EXECUTOR}
"${_TEST_EXECUTABLE}"
"--gtest_filter=${suite}.${test}"
"--gtest_also_run_disabled_tests"
${TEST_XML_OUTPUT_PARAM}
${extra_args}
)
if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
add_command(set_tests_properties
"${testname}"
PROPERTIES DISABLED TRUE
)
endif()
add_command(set_tests_properties
"${testname}"
PROPERTIES
WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
SKIP_REGULAR_EXPRESSION "\\\\[ SKIPPED \\\\]"
${properties}
)
list(APPEND tests_buffer "${testname}")
list(LENGTH tests_buffer tests_buffer_length)
if(${tests_buffer_length} GREATER "250")
flush_tests_buffer()
endif()
endif()
endif()
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
flush_tests_buffer()
add_command(set ${_TEST_LIST} ${tests})
# Write CTest script
flush_script()
endfunction()
if(CMAKE_SCRIPT_MODE_FILE)
gtest_discover_tests_impl(
NO_PRETTY_TYPES ${NO_PRETTY_TYPES}
NO_PRETTY_VALUES ${NO_PRETTY_VALUES}
TEST_EXECUTABLE ${TEST_EXECUTABLE}
TEST_EXECUTOR ${TEST_EXECUTOR}
TEST_WORKING_DIR ${TEST_WORKING_DIR}
TEST_PREFIX ${TEST_PREFIX}
TEST_SUFFIX ${TEST_SUFFIX}
TEST_LIST ${TEST_LIST}
CTEST_FILE ${CTEST_FILE}
TEST_DISCOVERY_TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
TEST_XML_OUTPUT_DIR ${TEST_XML_OUTPUT_DIR}
TEST_EXTRA_ARGS ${TEST_EXTRA_ARGS}
TEST_PROPERTIES ${TEST_PROPERTIES}
)
endif()

View File

@@ -1,12 +1,8 @@
#=============================================================================
# Copyright 2014 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.
# Distributed under the OSI-approved BSD 3-Clause License,
# see accompanying file BSD-3-Clause-license.txt for details.
#
# Inspired on the Testing.cmake from Libmv
#
@@ -37,6 +33,11 @@ macro(BLENDER_SRC_GTEST_EX)
if(WIN32)
set(MANIFEST "${CMAKE_BINARY_DIR}/tests.exe.manifest")
endif()
add_definitions(-DBLENDER_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
add_executable(${TARGET_NAME} ${ARG_SRC} ${MANIFEST})
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
@@ -69,6 +70,9 @@ macro(BLENDER_SRC_GTEST_EX)
if(WITH_TBB)
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
endif()
if(WITH_GMP)
target_link_libraries(${TARGET_NAME} ${GMP_LIBRARIES})
endif()
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)

View File

@@ -15,10 +15,12 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)

View File

@@ -20,10 +20,12 @@ set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
set(WITH_FREESTYLE OFF CACHE BOOL "" FORCE)
set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)

View File

@@ -16,10 +16,12 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GMP ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
@@ -53,7 +55,7 @@ set(WITH_USD ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75;compute_75 CACHE STRING "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
# platform dependent options

View File

@@ -169,6 +169,26 @@ function(blender_include_dirs_sys
include_directories(SYSTEM ${_ALL_INCS})
endfunction()
# Set include paths for header files included with "*.h" syntax.
# This enables auto-complete suggestions for user header files on Xcode.
# Build process is not affected since the include paths are the same
# as in HEADER_SEARCH_PATHS.
function(blender_user_header_search_paths
name
includes
)
if(XCODE)
set(_ALL_INCS "")
foreach(_INC ${includes})
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
# _ALL_INCS is a space-separated string of file paths in quotes.
set(_ALL_INCS "${_ALL_INCS} \"${_ABS_INC}\"")
endforeach()
set_target_properties(${name} PROPERTIES XCODE_ATTRIBUTE_USER_HEADER_SEARCH_PATHS "${_ALL_INCS}")
endif()
endfunction()
function(blender_source_group
name
sources
@@ -317,6 +337,7 @@ function(blender_add_lib__impl
# works fine without having the includes
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${name}" "${sources}")
blender_user_header_search_paths("${name}" "${includes}")
list_assert_duplicates("${sources}")
list_assert_duplicates("${includes}")
@@ -354,6 +375,42 @@ function(blender_add_lib
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
endfunction()
# blender_add_test_lib() is used to define a test library. It is intended to be
# called in tandem with blender_add_lib(). The test library will be linked into
# the bf_gtest_runner_test executable (see tests/gtests/CMakeLists.txt).
function(blender_add_test_lib
name
sources
includes
includes_sys
library_deps
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
# Otherwise external projects will produce warnings that we cannot fix.
remove_strict_flags()
# This duplicates logic that's also in GTestTesting.cmake, macro BLENDER_SRC_GTEST_EX.
# TODO(Sybren): deduplicate after the general approach in D7649 has been approved.
LIST(APPEND includes
${CMAKE_SOURCE_DIR}/tests/gtests
)
LIST(APPEND includes_sys
${GLOG_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/extern/gtest/include
${CMAKE_SOURCE_DIR}/extern/gmock/include
)
add_definitions(-DBLENDER_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
add_definitions(${GFLAGS_DEFINES})
add_definitions(${GLOG_DEFINES})
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
set_property(GLOBAL APPEND PROPERTY BLENDER_TEST_LIBS ${name})
endfunction()
# Ninja only: assign 'heavy pool' to some targets that are especially RAM-consuming to build.
function(setup_heavy_lib_pool)
if(WITH_NINJA_POOL_JOBS AND NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
@@ -361,7 +418,7 @@ function(setup_heavy_lib_pool)
list(APPEND _HEAVY_LIBS "cycles_device" "cycles_kernel")
endif()
if(WITH_LIBMV)
list(APPEND _HEAVY_LIBS "bf_intern_libmv")
list(APPEND _HEAVY_LIBS "extern_ceres" "bf_intern_libmv")
endif()
if(WITH_OPENVDB)
list(APPEND _HEAVY_LIBS "bf_intern_openvdb")
@@ -439,6 +496,10 @@ function(SETUP_LIBDIRS)
link_directories(${ALEMBIC_LIBPATH})
endif()
if(WITH_GMP)
link_directories(${GMP_LIBPATH})
endif()
if(WITH_GHOST_WAYLAND)
link_directories(
${wayland-client_LIBRARY_DIRS}

View File

@@ -20,7 +20,11 @@
# Libraries configuration for Apple.
set(MACOSX_DEPLOYMENT_TARGET "10.11")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(MACOSX_DEPLOYMENT_TARGET 11.00)
else()
set(MACOSX_DEPLOYMENT_TARGET 10.13)
endif()
macro(find_package_wrapper)
# do nothing, just satisfy the macro
@@ -369,8 +373,9 @@ if(WITH_CYCLES_OSL)
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
find_path(OSL_SHADER_DIR NAMES stdosl.h PATHS ${CYCLES_OSL}/shaders)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER AND OSL_SHADER_DIR)
set(OSL_FOUND TRUE)
else()
message(STATUS "OSL not found")
@@ -378,6 +383,12 @@ if(WITH_CYCLES_OSL)
endif()
endif()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(WITH_CYCLES_EMBREE OFF)
set(WITH_OPENIMAGEDENOISE OFF)
set(WITH_CPU_SSE OFF)
endif()
if(WITH_CYCLES_EMBREE)
find_package(Embree 3.8.0 REQUIRED)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
@@ -396,6 +407,15 @@ if(WITH_TBB)
find_package(TBB)
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
set(WITH_GMP OFF)
message(STATUS "GMP 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")
@@ -420,13 +440,21 @@ if(WITH_OPENMP)
endif()
if(WITH_XR_OPENXR)
find_package(OpenXR-SDK)
if(NOT OPENXR_SDK_FOUND)
find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
message(WARNING "GMP not found, disabling WITH_GMP")
set(WITH_GMP OFF)
endif()
endif()
set(EXETYPE MACOSX_BUNDLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
@@ -439,8 +467,8 @@ if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize -fvariable-expansion-in-unroller")
endif()
else()
set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -fno-strict-aliasing")
endif()
if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)

View File

@@ -21,8 +21,10 @@
# Xcode and system configuration for Apple.
if(NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
"Choose the architecture you want to build Blender for: i386, x86_64 or ppc"
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Detected native architecture ${ARCHITECTURE}.")
set(CMAKE_OSX_ARCHITECTURES ${ARCHITECTURE} CACHE STRING
"Choose the architecture you want to build Blender for: arm64 or x86_64"
FORCE)
endif()
@@ -65,13 +67,9 @@ endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_BUNDLE}")
# Older Xcode versions had different approach to the directory hiearchy.
# Require newer Xcode which is also have better chances of being able to compile with the
# required deployment target.
#
# NOTE: Xcode version 8.2 is the latest one which runs on macOS 10.11.
if(${XCODE_VERSION} VERSION_LESS 8.2)
message(FATAL_ERROR "Only Xcode version 8.2 and newer is supported")
# Require a relatively recent Xcode version.
if(${XCODE_VERSION} VERSION_LESS 10.0)
message(FATAL_ERROR "Only Xcode version 10.0 and newer is supported")
endif()
# note: xcode-select path could be ambiguous,
@@ -133,14 +131,21 @@ if(${CMAKE_GENERATOR} MATCHES "Xcode")
endif()
unset(OSX_SDKROOT)
# 10.11 is our min. target, if you use higher sdk, weak linking happens
# 10.13 is our min. target, if you use higher sdk, weak linking happens
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(OSX_MIN_DEPLOYMENT_TARGET 11.00)
else()
set(OSX_MIN_DEPLOYMENT_TARGET 10.13)
endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.11)
message(STATUS "Setting deployment target to 10.11, lower versions are not supported")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS ${OSX_MIN_DEPLOYMENT_TARGET})
message(STATUS "Setting deployment target to ${OSX_MIN_DEPLOYMENT_TARGET}, lower versions are not supported")
set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE)
endif()
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE)
endif()
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")

View File

@@ -36,6 +36,11 @@ if(NOT DEFINED LIBDIR)
elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
if(CMAKE_COMPILER_IS_GNUCC AND
CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)
message(FATAL_ERROR "GCC version must be at least 9.3 for precompiled libraries, found ${CMAKE_C_COMPILER_VERSION}")
endif()
endif()
# Avoid namespace pollustion.
@@ -229,10 +234,10 @@ endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
if(NOT OSL_ROOT)
if(EXISTS ${CYCLES_OSL} AND NOT OSL_ROOT)
set(OSL_ROOT ${CYCLES_OSL})
endif()
find_package_wrapper(OpenShadingLanguage)
find_package_wrapper(OSL)
if(OSL_FOUND)
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
@@ -422,14 +427,31 @@ if(WITH_TBB)
find_package_wrapper(TBB)
endif()
if(WITH_GMP)
find_package(GMP)
if(NOT GMP_FOUND)
set(WITH_GMP OFF)
message(STATUS "GMP not found")
endif()
endif()
if(WITH_XR_OPENXR)
find_package(XR-OpenXR-SDK)
find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
endif()
if(WITH_GMP)
find_package_wrapper(GMP)
if(NOT GMP_FOUND)
message(WARNING "GMP not found, disabling WITH_GMP")
set(WITH_GMP OFF)
endif()
endif()
if(EXISTS ${LIBDIR})
without_system_libs_end()
endif()
@@ -577,6 +599,14 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
# `maybe-uninitialized` is unreliable in release builds, but fine in debug builds.
set(GCC_EXTRA_FLAGS_RELEASE "-Wno-maybe-uninitialized")
set(CMAKE_C_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
set(CMAKE_CXX_FLAGS_RELEASE "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
unset(GCC_EXTRA_FLAGS_RELEASE)
if(WITH_LINKER_GOLD)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version

View File

@@ -136,6 +136,13 @@ add_definitions(
# MSVC11 needs _ALLOW_KEYWORD_MACROS to build
add_definitions(-D_ALLOW_KEYWORD_MACROS)
# RTTI is on by default even without this switch
# however having it in the CXX Flags makes it difficult
# to remove for individual files that want to disable it
# using the /GR- flag without generating a build warning
# that both /GR and /GR- are specified.
remove_cc_flag("/GR")
# We want to support Windows 7 level ABI
add_definitions(-D_WIN32_WINNT=0x601)
include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
@@ -416,9 +423,6 @@ if(WITH_BOOST)
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif()
if(WITH_OPENVDB)
list(APPEND boost_extra_libs iostreams)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
@@ -524,12 +528,11 @@ if(WITH_OPENCOLORIO)
endif()
if(WITH_OPENVDB)
set(BLOSC_LIBRARIES optimized ${LIBDIR}/blosc/lib/libblosc.lib debug ${LIBDIR}/blosc/lib/libblosc_d.lib)
set(OPENVDB ${LIBDIR}/openVDB)
set(OPENVDB_LIBPATH ${OPENVDB}/lib)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib ${BLOSC_LIBRARIES})
set(OPENVDB_DEFINITIONS -DNOMINMAX -DOPENVDB_STATICLIB -D_USE_MATH_DEFINES)
set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib )
set(OPENVDB_DEFINITIONS -DNOMINMAX -D_USE_MATH_DEFINES)
endif()
if(WITH_OPENIMAGEDENOISE)
@@ -750,3 +753,10 @@ if(WITH_XR_OPENXR)
set(WITH_XR_OPENXR OFF)
endif()
endif()
if(WITH_GMP)
set(GMP_INCLUDE_DIRS ${LIBDIR}/gmp/include)
set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/libgmp-10.lib optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
set(GMP_ROOT_DIR ${LIBDIR}/gmp)
set(GMP_FOUND On)
endif()

View File

@@ -5,6 +5,14 @@ if(WITH_WINDOWS_BUNDLE_CRT)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
# This sometimes can change when updates are installed and the compiler version
# changes, so test if it exists and if not, give InstallRequiredSystemLibraries
# another chance to figure out the path.
if(MSVC_REDIST_DIR AND NOT EXISTS "${MSVC_REDIST_DIR}")
unset(MSVC_REDIST_DIR CACHE)
endif()
include(InstallRequiredSystemLibraries)
# Install the CRT to the blender.crt Sub folder.

View File

@@ -40,7 +40,8 @@ if make_utils.command_missing(git_command):
# Test if we are building a specific release version.
branch = make_utils.git_branch(git_command)
release_version = make_utils.git_branch_release_version(branch)
tag = make_utils.git_tag(git_command)
release_version = make_utils.git_branch_release_version(branch, tag)
lib_tests_dirpath = os.path.join('..', 'lib', "tests")
if not os.path.exists(lib_tests_dirpath):

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