---
# System prepended metadata

title: Geometry Nodes Grease Pencil integration design

---

# Geometry Nodes Grease Pencil integration design

This document summarizes the ideas for how to integrate Grease Pencil into geometry nodes.

The Grease Pencil data-block at a specific scene frame can be thought of as a tree of `CurvesGeometry`.

```mermaid
%%{init: 
    {'theme': 'dark',
     'themeVariables': {
         'darkMode': 'true'
    }}
}%%
graph TD
    subgraph GreasePencil
    Group1-->Layer2
    Group1-->Layer3
    Group1-->Group2
    Group2-->Layer4
    Group2-->Layer5
    Layer1-->CurvesGeometry1
    Layer2-->CurvesGeometry2
    Layer3-->CurvesGeometry3
    Layer4-->CurvesGeometry4
    Layer5-->CurvesGeometry5
    end
```
## Idea #1

* New Geometry Component for Grease Pencil
* Two nodes
    * **Convert Grease Pencil to Curves**
        * ![](https://i.imgur.com/b1xO2JJ.png)
        * If the layer name is empty, will convert all the visible curves to a single CurvesGeometry
        * If there is a valid layer name, will only convert the CurvesGeometry of that layer.
    * **Convert Curves to Grease Pencil**
        * Problem: How to we reconstruct the layer tree?
            * Idea: Store a `layer_id` and a `parent_layer_id` attribute on each curve. Reconstruct the tree from this information. This will reconstruct the structure, but looses all information stored on the layers. E.g. visibility, name, etc
