Update geometry.py
This commit is contained in:
@@ -224,6 +224,19 @@ class GeometryUI(ui_utils.BaseUI):
|
||||
# 创建8个LOD标签页
|
||||
lod_names = [f"LOD{i}" for i in range(8)]
|
||||
|
||||
# 定义部件名称和显示名称的映射
|
||||
part_display_names = {
|
||||
"Head": "头部",
|
||||
"Teeth": "牙齿",
|
||||
"Saliva": "牙龈",
|
||||
"EyeLeft": "左眼",
|
||||
"EyeRight": "右眼",
|
||||
"Eyeshell": "红脸",
|
||||
"Eyeslashes": "眉毛",
|
||||
"EyesEdge": "眉毛",
|
||||
"Body": "身体"
|
||||
}
|
||||
|
||||
# 创建标签页和内容
|
||||
for lod_name in lod_names:
|
||||
# 创建标签页
|
||||
@@ -235,20 +248,17 @@ class GeometryUI(ui_utils.BaseUI):
|
||||
tab_layout.setContentsMargins(5, 5, 5, 5)
|
||||
tab_layout.setSpacing(5)
|
||||
|
||||
# 创建身体部位输入字段
|
||||
body_parts = [
|
||||
"头部", "牙齿", "牙龈", "左眼", "右眼", "红脸", "眉毛", "眉毛", "躯体"
|
||||
]
|
||||
|
||||
# 根据LOD级别限制显示的身体部位
|
||||
if lod_name in ["LOD0", "LOD1"]:
|
||||
parts_to_show = body_parts
|
||||
if lod_name == "LOD0":
|
||||
parts_to_show = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge", "Body"]
|
||||
elif lod_name == "LOD1":
|
||||
parts_to_show = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge", "Body"]
|
||||
elif lod_name in ["LOD2", "LOD3"]:
|
||||
parts_to_show = body_parts[:8]
|
||||
elif lod_name in ["LOD4", "LOD5"]:
|
||||
parts_to_show = body_parts[:5]
|
||||
else: # LOD6, LOD7
|
||||
parts_to_show = body_parts[:4]
|
||||
parts_to_show = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge"]
|
||||
elif lod_name == "LOD4":
|
||||
parts_to_show = ["Head", "Teeth", "EyeLeft", "EyeRight", "Eyeshell"]
|
||||
else: # LOD5, LOD6, LOD7
|
||||
parts_to_show = ["Head", "Teeth", "EyeLeft", "EyeRight"]
|
||||
|
||||
# 为每个身体部位创建输入字段和加载按钮
|
||||
for part in parts_to_show:
|
||||
@@ -257,7 +267,7 @@ class GeometryUI(ui_utils.BaseUI):
|
||||
part_layout.setSpacing(5)
|
||||
|
||||
# 创建标签
|
||||
label = QtWidgets.QLabel(f"{part}:")
|
||||
label = QtWidgets.QLabel(f"{part_display_names[part]}:")
|
||||
label.setMinimumWidth(40)
|
||||
label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
|
||||
|
||||
@@ -293,17 +303,16 @@ class GeometryUI(ui_utils.BaseUI):
|
||||
self.controls["tab_widget"].addTab(tab, lod_name)
|
||||
|
||||
# 创建清理按钮
|
||||
self.buttons["clear"] = QtWidgets.QPushButton(LANG.get("clear", "清理"))
|
||||
self.buttons["clear"] = QtWidgets.QPushButton(LANG.get("clear", " 清 理 "))
|
||||
self.buttons["clear"].setObjectName("clearButton")
|
||||
self.buttons["clear"].setIcon(ui_utils.load_icon("delete.png"))
|
||||
self.buttons["clear"].setIconSize(QtCore.QSize(16, 16))
|
||||
self.buttons["clear"].setFixedSize(70, 24) # 与加载按钮高度一致
|
||||
self.buttons["clear"].setFixedSize(150, 24) # 与加载按钮高度一致
|
||||
self.buttons["clear"].setToolTip(LANG.get("clear_all_models", "清理所有模型"))
|
||||
# 添加内边距和外边距,使其与加载按钮对齐
|
||||
self.buttons["clear"].setStyleSheet("""
|
||||
QPushButton {
|
||||
padding: 2px 4px;
|
||||
margin: 3px 5px 0px 0px; /* 上右下左的边距,增加上边距避免与标签栏重叠 */
|
||||
padding: 2px 2px;
|
||||
margin: 0px 50px 0px 0px; /* 上右下左的边距,增加上边距避免与标签栏重叠 */
|
||||
}
|
||||
""")
|
||||
self.buttons["clear"].setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
||||
@@ -505,20 +514,32 @@ class GeometryUI(ui_utils.BaseUI):
|
||||
|
||||
# 连接LOD标签页的加载按钮
|
||||
lod_names = [f"LOD{i}" for i in range(8)]
|
||||
body_parts = [
|
||||
"头部", "牙齿", "牙龈", "左眼", "右眼", "红脸", "眉毛", "眉毛", "躯体"
|
||||
]
|
||||
|
||||
# 定义部件名称和显示名称的映射
|
||||
part_display_names = {
|
||||
"Head": "头部",
|
||||
"Teeth": "牙齿",
|
||||
"Saliva": "牙龈",
|
||||
"EyeLeft": "左眼",
|
||||
"EyeRight": "右眼",
|
||||
"Eyeshell": "红脸",
|
||||
"Eyeslashes": "眉毛",
|
||||
"EyesEdge": "眉毛",
|
||||
"Body": "身体"
|
||||
}
|
||||
|
||||
# 根据LOD级别限制连接的身体部位
|
||||
for lod_name in lod_names:
|
||||
if lod_name in ["LOD0", "LOD1"]:
|
||||
parts_to_connect = body_parts
|
||||
if lod_name == "LOD0":
|
||||
parts_to_connect = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge", "Body"]
|
||||
elif lod_name == "LOD1":
|
||||
parts_to_connect = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge", "Body"]
|
||||
elif lod_name in ["LOD2", "LOD3"]:
|
||||
parts_to_connect = body_parts[:8]
|
||||
elif lod_name in ["LOD4", "LOD5"]:
|
||||
parts_to_connect = body_parts[:5]
|
||||
else: # LOD6, LOD7
|
||||
parts_to_connect = body_parts[:4]
|
||||
parts_to_connect = ["Head", "Teeth", "Saliva", "EyeLeft", "EyeRight", "Eyeshell", "Eyeslashes", "EyesEdge"]
|
||||
elif lod_name == "LOD4":
|
||||
parts_to_connect = ["Head", "Teeth", "EyeLeft", "EyeRight", "Eyeshell"]
|
||||
else: # LOD5, LOD6, LOD7
|
||||
parts_to_connect = ["Head", "Teeth", "EyeLeft", "EyeRight"]
|
||||
|
||||
# 连接每个身体部位的加载按钮
|
||||
for part in parts_to_connect:
|
||||
|
Reference in New Issue
Block a user