1
1
Commit Graph

123109 Commits

Author SHA1 Message Date
3ce788e015 Progress on input properties, currently crashes 2023-04-12 16:48:59 -04:00
8be481fbd8 Fix missing update tag 2023-04-12 16:18:46 -04:00
a385a00821 Merge branch 'main' into node-group-operators 2023-04-12 15:58:29 -04:00
e35f971da1 Mesh: Avoid unnecessarily initializing corner topology arrays
This data should be initialized when building the mesh. If the arrays
aren't already initialized, there is already a bug. Theoretically this
could improve performance, since we can use `malloc` instead of
`calloc`. In practice I observed less than a 1% difference though.
2023-04-12 15:49:09 -04:00
a04098ebba Fix: Incorrect creation of deform mesh with no deform modifiers
Logic error in 99c630cd9c, hidden by a null check
in `BKE_id_copy_ex`.
2023-04-12 15:42:14 -04:00
16de3ba759 Fix #106845: Extrude node crash when no faces added
The non-individual face mode needs to check if there are any new faces
before accumulating their corner offsets.
2023-04-12 15:40:55 -04:00
e03da77033 Curves: Avoid unnecessary allocations in copy and move constructors
These aren't used much in current code, but currently they created
offsets on the result curves, then just freed them again when copying
from the source data. In the future it might be better to completely
avoid using the base constructor in the first place.
2023-04-12 15:32:30 -04:00
dccd42766c Cleanup: Use swap to take ownership of mesh data
Swap is commonly used to implement move assignment since it's short
and the logic is relatively simple. Use is here to avoid the need to
spell out the copying and freeing manually. The `BKE_id_free` call
at the end of the function will free whatever data was swapped.
2023-04-12 15:08:15 -04:00
642bc5546a Cleanup: Access curves offsets in RNA with C wrapper function
This simplifies the process of adding implicit sharing to the curve
offsets in the future.
2023-04-12 14:58:17 -04:00
b7e9906337 Cleanup: Remove unnecessary check when allocating mesh face offsets
The assert already checks this, but even in release builds,
doing nothing is probably worse than a memory leak here.
2023-04-12 14:56:28 -04:00
dd229a9d54 Cleanup: Slightly CurvesGeometry reorganize read function
The curve types and the runtime always have to be created when reading
the file from disk, so we might as well do that in `blend_read`, which
will help in the future when the offsets use implicit sharing.
2023-04-12 14:54:18 -04:00
87cd22f643 Cleanup: Use early return in legacy curve conversion
Return null instead of an empty curves data-block, which amounts to
the same thing in geometry nodes, with less potential for error in
the rest of the function.
2023-04-12 14:51:24 -04:00
2b6c1600cf UI: Allow Float Kerning for Text Objects
Change Text Object character `kern` member to float from int, and allow
fractional changes to kerning with Shift-Alt-arrows.

Pull Request: blender/blender#105181
2023-04-12 19:11:53 +02:00
0ee0e8c0d4 UI: Tooltips for Assets
Show tooltips for Asset Browser items.

Pull Request: blender/blender#106189
2023-04-12 18:44:47 +02:00
000aef6e5e Cleanup: Use references in mesh.cc 2023-04-12 11:49:43 -04:00
baf6892270 Cleanup: Add utility function for clearing mesh geometry
The existing utility cleared vertex group names and active attribute
names, which doesn't always make sense when the geometry is
replaced but the custom data layout remains mainly unchanged.
2023-04-12 11:49:43 -04:00
2771f53cb7 UI: Fix disconnected and non-clickable checkbox labels in popovers
For popovers, draw the checkbox in header as usual with label, but
hide the panel header label, see ed870f87b9.

Patch by Yevgeny Makarov (@jenkm) in
https://archive.blender.org/developer/D9586

Co-authored-by: Yevgeny Makarov <jenkm>
Pull Request: blender/blender#105657
2023-04-12 17:00:51 +02:00
c738d8df84 Cleanup: VSE clipboard: Remove code in blo_lib_link_restore.
This code (looking for matching new IDs to restore by name) is called
from `set_app_data` after a .blend file has been read (also in memfile
undo case).

