summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-10-21 19:31:23 +0200
committerRémi Verschelde <rverschelde@gmail.com>2017-10-21 20:41:07 +0200
commit6361e24f29ae735b75bcd27f9fe521397ce7c10c (patch)
tree74eefddaf3213579181f2945b59427f15b33e3ae /editor
parent393daf05025bd8076ec01eb754d1145dbb12edc5 (diff)
Cleanup unnecessary debug prints
Diffstat (limited to 'editor')
-rw-r--r--editor/SCsub9
-rw-r--r--editor/collada/collada.cpp30
-rw-r--r--editor/editor_export.cpp5
-rw-r--r--editor/editor_file_system.cpp56
-rw-r--r--editor/editor_node.cpp12
-rw-r--r--editor/editor_resource_preview.cpp9
-rw-r--r--editor/editor_themes.cpp1
-rw-r--r--editor/import/editor_import_collada.cpp19
8 files changed, 7 insertions, 134 deletions
diff --git a/editor/SCsub b/editor/SCsub
index 772feca5f8..2b6494608b 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -415,12 +415,11 @@ if env['tools']:
f.close()
# API documentation
- docs=[]
- print("cdir is: "+env.Dir('#').abspath)
- for f in os.listdir(os.path.join(env.Dir('#').abspath,"doc/classes")):
- docs.append("#doc/classes/"+f)
+ docs = []
+ for f in os.listdir(os.path.join(env.Dir('#').abspath, "doc/classes")):
+ docs.append("#doc/classes/" + f)
- _make_doc_data_class_path(os.path.join(env.Dir('#').abspath,"editor/doc"))
+ _make_doc_data_class_path(os.path.join(env.Dir('#').abspath, "editor/doc"))
env.Depends("#editor/doc_data_compressed.gen.h", docs)
env.Command("#editor/doc_data_compressed.gen.h", docs, make_doc_header)
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index 2d49840683..6dbfd84c86 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -422,11 +422,6 @@ Vector<String> Collada::_read_string_array(XMLParser &parser) {
// parse String data
String str = parser.get_node_data();
array = str.split_spaces();
- /*
- for(int i=0;i<array.size();i++) {
- print_line(itos(i)+": "+array[i]);
- }
- */
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END)
break; // end parsing text
}
@@ -1320,11 +1315,8 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) {
state.morph_controller_data_map[p_id] = MorphControllerData();
MorphControllerData &morphdata = state.morph_controller_data_map[p_id];
- print_line("morph source: " + parser.get_attribute_value("source") + " id: " + p_id);
morphdata.mesh = _uri_to_id(parser.get_attribute_value("source"));
- print_line("morph source2: " + morphdata.mesh);
morphdata.mode = parser.get_attribute_value("method");
- printf("JJmorph: %p\n", &morphdata);
String current_source;
while (parser.read() == OK) {
@@ -1690,7 +1682,6 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) {
} else if (section != "node") {
//usually what defines the type of node
- //print_line(" don't know what to do with "+section);
if (section.begins_with("instance_")) {
if (!node) {
@@ -1863,9 +1854,6 @@ void Collada::_parse_animation(XMLParser &parser) {
String source = _uri_to_id(channel_sources[i]);
String target = channel_targets[i];
- if (!samplers.has(source)) {
- print_line("channel lacks source: " + source);
- }
ERR_CONTINUE(!samplers.has(source));
Map<String, String> &sampler = samplers[source];
@@ -1970,8 +1958,6 @@ void Collada::_parse_animation(XMLParser &parser) {
track.target = target;
}
- print_line("TARGET: " + track.target);
-
state.animation_tracks.push_back(track);
if (!state.referenced_tracks.has(target))
@@ -2027,8 +2013,8 @@ void Collada::_parse_animation_clip(XMLParser &parser) {
}
state.animation_clips.push_back(clip);
- print_line("found anim clip: " + clip.name);
}
+
void Collada::_parse_scene(XMLParser &parser) {
if (parser.is_empty()) {
@@ -2044,7 +2030,6 @@ void Collada::_parse_scene(XMLParser &parser) {
if (name == "instance_visual_scene") {
state.root_visual_scene = _uri_to_id(parser.get_attribute_value("url"));
- print_line("***ROOT VISUAL SCENE: " + state.root_visual_scene);
} else if (name == "instance_physics_scene") {
state.root_physics_scene = _uri_to_id(parser.get_attribute_value("url"));
@@ -2213,9 +2198,6 @@ void Collada::_merge_skeletons(VisualScene *p_vscene, Node *p_node) {
NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]);
ERR_CONTINUE(!nj); //broken collada
- if (!nj->owner) {
- print_line("no owner for: " + String(nodeid));
- }
ERR_CONTINUE(!nj->owner); //weird, node should have a skeleton owner
skeletons.insert(nj->owner);
@@ -2268,10 +2250,6 @@ void Collada::_merge_skeletons2(VisualScene *p_vscene) {
name = state.sid_to_node_map[F->key()];
- if (!state.scene_map.has(name)) {
- print_line("no foundie node for: " + name);
- }
-
ERR_CONTINUE(!state.scene_map.has(name));
Node *node = state.scene_map[name];
@@ -2299,9 +2277,6 @@ void Collada::_merge_skeletons2(VisualScene *p_vscene) {
if (skeleton != sk) {
//whoa.. wtf, merge.
- print_line("MERGED BONES!!");
-
- //NodeSkeleton *merged = E->get();
_remove_node(p_vscene, sk);
for (int i = 0; i < sk->children.size(); i++) {
@@ -2399,9 +2374,6 @@ bool Collada::_move_geometry_to_skeletons(VisualScene *p_vscene, Node *p_node, L
ERR_FAIL_COND_V(!state.scene_map.has(nodeid), false); //weird, it should have it...
NodeJoint *nj = SAFE_CAST<NodeJoint *>(state.scene_map[nodeid]);
ERR_FAIL_COND_V(!nj, false);
- if (!nj->owner) {
- print_line("Has no owner: " + nj->name);
- }
ERR_FAIL_COND_V(!nj->owner, false); //weird, node should have a skeleton owner
NodeSkeleton *sk = nj->owner;
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index bc20a99809..efe32b99ab 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -342,12 +342,10 @@ String EditorExportPlatform::find_export_template(String template_file_name, Str
bool has_system_path = (system_file != "");
system_file = system_file.plus_file(base_name);
- print_line("test user file: " + user_file);
// Prefer user file
if (FileAccess::exists(user_file)) {
return user_file;
}
- print_line("test system file: " + system_file);
// Now check system file
if (has_system_path) {
@@ -927,13 +925,10 @@ void EditorExport::_save() {
}
config->save("res://export_presets.cfg");
-
- print_line("saved ok");
}
void EditorExport::save_presets() {
- print_line("save presets");
if (block_save)
return;
save_timer->start();
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 4ae786391b..a6fc8dcddf 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -240,17 +240,12 @@ void EditorFileSystem::_scan_filesystem() {
String update_cache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("filesystem_update3");
- print_line("try to see fs update2");
if (FileAccess::exists(update_cache)) {
-
- print_line("it exists");
-
{
FileAccessRef f = FileAccess::open(update_cache, FileAccess::READ);
String l = f->get_line().strip_edges();
while (l != String()) {
- print_line("erased cache for: " + l + " " + itos(file_cache.has(l)));
file_cache.erase(l); //erase cache for this, so it gets updated
l = f->get_line().strip_edges();
}
@@ -278,9 +273,6 @@ void EditorFileSystem::_scan_filesystem() {
memdelete(d);
- //save back the findings
- //String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache");
-
f = FileAccess::open(fscache, FileAccess::WRITE);
_save_filesystem_cache(new_filesystem, f);
f->close();
@@ -322,7 +314,6 @@ bool EditorFileSystem::_update_scan_actions() {
} break;
case ItemAction::ACTION_DIR_ADD: {
- //print_line("*ACTION ADD DIR: "+ia.new_dir->get_name());
int idx = 0;
for (int i = 0; i < ia.dir->subdirs.size(); i++) {
@@ -341,7 +332,6 @@ bool EditorFileSystem::_update_scan_actions() {
case ItemAction::ACTION_DIR_REMOVE: {
ERR_CONTINUE(!ia.dir->parent);
- //print_line("*ACTION REMOVE DIR: "+ia.dir->get_name());
ia.dir->parent->subdirs.erase(ia.dir);
memdelete(ia.dir);
fs_changed = true;
@@ -362,7 +352,6 @@ bool EditorFileSystem::_update_scan_actions() {
}
fs_changed = true;
- //print_line("*ACTION ADD FILE: "+ia.new_file->file);
} break;
case ItemAction::ACTION_FILE_REMOVE: {
@@ -374,7 +363,6 @@ bool EditorFileSystem::_update_scan_actions() {
ia.dir->files.remove(idx);
fs_changed = true;
- //print_line("*ACTION REMOVE FILE: "+ia.file);
} break;
case ItemAction::ACTION_FILE_REIMPORT: {
@@ -512,7 +500,6 @@ bool EditorFileSystem::_check_missing_imported_files(const String &p_path) {
for (List<String>::Element *E = to_check.front(); E; E = E->next()) {
if (!FileAccess::exists(E->get())) {
- print_line("missing " + E->get() + ", reimport");
return false;
}
}
@@ -639,22 +626,7 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
} else {
- if (!fc) {
- print_line("REIMPORT BECAUSE: not previously found");
- } else if (fc->modification_time != mt) {
- print_line("REIMPORT BECAUSE: modified resource time " + itos(fc->modification_time) + " vs " + itos(mt));
-
- } else if (fc->import_modification_time != import_mt) {
- print_line("REIMPORT BECAUSE: modified .import time" + itos(fc->import_modification_time) + " vs " + itos(import_mt));
-
- } else {
-
- print_line("REIMPORT BECAUSE: missing imported files");
- }
-
fi->type = ResourceFormatImporter::get_singleton()->get_resource_type(path);
- //fi->deps = ResourceLoader::get_dependencies(path); pointless because it will be reimported, but..
- print_line("import extension tried resource type for " + path + " and its " + fi->type);
fi->modified_time = 0;
fi->import_modified_time = 0;
fi->import_valid = ResourceLoader::is_import_valid(path);
@@ -678,7 +650,6 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess
//new or modified time
fi->type = ResourceLoader::get_resource_type(path);
fi->deps = _get_dependencies(path);
- print_line("regular import tried resource type for " + path + " and its " + fi->type);
fi->modified_time = mt;
fi->import_modified_time = 0;
fi->import_valid = true;
@@ -697,8 +668,6 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
bool updated_dir = false;
String cd = p_dir->get_path();
- //print_line("dir: "+p_dir->get_path()+" MODTIME: "+itos(p_dir->modified_time)+" CTIME: "+itos(current_mtime));
-
if (current_mtime != p_dir->modified_time) {
updated_dir = true;
@@ -791,11 +760,6 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
if (import_extensions.has(ext)) {
//if it can be imported, and it was added, it needs to be reimported
- print_line("REIMPORT: file was not found before, reimport");
- print_line("at dir: " + p_dir->get_path() + " file: " + f);
- for (int i = 0; i < p_dir->files.size(); i++) {
- print_line(itos(i) + ": " + p_dir->files[i]->file);
- }
ItemAction ia;
ia.action = ItemAction::ACTION_FILE_REIMPORT;
ia.dir = p_dir;
@@ -835,20 +799,15 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
bool reimport = false;
if (mt != p_dir->files[i]->modified_time) {
- print_line("REIMPORT: modified time changed, reimport");
reimport = true; //it was modified, must be reimported.
} else if (!FileAccess::exists(path + ".import")) {
- print_line("REIMPORT: no .import exists, reimport");
reimport = true; //no .import file, obviously reimport
} else {
uint64_t import_mt = FileAccess::get_modified_time(path + ".import");
- //print_line(itos(import_mt) + " vs " + itos(p_dir->files[i]->import_modified_time));
if (import_mt != p_dir->files[i]->import_modified_time) {
- print_line("REIMPORT: import modified changed, reimport");
reimport = true;
} else if (!_check_missing_imported_files(path)) {
- print_line("REIMPORT: imported files removed");
reimport = true;
}
}
@@ -947,9 +906,6 @@ void EditorFileSystem::scan_changes() {
Thread::Settings s;
s.priority = Thread::PRIORITY_LOW;
thread_sources = Thread::create(_thread_func_sources, this, s);
- //tree->hide();
- //print_line("SCAN BEGIN!");
- //progress->show();
}
}
@@ -1000,7 +956,6 @@ void EditorFileSystem::_notification(int p_what) {
thread_sources = NULL;
if (_update_scan_actions())
emit_signal("filesystem_changed");
- //print_line("sources changed: "+itos(sources_changed.size()));
emit_signal("sources_changed", sources_changed.size() > 0);
}
} else if (!scanning) {
@@ -1017,10 +972,6 @@ void EditorFileSystem::_notification(int p_what) {
_update_scan_actions();
emit_signal("filesystem_changed");
emit_signal("sources_changed", sources_changed.size() > 0);
- //print_line("initial sources changed: "+itos(sources_changed.size()));
-
- } else {
- //progress->set_text("Scanning...\n"+itos(total*100)+"%");
}
}
} break;
@@ -1239,7 +1190,6 @@ void EditorFileSystem::_save_late_updated_files() {
void EditorFileSystem::_resource_saved(const String &p_path) {
- //print_line("resource saved: "+p_path);
EditorFileSystem::get_singleton()->update_file(p_path);
}
@@ -1311,14 +1261,10 @@ void EditorFileSystem::update_file(const String &p_file) {
_save_late_updated_files(); //files need to be updated in the re-scan
}
- //print_line("UPDATING: "+p_file);
fs->files[cpos]->type = type;
fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file);
fs->files[cpos]->deps = _get_dependencies(p_file);
fs->files[cpos]->import_valid = ResourceLoader::is_import_valid(p_file);
- //if (FileAccess::exists(p_file+".import")) {
- // fs->files[cpos]->import_modified_time=FileAccess::get_modified_time(p_file+".import");
- //}
EditorResourcePreview::get_singleton()->call_deferred("check_for_invalidation", p_file);
call_deferred("emit_signal", "filesystem_changed"); //update later
@@ -1326,8 +1272,6 @@ void EditorFileSystem::update_file(const String &p_file) {
void EditorFileSystem::_reimport_file(const String &p_file) {
- print_line("REIMPORTING: " + p_file);
-
EditorFileSystemDirectory *fs = NULL;
int cpos = -1;
bool found = _find_file(p_file, &fs, cpos);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index f109cdddc3..f2390ad269 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -406,7 +406,6 @@ void EditorNode::_fs_changed() {
uint64_t mt = FileAccess::get_modified_time(E->get()->get_import_path());
if (mt != E->get()->get_import_last_modified_time()) {
- print_line("success");
changed.push_back(E->get());
}
#endif
@@ -431,7 +430,7 @@ void EditorNode::_fs_changed() {
}
void EditorNode::_resources_reimported(const Vector<String> &p_resources) {
- print_line("reimporting");
+
List<String> scenes; //will load later
for (int i = 0; i < p_resources.size(); i++) {
@@ -463,7 +462,6 @@ void EditorNode::_sources_changed(bool p_exist) {
if (defer_load_scene != "") {
- print_line("loading scene DEFERRED");
load_scene(defer_load_scene);
defer_load_scene = "";
}
@@ -781,7 +779,6 @@ bool EditorNode::_find_and_save_resource(RES p_res, Map<RES, bool> &processed, i
if (p_res->get_path().is_resource_file()) {
if (changed || subchanged) {
//save
- print_line("Also saving modified external resource: " + p_res->get_path());
ResourceSaver::save(p_res->get_path(), p_res, flags);
}
processed[p_res] = false; //because it's a file
@@ -1991,7 +1988,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
case EDIT_UNDO: {
if (Input::get_singleton()->get_mouse_button_mask() & 0x7) {
- print_line("no because state");
break; // can't undo while mouse buttons are pressed
}
@@ -2960,7 +2956,6 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
dependency_errors.clear();
- print_line("actually loading it");
Error err;
Ref<PackedScene> sdata = ResourceLoader::load(lpath, "", true, &err);
if (!sdata.is_valid()) {
@@ -4297,15 +4292,11 @@ void EditorNode::reload_scene(const String &p_path) {
//first of all, reload internal textures, materials, meshes, etc. as they might have changed on disk
- print_line("reloading: " + p_path);
List<Ref<Resource> > cached;
ResourceCache::get_cached_resources(&cached);
List<Ref<Resource> > to_clear; //clear internal resources from previous scene from being used
for (List<Ref<Resource> >::Element *E = cached.front(); E; E = E->next()) {
- if (E->get()->get_path().find("::") != -1) {
- print_line(E->get()->get_path());
- }
if (E->get()->get_path().begins_with(p_path + "::")) { //subresources of existing scene
to_clear.push_back(E->get());
}
@@ -4313,7 +4304,6 @@ void EditorNode::reload_scene(const String &p_path) {
//so reload reloads everything, clear subresources of previous scene
while (to_clear.front()) {
- print_line("bye bye: " + to_clear.front()->get()->get_path());
to_clear.front()->get()->set_path("");
to_clear.pop_front();
}
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 437ad5ac3f..f92962a4cb 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -185,7 +185,6 @@ void EditorResourcePreview::_thread() {
path += ":" + itos(cache[item.path].last_hash); //keep last hash (see description of what this is in condition below)
}
- print_line("cached: " + item.path);
_preview_ready(path, cache[item.path].preview, item.id, item.function, item.userdata);
preview_mutex->unlock();
@@ -201,16 +200,12 @@ void EditorResourcePreview::_thread() {
if (item.resource.is_valid()) {
- print_line("generated: " + item.path);
-
texture = _generate_preview(item, String());
//adding hash to the end of path (should be ID:<objid>:<hash>) because of 5 argument limit to call_deferred
_preview_ready(item.path + ":" + itos(item.resource->hash_edited_version()), texture, item.id, item.function, item.userdata);
} else {
- print_line("from file: " + item.path);
-
String temp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp");
String cache_base = ProjectSettings::get_singleton()->globalize_path(item.path).md5_text();
cache_base = temp_path.plus_file("resthumb-" + cache_base);
@@ -218,12 +213,9 @@ void EditorResourcePreview::_thread() {
//does not have it, try to load a cached thumbnail
String file = cache_base + ".txt";
- //print_line("cachetxt at "+file);
FileAccess *f = FileAccess::open(file, FileAccess::READ);
if (!f) {
- //print_line("generate because not cached");
-
//generate
texture = _generate_preview(item, cache_base);
} else {
@@ -283,7 +275,6 @@ void EditorResourcePreview::_thread() {
}
}
- //print_line("notify of preview ready");
_preview_ready(item.path, texture, item.id, item.function, item.userdata);
}
}
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 992322978e..29859a1a56 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -233,7 +233,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
clock_t end_time = clock();
double time_d = (double)(end_time - begin_time) / CLOCKS_PER_SEC;
- print_line("SVG_GENERATION TIME: " + rtos(time_d));
#else
print_line("Sorry no icons for you");
#endif
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 6ef1758363..4d658438cd 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -1106,7 +1106,6 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
for (int mi = 0; mi < p_morph_meshes.size(); mi++) {
- //print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count()));
Array a = p_morph_meshes[mi]->surface_get_arrays(surface);
//add valid weight and bone arrays if they exist, TODO check if they are unique to shape (generally not)
@@ -1187,9 +1186,6 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
if (cd.control_vertices.has("TILT") && cd.sources.has(cd.control_vertices["TILT"]))
tilts = &cd.sources[cd.control_vertices["TILT"]];
- if (tilts) {
- print_line("FOUND TILTS!!!");
- }
int pc = vertices.array.size() / 3;
for (int i = 0; i < pc; i++) {
@@ -1237,12 +1233,8 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
Vector<int> bone_remap;
Vector<Ref<ArrayMesh> > morphs;
- print_line("mesh: " + String(mi->get_name()));
-
if (ng->controller) {
- print_line("has controller");
-
String ngsource = ng->source;
if (collada.state.skin_controller_data_map.has(ngsource)) {
@@ -1255,9 +1247,6 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
ERR_FAIL_COND_V(skeletons.empty(), ERR_INVALID_DATA);
String skname = skeletons[0];
- if (!node_map.has(skname)) {
- print_line("no node for skeleton " + skname);
- }
ERR_FAIL_COND_V(!node_map.has(skname), ERR_INVALID_DATA);
NodeMap nmsk = node_map[skname];
Skeleton *sk = Object::cast_to<Skeleton>(nmsk.node);
@@ -1295,22 +1284,16 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) {
for (int i = 0; i < bone_remap.size(); i++) {
String str = joint_src->sarray[i];
- if (!bone_remap_map.has(str)) {
- print_line("bone not found for remap: " + str);
- print_line("in skeleton: " + skname);
- }
ERR_FAIL_COND_V(!bone_remap_map.has(str), ERR_INVALID_DATA);
bone_remap[i] = bone_remap_map[str];
}
}
if (collada.state.morph_controller_data_map.has(ngsource)) {
- print_line("is morph " + ngsource);
+
//it's a morph!!
morph = &collada.state.morph_controller_data_map[ngsource];
meshid = morph->mesh;
- printf("KKmorph: %p\n", morph);
- print_line("morph mshid: " + meshid);
Vector<String> targets;