/**************************************************************************/ /* scene_debugger_object.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #ifdef DEBUG_ENABLED #include "scene_debugger_object.h" #include "core/io/marshalls.h" #include "core/object/script_language.h" SceneDebuggerObject::SceneDebuggerObject(Object *p_obj) { if (!p_obj) { return; } id = p_obj->get_instance_id(); class_name = p_obj->get_class(); if (ScriptInstance *si = p_obj->get_script_instance()) { // Read script instance constants and variables. if (!si->get_script().is_null()) { Script *s = si->get_script().ptr(); _parse_script_properties(s, si); } } if (Node *node = Object::cast_to(p_obj)) { // For debugging multiplayer. { PropertyInfo pi(Variant::INT, String("Node/multiplayer_authority"), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_READ_ONLY); properties.push_back(SceneDebuggerProperty(pi, node->get_multiplayer_authority())); } // Add specialized NodePath info (if inside tree). if (node->is_inside_tree()) { PropertyInfo pi(Variant::NODE_PATH, String("Node/path")); properties.push_back(SceneDebuggerProperty(pi, node->get_path())); } else { // Can't ask for path if a node is not in tree. PropertyInfo pi(Variant::STRING, String("Node/path")); properties.push_back(SceneDebuggerProperty(pi, "[Orphan]")); } } else if (Script *s = Object::cast_to