The part handling VSE clipboard to restore ID pointers is not really
needed, since pasting VSE strips already ensures stored ID pointers are
still valid, and tries to find a new matching one otherwise.
2023-04-12 16:18:25 +02:00
c40ce3baae Cleanup: I18n: sort disambiguation contexts from BLT_translation.h
The contexts appear twice, in the list of #defines and in the
BLT_I18NCONTEXTS_DESC. Both had gotten out of alphabetical order, and
out of sync.

Pull Request: blender/blender#106718
2023-04-12 15:09:21 +02:00
5cf365554b I18n: disambiguate a few messages
- "Lens" can be a transparent object used in cameras, or specifically
  its property of focal length
- "Empty" can be an adjective meaning void, or an object type. The
  latter is already disambiguated using `ID_ID`
- "New" and "Old" are adjectives that can have agreements in some
  languages
- "Modified" is an adjective that can have agreement in some languages
- "Clipping" can be a property of a camera, or a behavior of the
  mirror modifier
- "Value" in HSV nodes, see #105113
- "Area" in the Face Area geometry node, can mean a measurement or a
  window type
- "New" is an adjective that can have agreement
- "Tab" can be a UI element or a whitespace character
- "Volume" can mean a measurement or an object type. The latter is
  already disambiguated using `ID_ID`

These changes introduce the new `BLT_I18NCONTEXT_TIME` translation
context.

They also remove `BLT_I18NCONTEXT_VIRTUAL_REALITY`, which I added at
one point but then couldn't find which messages I wanted to fix with
it.

Ref #43295

Pull Request: #106718
2023-04-12 15:09:17 +02:00
c31434a570 Cleanup: Remove setting polygon loop total from Python
This property is not editable after 7966cd16d6,
though doing so didn't seem to give an error. It doesn't have
to be set anymore, since the data is redundant with the
"loop_start" anyway.
2023-04-12 08:38:32 -04:00
30d8cb3be8 Fix #106246: Outliner: Crash on deleting the multi-level objects hierarchy.
Existing code was intrisically wrong, and also potentially very
innefficient.

Now tagging objects for deletion and removal is separated from actual
collection removal and object deletion. This makes the code safer,
simpler and more efficient.

NOTE: There is still an unsolved (already existing in original code)
issue with checks on objects that should not be deleted, noted in code.

Pull Request: blender/blender#106821
2023-04-12 14:25:40 +02:00
81815681d0 Python API: Add function to create links to virtual sockets
Links created through the normal Python API are invalid since
7026096099. Before then, one could create links to or from virtual
sockets from Python (grayed out sockets in Group Input and Group
Output nodes), as is still possible in the GUI.

This is documented as an API change, and it broke at least Node
Wrangler, see blender/blender-addons#104470. Instead of just fixing
that, let's introduce an API to make this operation simpler.

Pull Request: blender/blender#105975
2023-04-12 14:18:29 +02:00
9ffd413008 macOS/Linker: support mold and lld
If someone buys "sold", mold should work on macOS too.
With lld, Blender (700 MB) intel i5: 26s -> 17s.

Pull Request #106843
2023-04-12 17:01:53 +05:30
da75495ada Fix user add-ons not showing up with "User" filter in Preferences
Mistake in ba25023d22, updated the drawing code with the wrong function
call. So when setting the add-ons category to "User", add-ons installed
in the user paths (custom paths configured in Preferences) wouldn't show
up.
2023-04-12 13:04:54 +02:00
ac09d18e4e Fix #106840: Add-ons not loading from custom script directories
`script_paths()` wasn't updated correctly, but that was hidden by some
compabtibility logic that was in the patch earlier. Only with my last
change to the PR before merging it that was removed and the error became
quite visible.
2023-04-12 13:02:31 +02:00
3f4f975228 I18n: fix footer in the text editor when loading an external file
When loading an external file in the text editor, the footer text
stating "File: <file>" or "File: <file> (unsaved)" was not translated,
because the translation happened after string formatting, and the
message was thus not found in the po files.

