WeaponMeshTools ​
Inherits: VBoxContainer
THE TOOLS OF A WEAPON MESH (Assets > Meshes, 2026-11-14; the user: a 3D view of the equipment mesh where the data a dev sets on it is set with tools, not typed blind). The weapon is shown IN THE HAND of the figure of the view (a skeleton of Model Scenes playing an animation: AssetViewport3D), in the very weapon slot the game puts it in, so what is set is what is seen in game. Tools (the row above the view): View turn the camera round (no handles) Grip where the weapon sits in the hand: drag the white handle (its position offset); the X, Y, Z +90 buttons turn it (its rotation offset) Enchant the part of the weapon an enchant covers: click the mesh to place START, click again for END (Shift+click: END), drag the green START, red END and yellow WIDTH handles; the rings show its width Spawn where projectiles leave the weapon: click the mesh, or drag the handle THE MOVE GIZMO (2026-11-14): the handle picked (the last one taken, or the first of the tool) has the X, Y, Z arrows: hold one to move it along that axis only. Hold Ctrl while dragging to snap to the centimetre. A value is told (the signals) when a drag ends or a click places it; the Meshes tab saves it on the mesh (MeshSettings) and shows it in its fields. Main hand or Off hand: which hand of the figure holds it. Without a skeleton (the stand-in) the mesh is shown on its own and the Grip tool has nothing to hold it.
Variables ​
AssetViewport3D | viewport | null |
Tool | active_tool | Tool.VIEW |
int | hand_slot | GeneralSkeleton.WeaponSlot.MAIN_HAND |
Mesh | mesh | null |
Vector3 | grip_position | Vector3.ZERO |
Vector3 | grip_rotation | Vector3.ZERO |
Vector3 | enchant_start | Vector3.ZERO |
Vector3 | enchant_end | Vector3(0, 1, 0) |
float | enchant_width | 0.06 |
Vector3 | spawn_point | Vector3.ZERO |
MeshInstance3D | weapon_node | null |
Node3D | gizmos | null |
MeshInstance3D | grip_gizmo | null |
Dictionary | handles | {} |
MeshInstance3D | lines | null |
AxisGizmo3D | gizmo | null |
String | gizmo_key | "" |
Array[Button] | tool_buttons | [] |
OptionButton | hand_option | null |
OptionButton | effect_option | null |
VFXEnchant | effect | null |
HBoxContainer | rotate_row | null |
Label | hint_label | null |
Methods ​
String | effect_label( effect_name: String ) static |
void | set_weapon( new_mesh: Mesh, values: Dictionary ) |
void | set_values( values: Dictionary ) |
Dictionary | default_enchant( of_mesh: Mesh, old_point: Variant = null ) static |
void | frame_weapon() |
void | set_tool( index: int ) |
Variant | ray_mesh( point: Vector2 ) |
void | move_handle( key: String, world_point: Vector3, snap: bool = false ) |
void | turn_grip( axis: Vector3 ) |
Signals ​
grip_edited( position: Vector3, rotation: Vector3 ) ​
The weapon was moved or turned in the hand (its position and rotation offsets)
enchant_edited( start: Vector3, end: Vector3, width: float ) ​
The enchant segment was set (mesh space: the start, the end, the width)
spawn_edited( point: Vector3 ) ​
The projectile spawn point was set (mesh space)
Enumerations ​
enum Tool ​
- VIEW =
0 - GRIP =
1 - ENCHANT =
2 - SPAWN =
3
Constants ​
floatHANDLE_PICK_PIXELS =14.0- How near (pixels) the mouse must be to a handle to take itfloatHANDLE_RADIUS =0.018ColorCOLOR_START =Color(0.35, 1.0, 0.45)ColorCOLOR_END =Color(1.0, 0.38, 0.32)ColorCOLOR_WIDTH =Color(1.0, 0.85, 0.3)ColorCOLOR_SPAWN =Color(1.0, 0.95, 0.25)ColorCOLOR_GRIP =Color(1.0, 1.0, 1.0)ColorCOLOR_LINE =Color(0.6, 0.9, 1.0)DictionaryTOOL_HINTS ={
Variable descriptions ​
AssetViewport3D viewport = null ​
No description yet.
Tool active_tool = Tool.VIEW ​
No description yet.
int hand_slot = GeneralSkeleton.WeaponSlot.MAIN_HAND ​
No description yet.
Mesh mesh = null ​
No description yet.
Vector3 grip_position = Vector3.ZERO ​
The values (the weapon's position and rotation offsets in the hand; the enchant segment and the spawn point in the mesh's own space)
Vector3 grip_rotation = Vector3.ZERO ​
No description yet.
Vector3 enchant_start = Vector3.ZERO ​
No description yet.
Vector3 enchant_end = Vector3(0, 1, 0) ​
No description yet.
float enchant_width = 0.06 ​
No description yet.
Vector3 spawn_point = Vector3.ZERO ​
No description yet.
MeshInstance3D weapon_node = null ​
Where the mesh is shown (a weapon slot of the figure, or a node of its own), its handles (in its space), the grip handle (in the hand's space)
Node3D gizmos = null ​
No description yet.
MeshInstance3D grip_gizmo = null ​
No description yet.
Dictionary handles = ​
No description yet.
MeshInstance3D lines = null ​
No description yet.
AxisGizmo3D gizmo = null ​
THE MOVE GIZMO (2026-11-14): on the handle picked (the last one taken; the first of the tool), hold an arrow to move it along one axis
String gizmo_key = "" ​
No description yet.
Array[Button] tool_buttons = [] ​
No description yet.
OptionButton hand_option = null ​
No description yet.
OptionButton effect_option = null ​
The enchant effect shown on the weapon (No effect, or one of the enchant folder), and the one shown
VFXEnchant effect = null ​
No description yet.
HBoxContainer rotate_row = null ​
No description yet.
Label hint_label = null ​
No description yet.
Method descriptions ​
String effect_label( effect_name: String ) ​
The name of an enchant in the list: its theme and its name ("Fire Weapon 02")
void set_weapon( new_mesh: Mesh, values: Dictionary ) ​
Shows a weapon mesh with its values: position_offset, rotation_offset, enchant_start, enchant_end, enchant_width, projectile_spawn_point (and the old enchant_vfx_position, read as the start)
void set_values( values: Dictionary ) ​
Takes the values (from the fields of the Meshes tab) without telling them back
Dictionary default_enchant( of_mesh: Mesh, old_point: Variant = null ) ​
The segment a mesh without one gets: along its longest side, from a third of the way to its far end (or from the old enchant point), reaching three quarters of its wider side from the line (a sword 8 cm wide: 6 cm)
void frame_weapon() ​
The camera looks at the weapon (in the hand, or on its own)
void set_tool( index: int ) ​
No description yet.
Variant ray_mesh( point: Vector2 ) ​
Where the ray through a point of the view first meets the mesh, in the mesh's own space (null: it misses)
void move_handle( key: String, world_point: Vector3, snap: bool = false ) ​
Moves a handle to a point of the world (snapped to the centimetre with snap)
void turn_grip( axis: Vector3 ) ​
Turns the weapon a quarter turn round an axis of the hand