diff options
-rw-r--r-- | doc/classes/Mesh.xml | 14 | ||||
-rw-r--r-- | doc/classes/MeshInstance3D.xml | 13 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 12 |
3 files changed, 35 insertions, 4 deletions
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 3063e76c65..b9e6854bbf 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -16,22 +16,26 @@ <method name="_get_aabb" qualifiers="virtual const"> <return type="AABB" /> <description> + Virtual method to override the [AABB] for a custom class extending [Mesh]. </description> </method> <method name="_get_blend_shape_count" qualifiers="virtual const"> <return type="int" /> <description> + Virtual method to override the number of blend shapes for a custom class extending [Mesh]. </description> </method> <method name="_get_blend_shape_name" qualifiers="virtual const"> <return type="StringName" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the retrieval of blend shape names for a custom class extending [Mesh]. </description> </method> <method name="_get_surface_count" qualifiers="virtual const"> <return type="int" /> <description> + Virtual method to override the surface count for a custom class extending [Mesh]. </description> </method> <method name="_set_blend_shape_name" qualifiers="virtual"> @@ -39,54 +43,63 @@ <param index="0" name="index" type="int" /> <param index="1" name="name" type="StringName" /> <description> + Virtual method to override the names of blend shapes for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_array_index_len" qualifiers="virtual const"> <return type="int" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface array index length for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_array_len" qualifiers="virtual const"> <return type="int" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface array length for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_arrays" qualifiers="virtual const"> <return type="Array" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface arrays for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_blend_shape_arrays" qualifiers="virtual const"> <return type="Array[]" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the blend shape arrays for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_format" qualifiers="virtual const"> <return type="int" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface format for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_lods" qualifiers="virtual const"> <return type="Dictionary" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface LODs for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_material" qualifiers="virtual const"> <return type="Material" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface material for a custom class extending [Mesh]. </description> </method> <method name="_surface_get_primitive_type" qualifiers="virtual const"> <return type="int" /> <param index="0" name="index" type="int" /> <description> + Virtual method to override the surface primitive type for a custom class extending [Mesh]. </description> </method> <method name="_surface_set_material" qualifiers="virtual"> @@ -94,6 +107,7 @@ <param index="0" name="index" type="int" /> <param index="1" name="material" type="Material" /> <description> + Virtual method to override the setting of a [param material] at the given [param index] for a custom class extending [Mesh]. </description> </method> <method name="create_convex_shape" qualifiers="const"> diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml index 618503c8df..2ee3b4cb0c 100644 --- a/doc/classes/MeshInstance3D.xml +++ b/doc/classes/MeshInstance3D.xml @@ -45,31 +45,35 @@ <return type="int" /> <param index="0" name="name" type="StringName" /> <description> + Returns the index of the blend shape with the given [param name]. Returns [code]-1[/code] if no blend shape with this name exists, including when [member mesh] is [code]null[/code]. </description> </method> <method name="get_active_material" qualifiers="const"> <return type="Material" /> <param index="0" name="surface" type="int" /> <description> - Returns the [Material] that will be used by the [Mesh] when drawing. This can return the [member GeometryInstance3D.material_override], the surface override [Material] defined in this [MeshInstance3D], or the surface [Material] defined in the [Mesh]. For example, if [member GeometryInstance3D.material_override] is used, all surfaces will return the override material. + Returns the [Material] that will be used by the [Mesh] when drawing. This can return the [member GeometryInstance3D.material_override], the surface override [Material] defined in this [MeshInstance3D], or the surface [Material] defined in the [member mesh]. For example, if [member GeometryInstance3D.material_override] is used, all surfaces will return the override material. + Returns [code]null[/code] if no material is active, including when [member mesh] is [code]null[/code]. </description> </method> <method name="get_blend_shape_count" qualifiers="const"> <return type="int" /> <description> + Returns the number of blend shapes available. Produces an error if [member mesh] is [code]null[/code]. </description> </method> <method name="get_blend_shape_value" qualifiers="const"> <return type="float" /> <param index="0" name="blend_shape_idx" type="int" /> <description> + Returns the value of the blend shape at the given [param blend_shape_idx]. Returns [code]0.0[/code] and produces an error if [member mesh] is [code]null[/code] or doesn't have a blend shape at that index. </description> </method> <method name="get_surface_override_material" qualifiers="const"> <return type="Material" /> <param index="0" name="surface" type="int" /> <description> - Returns the override [Material] for the specified surface of the [Mesh] resource. + Returns the override [Material] for the specified [param surface] of the [Mesh] resource. </description> </method> <method name="get_surface_override_material_count" qualifiers="const"> @@ -83,6 +87,7 @@ <param index="0" name="blend_shape_idx" type="int" /> <param index="1" name="value" type="float" /> <description> + Sets the value of the blend shape at [param blend_shape_idx] to [param value]. Produces an error if [member mesh] is [code]null[/code] or doesn't have a blend shape at that index. </description> </method> <method name="set_surface_override_material"> @@ -90,7 +95,7 @@ <param index="0" name="surface" type="int" /> <param index="1" name="material" type="Material" /> <description> - Sets the override [Material] for the specified surface of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with the [Mesh] resource. + Sets the override [param material] for the specified [param surface] of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with [member mesh]. </description> </method> </methods> @@ -102,7 +107,7 @@ [NodePath] to the [Skeleton3D] associated with the instance. </member> <member name="skin" type="Skin" setter="set_skin" getter="get_skin"> - Sets the skin to be used by this instance. + The [Skin] to be used by this instance. </member> </members> </class> diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 0ee86c8ed0..3a147abade 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -561,6 +561,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R bool isroot = p_node == p_root; if (!isroot && _teststr(name, "noimp")) { + p_node->set_owner(nullptr); memdelete(p_node); return nullptr; } @@ -690,6 +691,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R col->set_transform(mi->get_transform()); col->set_name(fixed_name); p_node->replace_by(col); + p_node->set_owner(nullptr); memdelete(p_node); p_node = col; @@ -703,6 +705,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R sb->set_name(fixed_name); Object::cast_to<Node3D>(sb)->set_transform(Object::cast_to<Node3D>(p_node)->get_transform()); p_node->replace_by(sb); + p_node->set_owner(nullptr); memdelete(p_node); p_node = sb; CollisionShape3D *colshape = memnew(CollisionShape3D); @@ -810,6 +813,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R nmi->set_navigation_mesh(nmesh); Object::cast_to<Node3D>(nmi)->set_transform(mi->get_transform()); p_node->replace_by(nmi); + p_node->set_owner(nullptr); memdelete(p_node); p_node = nmi; } else if (_teststr(name, "occ") || _teststr(name, "occonly")) { @@ -832,6 +836,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, HashMap<R } } } else { + p_node->set_owner(nullptr); memdelete(p_node); p_node = nullptr; } @@ -1103,6 +1108,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< } if (!isroot && (node_settings.has("import/skip_import") && bool(node_settings["import/skip_import"]))) { + p_node->set_owner(nullptr); memdelete(p_node); return nullptr; } @@ -1263,6 +1269,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< col->set_position(p_applied_root_scale * col->get_position()); col->set_name(p_node->get_name()); p_node->replace_by(col); + p_node->set_owner(nullptr); memdelete(p_node); p_node = col; base = col; @@ -1273,6 +1280,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< area->set_position(p_applied_root_scale * area->get_position()); area->set_name(p_node->get_name()); p_node->replace_by(area); + p_node->set_owner(nullptr); memdelete(p_node); p_node = area; base = area; @@ -1312,6 +1320,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< if (navmesh_mode == NAVMESH_NAVMESH_ONLY) { nmi->set_transform(mi->get_transform()); p_node->replace_by(nmi); + p_node->set_owner(nullptr); memdelete(p_node); p_node = nmi; } else { @@ -1341,6 +1350,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< OccluderInstance3D::bake_single_node(mi, simplification_dist, r_occluder_arrays.first, r_occluder_arrays.second); if (occluder_mode == OCCLUDER_OCCLUDER_ONLY) { + p_node->set_owner(nullptr); memdelete(p_node); p_node = nullptr; } @@ -2092,6 +2102,7 @@ void ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_m } p_node->replace_by(mesh_node); + p_node->set_owner(nullptr); memdelete(p_node); p_node = mesh_node; } @@ -2427,6 +2438,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p if (base_node) { scene->replace_by(base_node); + scene->set_owner(nullptr); memdelete(scene); scene = base_node; } |