Commit Graph

109713 Commits

Author SHA1 Message Date
08a1492ae5 Asset Browser: apply search filter to tags as well
The search bar in the asset browser now also matches on asset tags.

- Matching is done on entire tags, so searching for "redder" will not
  show assets tagged with "red".
- All assets are shown that have at least one matching tag. So searching
  for "red green" will show all assets with either "red" or "green" tags
  (or both, of course).
- Searching is case-insensitive.
- Only assets from the active catalog are shown; if all assets should be
  searched through, users can select the "All" catalog.

Manifest Task: T82679
2021-10-25 17:12:56 +02:00
Hans Goudey
972677b25e UI: Improve layout of custom property edit panel
This patch makes the layout of the custom property panel more coherent
with the rest of the property editor interface, makes it less busy,
allows more space for the buttons for the actual properties, and
simplifies editing values of unsupported property types or long arrays.

 - Remove the box around each property.
 - Use an non-embossed X icon for deleting.
 - Use an "edit" icon instead of the text for the meta-data edit operator.
   The "gear" icon used for editing isn't ideal here.
 - Increase the max array length for drawing the values directly to 8.
 - Add an "Edit Property Value" operator for dictionaries or longer arrays.
 - Replace the "Library Override" text with an icon.
 - Use a proper split factor, the same as the rest of the UI.

Differential Revision: https://developer.blender.org/D12805
2021-10-25 10:01:07 -05:00
Germano Cavalcante
a84f1c02d2 Assets: Snapping with visual feedback while dragging
The drag and drop feature of objects in 3D View has been modified to include:
- Snap the object being dragged.
- Visual feedback through a box and the placement tool grid.

Maniphest Tasks: T90198

Differential Revision: https://developer.blender.org/D12912
2021-10-25 11:57:26 -03:00
Germano Cavalcante
b17038db31 Drag Drop: allow customizable drawing 2021-10-25 11:57:26 -03:00
Germano Cavalcante
e8027ec2a0 UI Drag Drop: allow customizable drawing
No functional changes.

This commit adds 3 callbacks for `wmDropBox` which allow custom drawing
without affecting the internal dropbox API.

Differential Revision: https://developer.blender.org/D12948
2021-10-25 11:57:26 -03:00
Pablo Vazquez
2a7b9f2d45 Cleanup: silence warning in recent commit
Thanks to Dr. Sybren for pointing it out!
2021-10-25 16:52:27 +02:00
6da63b19ff Fix T87627: Asset Browser Search Bar not working
The asset browser search bar was filtering on the filename containing the
asset, and not the asset name. This is now fixed.
2021-10-25 16:39:14 +02:00
1267dfee7c Cleanup: refactor filelist filter functions
Perform a few cleanups:

- Add documentation to explain what returned bools mean.
- Early returns so that flow is clearer and some checks on `is_filtered`
  are no longer necessary.
- Split up `is_filtered_file` and `is_filtered_id_file`, so that they can
  reuse common code, and such that the different filter checks they
  perform can be separated from each other.

The latter is done not only to reduce code duplication, but also as
preparation to fix the asset browser filtering. For that, it helps when
the "filter by file name" and "filter by file type" parts are separate.

No functional changes.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D12991
2021-10-25 16:39:14 +02:00
Pablo Vazquez
4758a7d357 UI: Use flat colors for NLA strip drawing
The NLA editor is in need of a design overhaul, hopefully for 3.1 or 3.2.

This should be a project on itself, however, the worst offender currently is the use of
gradients on strips. Something that can be fixed easily.

{F11390293, size=full, loop, autoplay}

A simple replace of `UI_draw_roundbox_shade_x` for `UI_draw_roundbox_4fv` brings strips
in line with how other areas are drawn.

This patch also:
* Remove embossed lines around active action channel.
* Highlight the strip while being moved.

This patch does not include any theme changes. This will be tackled separately.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D12968
2021-10-25 16:29:26 +02:00
Germano Cavalcante
1bc28fc73b Fix T92466: Crash snapping to text objects with XRay shading
Should have been addressed along with {rB6cff1d648030}
2021-10-25 11:26:01 -03:00
Hans Goudey
bc2f4dd8b4 Geometry Nodes: Add "Fill Caps" option to curve to mesh node
This adds an option to fill the ends of the generated mesh for
each spline combination with an N-gon. The resulting mesh is
manifold, so it can be used for operations like Boolean.

