-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@tool | ||
extends EditorNode3DGizmoPlugin | ||
|
||
var editor_plugin : EditorPlugin | ||
|
||
func _init(_editor_plugin:EditorPlugin): | ||
editor_plugin = _editor_plugin | ||
create_material("main", Color(1,1,1), false, true, true) | ||
|
||
func _has_gizmo(node): | ||
return node is GPUTrail3D | ||
|
||
# show gizmo name in visibility list | ||
func _get_gizmo_name(): | ||
return "GPUTrail3DGizmo" | ||
|
||
func _redraw(gizmo): | ||
gizmo.clear() | ||
|
||
var node3d : Node3D = gizmo.get_node_3d() | ||
|
||
var lines = PackedVector3Array() | ||
|
||
lines.push_back(Vector3(0,1,0)) | ||
lines.push_back(Vector3(0,-1,0)) | ||
|
||
gizmo.add_lines(lines, get_material("main", gizmo), false, Color(1,1,1,1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
@tool | ||
extends EditorPlugin | ||
|
||
const MyCustomGizmoPlugin = preload("gizmo/gizmo.gd") | ||
var gizmo_plugin = MyCustomGizmoPlugin.new(self) | ||
|
||
func _enter_tree(): | ||
# Initialization of the plugin goes here. | ||
# Add the new type with a name, a parent type, a script and an icon. | ||
add_custom_type("GPUTrail3D", "GPUParticles3D", preload("GPUTrail3D.gd"), preload("bounce.svg")) | ||
|
||
add_node_3d_gizmo_plugin(gizmo_plugin) | ||
|
||
func _exit_tree(): | ||
# Clean-up of the plugin goes here. | ||
# Always remember to remove it from the engine when deactivated. | ||
remove_custom_type("GPUTrail3D") | ||
|
||
remove_node_3d_gizmo_plugin(gizmo_plugin) |