refactor: re-layput project

- move assets (raw jsons, icons, meshes and i18n data) into the root of repo.
- move script into the root of repo.
- modify blender manifest according to this changes.
- optimize gitignore.
This commit is contained in:
2025-07-24 09:39:38 +08:00
parent 9f591113f8
commit 0ae95e927f
132 changed files with 9304 additions and 4329 deletions

13
bbp_ng/.gitignore vendored
View File

@ -1,20 +1,15 @@
## ===== Personal =====
# Do not include PyBMap in this repository.
# Order build fetch it manually.
# Order user build and fetch it manually.
PyBMap/
# Disable generated icons and jsons but keep the directory hierarchy.
# Disable generated assets but keep the directory hierarchy.
icons/*
!icons/.gitkeep
jsons/*
!jsons/.gitkeep
# Do not include intermidiate translation template (POT)
# NOTE: it seems that Python default gitignore (written following) disable POT file in default.
# so, as it wish, I also remove it from git.
i18n/*
!i18n/blender.pot
!i18n/*.po
meshes/*
!meshes/.gitkeep
## ===== Python =====
# Byte-compiled / optimized / DLL files

View File

@ -124,7 +124,7 @@ def _load_element(mesh: bpy.types.Mesh, element_type: BallanceElementType) -> No
element_filename: str = os.path.join(
os.path.dirname(__file__),
"meshes",
element_name + '.bin'
element_name + '.ph'
)
# open file and read

View File

@ -71,12 +71,8 @@ files = "Import/export Virtools file from/to disk"
[build]
paths_exclude_pattern = [
"__pycache__/", # Python runtime cache
".gitignore", # Git Ignore File
".style.yapf", # Python code style
"*.gitkeep", # Git directory keeper
".gitignore", # Git Ignore File
"*.md", # Useless document.
"/raw_jsons", # Raw JSONs.
"/raw_icons", # Raw Icons.
"/tools", # Assistant tools.
"/i18n", # GNU gettext Translation.
]

File diff suppressed because it is too large Load Diff

0
bbp_ng/meshes/.gitkeep Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

View File

@ -1,7 +0,0 @@
# Raw Icons
This folder contain all images used by this Blender plugin.
This folder should not be distributed in production because all of these files are in original size. It is pretty need too much time to load them in blender.
So we keep these high quality images here and provide a tools in `tools` folder. Builder should run script to generate thumbnails in `icons` folder.
Then this Blender plugin can work normally.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

View File

@ -1,183 +0,0 @@
[
{
"identifier": "raw_floor_1x1",
"showcase": null,
"params": [
{
"field": "height",
"data": "5.0"
},
{
"field": "face",
"data": "(True, False, True, True, True, True)"
},
{
"field": "is_sink",
"data": "False"
}
],
"skip": "False",
"vars": [],
"vertices": [],
"faces": [],
"instances": [
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[3], None)",
"is_sink": "is_sink"
},
"transform": "move(5, 0, 0) @ rot(0, 0, 90)"
},
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[5], None)",
"is_sink": "is_sink"
},
"transform": "move(5, 5, 0) @ rot(0, 0, 180)"
},
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[2], None)",
"is_sink": "is_sink"
},
"transform": "move(0, 5, 0) @ rot(0, 0, 270)"
},
{
"identifier": "cv_triangle_side",
"skip": "False",
"params": {
"edge_length": "5",
"tip_offset": "2.5",
"height": "height",
"face": "(face[0], False, False, False, face[4], None)",
"is_sink": "is_sink"
},
"transform": "ident()"
},
{
"identifier": "floor_rectangle_bottom",
"skip": "not face[1]",
"params": {
"length": "5",
"width": "5"
},
"transform": "move(0, 0, -height)"
}
]
},
{
"identifier": "floor_normal_1x1",
"showcase": {
"title": "Normal 1x1",
"icon": "Normal1x1",
"type": "floor",
"cfgs": [
{
"field": "height_",
"type": "float",
"title": "Height",
"desc": "The height of block.",
"default": "5.0"
},
{
"field": "face_",
"type": "face",
"title": "Face",
"desc": "Whether has some faces.",
"default": "(True, False, True, True, True, True)"
}
]
},
"params": [
{
"field": "height",
"data": "height_"
},
{
"field": "face",
"data": "face_"
}
],
"skip": "False",
"vars": [],
"vertices": [],
"faces": [],
"instances": [
{
"identifier": "raw_floor_1x1",
"skip": "False",
"params": {
"height": "height",
"face": "face",
"is_sink": "False"
},
"transform": "ident()"
}
]
},
{
"identifier": "floor_sink_1x1",
"showcase": {
"title": "Sink 1x1",
"icon": "Sink1x1",
"type": "floor",
"cfgs": [
{
"field": "height_",
"type": "float",
"title": "Height",
"desc": "The height of block.",
"default": "5.0"
},
{
"field": "face_",
"type": "face",
"title": "Face",
"desc": "Whether has some faces.",
"default": "(True, False, True, True, True, True)"
}
]
},
"params": [
{
"field": "height",
"data": "height_"
},
{
"field": "face",
"data": "face_"
}
],
"skip": "False",
"vars": [],
"vertices": [],
"faces": [],
"instances": [
{
"identifier": "raw_floor_1x1",
"skip": "False",
"params": {
"height": "height",
"face": "face",
"is_sink": "True"
},
"transform": "ident()"
}
]
}
]

Some files were not shown because too many files have changed in this diff Show More