Differential Revision: https://developer.blender.org/D12982
2021-10-25 09:10:44 -05:00
Campbell Barton
4b1ad2dc17 Fix T92361: Zooming nodes clips text labels
While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug,
this was caused by text widths being calculated without taking the zoom
level into account since drawing at a smaller size is often wider than
the width of the larger text scaled by the zoom.
2021-10-26 00:25:29 +11:00
Dalai Felinto
cfde1f9f3b Geometry Nodes: Keep Add menu sorted alphabetically 2021-10-25 15:14:40 +02:00
Jacques Lucke
b15e1861ac Fix T92460: crash when instancing on curves generated from string
Issue is that the Instance on Points node currently expects that all
instance references are used (see `remove_unused_references`).
This should be fixed at some point, but for now make sure that
the String to Curves node does not output unused references.
2021-10-25 15:12:50 +02:00
Bastien Montagne
bd7f1c5cce Fix non-capitalized UI message. 2021-10-25 14:41:47 +02:00
cdcca917cf Tests: assets, add BKE callback init/finalize to test setup/teardown
Add calls to `BKE_callback_global_init()` and `BKE_callback_global_finalize()`
to ensure unit tests mimick Blender (and don't trip the assertions added
in rBbeea601e7253).

No functional changes to Blender.
2021-10-25 14:21:43 +02:00
Julian Eisel
4100a79219 Assets: Add Author field to asset metadata
This is information you'd typically want to be visible in the UI. It's optional
of course, so if not relevant, it can just remain unset.
2021-10-25 13:51:14 +02:00
Julian Eisel
e7bea3fb6e Assets/IDs: Don't generate previews for object types with no real geometry
Object types like empties, cameras or lamps will just end up as empty preview
images. We can think about ways to visualize them still, but meanwhile, don't
create such an empty preview.

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

Reviewed by: Bastien Montagne, Sybren Stüvel
2021-10-25 13:33:16 +02:00
Jacques Lucke
60e2103507 Fix: crash in previously added versioning code 2021-10-25 13:30:00 +02:00
Campbell Barton
5c2330203e Fix T92293: Clipped labels for graph editor modifiers
While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug,
this was caused by a discrepancy in padding where labels would
have additional padding when drawing without emboss.
The padding made widget drawing behave as if the text took up more
room causing it to be clipped.

Now labels are considered the same width with/without emboss.
2021-10-25 22:28:06 +11:00
Campbell Barton
8cecf88dca Cleanup: clang-tidy, spelling 2021-10-25 22:28:06 +11:00
Antonio Vazquez
61bb70e0c7 GPencil: Fix unreported double stroke color in materials panel
There was an extra stroke color in the side panel, but this prop must be visible only in Topbar.
2021-10-25 13:14:54 +02:00
Jacques Lucke
039094c1ec Geometry Nodes: new Image Texture node
This adds a new image texture node for geometry nodes. It does not
reuse the same node that is used in shading, because we want to be
able to expose the image and frame as sockets.

There is a known update issue when a movie or image sequence is
used. That will be fixed separately (also see D12957).

Currently, the image socket is just a pointer to an Image ID data block.
This can contain single images but also movies and image sequences.
In the future, the definition of an image socket can be expanded to
include images that are generated from scratch in the node tree.
For more details read the discussion in D12827.

Some of the code is a direct port from cycles and should be cleaned
up a bit in the future. For example `image_cubic_texture_lookup`.

For still images, the frame input is ignored. Otherwise, the frame
has to be in a valid range for the node to work. In the future we
may add e.g. automatic looping functionality.

Differential Revision: https://developer.blender.org/D12827
2021-10-25 13:03:57 +02:00
Philipp Oeser
2b91445ddd Cleanup: rename Outliner function
Seems like typos in rB32dc085289ac

outline_batch_delete_hierarchy --> outliner_batch_delete_hierarchy

Differential Revision: https://developer.blender.org/D12989
2021-10-25 12:58:52 +02:00
Philipp Oeser
3c2e4f4cfd Fix T91411: Outliner crash using contextmenu operators from a shortcut
Oversight in {rBb0741e1dcbc5}.

