GPv3: Join Geometry/Realize Instances node #113844
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113844
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "filedescriptor/blender:gpv3-join-geometry-node"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the Join Geometry and Realize Instances node.
Note that the layers are joined in the order of the indices. This means that the layers plugged into the top of the multi-input socket will appear "behind" the other layers.
The data inside the layers themselves is not changed, e.g. layers are not merged.
If the geometries have layers with the same name, the output will rename layers such that the names are unique.
Edit: Commented on the wrong PR, oops
@ -144,0 +145,4 @@
static void join_grease_pencil(const Span<const GeometryComponent *> src_components,
GeometrySet &result)
{
int tot_drawings = 0;
drawings_num
@ -144,0 +146,4 @@
GeometrySet &result)
{
int tot_drawings = 0;
Vector<int> start_offsets;
Array
, since the size is known ahead of time@ -144,0 +164,4 @@
const bke::GreasePencilComponent &src_grease_pencil_component =
static_cast<const bke::GreasePencilComponent &>(*src_components[index]);
const int start_offset = start_offsets[index];
for (int i = 0; i < src_grease_pencil_component.get()->drawing_array_num; i++) {
->drawings().index_range()`?
@ -144,0 +180,4 @@
const GreasePencilDrawingReference *src_drawing_reference =
reinterpret_cast<const GreasePencilDrawingReference *>(src_drawing_base);
dst_grease_pencil->drawing_array[start_offset + i] =
reinterpret_cast<GreasePencilDrawingBase *>(MEM_dupallocN(src_drawing_reference));
MEM_new(__func__, src_drawing_reference);
seems like a safer way to do this IMO@ -144,0 +192,4 @@
const bke::GreasePencilComponent &src_grease_pencil_component =
static_cast<const bke::GreasePencilComponent &>(*src_components[index]);
const int start_offset = start_offsets[index];
const blender::Span<const bke::greasepencil::Layer *> src_layers =
Remove
blender::
@ -144,0 +164,4 @@
const bke::GreasePencilComponent &src_grease_pencil_component =
static_cast<const bke::GreasePencilComponent &>(*src_components[index]);
const int start_offset = start_offsets[index];
for (const int i : src_grease_pencil_component.get()->drawings().index_range()) {
Maybe put the drawings in a temporary
Span
variable to avoid combining the use ofdrawings()
anddrawing_array
, and to avoid callingcomponent.get()
many times.Also, the PR/commit description should mention the behavior we decided on about concatenating the layers vs. merging them by name.
Having redundant information doesn’t hurt, but I’ll make sure that design decision is mentioned on the overview task, where we mention the instancing as well.(done)Once we are done (soon?) this can move to the wiki.
I think this should use the same approach we use for meshes, point clouds and curves: reuse the realize instances code.
When the realize instances code is implemented, only a one line change should be necessary to make the Join Geometry node work as well.
GPv3: Join Geometry nodeto GPv3: Join Geometry/Realize Instances nodeI've updated the code to implement the
realize_instance
function instead.There are some todos right now:
preprocess_grease_pencils
where we populate an array of all names)-inf
)@ -505,0 +512,4 @@
TreeNode &TreeNode::operator=(const TreeNode &other)
{
copy_tree_node(other, *this);
Few issues here:
TreeNode
that is being replaced.Currently, I'd recommend against using copy-assignment for layers. It's not always trivial to get these things right. And here it's even harder because the layer has a pointer to its parent, and the parent also has a pointer to the children.
Ok apart from fixing the issues you mentioned, what would be the alternative to using the copy assignment?
A method or normal function that copies that data you care about from one layer to another (but probably does not change the parent pointer).
@ -1494,0 +1623,4 @@
const Span<const bke::greasepencil::Layer *> layers = grease_pencil->layers();
for (const int layer_i : layers.index_range()) {
char unique_name[MAX_NAME];
Seems like layer names can be quite a bit longer in generally? At least based on the DNA definition.
Right, I think we'd need a better
BLI_uniquename
function like #113901 to support arbitrary long unique names.Just requesting changes based on existing comments to remove this from my queue.
Closing this since it's replaced by #124361.
Pull request closed