Logo von Grease Pencil V3

Grease Pencil V3

Community
TMHSDigital
grease-pencil-v3

Create and inspect Grease Pencil v3 (GPv3) data from Python: the datablock address split (bpy.data.grease_pencils_v3 on 4.5 LTS, bpy.data.grease_pencils on 5.x), layers.new -> frames.new(n).drawing -> add_strokes([counts]) -> per-point position/radius/opacity/vertex_color, lazily materialized drawing.attributes, and the Line Art modifier (source_type/source_object, edge-type flags, depsgraph-evaluated strokes, thickness removed in favor of radius). Use when the user scripts Grease Pencil strokes or Line Art, ports GPencil code to 4.3+ or 5.x, writes frame.strokes or GPencilStroke, or hits AttributeError on grease_pencils_v3, frame.drawing, frame.strokes or LineartModifier.thickness. Targets 5.2 LTS with 4.5 LTS fallback.

Übersicht

HerausgeberTMHSDigital
RepositoryBlender-Developer-Tools
Skill-Namegrease-pencil-v3
Sterne
20
Forks
5
Mitgelieferte Dateien
Nur Anweisungen
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von TMHSDigital auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Grease Pencil V3 in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/grease-pencil-v3
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TMHSDigital/Blender-Developer-Tools.git /tmp/Blender-Developer-Tools
mkdir -p .claude/skills
cp -r /tmp/Blender-Developer-Tools/skills/grease-pencil-v3 .claude/skills/grease-pencil-v3
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Grease Pencil V3 in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Grease Pencil V3 automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Grease Pencil V3 nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Grease Pencil v3 in Python

Trigger

Use this skill when the user:

  • Creates Grease Pencil objects, layers, frames, or strokes from a script
  • Mentions grease_pencils, grease_pencils_v3, GreasePencil, GPencilStroke, drawing, add_strokes, or the LINEART modifier
  • Ports pre-4.3 GPencil code (frames that carry .strokes directly) to 4.5 LTS or 5.x
  • Hits AttributeError on bpy.data.grease_pencils_v3 (5.x), on frame.drawing (legacy data on 4.5), or on the Line Art modifier's thickness (5.x)
  • Gets zero Line Art strokes and does not know why

High-level shape

GPv3 exists on both supported versions, but at different addresses. Branch on the bpy.app.version tuple, never on bpy.app.version_string.

python
import bpy


def gp_data_new(name):
    if bpy.app.version >= (5, 0, 0):
        return bpy.data.grease_pencils.new(name)   # 5.x: GPv3 owns the name
    return bpy.data.grease_pencils_v3.new(name)    # 4.5 LTS: GPv3 lives at _v3


gp = gp_data_new("Ink")
layer = gp.layers.new("Lines")
drawing = layer.frames.new(1).drawing
drawing.add_strokes([4, 4])                        # two strokes, four points each
for stroke in drawing.strokes:
    stroke.cyclic = True
    for i, pt in enumerate(stroke.points):
        pt.position = (float(i), 0.0, 0.0)
        pt.radius = 0.02
        pt.opacity = 1.0
        pt.vertex_color = (1.0, 0.5, 0.0, 1.0)

obj = bpy.data.objects.new("Ink", gp)              # obj.type == 'GREASEPENCIL'
bpy.context.collection.objects.link(obj)

The hierarchy is datablock -> layers -> frames -> frame.drawing -> drawing.strokes -> stroke.points. Strokes are allocated in one call with a list of point counts.

Datablock address: the 4.5 trap

4.5 LTS5.x (5.1, 5.2 LTS)
GPv3 collectionbpy.data.grease_pencils_v3 (GreasePencilv3)bpy.data.grease_pencils (GreasePencil)
bpy.data.grease_pencilsLegacy GPencil: frames carry .strokes, no .drawingGPv3
bpy.data.grease_pencils_v3PresentAttributeError
bpy.types.GPencilStrokePresent (legacy)Gone

