GPv3: Curve to Mesh node #113659

Manually merged
Dalai Felinto merged 86 commits from dfelinto/blender:grease-nodes-curve-to-mesh into main 2023-10-16 11:49:25 +02:00

86 Commits

Author SHA1 Message Date
Dalai Felinto 9c22af32a9 Cleanup: Remove unecesary includes 2023-10-16 11:30:22 +02:00
Dalai Felinto 47cfeb45d8 GPv3: Delete Geometry node
Incorporated the cleanup and tweaks from Hans Goudey to return CurvesGeometry directly.

Part of #113602.

Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113721
2023-10-16 11:29:07 +02:00
Omar Emara 9f1538b586 Cleanup: Move compositor headers to c++
buildbot/vdev-code-daily-coordinator Build done. Details
Pull Request: #113758
2023-10-16 10:45:54 +02:00
Jeroen Bakker 6a34dc2853 Cleanup: Make format
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-16 08:12:10 +02:00
Jesse Yurkovich 51846d8173 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-15 19:01:10 -07:00
Jesse Yurkovich 49e4923384 Fix #113697: Fix timer leak from panel drag/animate processing
buildbot/v400-code-daily-coordinator Build done. Details
When clicking or dragging a Panel's drag handle, a PANEL_STATE_DRAG
state transition is followed immediately by a PANEL_STATE_ANIMATE
transition.  Both transitions start a timer.

Unfortunately, a subtle change introduced in
f3ab698951 meant the first timer would no
longer be destroyed before starting the second one.

The fix is to just reuse the timer if it's already present so that a
second one is not created in the first place.

