Compare commits

..

188 Commits

Author SHA1 Message Date
cb261c96f5 UV: tweak face select behavior
When the mouse cursor is inside the UV face,
extend the selection threshold.

This means when zoomed in, a face can always be selected when the cursor
is inside it.
In the case of multiple overlapping faces - the face with the closest
center is used.
2021-01-18 18:24:56 +11:00
44c1a018f4 Cleanup: move UvNearestHit.ob assignment in find nearest functions
This makes it possible to pass multiple hit arguments.

Also rename 'hit_final' to 'hit', since there are no longer a local
'hit' variable defined in these functions.
2021-01-18 18:01:50 +11:00
4ef0654449 GPencil: Fix Autojoin error using layer transform
The target stroke bounding box was not checked properly and when using layer transform the error was noticeable, but really the error was before the layer transform commit.
2021-01-17 12:35:27 +01:00
502eadb2f7 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:11 +11:00
ced673c833 Merge branch 'blender-v2.92-release' 2021-01-17 21:40:07 +11:00
9fb755fe4c Merge branch 'blender-v2.92-release' 2021-01-17 21:40:03 +11:00
2ee2f87f29 Add Object Tool: move extra settings popover last
This is intended to be used when settings don't fit in the top bar,
so it makes sense to keep them last.
2021-01-17 21:36:49 +11:00
06da6e2eaf Add Object Tool: scale the cursor plane based on the depth
Draw the cursor plane smaller then further away from the view.

This makes the plane being drawn onto easier to perceive.
2021-01-17 21:21:18 +11:00
5f9358a373 Add Object Tool: split aspect & origin options for base/height
In practice it's common these settings shouldn't be linked for drawing
the initial (base) plane, compared with the height.
2021-01-17 21:16:22 +11:00
14bb9f09ab Merge branch 'blender-v2.92-release' 2021-01-17 18:30:14 +11:00
54c28e5bfb Merge branch 'blender-v2.92-release' 2021-01-17 18:30:10 +11:00
ca476a638c RNA: report an error when the name property is set twice
This helps avoid copy-paste errors which have happened a few times,
no functional changes.
2021-01-17 18:24:34 +11:00
66a87fc9f4 Fix workspace tool name property
The fallback tool was used as the tool name.

Regression in a8ce9a143a
2021-01-17 18:24:34 +11:00
1e8ed36a90 Merge branch 'blender-v2.92-release' 2021-01-16 13:11:33 -06:00
Wannes Malfait
6fb7d0f559 Fix T84713: Geometry nodes reroute sockets have incorrect type
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.

Differential Revision: https://developer.blender.org/D10123
2021-01-16 13:09:19 -06:00
4e8c78245d GPencil: Hide layer if the scale is zero
When scale a layer to zero must be hidden.
2021-01-16 19:36:00 +01:00
24cdffde55 GPencil: Cleanup - Rename ED_gpencil_stroke_color_use to ED_gpencil_stroke_material_editable 2021-01-16 16:44:49 +01:00
f5ec29023d GPencil: Fix initial value for fill factor after last changes
The value has changed due a previous commit and the minimum value cannot be 0.
2021-01-16 16:36:49 +01:00
e02d84eb3b GPencil: Add new parameteres to transform layers
When using grease pencil for drawing Storyboards, it's very common to require a transform of the layers. This transform can be done using the offset modifier, but in some cases, the scene requires a lot of modifiers and makes the file hard to work.

This new feature adds a transforms Location, Rotation and Scale at Layer level, and allows to transform the layer without using a modifier, keeping the scene more clean.

{F9480695}

This feature was suggested by @pepeland after receiving feedback from several artists.

Also, done some code cleanup and rename some functions to get a better naming.

Maniphest Tasks: T83660

Differential Revision: https://developer.blender.org/D9761
2021-01-16 15:46:45 +01:00
0a44c4b594 Merge branch 'blender-v2.92-release' 2021-01-16 15:26:43 +01:00
1e193a0b56 Fix T84757: feedback loop with when modifying vertex group with nodes
The issue was that the mesh shared its vertex weights with the
original mesh (to reduce memory consumption). The solution is
to make a local copy of the vertex weights in this case.
2021-01-16 15:24:22 +01:00
79dd9fedb2 Fix T84758: Revert "LibOverride: Also consider regular embedded IDs as virtual overrides."
This made Blender considers all materials to be overridden.

This reverts commit 2aa7bc06e7.
2021-01-16 10:28:47 +01:00
3cc1bcce4f Merge branch 'blender-v2.92-release' 2021-01-16 11:39:37 +11:00
7573631d69 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:34 +11:00
d4ffccbeae Merge branch 'blender-v2.92-release' 2021-01-16 11:39:31 +11:00
3adb9530bb Merge branch 'blender-v2.92-release' 2021-01-16 11:39:29 +11:00
3856c58f5d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:27 +11:00
6403c8c025 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:23 +11:00
39b752316d Merge branch 'blender-v2.92-release' 2021-01-16 11:39:21 +11:00
66161ba3a1 Merge branch 'blender-v2.92-release' 2021-01-16 11:39:12 +11:00
f7829961c6 Add Object Tool: include shortcuts in the tool-tip 2021-01-16 11:37:52 +11:00
ecffd231a0 Add Object Tool: add initial "Fixed Aspect" option
This makes it more convent to add many objects with a fixed aspect ratio.
2021-01-16 11:37:52 +11:00
fef7b792e7 Add Object Tool: make UI more compact
Move some of the more obscure options into a popover,
so they don't take up so much room in the top-bar.
2021-01-16 11:37:52 +11:00
cdfa3feb91 Add Object Tool: support incremental snapping
This adds a "Snap to" option that allows using all the scenes snap
settings which includes incremental & absolute grid snapping options.

This is optional because always following scene snapping would not
snap to geometry by default (which seems to be the most useful default).
2021-01-16 11:36:55 +11:00
c4bbe44e47 Add Object Tool: workaround non-orthogonal orientation matrices 2021-01-16 11:32:00 +11:00
2f0d919f89 Add Object Tool: quiet warning setting size
The size property was only used for the cube
2021-01-16 11:32:00 +11:00
8fd3ffcb31 Add Object Tool: rename keymap, expose in keymap editor
Make the name follow the convention of other View3D keymaps.
2021-01-16 11:31:35 +11:00
27c142aa29 Add Object Tool: remove from experimental
Based on feedback from @dbystedt, include this in 2.92
with some updates (coming next).
2021-01-16 11:28:02 +11:00
a8436334bd Merge branch 'blender-v2.92-release' 2021-01-15 12:23:13 -08:00
957de39191 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-15 12:18:13 -08:00
Aaron Carlisle
f71a7d3914 Cleanup: Remove Unused tracking properties
These properties are unused and serve no purpose.

Reviewed By: sergey, #motion_tracking

Differential Revision: https://developer.blender.org/D9803
2021-01-15 14:58:24 -05:00
fa817b8c96 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-15 12:36:35 -07:00
de60dc84e2 Fix: Build error with MSVC 2017
BKE_cryptomatte_extract_layer_name was using std::isdigit
without including <cctype> somehow only MSVC 2017 had a
problem with that.
2021-01-15 12:36:03 -07:00
bf7fdd0f67 Cleanup: LibOverride: Update comment. 2021-01-15 19:36:38 +01:00
2aa7bc06e7 LibOverride: Also consider regular embedded IDs as virtual overrides.
Those (aka root node trees and master collections) share same 'traits'
as the shapekeys: RNA cannot assign them, so we need to handle them as
sub-data of their owner IDs.

Not sure how much this will help in improving support of overrides for
scenes and nodetrees, but this is a mandatory step towards that goal for
sure.
2021-01-15 19:27:49 +01:00
ce317c9faa LibOverride: fix/update/re-enable ID-related debug checks in diffing code.
We should now have the tools to ensure consistency of ID pointers
diffing in `rna_property_override_diff_propptr`.

As a reminder, for most ID pointers we just check the actual pointer value,
but this is not possible for embedded IDs like root node trees or master
collections, and for fake embedded ones like shapekeys, so those should be
handled as mere sub-data of their owner IDs in override context.
2021-01-15 19:18:26 +01:00
f1a577b38a Merge branch 'blender-v2.92-release' 2021-01-15 19:00:46 +01:00
dc69ef6f3b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 19:00:38 +01:00
5cf04fe2ba Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 19:00:38 +01:00
319056679b Fix T84373: Overrides : shapes keys driven by armature don't work on second instance.
Code generating override operations would not deal properly with Pointer
RNA properties, trying by default to use and check pointers' names
properties like it does with items of a collection.

However, using name property in pointer RNA property case makes no
sense, so specialize the `no_prop_name` flag for each case (pointer or
collection).

here, since second override would generate local data-blocks with
different names than the linked data ones, name matching would fail and
breck handling of override diffing in shapekeys.

Note that shape keys are the only one concerned by that problem, since
other embedded IDs (root node trees and master collections) are fully
real ones, so they always get the same names.
2021-01-15 18:51:04 +01:00
69a7015e12 Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special
snowflake treatment here as well.

