This is a prototype vector graphics and SVG import plugin written for the Godot game engine. This version relies on Godot PR 75278 being merged. For a version implemented using a shader instead see the Godot 3 or Godot 4.0 branches.
Both SVG import and an internal vector shape editor are available as options for creating the shape. Strokes are available using a runtime stroke to fill filter node, and basic linear and radial gradients are implemented in the fill shader.
Copy the addons
folder to your project. Then go to Project
->Project Settings...
->Plugins
and check the checkbox in the Enable
column in the Vector 2D Graphics
row.
Then either import an SVG normally (e.g. via drag and drop), or create a new shape using the Vector2DShape
and Vector2DFill
nodes. Note: It is better to first use an SVG as an example for how these nodes work.
The vector shape editor is extremely bare bones, and lacks many quality of life features, like automatic smooth handles, box/lasso selection, or scale/rotate for multiple selected points. It also lacks a few necessary basic features.
There are two options to animate a shape:
Vector2DShape
's properties. Since shapes are stored as resources, if a shape is used in a scene that is used multiple times, the resource must be set to be Local to scene
, otherwise the animation would apply to all instances.Vector2DShape
. This is useful for frame by frame animations, but doesn't allow tweening.Due to limitations of Godot's editor, it's not possible to edit multiple shapes at once, even though aligning points between different shapes can be useful.
Released to the public domain. See UNLICENSE. This only applies to this addon, and not to Godot itself (Obviously).
Vector2DTween
node to tween between two shapes without having to animate individual points.Skeleton2D
for animations