Commit Graph

96048 Commits

Author SHA1 Message Date
bb543620ae Fix invalid UTF8 strings being copied into the Python console
Add a ensure_utf8 argument to WM_clipboard_text_get so callers don't
have to handle validation themselves.

Copying non-utf8 text into the Python console and buttons was possible,
causing invalid cursor position and a UnicodeDecodeError accessing
ConsoleLine.body from Python.
2023-05-19 12:49:27 +10:00
6dcebc68d6 Fix "~" expanding to the default document directory instead of HOME
Originally this function expanded to the home however on WIN32
functionality changed to return the default Documents directory & the
function was renamed. Always expand "~" to the users home directory
since that's what it represents when used at the beginning of a path.
2023-05-18 13:30:40 +10:00
112a5196f6 Fix: Missing loose vertices converting BMesh to Mesh
Mistake in 6323d56eb5
2023-05-17 11:58:49 -04:00
5531d610f9 Fix warning in USD curves exporter
Use timecode.GetValue() to fix warning about passing correct 'double' type to 'WM_reportf'

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: blender/blender#108008
2023-05-17 14:43:59 +02:00
2dd0a08aff Release cycle: 3.6 enters beta, Bcon3.
Splash screen: Pet Projects, Blender Studio.
2023-05-17 13:02:49 +02:00
2d66a0ef84 EEVEE: Add Transparent Render-Pass option
This renderpass pass outputs alpha blender surface
to allow combining them with the opaque passes.

Limitation: This only supports monochromatic opacity.
Colored opacity will show differently than in combined pass.

Pull Request: blender/blender#107890
2023-05-17 11:57:36 +02:00
39644e7f71 Workbench: Fix compiler warnings 2023-05-17 11:52:49 +02:00
eac3d37ab1 Fix #107422: Mesh context menus do not open with the last used option
Caused by 99e5024e97

Above commit changed behavior in that it only flagged the `uiBlock` with
`UI_BLOCK_POPUP_MEMORY` in case a Menu's title was provided to
`ui_popup_menu_create_block`. Now when is the title provided? This
depends on the `bl_label` set in the menu class. But this is not always
the case, there are some menus that have a blank `bl_label` (as seen
with `VIEW3D_MT_edit_mesh_context_menu` for example -- this specifies its
own label inside the draw function depending on vertex/edge/face mode).
Thus the provided title is not really reliable as source information to
do the flagging (also see for example
a38b98478a), flagging should **always** be
done [and only check a title for actually inserting in the puphash].

Choosing an entry in a menu will still handle puphash later (see
`button_activate_exit`) though multiple menus without a label might fight for the
same storage of the menu memory. Using idname instead (or in combination with
the label) for the hash could be looked at to solve this.

Pull Request: blender/blender#107427
2023-05-17 10:41:17 +02:00
a5207ae24d Fix error returning the path length from BLI_path_normalize
Error in [0] caused the returned length to be wrong when skipping the
prefix. Also fix normalized path comparison failing on windows.

[0]: f45a985217
2023-05-17 17:47:35 +10:00
e27cb91442 BLI_path: add native path canonicalize function
This function handles cleaning valid system paths that are functional
when passed to `open(..)` but may be relative to the current working
directory or have redundant slashers that can be normalized.
2023-05-17 13:42:51 +10:00
0099f51cdd Cleanup: sort file, uppercase booleans, add missing headers
Also update files to ignore for check_cmake.
2023-05-17 13:13:10 +10:00
139f4981d4 Cleanup: return early, reduce indentation 2023-05-17 13:13:10 +10:00
1d32a36540 Cleanup: add utility functions for checking WIN32 drive letters
Avoid character checks in-line.
2023-05-17 13:13:10 +10:00
52eb1f2ba0 Cleanup: use BLI_rename where overwriting isn't needed
Use BLI_rename as the destination is removed before renaming.
2023-05-17 13:13:10 +10:00
f45a985217 Cleanup: use BLI_path_slash_ensure instead of performing this in-line
- Add BLI_path_slash_ensure_ex which takes the string length.
- Normalize functions now return the string length,
  so ensuring trailing a trailing slash is a simple check.

This would have avoided the off-by-one error from
761eac2f5d.
2023-05-17 13:12:49 +10:00
761eac2f5d Fix buffer overflow in BLI_path_append 2023-05-17 13:11:17 +10:00
0ae286be03 Fix trailing slashes causing normalized path comparison to fail 2023-05-17 13:11:17 +10:00
f1d436a3aa Core: Improve error message for make relative/make absolute operators
This improves the warning messages when make relative/absolute fails to add more context and help in tracking down problems.

Pull Request: blender/blender#107914
2023-05-17 05:02:39 +02:00
c8b5b17d40 Cleanup: format 2023-05-17 11:35:46 +12:00
354ef89d20 Fix lite build error
Missing dummy function definition in 4dc026ec8e.
2023-05-17 01:03:47 +02:00
4dc026ec8e VSE: Smooth transition for retiming tool
This feature implements smooth transition between 2 retimed segments.

