资产管理插件
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
uid://bhxhjvggmpfr6
|
||||
@@ -0,0 +1,446 @@
|
||||
[gd_scene format=3 uid="uid://dspvtw055wu4s"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bhxhjvggmpfr6" path="res://addons/global_asset_manager/asset_manager.gd" id="1_abcde"]
|
||||
[ext_resource type="Script" uid="uid://bqil1tlkmnbxj" path="res://addons/global_asset_manager/settings_manager.gd" id="2_fghij"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_f1y5n"]
|
||||
background_mode = 1
|
||||
background_color = Color(0.18, 0.18, 0.18, 1)
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
ambient_light_energy = 0.4
|
||||
|
||||
[sub_resource type="World3D" id="World3D_ul3vj"]
|
||||
environment = SubResource("Environment_f1y5n")
|
||||
|
||||
[node name="AssetManager" type="Control" unique_id=1572556146]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_abcde")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1495794556]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 16
|
||||
theme_override_constants/margin_top = 16
|
||||
theme_override_constants/margin_right = 16
|
||||
theme_override_constants/margin_bottom = 16
|
||||
|
||||
[node name="MainSplit" type="HSplitContainer" parent="MarginContainer" unique_id=838962311]
|
||||
layout_mode = 2
|
||||
split_offsets = PackedInt32Array(250)
|
||||
split_offset = 250
|
||||
|
||||
[node name="Sidebar" type="VBoxContainer" parent="MarginContainer/MainSplit" unique_id=2026459748]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="ScanButton" type="Button" parent="MarginContainer/MainSplit/Sidebar" unique_id=1200203880]
|
||||
layout_mode = 2
|
||||
text = "Scan Folder..."
|
||||
|
||||
[node name="SettingsButton" type="Button" parent="MarginContainer/MainSplit/Sidebar" unique_id=1029532372]
|
||||
layout_mode = 2
|
||||
text = "Settings"
|
||||
|
||||
[node name="NavigationTree" type="Tree" parent="MarginContainer/MainSplit/Sidebar" unique_id=1210938222]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
allow_rmb_select = true
|
||||
hide_root = true
|
||||
|
||||
[node name="ContentSplit" type="HSplitContainer" parent="MarginContainer/MainSplit" unique_id=1996806136]
|
||||
layout_mode = 2
|
||||
split_offsets = PackedInt32Array(400)
|
||||
split_offset = 400
|
||||
|
||||
[node name="CenterPanel" type="VBoxContainer" parent="MarginContainer/MainSplit/ContentSplit" unique_id=769933576]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="SearchHBox" type="HBoxContainer" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel" unique_id=1595355325]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="SearchInput" type="LineEdit" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/SearchHBox" unique_id=1650205098]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Fuzzy search assets..."
|
||||
|
||||
[node name="ZoomOutButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/SearchHBox" unique_id=839575094]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = " - "
|
||||
|
||||
[node name="ZoomInButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/SearchHBox" unique_id=1622756085]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = " + "
|
||||
|
||||
[node name="ViewModeButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/SearchHBox" unique_id=1186203920]
|
||||
layout_mode = 2
|
||||
text = "View: List"
|
||||
|
||||
[node name="AssetGrid" type="ItemList" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel" unique_id=1739278632]
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/h_separation = 8
|
||||
theme_override_constants/v_separation = 4
|
||||
select_mode = 1
|
||||
fixed_icon_size = Vector2i(24, 24)
|
||||
|
||||
[node name="PaginationContainer" type="HBoxContainer" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel" unique_id=751157778]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="PrevPageButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/PaginationContainer" unique_id=546984628]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "< Prev"
|
||||
|
||||
[node name="PageLabel" type="Label" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/PaginationContainer" unique_id=1158757073]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Page 1 of 608"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="NextPageButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/CenterPanel/PaginationContainer" unique_id=1287330111]
|
||||
layout_mode = 2
|
||||
text = "Next >"
|
||||
|
||||
[node name="PreviewPanel" type="VBoxContainer" parent="MarginContainer/MainSplit/ContentSplit" unique_id=1928029523]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="PreviewContainer" type="PanelContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel" unique_id=1573284764]
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SubViewportContainer" type="SubViewportContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer" unique_id=1729812474]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
stretch = true
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/SubViewportContainer" unique_id=140946012]
|
||||
world_3d = SubResource("World3D_ul3vj")
|
||||
handle_input_locally = false
|
||||
size = Vector2i(446, 241)
|
||||
size_2d_override = Vector2i(223, 120)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/SubViewportContainer/SubViewport" unique_id=1167006985]
|
||||
transform = Transform3D(0.866025, -0.25, 0.433013, 0, 0.866025, 0.5, -0.5, -0.433013, 0.75, 2, 2, 3)
|
||||
current = true
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/SubViewportContainer/SubViewport" unique_id=813099430]
|
||||
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 5, 0)
|
||||
light_energy = 0.5
|
||||
|
||||
[node name="ModelPivot" type="Node3D" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/SubViewportContainer/SubViewport" unique_id=182794437]
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer" unique_id=1268634186]
|
||||
visible = false
|
||||
texture_filter = 1
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="ViewportToolbar" type="MarginContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer" unique_id=1133259305]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/ViewportToolbar" unique_id=2323868]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="ResetOriginBtn" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/ViewportToolbar/HBox" unique_id=1867599949]
|
||||
layout_mode = 2
|
||||
text = "Origin"
|
||||
|
||||
[node name="ResetZoomBtn" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/ViewportToolbar/HBox" unique_id=1872291065]
|
||||
layout_mode = 2
|
||||
text = "100%"
|
||||
|
||||
[node name="LightModeBtn" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/PreviewContainer/ViewportToolbar/HBox" unique_id=1690862519]
|
||||
custom_minimum_size = Vector2(80, 0)
|
||||
layout_mode = 2
|
||||
text = "Lit"
|
||||
|
||||
[node name="DetailsPanel" type="VBoxContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel" unique_id=1870626175]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 0.6
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="FileNameLabel" type="Label" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=1945897261]
|
||||
custom_minimum_size = Vector2(150, 0)
|
||||
layout_mode = 2
|
||||
text = "No asset selected"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="ActionButtons" type="HBoxContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=203888111]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="ReplayButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/ActionButtons" unique_id=705458203]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Replay"
|
||||
|
||||
[node name="OpenExternalButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/ActionButtons" unique_id=2085029535]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Open External"
|
||||
|
||||
[node name="OpenLocationButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/ActionButtons" unique_id=1933600867]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Open Location"
|
||||
|
||||
[node name="SendToProjectButton" type="Button" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/ActionButtons" unique_id=1506299809]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Add to Project"
|
||||
|
||||
[node name="HSeparator1" type="HSeparator" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=1957271692]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CurrentTagsLabel" type="Label" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=1625403212]
|
||||
layout_mode = 2
|
||||
text = "Current Tags (Click to remove):"
|
||||
|
||||
[node name="CurrentTagsScroll" type="ScrollContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=325549676]
|
||||
custom_minimum_size = Vector2(0, 80)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="TagFlowContainer" type="HFlowContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/CurrentTagsScroll" unique_id=1644314182]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="TagInputField" type="LineEdit" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=189668564]
|
||||
layout_mode = 2
|
||||
placeholder_text = "Type new tag and press Enter..."
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=2046671363]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="AvailableTagsLabel" type="Label" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=796453656]
|
||||
layout_mode = 2
|
||||
text = "Quick Add Known Tags:"
|
||||
|
||||
[node name="AvailableTagsScroll" type="ScrollContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel" unique_id=82847435]
|
||||
custom_minimum_size = Vector2(0, 80)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="AvailableTagsFlowContainer" type="HFlowContainer" parent="MarginContainer/MainSplit/ContentSplit/PreviewPanel/DetailsPanel/AvailableTagsScroll" unique_id=1147206232]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=447829074]
|
||||
volume_db = -12.0412
|
||||
|
||||
[node name="FolderDialog" type="FileDialog" parent="." unique_id=751017296]
|
||||
title = "Open a Directory"
|
||||
size = Vector2i(800, 600)
|
||||
ok_button_text = "Select Current Folder"
|
||||
file_mode = 2
|
||||
access = 2
|
||||
|
||||
[node name="SettingsDialog" type="AcceptDialog" parent="." unique_id=1835870348]
|
||||
oversampling_override = 1.0
|
||||
title = "Settings"
|
||||
position = Vector2i(0, 36)
|
||||
size = Vector2i(788, 650)
|
||||
script = ExtResource("2_fghij")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="SettingsDialog" unique_id=1304404260]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 8.0
|
||||
offset_top = 8.0
|
||||
offset_right = -8.0
|
||||
offset_bottom = -49.0
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="SettingsDialog/ScrollContainer" unique_id=1102077803]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="VolumeLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=597664857]
|
||||
layout_mode = 2
|
||||
text = "Max Audio Volume: 25%"
|
||||
|
||||
[node name="VolumeSlider" type="HSlider" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=337623076]
|
||||
layout_mode = 2
|
||||
value = 25.0
|
||||
|
||||
[node name="WavLengthLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1860502584]
|
||||
layout_mode = 2
|
||||
text = "WAV Preview Length: 20s"
|
||||
|
||||
[node name="WavLengthSlider" type="HSlider" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1204250806]
|
||||
layout_mode = 2
|
||||
min_value = 5.0
|
||||
max_value = 60.0
|
||||
value = 20.0
|
||||
|
||||
[node name="WavDisclaimerLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1950677763]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.43529412, 0.43529412, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "* Higher values may cause performance drops or high RAM usage when previewing large WAV files."
|
||||
|
||||
[node name="HSeparator1" type="HSeparator" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=898958503]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PathsLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=79087959]
|
||||
layout_mode = 2
|
||||
text = "Default Project Import Paths"
|
||||
|
||||
[node name="PathsVBox" type="VBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=212524826]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="Path3DBox" type="HBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox" unique_id=533637137]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path3DBox" unique_id=482903522]
|
||||
custom_minimum_size = Vector2(90, 0)
|
||||
layout_mode = 2
|
||||
text = "3D Models:"
|
||||
|
||||
[node name="Path3DEdit" type="LineEdit" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path3DBox" unique_id=1729944401]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "res://assets/models"
|
||||
placeholder_text = "res://assets/models"
|
||||
|
||||
[node name="Path3DBtn" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path3DBox" unique_id=1270886819]
|
||||
layout_mode = 2
|
||||
text = "Browse"
|
||||
|
||||
[node name="Path2DBox" type="HBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox" unique_id=1285561563]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path2DBox" unique_id=79932626]
|
||||
custom_minimum_size = Vector2(90, 0)
|
||||
layout_mode = 2
|
||||
text = "2D Images:"
|
||||
|
||||
[node name="Path2DEdit" type="LineEdit" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path2DBox" unique_id=771401102]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "res://assets/images"
|
||||
placeholder_text = "res://assets/images"
|
||||
|
||||
[node name="Path2DBtn" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/Path2DBox" unique_id=1491796409]
|
||||
layout_mode = 2
|
||||
text = "Browse"
|
||||
|
||||
[node name="PathAudioBox" type="HBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox" unique_id=183657517]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathAudioBox" unique_id=1193668696]
|
||||
custom_minimum_size = Vector2(90, 0)
|
||||
layout_mode = 2
|
||||
text = "Audio:"
|
||||
|
||||
[node name="PathAudioEdit" type="LineEdit" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathAudioBox" unique_id=559033777]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "res://assets/audio"
|
||||
placeholder_text = "res://assets/audio"
|
||||
|
||||
[node name="PathAudioBtn" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathAudioBox" unique_id=1049358774]
|
||||
layout_mode = 2
|
||||
text = "Browse"
|
||||
|
||||
[node name="PathShaderBox" type="HBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox" unique_id=1789204463]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathShaderBox" unique_id=290911804]
|
||||
custom_minimum_size = Vector2(90, 0)
|
||||
layout_mode = 2
|
||||
text = "Shaders:"
|
||||
|
||||
[node name="PathShaderEdit" type="LineEdit" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathShaderBox" unique_id=2109857326]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "res://assets/shaders"
|
||||
placeholder_text = "res://assets/shaders"
|
||||
|
||||
[node name="PathShaderBtn" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/PathsVBox/PathShaderBox" unique_id=866708351]
|
||||
layout_mode = 2
|
||||
text = "Browse"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=576437035]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FormatsLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=474270375]
|
||||
layout_mode = 2
|
||||
text = "Active Formats"
|
||||
|
||||
[node name="SettingsTree" type="Tree" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1374659203]
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
layout_mode = 2
|
||||
hide_root = true
|
||||
scroll_vertical_enabled = false
|
||||
|
||||
[node name="HSeparator3" type="HSeparator" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=582192234]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DangerZoneLabel" type="Label" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1373151021]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.435294, 0.435294, 1)
|
||||
text = "Danger Zone"
|
||||
|
||||
[node name="DangerZoneBox" type="HBoxContainer" parent="SettingsDialog/ScrollContainer/VBoxContainer" unique_id=1347846678]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 16
|
||||
|
||||
[node name="ResetButton" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/DangerZoneBox" unique_id=379439961]
|
||||
layout_mode = 2
|
||||
text = "Reset Settings to Default"
|
||||
|
||||
[node name="ClearButton" type="Button" parent="SettingsDialog/ScrollContainer/VBoxContainer/DangerZoneBox" unique_id=980056231]
|
||||
layout_mode = 2
|
||||
text = "Clear Entire Asset Database"
|
||||
|
||||
[node name="DirDialog" type="FileDialog" parent="SettingsDialog" unique_id=1398567986]
|
||||
title = "Open a Directory"
|
||||
size = Vector2i(600, 400)
|
||||
ok_button_text = "Select Current Folder"
|
||||
file_mode = 2
|
||||
|
||||
[node name="TagContextMenu" type="PopupMenu" parent="." unique_id=1890144552]
|
||||
item_count = 1
|
||||
item_0/text = "Delete Tag Globally"
|
||||
item_0/id = 0
|
||||
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="Global Asset Manager"
|
||||
description="A central hub for scanning, tagging, and importing local game assets."
|
||||
author="sn1ks0h"
|
||||
version="2.1.4"
|
||||
script="plugin.gd"
|
||||
@@ -0,0 +1,27 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
var main_panel_instance: Control
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
main_panel_instance = preload("res://addons/global_asset_manager/asset_manager.tscn").instantiate()
|
||||
EditorInterface.get_editor_main_screen().add_child(main_panel_instance)
|
||||
_make_visible(false)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if main_panel_instance:
|
||||
main_panel_instance.queue_free()
|
||||
|
||||
func _has_main_screen() -> bool:
|
||||
return true
|
||||
|
||||
func _make_visible(visible: bool) -> void:
|
||||
if main_panel_instance:
|
||||
main_panel_instance.visible = visible
|
||||
|
||||
func _get_plugin_name() -> String:
|
||||
return "AssetHub"
|
||||
|
||||
func _get_plugin_icon() -> Texture2D:
|
||||
return EditorInterface.get_editor_theme().get_icon("Load", "EditorIcons")
|
||||
@@ -0,0 +1 @@
|
||||
uid://cop233bihhwbe
|
||||
@@ -0,0 +1,116 @@
|
||||
@tool
|
||||
class_name PreviewController
|
||||
extends RefCounted
|
||||
## Handles 2D and 3D preview manipulations (orbit, pan, zoom).
|
||||
|
||||
var pivot: Node3D
|
||||
var camera: Camera3D
|
||||
var texture_rect: TextureRect
|
||||
|
||||
var _is_orbiting: bool = false
|
||||
var _is_panning_3d: bool = false
|
||||
var _is_panning_2d: bool = false
|
||||
var _last_mouse_pos: Vector2 = Vector2.ZERO
|
||||
|
||||
var _yaw: float = 0.0
|
||||
var _pitch: float = 0.0
|
||||
var _initial_cam_transform: Transform3D
|
||||
|
||||
func reset_views() -> void:
|
||||
_yaw = 0.0
|
||||
_pitch = 0.0
|
||||
if is_instance_valid(pivot):
|
||||
pivot.transform.basis = Basis.IDENTITY
|
||||
pivot.position = Vector3.ZERO
|
||||
if is_instance_valid(camera):
|
||||
if _initial_cam_transform == Transform3D():
|
||||
_initial_cam_transform = camera.transform
|
||||
camera.transform = _initial_cam_transform
|
||||
|
||||
if is_instance_valid(texture_rect):
|
||||
texture_rect.scale = Vector2.ONE
|
||||
texture_rect.position = Vector2.ZERO
|
||||
|
||||
func reset_origin() -> void:
|
||||
_yaw = 0.0
|
||||
_pitch = 0.0
|
||||
if is_instance_valid(pivot):
|
||||
pivot.transform.basis = Basis.IDENTITY
|
||||
pivot.position = Vector3.ZERO
|
||||
|
||||
func reset_zoom() -> void:
|
||||
if is_instance_valid(camera) and _initial_cam_transform != Transform3D():
|
||||
# Preserve the camera's angle, but snap its distance back to default
|
||||
camera.global_position = _initial_cam_transform.origin
|
||||
|
||||
func handle_3d_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
_is_orbiting = event.pressed
|
||||
_last_mouse_pos = event.position
|
||||
elif event.button_index == MOUSE_BUTTON_RIGHT or event.button_index == MOUSE_BUTTON_MIDDLE:
|
||||
_is_panning_3d = event.pressed
|
||||
_last_mouse_pos = event.position
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed:
|
||||
# Zoom in along the camera's actual line of sight
|
||||
camera.global_position -= camera.global_transform.basis.z * 0.5
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN and event.pressed:
|
||||
# Zoom out along the camera's actual line of sight
|
||||
camera.global_position += camera.global_transform.basis.z * 0.5
|
||||
|
||||
elif event is InputEventMouseMotion:
|
||||
var motion := event as InputEventMouseMotion
|
||||
var delta: Vector2 = motion.position - _last_mouse_pos
|
||||
_last_mouse_pos = motion.position
|
||||
|
||||
if _is_orbiting:
|
||||
_yaw += delta.x * 0.01
|
||||
_pitch += delta.y * 0.01
|
||||
_pitch = clampf(_pitch, -PI / 2.5, PI / 2.5)
|
||||
|
||||
pivot.transform.basis = Basis.IDENTITY
|
||||
|
||||
# Rotate relative to the camera's orientation so screen-space movement always feels perfectly vertical/horizontal
|
||||
var cam_up := camera.global_transform.basis.y.normalized()
|
||||
var cam_right := camera.global_transform.basis.x.normalized()
|
||||
|
||||
pivot.global_rotate(cam_up, _yaw)
|
||||
pivot.global_rotate(cam_right, _pitch)
|
||||
|
||||
elif _is_panning_3d:
|
||||
var right := camera.global_transform.basis.x
|
||||
var up := camera.global_transform.basis.y
|
||||
|
||||
# Calculate distance from camera to pivot to dynamically adjust pan speed
|
||||
var dist := camera.global_position.distance_to(pivot.global_position)
|
||||
var pan_speed := maxf(0.01, dist * 0.003)
|
||||
|
||||
pivot.global_position += right * delta.x * pan_speed
|
||||
pivot.global_position -= up * delta.y * pan_speed
|
||||
|
||||
func handle_2d_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT or event.button_index == MOUSE_BUTTON_RIGHT or event.button_index == MOUSE_BUTTON_MIDDLE:
|
||||
_is_panning_2d = event.pressed
|
||||
_last_mouse_pos = event.position
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed:
|
||||
_zoom_2d(event.position, 1.1)
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN and event.pressed:
|
||||
_zoom_2d(event.position, 1.0 / 1.1)
|
||||
|
||||
elif event is InputEventMouseMotion and _is_panning_2d:
|
||||
var motion := event as InputEventMouseMotion
|
||||
var delta: Vector2 = motion.position - _last_mouse_pos
|
||||
_last_mouse_pos = motion.position
|
||||
texture_rect.position += delta
|
||||
|
||||
func _zoom_2d(mouse_pos: Vector2, factor: float) -> void:
|
||||
var old_scale := texture_rect.scale
|
||||
var new_scale := old_scale * factor
|
||||
|
||||
new_scale.x = clampf(new_scale.x, 0.1, 50.0)
|
||||
new_scale.y = clampf(new_scale.y, 0.1, 50.0)
|
||||
|
||||
var mouse_local := mouse_pos - texture_rect.position
|
||||
texture_rect.position -= mouse_local * ((new_scale / old_scale) - Vector2.ONE)
|
||||
texture_rect.scale = new_scale
|
||||
@@ -0,0 +1 @@
|
||||
uid://ccl1fofx0hjq0
|
||||
@@ -0,0 +1,200 @@
|
||||
@tool
|
||||
extends AcceptDialog
|
||||
|
||||
signal settings_changed
|
||||
signal database_cleared
|
||||
|
||||
const ALL_3D_FORMATS: PackedStringArray = ["glb", "gltf", "fbx"]
|
||||
const ALL_2D_FORMATS: PackedStringArray = ["png", "jpg", "jpeg", "webp"]
|
||||
const ALL_AUDIO_FORMATS: PackedStringArray = ["ogg", "mp3", "wav"]
|
||||
|
||||
var db: Dictionary
|
||||
|
||||
var _current_path_target: String = ""
|
||||
|
||||
@onready var clear_button: Button = $ScrollContainer/VBoxContainer/DangerZoneBox/ClearButton
|
||||
@onready var dir_dialog: FileDialog = $DirDialog
|
||||
@onready var path_btn_2d: Button = $ScrollContainer/VBoxContainer/PathsVBox/Path2DBox/Path2DBtn
|
||||
@onready var path_btn_3d: Button = $ScrollContainer/VBoxContainer/PathsVBox/Path3DBox/Path3DBtn
|
||||
@onready var path_btn_audio: Button = $ScrollContainer/VBoxContainer/PathsVBox/PathAudioBox/PathAudioBtn
|
||||
@onready var path_btn_shader: Button = $ScrollContainer/VBoxContainer/PathsVBox/PathShaderBox/PathShaderBtn
|
||||
@onready var path_edit_2d: LineEdit = $ScrollContainer/VBoxContainer/PathsVBox/Path2DBox/Path2DEdit
|
||||
@onready var path_edit_3d: LineEdit = $ScrollContainer/VBoxContainer/PathsVBox/Path3DBox/Path3DEdit
|
||||
@onready var path_edit_audio: LineEdit = $ScrollContainer/VBoxContainer/PathsVBox/PathAudioBox/PathAudioEdit
|
||||
@onready var path_edit_shader: LineEdit = $ScrollContainer/VBoxContainer/PathsVBox/PathShaderBox/PathShaderEdit
|
||||
@onready var reset_button: Button = $ScrollContainer/VBoxContainer/DangerZoneBox/ResetButton
|
||||
@onready var settings_tree: Tree = $ScrollContainer/VBoxContainer/SettingsTree
|
||||
@onready var volume_label: Label = $ScrollContainer/VBoxContainer/VolumeLabel
|
||||
@onready var volume_slider: HSlider = $ScrollContainer/VBoxContainer/VolumeSlider
|
||||
@onready var wav_length_label: Label = $ScrollContainer/VBoxContainer/WavLengthLabel
|
||||
@onready var wav_length_slider: HSlider = $ScrollContainer/VBoxContainer/WavLengthSlider
|
||||
|
||||
func save_database() -> void:
|
||||
var file := FileAccess.open("user://asset_database.dat", FileAccess.WRITE)
|
||||
if file:
|
||||
file.store_var(db)
|
||||
|
||||
func setup(database: Dictionary) -> void:
|
||||
db = database
|
||||
_verify_settings_schema()
|
||||
_update_ui_from_db()
|
||||
|
||||
if not wav_length_slider.value_changed.is_connected(_on_wav_length_changed):
|
||||
wav_length_slider.value_changed.connect(_on_wav_length_changed)
|
||||
if not wav_length_slider.drag_ended.is_connected(_on_wav_length_drag_ended):
|
||||
wav_length_slider.drag_ended.connect(_on_wav_length_drag_ended)
|
||||
|
||||
func _ready() -> void:
|
||||
settings_tree.item_edited.connect(_on_settings_tree_item_edited)
|
||||
|
||||
volume_slider.value_changed.connect(_on_volume_changed)
|
||||
volume_slider.drag_ended.connect(_on_volume_drag_ended)
|
||||
|
||||
path_btn_3d.pressed.connect(func() -> void: _open_dir_dialog("3d"))
|
||||
path_btn_2d.pressed.connect(func() -> void: _open_dir_dialog("2d"))
|
||||
path_btn_audio.pressed.connect(func() -> void: _open_dir_dialog("audio"))
|
||||
path_btn_shader.pressed.connect(func() -> void: _open_dir_dialog("shader"))
|
||||
|
||||
path_edit_3d.text_changed.connect(func(text: String) -> void: _update_path("3d", text))
|
||||
path_edit_2d.text_changed.connect(func(text: String) -> void: _update_path("2d", text))
|
||||
path_edit_audio.text_changed.connect(func(text: String) -> void: _update_path("audio", text))
|
||||
path_edit_shader.text_changed.connect(func(text: String) -> void: _update_path("shader", text))
|
||||
|
||||
reset_button.pressed.connect(_on_reset_pressed)
|
||||
clear_button.pressed.connect(_on_clear_pressed)
|
||||
dir_dialog.dir_selected.connect(_on_dir_selected)
|
||||
|
||||
func _add_setting_category(parent: TreeItem, label: String, formats: PackedStringArray) -> void:
|
||||
var category_item := settings_tree.create_item(parent)
|
||||
category_item.set_cell_mode(0, TreeItem.CELL_MODE_CHECK)
|
||||
category_item.set_text(0, label)
|
||||
category_item.set_editable(0, true)
|
||||
category_item.set_metadata(0, "category")
|
||||
|
||||
var all_checked := true
|
||||
for ext in formats:
|
||||
var child := settings_tree.create_item(category_item)
|
||||
child.set_cell_mode(0, TreeItem.CELL_MODE_CHECK)
|
||||
child.set_text(0, "." + ext)
|
||||
child.set_editable(0, true)
|
||||
|
||||
var is_active: bool = db["settings"]["active_formats"].has(ext)
|
||||
child.set_checked(0, is_active)
|
||||
child.set_metadata(0, ext)
|
||||
|
||||
if not is_active:
|
||||
all_checked = false
|
||||
|
||||
category_item.set_checked(0, all_checked)
|
||||
|
||||
func _on_clear_pressed() -> void:
|
||||
database_cleared.emit()
|
||||
hide()
|
||||
|
||||
func _on_dir_selected(dir: String) -> void:
|
||||
if _current_path_target == "3d": path_edit_3d.text = dir
|
||||
elif _current_path_target == "2d": path_edit_2d.text = dir
|
||||
elif _current_path_target == "audio": path_edit_audio.text = dir
|
||||
elif _current_path_target == "shader": path_edit_shader.text = dir
|
||||
|
||||
_update_path(_current_path_target, dir)
|
||||
|
||||
func _on_reset_pressed() -> void:
|
||||
db["settings"].clear()
|
||||
_verify_settings_schema()
|
||||
_update_ui_from_db()
|
||||
save_database()
|
||||
settings_changed.emit()
|
||||
|
||||
func _on_settings_tree_item_edited() -> void:
|
||||
var item := settings_tree.get_edited()
|
||||
var is_checked := item.is_checked(0)
|
||||
var meta: Variant = item.get_metadata(0)
|
||||
|
||||
if meta is String and meta == "category":
|
||||
for i in range(item.get_child_count()):
|
||||
var child := item.get_child(i)
|
||||
child.set_checked(0, is_checked)
|
||||
var ext: String = child.get_metadata(0)
|
||||
_update_active_format(ext, is_checked)
|
||||
elif meta is String:
|
||||
_update_active_format(meta, is_checked)
|
||||
var parent := item.get_parent()
|
||||
if parent:
|
||||
var all_checked := true
|
||||
for i in range(parent.get_child_count()):
|
||||
if not parent.get_child(i).is_checked(0):
|
||||
all_checked = false
|
||||
parent.set_checked(0, all_checked)
|
||||
|
||||
save_database()
|
||||
settings_changed.emit()
|
||||
|
||||
func _on_volume_changed(value: float) -> void:
|
||||
volume_label.text = "Max Audio Volume: " + str(int(value)) + "%"
|
||||
|
||||
func _on_volume_drag_ended(_value_changed: bool) -> void:
|
||||
db["settings"]["volume"] = volume_slider.value
|
||||
save_database()
|
||||
settings_changed.emit()
|
||||
|
||||
func _on_wav_length_changed(value: float) -> void:
|
||||
wav_length_label.text = "WAV Preview Length: " + str(int(value)) + "s"
|
||||
|
||||
func _on_wav_length_drag_ended(_value_changed: bool) -> void:
|
||||
db["settings"]["wav_preview_length"] = int(wav_length_slider.value)
|
||||
save_database()
|
||||
settings_changed.emit()
|
||||
|
||||
func _open_dir_dialog(target: String) -> void:
|
||||
_current_path_target = target
|
||||
dir_dialog.current_dir = "res://"
|
||||
dir_dialog.popup_centered()
|
||||
|
||||
func _populate_settings_tree() -> void:
|
||||
settings_tree.clear()
|
||||
var root := settings_tree.create_item()
|
||||
|
||||
_add_setting_category(root, "3D Models", ALL_3D_FORMATS)
|
||||
_add_setting_category(root, "2D Images", ALL_2D_FORMATS)
|
||||
_add_setting_category(root, "Audio", ALL_AUDIO_FORMATS)
|
||||
|
||||
func _update_active_format(ext: String, is_active: bool) -> void:
|
||||
var active_list: Array = db["settings"]["active_formats"]
|
||||
if is_active and not active_list.has(ext):
|
||||
active_list.append(ext)
|
||||
elif not is_active and active_list.has(ext):
|
||||
active_list.erase(ext)
|
||||
|
||||
func _update_path(target: String, new_path: String) -> void:
|
||||
db["settings"]["import_path_" + target] = new_path
|
||||
save_database()
|
||||
settings_changed.emit()
|
||||
|
||||
func _update_ui_from_db() -> void:
|
||||
var s: Dictionary = db["settings"]
|
||||
volume_slider.value = s["volume"]
|
||||
volume_label.text = "Max Audio Volume: " + str(int(s["volume"])) + "%"
|
||||
|
||||
wav_length_slider.value = s["wav_preview_length"]
|
||||
wav_length_label.text = "WAV Preview Length: " + str(int(s["wav_preview_length"])) + "s"
|
||||
|
||||
path_edit_3d.text = s["import_path_3d"]
|
||||
path_edit_2d.text = s["import_path_2d"]
|
||||
path_edit_audio.text = s["import_path_audio"]
|
||||
path_edit_shader.text = s["import_path_shader"]
|
||||
|
||||
_populate_settings_tree()
|
||||
|
||||
func _verify_settings_schema() -> void:
|
||||
if not db.has("settings"):
|
||||
db["settings"] = {}
|
||||
|
||||
var s: Dictionary = db["settings"]
|
||||
if not s.has("active_formats"): s["active_formats"] = ["glb", "gltf", "png", "jpg", "jpeg", "webp", "ogg", "mp3", "wav"]
|
||||
if not s.has("volume"): s["volume"] = 25.0
|
||||
if not s.has("import_path_3d"): s["import_path_3d"] = "res://assets/models"
|
||||
if not s.has("import_path_2d"): s["import_path_2d"] = "res://assets/images"
|
||||
if not s.has("import_path_audio"): s["import_path_audio"] = "res://assets/audio"
|
||||
if not s.has("import_path_shader"): s["import_path_shader"] = "res://assets/shaders"
|
||||
if not s.has("wav_preview_length"): s["wav_preview_length"] = 10
|
||||
@@ -0,0 +1 @@
|
||||
uid://bqil1tlkmnbxj
|
||||
Reference in New Issue
Block a user