diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/create_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/editor_audio_buses.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_3d_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/multimesh_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/property_editor.cpp | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 7e59fc31c4..f9858aa514 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -130,8 +130,8 @@ bool CreateDialog::_should_hide_type(const String &p_type) const { } if (ClassDB::class_exists(p_type)) { - if (!ClassDB::can_instantiate(p_type)) { - return true; // Can't create abstract class. + if (!ClassDB::can_instantiate(p_type) || ClassDB::is_virtual(p_type)) { + return true; // Can't create abstract or virtual class. } if (!ClassDB::is_parent_class(p_type, base_type)) { diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b64b48b4ee..e1198026b6 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -919,7 +919,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { ClassDB::get_inheriters_from_class("AudioEffect", &effects); effects.sort_custom<StringName::AlphCompare>(); for (const StringName &E : effects) { - if (!ClassDB::can_instantiate(E)) { + if (!ClassDB::can_instantiate(E) || ClassDB::is_virtual(E)) { continue; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 7a9511e8c6..2c39dc69b9 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3858,18 +3858,18 @@ void EditorNode::register_editor_types() { GDREGISTER_CLASS(EditorScript); GDREGISTER_CLASS(EditorSelection); GDREGISTER_CLASS(EditorFileDialog); - GDREGISTER_VIRTUAL_CLASS(EditorSettings); + GDREGISTER_ABSTRACT_CLASS(EditorSettings); GDREGISTER_CLASS(EditorNode3DGizmo); GDREGISTER_CLASS(EditorNode3DGizmoPlugin); - GDREGISTER_VIRTUAL_CLASS(EditorResourcePreview); + GDREGISTER_ABSTRACT_CLASS(EditorResourcePreview); GDREGISTER_CLASS(EditorResourcePreviewGenerator); - GDREGISTER_VIRTUAL_CLASS(EditorFileSystem); + GDREGISTER_ABSTRACT_CLASS(EditorFileSystem); GDREGISTER_CLASS(EditorFileSystemDirectory); GDREGISTER_CLASS(EditorVCSInterface); - GDREGISTER_VIRTUAL_CLASS(ScriptEditor); - GDREGISTER_VIRTUAL_CLASS(ScriptEditorBase); + GDREGISTER_ABSTRACT_CLASS(ScriptEditor); + GDREGISTER_ABSTRACT_CLASS(ScriptEditorBase); GDREGISTER_CLASS(EditorSyntaxHighlighter); - GDREGISTER_VIRTUAL_CLASS(EditorInterface); + GDREGISTER_ABSTRACT_CLASS(EditorInterface); GDREGISTER_CLASS(EditorExportPlugin); GDREGISTER_CLASS(EditorResourceConversionPlugin); GDREGISTER_CLASS(EditorSceneFormatImporter); @@ -3884,7 +3884,7 @@ void EditorNode::register_editor_types() { GDREGISTER_CLASS(EditorResourcePicker); GDREGISTER_CLASS(EditorScriptPicker); - GDREGISTER_VIRTUAL_CLASS(FileSystemDock); + GDREGISTER_ABSTRACT_CLASS(FileSystemDock); // FIXME: Is this stuff obsolete, or should it be ported to new APIs? GDREGISTER_CLASS(EditorScenePostImport); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index 293d1c3913..35cbff53f4 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -166,20 +166,20 @@ void GPUParticles3DEditorBase::_node_selected(const NodePath &p_path) { return; } - VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sel); - if (!vi) { + MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(sel); + if (!mi || mi->get_mesh().is_null()) { EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain geometry."), sel->get_name())); return; } - geometry = vi->get_faces(VisualInstance3D::FACES_SOLID); + geometry = mi->get_mesh()->get_faces(); if (geometry.size() == 0) { EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain face geometry."), sel->get_name())); return; } - Transform3D geom_xform = base_node->get_global_transform().affine_inverse() * vi->get_global_transform(); + Transform3D geom_xform = base_node->get_global_transform().affine_inverse() * mi->get_global_transform(); int gc = geometry.size(); Face3 *w = geometry.ptrw(); diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index 72f3b6a06e..850c673c12 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -105,9 +105,9 @@ void MultiMeshEditor::_populate() { return; } - GeometryInstance3D *ss_instance = Object::cast_to<MeshInstance3D>(ss_node); + MeshInstance3D *ss_instance = Object::cast_to<MeshInstance3D>(ss_node); - if (!ss_instance) { + if (!ss_instance || !ss_instance->get_mesh().is_valid()) { err_dialog->set_text(TTR("Surface source is invalid (no geometry).")); err_dialog->popup_centered(); return; @@ -115,7 +115,7 @@ void MultiMeshEditor::_populate() { Transform3D geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform(); - Vector<Face3> geometry = ss_instance->get_faces(VisualInstance3D::FACES_SOLID); + Vector<Face3> geometry = ss_instance->get_mesh()->get_faces(); if (geometry.size() == 0) { err_dialog->set_text(TTR("Surface source is invalid (no faces).")); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 0282504c70..dd4b963fc0 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -907,7 +907,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } } - if (!is_custom_resource && !ClassDB::can_instantiate(t)) { + if (!is_custom_resource && (!ClassDB::can_instantiate(t) || ClassDB::is_virtual(t))) { continue; } |