Class Reference

Brush

Inherits RefCounted

Brush settings.

Members

anglefloat The angle of the brush tip.
angle_jitterfloat The randomness of the angle.
colorsColor[] The color each channel ist tinted.
erasebool
flowfloat The opacity of a single brush.
flow_pen_pressurebool If the opacity of the tip is affected by pen pressure.
follow_pathbool If the angle of the tip should point from the last brush stroke to the next. If the angle isn't zero, it is added ontop of that.
pattern_scalefloat The scale of the textures.
position_jitterfloat The random offset of the painting position.
projectionint The projection which projects the mouse position into brush space.
radial_symmetry_countint The amount of symmetry axis.
sizefloat The scale of the brush tip.
size_jitterfloat The randomness of the size of the brush.
size_pen_pressurebool If the size of the tip is affected by pen pressure.
size_spaceint If the result should be removed by the opacity of the stroke.
spacingfloat The minimum distance between dots.
stencilTexture2D A screen-space texture which opacity is multiplied by the strength of the stroke.
stencil_transformTransform2D The stencil transform in view-space.
stroke_opacityfloat The maximimum opacity of a single brush strokes.
symmetryint The type of symmetry to use.
symmetry_axisVector3 An axis is enabled if it is anything other than zero. This is used as the axis for radial symmetry.
texturesTexture2D[] The texture of each channel.
tipTexture2D The texture that determines the opacity of the stroke.

Methods

apply_symmetry(transform: Transform3D) -> Transform3D[]

Returns the list of transforms that result when the given transform is mirrored using this brush's symmetry options.

duplicate() -> Object

Returns a new brush with the same settings.

get_color(channel: int) -> Color

Returns the color a channel texture is tintet, white if not specified.

get_texture(channel: int) -> Texture2D

Returns the texture a channel texture is tintet, white if not specified.

BrushPreview

Inherits Node3D

Uses the tip and first texture and color to show a preview of what the brush looks like.

Members

appearanceint
brushBrush
follow_mousebool If the preview should move with the mouse.
painterPainter

Inherits Camera3D

A camera that can be rotated and panned around a center using the mouse

Members

focus_pointVector3
horizontal_rotationfloat
moving_sensitityfloat
pan_onlybool
rotation_sensitityfloat
vertical_rotationfloat
zoomfloat
zoom_sensitityfloat

PaintStep

Inherits Step

Step where the [Painter] draws a stroke.

Members

brushBrush
camera_transformTransform3D
fromVector2
toVector2

Painter

Inherits Node

Possibilities:

Signals

PropertyContainer

Inherits HBoxContainer

An item in a [PropertyPanel].

Contains a [member name_label] and the [member property_control] the [member property] returns. Emits the [signal property_changed] signal when the [member property_control] emitted the signal the [member property] specified.

Members

name_labelLabel
property"addons/property_panel/properties.gd".Property
property_controlControl

Methods

get_value() -> Variant

set_value(to: Variant) -> void

setup(_property: Variant) -> Control

Signals

property_changedvalue: Variant

PropertyPanel

Inherits Panel

An inspector-like panel that builds a list of [PropertyContainer]s.

When the properties are set, a [PropertyContainer] is generated for each property. The resulting values can be retrieved using [method get_value] and [method get_values]. A [Dictionary] similar to the result of [method get_values] can be given to [code]load_values[/code] to update the values of the [PropertyContainer]s. [br][br][b]Usage[/b]: [codeblock] const Properties = preload("res://addons/property_panel/properties.gd") property_panel.set_properties([ Properties.BoolProperty.new("Active"), Properties.FloatProperty.new("Size", 1, 5), Properties.EnumProperty.new("Distance", ["Far", "Near"]) ]) [/codeblock]

Members

verticalbool Whether the properties should be alligned from left to right or from top to bottom.

Methods

clear() -> void

Clears the panel, removing every property and section title.

get_value(property: String) -> Variant

get_values() -> Dictionary

Returns a `Dictionary` with the property names as keys and the values as values.

has_property(property: String) -> bool

Returns true if the property is exposed.

load_values(instance: Variant) -> void

Load the property values from an [Object] or [Dictionary].

set_properties(properties: Array) -> void

Shows a list of section titles and properties.

set_value(property: String, value: Variant) -> void

store_values(instance: Variant) -> void

Store the property/value pairs in an [Object] or [Dictionary].

Signals

property_changedproperty: Variant, value: Variant

Test

Inherits Resource

A test which checks if the [Painter] functions correctly.

Members

channelsint
modelMesh
nameString
stepsStep[]

addons/painter/camera_state.gd

Inherits RefCounted

Utility to store all members of a camera relevant to rendering.

Methods

apply(camera: Camera3D) -> void

Replicate all stored members to the given camera.

addons/painter/channel_painter/channel_painter.gd

Inherits Node

Utility that is used by a painter to paint one channel.

