diff --git a/plugins/README.md b/plugins/README.md index 2b8de36d..0e07ad8b 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -1,9 +1,35 @@ -# Plugin demos +# Plugin Demos -To use these plugins, copy any of these folders to the `addons/` folder in a Godot project. +This contains multiple plugin demos, all placed in a project for convenience. + +Please see the documentation for editor plugins: +https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html + +Language: GDScript + +Renderer: GLES 2 + +# How does it work? + +This project contains 3 plugins: + +* The custom node plugin shows how to create a custom node type + using `add_custom_type`. [More info](addons/custom_node). + +* The material import plugin shows how to make a plugin handle importing + a custom file type (mtxt). [More info](addons/material_import_plugin). + +* The material creator plugin shows how to add a custom dock with some + simple functionality. [More info](addons/material_creator). + +To use these plugins in another project, copy any of these +folders to the `addons/` folder in a Godot project, and then +enable them in the project settings menu. For example, the path would look like: `addons/custom_node` -Plugins can be distributed and installed from the UI. If you make a zip that contains the folder, Godot will recognize it as a plugin and will allow you to install it. +Plugins can be distributed and installed from the UI. +If you make a zip that contains the folder, Godot will recognize +it as a plugin and will allow you to install it. This can be done via the terminal: `zip -r custom_node.zip custom_node/*` diff --git a/plugins/addons/README.md b/plugins/addons/README.md new file mode 100644 index 00000000..dbc4d3ed --- /dev/null +++ b/plugins/addons/README.md @@ -0,0 +1,12 @@ +# How to use + +To use these plugins in another project, copy any of these +folders to the `addons/` folder in a Godot project. + +For example, the path would look like: `addons/custom_node` + +Plugins can be distributed and installed from the UI. +If you make a zip that contains the folder, Godot will recognize +it as a plugin and will allow you to install it. + +This can be done via the terminal: `zip -r custom_node.zip custom_node/*` diff --git a/plugins/custom_node/README.md b/plugins/addons/custom_node/README.md similarity index 100% rename from plugins/custom_node/README.md rename to plugins/addons/custom_node/README.md diff --git a/plugins/custom_node/heart.gd b/plugins/addons/custom_node/heart.gd similarity index 100% rename from plugins/custom_node/heart.gd rename to plugins/addons/custom_node/heart.gd diff --git a/plugins/custom_node/heart.png b/plugins/addons/custom_node/heart.png similarity index 100% rename from plugins/custom_node/heart.png rename to plugins/addons/custom_node/heart.png diff --git a/plugins/custom_node/heart.png.import b/plugins/addons/custom_node/heart.png.import similarity index 100% rename from plugins/custom_node/heart.png.import rename to plugins/addons/custom_node/heart.png.import diff --git a/plugins/custom_node/heart_icon.png b/plugins/addons/custom_node/heart_icon.png similarity index 100% rename from plugins/custom_node/heart_icon.png rename to plugins/addons/custom_node/heart_icon.png diff --git a/plugins/custom_node/heart_icon.png.import b/plugins/addons/custom_node/heart_icon.png.import similarity index 100% rename from plugins/custom_node/heart_icon.png.import rename to plugins/addons/custom_node/heart_icon.png.import diff --git a/plugins/custom_node/heart_plugin.gd b/plugins/addons/custom_node/heart_plugin.gd similarity index 100% rename from plugins/custom_node/heart_plugin.gd rename to plugins/addons/custom_node/heart_plugin.gd diff --git a/plugins/custom_node/plugin.cfg b/plugins/addons/custom_node/plugin.cfg similarity index 100% rename from plugins/custom_node/plugin.cfg rename to plugins/addons/custom_node/plugin.cfg diff --git a/plugins/addons/material_creator/README.md b/plugins/addons/material_creator/README.md new file mode 100644 index 00000000..147fbca7 --- /dev/null +++ b/plugins/addons/material_creator/README.md @@ -0,0 +1,20 @@ +# Material Creator Plugin Demo + +This plugin demo contains a custom material creator +interface using a custom dock in the editor. + +Custom docks are made of Control nodes, they run in the +editor, and any behavior must be done through `tool` scripts. +For more information, see this documentation article: +https://docs.godotengine.org/en/latest/tutorials/plugins/editor/making_plugins.html#a-custom-dock + +This plugin allows you to specify color, metallic, and +roughness values, and then use it as a material. + +You can apply this material directly to Spatial +nodes by selecting them and then clicking "Apply". +This shows how a plugin can interact closely with the +editor, manipulating nodes the user selects. + +Alternatively, you can also save the material to +a file, and then load it back into the plugin later. diff --git a/plugins/material_creator/material_creator.gd b/plugins/addons/material_creator/material_creator.gd similarity index 100% rename from plugins/material_creator/material_creator.gd rename to plugins/addons/material_creator/material_creator.gd diff --git a/plugins/material_creator/material_dock.tscn b/plugins/addons/material_creator/material_dock.tscn similarity index 100% rename from plugins/material_creator/material_dock.tscn rename to plugins/addons/material_creator/material_dock.tscn diff --git a/plugins/material_creator/material_plugin.gd b/plugins/addons/material_creator/material_plugin.gd similarity index 100% rename from plugins/material_creator/material_plugin.gd rename to plugins/addons/material_creator/material_plugin.gd diff --git a/plugins/material_creator/material_resource.gd b/plugins/addons/material_creator/material_resource.gd similarity index 100% rename from plugins/material_creator/material_resource.gd rename to plugins/addons/material_creator/material_resource.gd diff --git a/plugins/material_creator/plugin.cfg b/plugins/addons/material_creator/plugin.cfg similarity index 100% rename from plugins/material_creator/plugin.cfg rename to plugins/addons/material_creator/plugin.cfg diff --git a/plugins/addons/material_import_plugin/README.md b/plugins/addons/material_import_plugin/README.md new file mode 100644 index 00000000..77294182 --- /dev/null +++ b/plugins/addons/material_import_plugin/README.md @@ -0,0 +1,9 @@ +# Material Import Plugin Demo + +This plugin demo shows how a custom import system can +be added to the editor. In this case, it imports a material. +For more information, see this documentation article: +https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html + +In the editor, try opening `test.mtxt`. Godot will recognize +it and import it as a material because of this plugin. diff --git a/plugins/material_import_plugin/import.gd b/plugins/addons/material_import_plugin/import.gd similarity index 100% rename from plugins/material_import_plugin/import.gd rename to plugins/addons/material_import_plugin/import.gd diff --git a/plugins/material_import_plugin/plugin.cfg b/plugins/addons/material_import_plugin/plugin.cfg similarity index 100% rename from plugins/material_import_plugin/plugin.cfg rename to plugins/addons/material_import_plugin/plugin.cfg diff --git a/plugins/material_import_plugin/plugin.gd b/plugins/addons/material_import_plugin/plugin.gd similarity index 100% rename from plugins/material_import_plugin/plugin.gd rename to plugins/addons/material_import_plugin/plugin.gd diff --git a/plugins/material_import_plugin/test.mtxt b/plugins/addons/material_import_plugin/test.mtxt similarity index 100% rename from plugins/material_import_plugin/test.mtxt rename to plugins/addons/material_import_plugin/test.mtxt diff --git a/plugins/material_import_plugin/test.mtxt.import b/plugins/addons/material_import_plugin/test.mtxt.import similarity index 100% rename from plugins/material_import_plugin/test.mtxt.import rename to plugins/addons/material_import_plugin/test.mtxt.import diff --git a/plugins/custom_node_test.tscn b/plugins/custom_node_test.tscn new file mode 100644 index 00000000..8684e02a --- /dev/null +++ b/plugins/custom_node_test.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/custom_node/heart.gd" type="Script" id=1] + +[sub_resource type="CubeMesh" id=1] + +[node name="CustomNodeTest" type="Node2D"] + +[node name="Heart" type="Node2D" parent="."] +script = ExtResource( 1 ) + +[node name="MeshInstance" type="MeshInstance" parent="."] +mesh = SubResource( 1 ) +skeleton = NodePath("") +material/0 = null diff --git a/plugins/default_env.tres b/plugins/default_env.tres new file mode 100644 index 00000000..20207a4a --- /dev/null +++ b/plugins/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/plugins/icon.png b/plugins/icon.png new file mode 100644 index 00000000..c98fbb60 Binary files /dev/null and b/plugins/icon.png differ diff --git a/plugins/icon.png.import b/plugins/icon.png.import new file mode 100644 index 00000000..96cbf462 --- /dev/null +++ b/plugins/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/plugins/material_creator/README.md b/plugins/material_creator/README.md deleted file mode 100644 index acdde591..00000000 --- a/plugins/material_creator/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Material Creator Plugin Demo - -This plugin demo contains a custom material creator interface using a custom dock in the editor. - -Custom docks are made of Control nodes, they run in the editor, and any behavior must be done through `tool` scripts. -For more information, see this documentation article: https://docs.godotengine.org/en/latest/tutorials/plugins/editor/making_plugins.html#a-custom-dock - -This plugin allows you to specify color, metallic, and roughness values, and then use it as a material. - -You can apply this silly material directly to Spatial nodes by selecting them and then clicking "Apply". -This shows how a plugin can interact closely with the editor, manipulating nodes the user selects. - -Alternatively, you can also save the silly material to a file, and then load it back into the plugin later. diff --git a/plugins/material_import_plugin/README.md b/plugins/material_import_plugin/README.md deleted file mode 100644 index 70a3a26f..00000000 --- a/plugins/material_import_plugin/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Material Import Plugin Demo - -This plugin demo shows how a custom import system can be added to the editor. In this case, it imports a material. -For more information, see this documentation article: https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html - -In the editor, try opening `test.mtxt`. Godot will recognize it and import it as a material because of this plugin. diff --git a/plugins/project.godot b/plugins/project.godot new file mode 100644 index 00000000..8ffa7ea0 --- /dev/null +++ b/plugins/project.godot @@ -0,0 +1,32 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ ] +_global_script_class_icons={ + +} + +[application] + +config/name="Plugin Demos" +config/description="This contains multiple plugin demos, all placed in a project for convenience." +run/main_scene="res://custom_node_test.tscn" +config/icon="res://icon.png" + +[editor_plugins] + +enabled=PoolStringArray( "custom_node", "material_creator", "material_import_plugin" ) + +[rendering] + +quality/driver/driver_name="GLES2" +vram_compression/import_etc=true +vram_compression/import_etc2=false +environment/default_environment="res://default_env.tres"