summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-03-13 16:58:31 +0100
committerGitHub <noreply@github.com>2023-03-13 16:58:31 +0100
commit30e81fcc26ee4e9394abe2504c6dd613b06a85db (patch)
tree9f1cfef5f96c0392260646f03addce85f4604772 /modules
parenteb503fb461f996ae9fb56c0525abed784e9ed8db (diff)
parent857cd853dee0ebd553621ec4c29f16d7ca79085a (diff)
Merge pull request #74866 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 1st batch
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml4
-rw-r--r--modules/gdscript/gdscript.cpp6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd16
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd16
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/property_inline.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/static_typing.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/static_typing.out10
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd2
-rw-r--r--modules/gltf/doc_classes/GLTFNode.xml13
-rw-r--r--modules/gltf/doc_classes/GLTFState.xml26
-rw-r--r--modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp2
-rw-r--r--modules/mono/csharp_script.cpp12
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs30
-rw-r--r--modules/openxr/doc_classes/OpenXRAction.xml2
-rw-r--r--modules/text_server_adv/text_server_adv.cpp9
-rw-r--r--modules/text_server_adv/text_server_adv.h2
-rw-r--r--modules/text_server_fb/text_server_fb.cpp4
31 files changed, 134 insertions, 70 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 045505b720..effc0aab96 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -285,7 +285,7 @@
@export var string = ""
@export var int_number = 5
@export var float_number: float = 5
- @export var image : Image
+ @export var image: Image
[/codeblock]
</description>
</annotation>
@@ -309,7 +309,7 @@
Export a [Color] property without allowing its transparency ([member Color.a]) to be edited.
See also [constant PROPERTY_HINT_COLOR_NO_ALPHA].
[codeblock]
- @export_color_no_alpha var dye_color : Color
+ @export_color_no_alpha var dye_color: Color
[/codeblock]
</description>
</annotation>
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index b6caefbdb5..1a1d021dbc 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1010,12 +1010,14 @@ void GDScript::_bind_methods() {
}
void GDScript::set_path(const String &p_path, bool p_take_over) {
- String old_path = path;
if (is_root_script()) {
Script::set_path(p_path, p_take_over);
}
- this->path = p_path;
+
+ String old_path = path;
+ path = p_path;
GDScriptCache::move_script(old_path, p_path);
+
for (KeyValue<StringName, Ref<GDScript>> &kv : subclasses) {
kv.value->set_path(p_path, p_take_over);
}
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd b/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
index 62ac1c3108..900155569c 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
@@ -1,7 +1,7 @@
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
-func enum_func(e : MyEnum) -> void:
+func enum_func(e: MyEnum) -> void:
print(e)
func test():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
index dd2708b21d..63c080e583 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
@@ -4,4 +4,4 @@ func test():
x.free()
var ok = x
- var bad : Node = x
+ var bad: Node = x
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
index 4e75ded96a..c84a4ad8af 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
@@ -2,5 +2,5 @@ enum LocalNamed { VALUE_A, VALUE_B, VALUE_C = 42 }
func test():
const P = preload("../features/enum_from_outer.gd")
- var x : LocalNamed
+ var x: LocalNamed
x = P.Named.VALUE_A
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
index f1be6aaa0c..35f506aabd 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Getter function has wrong return type.
-var prop : String:
+var prop: String:
get = get_prop
func get_prop():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
index dd190157a1..eedeea915d 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
@@ -1,10 +1,10 @@
-var _prop : int
+var _prop: int
# Setter function has wrong argument type.
-var prop : String:
+var prop: String:
set = set_prop
-func set_prop(value : int):
+func set_prop(value: int):
_prop = value
func test():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
index 7f2b29222a..90b00fbe13 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Inline getter returns int instead of String.
-var prop : String:
+var prop: String:
get:
return _prop
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
index 0ce239dbbd..5747b85fc7 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Inline setter assigns String to int.
-var prop : String:
+var prop: String:
set(value):
_prop = value
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
index 758fbaccc9..b0cfdea75d 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
@@ -7,4 +7,4 @@ func test():
x.free()
var ok = x
- var bad : A = x
+ var bad: A = x
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
index 3076e7069f..8e6bb22a12 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
@@ -1,7 +1,7 @@
enum Enum {V1, V2}
func test():
- var enumAsDict : Dictionary = Enum.duplicate()
+ var enumAsDict: Dictionary = Enum.duplicate()
var enumAsVariant = Enum.duplicate()
print(Enum.has("V1"))
print(enumAsDict.has("V1"))
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
index 8a4e89d0d6..3a1863a1f4 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
@@ -5,19 +5,19 @@ enum MyEnum { V0, V1, V2 }
class InnerClass:
enum MyEnum { V0, V2, V1 }
- func inner_inner_no_class(e : MyEnum) -> MyEnum:
+ func inner_inner_no_class(e: MyEnum) -> MyEnum:
print(e)
return e
- func inner_inner_class(e : InnerClass.MyEnum) -> InnerClass.MyEnum:
+ func inner_inner_class(e: InnerClass.MyEnum) -> InnerClass.MyEnum:
print(e)
return e
- func inner_inner_class_class(e : EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
+ func inner_inner_class_class(e: EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
print(e)
return e
- func inner_outer(e : EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
+ func inner_outer(e: EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
print(e)
return e
@@ -59,19 +59,19 @@ class InnerClass:
print()
-func outer_outer_no_class(e : MyEnum) -> MyEnum:
+func outer_outer_no_class(e: MyEnum) -> MyEnum:
print(e)
return e
-func outer_outer_class(e : EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
+func outer_outer_class(e: EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
print(e)
return e
-func outer_inner_class(e : InnerClass.MyEnum) -> InnerClass.MyEnum:
+func outer_inner_class(e: InnerClass.MyEnum) -> InnerClass.MyEnum:
print(e)
return e
-func outer_inner_class_class(e : EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
+func outer_inner_class_class(e: EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
print(e)
return e
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
index 6a0a1e1969..0e4fd59267 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
@@ -1,9 +1,9 @@
-func print_enum(e : TileSet.TileShape) -> TileSet.TileShape:
+func print_enum(e: TileSet.TileShape) -> TileSet.TileShape:
print(e)
return e
func test():
- var v : TileSet.TileShape
+ var v: TileSet.TileShape
v = TileSet.TILE_SHAPE_SQUARE
v = print_enum(v)
v = print_enum(TileSet.TILE_SHAPE_SQUARE)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
index b05ae82048..1c4b19d8e0 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
@@ -7,9 +7,9 @@ class InnerClass:
static func test_inner_from_inner():
print("Inner - Inner")
- var e1 : MyEnum
- var e2 : InnerClass.MyEnum
- var e3 : EnumTypecheckOuterClass.InnerClass.MyEnum
+ var e1: MyEnum
+ var e2: InnerClass.MyEnum
+ var e3: EnumTypecheckOuterClass.InnerClass.MyEnum
print("Self ", e1, e2, e3)
e1 = MyEnum.V1
@@ -36,7 +36,7 @@ class InnerClass:
static func test_outer_from_inner():
print("Inner - Outer")
- var e : EnumTypecheckOuterClass.MyEnum
+ var e: EnumTypecheckOuterClass.MyEnum
e = EnumTypecheckOuterClass.MyEnum.V1
print("Outer.MyEnum ", e)
@@ -45,8 +45,8 @@ class InnerClass:
func test_outer_from_outer():
print("Outer - Outer")
- var e1 : MyEnum
- var e2 : EnumTypecheckOuterClass.MyEnum
+ var e1: MyEnum
+ var e2: EnumTypecheckOuterClass.MyEnum
print("Self ", e1, e2)
e1 = MyEnum.V1
@@ -63,8 +63,8 @@ func test_outer_from_outer():
func test_inner_from_outer():
print("Outer - Inner")
- var e1 : InnerClass.MyEnum
- var e2 : EnumTypecheckOuterClass.InnerClass.MyEnum
+ var e1: InnerClass.MyEnum
+ var e2: EnumTypecheckOuterClass.InnerClass.MyEnum
print("Inner ", e1, e2)
e1 = InnerClass.MyEnum.V1
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
index 38bb7f6e9c..5b0e5c0bf0 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
@@ -1,4 +1,4 @@
-var Value:int = 8 :
+var Value:int = 8:
get:
return Value
set(v):
diff --git a/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd b/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
index 23eb011b23..474bb49a3b 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
@@ -6,21 +6,21 @@ var prop1:
prop1 = value
# Typed inline property
-var prop2 : int:
+var prop2: int:
get:
return prop2
set(value):
prop2 = value
# Typed inline property with default value
-var prop3 : int = 1:
+var prop3: int = 1:
get:
return prop3
set(value):
prop3 = value
# Typed inline property with backing variable
-var _prop4 : int = 2
+var _prop4: int = 2
var prop4: int:
get:
return _prop4
diff --git a/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd b/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
index beabf3d2e5..5fbc91be5e 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
@@ -1,4 +1,4 @@
-const preloaded : GDScript = preload("gdscript_to_preload.notest.gd")
+const preloaded: GDScript = preload("gdscript_to_preload.notest.gd")
func test():
var preloaded_instance: preloaded = preloaded.new()
diff --git a/modules/gdscript/tests/scripts/parser/features/static_typing.gd b/modules/gdscript/tests/scripts/parser/features/static_typing.gd
index d42632c82d..0157ca2128 100644
--- a/modules/gdscript/tests/scripts/parser/features/static_typing.gd
+++ b/modules/gdscript/tests/scripts/parser/features/static_typing.gd
@@ -1,3 +1,5 @@
+# Do not fix code style here!
+
func test():
# The following lines are equivalent:
var _integer: int = 1
diff --git a/modules/gdscript/tests/scripts/parser/features/static_typing.out b/modules/gdscript/tests/scripts/parser/features/static_typing.out
index 92ce7bc0e0..207d90fef1 100644
--- a/modules/gdscript/tests/scripts/parser/features/static_typing.out
+++ b/modules/gdscript/tests/scripts/parser/features/static_typing.out
@@ -1,21 +1,21 @@
GDTEST_OK
>> WARNING
->> Line: 9
+>> Line: 11
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER'
>> WARNING
->> Line: 10
+>> Line: 12
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_TYPED' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_TYPED'
>> WARNING
->> Line: 11
+>> Line: 13
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_TYPED2' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_TYPED2'
>> WARNING
->> Line: 12
+>> Line: 14
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_INFERRED' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_INFERRED'
>> WARNING
->> Line: 13
+>> Line: 15
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_INFERRED2' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_INFERRED2'
diff --git a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
index 03278e453f..0851d939dc 100644
--- a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
@@ -1,8 +1,8 @@
extends Node
@onready var later_inferred := [1]
-@onready var later_static : Array
-@onready var later_static_with_init : Array = [1]
+@onready var later_static: Array
+@onready var later_static_with_init: Array = [1]
@onready var later_untyped = [1]
func test():
diff --git a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
index 3eb02816ed..14c93eb159 100644
--- a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
@@ -1,5 +1,5 @@
#GDTEST_OK
-var prop : int = 0:
+var prop: int = 0:
get:
return prop
set(value):
diff --git a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
index efa8270526..20b024f09e 100644
--- a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
@@ -4,6 +4,6 @@ func test():
@warning_ignore("narrowing_conversion")
var foo: int = 0.0
print(typeof(foo) == TYPE_INT)
- var dict : Dictionary = {"a":0.0}
+ var dict: Dictionary = {"a": 0.0}
foo = dict.get("a")
print(typeof(foo) == TYPE_INT)
diff --git a/modules/gltf/doc_classes/GLTFNode.xml b/modules/gltf/doc_classes/GLTFNode.xml
index f3b3e61501..b9223bfdfa 100644
--- a/modules/gltf/doc_classes/GLTFNode.xml
+++ b/modules/gltf/doc_classes/GLTFNode.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and more specialized properties (represented by their own classes).
+ GLTF nodes generally exist inside of [GLTFState] which represents all data of a GLTF file. Most of GLTFNode's properties are indices of other data in the GLTF file. You can extend a GLTF node with additional properties by using [method get_additional_data] and [method set_additional_data].
</description>
<tutorials>
<link title="GLTF scene and node spec">https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md"</link>
@@ -30,28 +31,40 @@
</methods>
<members>
<member name="camera" type="int" setter="set_camera" getter="get_camera" default="-1">
+ If this GLTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes the camera's properties. If -1, this node is not a camera.
</member>
<member name="children" type="PackedInt32Array" setter="set_children" getter="get_children" default="PackedInt32Array()">
+ The indices of the children nodes in the [GLTFState]. If this GLTF node has no children, this will be an empty array.
</member>
<member name="height" type="int" setter="set_height" getter="get_height" default="-1">
+ How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated.
</member>
<member name="light" type="int" setter="set_light" getter="get_light" default="-1">
+ If this GLTF node is a light, the index of the [GLTFLight] in the [GLTFState] that describes the light's properties. If -1, this node is not a light.
</member>
<member name="mesh" type="int" setter="set_mesh" getter="get_mesh" default="-1">
+ If this GLTF node is a mesh, the index of the [GLTFMesh] in the [GLTFState] that describes the mesh's properties. If -1, this node is not a mesh.
</member>
<member name="parent" type="int" setter="set_parent" getter="get_parent" default="-1">
+ The index of the parent node in the [GLTFState]. If -1, this node is a root node.
</member>
<member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)">
+ The position of the GLTF node relative to its parent.
</member>
<member name="rotation" type="Quaternion" setter="set_rotation" getter="get_rotation" default="Quaternion(0, 0, 0, 1)">
+ The rotation of the GLTF node relative to its parent.
</member>
<member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)">
+ The scale of the GLTF node relative to its parent.
</member>
<member name="skeleton" type="int" setter="set_skeleton" getter="get_skeleton" default="-1">
+ If this GLTF node has a skeleton, the index of the [GLTFSkeleton] in the [GLTFState] that describes the skeleton's properties. If -1, this node does not have a skeleton.
</member>
<member name="skin" type="int" setter="set_skin" getter="get_skin" default="-1">
+ If this GLTF node has a skin, the index of the [GLTFSkin] in the [GLTFState] that describes the skin's properties. If -1, this node does not have a skin.
</member>
<member name="xform" type="Transform3D" setter="set_xform" getter="get_xform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)">
+ The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.
</member>
</members>
</class>
diff --git a/modules/gltf/doc_classes/GLTFState.xml b/modules/gltf/doc_classes/GLTFState.xml
index 33b92f37c8..7a46fb8dfc 100644
--- a/modules/gltf/doc_classes/GLTFState.xml
+++ b/modules/gltf/doc_classes/GLTFState.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GLTFState" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
+ Represents all data of a GLTF file.
</brief_description>
<description>
+ Contains all nodes and resources of a GLTF file. This is used by [GLTFDocument] as data storage, which allows [GLTFDocument] and all [GLTFDocumentExtension] classes to remain stateless.
+ GLTFState can be populated by [GLTFDocument] reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a GLTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by [GLTFDocumentExtension] classes. This allows for custom data to be stored in the GLTF file or for custom data to be converted to/from Godot nodes.
</description>
<tutorials>
</tutorials>
@@ -32,17 +35,20 @@
<return type="AnimationPlayer" />
<param index="0" name="idx" type="int" />
<description>
+ Returns the [AnimationPlayer] node with the given index. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations.
</description>
</method>
<method name="get_animation_players_count">
<return type="int" />
<param index="0" name="idx" type="int" />
<description>
+ Returns the number of [AnimationPlayer] nodes in this [GLTFState]. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations.
</description>
</method>
<method name="get_animations">
<return type="GLTFAnimation[]" />
<description>
+ Returns an array of all [GLTFAnimation]s in the GLTF file. When importing, these will be generated as animations in an [AnimationPlayer] node. When exporting, these will be generated from Godot [AnimationPlayer] nodes.
</description>
</method>
<method name="get_buffer_views">
@@ -53,6 +59,7 @@
<method name="get_cameras">
<return type="GLTFCamera[]" />
<description>
+ Returns an array of all [GLTFCamera]s in the GLTF file. These are the cameras that the [member GLTFNode.camera] index refers to.
</description>
</method>
<method name="get_handle_binary_image">
@@ -68,6 +75,7 @@
<method name="get_lights">
<return type="GLTFLight[]" />
<description>
+ Returns an array of all [GLTFLight]s in the GLTF file. These are the lights that the [member GLTFNode.light] index refers to.
</description>
</method>
<method name="get_materials">
@@ -78,27 +86,32 @@
<method name="get_meshes">
<return type="GLTFMesh[]" />
<description>
+ Returns an array of all [GLTFMesh]es in the GLTF file. These are the meshes that the [member GLTFNode.mesh] index refers to.
</description>
</method>
<method name="get_nodes">
<return type="GLTFNode[]" />
<description>
+ Returns an array of all [GLTFNode]s in the GLTF file. These are the nodes that [member GLTFNode.children] and [member root_nodes] refer to. This includes nodes that may not be generated in the Godot scene, or nodes that may generate multiple Godot scene nodes.
</description>
</method>
<method name="get_scene_node">
<return type="Node" />
<param index="0" name="idx" type="int" />
<description>
+ Returns the Godot scene node that corresponds to the same index as the [GLTFNode] it was generated from. Not every [GLTFNode] will have a scene node generated, and not every generated scene node will have a corresponding [GLTFNode].
</description>
</method>
<method name="get_skeletons">
<return type="GLTFSkeleton[]" />
<description>
+ Returns an array of all [GLTFSkeleton]s in the GLTF file. These are the skeletons that the [member GLTFNode.skeleton] index refers to.
</description>
</method>
<method name="get_skins">
<return type="GLTFSkin[]" />
<description>
+ Returns an array of all [GLTFSkin]s in the GLTF file. These are the skins that the [member GLTFNode.skin] index refers to.
</description>
</method>
<method name="get_texture_samplers">
@@ -115,11 +128,13 @@
<method name="get_unique_animation_names">
<return type="String[]" />
<description>
+ Returns an array of unique animation names. This is only used during the import process.
</description>
</method>
<method name="get_unique_names">
<return type="String[]" />
<description>
+ Returns an array of unique node names. This is used in both the import process and export process.
</description>
</method>
<method name="set_accessors">
@@ -141,6 +156,7 @@
<return type="void" />
<param index="0" name="animations" type="GLTFAnimation[]" />
<description>
+ Sets the [GLTFAnimation]s in the state. When importing, these will be generated as animations in an [AnimationPlayer] node. When exporting, these will be generated from Godot [AnimationPlayer] nodes.
</description>
</method>
<method name="set_buffer_views">
@@ -153,6 +169,7 @@
<return type="void" />
<param index="0" name="cameras" type="GLTFCamera[]" />
<description>
+ Sets the [GLTFCamera]s in the state. These are the cameras that the [member GLTFNode.camera] index refers to.
</description>
</method>
<method name="set_handle_binary_image">
@@ -171,6 +188,7 @@
<return type="void" />
<param index="0" name="lights" type="GLTFLight[]" />
<description>
+ Sets the [GLTFLight]s in the state. These are the lights that the [member GLTFNode.light] index refers to.
</description>
</method>
<method name="set_materials">
@@ -183,24 +201,28 @@
<return type="void" />
<param index="0" name="meshes" type="GLTFMesh[]" />
<description>
+ Sets the [GLTFMesh]es in the state. These are the meshes that the [member GLTFNode.mesh] index refers to.
</description>
</method>
<method name="set_nodes">
<return type="void" />
<param index="0" name="nodes" type="GLTFNode[]" />
<description>
+ Sets the [GLTFNode]s in the state. These are the nodes that [member GLTFNode.children] and [member root_nodes] refer to. Some of the nodes set here may not be generated in the Godot scene, or may generate multiple Godot scene nodes.
</description>
</method>
<method name="set_skeletons">
<return type="void" />
<param index="0" name="skeletons" type="GLTFSkeleton[]" />
<description>
+ Sets the [GLTFSkeleton]s in the state. These are the skeletons that the [member GLTFNode.skeleton] index refers to.
</description>
</method>
<method name="set_skins">
<return type="void" />
<param index="0" name="skins" type="GLTFSkin[]" />
<description>
+ Sets the [GLTFSkin]s in the state. These are the skins that the [member GLTFNode.skin] index refers to.
</description>
</method>
<method name="set_texture_samplers">
@@ -220,12 +242,14 @@
<return type="void" />
<param index="0" name="unique_animation_names" type="String[]" />
<description>
+ Sets the unique animation names in the state. This is only used during the import process.
</description>
</method>
<method name="set_unique_names">
<return type="void" />
<param index="0" name="unique_names" type="String[]" />
<description>
+ Sets the unique node names in the state. This is used in both the import process and export process.
</description>
</method>
</methods>
@@ -245,8 +269,10 @@
<member name="minor_version" type="int" setter="set_minor_version" getter="get_minor_version" default="0">
</member>
<member name="root_nodes" type="PackedInt32Array" setter="set_root_nodes" getter="get_root_nodes" default="PackedInt32Array()">
+ The root nodes of the GLTF file. Typically, a GLTF file will only have one scene, and therefore one root node. However, a GLTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene.
</member>
<member name="scene_name" type="String" setter="set_scene_name" getter="get_scene_name" default="&quot;&quot;">
+ The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the GLTF file.
</member>
<member name="use_named_skin_binds" type="bool" setter="set_use_named_skin_binds" getter="get_use_named_skin_binds" default="false">
</member>
diff --git a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
index 388c3ec740..2af716b867 100644
--- a/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
+++ b/modules/gltf/extensions/gltf_document_extension_convert_importer_mesh.cpp
@@ -70,7 +70,7 @@ Error GLTFDocumentExtensionConvertImporterMesh::import_post(Ref<GLTFState> p_sta
}
queue.pop_front();
}
- while (!queue.is_empty()) {
+ while (!delete_queue.is_empty()) {
List<Node *>::Element *E = delete_queue.front();
Node *node = E->get();
memdelete(node);
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 872e803b9c..aad8ab9a57 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -42,7 +42,6 @@
#ifdef TOOLS_ENABLED
#include "core/os/keyboard.h"
-#include "editor/bindings_generator.h"
#include "editor/editor_internal_calls.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
@@ -102,13 +101,6 @@ void CSharpLanguage::init() {
}
#endif
-#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
- // Generate the bindings here, before loading assemblies. The Godot assemblies
- // may be missing if the glue wasn't generated yet in order to build them.
- List<String> cmdline_args = OS::get_singleton()->get_cmdline_args();
- BindingsGenerator::handle_cmdline_args(cmdline_args);
-#endif
-
GLOBAL_DEF("dotnet/project/assembly_name", "");
#ifdef TOOLS_ENABLED
GLOBAL_DEF("dotnet/project/solution_directory", "");
@@ -589,7 +581,7 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info()
_recursion_flag_ = false;
};
- if (!gdmono->is_runtime_initialized()) {
+ if (!gdmono || !gdmono->is_runtime_initialized()) {
return Vector<StackInfo>();
}
@@ -679,6 +671,7 @@ void CSharpLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft
#ifdef GD_MONO_HOT_RELOAD
bool CSharpLanguage::is_assembly_reloading_needed() {
+ ERR_FAIL_NULL_V(gdmono, false);
if (!gdmono->is_runtime_initialized()) {
return false;
}
@@ -713,6 +706,7 @@ bool CSharpLanguage::is_assembly_reloading_needed() {
}
void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
+ ERR_FAIL_NULL(gdmono);
if (!gdmono->is_runtime_initialized()) {
return;
}
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index c267d32f5a..f50803af95 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -35,6 +35,7 @@ namespace GodotTools
private PopupMenu _menuPopup;
private AcceptDialog _errorDialog;
+ private ConfirmationDialog _confirmCreateSlnDialog;
private Button _bottomPanelBtn;
private Button _toolBarBuildButton;
@@ -99,7 +100,7 @@ namespace GodotTools
pr.Step("Done".TTR());
// Here, after all calls to progress_task_step
- CallDeferred(nameof(_RemoveCreateSlnMenuOption));
+ CallDeferred(nameof(_ShowDotnetFeatures));
}
else
{
@@ -110,9 +111,8 @@ namespace GodotTools
}
}
- private void _RemoveCreateSlnMenuOption()
+ private void _ShowDotnetFeatures()
{
- _menuPopup.RemoveItem(_menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
_bottomPanelBtn.Show();
_toolBarBuildButton.Show();
}
@@ -122,8 +122,17 @@ namespace GodotTools
switch ((MenuOptions)id)
{
case MenuOptions.CreateSln:
- CreateProjectSolution();
+ {
+ if (File.Exists(GodotSharpDirs.ProjectSlnPath) || File.Exists(GodotSharpDirs.ProjectCsProjPath))
+ {
+ ShowConfirmCreateSlnDialog();
+ }
+ else
+ {
+ CreateProjectSolution();
+ }
break;
+ }
case MenuOptions.SetupGodotNugetFallbackFolder:
{
try
@@ -169,6 +178,13 @@ namespace GodotTools
_errorDialog.PopupCentered();
}
+ public void ShowConfirmCreateSlnDialog()
+ {
+ _confirmCreateSlnDialog.Title = "C# solution already exists. This will override the existing C# project file, any manual changes will be lost.".TTR();
+ _confirmCreateSlnDialog.DialogText = "Create C# solution".TTR();
+ _confirmCreateSlnDialog.PopupCentered();
+ }
+
private static string _vsCodePath = string.Empty;
private static readonly string[] VsCodeNames =
@@ -420,6 +436,10 @@ namespace GodotTools
_errorDialog = new AcceptDialog();
editorBaseControl.AddChild(_errorDialog);
+ _confirmCreateSlnDialog = new ConfirmationDialog();
+ _confirmCreateSlnDialog.Confirmed += () => CreateProjectSolution();
+ editorBaseControl.AddChild(_confirmCreateSlnDialog);
+
MSBuildPanel = new MSBuildPanel();
MSBuildPanel.Ready += () =>
MSBuildPanel.BuildOutputView.BuildStateChanged += BuildStateChanged;
@@ -453,8 +473,8 @@ namespace GodotTools
{
_bottomPanelBtn.Hide();
_toolBarBuildButton.Hide();
- _menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
}
+ _menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
_menuPopup.IdPressed += _MenuOptionPressed;
diff --git a/modules/openxr/doc_classes/OpenXRAction.xml b/modules/openxr/doc_classes/OpenXRAction.xml
index d53648723a..5e96f8fc67 100644
--- a/modules/openxr/doc_classes/OpenXRAction.xml
+++ b/modules/openxr/doc_classes/OpenXRAction.xml
@@ -30,7 +30,7 @@
This action provides a float value between [code]0.0[/code] and [code]1.0[/code] for any analog input such as triggers.
</constant>
<constant name="OPENXR_ACTION_VECTOR2" value="2" enum="ActionType">
- This action provides a vector2 value and can be bound to embedded trackpads and joysticks
+ This action provides a [Vector2] value and can be bound to embedded trackpads and joysticks.
</constant>
<constant name="OPENXR_ACTION_POSE" value="3" enum="ActionType">
</constant>
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index 22652daa24..50aea3da2e 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -334,6 +334,8 @@ _FORCE_INLINE_ bool is_connected_to_prev(char32_t p_chr, char32_t p_pchr) {
/*************************************************************************/
+bool TextServerAdvanced::icu_data_loaded = false;
+
bool TextServerAdvanced::_has_feature(Feature p_feature) const {
switch (p_feature) {
case FEATURE_SIMPLE_LAYOUT:
@@ -1384,7 +1386,9 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_f
FT_Select_Size(fd->face, best_match);
} else {
FT_Set_Pixel_Sizes(fd->face, 0, double(fd->size.x * fd->oversampling));
- fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
+ if (fd->face->size->metrics.y_ppem != 0) {
+ fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
+ }
}
fd->hb_handle = hb_ft_font_create(fd->face, nullptr);
@@ -6599,5 +6603,6 @@ TextServerAdvanced::~TextServerAdvanced() {
uset_close(allowed);
allowed = nullptr;
}
- u_cleanup();
+
+ std::atexit(u_cleanup);
}
diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h
index 02244a294e..f092fa8cca 100644
--- a/modules/text_server_adv/text_server_adv.h
+++ b/modules/text_server_adv/text_server_adv.h
@@ -158,7 +158,7 @@ class TextServerAdvanced : public TextServerExtension {
// ICU support data.
- bool icu_data_loaded = false;
+ static bool icu_data_loaded;
mutable USet *allowed = nullptr;
mutable USpoofChecker *sc_spoof = nullptr;
mutable USpoofChecker *sc_conf = nullptr;
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp
index 240ae8310a..d67ae6b45b 100644
--- a/modules/text_server_fb/text_server_fb.cpp
+++ b/modules/text_server_fb/text_server_fb.cpp
@@ -825,7 +825,9 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontFallback *p_f
FT_Select_Size(fd->face, best_match);
} else {
FT_Set_Pixel_Sizes(fd->face, 0, Math::round(fd->size.x * fd->oversampling));
- fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
+ if (fd->face->size->metrics.y_ppem != 0) {
+ fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
+ }
}
fd->ascent = (fd->face->size->metrics.ascender / 64.0) / fd->oversampling * fd->scale;