This commit is contained in:
2026-01-22 00:06:13 +08:00
parent f26fc95ea3
commit ed7476e54b
316 changed files with 4962 additions and 14039 deletions

View File

@@ -50,14 +50,14 @@ def build_ui(parent, global_actions):
t.addAction(a)
t = QtWidgets.QToolBar()
create_brush_mode_button(t, PaintMode.replace, "Replace", "Whatever")
create_brush_mode_button(t, PaintMode.add, "Add", "")
create_brush_mode_button(t, PaintMode.scale, "Scale", "")
create_brush_mode_button(t, PaintMode.replace, "替换", "替换")
create_brush_mode_button(t, PaintMode.add, "添加", "")
create_brush_mode_button(t, PaintMode.scale, "减少", "")
row.addWidget(t)
t = QtWidgets.QToolBar()
create_brush_mode_button(t, PaintMode.smooth, "Smooth", "")
create_brush_mode_button(t, PaintMode.sharpen, "Sharpen", "")
create_brush_mode_button(t, PaintMode.smooth, "平滑", "")
create_brush_mode_button(t, PaintMode.sharpen, "锐化", "")
row.addWidget(t)
@on_signal(et.tool_settings_changed, scope=row)
@@ -96,9 +96,9 @@ def build_ui(parent, global_actions):
update_to_tool()
qt.on(a.toggled)(toggled)
add_brush_shape_action(':/circleSolid.png', 'Solid', BrushShape.solid, checked=True)
add_brush_shape_action(':/circlePoly.png', 'Smooth', BrushShape.smooth)
add_brush_shape_action(':/circleGaus.png', 'Gaus', BrushShape.gaus)
add_brush_shape_action(':/circleSolid.png', '硬边圆', BrushShape.solid, checked=True)
add_brush_shape_action(':/circlePoly.png', '软边圆', BrushShape.smooth)
add_brush_shape_action(':/circleGaus.png', '喷枪', BrushShape.gaus)
return result
@@ -136,23 +136,23 @@ def build_ui(parent, global_actions):
update_to_tool()
add(
'Surface',
'Using first surface hit under the mouse, update all nearby vertices that are connected by surface to the hit location. '
+ 'Only current shell will be updated.',
'表面',
'绘制由与曲面相连的模型顶点.'
+ '仅更新当前shell.',
BrushProjectionMode.surface,
use_volume=False,
checked=True,
)
add(
'Volume',
'Using first surface hit under the mouse, update all nearby vertices, including those from other shells.',
'体积',
'绘制附近所有模型顶点,包括没有连接的顶点.',
BrushProjectionMode.surface,
use_volume=True,
checked=False,
)
add(
'Screen',
'Use screen projection of a brush, updating all vertices on all surfaces that are within the brush radius.',
'屏幕',
'从屏幕方向投影到笔刷半径内所有曲面上的顶点.',
BrushProjectionMode.screen,
use_volume=False,
checked=False,
@@ -163,53 +163,53 @@ def build_ui(parent, global_actions):
def stylus_pressure_selection():
# noinspection PyShadowingNames
result = QtWidgets.QComboBox()
result.addItem("Unused")
result.addItem("Multiply intensity")
result.addItem("Multiply opacity")
result.addItem("Multiply radius")
result.addItem("未使用")
result.addItem("倍增强度")
result.addItem("倍增不透明度")
result.addItem("倍增半径")
return result
layout = QtWidgets.QVBoxLayout()
layout.addLayout(createTitledRow("Brush projection:", brush_projection_mode_row()))
layout.addLayout(createTitledRow("Brush mode:", brush_mode_row3()))
layout.addLayout(createTitledRow("Brush shape:", brush_shape_row()))
layout.addLayout(createTitledRow("笔刷投影:", brush_projection_mode_row()))
layout.addLayout(createTitledRow("笔刷模式:", brush_mode_row3()))
layout.addLayout(createTitledRow("笔刷形状:", brush_shape_row()))
intensity = widgets.NumberSliderGroup()
radius = widgets.NumberSliderGroup(
max_value=100, tooltip="You can also set brush radius by just holding <b>B</b> " "and mouse-dragging in the viewport"
max_value=100, tooltip="可以通过在视口中按住 <b>B</b> " "并鼠标左键按住拖动来设置笔刷半径"
)
iterations = widgets.NumberSliderGroup(value_type=int, min_value=1, max_value=100)
layout.addLayout(createTitledRow("Intensity:", intensity.layout()))
layout.addLayout(createTitledRow("Brush radius:", radius.layout()))
layout.addLayout(createTitledRow("Brush iterations:", iterations.layout()))
layout.addLayout(createTitledRow("强度:", intensity.layout()))
layout.addLayout(createTitledRow("笔刷半径:", radius.layout()))
layout.addLayout(createTitledRow("笔刷迭代次数:", iterations.layout()))
influences_limit = widgets.NumberSliderGroup(value_type=int, min_value=0, max_value=10)
layout.addLayout(createTitledRow("Influences limit:", influences_limit.layout()))
layout.addLayout(createTitledRow("影响物限制:", influences_limit.layout()))
@signal.on(influences_limit.valueChanged)
def influences_limit_changed():
paint.influences_limit = influences_limit.value()
update_ui()
fixed_influences = QtWidgets.QCheckBox("Only adjust existing vertex influences")
fixed_influences = QtWidgets.QCheckBox("仅调整顶点现有影响物,防止周围权重扩散")
fixed_influences.setToolTip(
"When this option is enabled, smooth will only adjust existing influences per vertex, "
"and won't include other influences from nearby vertices"
"启用此选项后,平滑-将仅调整每个顶点的现有影响物, "
"而不会包含来自附近顶点的影响物,防止周围权重扩散"
)
layout.addLayout(createTitledRow("Weight bleeding:", fixed_influences))
layout.addLayout(createTitledRow("平滑辅助:", fixed_influences))
@qt.on(fixed_influences.stateChanged)
def fixed_influences_changed():
paint.fixed_influences_per_vertex = fixed_influences.isChecked()
limit_to_component_selection = QtWidgets.QCheckBox("Limit to component selection")
limit_to_component_selection.setToolTip("When this option is enabled, smoothing will only happen between selected components")
layout.addLayout(createTitledRow("Isolation:", limit_to_component_selection))
limit_to_component_selection = QtWidgets.QCheckBox("限制在选中组件中平滑")
limit_to_component_selection.setToolTip("启用此选项后,仅在选定组件之间进行平滑")
layout.addLayout(createTitledRow("隔离选中组件:", limit_to_component_selection))
@qt.on(limit_to_component_selection.stateChanged)
def limit_to_component_selection_changed():
paint.limit_to_component_selection = limit_to_component_selection.isChecked()
interactive_mirror = QtWidgets.QCheckBox("Interactive mirror")
interactive_mirror = QtWidgets.QCheckBox("交互式镜像")
layout.addLayout(createTitledRow("", interactive_mirror))
@qt.on(interactive_mirror.stateChanged)
@@ -217,7 +217,7 @@ def build_ui(parent, global_actions):
paint.mirror = interactive_mirror.isChecked()
update_ui()
sample_joint_on_stroke_start = QtWidgets.QCheckBox("Sample current joint on stroke start")
sample_joint_on_stroke_start = QtWidgets.QCheckBox("在笔画开始时取样当前骨骼")
layout.addLayout(createTitledRow("", sample_joint_on_stroke_start))
@qt.on(sample_joint_on_stroke_start.stateChanged)
@@ -225,8 +225,8 @@ def build_ui(parent, global_actions):
paint.sample_joint_on_stroke_start = sample_joint_on_stroke_start.isChecked()
update_ui()
redistribute_removed_weight = QtWidgets.QCheckBox("Distribute to other influences")
layout.addLayout(createTitledRow("Removed weight:", redistribute_removed_weight))
redistribute_removed_weight = QtWidgets.QCheckBox("分配给其它影响物")
layout.addLayout(createTitledRow("移除的权重:", redistribute_removed_weight))
@qt.on(redistribute_removed_weight.stateChanged)
def redistribute_removed_weight_changed():
@@ -234,12 +234,12 @@ def build_ui(parent, global_actions):
update_ui()
stylus = stylus_pressure_selection()
layout.addLayout(createTitledRow("Stylus pressure:", stylus))
layout.addLayout(createTitledRow("手绘板压力:", stylus))
@on_signal(et.tool_settings_changed, scope=layout)
def update_ui():
log.info("updating paint settings ui")
log.info("brush mode:%s, brush shape: %s", paint.mode, paint.brush_shape)
log.info("更新的绘制设置的ui")
log.info("画笔模式:%s, 画笔形状: %s", paint.mode, paint.brush_shape)
paint.update_plugin_brush_radius()
paint.update_plugin_brush_intensity()
@@ -280,7 +280,7 @@ def build_ui(parent, global_actions):
@signal.on(radius.valueChanged, qtParent=layout)
def radius_edited():
log.info("updated brush radius")
log.info("更新笔刷半径")
paint.brush_radius = radius.value()
update_ui()
@@ -301,18 +301,18 @@ def build_ui(parent, global_actions):
update_ui()
result = QtWidgets.QGroupBox("Brush behavior")
result = QtWidgets.QGroupBox("笔刷行为")
result.setLayout(layout)
return result
def build_display_settings():
result = QtWidgets.QGroupBox("Display settings")
result = QtWidgets.QGroupBox("显示设置")
layout = QtWidgets.QVBoxLayout()
influences_display = QtWidgets.QComboBox()
influences_display.addItem("All influences, multiple colors", WeightsDisplayMode.allInfluences)
influences_display.addItem("Current influence, grayscale", WeightsDisplayMode.currentInfluence)
influences_display.addItem("Current influence, colored", WeightsDisplayMode.currentInfluenceColored)
influences_display.addItem("所有权重,多种颜色", WeightsDisplayMode.allInfluences)
influences_display.addItem("当前权重,灰度", WeightsDisplayMode.currentInfluence)
influences_display.addItem("当前权重,彩色", WeightsDisplayMode.currentInfluenceColored)
influences_display.setMinimumWidth(1)
influences_display.setCurrentIndex(paint.display_settings.weights_display_mode)
@@ -327,11 +327,11 @@ def build_ui(parent, global_actions):
display_layout = QtWidgets.QVBoxLayout()
display_layout.addWidget(influences_display)
display_layout.addWidget(display_toolbar)
layout.addLayout(createTitledRow("Influences display:", display_layout))
layout.addLayout(createTitledRow("权重显示:", display_layout))
mask_display = QtWidgets.QComboBox()
mask_display.addItem("Default", MaskDisplayMode.default_)
mask_display.addItem("Color ramp", MaskDisplayMode.color_ramp)
mask_display.addItem("默认", MaskDisplayMode.default_)
mask_display.addItem("彩色渐变", MaskDisplayMode.color_ramp)
mask_display.setMinimumWidth(1)
mask_display.setCurrentIndex(paint.display_settings.weights_display_mode)
@@ -340,14 +340,14 @@ def build_ui(parent, global_actions):
paint.display_settings.mask_display_mode = mask_display.currentData()
update_ui_to_tool()
layout.addLayout(createTitledRow("Mask display:", mask_display))
layout.addLayout(createTitledRow("表面显示:", mask_display))
show_effects = QtWidgets.QCheckBox("Show layer effects")
show_effects = QtWidgets.QCheckBox("显示图层效果")
layout.addLayout(createTitledRow("", show_effects))
show_masked = QtWidgets.QCheckBox("Show masked weights")
show_masked = QtWidgets.QCheckBox("显示蒙皮权重")
layout.addLayout(createTitledRow("", show_masked))
show_selected_verts_only = QtWidgets.QCheckBox("Hide unselected vertices")
show_selected_verts_only = QtWidgets.QCheckBox("隐藏未选择的顶点")
layout.addLayout(createTitledRow("", show_selected_verts_only))
@qt.on(show_effects.stateChanged)
@@ -363,7 +363,7 @@ def build_ui(parent, global_actions):
paint.display_settings.show_selected_verts_only = show_selected_verts_only.isChecked()
mesh_toolbar = QtWidgets.QToolBar()
toggle_original_mesh = QAction("Show Original Mesh", mesh_toolbar)
toggle_original_mesh = QAction("显示原本模型", mesh_toolbar)
toggle_original_mesh.setCheckable(True)
mesh_toolbar.addAction(toggle_original_mesh)
layout.addLayout(createTitledRow("", mesh_toolbar))
@@ -374,7 +374,7 @@ def build_ui(parent, global_actions):
update_ui_to_tool()
wireframe_color_button = widgets.ColorButton()
layout.addLayout(createTitledRow("Wireframe color:", wireframe_color_button))
layout.addLayout(createTitledRow("线框颜色:", wireframe_color_button))
@signal.on(wireframe_color_button.color_changed)
def update_wireframe_color():