mesh lib 工具自动化

master
chendian 2 years ago
parent 4e664e4785
commit 0599289de8

@ -59,5 +59,6 @@ func _get_option_visibility(path, option, options):
func _import(source_path, destination_path, options, _platforms, _gen_files):
var meshes = VoxImporterCommon.new().import(source_path, destination_path, options, _platforms, _gen_files);
var full_path = "%s.%s" % [ destination_path, _get_save_extension() ]
print(meshes[0])
return ResourceSaver.save(meshes[0], full_path)
var res = ResourceSaver.save(meshes[0], full_path)
Util.refresh_mesh_library([full_path])
return res

@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://c5wg3is8k5pux" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/BorderWallHorizontal.png" id="2_tawyw"]
[ext_resource type="Texture2D" uid="uid://208uoowofggq" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/Empty.png" id="2_tsiva"]
[ext_resource type="Texture2D" uid="uid://rgchhbw4jh7f" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/CornerInner.png" id="3_4qbbp"]
[ext_resource type="PackedScene" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/PlayerLocation.tscn" id="3_mk7eh"]
[ext_resource type="PackedScene" uid="uid://brmrbsa4ongaw" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/PlayerLocation.tscn" id="3_mk7eh"]
[ext_resource type="Texture2D" uid="uid://bxs8cn6khov7j" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/RoomFill.png" id="4_2clky"]
[ext_resource type="Texture2D" uid="uid://dihccrjj2ehi4" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/CornerOuter.png" id="4_xtd8s"]
[ext_resource type="Texture2D" uid="uid://b8ccoibsf323o" path="res://addons/MetroidvaniaSystem/Themes/Exquisite/BorderPassage.png" id="5_sn1if"]

@ -16,6 +16,6 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("3_3pp8a")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_mxlqc")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("4_q0bln")
animation_name = "long_air_attack01"

@ -16,6 +16,6 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("3_76yga")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_qfkyy")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("4_ahm2t")
animation_name = "long_air_attack02"

@ -16,6 +16,6 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("2_jrgan")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_8fm1u")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("3_jidy7")
animation_name = "long_attack02"

@ -16,6 +16,6 @@ action = "attack_light"
name = ""
skill_animation = ExtResource("2_sam6s")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_7tise")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("3_w7h1m")
animation_name = "long_attack04"

@ -15,6 +15,6 @@ action = "flash"
name = ""
skill_animation = ExtResource("2_bdxlh")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("2_uof6p")
animation_name = "long_flash"

@ -16,6 +16,6 @@ action = "attack_heavy"
name = ""
skill_animation = ExtResource("2_ewts2")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_p5wrw")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("3_qwjfl")
animation_name = "long_skill01"

@ -16,6 +16,6 @@ action = "attack_heavy"
name = ""
skill_animation = ExtResource("3_b7s0y")
attack_list = Array[Resource("res://script/config/attack_cfg.gd")]([ExtResource("1_edtv7")])
has_animation = false
refresh_animation = false
sprite_frams = ExtResource("4_rbnly")
animation_name = "long_skill02"

Binary file not shown.

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://bw3y6lchtlhlh"
path="res://.godot/imported/f_wall1.vox-6777fc1a37b75d7f097aeb0b7093d5d1.mesh"
[deps]
source_file="res://resource/mesh_level/f_wall1.vox"
dest_files=["res://.godot/imported/f_wall1.vox-6777fc1a37b75d7f097aeb0b7093d5d1.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

Binary file not shown.

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://b4utbpw0prsq8"
path="res://.godot/imported/f_wall2.vox-8c807af108e0895e836bfae59b0f5a33.mesh"
[deps]
source_file="res://resource/mesh_level/f_wall2.vox"
dest_files=["res://.godot/imported/f_wall2.vox-8c807af108e0895e836bfae59b0f5a33.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -1,4 +0,0 @@
[gd_scene format=3 uid="uid://bb3rddqjm47aw"]
[node name="Block" type="MeshInstance3D"]
cast_shadow = 0

File diff suppressed because one or more lines are too long

@ -1,11 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://d1lh6ere14pny"]
[gd_resource type="ConcavePolygonShape3D" format=3 uid="uid://bdcs11jue0b7a"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_stlyj"]
[resource]
data = PackedVector3Array(-0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, -0.32)
[node name="Block" type="MeshInstance3D"]
[node name="StaticBody3D" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_stlyj")

@ -1,11 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://ceyw37iyt3ye5"]
[gd_resource type="ConcavePolygonShape3D" format=3 uid="uid://b8mk8bhmwvw46"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_wncfa"]
[resource]
data = PackedVector3Array(-0.32, 0, -0.32, 0.32, 0, -0.32, 0.32, 0, 0.32, 0.32, 0, 0.32, -0.32, 0, 0.32, -0.32, 0, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, 0.32, -0.32, 0.32, -0.32, 0, -0.32, -0.32, 0, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, -0.32, -0.32, -0.32, 0, -0.32, 0.32, 0, -0.32, 0.32, -0.32, -0.32, 0.32, -0.32, 0.32, 0.32, -0.32, 0.32, 0.32, 0, 0.32, 0.32, 0, -0.32, -0.32, -0.32, 0.32, -0.32, 0, 0.32, 0.32, 0, 0.32, 0.32, 0, 0.32, 0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0.32, 0, -0.32, -0.32, 0, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, -0.32, 0.32, -0.32, -0.32, 0.32, 0, -0.32)
[node name="Block" type="MeshInstance3D"]
[node name="StaticBody3D" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("ConcavePolygonShape3D_wncfa")

File diff suppressed because one or more lines are too long

@ -1,49 +0,0 @@
[gd_scene load_steps=15 format=3 uid="uid://b3rp0a5do2mm6"]
[ext_resource type="Script" path="res://script/editor_tool/mesh_lib.gd" id="1_7xp6b"]
[ext_resource type="PackedScene" uid="uid://d1lh6ere14pny" path="res://resource/mesh_library/block_full.tscn" id="2_xn8cf"]
[ext_resource type="ArrayMesh" uid="uid://43lv5hser7jg" path="res://resource/mesh_level/f_block_air.vox" id="3_rgsxo"]
[ext_resource type="ArrayMesh" uid="uid://dbaxh8tjqojop" path="res://resource/mesh_level/f_block_center.vox" id="4_l6isk"]
[ext_resource type="ArrayMesh" uid="uid://dpfp554wuwtom" path="res://resource/mesh_level/f_block_corner.vox" id="5_0rc2s"]
[ext_resource type="ArrayMesh" uid="uid://b828kv8ly5aef" path="res://resource/mesh_level/f_block_edge.vox" id="6_7adng"]
[ext_resource type="PackedScene" uid="uid://ceyw37iyt3ye5" path="res://resource/mesh_library/block_half.tscn" id="7_2wb1i"]
[ext_resource type="ArrayMesh" uid="uid://cr0oere8ykvyw" path="res://resource/mesh_level/h_block_center_half.vox" id="8_4npd3"]
[ext_resource type="ArrayMesh" uid="uid://cmei6mojx4han" path="res://resource/mesh_level/h_wood_floor1.vox" id="9_loom3"]
[ext_resource type="ArrayMesh" uid="uid://dxhtmci2c1kn4" path="res://resource/mesh_level/h_wood_floor2.vox" id="10_72s0a"]
[ext_resource type="PackedScene" uid="uid://bb3rddqjm47aw" path="res://resource/mesh_library/block_empty.tscn" id="11_ppx7j"]
[ext_resource type="ArrayMesh" uid="uid://48vrhuyvto7c" path="res://resource/mesh_level/n_empty.vox" id="12_ggfpd"]
[ext_resource type="ArrayMesh" uid="uid://h5otvw5f0irr" path="res://resource/mesh_level/s_window1.vox" id="13_yyvao"]
[ext_resource type="ArrayMesh" uid="uid://ka07hfn33kq0" path="res://resource/mesh_level/s_window2.vox" id="14_t7xve"]
[node name="MeshLib" type="Node3D"]
script = ExtResource("1_7xp6b")
[node name="f_block_air" parent="." instance=ExtResource("2_xn8cf")]
mesh = ExtResource("3_rgsxo")
[node name="f_block_center" parent="." instance=ExtResource("2_xn8cf")]
mesh = ExtResource("4_l6isk")
[node name="f_block_corner" parent="." instance=ExtResource("2_xn8cf")]
mesh = ExtResource("5_0rc2s")
[node name="f_block_edge" parent="." instance=ExtResource("2_xn8cf")]
mesh = ExtResource("6_7adng")
[node name="h_block_center_half" parent="." instance=ExtResource("7_2wb1i")]
mesh = ExtResource("8_4npd3")
[node name="h_wood_floor1" parent="." instance=ExtResource("7_2wb1i")]
mesh = ExtResource("9_loom3")
[node name="h_wood_floor2" parent="." instance=ExtResource("7_2wb1i")]
mesh = ExtResource("10_72s0a")
[node name="n_empty" parent="." instance=ExtResource("11_ppx7j")]
mesh = ExtResource("12_ggfpd")
[node name="s_window1" parent="." instance=ExtResource("11_ppx7j")]
mesh = ExtResource("13_yyvao")
[node name="s_window2" parent="." instance=ExtResource("11_ppx7j")]
mesh = ExtResource("14_t7xve")

@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=3 uid="uid://kdji1jrwtwgs"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_1kov1"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_gdrhl"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_1kov1")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 3.6)
use_collision = true
size = Vector3(12.8, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource("2_gdrhl")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 7, 0)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=3 uid="uid://sqnwt5uomaj5"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_oh7rk"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_xalwl"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_oh7rk")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.4, -1, 7.2)
use_collision = true
size = Vector3(12.8, 2, 14.4)
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource("2_xalwl")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(1, 1, 1048587, 2, 1, 1048587, 3, 1, 1048587, 13, 1, 1048587, 15, 1, 1048587, 3, 0, 1048586, 2, 0, 1048586, 1, 0, 1048586, 4, 0, 1048586)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=3 uid="uid://bcpeytx43jpd6"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_8qie0"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_0qnfg"]
[node name="Level" type="Node3D"]
[node name="RoomInstance" parent="." instance=ExtResource("1_8qie0")]
[node name="Light" type="Node3D" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Light"]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 0, 0)
shadow_enabled = true
shadow_transmittance_bias = -16.0
shadow_opacity = 0.5
shadow_blur = 0.0
[node name="Ground" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 19.2, -1, 3.6)
use_collision = true
size = Vector3(38.4, 2, 7.2)
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource("2_0qnfg")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 15, 10, 917504, 14, 10, 917504, 13, 10, 917504, 12, 10, 917504, 11, 10, 917504, 8, 10, 917504, 7, 10, 917504, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 917504, 1, 65535, 917504, 2, 65535, 917504, 3, 65535, 917504, 4, 65535, 917504, 5, 65535, 917504, 6, 65535, 917504, 7, 65535, 917504, 8, 65535, 917504, 9, 65535, 917504, 12, 65535, 917504, 13, 65535, 917504, 14, 65535, 917504, 15, 65535, 917504, 16, 65535, 917504, 17, 65535, 917504, 18, 65535, 917504, 19, 65535, 917504, 10, 65535, 917504, 11, 65535, 917504, 20, 65535, 917504, 21, 65535, 917504, 22, 65535, 917504, 23, 65535, 917504, 24, 65535, 917504, 25, 65535, 917504, 34, 65535, 1245184, 35, 65535, 917504, 36, 65535, 917504, 37, 65535, 917504, 38, 65535, 917504, 39, 65535, 917504, 39, 10, 917504, 38, 10, 917504, 37, 10, 917504, 36, 10, 917504, 35, 10, 917504, 34, 10, 917504, 29, 10, 917504, 28, 10, 917504, 27, 10, 917504, 26, 10, 917504, 25, 10, 917504, 24, 10, 917504, 23, 10, 917504, 22, 10, 917504, 21, 10, 917504, 20, 10, 917504, 9, 10, 917504, 10, 10, 917504, 40, 65535, 1245184, 41, 65535, 1245184, 42, 65535, 1245184, 43, 65535, 1245184, 44, 65535, 1245184, 45, 65535, 1245184, 46, 65535, 1245184, 47, 65535, 1245184, 48, 65535, 1245184, 59, 65535, 1245184, 58, 65535, 1245184, 57, 65535, 1245184, 56, 65535, 1245184, 55, 65535, 1245184, 54, 65535, 1245184, 53, 65535, 1245184, 52, 65535, 1245184, 51, 65535, 1245184, 50, 65535, 1245184, 49, 65535, 1245184, 59, 0, 1245184, 59, 1, 1245184, 59, 2, 1245184, 59, 3, 1245184, 59, 6, 1245184, 59, 7, 1245184, 59, 8, 1245184, 59, 9, 1245184, 59, 10, 1245184, 58, 10, 1245184, 57, 10, 1245184, 56, 10, 1245184, 55, 10, 1245184, 54, 10, 1245184, 53, 10, 1245184, 52, 10, 1245184, 51, 10, 1245184, 50, 10, 1245184, 49, 10, 1245184, 48, 10, 1245184, 47, 10, 1245184, 46, 10, 1245184, 45, 10, 1245184, 44, 10, 1245184, 43, 10, 1245184, 42, 10, 1245184, 41, 10, 1245184, 40, 10, 1245184, 0, 0, 1245184, 0, 1, 1245184, 0, 2, 1245184, 0, 3, 1245184, 0, 6, 1245184, 0, 7, 1245184, 0, 8, 1245184, 0, 9, 1245184, 26, 65535, 1245184, 27, 65535, 1245184, 33, 65535, 1245184, 32, 65535, 1245184)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://blcei7idgavbg"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_pwg14"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_4ejwk"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_4ejwk"]
[node name="Level" type="Node3D"]
@ -33,4 +33,4 @@ cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 1, 917504, 0, 0, 917504, 19, 1, 917504, 19, 0, 917504, 19, 2, 0, 19, 3, 0, 19, 7, 917504, 19, 8, 0, 19, 9, 0, 19, 10, 0, 18, 10, 0, 17, 10, 0, 16, 10, 0, 0, 2, 917504, 0, 3, 917504, 0, 9, 917504, 0, 5, 917504, 0, 4, 917504, 15, 10, 0, 14, 10, 0, 13, 10, 0, 12, 10, 0, 11, 10, 0, 8, 10, 0, 7, 10, 0, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 917504, 1, 65535, 917504, 2, 65535, 917504, 3, 65535, 917504, 4, 65535, 917504, 5, 65535, 917504, 6, 65535, 917504, 7, 65535, 917504, 8, 65535, 917504, 9, 65535, 917504, 12, 65535, 917504, 13, 65535, 917504, 14, 65535, 917504, 15, 65535, 917504, 16, 65535, 917504, 65549, 65535, 917507, 65550, 65535, 917507, 65551, 65535, 917507, 65552, 65535, 917507, 65553, 65535, 917507, 65554, 65535, 917507, 131084, 65535, 917507, 131085, 65535, 917507, 131086, 65535, 917507, 131087, 65535, 917507, 131088, 65535, 917507, 131089, 65535, 917507, 131090, 65535, 917507, 9, 10, 917504, 10, 10, 917504, 19, 6, 917504, 19, 5, 917504, 19, 4, 917504, 19, 65535, 917504, 18, 65535, 917504, 17, 65535, 917504, 11, 65535, 917504, 10, 65535, 917504, 0, 6, 917504, 0, 7, 917504, 0, 8, 917504, 65545, 65535, 917504, 131081, 65535, 917504, 131080, 65535, 917504, 131079, 65535, 917504, 131078, 65535, 917504, 131077, 65535, 917504, 131076, 65535, 917504, 131075, 65535, 917504, 131074, 65535, 917504, 131073, 65535, 917504, 131072, 65535, 917504, 65544, 65535, 917504, 65543, 65535, 917504, 65634, 7, 917504, 65542, 65535, 917504, 65541, 65535, 917504, 65540, 65535, 917504, 65538, 65535, 917504, 65537, 65535, 917504, 65536, 65535, 917504, 65539, 65535, 917504, 65547, 65535, 917507, 65546, 65535, 917507, 65548, 65535, 917507, 131083, 65535, 917507, 131082, 65535, 917507, 196609, 65535, 786432, 196610, 65535, 786432, 196613, 65535, 196608, 196616, 65535, 196608, 196615, 65535, 196608, 196612, 65535, 196608, 196611, 65535, 262144, 196614, 65535, 262144, 65555, 65535, 262144, 131091, 65535, 262144, 196627, 65535, 262144, 196618, 65535, 917507, 196619, 65535, 917507, 196620, 65535, 917507, 196621, 65535, 917507, 196622, 65535, 917507, 196623, 65535, 917507, 196624, 65535, 917507, 196625, 65535, 917507, 196626, 65535, 917507, 262163, 65535, 196608, 262162, 65535, 196608, 262161, 65535, 196608, 262160, 65535, 196608, 262159, 65535, 196608, 262158, 65535, 196608, 262157, 65535, 196608, 262156, 65535, 196608, 262155, 65535, 196608, 262154, 65535, 196608, 262150, 65535, 196608, 262151, 65535, 196608, 262152, 65535, 196608, 262153, 65535, 196608, 262149, 65535, 196608, 262148, 65535, 196608, 262147, 65535, 196608, 262144, 65535, 196608, 262145, 65535, 196608, 262146, 65535, 196608, 196608, 65535, 196608, 196617, 65535, 196608, 196615, 0, 786436, 196612, 0, 786436, 196609, 0, 786436, 196610, 0, 917508, 196613, 0, 917508, 196616, 0, 917508)
}
metadata/_editor_floor_ = Vector3(0, 1, 0)
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://cmyn7g0lp71uj"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_m78sp"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_fqw73"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_fqw73"]
[node name="Level" type="Node3D"]
@ -21,7 +21,4 @@ size = Vector3(12.8, 2, 14.4)
[node name="GridMap" type="GridMap" parent="."]
mesh_library = ExtResource("2_fqw73")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(19, 7, 917504, 19, 8, 917504, 19, 9, 0, 19, 10, 0, 0, 2, 917504, 0, 3, 917504, 0, 9, 917504, 0, 5, 917504, 0, 4, 917504, 0, 65535, 1376258, 1, 65535, 1376258, 2, 65535, 1048582, 3, 65535, 1048582, 4, 65535, 1048582, 5, 65535, 1048582, 6, 65535, 1048582, 7, 65535, 1048582, 12, 65535, 1048582, 13, 65535, 1048582, 14, 65535, 1048582, 15, 65535, 1048582, 16, 65535, 1048582, 17, 65535, 1048582, 18, 65535, 1048582, 19, 65535, 1048582, 19, 21, 2, 17, 21, 0, 18, 21, 0, 16, 21, 0, 15, 21, 0, 14, 21, 0, 13, 21, 0, 12, 21, 0, 7, 21, 0, 6, 21, 0, 5, 21, 0, 4, 21, 0, 3, 21, 0, 2, 21, 0, 1, 21, 0, 0, 21, 0, 0, 6, 917504, 0, 7, 917504, 0, 8, 917504, 11, 65535, 1048582, 8, 65535, 917504, 19, 2, 917504, 19, 3, 917504, 19, 4, 917504, 19, 5, 917504, 19, 6, 917504, 1, 1, 1048587, 2, 1, 1048587, 3, 1, 1048587, 4, 1, 1048587, 5, 1, 1048587, 6, 1, 1048587, 7, 1, 1048587, 8, 1, 1048587, 9, 1, 1048587, 10, 1, 1048587, 11, 1, 1048587, 12, 1, 1048587, 13, 1, 1048587, 14, 1, 1048587, 15, 1, 1048587, 15, 0, 1048587, 16, 0, 1048586, 17, 0, 1048586, 17, 1, 1048587, 16, 1, 1048587, 18, 1, 1048587, 19, 1, 1048587, 14, 0, 1048586, 13, 0, 1048586, 12, 0, 1048586, 11, 0, 1048586, 10, 65535, 1048586, 9, 65535, 1048586, 10, 0, 1048586, 9, 0, 1048586, 8, 0, 1048586, 7, 0, 1048586, 6, 0, 1048586, 3, 0, 1048586, 2, 0, 1048586, 1, 0, 1048586, 4, 0, 1048586, 5, 0, 1048586, 18, 0, 1048586, 19, 0, 1048586, 0, 1, 1048586, 0, 0, 1048586)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://hhl8u75m4bgu"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_yj4gm"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_q76ck"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_q76ck"]
[node name="Level" type="Node3D"]

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://viwd61u8u8h0"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_3iffo"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_dx1b7"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_dx1b7"]
[node name="Level" type="Node3D"]
@ -25,6 +25,6 @@ size = Vector3(12.8, 2, 7.2)
mesh_library = ExtResource("2_dx1b7")
cell_size = Vector3(0.64, 0.64, 0.64)
data = {
"cells": PackedInt32Array(0, 1, 655362, 0, 0, 0, 19, 1, 0, 19, 0, 0, 19, 2, 0, 19, 3, 0, 19, 7, 0, 19, 8, 0, 19, 9, 0, 19, 10, 1245184, 18, 10, 1245184, 17, 10, 1245184, 16, 10, 1245184, 0, 2, 655362, 0, 3, 655362, 0, 9, 655362, 0, 5, 655362, 0, 4, 655362, 15, 10, 1245184, 14, 10, 1245184, 13, 10, 0, 12, 10, 0, 11, 10, 0, 8, 10, 0, 7, 10, 0, 6, 10, 0, 5, 10, 0, 4, 10, 0, 3, 10, 0, 2, 10, 0, 1, 10, 0, 0, 10, 0, 0, 65535, 1376258, 1, 65535, 1376258, 2, 65535, 1376258, 3, 65535, 1376258, 4, 65535, 1376258, 5, 65535, 1376258, 6, 65535, 1376258, 7, 65535, 1376258, 8, 65535, 1376258, 9, 65535, 1376258, 12, 65535, 1376258, 13, 65535, 1376258, 14, 65535, 1376258, 15, 65535, 1376258, 16, 65535, 1376258, 17, 65535, 1376258, 18, 65535, 1376258, 19, 65535, 1376258, 0, 11, 1245184, 1, 11, 1245184, 2, 11, 1245184, 3, 11, 1245184, 4, 11, 1245184, 5, 11, 1245184, 6, 11, 1245184, 7, 11, 1245184, 8, 11, 1245184, 11, 11, 1245184, 12, 11, 1245184, 13, 11, 1245184, 14, 11, 1245184, 15, 11, 1245184, 16, 11, 1245184, 17, 11, 1245184, 18, 11, 1245184, 19, 11, 1245184)
"cells": PackedInt32Array(19, 7, 0)
}
metadata/_editor_floor_ = Vector3(0, 0, 0)

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://b1kdn2586jbdn"]
[ext_resource type="PackedScene" uid="uid://do7abukgd54js" path="res://addons/MetroidvaniaSystem/Nodes/RoomInstance.tscn" id="1_wnjhu"]
[ext_resource type="MeshLibrary" uid="uid://bbya6804fmu42" path="res://resource/mesh_library/default.tres" id="2_qax75"]
[ext_resource type="MeshLibrary" uid="uid://bhmla7vrwht8d" path="res://resource/mesh_library/mesh_library.tres" id="2_qax75"]
[node name="Level" type="Node3D"]

@ -8,7 +8,7 @@ func snap_vector3(value:Vector3) -> Vector3:
return Vector3(snap_float(value.x),snap_float(value.y),snap_float(value.z))
func snap_float(value:float) -> float:
return floor(value/Setting.pixel_size)*Setting.pixel_size
return floor(value/Setting.pixel_size) * Setting.pixel_size
func vector_reduce(vector:Vector2,reduce:float) -> Vector2:
var len = vector.length()
@ -35,6 +35,36 @@ func refresh_animation_lib():
animation_library.animation_added.emit(animation_name)
ResourceSaver.save(animation_library,animation_library_path)
func refresh_mesh_library(path_list:Array):
var default_shape_full = [load("res://resource/mesh_library/default_shape_full.tres") as Shape3D]
var default_shape_half = [load("res://resource/mesh_library/default_shape_half.tres") as Shape3D]
var mesh_library = load("res://resource/mesh_library/mesh_library.tres") as MeshLibrary
for file_name_full in path_list:
var mesh_name = file_name_full.get_file().split('-')[0].trim_suffix('.vox')
print(mesh_name)
var mesh = load(file_name_full) as Mesh
var mesh_id = mesh_library.find_item_by_name(mesh_name)
if mesh_id == -1:
mesh_id = mesh_library.get_last_unused_item_id()
mesh_library.create_item(mesh_id)
mesh_library.set_item_name(mesh_id,mesh_name)
mesh_library.set_item_mesh(mesh_id,mesh)
if mesh_name.begins_with("f_"):
mesh_library.set_item_shapes(mesh_id,default_shape_full)
elif mesh_name.begins_with("h_"):
mesh_library.set_item_shapes(mesh_id,default_shape_half)
elif mesh_name.begins_with("s_"):
var new_shape = [mesh.create_convex_shape()]
mesh_library.set_item_shapes(mesh_id,new_shape)
var ids = mesh_library.get_item_list()
var meshes = []
for id in ids:
meshes.append(mesh_library.get_item_mesh(id))
var previews = EditorInterface.make_mesh_previews(meshes, 64)
for i in range(len(ids)):
mesh_library.set_item_preview(ids[i],previews[i])
ResourceSaver.save(mesh_library)
func get_all_player_skill():
var ret = []

@ -9,7 +9,7 @@ extends Node3D
@export var refresh_mesh_lib : bool :
get:return false
set(_value):
process_mesh_lib("res://resource/mesh_level/")
process_mesh_lib("res://resource/mesh_level")
print("done.")
@export var refresh_uid : bool :
@ -19,27 +19,16 @@ extends Node3D
print("done.")
func process_mesh_lib(dir_name: String) -> void:
var mesh_library_path = "res://resource/mesh_library/mesh_library.tscn"
var mesh_library_res = load(mesh_library_path)
var mesh_library = mesh_library_res.instantiate() as MeshLib
add_child(mesh_library)
mesh_library.owner = get_tree().edited_scene_root
mesh_library.name = "MeshLib"
var dir := DirAccess.open(dir_name)
if dir:
dir.list_dir_begin()
var file_name = dir.get_next()
if dir_name.ends_with("/"):
dir_name = dir_name.trim_suffix("/")
while file_name != "":
var file_name_full = dir_name + "/" + file_name
mesh_library.add(file_name_full,file_name)
file_name = dir.get_next()
else:
if not dir:
print("An error occurred when trying to access the path: ", dir_name)
mesh_library_res.pack(mesh_library)
ResourceSaver.save(mesh_library_res)
remove_child(mesh_library)
return
var path_list = []
dir.list_dir_begin()
for file_name in dir.get_files():
if file_name.ends_with(".vox"):
path_list.append(dir_name + "/" + file_name)
Util.refresh_mesh_library(path_list)
func process_dir(dir_name: String) -> void:
var dir := DirAccess.open(dir_name)

@ -1,28 +0,0 @@
@tool
extends Node3D
class_name MeshLib
var block_full = preload("res://resource/mesh_library/block_full.tscn")
var block_half = preload("res://resource/mesh_library/block_half.tscn")
var block_empty = preload("res://resource/mesh_library/block_empty.tscn")
func add(file_name_full:String,file_name:String):
if not file_name.ends_with(".vox"):
return
var resource_name = file_name.trim_suffix('.vox')
if find_child(resource_name,false,false):
return
var template:MeshInstance3D
if file_name.begins_with("f_"):
template = block_full.instantiate() as MeshInstance3D
elif file_name.begins_with("h_"):
template = block_half.instantiate() as MeshInstance3D
else:
template = block_empty.instantiate() as MeshInstance3D
var mesh = load(file_name_full) as Mesh
template.name = resource_name
template.mesh = mesh
add_child(template)
template.owner = self
print(file_name)
Loading…
Cancel
Save