A transition can be added by dragging retiming handle while holding
shift key. When any handle defining transition is removed, the
transition segment is removed and 2 linear segments are restored to
state before transition was created.

These transitions work with video and sound and changes are reflected
in waveforms with correct seeking, therefore it replaces usage of
`speed_factor` or earlier sound `pitch` property.

Smooth transition is achieved by evaluating Y value of circular arc,
that is tangent to lines of linear retimed segments. Because of this,
when transition length is changed both handles are moved symetrically.
This way it is possible to make transition without affecting content in
linear segments.
When linear segment after transition is further retimed, this shifts
content inside of a transition segment.

To support sound, `SEQ_retiming_sound_animation_data_set` and related
data structures has been updated to build speed table for each smooth
transition segment. Layering of retiming data via meta strips is still
fully supported.

Pull Request: blender/blender#107197
2023-05-16 22:33:13 +02:00
35be844c34 Fix #106621: Crash Adding GN Menus to Quick Favorites
Check for empty AssetItemTree when accessing Quick Favorite menu items.

Pull Request: blender/blender#107984
2023-05-16 20:50:46 +02:00
75c2d511ad Fix: Add 'typename' to fix build error
A `typename` was missing in 3195c1a669 which caused build errors
on all platforms except Windows.
2023-05-16 20:05:17 +02:00
1164976dd8 USD Export: New Curves/Hair Support
Previous patch location: https://archive.blender.org/developer/D16545

This patch addresses blender/blender#102376

A new writer is added, the usd_writer_curves.cc to handle transforming the new curves system into USD.

The goal was to enable export of the new curves type, but @HooglyBoogly mentioned there is a `curve_legacy_to_curves` utility function that could also handle converting legacy curves to the new Curves type. This very trivially enables the legacy curves for export too so I have included that change in this patch.

Co-authored-by: DESKTOP-ON14TH5\Sonny Campbell <sonny.campbell@unity3d.com>
Pull Request: blender/blender#105375
2023-05-16 20:04:18 +02:00
6ae44c4770 UI: Allow Configuration of Some Operator Confirmations
Allow users to disable/enable 14 operator confirmations in the Keymap
Editor.

Pull Request: blender/blender#107765
2023-05-16 20:03:45 +02:00
fc70eb1fb5 Fix #106655: Update Mesh Symmetry Buttons
Update the XYZ Symmetry buttons if they are toggled without mouse
click, for example from a script or keyboard shortcut.

Pull Request: blender/blender#106679
2023-05-16 19:24:44 +02:00
3195c1a669 Geometry Nodes: Add Sample Volume node
This commit adds a new experimental node "Sample Volume".
It's purpose is to be able to sample values from a volume grid given
a position field.
The 'Grid' input accepts a named attribute input with the name
of the volume grid to sample. Values will be implicitly converted
from the grid type to the specified value type.

Pull Request: #107656
2023-05-16 19:08:08 +02:00
cc498697ab Cleanup: Core: lib_query: Make names of self and owner ID data consistent.
Internal private struct was using `owner_id`/`self_id`, while the public
callback data struct was using `id_owner`/`id_self`.

Now using internal naming everywhere in lib_query related code, as
`owner_id` is already used in very low-level 'fundamental' part of the
code, e.g. in the `PointerRNA` struct, or in ID's 'loopback' pointers
for embedded data.

Note that this is only a very small first step toward proper naming
consistency for these type of data, the mismatch is currently spread all
over the code base.

We also need to document more formally the meaning and differences
between `self` and `owner` here.
2023-05-16 18:37:35 +02:00
122adc9e69 Fix asset list not providing some previews
Fixes preview images not showing up in asset-view templates or the in
development asset shelf.

The sliding-window optimization to only load previews that are in view
(or close to it) can't really be used by the asset-list API, since
figuring out what's actually in view is a bit tricky. So we have to
ensure all previews are loaded for now.
2023-05-16 17:48:02 +02:00
74b5e62d2a Fix #107633: USD import: duplicate shader nodes
This pull request addresses bug blender/blender#107633

Added logic to avoid creating duplicate Blender shader nodes when
converting USD Preview Surface shaders that are connected to more
than one input.

This change adds a `NodePlacementContext::node_cache` map to record
Blender nodes converted for given USD shaders.  The node creation
logic has been updated to query this cache to check if a node was
previously created for a given USD shader, before creating a
new node.

Pull Request: blender/blender#107945
2023-05-16 17:46:25 +02:00
859c0d9edf Cleanup: Remove redundant node type lookup function
Using the topology map gives a constant time lookup, since it has a map
of nodes per type. The collada code used the old function, but had been
ifdef'd for four years, so it's removed here.
2023-05-16 11:09:42 -04:00
216cb9e3f0 Fix: Assert loading undefined geometry node 2023-05-16 11:09:42 -04:00
eb0e03bae7 Workbench Next: Volumes
Port of the Workbench volumes to Workbench Next using the new Draw Manager API.

