1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Merge pull request #67055 from GuilhermeGSousa/custom-node-export

Added custom node export
This commit is contained in:
Rémi Verschelde
2022-10-31 11:11:07 +01:00
5 changed files with 39 additions and 8 deletions

View File

@@ -4392,6 +4392,27 @@ Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p
return nullptr;
}
bool EditorNode::is_object_of_custom_type(const Object *p_object, const StringName &p_class) {
ERR_FAIL_COND_V(!p_object, false);
Ref<Script> scr = p_object->get_script();
if (scr.is_null() && Object::cast_to<Script>(p_object)) {
scr = p_object;
}
if (scr.is_valid()) {
Ref<Script> base_script = scr;
while (base_script.is_valid()) {
StringName name = EditorNode::get_editor_data().script_class_get_name(base_script->get_path());
if (name == p_class) {
return true;
}
base_script = base_script->get_base_script();
}
}
return false;
}
void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
if (singleton->cmdline_export_mode) {
print_line(p_task + ": begin: " + p_label + " steps: " + itos(p_steps));