This was guarded by an assert in `get_target_element`, but it can be
valid to have these assigned to a shortcut (and then perform the action
without an active outliner element).

Now remove the assert and let the operator polls check if we really have
a target element.

note: this basically makes `get_target_element` obsolete, could call
`outliner_find_element_with_flag` instead in all cases.

Maniphest Tasks: T91411

Differential Revision: https://developer.blender.org/D12495
2021-10-25 12:58:43 +02:00
Jacques Lucke
06ae3c98eb Spreadsheet: fix updating active domain when component type changes
The mesh and instances case wasn't handled before.
2021-10-25 12:46:39 +02:00
892e5f4a9f Asset Catalogs: be more accepting of backslashes as separators
Asset Catalog Paths should only contain forward slashes as separators, but
now the UI is more resilient to people using blackslashes instead.

Manifest Task: T90553
2021-10-25 12:37:35 +02:00
550cbec5c4 Cleanup: asset catalog path test, improve sub-test separation
Put related lines in a block of their own, such that each block doesn't
have access to the variables of the previous blocks.

This makes it easier to correctly copy-paste some tests, as the compiler
forces you to update the code afterwards.
2021-10-25 12:37:35 +02:00
Sergey Sharybin
31f6e78370 Fix T92073: Cycles flicker when panning in camera view with border render
Panning in camera view makes the border to be modified, which was causing
the Cycles display to believe the rendered result is unusable.

The solution is to draw the render result at the display parameters it was
updated for. This allows to avoid flickering during panning, zooming, and
camera FOV changes. The suboptimal aspect of this is that it has some jelly
effect, although it is on the same level as jelly effect of object outline
so it is not terrible.

Differential Revision: https://developer.blender.org/D12970
2021-10-25 12:12:10 +02:00
beea601e72 BKE Callbacks: more explicit initialisation check
Add static boolean to track whether the callbacks system has been
initialised. This makes it possible to make the `BKE_callback_remove()`
function more noisy in case of programming errors, and avoids accessing
`funcstore->alloc` when `funcstore` was potentially already freed.

Thanks @campbellbarton for pointing this out.
2021-10-25 12:08:08 +02:00
Jeroen Bakker
8e56f3e8a3 Image: Fix Crash During Undo.
Fixes T91294.
2021-10-25 11:41:49 +02:00
Jacques Lucke
b3ca926aa8 Geometry Nodes: use vector socket for offset in Set Position node
This replaces the boolean Offset input in the Set Position node with
a vector input. This makes the node easier to use. Using a "Position"
input as an "Offset" sounds wrong anyway.

The Position and Offset inputs are evaluated at the same time.

The versioning only works correctly when the Offset input was not connected
to something else before.

Differential Revision: https://developer.blender.org/D12983
2021-10-25 11:37:45 +02:00
Jacques Lucke
1ecb4e6fd8 Fix T92446: node editor overlays reset automatically
Caused by rBcf72b10075758be971f9806b97db01f98383aba2.

The fix is to only enable the flags when a new node editor is actually created.
2021-10-25 11:30:41 +02:00
Bastien Montagne
15762e9611 Fix T92430: Infinite recursion in some cases in new append code.
Shapekeys, always shapekeys... Since we cannot deal with them as regular
IDs, we need to handle potential recursion cases ourselves here. sigh.
2021-10-25 10:57:41 +02:00
Julian Eisel
d16e732638 UI: Refactor dropping support for the tree-view API
Introduces a dropping-controller API for the tree-view items,
`AbstractTreeViewItemDropController`. This reduces responsibilities of the main
tree-view item classes, which are already getting quite big. As I expect even
more functionality to be needed for it (e.g. drag support), it's better to
start introducing such controller types already.
2021-10-25 10:46:52 +02:00
Sergey Sharybin
c4fa17c67a Cycles: More accurate volume stack size calculation
The idea is to allow having a lot of non-intersecting volumes without
allocating volume stack to its full size.

With the F11285472 file the memory usage goes from 1400 MiB to 1000
on the RTX6000 card.

The fix makes it so the integrator work memory is allocated after
scene update which has downside of possible less efficient update
when some textures don't fit GPU memory, but has an advantage of
making proper decision and having a clear and consistent internal API.

Fixes memory part of T92014.