Pull Request: blender/blender#106716
2023-04-12 12:19:00 +02:00
007c9e4e47 Fix #106427: Vector Math node does not appear in node search
When trying to search for the Vector Math node with a translated
interface, the node did not come up because it did not use the proper
translation context.

The Vector Math node's RNA had a translation context added in
db87e2a638, in order for the Floor operation to be disambiguated. I
made a mistake and added the context to the entire node struct instead
of just the Operation prop. This had the result that the Vector Math
was searched with an empty context in the search menu, but could not
be found.

Replacing the translation context from the struct to the property
fixes the issue, and actually allows disambiguating operations such as
Floor, which wasn't achieved previously.

Pull Request: blender/blender#106579
2023-04-12 12:01:48 +02:00
1771ded381 Fix: Call OpenImageIO correctly when creating grayscale images
The call to `channel_sum` requires that the `weights` array is at least
as large as the number of channels in the originating buffer.

Switch to use the span overload as well since the method that takes a
raw weights array is deprecated.

Thanks to @aras_p for debugging the issue.

Pull Request: blender/blender#106847
2023-04-12 10:23:34 +02:00
022652beb9 Fix #106794: Changing active camera changes other viewport local cameras
f36543c5f5 took care of syncing multiple viewport`s cameras, but wasnt
fully meeting intentions [which was to only do this if both viewports
are locked to the scene camera].

Check was only done for the viewport this was executed in (if this was
locked to the scene camera, it would change all other viewports as
well), now also check if the target viewport prefers to use its own
local camera instead and skip it in that case.

Pull Request: blender/blender#106799
2023-04-12 10:10:12 +02:00
13d9a6c929 Cleanup: improve comments for makesrna dependency workaround 2023-04-12 17:23:08 +10:00
28a8a3c086 Fix crash on startup under the RIVER Wayland compositor
Defer acting on the tag to update scale as it caused the window
to use the wrong scale on startup & exit.

GTK/KDE applications seem to postpone updating scale so use this by
default as glitches with scale tend to be caused by updating the scale
too frequently instead of not quickly enough.
2023-04-12 15:54:06 +10:00
ddb6928882 GHOST/Wayland: resize the EGL buffer & change surface scale immediately
There is no need to postpone these operations when configuring the frame
only postpone committing the surface change.

Deferring these operations caused flickering when moving windows
between monitors of different scale on both GNOME & KDE.
2023-04-12 15:54:06 +10:00
1f3949f1cf Fix building WITH_CINEON=OFF 2023-04-12 15:54:06 +10:00
aa3bdfd76a Image: Use OpenImageIO for loading and saving a variety of image formats
This checkin will use OIIO to replace the image save/load code for BMP,
DDS, DPX, HDR, PNG, TGA, and TIFF.

This simplifies our build environment, reduces binary duplication,
removes large amounts of hard to maintain code, and fixes some bugs
along the way.

It should also help reduce rare differences between Blender and Cycles
which already uses OIIO for most situations. Or potentially makes them
easier to solve once discovered.

This is a continuation of the work for #101413

Pull Request: blender/blender#105785
2023-04-12 05:22:26 +02:00
c6d6869171 GHOST/Wayland: suppress EGL_BAD_SURFACE error on exit
Freeing ContextEGL would attempt to free the context's EGLSurface,
which was already freed by the native-window, causing 2x bad-surface
errors on exit.

Suppress the warning by clearing the surface from releaseNativeHandles
when the surface was created by a native window.
2023-04-12 13:12:01 +10:00
b6457dc568 Fix #106740: VSE Image sequence can't be loaded from python
Caused by introduction of `SEQ_SINGLE_FRAME_CONTENT` flag (66eedc542b).
The flag was not updated in `SequenceElements` `append` and `pop`
functions.
2023-04-12 03:40:07 +02:00
6fa80d1e1d Cleanup: add doc-strings to upper/lowecase functions
Move detailed note into the implementation.
2023-04-12 11:24:12 +10:00
ccea39b538 Cleanup: spelling in comments 2023-04-12 11:24:10 +10:00
5df8e35da7 UI: Add slash separators to Hue/Saturation/Value
It was that names of related "combo" operations
like Hue/Saturation/Value, *Dilate/Erode*
and Brightness/Contrast should be separated
by slashes in their names.

This patch changes this for the multiple nodes
and operators concerning Hue/Saturation/Value
across Blender.

Note1: This patch should only touch UI names
which do not need versioning and should not
break scripts.

Note2: This breaks first letter fuzzy search
for "hsv". It was noted by @HooglyBoogly that
the "/" character needs to be added to the
fuzzy search split list. Note however that such
search is already broken in Main for nodes like
Brightness/Contrast and Dilate/Erode which
already use slash separators

Pull Request: blender/blender#106721
2023-04-11 23:48:05 +02:00
4170545dc5 Fix #106828: Extrude individual mode crash on mesh with no faces
Caused by 7966cd16d6
2023-04-11 15:34:03 -04:00
f8108d6dfd UI: Rename Bright/Contrast to Brightness/Contrast
Rename *Bright/Contrast* to *Brightness/Contrast* in order to avoid the use of shortened names and improve consistency within Blender and with industry conventions.

Reasoning:

The modified color characteristic is called *brightness*, not *bright*. You don't modify the *bright* of an image.

This also interferes with search in case someone searches for brightness, producing no results.

*Note: This patch should only touch UI names which do not need versioning. It leaves the actual property name in nodes for a future breaking release.*

Pull Request: blender/blender#104998
2023-04-11 21:32:29 +02:00
fd234fe1ce Fix #106745: Subdivision surface crash with more than 8 UV maps
Before 6c774feba2, the maximum number of UV maps was
enforced throughout Blender. Now it has to be enforced in the few places
that actually have the limit. In the future the limit of the subsurf
could be lifted, but that isn't done now to keep the crash fix simple.
2023-04-11 15:28:08 -04:00
99c630cd9c Fix #106802: Incorrect modifier deform evaluation result
Since the positions of the final mesh are modified rather than a
separate array after d20f992322, the final mesh has
to become the deformed mesh after the deform modifiers, rather
than the input mesh. The arrays can't be shared anymore, but that
performance loss will be solved by implicit sharing shortly.
2023-04-11 14:00:16 -04:00
1a6cfa1ae1 Fix: Incorrect mesh data used in mesh remap code
Mistake in 7966cd16d6
Related to #106671
2023-04-11 13:29:12 -04:00
c7995f3185 Fix #106366: Handle exceptions in add fur operator
Give errors in a few cases:
- The mesh has no UV map
- The faces have no area
- The applied modifier has no curve data (it may have been modified)

Use errors instead of cancelling the operator completely so the
operator can still do something useful when many meshes are
selected and only some fail.

Pull Request: blender/blender#106823
2023-04-11 19:19:41 +02:00
03c4173d81 Fix #106780: Crash with sculpt undo and poly offsets
The poly offsets need to be copied when converting a geometry
undo step into a full mesh, they were only assigned.
2023-04-11 12:35:52 -04:00
cd30bce7f1 Fix #106743: Crash writing with legacy mesh format
The new poly offsets were needed to interpolate attribute to a different
domain, but they were cleared when the legacy MPoly array was built.
Instead just clear the offsets a bit later after the other conversions.
2023-04-11 12:27:41 -04:00
90ad930a01 Fix #106778: Incomplete copy of curves radius to Cycles
The number of curves was used as a number of points by mistake.
Caused by ae017b3ab7.
2023-04-11 12:02:05 -04:00
4472717de2 Cleanup: Remove unnecessary PBVH attribute pointer
Material indices are only used when the structure is built. It's simpler
not to keep a longer-term reference available if it isn't needed.
2023-04-11 11:06:36 -04:00