Main nodes for mat_maker_gd and Initial setup for an editor plugin.

This commit is contained in:
Relintai 2021-10-03 19:56:35 +02:00
parent 46dae7373b
commit 059cabc48b
15 changed files with 101 additions and 4 deletions

View File

@ -0,0 +1,21 @@
[gd_scene format=2]
[node name="MatMakerGDEditor" type="MarginContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
rect_min_size = Vector2( 0, 200 )
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_right = 1024.0
margin_bottom = 600.0
[node name="GraphEdit" type="GraphEdit" parent="VBoxContainer"]
margin_right = 1024.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
static func clampv3(v : Vector3, mi : Vector3, ma : Vector3) -> Vector3: static func clampv3(v : Vector3, mi : Vector3, ma : Vector3) -> Vector3:

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -1,3 +1,4 @@
tool
extends Reference extends Reference
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")

View File

@ -0,0 +1,7 @@
tool
class_name MMMateial
extends Resource
var MMMNode = preload("res://addons/mat_maker_gd/nodes/mm_node.gd")
export(Array) var nodes : Array

View File

@ -0,0 +1,4 @@
tool
extends Resource

View File

@ -1,10 +1,59 @@
tool tool
extends EditorPlugin extends EditorPlugin
var MMNode = preload("res://addons/mat_maker_gd/nodes/mm_node.gd")
var MMMaterial = preload("res://addons/mat_maker_gd/nodes/mm_material.gd")
var editor_packed_scene = preload("res://addons/mat_maker_gd/editor/MatMakerGDEditor.tscn")
var editor_scene = null
var tool_button : ToolButton = null
func _enter_tree(): func _enter_tree():
pass add_custom_type("MMNode", "Resource", MMNode, null)
editor_scene = editor_packed_scene.instance()
tool_button = add_control_to_bottom_panel(editor_scene, "MMGD")
tool_button.hide()
func _exit_tree(): func _exit_tree():
remove_custom_type("MMNode")
remove_control_from_bottom_panel(editor_scene)
if editor_scene:
editor_scene.queue_free()
editor_scene = null
tool_button = null
func handles(object):
return object is MMMateial
func edit(object):
#if editor_scene:
# make_bottom_panel_item_visible(editor_scene)
pass pass
func make_visible(visible):
if tool_button:
if visible:
tool_button.show()
else:
#if tool_button.pressed:
# tool_button.pressed = false
if !tool_button.pressed:
tool_button.hide()
func get_plugin_icon():
return null
func get_plugin_name():
return "MatMakerGD"
func has_main_screen():
return false

View File

@ -144,6 +144,11 @@ _global_script_classes=[ {
"language": "GDScript", "language": "GDScript",
"path": "res://texture_tools/LayeredTextureMaker.gd" "path": "res://texture_tools/LayeredTextureMaker.gd"
}, { }, {
"base": "Resource",
"class": "MMMateial",
"language": "GDScript",
"path": "res://addons/mat_maker_gd/nodes/mm_material.gd"
}, {
"base": "Node", "base": "Node",
"class": "Main", "class": "Main",
"language": "GDScript", "language": "GDScript",
@ -247,6 +252,7 @@ _global_script_class_icons={
"HealthResource": "", "HealthResource": "",
"ItemTemplateGD": "", "ItemTemplateGD": "",
"LayeredTextureMaker": "", "LayeredTextureMaker": "",
"MMMateial": "",
"Main": "", "Main": "",
"MainTPlanetGenerator": "", "MainTPlanetGenerator": "",
"ManaResource": "", "ManaResource": "",
@ -310,7 +316,7 @@ window/size/ui_scale_touch=1.0
[editor_plugins] [editor_plugins]
enabled=PoolStringArray( "res://addons/Godoxel/plugin.cfg", "res://addons/color-palette/plugin.cfg", "res://addons/mesh_data_resource_editor/plugin.cfg" ) enabled=PoolStringArray( "res://addons/Godoxel/plugin.cfg", "res://addons/color-palette/plugin.cfg", "res://addons/mat_maker_gd/plugin.cfg", "res://addons/mesh_data_resource_editor/plugin.cfg" )
[ess] [ess]