mesh lib 工具自动化
parent
4e664e4785
commit
0599289de8
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,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…
Reference in New Issue