Pull Request: blender/blender#105501
2023-05-16 16:56:21 +02:00
ce83b26a33 Fix #107903: USD export: output emissiveColor in UsdPreviewSurface
Added support for emissiveColor in UsdPreviewSurface export, mapping the
PrincipledShader's Emission input to it.

Co-authored-by: pwflocal <drwave@apple.com>
Pull Request: blender/blender#107947

A similar solution was also proposed and discussed in pull request
blender/blender#104490
by Ashley Ruglys <ashley.ruglys@gmail.com>.
2023-05-16 15:57:26 +02:00
d87547abd5 Cleanup: Remove unused node function for finding link
Nowadays it's much better to use the topology cache.
2023-05-16 09:44:41 -04:00
320ac28f75 Cleanup: Remove unnecessary struct keywords in node header 2023-05-16 09:43:05 -04:00
f3babec2df Cleanup: Undo move of functions in previous node cleanup commit
Functions were moved as part of f7388e3be5, which was
unnecessarily noisy. Instead of reverting, move the definitions back
to their original place in node.cc. Also move a few more things to
the blender::bke namespace.
2023-05-16 09:39:53 -04:00
3b4354d4fb EEVEE Next: Default world null check before free
Fix previous commit
2023-05-16 15:35:44 +02:00
d0e635d077 EEVEE Next: Fix crash on Scenes without a World
Create a default world when scenes don't have one.
This is a 1:1 copy of the current EEVEE implementation.

Pull Request: blender/blender#107891
2023-05-16 15:06:43 +02:00
932baa18b7 Fix #106558: Add Primitive tool options not saving
Since a generic snap cursor was implemented (which can be used by Tools and by DragDrop), the Placement Settings are no longer a settings of the "VIEW3D_OT_interactive_add" Operator.

With that implementation, those properties started to be defined in a
static struct, filled in at runtime and accessed in the UI through
workarrounds.

As they are properties initialized at runtime, they are not saved in
the file.

The solution is to move the Placement Settings to `ToolSettings`.

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: blender/blender#107951
2023-05-16 15:00:45 +02:00
b905b02222 Remove newly added "Theme" i18n context, replace its use by "Color"
Pull Request: blender/blender#107139
2023-05-16 14:52:05 +02:00
dc999d83b4 I18n: disambiguate a few messages
- "Out" meaning "one end of a bone". Same as in 9120c86c3f.
- "Canvas" meaning a painting support for Dynamic Paint.
- "Twist" meaning an action verb, as opposed to an amount.
- "Solid" meaning a textureless, single-color material.
- "Blend mode" meaning material opacity blending, as opposed to color
  blending.
- "Pixel Size" meaning "a size measured using pixels as the unit".
- "Light" meaning "not dark", as in "Light Theme".

Ref #43295
2023-05-16 14:51:52 +02:00
22f641e7f8 Cleanup: I18n: Remove extraction macros from node socket declarations
The previous two commits introduced new regexes to extract node socket
names and descriptions automatically from the i18n Python module,
including socket labels.

This commit removes the extraction macros from all node files since
they are now redundant.

Pull Request: blender/blender#107258
2023-05-16 14:12:54 +02:00
8fb6b51410 GPU: Fix false positive include of debug_draw
This created unfulfilled resources binds that would
trigger an assert when running with Metal Backend.
2023-05-16 12:54:29 +02:00
88f536dc02 Add always-positive modulo function
Add modulo function `mod_f_positive(f, n)` that returns a positive result,
regardless of the sign of `f`.

For example, `mod_f_positive(-0.1, 1.0)` returns `0.9`, whereas the
standard `fmodf()` function would return `-0.1`.

This is useful for rewrapping values to a specific interval.
2023-05-16 11:41:17 +02:00
072002a672 I18n: translate Quick Fur data
The Quick Fur operator creates a curves object with hair modifiers and
a material.
These modifiers' and material's names can be translated if the user
chose to translate data in the preferences.

Only the modifier names are translated, the node groups are not
because they may be reused instead of appended again.

Pull Request: blender/blender#107909
2023-05-16 10:46:10 +02:00
7849857dfb I18n: extract messages related to paint curves
Two new messages are extracted:
- "New" in the context of paint curves. Used for the template_ID to
  create a new curve;
- "PaintCurve", the default name of a newly-created paint curve.

Pull Request: blender/blender#107888
2023-05-16 10:42:32 +02:00
e268f42e02 I18n: extract a few messages
A few new messages were extracted.

- "Catalog", the default name when creating a new catalog.
- Tooltips related to drag and dropping catalogs in the asset browser.
  Some use `fmt::format()` as a possible solution to messages
  currently extracted with string concatenation as mentioned in
  #92758.

Pull Request: blender/blender#107710
2023-05-16 10:41:25 +02:00
6daa3f6b8a UV: Fix packing problem with locked-position and large island count 2023-05-16 17:19:31 +12:00
36c682c551 Cleanup: remove redundant call to mat4_to_size 2023-05-16 14:41:21 +10:00