Differential Revision: https://developer.blender.org/D12966
2021-10-25 09:27:21 +02:00
Sergey Sharybin
8733d310e5 Cycles: Revert all host update specific changes
The approach didn't turn out to be that useful after all as there
are unavoidable dependencies of data from the device. For example,
to know whether object intersects volume or not it is required to
run displacement kernels.

The way of splitting host and device updates caused state where
some data is not yet available, causing confusion and leaving
code to be error-prone.
2021-10-25 09:27:21 +02:00
Harley Acheson
b714f9bf43 Fix T91931: Thumbnail Missing Region
Fixes a crash when blend thumbnails set to Camera View when there is
no camera, which resulted in use of a null region.

See D12748 for more details.

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

Reviewed by Campbell Barton
2021-10-24 22:12:20 -07:00
Andrea Beconcini
82ae7b990a Fix T90633: Frame all doesn't use meta range
This commit fixes T90633, it changes the behavior of the `Frame All`
operation when the user is tabbed into a metastrip: instead of using
the scene timeline's range, `Frame All` uses the current metastrip's
range.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D12974
2021-10-25 06:47:51 +02:00
Richard Antalik
84f7bf56a8 Fix T90855: Transform effect gives inconsistent output
When using downscaled preview size with proxies, transform effect
doesn't compensate for fact, that pixels are effectively larger. There
was compensation for scene render size already.

Use same compensation method as text effect uses for font size.
2021-10-25 05:35:54 +02:00
Richard Antalik
4266538ab9 Fix T90835: Strip snaps to first and second frame
This was caused by strips with single frame input like single image
strip or color strip. their length is always 1, and so content length
was calculated to end after first frame.

There was code handling this case, but it was also checking for
`anim_endofs` and `endstill` values. Anim offset values have no effect
on these strips and still frame value was used incorrectly. So these
chacks can be removed completely.
2021-10-25 04:33:43 +02:00
Richard Antalik
28ad680ff0 Fix T90836: Strip snaps to empty space
This was caused by snap to hold offset feature, which calculates strip
content boundary, but it can be outside of strip boundary.

Clamp content start and end values so they are always inside of strip.
2021-10-25 04:24:41 +02:00
Hans Goudey
3e75f70acd Geometry Nodes: Remove repeated instance attribute names in search
This commit makes sure that each attribute name is only added once
when logging geometry values for attribute search.

The `attribute_foreach` function for a single geometry component
deduplicated names, but a much more common situation is to have
more than one component in the instances of a geometry set.

Differential Revision: https://developer.blender.org/D12959
2021-10-24 13:24:02 -05:00
Jacques Lucke
6f0dd4f0f0 Fix: memory leak after type conversion in geometry nodes group
The leak happened when two things were true:
* Inside of a node group a socket is linked to a Group Input that has
  a different type.
* The corresponding input on the parent Group node is not linked.

The conversion happened correctly, but the original value wasn't
destructed.
2021-10-24 19:26:07 +02:00
Jacques Lucke
665657812d Cleanup: quiet asan warning because of uninitialized variable 2021-10-24 18:20:06 +02:00
Jacques Lucke
cc388651eb Fix T92327: use default value when field is passed into data socket
Previously, the computed value passed into the data socket could depend
on the actual field a bit. However, given that the link is marked as invalid
in the ui, the user should not depend on this behavior.
Using a default value is consistent with other cases when there are
invalid links.
2021-10-24 17:53:19 +02:00
Campbell Barton
6ce383a9df Cleanup: cross-reference right pointing arrow literal
This value is defined in the UI module, but happens to be used
in string_search.cc too. Note that these references need to be kept in
sync. Use escaped utf-8 sequence since the literal can be avoided.

Also replace BLI_str_utf8_as_unicode calls with constant assignments
as these values are known there is no need to decode a utf-8 sequence.
2021-10-24 22:38:25 +11:00
Campbell Barton
1411118055 Cleanup: spelling in comments 2021-10-24 21:04:04 +11:00
Campbell Barton
e288e392a8 Cleanup: line length in Python scripts 2021-10-24 21:04:04 +11:00
Erik Abrahamsson
dc2524eaae Geometry Nodes: Rename node "String Substring"
This patch renames the node "String Substring" to "Slice String"
to conform to the "verb first" naming convention.
Default length is also changed to 10 to make it easier for users
to understand what the node does.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D12931
2021-10-24 11:43:54 +02:00