Update
This commit is contained in:
@@ -36,7 +36,7 @@ def open_as_dialog(parent, matcher, result_callback):
|
||||
window.close()
|
||||
|
||||
def save_defaults():
|
||||
if not yesNo("Save current settings as default?"):
|
||||
if not yesNo("将当前设置保存为默认设置?"):
|
||||
return
|
||||
config.mirrorInfluencesDefaults = matcher.config.as_json()
|
||||
|
||||
@@ -47,18 +47,18 @@ def open_as_dialog(parent, matcher, result_callback):
|
||||
|
||||
return widgets.button_row(
|
||||
[
|
||||
("Apply", apply),
|
||||
("Cancel", window.close),
|
||||
("应用", apply),
|
||||
("取消", window.close),
|
||||
],
|
||||
side_menu=[
|
||||
("Save As Default", save_defaults),
|
||||
("Load Defaults", load_defaults),
|
||||
("储存为默认值", save_defaults),
|
||||
("加载默认值", load_defaults),
|
||||
],
|
||||
)
|
||||
|
||||
window = QtWidgets.QDialog(parent)
|
||||
cleanup.registerCleanupHandler(window.close)
|
||||
window.setWindowTitle("Influence Mirror Mapping")
|
||||
window.setWindowTitle("影响镜像映射")
|
||||
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
||||
window.resize(720 * scale_multiplier, 500 * scale_multiplier)
|
||||
window.setLayout(QtWidgets.QVBoxLayout())
|
||||
@@ -102,10 +102,10 @@ def build_ui(parent, matcher):
|
||||
split_path = path.rsplit("|", 1)
|
||||
parent_path, name = split_path if len(split_path) == 2 else ["", split_path[0]]
|
||||
|
||||
item = QtWidgets.QTreeWidgetItem([name, '-', '(not in skin cluster)' if is_intermediate else '?'])
|
||||
item = QtWidgets.QTreeWidgetItem([name, '-', '(不在皮肤簇中)' if is_intermediate else '?'])
|
||||
tree_items[path] = item
|
||||
|
||||
parent_item = None if parent_path == "" else find_item(parent_path, True)
|
||||
parent_item = None if parent_path is "" else find_item(parent_path, True)
|
||||
|
||||
if parent_item is not None:
|
||||
parent_item.addChild(item)
|
||||
@@ -142,7 +142,7 @@ def build_ui(parent, matcher):
|
||||
def pattern():
|
||||
result = QtWidgets.QTableWidget()
|
||||
result.setColumnCount(2)
|
||||
result.setHorizontalHeaderLabels(["Pattern", "Opposite"] if mirror_mode else ["Source", "Destination"])
|
||||
result.setHorizontalHeaderLabels(["左", "右"] if mirror_mode else ["来源", "目标"])
|
||||
result.setEditTriggers(QtWidgets.QTableWidget.AllEditTriggers)
|
||||
|
||||
result.verticalHeader().setVisible(False)
|
||||
@@ -209,12 +209,12 @@ def build_ui(parent, matcher):
|
||||
|
||||
def automaticRules():
|
||||
form = QtWidgets.QFormLayout()
|
||||
use_joint_names = QtWidgets.QCheckBox("Match by joint name")
|
||||
use_joint_names = QtWidgets.QCheckBox("匹配骨骼名称")
|
||||
naming_patterns = pattern()
|
||||
use_position = QtWidgets.QCheckBox("Match by position")
|
||||
use_position = QtWidgets.QCheckBox("匹配位置")
|
||||
tolerance_scroll = tolerance()
|
||||
use_joint_labels = QtWidgets.QCheckBox("Match by joint label")
|
||||
use_dg_links = QtWidgets.QCheckBox("Match by dependency graph links")
|
||||
use_joint_labels = QtWidgets.QCheckBox("匹配骨骼标签")
|
||||
use_dg_links = QtWidgets.QCheckBox("匹配依存关系图连接")
|
||||
|
||||
def update_enabled_disabled():
|
||||
def enable_form_row(form_item, e):
|
||||
@@ -260,27 +260,27 @@ def build_ui(parent, matcher):
|
||||
use_dg_links.setChecked(matcher.config.use_dg_link_matching)
|
||||
update_enabled_disabled()
|
||||
|
||||
g = QtWidgets.QGroupBox("Rules")
|
||||
g = QtWidgets.QGroupBox("规则")
|
||||
g.setLayout(form)
|
||||
form.addRow(use_dg_links)
|
||||
form.addRow("Attribute name:", dg_attribute)
|
||||
form.addRow("属性名称:", dg_attribute)
|
||||
form.addRow(use_joint_labels)
|
||||
form.addRow(use_joint_names)
|
||||
form.addRow("Naming scheme:", naming_patterns)
|
||||
form.addRow("命名方案:", naming_patterns)
|
||||
form.addRow(use_position)
|
||||
form.addRow("Position tolerance:", tolerance_scroll.layout())
|
||||
form.addRow("位置容差:", tolerance_scroll.layout())
|
||||
|
||||
update_values()
|
||||
return g
|
||||
|
||||
def scriptedRules():
|
||||
g = QtWidgets.QGroupBox("Scripted rules")
|
||||
g = QtWidgets.QGroupBox("脚本规则")
|
||||
g.setLayout(QtWidgets.QVBoxLayout())
|
||||
g.layout().addWidget(QtWidgets.QLabel("TODO"))
|
||||
return g
|
||||
|
||||
def manualRules():
|
||||
g = QtWidgets.QGroupBox("Manual overrides")
|
||||
g = QtWidgets.QGroupBox("手动覆盖")
|
||||
g.setLayout(QtWidgets.QVBoxLayout())
|
||||
g.layout().addWidget(QtWidgets.QLabel("TODO"))
|
||||
return g
|
||||
@@ -302,7 +302,7 @@ def build_ui(parent, matcher):
|
||||
def createMappingView():
|
||||
view = QtWidgets.QTreeWidget()
|
||||
view.setColumnCount(3)
|
||||
view.setHeaderLabels(["Source", "Destination", "Matched by rule"])
|
||||
view.setHeaderLabels(["来源", "目标", "按规则匹配"])
|
||||
view.setIndentation(7)
|
||||
view.setExpandsOnDoubleClick(False)
|
||||
|
||||
@@ -316,14 +316,14 @@ def build_ui(parent, matcher):
|
||||
:type mapping: dict[InfluenceInfo, InfluenceInfo]
|
||||
"""
|
||||
for treeItem in list(usedItems.values()):
|
||||
treeItem.setText(1, "(not matched)")
|
||||
treeItem.setText(1, "(不匹配)")
|
||||
treeItem.setText(2, "")
|
||||
|
||||
for k, v in list(mapping.items()):
|
||||
treeItem = usedItems.get(k.path_name(), None)
|
||||
if treeItem is None:
|
||||
continue
|
||||
treeItem.setText(1, "(self)" if k == v['infl'] else v["infl"].shortestPath)
|
||||
treeItem.setText(1, "(自己)" if k == v['infl'] else v["infl"].shortestPath)
|
||||
treeItem.setText(2, v["matchedRule"])
|
||||
treeItem.setData(1, linkedItemRole, v["infl"].path)
|
||||
|
||||
@@ -343,7 +343,7 @@ def build_ui(parent, matcher):
|
||||
matches = matcher.calculate()
|
||||
mappingView_updateMatches(matches)
|
||||
|
||||
g = QtWidgets.QGroupBox("Calculated mapping")
|
||||
g = QtWidgets.QGroupBox("计算映射")
|
||||
g.setLayout(QtWidgets.QVBoxLayout())
|
||||
mappingView, mappingView_updateMatches = createMappingView()
|
||||
g.layout().addWidget(mappingView)
|
||||
|
||||
Reference in New Issue
Block a user