Pull Request: #113711
2023-10-16 04:00:15 +02:00
Campbell Barton 89efeedd5b Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-16 10:35:45 +11:00
Campbell Barton db36c9f204 Merge branch 'blender-v4.0-release' 2023-10-16 10:35:42 +11:00
Campbell Barton ed2e42d62c Merge branch 'blender-v4.0-release' 2023-10-16 10:35:39 +11:00
Campbell Barton f95ee3e871 Fix incorrect window decoration size with Wayland & libdecor on startup
buildbot/v400-code-daily-coordinator Build done. Details
When fractional scaling was used with libdecor the window decorations
would not match the window size on startup, drawing small and on top
of Blender's window.
While there are still glitches with fractional-scaling & libdecor
(which doesn't support fractional scaling),
see #109194 this at least resolves one of the worst issues.
2023-10-16 10:01:00 +11:00
Campbell Barton e8f2c3e45f GHOST/Wayland: don't preempt new windows buffer fractional scale
When a new window is created the final buffer scale isn't known
so setting the buffer scale assuming the final state was just a guess
and only had the minor advantage of preventing rounding the window size
on startup.

Removing this to resolve a bug with LIBDECOR & fractional scaling
relating to #109194 (will commit separately).
2023-10-16 09:50:44 +11:00
Iliya Katushenock 4d91c50b62 Fix #113429: Dirty evaluated curve
buildbot/v400-code-daily-coordinator Build done. Details
Tag curve topology as dirty after changing of types of handles.

Pull Request: #113717
2023-10-15 20:59:21 +02:00
Jacques Lucke d76263de96 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-15 20:50:12 +02:00
Jacques Lucke c584b6434f Fix #113691: crash when Interpolate Curves input has zero curves
The crash happened only when there was a `Curves` geometry, but
it was empty.
2023-10-15 20:49:48 +02:00
Damien Picard fa5bb53f5c Fix: Python node_utils.connect_sockets broken after API change
After the recent introduction of node panels, the utility that
allowed scripters to connect sockets to or from a virtual socket was
broken. This happens when creating an interface before connecting
sockets. Sockets can have a subtype, while interfaces cannot.

For instance, the `NodeSocketFloatFactor` type cannot be used
directly, it has to be converted to `NodeSocketFloat`.

This commit chooses an appropriate type for the new interface before
creating it, based on the socket's `type` property.

Pull Request: #113630
2023-10-15 20:38:43 +02:00
Hans Goudey 030932e8df Merge branch 'blender-v4.0-release' 2023-10-15 20:31:50 +02:00
Jacques Lucke 38813a7441 Nodes: unify static and dynamic declarations
This helps solving the problem encountered in #113553. The problem is that we
currently can't support link-drag-search for nodes which have a dynamic declaration.

With this patch, there is only a single `declare` function per node type, instead of
the separate `declare` and `declare_dynamic` functions. The new `declare` function
has access to the node and tree. However, both are allowed to be null. The final
node declaration has a flag for whether it depends on the node context or not.

Nodes that previously had a dynamic declaration should now create as much of
the declaration as possible that does not depend on the node. This allows code
like for link-drag-search to take those sockets into account even if the other
sockets are dynamic.

For node declarations that have dynamic types (e.g. Switch node), we can also
add extra information to the static node declaration, like the identifier of the socket
with the dynamic type. This is not part of this patch though.

I can think of two main alternatives to the approach implemented here:
* Define two separate functions for dynamic nodes. One that creates the "static
  declaration" without node context, and on that creates the actual declaration with
  node context.
* Have a single declare function that generates "build instructions" for the actual
  node declaration. So instead of building the final declaration directly, one can for
  example add a socket whose type depends on a specific rna path in the node.
  The actual node declaration is then automatically generated based on the build
  instructions. This becomes quite a bit more tricky with dynamic amounts of sockets
  and introduces another indirection between declarations and what sockets the node
  actually has.

I found the approach implemented in this patch to lead to the least amount of
boilerplate (doesn't require a seperate "build instructions" data structure) and code
duplication (socket properties are still only defined in one place). At the same time,
it offers more flexibility to how nodes can be dynamic.

Pull Request: #113742
2023-10-15 20:28:23 +02:00
Hans Goudey 601fba20a6 Fix #113619: Incorrect nested group assets in compositor add menu
buildbot/v400-code-daily-coordinator Build done. Details
The menu structure currently needs to be duplicated in the code to avoid
adding assets to more than one menu. This was done for geometry nodes
in b49c84276c but was missed for the compositor and shader
nodes. Also remove an unnecessary separator.
2023-10-15 19:52:38 +02:00
Hans Goudey d3151df74a Fix #113736: Add modifier menu broken for surface objects
This object type doesn't support geometry nodes currently.
2023-10-15 19:22:21 +02:00
Hans Goudey e083be6a9c Fix #113737: Missing UI text for geometry nodes handle type properties 2023-10-15 19:19:42 +02:00
Harley Acheson d578170131 Cleanup: Make format
buildbot/v400-code-daily-coordinator Build done. Details
Format changes resulting from Make Format
2023-10-15 09:09:30 -07:00
Harley Acheson 03655189d7 Fix #113735: Space Characters in UI Text Entry #113749
With #113707 text cursor position is set using the character's visible
bounds, so special care is needed for those without bounds like space.
Forgot this also applies to 4.0.
2023-10-15 09:06:44 -07:00
Harley Acheson b6131cc338 Cleanup: Make format
buildbot/vdev-code-daily-coordinator Build done. Details
Formatting changes resulting from Make Format
2023-10-15 08:45:11 -07:00
Harley Acheson c6c86b555d Fix #113735: Space Characters in UI Text Entry
With #113707 text cursor position is set using the character's visible
bounds, so special care is needed for those without bounds like space.

Pull Request: #113749
2023-10-15 17:42:28 +02:00
Harley Acheson 1423ece1eb Cleanup: Compilation Error in wm_playanim.cc
buildbot/vdev-code-daily-coordinator Build done. Details
If compiling without WITH_AUDASPACE a structure contains too many
initializers. Caused by 4454561a5f
2023-10-15 07:56:11 -07:00
Clément Foucault ba89723abc Cleanup: EEVEE-Next: Volume AABB
buildbot/vdev-code-daily-coordinator Build done. Details
Make interface a bit more lined up with the
rest of the BLI API. Also use more of the
vector API.
2023-10-15 15:07:44 +02:00
Jacques Lucke 14fa963910 Cleanup: move node declaration code out of header
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-15 12:43:02 +02:00
Campbell Barton 46dedaf960 Cleanup: use C++ style casts in for the animation player
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-15 15:04:35 +11:00
Campbell Barton a3243cf5c3 PlayAnim: errors loading images are now shown in the UI
It's unlikely most users will see these messages in the stdout,
show them after the filepath as well as logging them.
2023-10-15 15:04:32 +11:00
Campbell Barton 63cb5ec1b2 Cleanup: use full sentences for comments in playanim 2023-10-15 15:04:30 +11:00
Campbell Barton 4454561a5f Cleanup: move animation globals into a struct
Avoid having many top-level static variables, make these more clearly
global by moving them into a struct.

Also use less cryptic terms for members.
2023-10-15 15:04:28 +11:00
Campbell Barton 492653e52d Cleanup: move PlayAnimPict from a global into PlayState
Avoid having as many globals, preferring PlayState where possible.
2023-10-15 15:04:27 +11:00
Campbell Barton e6b9465601 Cleanup: reduce indentation for the animation player argument parsing 2023-10-15 15:04:25 +11:00
Harley Acheson 13de143ba8 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-14 12:00:08 -07:00
Harley Acheson b772603843 Fix #113682: Improved Text Caret Position
buildbot/v400-code-daily-coordinator Build done. Details
For regular UI text entry, place the text caret exactly between
adjacent glyph bounds instead of just using partial text length to
position it.

Pull Request: #113707
2023-10-14 20:58:50 +02:00
Harley Acheson 9ee5de05c0 Fix #101058: Allow Cryptomatte Picking Between Windows
buildbot/vdev-code-daily-coordinator Build done. Details
Allow the source and target windows to differ when selecting
objects using Cryptomatte.

Pull Request: #113636
2023-10-14 20:28:00 +02:00
Dalai Felinto a93238a922 GPv3: Reverse Curve node
buildbot/vdev-code-daily-coordinator Build done. Details
Part of #113602.
Ref !113702.
2023-10-14 12:50:02 +02:00
Iliya Katushenock 690deeda18 Fix: Geometry Nodes: Create instance attribute of the right type
buildbot/v400-code-daily-coordinator Build done. Details
`attributes_to_propagate` is map of all attributes to propagate from different
components. For attribute propagation three different components is taken.
Each one can have named attribute with specific type. Current implementation
of propagation: Try to make implicit share attribute. Or create/copy.
This doesn't takes into account `attributes_to_propagate`' data type info.
So, this cause crash for case, there multiple component have same name attribute
with different type.
Fix: Try to make implicit share attribute with correct type. Or create, copy typed version.

Pull Request: #110146
2023-10-14 10:54:32 +02:00
Leon Schittek d9225ac121 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-14 10:07:09 +02:00
Leon Schittek b93dbaba1d Fix: Node Editor: Improve info panel drawing
buildbot/v400-code-daily-coordinator Build done. Details
Fix papercuts with the info panel:
1. Make the panel extend behind hidden nodes
2. Don't let it become smaller than the node itself, when resizing

Pull Request: #113411
2023-10-14 09:37:03 +02:00
Campbell Barton e6933e526c PlayAnim: place the indicator closest to the mouse cursor
buildbot/vdev-code-daily-coordinator Build done. Details
The indicator placement was always rounded to the left.
2023-10-14 17:14:14 +11:00
Campbell Barton f9b403c349 Cleanup: comments, reduce variable scope 2023-10-14 17:02:43 +11:00
Campbell Barton 286c893df7 PlayAnim: support dropping multiple files at once
buildbot/vdev-code-daily-coordinator Build done. Details
Previously only a single file was supported (only the first file was
used), now all files are loaded.
2023-10-14 16:04:38 +11:00
Campbell Barton b1cd144d7e PlayAnim: don't expand sequences when passing in multiple files
Only expand image sequences when a single file is passed in.
This allows shell globing to expand images without expanding each.

Prepare for support multiple file drag & drop where it also doesn't
make sense to expand sequences when dropping multiple files.
2023-10-14 16:00:56 +11:00
Campbell Barton e23cb0c743 Cleanup: simplify animation player argument handling
The first argument was always ignored, this added a minor complication
to drag & drop as the new argument needed to have a dummy first argument.
2023-10-14 16:00:54 +11:00
Campbell Barton 2e0b844b36 Cleanup: spelling in comments
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-14 13:53:00 +11:00
Harley Acheson 83705a87cb FontBLF: Store Sizes, Styles, and Other Metrics
buildbot/vdev-code-daily-coordinator Build done. Details
When loading a font, gather metrics and other information that can help
use it more correctly. Default weight and slant, X-height, cap height,
locations for underline, strike-through, subscripts, etc. Family and
style flags, etc.

Pull Request: #113432
2023-10-14 02:43:48 +02:00
Harley Acheson 844b78786c Cleanup: Calm Warning in Interface_region_tooltip
buildbot/vdev-code-daily-coordinator Build done. Details
Remove warning about unused variable `field_next`

Pull Request: #113708
2023-10-14 02:14:22 +02:00
Harley Acheson 8919fb8bc7 UI: Fix Placeholder Bad String Comparison
buildbot/vdev-code-daily-coordinator Build done. Details
Bad string comparison in ui_but_placeholder_get()

Pull Request: #113706
2023-10-14 01:42:49 +02:00
Dalai Felinto 7a73f792ed GPv3: Fix Normal Field
buildbot/vdev-code-daily-coordinator Build done. Details
Part of #113602.
Ref !113704.
2023-10-14 00:58:02 +02:00
Dalai Felinto 16b7977bb5 GPv3: Set Curve Normal
Part of #113602.
Ref !113704.
2023-10-14 00:58:02 +02:00
Germano Cavalcante c634a15e85 Fix crash when canceling Vertex Crease with Mirror
buildbot/v400-code-daily-coordinator Build done. Details
Crash due to variables not initialized.
2023-10-13 19:14:42 -03:00
Harley Acheson d94502b456 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-13 14:52:26 -07:00
Harley Acheson da2902120e UI: Remove Menu Search Console Warning
buildbot/v400-code-daily-coordinator Build done. Details
Menu Search is showing a console warning whenever it can't find a menu
to search. WM_menutype_find should be set to silent.

Pull Request: #113701
2023-10-13 23:51:18 +02:00
Harley Acheson 0c064fab59 UI: Never Show Unknown Type Placeholder
Some but types of UI_BTYPE_SEARCH_MENU can have no ID code and also be
of UnknownType. Don't show placeholder in this case.

Pull Request: #113700
2023-10-13 23:39:45 +02:00
Harley Acheson cb9832f9b1 UI: Allow Tooltip Padding In Any Order
buildbot/vdev-code-daily-coordinator Build done. Details
Allow padding anywhere within a tooltip, not just before the current
field, by adding a new field type of UI_TIP_STYLE_SPACER.

Pull Request: #112487
2023-10-13 22:34:43 +02:00
Harley Acheson 2d5c762645 Merge branch 'blender-v4.0-release' 2023-10-13 13:32:28 -07:00
Harley Acheson d625feadd8 Fix #113689: Improved BLF_width_to_strlen Measurement
buildbot/v400-code-daily-coordinator Build done. Details
BLF_width_to_strlen measures text with reduced accuracy with Hinting or
subpixel anti-aliasing enabled. blf_font_width_to_strlen_glyph_process
does not take into account these changes when iterating through glyphs.

Pull Request: #113698
2023-10-13 22:31:08 +02:00
Hans Goudey 9b0188db03 Fix #112448: Leading deform modifiers skip adding original coordinates
buildbot/vdev-code-daily-coordinator Build done. Details
Previously the first group of deform modifiers didn't need to access
original coordinates explicitly because the deformation wasn't included
in the mesh positions. After d20f992322 the mesh is deformed
directly though, so the original coordinates need to be added first.

In the case of this report, the particle system (which is a "deform"
modifier for reasons) didn't have original coordinates to work with, so
it created the child particles at the deformed positions from the shape
keys every time. Though for some reason it only did that for renders.

Pull Request: #113679
2023-10-13 20:35:16 +02:00
Dalai Felinto a92cfc2754 GPv3: Set Spline Resolution
buildbot/vdev-code-daily-coordinator Build done. Details
Part of #113602.
2023-10-13 19:55:10 +02:00
Dalai Felinto d3fea733a1 GPv3: Set Spline Cyclic
Part of #113602.
2023-10-13 19:48:22 +02:00
Dalai Felinto 493674435f GPv3: Set Curve Tilt
Part of #113602.
2023-10-13 19:48:22 +02:00
Clément Foucault 3a998fc461 Fix EEVEE-Next: Linking error cause by closure_to_rgba
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-13 19:25:11 +02:00
Clément Foucault 71835808d3 Fix EEVEE-Next: Inverted world coordinates
Caused by 71dfcf4558
2023-10-13 19:21:08 +02:00
Miguel Pozo 6484274048 Merge branch 'blender-v4.0-release' 2023-10-13 19:19:06 +02:00
Miguel Pozo 9e7a576cee Workbench: Fix: depth_in_front not being copied after the first sample
buildbot/v400-code-daily-coordinator Build done. Details
2023-10-13 19:18:46 +02:00
Clément Foucault 44d73f0fa6 GL: Silence null dispatch error
These are false positive. We actually want to
not dispatch in this case.
2023-10-13 19:15:05 +02:00
Clément Foucault 8f49407128 Fix EEVEE-Next: Broken Ambient Occlusion
Caused by 71dfcf4558
2023-10-13 19:07:05 +02:00
Julian Eisel 14d6891efe Merge branch 'blender-v4.0-release' 2023-10-13 19:05:13 +02:00
Leon Schittek 7017a9880e Fix: UI: Scale list item highlight with zoom
Fix the row highlight in list views not scaling properly by taking
the zoom into account.

Pull Request: #113645
2023-10-13 19:04:42 +02:00
Julian Eisel 7d3d214a82 Merge branch 'blender-v4.0-release' 2023-10-13 19:00:38 +02:00
Harley Acheson 5a1ad7d61d UI: Improved Placeholder Defaults
Improvements to how placeholder strings are guessed. Checking for
search icon, and also using name of the RNA property type.

Pull Request: #113688
2023-10-13 18:53:33 +02:00
Julian Eisel 7705e49bcd Fix #113201: Assets in same folder as current file ignored in All library
If an asset library was pointing to the same path as the current file is saved
in, the assets from this library wouldn't be loaded. This is because the asset
library service assumed the absolute library root path is a way to uniquely
identify an asset library.

Instead, identify the asset library using both the root path and the library
type.
2023-10-13 18:52:38 +02:00
Hans Goudey e1fb095f0e GPv3: Fix Field inputs that had no inputs
For example:
* Curve Tangent
* Spline Parameter
2023-10-13 18:51:03 +02:00
Jacques Lucke 71feaba657 RNA: speedup rna path creation in simple but common case
This speeds up saving the following production file by about 10%:
`240ms -> 220ms`
`heist/pro/shots/060_fight/060_0080/060_0080.anim.blend`

This is a fairly low hanging fruit. Ideally we wouldn't have to duplicate
the string at all, but changing that is a larger undertaking.
2023-10-13 18:42:23 +02:00
Clément Foucault 5b1d5fa82f Cleanup: EEVEE-Next: Remove some TODOs
These just move some code around, cleanup the
syntax and make sure to use appropriate libs.
2023-10-13 18:33:15 +02:00
Clément Foucault ef494b2794 Fix EEVEE-Next: Broken Barycentric on Metal
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-13 18:01:29 +02:00
Clément Foucault 71dfcf4558 EEVEE-Next: Remove common lib usage
Replaces all usage by the the gpu_shader_math
equivalent. This is because the old shader
library was quite tangled.

This avoids dependency hell trying to
mix libraries.

Changes are split into isolated commits until
I had to do mass changes because of inter-
dependencies.

Pull Request: #113631
2023-10-13 17:59:46 +02:00
Harley Acheson f7a8536112 Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-10-13 08:36:19 -07:00
Harley Acheson a9dc7a4719 Cleanup: Comment for Assert in UI_text_clip_middle_ex
buildbot/v400-code-daily-coordinator Build done. Details
Just an added detailed comment for the reason for the assert in
UI_text_clip_middle_ex and why it has wriggle room.
2023-10-13 08:35:04 -07:00
Miguel Pozo 42aa97a080 Fix #113580: Workbench: Always setup in_front_depth_tx
buildbot/v400-code-daily-coordinator Build done. Details
Always setup in-front depth, since Overlays can be updated without causing a Workbench re-sync.
2023-10-13 17:12:40 +02:00
Dalai Felinto 4a11755458 GPv3: Curve to Mesh node
buildbot/vdev-code-daily-coordinator Build done. Details
Part of #113602.
Ref !113659.
2023-10-13 16:50:12 +02:00
Falk David 1b85ca7b05 Fix: GPv3: Reorder layers missing update
Reordering layers using drag-and-drop in the properties editor
was missing a depsgraph update.
2023-10-13 16:48:43 +02:00
Clément Foucault f4e584b02a BLI: Math Vector: Add reduce_min/max/add and average function
This is a straightforward port from Cycles functions.

They are written to work even with vector of size 1.

Pull Request: #113678
2023-10-13 16:48:19 +02:00
Brecht Van Lommel 7f07d5f428 Merge branch 'blender-v4.0-release' into main 2023-10-13 16:34:27 +02:00
Brecht Van Lommel 5e67e44963 Shaders: don't unnecessarily set subsurface scale to zero in old files
buildbot/v400-code-daily-coordinator Build done. Details
When the subsurface weight is zero, keep the scale to its default value.
2023-10-13 16:32:19 +02:00