They do not have any override data, from override perspective they are
considered as mere sub-data from their owning ID (mesh, lattice, etc.).
Therefore, we should not copy override data from them, but instead
properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`.

Found while investigating T84373.
2021-01-15 18:50:50 +01:00
3459f75f5b Merge branch 'blender-v2.92-release' 2021-01-15 11:04:53 -06:00
0b0e45252b Geometry Nodes: Use a default value in the point scale node
This commit adds the ability to provide a default value to
`attribute_try_get_for_output` and uses it for the `Point Scale` node,
which is important because the node uses multiplication.

The idea is to keep "name-specific" functionality in nodes rather than in
the attribute API, otherwise the complexity will be hard to keep track of.
So this fix doesn't apply to the Attribute Vector Math node, but hopfully
that is okay since that's now a lower level node for this purpose anyway.

Differential Revision: https://developer.blender.org/D10115
2021-01-15 11:04:32 -06:00
237e27e161 Cleanup: Add const in various places in node code
Also includes some various other minor cleanups, like using bool
instead of int in a couple places.
2021-01-15 10:48:22 -06:00
20a54347ee Tracking: Fix transform cancel for plane tracks
Use exact marker accessor. Harmless due to the current way the
transform system is used by tracking. But for the future development
proper accessor needs to be used.
2021-01-15 17:42:13 +01:00
3732508c64 Fix T84745: build error with TBB 2021
task_group::is_canceling() was removed.
2021-01-15 17:29:36 +01:00
c4286ddb09 RNA: support range-based for loops in C++ api
Cycles has a lot of code like this:
```lang=c++
BL::Object::modifiers_iterator b_mod;
for (b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
```

Range-based for loops allow us to simplify this to:
```lang=c++
for (BL::Modifier &b_mod : b_ob->modifiers) {
```

In order to support this, a collection (such as `b_ob->modifiers`) must have
a `begin()` and `end()` method, that take no parameters and return an iterator.
The `end` method already exists, but the `begin` method takes the iterator as
argument currently.

This patch adds a new `begin` method that returns the iterator. The old `begin`
method is still available to avoid breaking existing code.

My assumption is that the old `begin` method took the iterator as parameter so
that the iterator is not copied or moved, i.e. its memory address is stable and
the destructor is only called once. I'm not sure if both of these requirements
are really necessary to ensure that the iterators work correctly. To be on the
safe side, I deleted the copy/move constructors/assignment operators.

Since C++17 there is "guaranteed copy elision" which basically allows us to
return a non-copyable and non-movable type from a function. To make that work,
I had to add a new constructor to `CollectionIterator` that calls `begin` on itself.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D10120
2021-01-15 16:35:22 +01:00
Piotr Barejko
340529a845 Fix Cycles build error with OSL 1.12
Differential Revision: https://developer.blender.org/D10118
2021-01-15 15:41:17 +01:00
df96a9c6ea Merge branch 'blender-v2.92-release' 2021-01-15 11:28:15 -03:00
c63442d2f2 Fix T84673: Skin resize operator always using object origin as pivot
The TransData converted to work in Skin Resize had no defined center.

Caused by rB54ee4109143b
2021-01-15 11:24:45 -03:00
cab6d5e94a Merge branch 'blender-v2.92-release' 2021-01-15 08:19:19 -06:00
6c840a2cb9 Fix "Make Instances Real" to work with nodes modifier instances
This commit changes the check at the beginning of the
"Make Instances Real" operator to account for the instances
created by nodes modifiers in the modifier stack.

Differential Revision: https://developer.blender.org/D10059
2021-01-15 08:18:52 -06:00
a51584dc70 Geometry Nodes: transfer corner and point attributes in Point Distribute node
If the mesh has any corner or point attributes (e.g. vertex weights or
uv maps), those attributes will now be available on the generated points
as well.

Other domains can be supported as well. I just did not implement those yet,
because we don't have a use case for them.

Differential Revision: https://developer.blender.org/D10114
2021-01-15 12:00:38 +01:00
04572f0899 Cleanup: spelling 2021-01-15 12:23:50 +11:00
dc59955481 Cleanup: use 'pragma once' 2021-01-15 12:17:11 +11:00
f03752b92f Nla: Rename NlaEvalChannel->valid to domain
For term consistency with usage.

The clarity is more for consistency with the nla domain() processing
function names and the core struct member name it stores the results
in, "valid". The name "domain", which implies a function can operate
on it, seems more natural than "valid", which implies something is
wrong if false.

No functional changes.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9692
2021-01-14 19:27:46 -05:00
10ce2a1016 NLA: Redundant NlaEvalChannel Valid Mask Write
The field will already be properly written to in (anim_sys.c)
nla_eval_domain_action(). It's easier to understand the property's
usage after removing the redundancy.

No functional changes.

Reviewed by: ChrisLend, sybren

Differential Revision: http://developer.blender.org/D9689
2021-01-14 19:04:40 -05:00
32e4ded24b Nla Refactor: is_fcurve_evaluatable()
No functional changes.

Future patches {D8867} {D8296} make use of it.

Reviewed by: sybren, ChrisLend

Differential Revision: http://developer.blender.org/D9691
2021-01-14 18:47:12 -05:00
09709a7e64 Nla Refactor: Split animsys_evaluate_nla()
No intended functional changes.

Refactors animsys_evaluate_nla() into 2 versions:
animsys_evaluate_nla_for_keyframing(), animsys_evaluate_nla_for_flush()
to make it clear what data is being calculated and why.

Dummy strip creation has been refactored to two separate functions,
animsys_create_tweak_strip() and animsys_create_action_track_strip().
Both are evaluated differently from other strips and eachother. There's
no need to interweave them. A future patch D8296, generally requires
both strips.

___

XXX anim_sys.c) nlatrack_find_tweaked() is a temporary work around.
If anyone has any insight into this problem, help is appreciated.

Reviewed by: sybren

Differential Revision: http://developer.blender.org/D9696
2021-01-14 18:25:01 -05:00
b75552ebbb UI: Draw socket type colors on the left in group sockets list
Previously the colors were on the right for outputs, but this is now
unecessary because of the organization in separate panels after
rBb1d1a58c77fb1658.
2021-01-14 16:49:20 -06:00
40d391fa60 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 16:50:14 -05:00
Cody Winchester
7a4bdc3a4f Gpencil Noise - Add noise offset parameter
This patch adds a noise offset option to the grease pencil noise modifier.
It allows the user to animate the noise along the length of the stroke to create movement that is currently not possible.

It works by adding an offset to the noise table and adding the remaining floating point value to the noise table sampling.

Reviewed By: #grease_pencil

Differential Revision: https://developer.blender.org/D10021
2021-01-14 22:25:36 +01:00
Lukas Stockner
0f2ae614a1 Use mmap() IO for reading uncompressed .blends
Instead of submitting tons of tiny IO syscalls, we can speed things up
significantly by `mmap`ing the .blend file into virtual memory and directly
accessing it.

In my local testing, this speeds up loading the Dweebs file with all its
linked files from 19sec to 10sec (on Linux).

As far as I can see, this should be supported on Linux, OSX and BSD.
For Windows, a second code path uses `CreateFileMapping` and
`MapViewOfFile` to achieve the same result.

Reviewed By: mont29, brecht

Differential Revision: https://developer.blender.org/D8246
2021-01-14 22:03:29 +01:00
30dd31a7b3 Fix T81533: NLA Properly Draw FModifiers
When NLA strips weren't time-aligned with the underlying action, then
fcurve modifiers would not be drawn anchored to the strip. Fmodifiers
were evaluating properly, they just weren't drawn with the proper
offset and scale.

To fix it in this specific case, I've chosen to undo the keyframe
remapping then remap the draw-evaluation-time from scene time to
fcurve time. Afterward, I redo the keyframe remapping so the controls
are properly drawn.

The Envelope fmodifier has special drawing code which was fixed too. In
this case, no mapping at all was happening. The solution was similar,
to remap the envelope control points from fcurve time to scene time.
2021-01-14 15:13:26 -05:00
33a558bf21 Geometry Nodes: support accessing UV layers with attribute system
Note that uv layers still can't be accessed with nodes, because those
only access attributes on the point domain currently, while uv data
is stored per corner. Implicit domain conversion hasn't been
implemented yet.
2021-01-14 18:11:44 +01:00
5c1b740f1e Geometry Nodes: add implicit conversions for float2 and others
Some of these conversions are arbitrary to some degree.
However, the user experience is better when at least something
happens when converting between types, instead of just getting
zeros. I left out a few conversions that I wasn't sure about yet.

I also added conversions for float2.
2021-01-14 18:02:59 +01:00
0815e2fdb1 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:37:39 +01:00
406d747695 Fix automated tests when building with GCC and march=native
When building with more aggressive optimization flags, GCC will add FMA
(Fused Multiply Add) instructions that will slightly alter the floating
point operation results.

This causes some automated tests to fail in blender.

In clang and the intel compiler ffp-contract is set to off per default
it seems from my research.  (They do not have the exact same setting,
but the default seems to match the off behavior)

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D9047
2021-01-14 17:32:21 +01:00
9131c697dd Merge branch 'blender-v2.92-release' 2021-01-14 15:55:51 +01:00
e5ee7e9a2d Geometry Nodes: don't delete existing attribute before new attribute is computed
This fixes the behavior of some nodes when the same attribute
name is used for input and output. If both attributes have a
different type, they can't exist at the same time. Therefore,
the input attribute has to be removed in order to create the
output attribute.

Previously, the input attribute was remove before it was used
in any computations. Now, the output is written to a temporary
buffer and only later saved in the geometry component. This
allows both attributes to coexist within the node.

The temporary attribute is only create when necessary. The
normal case without name collisions still works the same
as before.

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

Ref T83793.
2021-01-14 15:52:08 +01:00
8795514384 Merge branch 'blender-v2.92-release' 2021-01-14 15:19:24 +01:00
8ed7ed0255 Geometry Nodes: extract function for adding attributes in distribute node
This shouldn't have any functional changes.
2021-01-14 15:16:20 +01:00
53bd58993e Fix T84167: Saving half-float EXR might result in NaN pixels
Clamp value to the -HALF_MAX .. HALF_MAX.

The non-clamped values were causing NaN and inf values saved to
the file, which was the root cause of glare node giving unexpected
result.

The nan/inf on overflow is something mentioned in the half data
type in OpenEXR header.

Differential Revision: https://developer.blender.org/D10105
2021-01-14 14:54:08 +01:00
3cc7e2ad9d Fix various issues with regions in Asset Browser
Fixes a number of glitches, e.g. the sidebar disappearing when selecting an
asset or wrong AZones (the little chevrons to indicate a hidden region).

There were a couple of issues:
* Execution region was created, but not used.
* If an execution region already existed when refreshing the area, it was
  tagged as hidden, not removed.
* The sidebar was always set to be hidden on refreshes.
* When toggling from Asset Browser to File Browser as regular editor (i.e. not
  opened temporary via Ctrl+O or such), the sidebar region wasn't removed.

Adresses T83644.
2021-01-14 13:45:22 +01:00
Sebastian Parborg
74f6b81c12 Tests: skip OSL render tests in build without OSL
Differential Revision: https://developer.blender.org/D9990
2021-01-14 13:14:43 +01:00
4e90266fd8 Tests: enable bake and shader raytracing tests for OptiX
These are now supported and so can be tested.

Also refactor the code a bit to move Cycles specific blacklist out of generic
render test code.
2021-01-14 13:14:43 +01:00
6704372f04 GPencil: Allow small resolution for Fill tool
Now the resolution can be reduced to get less details. This is very useful for doing storyboards to get a quick fill of any character.

Following UI review, the name "Resolution" has been changed to "Precision" because is more clear.

Differential Revision: https://developer.blender.org/D10076
2021-01-14 12:57:17 +01:00
10423d462a Geometry Nodes: output color from Attribute Color Ramp node
The other output types did not work currently anyway.
There is not a significant benefit in somehow deducing the output
attribute type from the existing attribute types.
2021-01-14 12:44:37 +01:00
6f28c199b3 Cleanup: ed_undo: naming of parameters, const, etc.
No behavrioral change expected here.
2021-01-14 12:02:51 +01:00
a0029a678f Cleanup/refactor: Remove logically broken code from GPencil undo.
`ED_undo_gpencil_step` only support valid undo step direction, passing
step name here is useless and only add confusion to what works or not.

Undo by step name or step index is fully not supported by GPencil undo
mode currently.

Note that since GPencil undo mode does not seem to ever be used anyway,
this is not an urgent issue in practice, but this needs to be cleaned up
at some point. See also T84703.
2021-01-14 12:02:51 +01:00
8cdd701b45 Merge remote-tracking branch 'origin/blender-v2.92-release' 2021-01-14 11:42:22 +01:00
442b6e5e09 MeshCache: add error handling to fread() calls
Handle return value of `fread()`, by showing an error message when the
file cannot be read from and stopping further processing. Not only is
error handing a good idea, it also prevents GCC from warning that the
return value of `fread()` should not be ignored.

This is similar to {D9916}.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D10079
2021-01-14 11:38:14 +01:00
9e038a2c6b Tracking: Make transform cancel use explicit frame number
Before transform cancel will request marker at a current frame number
and restore transform flags to it. This worked fine if there was only
one marker from track in the transform data. This did not work correct
when multiple markers from track were added to transform data.

This allows to implement proportional editing in the clip editor.
2021-01-14 11:37:36 +01:00
4b1112c8c9 Tracking: Fix wrong projection for post-draw pass
Allows to draw proportional editing circle at a proper location.
2021-01-14 11:37:36 +01:00
5cf87b4a8e Tracking: Re-duplicate logic used to count and initialize data
Allows to easily implement more comprehensive checks about which
markers get added to the transformation context.

No user measurable changes are expected, purely house-keeping to
ease an upcoming development.
2021-01-14 11:37:36 +01:00
ab536824a6 Tracking: Simplify transform code
Reduce amount of duplicated pointer offset logic: advance transform
data pointers deep in the loop rather than have offset duplicated in
the outer loop.

Array size calculation still has duplicated, but that is another story.
2021-01-14 11:37:36 +01:00
4b0871af87 Bmesh: Deprecate deform parameter of from_object()
The deform parameter of the Bmesh from_object method is deprecated,
always assumed to be True, and will be removed in version 3.0.

That is because the cases where it is False don't work correctly and are
subject to memory leaks. One of the symptoms of the incorrect behavior
is the application of constructive modifiers twice if the input object
is an evaluated one, as demonstrated in D10053.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10086
2021-01-14 12:20:46 +02:00
Cody Winchester
3191b76eb5 GPencil: Noise Modifier - Move noise seed value outside of randomize subpanel
Currently the grease pencil noise modifier seed value is under the randomize subpanel.

Moved the seed value outside of this panel because it doesn't only change the noise when using the randomize option. Moving the seed value prevents it from being hidden/greyed out so the user can manually keyframe it to control the noise animation.

Reviewed By: #grease_pencil, antoniov

Differential Revision: https://developer.blender.org/D10020
2021-01-14 11:10:33 +01:00
024ac9c089 Fix T84549: Keymap presets written without repeat enabled
Key map items using TEXTINPUT didn't include the repeat setting.
2021-01-14 20:52:36 +11:00
e7c36ce43c GPencil: Disable Multiframe edition when play animation
When the multiframe is enabled, playing animation must be disabled or the animation is not visible,

{F9527854}

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D9930
2021-01-14 10:44:45 +01:00
3e4dd7b000 Merge branch 'blender-v2.92-release' 2021-01-14 15:55:34 +11:00
a4226a050b Fix T64518: Blender 2.7 keymap inconsistencies
- Add missing Shift-Space for toggle maximize area.
- Add missing Alt-F10 for toggle fullscreen area.
- Match 2.7x keymap for setting the pivot center.
2021-01-14 15:53:06 +11:00
646f1cc89a Merge branch 'blender-v2.92-release' 2021-01-14 11:50:55 +11:00
f64746177f Fix add-object tool snap placement when activated from tweak event
When activating add-object from from a tweak event (default keymap),
the snap gizmo could snap to a new location while dragging.

Workaround this by re-calculating the snap position where the tweak
event starts.

Reported T57210#1077747
2021-01-14 11:50:08 +11:00
0876829e7a Merge branch 'blender-v2.92-release' 2021-01-14 10:58:19 +11:00
5804bf25bd Fix uninitialized stack memory use accessing the snap normal
Using the add-object tool, snapping to object types such as
curve, armature ... etc, copied uninitialized stack memory.
2021-01-14 10:55:49 +11:00
c13383da41 Cleanup: use enum for undo step direction
The step direction was confusingly 1 for undo, -1 for redo.
This convention is from 2004 (562d6958cb).

Use enum for ed_undo.c for better readability.
2021-01-14 09:53:38 +11:00
01b9dfeab4 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:41:14 +01:00
73169628a1 Fix T84684: Undo operators not working
Mistake in 2771dfd563. The commit left the new editors operator registration
in `ed_util_ops.c`, but removed the function call to it.
In other words, the ED-utils operators were not registered.
2021-01-13 23:39:04 +01:00
b6aa8daf49 Fix T84645 cursor moves when clicking selector.
The absolute position desktop mapping has been corrected. The correct
mapping is 0-65535 inclusive. Additionally, division by the virtual
desktop width and height needed to be subtracted by 1 as width and
height are one more than the final pixel index.
2021-01-13 14:07:49 -08:00
c4c2c4bdb8 Merge branch 'blender-v2.92-release' 2021-01-13 14:33:53 -06:00
cf9709fd1e Fix T84686: Node vector socket default values not animate-able
{rB1d3b92bdeabc} disabled animating other properties of the socket default
values, like the "min" and "max" properties, as well as the "default_value"
of the "default_value". That naming confusion lead to the commit
inadvertently removing animation for the vector socket in RNA.

I checked that the other socket types don't have the same issue.
2021-01-13 14:33:28 -06:00
21b9231d7f Transform: geodesic distances for proportional edit connected mode
Use approximate geodesic distance computatiom that crosses through triangles
rather than only along edges. Using only edges would give artifacts already
on a simple grid.

Fixes T78752, T35590, T43393, T53602

Differential Revision: https://developer.blender.org/D10068
2021-01-13 18:24:33 +01:00
00b2c7c5cc Merge branch 'blender-v2.92-release' 2021-01-13 11:21:09 -06:00
9dab489d51 Bump file subversion after recent node versioning commit 2021-01-13 11:16:11 -06:00
08ee5573a9 Fix Python warnings in node editor after revert of datablock changes
Revert was done in 2771dfd, ref T84669
2021-01-13 18:06:39 +01:00
09fe0e8aa9 Nodes: use green color again for shader sockets and shader category
The green is still distinct from the more turquoise use for geometry, and
they are never used in the same node graph. The use of red makes sense, but
would need changes to other sockets and categories to set it apart well.

Ref T82689
2021-01-13 18:00:14 +01:00
d08ec3120f Revert "2.92 splashscreen"
This reverts commit 5d826866a3.
2021-01-13 17:49:28 +01:00
84c08748d8 Revert "Blender 2.92 beta - bcon3"
This reverts commit cfc9b95abd.
2021-01-13 17:49:24 +01:00
a60e270efb Merge branch 'blender-v2.92-release' 2021-01-13 17:49:08 +01:00
8ad305382e Blender 2.93 bcon1 - alpha
Bump the version number for the new release cycle.
2021-01-13 17:33:27 +01:00
5d826866a3 2.92 splashscreen
Credit: Joanna Kobierska - artstation.com/joanna_kobierska
2021-01-13 17:33:22 +01:00
cfc9b95abd Blender 2.92 beta - bcon3
Bump the release cycle to beta. This also hides away the experimental features
from the user interface.
2021-01-13 17:33:22 +01:00
1f4c1c5fc7 Geometry Nodes: Add "Point Translate" and "Point Scale" nodes
The translate node moves every point in the geometry, and the scale
node multiplies the "scale" attribute of the input geometry by its input.
While these operations are already possible with the "Attribute" nodes,
these new nodes fit nicely with the nodes specifically for changing the
"rotation" attribute that already exist, and they provide a simpler way
to do the same thing.

Differential Revision: https://developer.blender.org/D10100
2021-01-13 10:32:06 -06:00
bae4d00e2a UI: Use gray color for float sockets in nodes
The shade is too close to RGBA sockets.

Related to T82689
2021-01-13 17:17:54 +01:00
7d749720ad UI: Use capital letters for X Y and Z axes
Also add another comma and use plural "axes".
2021-01-13 10:13:00 -06:00
8df0268e2b Geometry Nodes: Rename "Rotate Points" to "Point Rotate"
This is consistent with the other node names, giving (almost) all of the
nodes in the "Point" category the same prefix.
2021-01-13 10:10:25 -06:00
80578a9d54 Geometry Nodes: Rename boolean input sockets
"Geometry A" becomes "Geometry 1", just to be more consistent
with other nodes.
2021-01-13 10:00:20 -06:00
2771dfd563 UI: Revert design changes to data-block selector for the 2.92 release
Partially reverts 2250b5cefe.

Removing the user count and fake user count icons was controversial (which was
expected) and there are a few further changes needed, that won't make it in
time for the release, see D9946.
While there is a design to bring back the user count and fake user indicators,
a new design idea was proposed that the UI team wants to follow. This came too
late for the 2.92 release, the new design is targeted at the 2.93 release now.
Meanwhile, UI team decision was to simply revert the design changes.

The new design is being worked on in https://developer.blender.org/T84669.

Note that this commit does not revert some internal changes done in
2250b5cefe. Namely the introduction of `ed_util_ops.c` and data-block
operators in there. These will still be needed in the new design.
2021-01-13 15:31:02 +01:00
ad4202a14f Cleanup: Remove unecessary namespace prefixes 2021-01-13 08:29:03 -06:00
89f490932f Geometry Nodes: Enable exposing object and collection sockets
This patch allows connecting wires for object and collection socket
types to the "Group Input" node, which exposes them to be adjusted
in the modifier.

Thanks to @angavrilov's recent work in rB8964c02348f6, it is now
possible to edit pointer IDProperties in the interface when they are
drawn with `uiItemPointerR`.

This patch is composed of a few changes:
  - Add code to create pointer properties in the modifier settings for
    object and collection sockets, and also to draw them in the UI.
  - Also search through the modifier's `IDProperty` settings to find IDs
    used by the modifier.
  - Change the setting's UI layout to support the change.

Differential Revision: https://developer.blender.org/D10056
2021-01-13 08:13:57 -06:00
Eric Bickle
55c56f1ffb Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 14:42:05 +01:00
5f411f7f38 Revert "Fix T79356: Improved icons for MSIX builds"
This reverts commit 78011d712d.
2021-01-13 14:31:52 +01:00
Eric Bickle
78011d712d Fix T79356: Improved icons for MSIX builds
Fixed an issue that was causing the app icon to render with a
'plated' background color in the taskbar and other areas of Windows.

Updated all app icons in Microsoft Store package to match Microsoft's
design recommendations.

Added multiple scales for app icons for high resolution displays.

Added high contrast app icons.

Reviewed By: pablovazquez, jmonteath

Maniphest Tasks: T79356

Differential Revision: https://developer.blender.org/D9681
2021-01-13 13:32:00 +01:00
d985751324 Geometry Nodes: improve Point Distribute node
This greatly simplifies the Point Distribute node. For a poisson disk
distribution, it now uses a simpler dart throwing variant. This results
in a slightly lower quality poisson disk distribution, but it still
fulfills our requirements: have a max density, minimum distance input
and stability while painting the density attribute.

This new implementation has a number of benefits over the old one:
* Much less and more readable code.
* Easier to extend with other distribution algorithms.
* Easier to transfer more attributes to the generated points later on.
* More predictable output when changing the max density and min distance.
* Works in 3d, so no projection on the xy plane is necessary.

This is related to T84640.

Differential Revision: https://developer.blender.org/D10104
2021-01-13 12:44:17 +01:00
ed1042ee06 Geometry Nodes: cleanup attribute usage
Now that typed attribute wrappers don't need to own the
attribute anymore, many `std::move` calls can be removed.
2021-01-13 12:27:38 +01:00
76fd41e9db Depsgraph: Remove redundant copy-on-write operations
This change removes copy-on-write operations from ID nodes which do not
need copy-on-write.

Should be no functional changes, as before the copy-on-write operation
would do nothing for those nodes anyway.
2021-01-13 12:13:35 +01:00
0f95f51361 Fix T83411: Crash when using a workspace/layout data path in a driver
Building IDs which are not covered by copy-on-write process was not
implemented, which was causing parameters block not present, and, hence
causing crashes in areas which expected parameters to present.

First part of this change is related on making it so Copy-on-Write is
optional for ID nodes in the dependency graph.

Second part is related on using a generic builder for all ID types
which were not covered by Copy-on-Write before.

The final part is related on making it so build_id() is properly
handling ParticleSettings and Grease Pencil Data. Before they were not
covered there at all, and they need special handling because they do
have own build functions.

Not sure it worth trying to split those parts, as they are related to
each other and are not really possible to be tested standalone. Open
for a second opinion though.

Possible nut-tightening is to re-organize build_id() function so
that every branch does return and have an assert at the end, so that
missing ID type in the switch statement is easier to spot even when
using compilers which do not report missing switch cases.

As for question "why not use default" the answer is: to make it more
explicit and clear what is a decision when adding new ID types. We do
not want to quietly fall-back to a non-copy-on-write case for a newly
added ID types.

Differential Revision: https://developer.blender.org/D10075
2021-01-13 12:13:34 +01:00
2cd091e9c7 Fix Cycles not taking into account CYCLES_SHADER_PATH for finding stdcycles.h
Contributed by howetuft.

Differential Revision: https://developer.blender.org/D9973
2021-01-13 12:12:36 +01:00
Jesse Y
dc170a6d67 Fix: popout windows are sized incorrectly on high DPI screens
There should be a conversion to native pixel size as expected by GHOST at the
window manager level, the dimensions at screen level do not need a conversion.

Differential Revision: https://developer.blender.org/D9976
2021-01-13 12:12:36 +01:00
8964c02348 RNA: allow editing pointer IDProperty values from the UI.
Currently it is not possible to edit bare IDProperty pointer
values which are not explicitly defined through python via
UI fields. This is likely mostly because, unlike numeric values,
pointers aren't marked PROP_EDITABLE by default. However there
are also some bugs in the RNA code that need fixing.

The Geometry Nodes modifier uses bare properties to store
input settings for the node group it wraps, so supporting
Object and Collection sockets requires editable pointers.

This patch marks bare IDProperties editable, and ensures
that changing ID pointers rebuilds the dependency graph.
A type check is needed because an IDPROPERTY PointerPropertyRNA
can actually wrap a group value rather than an ID pointer.

Making pointers editable is not likely to accidentally
affect UI fields that were not intended to be editable,
because a simple `layout.prop` cannot determine which
datablocks to display in the menu and remains read-only.

The PROP_NEVER_UNLINK flag is also removed: it seems it
was added because the edit field that couldn't produce
a menu to set the pointer used to still display the unlink
button, but that seems not to be the case anymore.

Actual support for Object & Collection inputs in the modifier
is added in D10056, which can be used to test this code.

Differential Revision: https://developer.blender.org/D10098
2021-01-13 14:09:31 +03:00
8185d07ace RNA: fix a crash when setting bare IDProperty pointers.
The rna_idproperty_check call should be done before accessing
the prop pointer so that it can detect IDProperty values and
replace them with the actual PointerPropertyRNA object.

Ref D10098
2021-01-13 14:09:31 +03:00
38df935c09 Fix T84646: Compositor: In Blender 292 "Set Alpha" node is undefined
Incorrect version code introduced by 9dbea1db66 would not check inside
node groups.
2021-01-13 12:07:26 +01:00
aed5b88ec1 Asset System: Disable Asset Browser as experimental feature
The Asset Browser will be disabled and not available for the 2.92 release. In
alpha/beta builds, there will be an "Asset Browser" option under Preferences >
Experimental, if the developer extras are enabled.
Note that this also disables related UI elements (e.g. "Mark Asset" buttons,
Preferences settings for asset libraries, etc.).

The code is still in master of course, development and testing will continue
there. But there simply needs to be too much polishing and fixing before the
2.92 release, plus there are some design decisions to be reevaluated.

Check the milestone 1 project to follow ongoing work:
https://developer.blender.org/project/view/124/
2021-01-13 11:10:17 +01:00
Robert Guetzkow
27b78c9c94 Compositor: "Save as Render" for the file output node
This commit adds the "Save as Render" feature to the file output node,
that allows to disable the application of the configured view transform
and other color management settings on the image. If disable it uses
the standard view transform instead. This feature was originally
suggested in T83842 and is part of the color management improvements
task in T68926. With this feature it is possible to toggle the
application of the color management settings for each input socket
of the File Output node individually.

Reviewed By: brecht

Maniphest Tasks: T68926, T83842

Differential Revision: https://developer.blender.org/D9921
2021-01-13 11:04:02 +01:00
614bd239f8 Geometry Nodes: support optional ownership for typed attributes
This will simplify some code in an upcoming commit and will be
useful for T83793.
2021-01-13 10:48:39 +01:00
7b68d0679e Cleanup: rename enum for event value items
This contains all value items (with overlapping values),
name this to make it clear it contains all items.
2021-01-13 19:58:57 +11:00
7af8271c34 Fix WM_event_print error printing tweak events value 2021-01-13 19:56:49 +11:00
ba44919601 Fix Event.value RNA access with tweak event types
Accessing event.value would return unrelated values such as
PRESS, RELEASE, CLICK... etc. instead of NORTH, SOUTH... etc.
2021-01-13 19:56:40 +11:00
0b711e6758 Fluid: Updated Mantaflow source files
Includes minor fixes / cleanups from the viscosity plugin.
2021-01-13 09:49:38 +01:00
3f7c294a95 Mix modifiers test after commit to bevel modifier defaults
{rB6b5e4ad5899d} neglected to update the modifier tests to reflect
the fact that the default limit method is no longer "NONE".
2021-01-12 23:54:46 -06:00
97a6b3ceee Cleanup: use single quotes for enum literals 2021-01-13 16:41:12 +11:00
37c5552742 Fix memory leak with image drag and drop
Dragging an image from the file selector into the sequencer
was leaking memory.

Regression in b5d778a7d4.
2021-01-13 16:23:14 +11:00
Philipp Oeser
5d99199880 Fix T83084: Smart UV Project inverts the resulting UVs
Caused by 850234c1b1,

Flip the normal to avoid flipped projection.
2021-01-13 13:37:14 +11:00
92826a921c Cleanup: spelling 2021-01-13 13:21:29 +11:00
bc58425862 Cleanup: clang-format, trailing space 2021-01-13 13:15:22 +11:00
b9e02eace6 UI: Clarify the property name of "F-Curve Visibility"
"F-Curve Visibility" is a bad UI label for a property that only affects
the display of unselected F-Curves. This commit clarifies the property
name by making it more specific with the word "Unselected", and by using
the word "Opacity". "F-Curve" is redundant in the UI label anyway because
it is included in the panel title.

Resolves T82587

Differential Revision: https://developer.blender.org/D10027
2021-01-12 19:14:57 -06:00
6b5e4ad589 Bevel Modifier: Use angle limit method by default
This right click select post outlines the reasons to make "Angle" the
default limit method: https://blender.community/c/rightclickselect/BVfbbc/
In short: Beveling every single edge rather than just sharp edges is
rarely the desired behavior, and the placement of the property in the UI
makes it easy to see the property's importance and toggle it.

Differential Revision: https://developer.blender.org/D8961
2021-01-12 18:55:27 -06:00
719bea0d6d Geometry Nodes: Output the most complex attribute data type
In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.

Such a function already exists, `attribute_data_type_highest_complexity`,
it just needs to be used in a few more places. The change for the attribute
compare node is just so the code there uses the same code style as in the
attribute mix node.

Addresses part of T83793
Differential Revision: https://developer.blender.org/D10099
2021-01-12 14:03:35 -06:00
Aaron Carlisle
6c15b70279 UI: Update Clip Tracking menus
- Add operators that previously could only be found in panels
- Re order menus to match other menus
- Organize Code

|Before|After|
|{F9493583}|{F9493584}|
|{F9493585}|{F9493586}|
|{F9493588}|{F9493590}|
|{F9493591}|{F9493592}|

Reviewed By: sergey, sebastian_k, #motion_tracking

Differential Revision: https://developer.blender.org/D9781
2021-01-12 14:45:20 -05:00
bf5d45fd99 Cleanup: Fix incorrect function name
The function used "domain" incorrectly where it meant "data type".
2021-01-12 11:47:51 -06:00
abbc43e4e4 Fix T84397: Creating and removing many objects very quickly causes a crash
The root of the issue was caused by the dependency graph using ID pointer
to map evaluated state from old depsgraph to new one upon relations update.
This was failing when IDs were re-allocated rapidly: was possible that
Object ID's evaluated state assigned to Mesh and vice versa.

Now depsgraph uses Session UUID to identify which IDs to restore evaluated
state to. The session UUID is stored in the IDNode, so that id_orig is not
dereferenced on depsgraph update since the ID might be freed.

The root of the issue is identified by Campbell, original patch was done
by Bastien, thanks! Also thanks to Oliver and Ray and everyone else for
testing!
2021-01-12 17:16:48 +01:00
957e292c58 Fix T64953: Add cryptomatte meta data to file output node.
This change will try to add meta data when using a multilayered open
exr file output node in the compositor. It adds the current scene meta
data and converts existing cryptomatte keys so it follows the
naming that is configured in the file output node.

This change supports the basic use-case where the compositor is
used to output cryptomatte layers with a different naming scheme to
support external compositors. In this case the Multilayered OpenEXR
files are used and the meta data is read from the render result.

Meta data is found when render layer node is connected with the
file output node without any other nodes in between. Redirects and empty
node groups are allowed.

The patch has been verified to work with external compositors.
See https://devtalk.blender.org/t/making-sense-of-cryptomatte-usage-in-third-party-programs/16576/17

See patch for example files.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D10016
2021-01-12 16:24:26 +01:00
c3b68fa7b1 Fix T81965: Library-Override Not able to edit Keyframe properties
Fix keyframe properties not being editable when animating a
library-overridden datablock.

The problem was that RNA pointers were created based on the datablock
affected by the animation (for example an Object), instead of the
datablock that contains the FCurve itself (the Action). The latter can
be local to the current blend file and should thus be editable, even
when the former is not.

Reviewed By: mont29

Maniphest Tasks: T81965

Differential Revision: https://developer.blender.org/D10091
2021-01-12 15:43:42 +01:00
c96d596f43 GPU: Remove Limited Support AMD Polaris
Removing the limited support message as the known opengl issues of the
recent drivers with polaris cards have been tackled.
2021-01-12 13:54:50 +01:00
b2ad52a763 Tests: skip unit test if built without ocean sim modifier
Disable the Ocean Sim test when building with `WITH_MOD_OCEANSIM=OFF`.
2021-01-12 13:50:29 +01:00
e0a4b392f3 Cleanup: use exact check for fread, move out of the loop
Without this, additional items could be added in the future
which wouldn't be included in the check.

Move the check out of the loop since this is such an unlikely
situation that checking every iteration isn't needed.

Also remove redundant casts.
2021-01-12 23:31:34 +11:00
28b17ef0e6 Cleanup: replace 'long long' with int64_t in imbuf indexer 2021-01-12 23:31:34 +11:00
3b77bd48f9 Geometry Nodes: new Align Rotation to Vector node
This adds a new Align Rotation to Vector node based on the mockup
in T83669.

Reviewers: HooglyBoogly, simonthommes

Differential Revision: https://developer.blender.org/D10081
2021-01-12 12:55:14 +01:00
3a254b93fd Geometry Nodes: support reading from spans of WriteAttribute
Previously, the span returned by `WriteAttribute`s might not contain the
current value of the attribute for performance reasons. To avoid some
bugs, the span now always contains the old values (they might have to
be copied over from the internal storage, dependending on how the
attribute is stored).
The old behavior is still available with the `get_span_for_write_only`
method. The span that it returns might not contain the current
attribute values. Therefore, it should only be used when you want
to overwrite an attribute without looking at the old values.
2021-01-12 12:50:29 +01:00
58dae919e5 Weight Paint: avoid creating very small values with locked weights.
When painting using Auto-Normalize or Lock Relative with some
groups locked, the locked weights may not add up precisely to
1 because of precision limitations, which results in creating
nonzero weights close to FLT_EPSILON. With Lock Relative display
mode this is very obvious and annoying (random red points amid
black or blue), so add an epsilon check to consider less than
1e-6 unlocked weight to be the same as 0.

In addition, in cases when no weight can be painted due to locks,
don't create vertex group entries at all if they don't exist yet.
Also, don't run Auto Normalize when not painting a deform group.

Differential Revision: https://developer.blender.org/D10000
2021-01-12 14:32:05 +03:00
Robert Guetzkow
f5c0ef52cf Fix T84588: Cache access in rna_Particle_uv_on_emitter
The function `rna_Particle_uv_on_emitter` did not handle the case where
`particle->num_dmcache` was `DMCACHE_ISCHILD`. This resulted in an
incorrect offset for the `mtface` pointer. The commit checks for the
case and sets the offset accordingly, similar to existing code in
e.g. `particle_calculate_parent_uvs`.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D10072
2021-01-12 12:14:34 +01:00
c56da67716 Fix: Bmesh from_object applies modifiers twice
The Bmesh from_object method applies modifiers twice when the input
deform is enabled and the input depsgraph is a render one.

The evaluated object already have modifiers applied, and
mesh_create_eval_final() applies modifiers again. To fix this, the
BKE_mesh_new_from_object() function is used instead.

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D10053
2021-01-12 13:07:12 +02:00
26fd55fad1 UndoSys: Refactor step 1: cleanup and simplify logic in main undo/redo handlers.
* Simplify and clarify logic in `BKE_undosys_step_undo/redo_with_data_ex`,
  by adding early return on invalid situations, renaming some variables,
  and adding comments.
* Add more sanity checks in those functions.

No behavioral change are expected here, besides in potential edge-case,
invalid situations.

This is a preliminary change, before some deeper modifications of
`BKE_undosys` undo/redo API.

Differential Revision: https://developer.blender.org/D10033
2021-01-12 11:58:14 +01:00
1dc9650d20 Cycles: upgrade to OptiX SDK version 7.1 on buildbot
This means that NVIDIA driver version 450 or newer is now required for Cycles
OptiX rendering. This upgrade is required to take advantage of new features and
improvements.

Ref T81431
2021-01-12 11:51:42 +01:00
89ae4a7a2a Fix NLA liboverride issues re tracks handling.
From original rBc0bd240ad0a1 commit, issues reported with suggested
fixes by Wayde Moss (@GuiltyGhost), thx.
2021-01-12 11:32:17 +01:00
Oliver Weissbarth
401279253e Fix T84515: Status bar is reporting the average solve error of the wrong tracking object
Reviewed By: sergey

Maniphest Tasks: T84515

Differential Revision: https://developer.blender.org/D10047
2021-01-12 11:02:12 +01:00
Janusch Patas
2a23addf52 Fix T83122: NURBS Extruding multiple points only moves existing points
The Surface -> Nurbs Curve behaves now like the Curve -> Nurbs Curve,
if you initially select less than all points. So, multiple points can
be selected and extruded which just moves the selected points similar
to Curve -> Nurbs Curve object.

Differential Revision: https://developer.blender.org/D9934
2021-01-12 10:56:51 +01:00
ff51afb194 Fix T84593: Operators on material (linked to local object but with
linked obdata) fail

Caused by rB1a650fdcb286.

Above commit made polling more restricitive in that it did not allow for
actions on material slots (linked to object, not object data) on objects
with liked object data. This should be allowed though.

Maniphest Tasks: T84593

https://developer.blender.org/D10078
2021-01-12 10:03:48 +01:00
55059af01d Fix T84455: Circle select tool cursor draws in overlapping regions 2021-01-12 14:19:32 +11:00
Rahul Chaudhary
acbda123ad UI: Icon for Multires Displacement Smear Tool
This commit adds the icon for the new tool.
2021-01-11 15:30:26 -06:00
b9b59aa6de UI: Update geometry icon files
None of these changes should be visible, but the files were somehow
out of sync with the blend file, so they need to be updated to reflect
those changes.
2021-01-11 15:29:20 -06:00
Lukas Stockner
688e5c6d38 Fix T82351: Cycles: Tile stealing glitches with adaptive sampling
In my testing this works, but it requires me to remove the min(start_sample...) part in the
adaptive sampling kernel, and I assume there's a reason why it was there?

Reviewed By: brecht

Maniphest Tasks: T82351

Differential Revision: https://developer.blender.org/D9445
2021-01-11 21:04:49 +01:00
b70f4a265a Fix T84496: Cycles: Tile stealing does not work with NLM
Reviewed By: brecht

Maniphest Tasks: T84496

Differential Revision: https://developer.blender.org/D10066
2021-01-11 21:04:49 +01:00
Nicholas Rishel
d5c59913de Fix T81211 Add high frequency mouse input for Windows.
Also send mouse move event instead of moving cursor via SetCursorPos.
SetCursorPos did not reliably move the mouse when it is leaving the
window quickly.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9981
2021-01-11 11:40:21 -08:00
ecdbd83a8d Geometry Nodes: Attribute Vector Math Node
This patch implements the same operations and interface as the regular
vector math node, but it runs for every element of the attribute. This
should expand what's possible with geometry nodes quite a bit.

Differential Revision: https://developer.blender.org/D9914
2021-01-11 12:06:52 -06:00
5bd822dc46 Geometry Nodes Point Distribution: Align points to face normals
This patch makes the point distribute node write to the "rotation"
attribute with the normal of each face at each distributed point.
The "normal" attribute is also created with the triangle normal
at each point.

The conversion from the triangle normal to an Euler rotation is somewhat
arbitrary, since we only have one direction vector. For a more flexible
rotation for each point, the "Align Rotation to Vector" node can be used
in the future.

Differential Revision: https://developer.blender.org/D9965
2021-01-11 11:42:16 -06:00
2a8b987e9e Fix T83422: Dimensions incorrect after undoing if it has modified geometry.
Root of the issue is that `BKE_object_eval_boundbox` (that ports back
evaluated bbox to orig object during active depsgraph evaluation) is
only called when object's geometry actually is evaluated.

However, with new undo, often Object itself can be changed by undo,
without requiring its geometry to be re-evaluated, which was leading to
the evaluated bbox not being copied back into orig object anymore.

Fixing that by moving bbox copying-to-orig code into
`BKE_object_sync_to_original` instead, which is always executed when
object is evaluated (as hinted by the comment above
`BKE_object_eval_boundbox` actually).

Also allows to cleanup code for armature eval, apparently.

Maniphest Tasks: T83422

Differential Revision: https://developer.blender.org/D9789
2021-01-11 17:59:21 +01:00
439 changed files with 8246 additions and 5174 deletions

View File

@@ -42,7 +42,7 @@ def get_cmake_options(builder):
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK')
optix_sdk_dir = os.path.join(builder.blender_dir, '..', '..', 'NVIDIA-Optix-SDK-7.1')
options.append('-DOPTIX_ROOT_DIR:PATH=' + optix_sdk_dir)
# Workaround to build sm_30 kernels with CUDA 10, since CUDA 11 no longer supports that architecture

View File

@@ -1231,7 +1231,7 @@ function(find_python_package
set(WITH_PYTHON_INSTALL_${_upper_package} OFF PARENT_SCOPE)
else()
message(STATUS "${package} found at '${PYTHON_${_upper_package}_PATH}'")
if(NOT "${relative_include_dir}" STREQUAL "")
set(_relative_include_dir "${package}/${relative_include_dir}")
unset(PYTHON_${_upper_package}_INCLUDE_DIRS CACHE)

View File

@@ -610,7 +610,13 @@ endif()
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
# ffp-contract=off:
# Automatically turned on when building with "-march=native". This is
# explicitly turned off here as it will make floating point math give a bit
# different results. This will lead to automated test failures. So disable
# this until we support it. Seems to default to off in clang and the intel
# compiler.
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off")
# `maybe-uninitialized` is unreliable in release builds, but fine in debug builds.
set(GCC_EXTRA_FLAGS_RELEASE "-Wno-maybe-uninitialized")

View File

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

View File

@@ -170,7 +170,7 @@ struct ApplyMatrix : public KernelBase {
unusedParameter(vecRhs); // Not needed in this matrix application
if (matrixA.size() != 4)
errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Ai = *matrixA[1];
Grid<Real> &Aj = *matrixA[2];
@@ -256,7 +256,7 @@ struct ApplyMatrix2D : public KernelBase {
unusedParameter(vecRhs); // Not needed in this matrix application
if (matrixA.size() != 3)
errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Ai = *matrixA[1];
Grid<Real> &Aj = *matrixA[2];
@@ -338,7 +338,7 @@ struct ApplyMatrixViscosityU : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -348,7 +348,7 @@ struct ApplyMatrixViscosityU : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcV = *vecRhs[0];
Grid<Real> &srcW = *vecRhs[1];
@@ -450,7 +450,7 @@ struct ApplyMatrixViscosityV : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -460,7 +460,7 @@ struct ApplyMatrixViscosityV : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcU = *vecRhs[0];
Grid<Real> &srcW = *vecRhs[1];
@@ -562,7 +562,7 @@ struct ApplyMatrixViscosityW : public KernelBase {
const std::vector<Grid<Real> *> vecRhs) const
{
if (matrixA.size() != 15)
errMsg("ConjugatedGrad: Invalid A matrix in apply matrix step");
errMsg("ConjugateGrad: Invalid A matrix in apply matrix step");
Grid<Real> &A0 = *matrixA[0];
Grid<Real> &Aplusi = *matrixA[1];
Grid<Real> &Aplusj = *matrixA[2];
@@ -572,7 +572,7 @@ struct ApplyMatrixViscosityW : public KernelBase {
Grid<Real> &Aminusk = *matrixA[6];
if (vecRhs.size() != 2)
errMsg("ConjugatedGrad: Invalid rhs vector in apply matrix step");
errMsg("ConjugateGrad: Invalid rhs vector in apply matrix step");
Grid<Real> &srcU = *vecRhs[0];
Grid<Real> &srcV = *vecRhs[1];

View File

@@ -139,7 +139,7 @@ struct KnEstimateVolumeFraction : public KernelBase {
{
const Vec3 centre = startCentre + Vec3(i, j, k) * 0.5;
const Real offset = 0.5 * dx;
const int order = 2;
const int order = 1; // is sufficient
Real phi000 = phi.getInterpolatedHi(centre + Vec3(-offset, -offset, -offset), order);
Real phi001 = phi.getInterpolatedHi(centre + Vec3(-offset, -offset, +offset), order);
@@ -1067,10 +1067,8 @@ void solveViscosity(const FlagGrid &flags,
Real viscTop = 0.25 * (viscosity(i, j, k) + viscosity(i, j, k - 1) + viscosity(i, j + 1, k) +
viscosity(i, j + 1, k - 1));
;
Real viscBottom = 0.25 * (viscosity(i, j, k) + viscosity(i, j, k - 1) +
viscosity(i, j - 1, k) + viscosity(i, j - 1, k - 1));
;
Real volTop = exVolLiquid(i, j + 1, k);
Real volBottom = exVolLiquid(i, j, k);
@@ -1224,7 +1222,7 @@ void solveViscosity(const FlagGrid &flags,
uSolution, uRhs, uResidual, uSearch, flags, uTmp, uMatA, uVecRhs);
}
else {
errMsg("2D Matrix application not yet supported in viscosity solver");
errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// CG solver for V
@@ -1249,7 +1247,7 @@ void solveViscosity(const FlagGrid &flags,
vSolution, vRhs, vResidual, vSearch, flags, vTmp, vMatA, vVecRhs);
}
else {
errMsg("2D Matrix application not yet supported in viscosity solver");
errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// CG solver for W
@@ -1274,7 +1272,7 @@ void solveViscosity(const FlagGrid &flags,
wSolution, wRhs, wResidual, wSearch, flags, wTmp, wMatA, wVecRhs);
}
else {
errMsg("2D Matrix application not yet supported in viscosity solver");
errMsg("Viscosity: 2D Matrix application not yet supported in viscosity solver");
}
// Same accuracy for all dimensions
@@ -1308,7 +1306,7 @@ void solveViscosity(const FlagGrid &flags,
wRhs.copyFrom(wSearch);
}
debMsg(
"Viscosity::solveViscosity done. "
"Viscosity: solveViscosity() done. "
"Iterations (u,v,w): ("
<< uGcg->getIterations() << "," << vGcg->getIterations() << "," << wGcg->getIterations()
<< "), "

View File

@@ -379,6 +379,9 @@ endif()
# Subdirectories
if(WITH_CYCLES_BLENDER)
# Not needed to make cycles automated tests pass with -march=native.
# However Blender itself needs this flag.
remove_cc_flag("-ffp-contract=off")
add_definitions(-DWITH_BLENDER_GUARDEDALLOC)
add_subdirectory(blender)
endif()

View File

@@ -1148,7 +1148,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
split = layout.split(factor=0.65)
if ob:
split.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate")
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
if slot:

View File

@@ -1929,18 +1929,19 @@ void CUDADevice::render(DeviceTask &task, RenderTile &rtile, device_vector<WorkT
}
uint step_samples = divide_up(min_blocks * num_threads_per_block, wtile->w * wtile->h);
if (task.adaptive_sampling.use) {
step_samples = task.adaptive_sampling.align_static_samples(step_samples);
}
/* Render all samples. */
int start_sample = rtile.start_sample;
int end_sample = rtile.start_sample + rtile.num_samples;
for (int sample = start_sample; sample < end_sample; sample += step_samples) {
for (int sample = start_sample; sample < end_sample;) {
/* Setup and copy work tile to device. */
wtile->start_sample = sample;
wtile->num_samples = min(step_samples, end_sample - sample);
wtile->num_samples = step_samples;
if (task.adaptive_sampling.use) {
wtile->num_samples = task.adaptive_sampling.align_samples(sample, step_samples);
}
wtile->num_samples = min(wtile->num_samples, end_sample - sample);
work_tiles.copy_to_device();
CUdeviceptr d_work_tiles = (CUdeviceptr)work_tiles.device_pointer;
@@ -1962,7 +1963,8 @@ void CUDADevice::render(DeviceTask &task, RenderTile &rtile, device_vector<WorkT
cuda_assert(cuCtxSynchronize());
/* Update progress. */
rtile.sample = sample + wtile->num_samples;
sample += wtile->num_samples;
rtile.sample = sample;
task.update_progress(&rtile, rtile.w * rtile.h * wtile->num_samples);
if (task.get_cancel()) {

View File

@@ -920,8 +920,7 @@ class CPUDevice : public Device {
ccl_global float *buffer = render_buffer + index * kernel_data.film.pass_stride;
if (buffer[kernel_data.film.pass_sample_count] < 0.0f) {
buffer[kernel_data.film.pass_sample_count] = -buffer[kernel_data.film.pass_sample_count];
float sample_multiplier = tile.sample / max((float)tile.start_sample + 1.0f,
buffer[kernel_data.film.pass_sample_count]);
float sample_multiplier = tile.sample / buffer[kernel_data.film.pass_sample_count];
if (sample_multiplier != 1.0f) {
kernel_adaptive_post_adjust(kg, buffer, sample_multiplier);
}
@@ -952,7 +951,7 @@ class CPUDevice : public Device {
SIMD_SET_FLUSH_TO_ZERO;
for (int sample = start_sample; sample < end_sample; sample++) {
if (task.get_cancel() || task_pool.canceled()) {
if (task.get_cancel() || TaskPool::canceled()) {
if (task.need_finish_queue == false)
break;
}
@@ -997,7 +996,7 @@ class CPUDevice : public Device {
coverage.finalize();
}
if (task.adaptive_sampling.use) {
if (task.adaptive_sampling.use && (tile.stealing_state != RenderTile::WAS_STOLEN)) {
adaptive_sampling_post(tile, kg);
}
}
@@ -1250,7 +1249,7 @@ class CPUDevice : public Device {
void thread_render(DeviceTask &task)
{
if (task_pool.canceled()) {
if (TaskPool::canceled()) {
if (task.need_finish_queue == false)
return;
}
@@ -1320,7 +1319,7 @@ class CPUDevice : public Device {
task.release_tile(tile);
if (task_pool.canceled()) {
if (TaskPool::canceled()) {
if (task.need_finish_queue == false)
break;
}
@@ -1417,7 +1416,7 @@ class CPUDevice : public Device {
task.offset,
sample);
if (task.get_cancel() || task_pool.canceled())
if (task.get_cancel() || TaskPool::canceled())
break;
task.update_progress(NULL);

View File

@@ -760,9 +760,6 @@ class OptiXDevice : public CUDADevice {
const int end_sample = rtile.start_sample + rtile.num_samples;
// Keep this number reasonable to avoid running into TDRs
int step_samples = (info.display_device ? 8 : 32);
if (task.adaptive_sampling.use) {
step_samples = task.adaptive_sampling.align_static_samples(step_samples);
}
// Offset into launch params buffer so that streams use separate data
device_ptr launch_params_ptr = launch_params.device_pointer +
@@ -770,10 +767,14 @@ class OptiXDevice : public CUDADevice {
const CUDAContextScope scope(cuContext);
for (int sample = rtile.start_sample; sample < end_sample; sample += step_samples) {
for (int sample = rtile.start_sample; sample < end_sample;) {
// Copy work tile information to device
wtile.num_samples = min(step_samples, end_sample - sample);
wtile.start_sample = sample;
wtile.num_samples = step_samples;
if (task.adaptive_sampling.use) {
wtile.num_samples = task.adaptive_sampling.align_samples(sample, step_samples);
}
wtile.num_samples = min(wtile.num_samples, end_sample - sample);
device_ptr d_wtile_ptr = launch_params_ptr + offsetof(KernelParams, tile);
check_result_cuda(
cuMemcpyHtoDAsync(d_wtile_ptr, &wtile, sizeof(wtile), cuda_stream[thread_index]));
@@ -815,7 +816,8 @@ class OptiXDevice : public CUDADevice {
check_result_cuda(cuStreamSynchronize(cuda_stream[thread_index]));
// Update current sample, so it is displayed correctly
rtile.sample = wtile.start_sample + wtile.num_samples;
sample += wtile.num_samples;
rtile.sample = sample;
// Update task progress after the kernel completed rendering
task.update_progress(&rtile, wtile.w * wtile.h * wtile.num_samples);

View File

@@ -223,8 +223,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask &task,
subtile.num_samples = samples_per_second;
if (task.adaptive_sampling.use) {
subtile.num_samples = task.adaptive_sampling.align_dynamic_samples(subtile.start_sample,
subtile.num_samples);
subtile.num_samples = task.adaptive_sampling.align_samples(subtile.start_sample,
subtile.num_samples);
}
/* Don't go beyond requested number of samples. */

View File

@@ -144,41 +144,20 @@ AdaptiveSampling::AdaptiveSampling() : use(true), adaptive_step(0), min_samples(
}
/* Render samples in steps that align with the adaptive filtering. */
int AdaptiveSampling::align_static_samples(int samples) const
int AdaptiveSampling::align_samples(int sample, int num_samples) const
{
if (samples > adaptive_step) {
/* Make multiple of adaptive_step. */
while (samples % adaptive_step != 0) {
samples--;
}
int end_sample = sample + num_samples;
/* Round down end sample to the nearest sample that needs filtering. */
end_sample &= ~(adaptive_step - 1);
if (end_sample <= sample) {
/* In order to reach the next sample that needs filtering, we'd need
* to increase num_samples. We don't do that in this function, so
* just keep it as is and don't filter this time around. */
return num_samples;
}
else if (samples < adaptive_step) {
/* Make divisor of adaptive_step. */
while (adaptive_step % samples != 0) {
samples--;
}
}
return max(samples, 1);
}
/* Render samples in steps that align with the adaptive filtering, with the
* suggested number of samples dynamically changing. */
int AdaptiveSampling::align_dynamic_samples(int offset, int samples) const
{
/* Round so that we end up on multiples of adaptive_samples. */
samples += offset;
if (samples > adaptive_step) {
/* Make multiple of adaptive_step. */
while (samples % adaptive_step != 0) {
samples--;
}
}
samples -= offset;
return max(samples, 1);
return end_sample - sample;
}
bool AdaptiveSampling::need_filter(int sample) const

View File

@@ -117,8 +117,7 @@ class AdaptiveSampling {
public:
AdaptiveSampling();
int align_static_samples(int samples) const;
int align_dynamic_samples(int offset, int samples) const;
int align_samples(int sample, int num_samples) const;
bool need_filter(int sample) const;
bool use;

View File

@@ -139,7 +139,7 @@ kernel_cuda_adaptive_scale_samples(WorkTile *tile, int start_sample, int sample,
ccl_global float *buffer = tile->buffer + index * kernel_data.film.pass_stride;
if(buffer[kernel_data.film.pass_sample_count] < 0.0f) {
buffer[kernel_data.film.pass_sample_count] = -buffer[kernel_data.film.pass_sample_count];
float sample_multiplier = sample / max((float)start_sample + 1.0f, buffer[kernel_data.film.pass_sample_count]);
float sample_multiplier = sample / buffer[kernel_data.film.pass_sample_count];
if(sample_multiplier != 1.0f) {
kernel_adaptive_post_adjust(&kg, buffer, sample_multiplier);
}

View File

@@ -27,6 +27,7 @@
#include <OSL/oslclosure.h>
#include <OSL/oslexec.h>
#include <OSL/rendererservices.h>
#ifdef WITH_PTEX
class PtexCache;

View File

@@ -29,8 +29,7 @@ ccl_device void kernel_adaptive_adjust_samples(KernelGlobals *kg)
int sample = kernel_split_params.tile.start_sample + kernel_split_params.tile.num_samples;
if (buffer[kernel_data.film.pass_sample_count] < 0.0f) {
buffer[kernel_data.film.pass_sample_count] = -buffer[kernel_data.film.pass_sample_count];
float sample_multiplier = sample / max((float)kernel_split_params.tile.start_sample + 1.0f,
buffer[kernel_data.film.pass_sample_count]);
float sample_multiplier = sample / buffer[kernel_data.film.pass_sample_count];
if (sample_multiplier != 1.0f) {
kernel_adaptive_post_adjust(kg, buffer, sample_multiplier);
}

View File

@@ -323,7 +323,7 @@ bool OSLShaderManager::osl_compile(const string &inputfile, const string &output
string include_path_arg = string("-I") + shader_path;
options.push_back(include_path_arg);
stdosl_path = path_get("shader/stdcycles.h");
stdosl_path = path_join(shader_path, "stdcycles.h");
/* compile */
OSL::OSLCompiler *compiler = new OSL::OSLCompiler(&OSL::ErrorHandler::default_handler());

View File

@@ -459,13 +459,17 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ
int device_num = device->device_number(tile_device);
while (!tile_manager.next_tile(tile, device_num, tile_types)) {
if (steal_tile(rtile, tile_device, tile_lock)) {
return true;
}
/* Wait for denoising tiles to become available */
if ((tile_types & RenderTile::DENOISE) && !progress.get_cancel() && tile_manager.has_tiles()) {
denoising_cond.wait(tile_lock);
continue;
}
return steal_tile(rtile, tile_device, tile_lock);
return false;
}
/* fill render tile */
@@ -477,6 +481,7 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ
rtile.num_samples = tile_manager.state.num_samples;
rtile.resolution = tile_manager.state.resolution_divider;
rtile.tile_index = tile->index;
rtile.stealing_state = RenderTile::NO_STEALING;
if (tile->state == Tile::DENOISE) {
rtile.task = RenderTile::DENOISE;

View File

@@ -62,7 +62,7 @@ void TaskPool::cancel()
bool TaskPool::canceled()
{
return tbb_group.is_canceling();
return tbb::is_current_task_group_canceling();
}
/* Task Scheduler */

View File

@@ -61,7 +61,7 @@ class TaskPool {
void wait_work(Summary *stats = NULL); /* work and wait until all tasks are done */
void cancel(); /* cancel all tasks and wait until they are no longer executing */
bool canceled(); /* for worker threads, test if canceled */
static bool canceled(); /* For worker threads, test if current task pool canceled. */
protected:
tbb::task_group tbb_group;

View File

@@ -225,6 +225,9 @@ GHOST_SystemWin32::GHOST_SystemWin32()
#ifdef WITH_INPUT_NDOF
m_ndofManager = new GHOST_NDOFManagerWin32(*this);
#endif
getCursorPosition(m_mousePosX, m_mousePosY);
m_mouseTimestamp = ::GetTickCount();
}
GHOST_SystemWin32::~GHOST_SystemWin32()
@@ -533,7 +536,20 @@ GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
{
if (!::GetActiveWindow())
return GHOST_kFailure;
return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
INPUT input;
input.type = INPUT_MOUSE;
input.mi.mouseData = 0;
input.mi.time = ::GetTickCount();
/* Map from virtual screen to 0-65535 inclusive. */
input.mi.dx = (x - GetSystemMetrics(SM_XVIRTUALSCREEN)) * 65535 /
(GetSystemMetrics(SM_CXVIRTUALSCREEN) - 1);
input.mi.dy = (y - GetSystemMetrics(SM_YVIRTUALSCREEN)) * 65535 /
(GetSystemMetrics(SM_CYVIRTUALSCREEN) - 1);
input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK;
SendInput(1, &input, sizeof(input));
return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys &keys) const
@@ -942,8 +958,18 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type,
GHOST_TabletData td = window->m_tabletInRange ? window->getLastTabletData() :
GHOST_TABLET_DATA_NONE;
/* Ensure button click occurs at its intended position. */
processCursorEvent(window);
/* Move mouse to button event position. */
if (!window->m_tabletInRange) {
processCursorEvent(window);
}
else {
/* Tablet should be hadling inbetween mouse moves, only move to event position. */
DWORD msgPos = ::GetMessagePos();
int msgPosX = GET_X_LPARAM(msgPos);
int msgPosY = GET_Y_LPARAM(msgPos);
system->pushEvent(new GHOST_EventCursor(
::GetMessageTime(), GHOST_kEventCursorMove, window, msgPosX, msgPosY, td));
}
window->updateMouseCapture(type == GHOST_kEventButtonDown ? MousePressed : MouseReleased);
return new GHOST_EventButton(system->getMilliSeconds(), type, window, mask, td);
@@ -1101,18 +1127,79 @@ void GHOST_SystemWin32::processPointerEvent(
system->setCursorPosition(pointerInfo[0].pixelLocation.x, pointerInfo[0].pixelLocation.y);
}
GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
void GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
{
/* Cursor moves handled by tablets while active. */
if (window->m_tabletInRange) {
return;
}
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem();
DWORD msgPos = ::GetMessagePos();
GHOST_TInt32 x_screen = GET_X_LPARAM(msgPos);
GHOST_TInt32 y_screen = GET_Y_LPARAM(msgPos);
GHOST_TInt32 x_accum = 0, y_accum = 0;
LONG msgTime = ::GetMessageTime();
if (window->getCursorGrabModeIsWarp() && !window->m_tabletInRange) {
GHOST_TInt32 x_new = x_screen;
GHOST_TInt32 y_new = y_screen;
/* GetMessagePointsEx processes points as 16 bit integers and can fail or return erroneous values
* if negative input is not truncated. */
int msgPosX = GET_X_LPARAM(msgPos) & 0x0000FFFF;
int msgPosY = GET_Y_LPARAM(msgPos) & 0x0000FFFF;
const int maxPoints = 64;
MOUSEMOVEPOINT currentPoint = {msgPosX, msgPosY, (DWORD)msgTime, 0};
MOUSEMOVEPOINT points[maxPoints] = {0};
/* GetMouseMovePointsEx returns the number of points returned that are less than or equal to the
* requested point. If the requested point is the most recent, this returns up to 64 requested
* points. */
int numPoints = ::GetMouseMovePointsEx(
sizeof(MOUSEMOVEPOINT), &currentPoint, points, maxPoints, GMMP_USE_DISPLAY_POINTS);
if (numPoints == -1) {
/* Points at edge of screen are often not in the queue, use the message's point instead. */
numPoints = 1;
points[0] = currentPoint;
}
GHOST_TInt32 x_accum = 0, y_accum = 0;
window->getCursorGrabAccum(x_accum, y_accum);
/* Points are in reverse chronological order. Find least recent, unprocessed mouse move. */
int i;
for (i = 0; i < numPoints; i++) {
if (points[i].time < system->m_mouseTimestamp) {
break;
}
/* GetMouseMovePointsEx returns 16 bit number as 32 bit. If negative, we need to sign extend.
*/
points[i].x = points[i].x > 32767 ? points[i].x | 0xFFFF0000 : points[i].x;
points[i].y = points[i].y > 32767 ? points[i].y | 0xFFFF0000 : points[i].y;
if (points[i].time == system->m_mouseTimestamp && points[i].x == system->m_mousePosX &&
points[i].y == system->m_mousePosY) {
break;
}
}
while (--i >= 0) {
system->pushEvent(new GHOST_EventCursor(system->getMilliSeconds(),
GHOST_kEventCursorMove,
window,
points[i].x + x_accum,
points[i].y + y_accum,
GHOST_TABLET_DATA_NONE));
}
DWORD lastTimestamp = points[0].time;
/* Check if we need to wrap the cursor. */
if (window->getCursorGrabModeIsWarp()) {
/* Wrap based on current cursor position in case Win32 mouse move queue is out of order due to
* prior wrap. */
POINT point;
::GetCursorPos(&point);
GHOST_TInt32 x_current = point.x;
GHOST_TInt32 y_current = point.y;
GHOST_TInt32 x_wrap = point.x;
GHOST_TInt32 y_wrap = point.y;
GHOST_Rect bounds;
/* Fallback to window bounds. */
@@ -1122,23 +1209,24 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
/* Could also clamp to screen bounds wrap with a window outside the view will fail atm.
* Use offset of 8 in case the window is at screen bounds. */
bounds.wrapPoint(x_new, y_new, 2, window->getCursorGrabAxis());
bounds.wrapPoint(x_wrap, y_wrap, 2, window->getCursorGrabAxis());
window->getCursorGrabAccum(x_accum, y_accum);
if (x_new != x_screen || y_new != y_screen) {
system->setCursorPosition(x_new, y_new); /* wrap */
window->setCursorGrabAccum(x_accum + (x_screen - x_new), y_accum + (y_screen - y_new));
if (x_wrap != x_current || y_wrap != y_current) {
system->setCursorPosition(x_wrap, y_wrap);
window->setCursorGrabAccum(x_accum + (x_current - x_wrap), y_accum + (y_current - y_wrap));
/* First message after SendInput wrap is invalid for unknown reasons, skip events until one
* tick after SendInput event time. */
lastTimestamp = ::GetTickCount() + 1;
}
}
GHOST_TabletData td = window->m_tabletInRange ? window->getLastTabletData() :
GHOST_TABLET_DATA_NONE;
return new GHOST_EventCursor(system->getMilliSeconds(),
GHOST_kEventCursorMove,
window,
x_screen + x_accum,
y_screen + y_accum,
td);
system->m_mousePosX = points[0].x;
system->m_mousePosY = points[0].y;
/* Use latest time, checking for overflow. */
if (lastTimestamp > system->m_mouseTimestamp || ::GetTickCount() < system->m_mouseTimestamp) {
system->m_mouseTimestamp = lastTimestamp;
}
}
void GHOST_SystemWin32::processWheelEvent(GHOST_WindowWin32 *window, WPARAM wParam, LPARAM lParam)
@@ -1631,7 +1719,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (!window->m_tabletInRange) {
event = processCursorEvent(window);
processCursorEvent(window);
eventHandled = true;
}
break;
case WM_MOUSEWHEEL: {
@@ -1677,6 +1766,9 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_MOUSELEAVE:
window->m_mousePresent = false;
window->setWintabOverlap(false);
if (!window->m_tabletInRange) {
processCursorEvent(window);
}
break;
////////////////////////////////////////////////////////////////////////
// Mouse events, ignored

View File

@@ -340,9 +340,8 @@ class GHOST_SystemWin32 : public GHOST_System {
/**
* Creates cursor event.
* \param window: The window receiving the event (the active window).
* \return The event created.
*/
static GHOST_EventCursor *processCursorEvent(GHOST_WindowWin32 *window);
static void processCursorEvent(GHOST_WindowWin32 *window);
/**
* Handles a mouse wheel event.
@@ -463,16 +462,23 @@ class GHOST_SystemWin32 : public GHOST_System {
__int64 m_lfstart;
/** AltGr on current keyboard layout. */
bool m_hasAltGr;
/** language identifier. */
/** Language identifier. */
WORD m_langId;
/** stores keyboard layout. */
/** Stores keyboard layout. */
HKL m_keylayout;
/** Console status */
/** Console status. */
int m_consoleStatus;
/** Wheel delta accumulator */
/** Wheel delta accumulator. */
int m_wheelDeltaAccum;
/** Last mouse x position. */
int m_mousePosX;
/** Last mouse y position. */
int m_mousePosY;
/** Last mouse timestamp. */
DWORD m_mouseTimestamp;
};
inline void GHOST_SystemWin32::retrieveModifierKeys(GHOST_ModifierKeys &keys) const

View File

@@ -49,12 +49,6 @@ set(LIB
)
if(WIN32 AND NOT UNIX)
list(APPEND SRC
intern/mmap_win.c
mmap_win.h
)
list(APPEND INC_SYS
${PTHREADS_INC}
)

View File

@@ -1,294 +0,0 @@
/*
* 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.
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*/
/** \file
* \ingroup MEM
*/
#ifdef WIN32
# include <errno.h>
# include <io.h>
# include <stdio.h>
# include <sys/types.h>
# include <windows.h>
# include "mmap_win.h"
# ifndef FILE_MAP_EXECUTE
// not defined in earlier versions of the Platform SDK (before February 2003)
# define FILE_MAP_EXECUTE 0x0020
# endif
/* copied from BLI_utildefines.h, ugh */
# ifdef __GNUC__
# define UNUSED(x) UNUSED_##x __attribute__((__unused__))
# else
# define UNUSED(x) x
# endif
/* --------------------------------------------------------------------- */
/* local storage definitions */
/* --------------------------------------------------------------------- */
/* all memory mapped chunks are put in linked lists */
typedef struct mmapLink {
struct mmapLink *next, *prev;
} mmapLink;
typedef struct mmapListBase {
void *first, *last;
} mmapListBase;
typedef struct MemMap {
struct MemMap *next, *prev;
void *mmap;
HANDLE fhandle;
HANDLE maphandle;
} MemMap;
/* --------------------------------------------------------------------- */
/* local functions */
/* --------------------------------------------------------------------- */
static void mmap_addtail(volatile mmapListBase *listbase, void *vlink);
static void mmap_remlink(volatile mmapListBase *listbase, void *vlink);
static void *mmap_findlink(volatile mmapListBase *listbase, void *ptr);
static int mmap_get_prot_flags(int flags);
static int mmap_get_access_flags(int flags);
/* --------------------------------------------------------------------- */
/* vars */
/* --------------------------------------------------------------------- */
volatile static struct mmapListBase _mmapbase;
volatile static struct mmapListBase *mmapbase = &_mmapbase;
/* --------------------------------------------------------------------- */
/* implementation */
/* --------------------------------------------------------------------- */
/* mmap for windows */
void *mmap(void *UNUSED(start), size_t len, int prot, int flags, int fd, off_t offset)
{
HANDLE fhandle = INVALID_HANDLE_VALUE;
HANDLE maphandle;
int prot_flags = mmap_get_prot_flags(prot);
int access_flags = mmap_get_access_flags(prot);
MemMap *mm = NULL;
void *ptr = NULL;
if (flags & MAP_FIXED) {
return MAP_FAILED;
}
# if 0
if (fd == -1) {
_set_errno(EBADF);
return MAP_FAILED;
}
# endif
if (fd != -1) {
fhandle = (HANDLE)_get_osfhandle(fd);
}
if (fhandle == INVALID_HANDLE_VALUE) {
if (!(flags & MAP_ANONYMOUS)) {
errno = EBADF;
return MAP_FAILED;
}
}
else {
if (!DuplicateHandle(GetCurrentProcess(),
fhandle,
GetCurrentProcess(),
&fhandle,
0,
FALSE,
DUPLICATE_SAME_ACCESS)) {
return MAP_FAILED;
}
}
/* Split 64 bit size into low and high bits. */
DWORD len_bits_high = len >> 32;
DWORD len_bits_low = len & 0xFFFFFFFF;
maphandle = CreateFileMapping(fhandle, NULL, prot_flags, len_bits_high, len_bits_low, NULL);
if (maphandle == 0) {
errno = EBADF;
return MAP_FAILED;
}
ptr = MapViewOfFile(maphandle, access_flags, 0, offset, 0);
if (ptr == NULL) {
DWORD dwLastErr = GetLastError();
if (dwLastErr == ERROR_MAPPED_ALIGNMENT) {
errno = EINVAL;
}
else {
errno = EACCES;
}
CloseHandle(maphandle);
return MAP_FAILED;
}
mm = (MemMap *)malloc(sizeof(MemMap));
if (!mm) {
errno = ENOMEM;
}
mm->fhandle = fhandle;
mm->maphandle = maphandle;
mm->mmap = ptr;
mmap_addtail(mmapbase, mm);
return ptr;
}
/* munmap for windows */
intptr_t munmap(void *ptr, size_t UNUSED(size))
{
MemMap *mm = mmap_findlink(mmapbase, ptr);
if (!mm) {
errno = EINVAL;
return -1;
}
UnmapViewOfFile(mm->mmap);
CloseHandle(mm->maphandle);
CloseHandle(mm->fhandle);
mmap_remlink(mmapbase, mm);
free(mm);
return 0;
}
/* --------------------------------------------------------------------- */
/* local functions */
/* --------------------------------------------------------------------- */
static void mmap_addtail(volatile mmapListBase *listbase, void *vlink)
{
struct mmapLink *link = vlink;
if (link == NULL) {
return;
}
if (listbase == NULL) {
return;
}
link->next = 0;
link->prev = listbase->last;
if (listbase->last) {
((struct mmapLink *)listbase->last)->next = link;
}
if (listbase->first == NULL) {
listbase->first = link;
}
listbase->last = link;
}
static void mmap_remlink(volatile mmapListBase *listbase, void *vlink)
{
struct mmapLink *link = vlink;
if (link == NULL) {
return;
}
if (listbase == NULL) {
return;
}
if (link->next) {
link->next->prev = link->prev;
}
if (link->prev) {
link->prev->next = link->next;
}
if (listbase->last == link) {
listbase->last = link->prev;
}
if (listbase->first == link) {
listbase->first = link->next;
}
}
static void *mmap_findlink(volatile mmapListBase *listbase, void *ptr)
{
MemMap *mm;
if (ptr == NULL) {
return NULL;
}
if (listbase == NULL) {
return NULL;
}
mm = (MemMap *)listbase->first;
while (mm) {
if (mm->mmap == ptr) {
return mm;
}
mm = mm->next;
}
return NULL;
}
static int mmap_get_prot_flags(int flags)
{
int prot = PAGE_NOACCESS;
if ((flags & PROT_READ) == PROT_READ) {
if ((flags & PROT_WRITE) == PROT_WRITE) {
prot = (flags & PROT_EXEC) ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
}
else {
prot = (flags & PROT_EXEC) ? PAGE_EXECUTE_READ : PAGE_READONLY;
}
}
else if ((flags & PROT_WRITE) == PROT_WRITE) {
prot = (flags & PROT_EXEC) ? PAGE_EXECUTE_READ : PAGE_WRITECOPY;
}
else if ((flags & PROT_EXEC) == PROT_EXEC) {
prot = PAGE_EXECUTE_READ;
}
return prot;
}
static int mmap_get_access_flags(int flags)
{
int access = 0;
if ((flags & PROT_READ) == PROT_READ) {
if ((flags & PROT_WRITE) == PROT_WRITE) {
access = FILE_MAP_WRITE;
}
else {
access = (flags & PROT_EXEC) ? FILE_MAP_EXECUTE : FILE_MAP_READ;
}
}
else if ((flags & PROT_WRITE) == PROT_WRITE) {
access = FILE_MAP_COPY;
}
else if ((flags & PROT_EXEC) == PROT_EXEC) {
access = FILE_MAP_EXECUTE;
}
return access;
}
#endif // WIN32

View File

@@ -1,50 +0,0 @@
/*
* 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.
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*/
/** \file
* \ingroup MEM
*/
#ifndef __MMAP_WIN_H__
#define __MMAP_WIN_H__
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
#define MAP_FILE 0
#define MAP_SHARED 1
#define MAP_PRIVATE 2
#define MAP_TYPE 0xF
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FAILED ((void *)-1)
/* needed for uintptr_t, exception, dont use BLI anywhere else in MEM_* */
#include "../../source/blender/blenlib/BLI_sys_types.h"
#include <sys/types.h>
void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t offset);
intptr_t munmap(void *ptr, size_t size);
#endif

View File

@@ -836,7 +836,7 @@ const bTheme U_theme_default = {
.nodeclass_filter = RGBA(0x584d80ff),
.nodeclass_vector = RGBA(0x9b80ffff),
.nodeclass_texture = RGBA(0xe68745ff),
.nodeclass_shader = RGBA(0xea7581ff),
.nodeclass_shader = RGBA(0x63c763ff),
.nodeclass_script = RGBA(0x084d4dff),
.nodeclass_pattern = RGBA(0x6c696fff),
.nodeclass_layout = RGBA(0x6c696fff),

View File

@@ -74,9 +74,11 @@ def kmi_args_as_data(kmi):
s.append(f"\"key_modifier\": '{kmi.key_modifier}'")
if kmi.repeat:
if kmi.map_type == 'KEYBOARD':
if kmi.value in {'PRESS', 'ANY'}:
s.append("\"repeat\": True")
if (
(kmi.map_type == 'KEYBOARD' and kmi.value in {'PRESS', 'ANY'}) or
(kmi.map_type == 'TEXTINPUT')
):
s.append("\"repeat\": True")
return "{" + ", ".join(s) + "}"

View File

@@ -118,6 +118,7 @@ _km_hierarchy = [
('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change
('View3D Placement Modal', 'EMPTY', 'WINDOW', []),
('View3D Walk Modal', 'EMPTY', 'WINDOW', []),
('View3D Fly Modal', 'EMPTY', 'WINDOW', []),
('View3D Rotate Modal', 'EMPTY', 'WINDOW', []),

View File

@@ -537,6 +537,9 @@ def km_screen(params):
("ed.undo_history", {"type": 'Z', "value": 'PRESS', "ctrl": True, "alt": True}, None),
("screen.screen_full_area", {"type": 'UP_ARROW', "value": 'PRESS', "ctrl": True}, None),
("screen.screen_full_area", {"type": 'DOWN_ARROW', "value": 'PRESS', "ctrl": True}, None),
("screen.screen_full_area", {"type": 'SPACE', "value": 'PRESS', "shift": True}, None),
("screen.screen_full_area", {"type": 'F10', "value": 'PRESS', "alt": True},
{"properties": [("use_hide_panels", True)]}),
("screen.screen_set", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True},
{"properties": [("delta", 1)]}),
("screen.screen_set", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True},
@@ -788,9 +791,9 @@ def km_outliner(params):
("outliner.select_box", {"type": 'B', "value": 'PRESS'}, None),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True},
{"properties": [("tweak", True), ("mode", "ADD")]}),
{"properties": [("tweak", True), ("mode", 'ADD')]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True},
{"properties": [("tweak", True), ("mode", "SUB")]}),
{"properties": [("tweak", True), ("mode", 'SUB')]}),
("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'UP')]}),
("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
@@ -1445,7 +1448,7 @@ def km_time_scrub(_params):
)
items.extend([
("anim.change_frame", {"type": "LEFTMOUSE", "value": 'PRESS'}, None),
("anim.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
])
return keymap
@@ -1460,7 +1463,7 @@ def km_time_scrub_clip(_params):
)
items.extend([
("clip.change_frame", {"type": "LEFTMOUSE", "value": 'PRESS'}, None),
("clip.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
])
return keymap
@@ -1591,12 +1594,26 @@ def km_graph_editor(params):
("wm.context_toggle", {"type": 'O', "value": 'PRESS'},
{"properties": [("data_path", 'tool_settings.use_proportional_fcurve')]}),
op_menu_pie("VIEW3D_MT_proportional_editing_falloff_pie", {"type": 'O', "value": 'PRESS', "shift": True}),
op_menu_pie("GRAPH_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
*_template_items_context_menu("GRAPH_MT_context_menu", params.context_menu_event),
])
if not params.legacy:
items.extend([
op_menu_pie("GRAPH_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
])
else:
items.extend([
# Old pivot.
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'BOUNDING_BOX_CENTER')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'CURSOR')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'INDIVIDUAL_ORIGINS')]}),
])
if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
items.extend([
("graph.cursor_set", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
@@ -1697,14 +1714,25 @@ def km_image(params):
for i in range(9)
)
),
op_menu_pie("IMAGE_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
("image.render_border", {"type": 'B', "value": 'PRESS', "ctrl": True}, None),
("image.clear_render_border", {"type": 'B', "value": 'PRESS', "ctrl": True, "alt": True}, None),
*_template_items_context_menu("IMAGE_MT_mask_context_menu", params.context_menu_event),
])
if params.legacy:
if not params.legacy:
items.extend([
op_menu_pie("IMAGE_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
])
else:
items.extend([
# Old pivot.
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'CENTER')]}),
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'MEDIAN')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'CURSOR')]}),
("image.view_center_cursor", {"type": 'HOME', "value": 'PRESS', "alt": True}, None),
])
@@ -2826,14 +2854,25 @@ def km_clip_editor(params):
("clip.clear_track_path", {"type": 'T', "value": 'PRESS', "shift": True, "alt": True},
{"properties": [("action", 'ALL'), ("clear_active", False)]}),
("clip.cursor_set", params.cursor_set_event, None),
op_menu_pie("CLIP_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
("clip.copy_tracks", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
("clip.paste_tracks", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
*_template_items_context_menu("CLIP_MT_tracking_context_menu", params.context_menu_event),
])
if params.legacy:
if not params.legacy:
op_menu_pie("CLIP_MT_pivot_pie", {"type": 'PERIOD', "value": 'PRESS'}),
else:
items.extend([
# Old pivot.
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'BOUNDING_BOX_CENTER')]}),
("wm.context_set_enum", {"type": 'COMMA', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'MEDIAN_POINT')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS'},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'CURSOR')]}),
("wm.context_set_enum", {"type": 'PERIOD', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", 'space_data.pivot_point'), ("value", 'INDIVIDUAL_ORIGINS')]}),
("clip.view_center_cursor", {"type": 'HOME', "value": 'PRESS', "alt": True}, None),
])
@@ -4396,9 +4435,9 @@ def km_sculpt(params):
("sculpt.mask_expand", {"type": 'W', "value": 'PRESS', "shift": True},
{"properties": [("use_normals", False), ("keep_previous_mask", False), ("invert", False), ("smooth_iterations", 0), ("create_face_set", True)]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", "GROW")]}),
{"properties": [("mode", 'GROW')]}),
("sculpt.face_set_edit", {"type": 'W', "value": 'PRESS', "ctrl": True, "alt": True},
{"properties": [("mode", "SHRINK")]}),
{"properties": [("mode", 'SHRINK')]}),
# Subdivision levels
*_template_items_object_subdivision_set(),
("object.subdivision_set", {"type": 'PAGE_UP', "value": 'PRESS', "repeat": True},
@@ -5048,10 +5087,10 @@ def km_transform_modal_map(_params):
return keymap
def km_view3d_interactive_add_tool_modal_map(_params):
def km_view3d_interactive_add_tool_modal(_params):
items = []
keymap = (
"View3D Placement Modal Map",
"View3D Placement Modal",
{"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True},
{"items": items},
)
@@ -6958,7 +6997,7 @@ def generate_keymaps(params=None):
km_eyedropper_modal_map(params),
km_eyedropper_colorramp_pointsampling_map(params),
km_transform_modal_map(params),
km_view3d_interactive_add_tool_modal_map(params),
km_view3d_interactive_add_tool_modal(params),
km_view3d_gesture_circle(params),
km_gesture_border(params),
km_gesture_zoom_border(params),

View File

@@ -494,9 +494,9 @@ def km_outliner(params):
{"properties": [("extend", True), ("extend_range", True), ("deselect_all", True)]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, {"properties": [("tweak", True)]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "shift": True},
{"properties": [("tweak", True), ("mode", "ADD")]}),
{"properties": [("tweak", True), ("mode", 'ADD')]}),
("outliner.select_box", {"type": 'EVT_TWEAK_L', "value": 'ANY', "ctrl": True},
{"properties": [("tweak", True), ("mode", "SUB")]}),
{"properties": [("tweak", True), ("mode", 'SUB')]}),
("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
{"properties": [("direction", 'UP')]}),
("outliner.select_walk", {"type": 'UP_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
@@ -586,7 +586,7 @@ def km_uv_editor(params):
("uv.select", {"type": 'LEFTMOUSE', "value": 'CLICK', "shift": True},
{"properties": [("extend", True), ("deselect_all", False)]}),
("transform.translate", {"type": "EVT_TWEAK_L", "value": 'ANY'}, None),
("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, None),
("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "shift": True},
{"properties": [("extend", True)]}),
("uv.select_loop", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK'},

View File

@@ -225,7 +225,7 @@ class ConstraintButtonsPanel(Panel):
sub.active = con.use_limit_x
sub.prop(con, "min_x", text="Min")
sub.prop(con, "max_x", text="Max")
row.label(icon="BLANK1")
row.label(icon='BLANK1')
row = layout.row(heading="Y", align=True)
row.use_property_decorate = False
@@ -234,7 +234,7 @@ class ConstraintButtonsPanel(Panel):
sub.active = con.use_limit_y
sub.prop(con, "min_y", text="Min")
sub.prop(con, "max_y", text="Max")
row.label(icon="BLANK1")
row.label(icon='BLANK1')
row = layout.row(heading="Z", align=True)
row.use_property_decorate = False
@@ -243,7 +243,7 @@ class ConstraintButtonsPanel(Panel):
sub.active = con.use_limit_z
sub.prop(con, "min_z", text="Min")
sub.prop(con, "max_z", text="Max")
row.label(icon="BLANK1")
row.label(icon='BLANK1')
layout.prop(con, "use_transform_limit")
self.space_template(layout, con, target=False, owner=True)
@@ -556,7 +556,7 @@ class ConstraintButtonsPanel(Panel):
row = layout.row()
row.prop(con, "distance")
row.operator("constraint.limitdistance_reset", text="", icon="X")
row.operator("constraint.limitdistance_reset", text="", icon='X')
layout.prop(con, "limit_mode", text="Clamp Region")
@@ -576,7 +576,7 @@ class ConstraintButtonsPanel(Panel):
row = layout.row()
row.prop(con, "rest_length")
row.operator("constraint.stretchto_reset", text="", icon="X")
row.operator("constraint.stretchto_reset", text="", icon='X')
layout.separator()

View File

@@ -592,7 +592,7 @@ class GreasePencilMaterialsPanel:
if show_full_ui:
row = layout.row()
row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate", live_icon=True)
row.template_ID(ob, "active_material", new="material.new", live_icon=True)
slot = context.material_slot
if slot:
@@ -759,6 +759,16 @@ class GreasePencilLayerAdjustmentsPanel:
col = layout.row(align=True)
col.prop(gpl, "lock_material")
# Transforms
row = layout.row(align=True)
row.prop(gpl, "location")
row = layout.row(align=True)
row.prop(gpl, "rotation")
row = layout.row(align=True)
row.prop(gpl, "scale")
class GPENCIL_UL_masks(UIList):
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):

View File

@@ -133,7 +133,7 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
row = layout.row()
if ob:
row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate")
row.template_ID(ob, "active_material", new="material.new")
if slot:
icon_link = 'MESH_DATA' if slot.link == 'DATA' else 'OBJECT_DATA'

View File

@@ -92,7 +92,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
if obj.type == 'MESH':
row = physics_add(col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False)
if row and obj.collision:
row.prop(obj.collision, "use", text="", icon="HIDE_OFF" if obj.collision.use else "HIDE_ON")
row.prop(obj.collision, "use", text="", icon='HIDE_OFF' if obj.collision.use else 'HIDE_ON')
physics_add(col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True)
physics_add(col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True)

View File

@@ -51,7 +51,7 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel):
space = context.space_data
if scene:
layout.template_ID(scene, "world", new="world.new", duplicate="world.duplicate")
layout.template_ID(scene, "world", new="world.new")
elif world:
layout.template_ID(space, "pin_id")

View File

@@ -303,11 +303,11 @@ class CLIP_MT_masking_editor_menus(Menu):
if clip:
layout.menu("MASK_MT_select")
layout.menu("CLIP_MT_clip") # XXX - remove?
layout.menu("CLIP_MT_clip")
layout.menu("MASK_MT_add")
layout.menu("MASK_MT_mask")
else:
layout.menu("CLIP_MT_clip") # XXX - remove?
layout.menu("CLIP_MT_clip")
class CLIP_PT_clip_view_panel:
@@ -1330,10 +1330,17 @@ class CLIP_MT_clip(Menu):
layout.operator("clip.open")
if clip:
layout.operator("clip.set_scene_frames")
layout.operator("clip.set_center_principal")
layout.operator("clip.prefetch")
layout.operator("clip.reload")
layout.menu("CLIP_MT_proxy")
layout.separator()
layout.operator("clip.set_viewport_background")
layout.operator("clip.setup_tracking_scene")
class CLIP_MT_proxy(Menu):
bl_label = "Proxy"
@@ -1345,66 +1352,161 @@ class CLIP_MT_proxy(Menu):
layout.operator("clip.delete_proxy")
class CLIP_MT_track(Menu):
bl_label = "Track"
class CLIP_MT_track_transform(Menu):
bl_label = "Transform"
def draw(self, _context):
layout = self.layout
layout.operator("clip.clear_solution")
layout.operator("clip.solve_camera")
layout.operator("transform.translate")
layout.operator("transform.rotate")
layout.operator("transform.resize")
layout.separator()
props = layout.operator("clip.clear_track_path", text="Clear After")
props.clear_active = False
props.action = 'REMAINED'
props = layout.operator("clip.clear_track_path", text="Clear Before")
class CLIP_MT_track_motion(Menu):
bl_label = "Track Motion"
def draw(self, _context):
layout = self.layout
props = layout.operator("clip.track_markers", text="Backwards")
props.backwards = True
props.sequence = True
props = layout.operator("clip.track_markers", text="Frame Backwards")
props.backwards = True
props.sequence = False
props = layout.operator("clip.track_markers", text="Forwards")
props.backwards = False
props.sequence = True
props = layout.operator("clip.track_markers", text="Frame Forwards")
props.backwards = False
props.sequence = False
class CLIP_MT_track_clear(Menu):
bl_label = "Clear"
def draw(self, _context):
layout = self.layout
props = layout.operator("clip.clear_track_path", text="Before")
props.clear_active = False
props.action = 'UPTO'
props = layout.operator("clip.clear_track_path", text="Clear Track Path")
props = layout.operator("clip.clear_track_path", text="After")
props.clear_active = False
props.action = 'REMAINED'
props = layout.operator("clip.clear_track_path", text="Track Path")
props.clear_active = False
props.action = 'ALL'
layout.separator()
layout.operator("clip.clear_solution", text="Solution")
class CLIP_MT_track_refine(Menu):
bl_label = "Refine"
def draw(self, _context):
layout = self.layout
props = layout.operator("clip.refine_markers", text="Backwards")
props.backwards = True
props = layout.operator("clip.refine_markers", text="Fowards")
props.backwards = False
class CLIP_MT_track_animation(Menu):
bl_label = "Animation"
def draw(self, _context):
layout = self.layout
layout.operator("clip.keyframe_insert")
layout.operator("clip.keyframe_delete")
class CLIP_MT_track_visibility(Menu):
bl_label = "Show/Hide"
def draw(self, _context):
layout = self.layout
layout.operator("clip.hide_tracks_clear")
layout.operator("clip.hide_tracks", text="Hide Selected").unselected = False
layout.operator("clip.hide_tracks", text="Hide Unselected").unselected = True
class CLIP_MT_track_cleanup(Menu):
bl_label = "Clean Up"
def draw(self, _context):
layout = self.layout
layout.operator("clip.clean_tracks")
layout.operator("clip.filter_tracks")
class CLIP_MT_track(Menu):
bl_label = "Track"
def draw(self, context):
layout = self.layout
clip = context.space_data.clip
tracking_object = clip.tracking.objects.active
layout.menu("CLIP_MT_track_transform")
layout.menu("CLIP_MT_track_motion")
layout.menu("CLIP_MT_track_clear")
layout.menu("CLIP_MT_track_refine")
layout.separator()
layout.operator("clip.add_marker_move", text="Add Marker")
layout.operator("clip.detect_features")
layout.operator("clip.create_plane_track")
layout.separator()
layout.operator("clip.solve_camera",
text="Solve Camera Motion" if tracking_object.is_camera
else "Solve Object Motion")
layout.separator()
layout.operator("clip.join_tracks")
layout.separator()
layout.operator("clip.clean_tracks")
layout.operator("clip.copy_tracks", icon='COPYDOWN')
layout.operator("clip.paste_tracks", icon='PASTEDOWN')
layout.separator()
layout.operator("clip.copy_tracks")
layout.operator("clip.paste_tracks")
layout.operator("clip.track_settings_as_default", text="Copy Settings to Defaults")
layout.operator("clip.track_settings_to_track", text="Apply Default Settings")
layout.separator()
props = layout.operator("clip.track_markers", text="Track Frame Backwards")
props.backwards = True
props.sequence = False
props = layout.operator("clip.track_markers", text="Track Backwards")
props.backwards = True
props.sequence = True
props = layout.operator("clip.track_markers", text="Track Forwards")
props.backwards = False
props.sequence = True
props = layout.operator("clip.track_markers", text="Track Frame Forwards")
props.backwards = False
props.sequence = False
layout.menu("CLIP_MT_track_animation")
layout.separator()
layout.menu("CLIP_MT_track_visibility")
layout.menu("CLIP_MT_track_cleanup")
layout.separator()
layout.operator("clip.delete_track")
layout.operator("clip.delete_marker")
layout.separator()
layout.operator("clip.add_marker_move")
layout.separator()
layout.menu("CLIP_MT_track_visibility")
layout.menu("CLIP_MT_track_transform")
class CLIP_MT_reconstruction(Menu):
bl_label = "Reconstruction"
@@ -1420,6 +1522,7 @@ class CLIP_MT_reconstruction(Menu):
layout.operator("clip.set_axis", text="Set Y Axis").axis = 'Y'
layout.operator("clip.set_scale")
layout.operator("clip.apply_solution_scale")
layout.separator()
@@ -1427,25 +1530,13 @@ class CLIP_MT_reconstruction(Menu):
layout.operator("clip.bundles_to_mesh")
class CLIP_MT_track_visibility(Menu):
bl_label = "Show/Hide"
class CLIP_MT_select_grouped(Menu):
bl_label = "Select Grouped"
def draw(self, _context):
layout = self.layout
layout.operator("clip.hide_tracks_clear")
layout.operator("clip.hide_tracks", text="Hide Selected").unselected = False
layout.operator("clip.hide_tracks", text="Hide Unselected").unselected = True
class CLIP_MT_track_transform(Menu):
bl_label = "Transform"
def draw(self, _context):
layout = self.layout
layout.operator("transform.translate")
layout.operator("transform.resize")
layout.operator_enum("clip.select_grouped", "group")
class CLIP_MT_select(Menu):
@@ -1459,21 +1550,15 @@ class CLIP_MT_select(Menu):
layout.separator()
layout.operator("clip.select_all"
).action = 'TOGGLE'
layout.operator("clip.select_all",
text="Inverse").action = 'INVERT'
layout.operator("clip.select_all").action = 'TOGGLE'
layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
layout.menu("CLIP_MT_select_grouped")
layout.separator()
class CLIP_MT_select_grouped(Menu):
bl_label = "Select Grouped"
def draw(self, _context):
layout = self.layout
layout.operator_enum("clip.select_grouped", "group")
layout.operator("clip.stabilize_2d_select")
layout.operator("clip.stabilize_2d_rotation_select")
class CLIP_MT_tracking_context_menu(Menu):
@@ -1746,7 +1831,6 @@ classes = (
CLIP_PT_display,
CLIP_PT_clip_display,
CLIP_PT_marker_display,
CLIP_MT_track,
CLIP_MT_tracking_editor_menus,
CLIP_MT_masking_editor_menus,
CLIP_PT_track,
@@ -1786,8 +1870,14 @@ classes = (
CLIP_MT_clip,
CLIP_MT_proxy,
CLIP_MT_reconstruction,
CLIP_MT_track_visibility,
CLIP_MT_track,
CLIP_MT_track_transform,
CLIP_MT_track_motion,
CLIP_MT_track_clear,
CLIP_MT_track_refine,
CLIP_MT_track_animation,
CLIP_MT_track_visibility,
CLIP_MT_track_cleanup,
CLIP_MT_select,
CLIP_MT_select_grouped,
CLIP_MT_tracking_context_menu,

View File

@@ -248,7 +248,7 @@ class DOPESHEET_HT_editor_buttons:
layout.separator_spacer()
layout.template_ID(st, "action", new="action.new", duplicate="action.duplicate_assign", unlink="action.unlink")
layout.template_ID(st, "action", new="action.new", unlink="action.unlink")
# Layer management
if st.mode == 'GPENCIL':

View File

@@ -40,7 +40,7 @@ class FILEBROWSER_HT_header(Header):
row.prop(params, "asset_library", text="")
# External libraries don't auto-refresh, add refresh button.
if params.asset_library != 'LOCAL':
row.operator("file.refresh", text="", icon="FILE_REFRESH")
row.operator("file.refresh", text="", icon='FILE_REFRESH')
layout.separator_spacer()
@@ -197,7 +197,8 @@ class FILEBROWSER_PT_filter(Panel):
sub = row.column(align=True)
sub.prop(params, "use_filter_asset_only")
if context.preferences.experimental.use_asset_browser:
sub.prop(params, "use_filter_asset_only")
filter_id = params.filter_id
for identifier in dir(filter_id):
@@ -390,7 +391,8 @@ class FILEBROWSER_PT_advanced_filter(Panel):
layout.separator()
col = layout.column(align=True)
col.prop(params, "use_filter_asset_only")
if context.preferences.experimental.use_asset_browser:
col.prop(params, "use_filter_asset_only")
filter_id = params.filter_id
for identifier in dir(filter_id):

View File

@@ -93,10 +93,10 @@ class NODE_HT_header(Header):
# Show material.new when no active ID/slot exists
if not id_from and ob_type in types_that_support_material:
row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate")
row.template_ID(ob, "active_material", new="material.new")
# Material ID, but not for Lights
if id_from and ob_type != 'LIGHT':
row.template_ID(id_from, "active_material", new="material.new", duplicate="material.duplicate")
row.template_ID(id_from, "active_material", new="material.new")
if snode.shader_type == 'WORLD':
NODE_MT_editor_menus.draw_collapsible(context, layout)
@@ -109,7 +109,7 @@ class NODE_HT_header(Header):
row = layout.row()
row.enabled = not snode.pin
row.template_ID(scene, "world", new="world.new", duplicate="world.duplicate")
row.template_ID(scene, "world", new="world.new")
if snode.shader_type == 'LINESTYLE':
view_layer = context.view_layer
@@ -678,16 +678,8 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
row = layout.row(align=True)
# inputs get icon on the left
if not socket.is_output:
row.template_node_socket(color=color)
row.template_node_socket(color=color)
row.prop(socket, "name", text="", emboss=False, icon_value=icon)
# outputs get icon on the right
if socket.is_output:
row.template_node_socket(color=color)
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.template_node_socket(color=color)

View File

@@ -375,11 +375,11 @@ class OUTLINER_PT_filter(Panel):
row.label(icon='OBJECT_DATAMODE')
row.prop(space, "use_filter_object", text="Objects")
row = col.row(align=True)
row.label(icon="BLANK1")
row.label(icon='BLANK1')
row.prop(space, "filter_state", text="")
sub = row.row(align=True)
sub.enabled = space.filter_state != 'ALL'
sub.prop(space, "filter_invert", text="", icon="ARROW_LEFTRIGHT")
sub.prop(space, "filter_invert", text="", icon='ARROW_LEFTRIGHT')
sub = col.column(align=True)
sub.active = space.use_filter_object

View File

@@ -1004,7 +1004,7 @@ def _activate_by_item(context, space_type, item, index, *, as_fallback=False):
if item.draw_cursor is not None:
def handle_fn(context, item, tool, xy):
item.draw_cursor(context, tool, xy)
handle = WindowManager.draw_cursor_add(handle_fn, (context, item, tool), space_type)
handle = WindowManager.draw_cursor_add(handle_fn, (context, item, tool), space_type, 'WINDOW')
handle_map[space_type] = handle

View File

@@ -441,38 +441,90 @@ class _defs_view3d_select:
class _defs_view3d_add:
@staticmethod
def description_interactive_add(context, _item, _km, *, prefix):
km = context.window_manager.keyconfigs.user.keymaps["View3D Placement Modal"]
def keymap_item_from_propvalue(propvalue):
for item in km.keymap_items:
if item.propvalue == propvalue:
return item
if km is not None:
kmi_snap = keymap_item_from_propvalue('SNAP_ON')
kmi_center = keymap_item_from_propvalue('PIVOT_CENTER_ON')
kmi_fixed_aspect = keymap_item_from_propvalue('FIXED_ASPECT_ON')
else:
kmi_snap = None
kmi_center = None
kmi_fixed_aspect = None
return tip_(
"%s\n"
"\u2022 %s toggles snap while dragging.\n"
"\u2022 %s toggles dragging from the center.\n"
"\u2022 %s toggles fixed aspect"
) % (
prefix,
kmi_to_string_or_none(kmi_snap),
kmi_to_string_or_none(kmi_center),
kmi_to_string_or_none(kmi_fixed_aspect),
)
# Layout tweaks here would be good to avoid,
# this shows limits in layout engine, as buttons are using a lot of space.
@staticmethod
def draw_settings_interactive_add(layout, tool):
def draw_settings_interactive_add(layout, tool, extra):
show_extra = False
props = tool.operator_properties("view3d.interactive_add")
row = layout.row()
row.scale_x = 0.8
row.label(text="Depth:")
row = layout.row()
row.scale_x = 0.9
row.prop(props, "plane_depth", text="")
row = layout.row()
row.prop(props, "plane_axis", text="")
row = layout.row()
row.scale_x = 0.8
row.label(text="Orientation:")
row = layout.row()
row.prop(props, "plane_orientation", text="")
row = layout.row()
row.scale_x = 0.7
row.prop(props, "plane_origin")
if not extra:
row = layout.row()
row.scale_x = 0.8
row.label(text="Depth:")
row = layout.row()
row.scale_x = 0.9
row.prop(props, "plane_depth", text="")
row = layout.row()
row.scale_x = 0.8
row.label(text="Orientation:")
row = layout.row()
row.prop(props, "plane_orientation", text="")
row = layout.row()
row.scale_x = 0.8
row.prop(props, "snap_target")
region_is_header = bpy.context.region.type == 'TOOL_HEADER'
if region_is_header:
# Don't draw the "extra" popover here as we might have other settings & this should be last.
show_extra = True
else:
extra = True
if extra:
layout.use_property_split = True
layout.row().prop(props, "plane_axis", expand=True)
layout.label(text="Base")
layout.row().prop(props, "plane_origin_base", expand=True)
layout.row().prop(props, "plane_aspect_base", expand=True)
layout.label(text="Height")
layout.row().prop(props, "plane_origin_depth", expand=True)
layout.row().prop(props, "plane_aspect_depth", expand=True)
return show_extra
@ToolDef.from_fn
def cube_add():
def draw_settings(_context, layout, tool):
_defs_view3d_add.draw_settings_interactive_add(layout, tool)
def draw_settings(_context, layout, tool, *, extra=False):
show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_cube_add",
label="Add Cube",
icon="ops.mesh.primitive_cube_add_gizmo",
description=(
"Add cube to mesh interactively"
description=lambda *args: _defs_view3d_add.description_interactive_add(
*args, prefix=tip_("Add cube to mesh interactively"),
),
widget="VIEW3D_GGT_placement",
keymap="3D View Tool: Object, Add Primitive",
@@ -481,18 +533,24 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cone_add():
def draw_settings(_context, layout, tool):
_defs_view3d_add.draw_settings_interactive_add(layout, tool)
def draw_settings(_context, layout, tool, *, extra=False):
show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_cone_add")
layout.prop(props, "vertices")
layout.prop(props, "end_fill_type")
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_cone_add",
label="Add Cone",
icon="ops.mesh.primitive_cone_add_gizmo",
description=(
"Add cone to mesh interactively"
description=lambda *args: _defs_view3d_add.description_interactive_add(
*args, prefix=tip_("Add cone to mesh interactively"),
),
widget="VIEW3D_GGT_placement",
keymap="3D View Tool: Object, Add Primitive",
@@ -501,18 +559,23 @@ class _defs_view3d_add:
@ToolDef.from_fn
def cylinder_add():
def draw_settings(_context, layout, tool):
_defs_view3d_add.draw_settings_interactive_add(layout, tool)
def draw_settings(_context, layout, tool, *, extra=False):
show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_cylinder_add")
layout.prop(props, "vertices")
layout.prop(props, "end_fill_type")
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_cylinder_add",
label="Add Cylinder",
icon="ops.mesh.primitive_cylinder_add_gizmo",
description=(
"Add cylinder to mesh interactively"
description=lambda *args: _defs_view3d_add.description_interactive_add(
*args, prefix=tip_("Add cylinder to mesh interactively"),
),
widget="VIEW3D_GGT_placement",
keymap="3D View Tool: Object, Add Primitive",
@@ -521,18 +584,23 @@ class _defs_view3d_add:
@ToolDef.from_fn
def uv_sphere_add():
def draw_settings(_context, layout, tool):
_defs_view3d_add.draw_settings_interactive_add(layout, tool)
def draw_settings(_context, layout, tool, *, extra=False):
show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_uv_sphere_add")
layout.prop(props, "segments")
layout.prop(props, "ring_count")
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_uv_sphere_add",
label="Add UV Sphere",
icon="ops.mesh.primitive_sphere_add_gizmo",
description=(
"Add cylinder to mesh interactively"
description=lambda *args: _defs_view3d_add.description_interactive_add(
*args, prefix=tip_("Add sphere to mesh interactively"),
),
widget="VIEW3D_GGT_placement",
keymap="3D View Tool: Object, Add Primitive",
@@ -541,17 +609,22 @@ class _defs_view3d_add:
@ToolDef.from_fn
def ico_sphere_add():
def draw_settings(_context, layout, tool):
_defs_view3d_add.draw_settings_interactive_add(layout, tool)
def draw_settings(_context, layout, tool, *, extra=False):
show_extra = _defs_view3d_add.draw_settings_interactive_add(layout, tool, extra)
if extra:
return
props = tool.operator_properties("mesh.primitive_ico_sphere_add")
layout.prop(props, "subdivisions")
if show_extra:
layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.primitive_ico_sphere_add",
label="Add Ico Sphere",
icon="ops.mesh.primitive_sphere_add_gizmo",
description=(
"Add cylinder to mesh interactively"
description=lambda *args: _defs_view3d_add.description_interactive_add(
*args, prefix=tip_("Add sphere to mesh interactively"),
),
widget="VIEW3D_GGT_placement",
keymap="3D View Tool: Object, Add Primitive",
@@ -2581,12 +2654,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
],
'OBJECT': [
*_tools_default,
# Currently experimental.
# None, _tools_view3d_add,
lambda context: (
(None, VIEW3D_PT_tools_active._tools_view3d_add)
if (context is None or context.preferences.experimental.use_object_add_tool) else ()
),
None,
_tools_view3d_add,
],
'POSE': [
*_tools_default,
@@ -2615,12 +2684,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
'EDIT_MESH': [
*_tools_default,
# Currently experimental.
# None, _tools_view3d_add,
lambda context: (
(None, VIEW3D_PT_tools_active._tools_view3d_add)
if (context is None or context.preferences.experimental.use_object_add_tool) else ()
),
None,
_tools_view3d_add,
None,
(
_defs_edit_mesh.extrude,

View File

@@ -542,7 +542,7 @@ class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel):
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
flow.prop(edit, "fcurve_unselected_alpha", text="F-Curve Visibility")
flow.prop(edit, "fcurve_unselected_alpha", text="Unselected Opacity")
flow.prop(edit, "fcurve_new_auto_smoothing", text="Default Smoothing Mode")
flow.prop(edit, "keyframe_new_interpolation_type", text="Default Interpolation")
flow.prop(edit, "keyframe_new_handle_type", text="Default Handles")
@@ -1342,6 +1342,11 @@ class USERPREF_PT_saveload_autorun(FilePathsPanel, Panel):
class USERPREF_PT_file_paths_asset_libraries(FilePathsPanel, Panel):
bl_label = "Asset Libraries"
@classmethod
def poll(cls, context):
prefs = context.preferences
return prefs.experimental.use_asset_browser
def draw(self, context):
layout = self.layout
layout.use_property_split = False
@@ -2188,14 +2193,21 @@ class ExperimentalPanel:
layout.use_property_split = False
layout.use_property_decorate = False
for prop_keywords, task in items:
for prop_keywords, reference in items:
split = layout.split(factor=0.66)
col = split.split()
col.prop(experimental, **prop_keywords)
if task:
if reference:
if type(reference) is tuple:
url_ext = reference[0]
text = reference[1]
else:
url_ext = reference
text = reference
col = split.split()
col.operator("wm.url_open", text=task, icon='URL').url = self.url_prefix + task
col.operator("wm.url_open", text=text, icon='URL').url = self.url_prefix + url_ext
"""
@@ -2224,7 +2236,7 @@ class USERPREF_PT_experimental_new_features(ExperimentalPanel, Panel):
({"property": "use_sculpt_vertex_colors"}, "T71947"),
({"property": "use_switch_object_operator"}, "T80402"),
({"property": "use_sculpt_tools_tilt"}, "T82877"),
({"property": "use_object_add_tool"}, "T57210"),
({"property": "use_asset_browser"}, ("project/profile/124/", "Milestone 1")),
),
)

View File

@@ -1435,7 +1435,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_advanced(View3DPanel, Panel):
row.prop(gp_settings, "fill_layer_mode", text="Layers")
col.separator()
col.prop(gp_settings, "fill_factor", text="Resolution")
col.prop(gp_settings, "fill_factor")
if gp_settings.fill_draw_mode != 'STROKE':
col = layout.column(align=False, heading="Ignore Transparent")
col.use_property_decorate = False

View File

@@ -488,6 +488,7 @@ geometry_node_categories = [
NodeItem("GeometryNodeAttributeFill"),
NodeItem("GeometryNodeAttributeMix"),
NodeItem("GeometryNodeAttributeColorRamp"),
NodeItem("GeometryNodeAttributeVectorMath"),
]),
GeometryNodeCategory("GEO_COLOR", "Color", items=[
NodeItem("ShaderNodeValToRGB"),
@@ -514,7 +515,10 @@ geometry_node_categories = [
NodeItem("GeometryNodePointDistribute"),
NodeItem("GeometryNodePointInstance"),
NodeItem("GeometryNodePointSeparate"),
NodeItem("GeometryNodePointScale"),
NodeItem("GeometryNodePointTranslate"),
NodeItem("GeometryNodeRotatePoints"),
NodeItem("GeometryNodeAlignRotationToVector"),
]),
GeometryNodeCategory("GEO_UTILITIES", "Utilities", items=[
NodeItem("ShaderNodeMapRange"),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

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