GPv3: Delete Geometry node #113721

Merged
Dalai Felinto merged 1 commits from dfelinto/blender:grease-nodes-delete-geometry into main 2023-10-16 11:29:15 +02:00

Incorporated the cleanup and tweaks from Hans Goudey to return CurvesGeometry directly.

Part of #113602.

Incorporated the cleanup and tweaks from Hans Goudey to return CurvesGeometry directly. Part of #113602.
Dalai Felinto requested review from Hans Goudey 2023-10-14 14:51:26 +02:00
Author
Owner

Man this was tricky, but hey now I learned optional<> :)

This is memory leaking at the moment (open attached file -b, to see it). I'm also not sure if I'm using std::move() the right amount of times on the grease pencil loop.

I believe I may need a lib free for the Curve*.

Man this was tricky, but hey now I learned optional<> :) This is memory leaking at the moment (open attached file -b, to see it). I'm also not sure if I'm using std::move() the right amount of times on the grease pencil loop. I believe I may need a lib free for the Curve*.
Hans Goudey reviewed 2023-10-14 15:06:08 +02:00
Hans Goudey left a comment
Member

Nice! Yeah, sorry about the confusing use of optional here.

Left one comment about the memory leak with a suggestion

Nice! Yeah, sorry about the confusing use of `optional` here. Left one comment about the memory leak with a suggestion
@ -177,0 +192,4 @@
const bke::CurvesGeometry &src_curves = drawing->strokes();
const bke::GreasePencilLayerFieldContext field_context(
grease_pencil, ATTR_DOMAIN_CURVE, layer_index);
std::optional<Curves *> dst_curves_id = file_ns::separate_curves_selection(
Member

This would probably be simpler if separate_curves_selection returned a CurvesGeometry rather than a Curves, then the curves would just have to handle bke::curves_new_nomain.

This would probably be simpler if `separate_curves_selection` returned a `CurvesGeometry` rather than a `Curves`, then the curves would just have to handle `bke::curves_new_nomain`.
dfelinto marked this conversation as resolved
Author
Owner

It was too complicated to return a CurvesGeometry with the whole optional thing. Anyways, fully working now :)

It was too complicated to return a CurvesGeometry with the whole optional thing. Anyways, fully working now :)
Dalai Felinto force-pushed grease-nodes-delete-geometry from 31e21c8895 to 33bbe8cc74 2023-10-14 21:07:09 +02:00 Compare
Member

It was too complicated to return a CurvesGeometry with the whole optional thing. Anyways, fully working now :)

It sounded too much like a challenge that way! How does this look? 43388df3c3

> It was too complicated to return a CurvesGeometry with the whole optional thing. Anyways, fully working now :) It sounded too much like a challenge that way! How does this look? https://projects.blender.org/HooglyBoogly/blender/commit/43388df3c3b43e9fcedb0209be7289149a40ee3c
Dalai Felinto force-pushed grease-nodes-delete-geometry from d3e4880ec9 to bdf192c031 2023-10-16 11:18:13 +02:00 Compare
Hans Goudey approved these changes 2023-10-16 11:26:01 +02:00
@ -12,2 +12,4 @@
#include "BKE_curves.hh"
#include "BKE_grease_pencil.hh"
#include "BKE_instances.hh"
#include "BKE_lib_id.h"
Member

Unnecessary include now

Unnecessary include now
Dalai Felinto merged commit 47cfeb45d8 into main 2023-10-16 11:29:15 +02:00
Dalai Felinto deleted branch grease-nodes-delete-geometry 2023-10-16 11:29:17 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113721
No description provided.