The StrokeViewport holds the progress of a single stroke. When a stroke is finished, it gets applied to the ResultViewport. This is required to support stroke opacity.

Methods

clear_with(value: Variant) -> void

Clears the result with a color or a texture.

finish_stroke() -> void

Apply a stroke to the base.

get_result() -> ViewportTexture

init(mesh: Mesh, _size: Vector2, seams_texture: Texture2D, mask: Texture2D) -> void

paint(operations: "addons/painter/paint_operation.gd"[]) -> void

addons/painter/paint_operation.gd

Inherits RefCounted

Used to record the painting process and replay it with a higher result resolution.

Members

brushBrush
brush_transformTransform3D
camera_state"addons/painter/camera_state.gd"
model_transformTransform3D
pressurefloat
screen_positionVector2

addons/painter/preview/stencil_preview.gd

Inherits TextureRect

An overlay that shows the stencil of a brush.

Members

brushBrush

addons/painter/seams/seams_texture_generator.gd

Inherits Node

Generate "bleed" textures so UV seams don't appear on painted meshes.

Methods

generate(mesh: Mesh) -> ViewportTexture

addons/painter/utils/texture_pack_store.gd

Inherits RefCounted

Utility for saving and loading textures to memory or disk.

[b]Example Usage:[/b] [codeblock] var store = TexturePackStore.new("user://textures") stare.max_packs_in_memory = 1 var pack_a = store.add_textures([a, b, c]) var pack_b = store.add_textures([d, e, f]) var a_textures = pack_a.get_textures() store.cleanup() [/codeblock]

Members

max_packs_in_memoryint The maximum Pack objects stored in ram. When this value is exceeded the oldest packs will be saved to disk.
max_packs_on_diskint The maximum packs to save to disk before the oldest are deleted.

Methods

add_textures(new_textures: Array) -> "addons/painter/utils/texture_pack_store.gd".Pack

Add a new list of textures and return a pack that can be used to load textures at a later point in time.

clear() -> void

addons/property_panel/float_slider/float_slider.gd

Inherits LineEdit

A number slider similar to that found in Godot Engine's inspector.

Members

knobControl
max_valuefloat The maximum value allowed.
min_valuefloat The mininum value allowed by sliding. Smaller numbers can be inputed manually.
sensitivityfloat The sensitivity while dragging with the mouse to change the value.
stepfloat The number the value will be snapped to. Useful for integer inputs.
valuefloat The current number.

Signals

changed Emitted when the user changes the value by sliding or by typing it in.

addons/property_panel/path_picker_button/path_picker_button.gd

Inherits Button

A [Button] to select a path to be used in a [PropertyPanel].

Right-clicking clears the path.

Members

filtersPackedStringArray
pathString

Methods

select_path(selected_path: String) -> void

Signals

changed
dialog_opened

addons/property_panel/properties.gd

Inherits RefCounted

Each property can create a `Control` and specifies the signal it emits when it changed. It also specifies which member of the control is the resulting value.

brush_property_panel.gd

Inherits PropertyPanel

Panel exposing brush properties.

Methods

load_brush(brush: Brush) -> void

main.gd

Inherits Node3D

A demo of the painter addon.

The brush settings can be configured in a panel to the right. The mesh can be switched and the result saved as a png.

Members

brushBrush
brush_downbool Tracking if a motion event should continue a stroke.
brush_previewBrushPreview
brush_property_panel"brush_property_panel.gd"
cameraNavigationCamera
change_startVector2
change_start_valuefloat
changing_sizebool
error_dialogAcceptDialog
last_stencilTransform2D
mesh_option_buttonOptionButton
paintable_modelMeshInstance3D
painterPainter
released_atVector2 Where the user clicked to end resizing the brush.
save_file_dialogFileDialog
stencil_preview"addons/painter/preview/stencil_preview.gd"

Methods

delete_undo_textures() -> void

handle_brush_input(event: InputEvent) -> bool

handle_paint_input(event: InputEvent) -> void

handle_stencil_input(event: InputEvent) -> bool

setup_painter() -> void

tests/painted_model_container.gd

Inherits SubViewportContainer

Viewport where paint strokes for the test can be drawn.

Members

start_pointVariant

Signals

stroke_addedfrom: Vector2, to: Vector2

tests/result_rect.gd

Inherits TextureRect

Area where the checks of a test can be edited.

Members

color_pickerColorPickerButton
start_pointVariant

Signals

area_addedposition: Vector2, size: Vector2, color: Color

tests/test_editor.gd

Inherits Control

Test run editor.

Tests can be created and modified visually, and saved as JSON files into [member TESTS_DIR].

Members

channel_count_spin_boxSpinBox
mesh_instanceMeshInstance3D
model_option_buttonOptionButton
modelsMesh[]
name_editLineEdit
testTest
tests_option_buttonOptionButton

Methods

load_data(data: Test) -> void

reload_test_list() -> void

tests/tests.gd

Inherits Control

Test runner.

Members

result_containerVBoxContainer