The collection name is identical across versions while the API behind it is incompatible. Code that calls bpy.data.grease_pencils.new(...) unconditionally gets legacy GPencil on 4.5, and the first frame.drawing raises. Use the version-gated gp_data_new above on every creation path.

Points are views over attributes

Stroke points are views over attribute layers on the drawing, not copies. Writing through the point view lazily creates the layers; a fresh drawing does not have them. After the writes above, drawing.attributes holds:

AttributeDomainType
positionPOINTFLOAT_VECTOR
radiusPOINTFLOAT
opacityPOINTFLOAT
vertex_colorPOINTFLOAT_COLOR
cyclicCURVEBOOLEAN

For bulk reads, go through the raw buffer. Points are laid out stroke by stroke:

python
def read_positions(drawing):
    pos = drawing.attributes["position"]
    buf = [0.0] * (3 * len(pos.data))
    pos.data.foreach_get("vector", buf)
    return buf

A minimal end-to-end build that runs on both 4.5 LTS and 5.2 LTS:

python
import bpy

if bpy.app.version >= (5, 0, 0):
    assert not hasattr(bpy.data, "grease_pencils_v3")
    assert not hasattr(bpy.types, "GPencilStroke")
    gp = bpy.data.grease_pencils.new("SmokeGP")
else:
    assert hasattr(bpy.data, "grease_pencils_v3")
    gp = bpy.data.grease_pencils_v3.new("SmokeGP")

drawing = gp.layers.new("Ink").frames.new(1).drawing
drawing.add_strokes([3, 5])
for stroke in drawing.strokes:
    stroke.cyclic = True
    for i, pt in enumerate(stroke.points):
        pt.position = (float(i), 0.0, 0.5 * i)
        pt.radius = 0.03

mat = bpy.data.materials.new("SmokeInk")
bpy.data.materials.create_gpencil_data(mat)
gp.materials.append(mat)
obj = bpy.data.objects.new("SmokeGP", gp)
bpy.context.collection.objects.link(obj)

assert obj.type == 'GREASEPENCIL'
assert [len(s.points) for s in drawing.strokes] == [3, 5]
assert all(s.cyclic for s in drawing.strokes)
attrs = {a.name: (a.domain, a.data_type) for a in drawing.attributes}
assert attrs["position"] == ('POINT', 'FLOAT_VECTOR')
assert attrs["radius"] == ('POINT', 'FLOAT')
assert attrs["cyclic"] == ('CURVE', 'BOOLEAN')
buf = [0.0] * (3 * 8)
drawing.attributes["position"].data.foreach_get("vector", buf)
assert buf[3 * 4:3 * 5] == [1.0, 0.0, 0.5]   # stroke 2, point 1
assert gp.materials[0].grease_pencil is not None

Materials: bpy.data.materials.create_gpencil_data(mat) adds the mat.grease_pencil settings on both versions; append the material to gp.materials. To keep ink unlit, set layer.use_lights = False.

Line Art modifier

Contours come from a LINEART modifier on a GPv3 object, evaluated through the depsgraph. No bake is needed to read the result.

python
import math

import bpy


def add_lineart(gp_obj, source, gp_mat, radius=0.02):
    layer = gp_obj.data.layers.new("Ink")
    layer.frames.new(1)                            # a frame for the evaluated strokes
    mod = gp_obj.modifiers.new("LineArt", "LINEART")
    mod.source_type = "OBJECT"
    mod.source_object = source                     # load-bearing: None -> 0 strokes
    mod.use_contour = True
    mod.use_crease = True
    if hasattr(mod, "use_material"):
        mod.use_material = True
    if hasattr(mod, "use_intersection"):
        mod.use_intersection = True
    mod.crease_threshold = math.radians(130)
    mod.target_layer = "Ink"                       # layer name, not the layer
    mod.target_material = gp_mat
    if hasattr(mod, "thickness"):                  # 4.5 only: legacy px width
        mod.thickness = 22
    mod.radius = radius                            # portable width on 4.5 and 5.x
    return mod


