diff options
| -rw-r--r-- | core/object/object.h | 8 | ||||
| -rw-r--r-- | core/object/script_language.cpp | 3 | ||||
| -rw-r--r-- | doc/classes/@GlobalScope.xml | 33 | ||||
| -rw-r--r-- | editor/editor_node.cpp | 9 | ||||
| -rw-r--r-- | editor/editor_properties.cpp | 3 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 10 | ||||
| -rw-r--r-- | scene/2d/skeleton_2d.cpp | 2 | ||||
| -rw-r--r-- | scene/3d/mesh_instance_3d.cpp | 2 | ||||
| -rw-r--r-- | scene/3d/visual_instance_3d.cpp | 4 | ||||
| -rw-r--r-- | scene/resources/particle_process_material.cpp | 6 | ||||
| -rw-r--r-- | scene/resources/skeleton_modification_stack_2d.cpp | 2 | ||||
| -rw-r--r-- | scene/resources/visual_shader.cpp | 2 |
12 files changed, 52 insertions, 32 deletions
diff --git a/core/object/object.h b/core/object/object.h index f3c387594b..7b53fcaa41 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -72,12 +72,12 @@ enum PropertyHint { PROPERTY_HINT_COLOR_NO_ALPHA, ///< used for ignoring alpha component when editing a color PROPERTY_HINT_OBJECT_ID, PROPERTY_HINT_TYPE_STRING, ///< a type string, the hint is the base type to choose - PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE, ///< so something else can provide this (used in scripts) + PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE, // Deprecated. PROPERTY_HINT_OBJECT_TOO_BIG, ///< object is too big to send PROPERTY_HINT_NODE_PATH_VALID_TYPES, PROPERTY_HINT_SAVE_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,". This opens a save dialog PROPERTY_HINT_GLOBAL_SAVE_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,". This opens a save dialog - PROPERTY_HINT_INT_IS_OBJECTID, + PROPERTY_HINT_INT_IS_OBJECTID, // Deprecated. PROPERTY_HINT_INT_IS_POINTER, PROPERTY_HINT_ARRAY_TYPE, PROPERTY_HINT_LOCALE_ID, @@ -105,7 +105,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_SCRIPT_VARIABLE = 1 << 12, PROPERTY_USAGE_STORE_IF_NULL = 1 << 13, PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 1 << 14, - PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 15, + PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 15, // Deprecated. PROPERTY_USAGE_CLASS_IS_ENUM = 1 << 16, PROPERTY_USAGE_NIL_IS_VARIANT = 1 << 17, PROPERTY_USAGE_ARRAY = 1 << 18, // Used in the inspector to group properties as elements of an array. @@ -115,7 +115,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 22, PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 1 << 23, PROPERTY_USAGE_KEYING_INCREMENTS = 1 << 24, // Used in inspector to increment property when keyed in animation player. - PROPERTY_USAGE_DEFERRED_SET_RESOURCE = 1 << 25, // when loading, the resource for this property can be set at the end of loading. + PROPERTY_USAGE_DEFERRED_SET_RESOURCE = 1 << 25, // Deprecated. PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT = 1 << 26, // For Object properties, instantiate them when creating in editor. PROPERTY_USAGE_EDITOR_BASIC_SETTING = 1 << 27, //for project or editor settings, show when basic settings are selected. PROPERTY_USAGE_READ_ONLY = 1 << 28, // Mark a property as read-only in the inspector. diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 2bdbfb5ad1..5f53975bf6 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -558,9 +558,6 @@ void PlaceHolderScriptInstance::get_property_list(List<PropertyInfo> *p_properti } else { for (const PropertyInfo &E : properties) { PropertyInfo pinfo = E; - if (!values.has(pinfo.name)) { - pinfo.usage |= PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE; - } p_properties->push_back(E); } } diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 1ae3674f65..193284896a 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2823,6 +2823,7 @@ Hints that a [Color] property should be edited without affecting its transparency ([member Color.a] is not editable). </constant> <constant name="PROPERTY_HINT_OBJECT_ID" value="22" enum="PropertyHint"> + Hints that the property's value is an object encoded as object ID, with its type specified in the hint string. Used by the debugger. </constant> <constant name="PROPERTY_HINT_TYPE_STRING" value="23" enum="PropertyHint"> If a property is [String], hints that the property represents a particular type (class). This allows to select a type from the create dialog. The property will store the selected type as a string. @@ -2881,21 +2882,30 @@ [/codeblocks] [b]Note:[/b] The trailing colon is required for properly detecting built-in types. </constant> - <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint" is_deprecated="true"> + [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future. </constant> <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="25" enum="PropertyHint"> + Hints that an object is too big to be sent via the debugger. </constant> <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="26" enum="PropertyHint"> + Hints that the hint string specifies valid node types for property of type [NodePath]. </constant> <constant name="PROPERTY_HINT_SAVE_FILE" value="27" enum="PropertyHint"> + Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the project's directory. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters]. </constant> <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="28" enum="PropertyHint"> + Hints that a [String] property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. See also [member FileDialog.filters]. </constant> - <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint" is_deprecated="true"> + Hints that an [int] property is an object ID. + [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future. </constant> <constant name="PROPERTY_HINT_INT_IS_POINTER" value="30" enum="PropertyHint"> + Hints that an [int] property is a pointer. Used by GDExtension. </constant> <constant name="PROPERTY_HINT_ARRAY_TYPE" value="31" enum="PropertyHint"> + Hints that a property is an [Array] with the stored type specified in the hint string. </constant> <constant name="PROPERTY_HINT_LOCALE_ID" value="32" enum="PropertyHint"> Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. @@ -2904,6 +2914,7 @@ Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. </constant> <constant name="PROPERTY_HINT_NODE_TYPE" value="34" enum="PropertyHint"> + Hints that a property is an instance of a [Node]-derived type, optionally specified via the hint string (e.g. [code]"Node2D"[/code]). Editing it will show a dialog for picking a node from the scene. </constant> <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="35" enum="PropertyHint"> Hints that a quaternion property should disable the temporary euler editor. @@ -2942,6 +2953,7 @@ Used to group properties together in the editor in a subgroup (under a group). See [EditorInspector]. </constant> <constant name="PROPERTY_USAGE_CLASS_IS_BITFIELD" value="512" enum="PropertyUsageFlags" is_bitfield="true"> + The property is a bitfield, i.e. it contains multiple flags represented as bits. </constant> <constant name="PROPERTY_USAGE_NO_INSTANCE_STATE" value="1024" enum="PropertyUsageFlags" is_bitfield="true"> The property does not save its state in [PackedScene]. @@ -2953,14 +2965,20 @@ The property is a script variable which should be serialized and saved in the scene file. </constant> <constant name="PROPERTY_USAGE_STORE_IF_NULL" value="8192" enum="PropertyUsageFlags" is_bitfield="true"> + The property value of type [Object] will be stored even if its value is [code]null[/code]. </constant> <constant name="PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" value="16384" enum="PropertyUsageFlags" is_bitfield="true"> + If this property is modified, all inspector fields will be refreshed. </constant> - <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" value="32768" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true"> + Signifies a default value from a placeholder script instance. + [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future. </constant> <constant name="PROPERTY_USAGE_CLASS_IS_ENUM" value="65536" enum="PropertyUsageFlags" is_bitfield="true"> + The property is an enum, i.e. it only takes named integer constants from its associated enumeration. </constant> <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="131072" enum="PropertyUsageFlags" is_bitfield="true"> + If property has [code]nil[/code] as default value, its type will be [Variant]. </constant> <constant name="PROPERTY_USAGE_ARRAY" value="262144" enum="PropertyUsageFlags" is_bitfield="true"> The property is an array. @@ -2975,16 +2993,23 @@ The property is only shown in the editor if modern renderers are supported (the Compatibility rendering method is excluded). </constant> <constant name="PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" value="4194304" enum="PropertyUsageFlags" is_bitfield="true"> + The [NodePath] property will always be relative to the scene's root. Mostly useful for local resources. </constant> <constant name="PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" value="8388608" enum="PropertyUsageFlags" is_bitfield="true"> + Use when a resource is created on the fly, i.e. the getter will always return a different instance. [ResourceSaver] needs this information to properly save such resources. </constant> <constant name="PROPERTY_USAGE_KEYING_INCREMENTS" value="16777216" enum="PropertyUsageFlags" is_bitfield="true"> + Inserting an animation key frame of this property will automatically increment the value, allowing to easily keyframe multiple values in a row. </constant> - <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_DEFERRED_SET_RESOURCE" value="33554432" enum="PropertyUsageFlags" is_bitfield="true" is_deprecated="true"> + When loading, the resource for this property can be set at the end of loading. + [i]Deprecated.[/i] This hint is not used anywhere and will be removed in the future. </constant> <constant name="PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" value="67108864" enum="PropertyUsageFlags" is_bitfield="true"> + When this property is a [Resource] and base object is a [Node], a resource instance will be automatically created whenever the node is created in the editor. </constant> <constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags" is_bitfield="true"> + The property is considered a basic setting and will appear even when advanced mode is disabled. Used for project settings. </constant> <constant name="PROPERTY_USAGE_READ_ONLY" value="268435456" enum="PropertyUsageFlags" is_bitfield="true"> The property is read-only in the [EditorInspector]. diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index ad324c3ae6..207f524194 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1278,6 +1278,15 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St } void EditorNode::save_resource(const Ref<Resource> &p_resource) { + // If built-in resource, save the scene instead. + if (p_resource->is_built_in()) { + const String scene_path = p_resource->get_path().get_slice("::", 0); + if (!scene_path.is_empty()) { + save_scene_if_open(scene_path); + return; + } + } + // If the resource has been imported, ask the user to use a different path in order to save it. String path = p_resource->get_path(); if (path.is_resource_file() && !FileAccess::exists(path + ".import")) { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index b37710724e..2d35d4e9ac 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3866,9 +3866,6 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ } break; case Variant::NODE_PATH: { EditorPropertyNodePath *editor = memnew(EditorPropertyNodePath); - if (p_hint == PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && !p_hint_text.is_empty()) { - editor->setup(p_hint_text, Vector<StringName>(), (p_usage & PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT)); - } if (p_hint == PROPERTY_HINT_NODE_PATH_VALID_TYPES && !p_hint_text.is_empty()) { Vector<String> types = p_hint_text.split(",", false); Vector<StringName> sn = Variant(types); //convert via variant diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 5ba0f46734..6c4636dba3 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2520,15 +2520,7 @@ void ScriptEditor::save_current_script() { clear_docs_from_script(scr); } - if (resource->is_built_in()) { - // If built-in script, save the scene instead. - const String scene_path = resource->get_path().get_slice("::", 0); - if (!scene_path.is_empty()) { - EditorNode::get_singleton()->save_scene_if_open(scene_path); - } - } else { - EditorNode::get_singleton()->save_resource(resource); - } + EditorNode::get_singleton()->save_resource(resource); if (scr.is_valid()) { update_docs_from_script(scr); diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp index 9e811fb568..527bbaf956 100644 --- a/scene/2d/skeleton_2d.cpp +++ b/scene/2d/skeleton_2d.cpp @@ -546,7 +546,7 @@ void Skeleton2D::_get_property_list(List<PropertyInfo> *p_list) const { PropertyInfo(Variant::OBJECT, PNAME("modification_stack"), PROPERTY_HINT_RESOURCE_TYPE, "SkeletonModificationStack2D", - PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE | PROPERTY_USAGE_ALWAYS_DUPLICATE)); + PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_ALWAYS_DUPLICATE)); } void Skeleton2D::_make_bone_setup_dirty() { diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 78b02d74d5..d83d55d121 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -99,7 +99,7 @@ void MeshInstance3D::_get_property_list(List<PropertyInfo> *p_list) const { if (mesh.is_valid()) { for (int i = 0; i < mesh->get_surface_count(); i++) { - p_list->push_back(PropertyInfo(Variant::OBJECT, vformat("%s/%d", PNAME("surface_material_override"), i), PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE)); + p_list->push_back(PropertyInfo(Variant::OBJECT, vformat("%s/%d", PNAME("surface_material_override"), i), PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT)); } } } diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp index 8026b12c2b..3b1faca17e 100644 --- a/scene/3d/visual_instance_3d.cpp +++ b/scene/3d/visual_instance_3d.cpp @@ -501,8 +501,8 @@ void GeometryInstance3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_aabb"), &GeometryInstance3D::get_aabb); ADD_GROUP("Geometry", ""); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE), "set_material_override", "get_material_override"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_overlay", PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE), "set_material_overlay", "get_material_overlay"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT), "set_material_override", "get_material_override"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_overlay", PROPERTY_HINT_RESOURCE_TYPE, "BaseMaterial3D,ShaderMaterial", PROPERTY_USAGE_DEFAULT), "set_material_overlay", "get_material_overlay"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "transparency", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_transparency", "get_transparency"); ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), "set_cast_shadows_setting", "get_cast_shadows_setting"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0.01,suffix:m"), "set_extra_cull_margin", "get_extra_cull_margin"); diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 6f8df70548..2a70deee6c 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -86,9 +86,9 @@ void ParticleProcessMaterial::init_shaders() { shader_names->tangent_accel_texture = "tangent_accel_texture"; shader_names->damping_texture = "damping_texture"; shader_names->scale_texture = "scale_curve"; - shader_names->hue_variation_texture = "hue_variation_texture"; - shader_names->anim_speed_texture = "anim_speed_texture"; - shader_names->anim_offset_texture = "anim_offset_texture"; + shader_names->hue_variation_texture = "hue_rot_curve"; + shader_names->anim_speed_texture = "animation_speed_curve"; + shader_names->anim_offset_texture = "animation_offset_curve"; shader_names->directional_velocity_texture = "directional_velocity_curve"; shader_names->scale_over_velocity_texture = "scale_over_velocity_curve"; diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/skeleton_modification_stack_2d.cpp index 5703185374..dcc69d4831 100644 --- a/scene/resources/skeleton_modification_stack_2d.cpp +++ b/scene/resources/skeleton_modification_stack_2d.cpp @@ -37,7 +37,7 @@ void SkeletonModificationStack2D::_get_property_list(List<PropertyInfo> *p_list) PropertyInfo(Variant::OBJECT, "modifications/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "SkeletonModification2D", - PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE | PROPERTY_USAGE_ALWAYS_DUPLICATE)); + PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_ALWAYS_DUPLICATE)); } } diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 69925fc19f..423ef3867f 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -963,13 +963,13 @@ void VisualShader::remove_node(Type p_type, int p_id) { for (List<Connection>::Element *E = g->connections.front(); E;) { List<Connection>::Element *N = E->next(); if (E->get().from_node == p_id || E->get().to_node == p_id) { - g->connections.erase(E); if (E->get().from_node == p_id) { g->nodes[E->get().to_node].prev_connected_nodes.erase(p_id); g->nodes[E->get().to_node].node->set_input_port_connected(E->get().to_port, false); } else if (E->get().to_node == p_id) { g->nodes[E->get().from_node].next_connected_nodes.erase(p_id); } + g->connections.erase(E); } E = N; } |
