Skip to content

Commit

Permalink
Merge pull request #725 from NotArme/fix-library-creation
Browse files Browse the repository at this point in the history
Fix nonexistent library dir
  • Loading branch information
RodZill4 authored Nov 30, 2024
2 parents dae9238 + 7d8533b commit 346d251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion material_maker/tools/library_manager/library.gd
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func get_sections() -> Array:
return Array(sections)

func save_library() -> void:
DirAccess.open("res://").make_dir_recursive(library_path.get_base_dir())
DirAccess.make_dir_recursive_absolute(library_path.get_base_dir())
var file : FileAccess = FileAccess.open(library_path, FileAccess.WRITE)
if file != null:
file.store_string(JSON.stringify({name=library_name, lib=library_items}, "\t", true))
Expand Down
3 changes: 2 additions & 1 deletion material_maker/tools/library_manager/library_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func _ready():
func _exit_tree():
if item_usage_file == "":
return
DirAccess.open("res://").make_dir_recursive(item_usage_file.get_base_dir())
DirAccess.make_dir_recursive_absolute(item_usage_file.get_base_dir())
var file = FileAccess.open(item_usage_file, FileAccess.WRITE)
if file != null:
file.store_string(JSON.stringify(item_usage, "\t", true))
Expand All @@ -55,6 +55,7 @@ func init_libraries() -> void:
add_child(library)
library.generate_node_sections(node_sections)
library = LIBRARY.new()
DirAccess.make_dir_recursive_absolute(user_lib.get_base_dir())
if library.load_library(user_lib):
if library.library_name == "":
library.library_name = user_lib_name
Expand Down

0 comments on commit 346d251

Please sign in to comment.