def evaluated_counts(gp_obj):
    dg = bpy.context.evaluated_depsgraph_get()
    dg.update()
    drawing = gp_obj.evaluated_get(dg).data.layers[0].frames[0].drawing
    strokes = list(drawing.strokes)
    return len(strokes), sum(len(s.points) for s in strokes)
  • source_object is load-bearing: clearing it yields 0 evaluated strokes; restoring it recovers them.
  • With every edge-type flag off (use_contour, use_crease, use_loose, use_intersection, use_material, use_edge_mark) the evaluator emits 0 strokes.
  • Line Art is view-dependent: it draws from the scene camera, so count strokes from the same camera you render from.
  • Stroke width: 4.5 exposes both thickness (legacy px) and radius; on 5.x (measured 5.1.2 and 5.2.1) thickness raises AttributeError and radius is the only width. Set radius; guard thickness with hasattr.
  • The original data holds no Line Art strokes; read evaluated_get(depsgraph).data, not obj.data.

Common AI mistakes

  1. Unconditional bpy.data.grease_pencils.new(...). On 4.5 LTS that is legacy GPencil and frame.drawing does not exist. Use grease_pencils_v3 on 4.5, grease_pencils on 5.x.

  2. bpy.data.grease_pencils_v3 on 5.x. AttributeError. The _v3 alias is gone; GPv3 took the plain name.

  3. Legacy stroke code: writing strokes into frame.strokes. That is the pre-4.3 GPencil shape (GPencilStroke). In GPv3 a frame owns a drawing, and strokes are allocated with drawing.add_strokes([counts]).

  4. Referencing bpy.types.GPencilStroke in type checks or annotations. Gone on 5.x; it only names the legacy type on 4.5.

  5. Expecting point attributes on a fresh drawing. radius, opacity, vertex_color and cyclic appear in drawing.attributes only after something writes them. Do not drawing.attributes["radius"] before the first write.

  6. mod.thickness = ... on the Line Art modifier on 5.x. AttributeError. Use mod.radius; set thickness only under hasattr.

  7. Line Art with no source_object, or every edge type off. Each yields an empty drawing with no error. Set source_type='OBJECT' and source_object, and leave use_contour on.

  8. Counting Line Art strokes on obj.data. The modifier output exists only on the evaluated object.

See also

Runnable examples

Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.

  • gp-lineart-contour: Grease Pencil LINEART modifier ink via the depsgraph on a cel-shaded lighthouse diorama. Falsify: --no-contour (exit 5).
  • grease-pencil-rosette: Grease Pencil v3's attribute-based API — layer → frames.new(1).drawing → add_strokes → per-point position/radius/opacity/vertex_color — drawing five nested neon rose curves. Falsify: --open-strokes (exit 5).

References

Häufig gestellte Fragen

Was macht der KI-Skill Grease Pencil V3?

Create and inspect Grease Pencil v3 (GPv3) data from Python: the datablock address split (bpy.data.grease_pencils_v3 on 4.5 LTS, bpy.data.grease_pencils on 5.x), layers.new -> frames.new(n).drawing -> add_strokes([counts]) -> per-point position/radius/opacity/vertex_color, lazily materialized drawing.attributes, and the Line Art modifier (source_type/source_object, edge-type flags, depsgraph-evaluated strokes, thickness removed in favor of radius). Use when the user scripts Grease Pencil strokes or Line Art, ports GPencil code to 4.3+ or 5.x, writes frame.strokes or GPencilStroke, or hits A...

Warum Grease Pencil V3 in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Grease Pencil V3 besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Grease Pencil V3 in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/grease-pencil-v3 ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Grease Pencil V3 nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Grease Pencil V3 verwenden?

So viele Sie möchten. In TypingMind können Sie Grease Pencil V3 mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Grease Pencil V3 kostenlos?

Der Skill wird von TMHSDigital auf GitHub veröffentlicht. Prüfen Sie im Repository, ob dort Lizenzbedingungen angegeben sind. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