Remove old and unused project settings, update various demos for 4.2 (#1024)

- Move all demo projects that don't require Forward+/Mobile-only features
  to the Compatibility rendering method. This improves performance significantly
  on low-end devices and ensures visuals are identical to a web export
  of the demo.
- Set deadzone on all inputs to 0.2 for better gamepad usability.
- Remove reliance on `default_env.tres` to use built-in Environment
  resources in the main scene instead (which follows the preview environment
  workflow).
- Remove notices pointing to GDNative or VisualScript, since both were
  removed in 4.0.
- Various bug fixes and usability tweaks to 10+ demos.
This commit is contained in:
Hugo Locurcio
2024-03-26 18:01:58 +01:00
committed by GitHub
parent 82913393a8
commit 31d1c0c112
266 changed files with 1619 additions and 1829 deletions

View File

@@ -2,14 +2,15 @@
This contains multiple plugin demos, all placed in a project for convenience.
Due to bug 36713 you need to open the project to import the assets once, then close, then open.
Due to [issue #36713](https://github.com/godotengine/godot/issues/36713),
you need to open the project to import the assets once, then close, then open.
Please see the documentation for editor plugins:
https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html
See the [documentation on editor plugins](https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html)
for more information.
Language: GDScript
Renderer: GLES 2
Renderer: Compatibility
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/585
@@ -36,7 +37,7 @@ 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
If you make a ZIP archive 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/*`

View File

@@ -16,5 +16,5 @@ A custom node type:
The way it works in this plugin is using the `add_custom_type` and `remove_custom_type` in the plugin script file.
Using this method you can specify any name, base type, script, and icon for your custom node.
There is also another way to add custom node types, which is using the `class_name` keyword in a script. However,
the `class_name` system is newer, may change in the future, and it is not available for C# or VisualScript.
There is also another way to add custom node types, which is using the `class_name` keyword in a script,
or [using the `[GlobalClass]` attribute above a class declaration in C#](https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_global_classes.html).

View File

@@ -16,27 +16,27 @@ func _ready():
func save_pressed():
get_node(^"SaveMaterialDialog").popup_centered()
get_node(^"SaveMaterialDialog").popup_centered_ratio()
func load_pressed():
get_node(^"LoadMaterialDialog").popup_centered()
get_node(^"LoadMaterialDialog").popup_centered_ratio()
func apply_pressed():
# Using the passed in editor interface, get the selected nodes in the editor.
var editor_selection = editor_interface.get_selection()
var selected_nodes = editor_selection.get_selected_nodes()
if selected_nodes.size() == 0:
printerr("Material Creator: Can't apply the material, because there are no nodes selected!")
if selected_nodes.is_empty():
push_error("Material Creator: Can't apply the material, because there are no nodes selected!")
var material = _silly_resource_from_values().make_material()
# Go through the selected nodes and see if they have the "set_surface_material"
# Go through the selected nodes and see if they have the "set_surface_override_material"
# function (which only MeshInstance3D has by default). If they do, then set the material
# to the silly material.
for node in selected_nodes:
if node.has_method("set_surface_material"):
node.set_surface_material(0, material)
if node.has_method("set_surface_override_material"):
node.set_surface_override_material(0, material)
func save_file_selected(path):

View File

@@ -2,13 +2,13 @@
[ext_resource type="Script" path="res://addons/material_creator/material_creator.gd" id="1"]
[node name="Material Creator Plugin" type="Panel"]
[node name="Material Creator" type="Panel"]
offset_right = 220.0
offset_bottom = 340.0
script = ExtResource("1")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchors_preset = 13
layout_mode = 0
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
@@ -17,77 +17,53 @@ offset_right = 100.0
grow_horizontal = 2
grow_vertical = 2
[node name="DockName" type="Label" parent="VBoxContainer"]
offset_right = 200.0
offset_bottom = 26.0
text = "Material creator"
[node name="AlbedoLabel" type="Label" parent="VBoxContainer"]
offset_top = 30.0
offset_right = 200.0
offset_bottom = 56.0
text = "Albedo color"
layout_mode = 2
text = "Albedo Color:"
[node name="AlbedoColorPicker" type="ColorPickerButton" parent="VBoxContainer"]
offset_top = 60.0
offset_right = 200.0
offset_bottom = 68.0
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
color = Color(1, 1, 1, 1)
[node name="MetallicLabel" type="Label" parent="VBoxContainer"]
offset_top = 72.0
offset_right = 200.0
offset_bottom = 98.0
text = "Metallic strength"
layout_mode = 2
text = "Metallic Strength:"
[node name="MetallicSlider" type="HSlider" parent="VBoxContainer"]
offset_top = 102.0
offset_right = 200.0
offset_bottom = 118.0
layout_mode = 2
max_value = 1.0
step = 0.05
[node name="RoughnessLabel" type="Label" parent="VBoxContainer"]
offset_top = 122.0
offset_right = 200.0
offset_bottom = 148.0
text = "Roughness strength"
layout_mode = 2
text = "Roughness Strength:"
[node name="RoughnessSlider" type="HSlider" parent="VBoxContainer"]
offset_top = 152.0
offset_right = 200.0
offset_bottom = 168.0
layout_mode = 2
max_value = 1.0
step = 0.05
ticks_on_borders = true
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
offset_top = 172.0
offset_right = 200.0
offset_bottom = 176.0
layout_mode = 2
[node name="ApplyButton" type="Button" parent="VBoxContainer"]
offset_top = 180.0
offset_right = 200.0
offset_bottom = 211.0
text = "Apply material"
layout_mode = 2
text = "Apply Material"
[node name="SaveButton" type="Button" parent="VBoxContainer"]
offset_top = 215.0
offset_right = 200.0
offset_bottom = 246.0
text = "Save material"
layout_mode = 2
text = "Save Material"
[node name="LoadButton" type="Button" parent="VBoxContainer"]
offset_top = 250.0
offset_right = 200.0
offset_bottom = 281.0
text = "Load material"
layout_mode = 2
text = "Load Material"
clip_text = true
[node name="Label" type="Label" parent="VBoxContainer/LoadButton"]
visible = false
anchors_preset = 15
layout_mode = 0
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -10.0

View File

@@ -31,7 +31,5 @@ enabled=PackedStringArray("res://addons/main_screen/plugin.cfg", "res://addons/m
[rendering]
quality/driver/driver_name="GLES2"
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_environment="res://default_env.tres"
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"