Class Reference
- Brush
- BrushPreview
- NavigationCamera
- PaintStep
- Painter
- PropertyContainer
- PropertyPanel
- Test
- addons/painter/camera_state.gd
- addons/painter/channel_painter/channel_painter.gd
- addons/painter/paint_operation.gd
- addons/painter/preview/stencil_preview.gd
- addons/painter/seams/seams_texture_generator.gd
- addons/painter/utils/texture_pack_store.gd
- addons/property_panel/float_slider/float_slider.gd
- addons/property_panel/path_picker_button/path_picker_button.gd
- addons/property_panel/properties.gd
- brush_property_panel.gd
- main.gd
- tests/painted_model_container.gd
- tests/result_rect.gd
- tests/test_editor.gd
- tests/tests.gd
Brush
Inherits RefCounted
Brush settings.
Members
| angle | float | The angle of the brush tip. |
| angle_jitter | float | The randomness of the angle. |
| colors | Color[] | The color each channel ist tinted. |
| erase | bool | |
| flow | float | The opacity of a single brush. |
| flow_pen_pressure | bool | If the opacity of the tip is affected by pen pressure. |
| follow_path | bool | 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_scale | float | The scale of the textures. |
| position_jitter | float | The random offset of the painting position. |
| projection | int | The projection which projects the mouse position into brush space. |
| radial_symmetry_count | int | The amount of symmetry axis. |
| size | float | The scale of the brush tip. |
| size_jitter | float | The randomness of the size of the brush. |
| size_pen_pressure | bool | If the size of the tip is affected by pen pressure. |
| size_space | int | If the result should be removed by the opacity of the stroke. |
| spacing | float | The minimum distance between dots. |
| stencil | Texture2D | A screen-space texture which opacity is multiplied by the strength of the stroke. |
| stencil_transform | Transform2D | The stencil transform in view-space. |
| stroke_opacity | float | The maximimum opacity of a single brush strokes. |
| symmetry | int | The type of symmetry to use. |
| symmetry_axis | Vector3 | An axis is enabled if it is anything other than zero. This is used as the axis for radial symmetry. |
| textures | Texture2D[] | The texture of each channel. |
| tip | Texture2D | 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
| appearance | int | |
| brush | Brush | |
| follow_mouse | bool | If the preview should move with the mouse. |
| painter | Painter |
NavigationCamera
Inherits Camera3D
A camera that can be rotated and panned around a center using the mouse
Members
| focus_point | Vector3 | |
| horizontal_rotation | float | |
| moving_sensitity | float | |
| pan_only | bool | |
| rotation_sensitity | float | |
| vertical_rotation | float | |
| zoom | float | |
| zoom_sensitity | float |
PaintStep
Inherits Step
Step where the [Painter] draws a stroke.
Members
| brush | Brush | |
| camera_transform | Transform3D | |
| from | Vector2 | |
| to | Vector2 |
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_label | Label | |
| property | "addons/property_panel/properties.gd".Property | |
| property_control | Control |
Methods
get_value() -> Variant
set_value(to: Variant) -> void
setup(_property: Variant) -> Control
Signals
| property_changed | value: 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
| vertical | bool | 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_changed | property: Variant, value: Variant |
Test
Inherits Resource
A test which checks if the [Painter] functions correctly.
Members
| channels | int | |
| model | Mesh | |
| name | String | |
| steps | Step[] |
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
| brush | Brush | |
| brush_transform | Transform3D | |
| camera_state | "addons/painter/camera_state.gd" | |
| model_transform | Transform3D | |
| pressure | float | |
| screen_position | Vector2 |
addons/painter/preview/stencil_preview.gd
Inherits TextureRect
An overlay that shows the stencil of a brush.
Members
| brush | Brush |
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_memory | int | The maximum Pack objects stored in ram. When this value is exceeded the oldest packs will be saved to disk. |
| max_packs_on_disk | int | 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
| knob | Control | |
| max_value | float | The maximum value allowed. |
| min_value | float | The mininum value allowed by sliding. Smaller numbers can be inputed manually. |
| sensitivity | float | The sensitivity while dragging with the mouse to change the value. |
| step | float | The number the value will be snapped to. Useful for integer inputs. |
| value | float | 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
| filters | PackedStringArray | |
| path | String |
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
| brush | Brush | |
| brush_down | bool | Tracking if a motion event should continue a stroke. |
| brush_preview | BrushPreview | |
| brush_property_panel | "brush_property_panel.gd" | |
| camera | NavigationCamera | |
| change_start | Vector2 | |
| change_start_value | float | |
| changing_size | bool | |
| error_dialog | AcceptDialog | |
| last_stencil | Transform2D | |
| mesh_option_button | OptionButton | |
| paintable_model | MeshInstance3D | |
| painter | Painter | |
| released_at | Vector2 | Where the user clicked to end resizing the brush. |
| save_file_dialog | FileDialog | |
| 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_point | Variant |
Signals
| stroke_added | from: Vector2, to: Vector2 |
tests/result_rect.gd
Inherits TextureRect
Area where the checks of a test can be edited.
Members
| color_picker | ColorPickerButton | |
| start_point | Variant |
Signals
| area_added | position: 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_box | SpinBox | |
| mesh_instance | MeshInstance3D | |
| model_option_button | OptionButton | |
| models | Mesh[] | |
| name_edit | LineEdit | |
| test | Test | |
| tests_option_button | OptionButton |
Methods
load_data(data: Test) -> void
reload_test_list() -> void
tests/tests.gd
Inherits Control
Test runner.
Members
| result_container | VBoxContainer |