mirror of
https://github.com/godotengine/godot.git
synced 2025-10-29 20:51:14 +00:00
Changed import workflow
-Rearrange favorites in fs dock with drag and drop -Removed import -> sub-scene, moved to scenetree contextual menu -Removed import -> re-import , moved and integrated to FS dock -Added ability in FS dock to re-import more than one resource simultaneously -Added ability to drag from native filesystem explorer to Godot, only works on Windows though -Removed scene reimport merge options, never worked well. Eventually merging materials should be re-added -Added ability to set custom root node type when importing scenes -Re-Import is now automatic, can be configured back to manual in editor settings -Added resource previews in property list for many resource types
This commit is contained in:
parent
eb7227a20b
commit
8be2fabbe5
54 changed files with 1258 additions and 636 deletions
|
|
@ -149,6 +149,41 @@ bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool EditorFileSystemDirectory::have_sources_changed(int p_idx) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,files.size(),false);
|
||||
return files[p_idx]->meta.sources_changed;
|
||||
|
||||
}
|
||||
|
||||
int EditorFileSystemDirectory::get_source_count(int p_idx) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,files.size(),0);
|
||||
if (!files[p_idx]->meta.enabled)
|
||||
return 0;
|
||||
|
||||
}
|
||||
String EditorFileSystemDirectory::get_source_file(int p_idx,int p_source) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,files.size(),String());
|
||||
ERR_FAIL_INDEX_V(p_source,files[p_idx]->meta.sources.size(),String());
|
||||
if (!files[p_idx]->meta.enabled)
|
||||
return String();
|
||||
|
||||
return files[p_idx]->meta.sources[p_source].path;
|
||||
|
||||
}
|
||||
bool EditorFileSystemDirectory::is_source_file_missing(int p_idx,int p_source) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,files.size(),false);
|
||||
ERR_FAIL_INDEX_V(p_source,files[p_idx]->meta.sources.size(),false);
|
||||
if (!files[p_idx]->meta.enabled)
|
||||
return false;
|
||||
|
||||
return files[p_idx]->meta.sources[p_source].missing;
|
||||
}
|
||||
|
||||
|
||||
StringName EditorFileSystemDirectory::get_file_type(int p_idx) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
|
||||
|
|
@ -210,8 +245,11 @@ EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String&
|
|||
EditorFileSystemDirectory::ImportMeta m;
|
||||
if (imd.is_null()) {
|
||||
m.enabled=false;
|
||||
m.sources_changed=false;
|
||||
} else {
|
||||
m.enabled=true;
|
||||
m.sources_changed=false;
|
||||
|
||||
for(int i=0;i<imd->get_source_count();i++) {
|
||||
EditorFileSystemDirectory::ImportMeta::Source s;
|
||||
s.path=imd->get_source_path(i);
|
||||
|
|
@ -649,7 +687,13 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess
|
|||
ia.dir=p_dir;
|
||||
ia.file=E->get();
|
||||
scan_actions.push_back(ia);
|
||||
fi->meta.sources_changed=true;
|
||||
} else {
|
||||
fi->meta.sources_changed=false;
|
||||
}
|
||||
|
||||
} else {
|
||||
fi->meta.sources_changed=true;
|
||||
}
|
||||
|
||||
p_dir->files.push_back(fi);
|
||||
|
|
@ -764,6 +808,9 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S
|
|||
ia.dir=p_dir;
|
||||
ia.file=f;
|
||||
scan_actions.push_back(ia);
|
||||
fi->meta.sources_changed=true;
|
||||
} else {
|
||||
fi->meta.sources_changed=false;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -800,6 +847,9 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S
|
|||
ia.dir=p_dir;
|
||||
ia.file=p_dir->files[i]->file;
|
||||
scan_actions.push_back(ia);
|
||||
p_dir->files[i]->meta.sources_changed=true;
|
||||
} else {
|
||||
p_dir->files[i]->meta.sources_changed=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1113,6 +1163,25 @@ String EditorFileSystem::get_file_type(const String& p_file) const {
|
|||
|
||||
}
|
||||
|
||||
EditorFileSystemDirectory* EditorFileSystem::find_file(const String& p_file,int* r_index) const {
|
||||
|
||||
if (!filesystem || scanning)
|
||||
return NULL;
|
||||
|
||||
EditorFileSystemDirectory *fs=NULL;
|
||||
int cpos=-1;
|
||||
if (!_find_file(p_file,&fs,cpos)) {
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (r_index)
|
||||
*r_index=cpos;
|
||||
|
||||
return fs;
|
||||
}
|
||||
|
||||
|
||||
EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue