Update
This commit is contained in:
@@ -24,7 +24,7 @@ def action_copy_cut(session, parent, cut):
|
||||
operation(session.state.currentLayer.layer, influences)
|
||||
|
||||
operation_name = "Cut" if cut else "Copy"
|
||||
result = actions.define_action(parent, operation_name + " weights to clipboard", callback=cut_copy_callback)
|
||||
result = actions.define_action(parent, operation_name + " 将权重复制到剪贴板", callback=cut_copy_callback) # 将权重复制到剪贴板 weights to clipboard
|
||||
|
||||
@signal.on(session.events.currentLayerChanged, session.events.currentInfluenceChanged, qtParent=parent)
|
||||
def on_selection_changed():
|
||||
@@ -49,13 +49,13 @@ def action_paste(session, parent, operation):
|
||||
api.paste_weights(session.state.currentLayer.layer, operation, influences=influences)
|
||||
|
||||
labels = {
|
||||
PasteOperation.add: 'Paste weights (add to existing)',
|
||||
PasteOperation.subtract: 'Paste weight (subtract from existing)',
|
||||
PasteOperation.replace: 'Paste weights (replace existing)',
|
||||
PasteOperation.add: '粘贴权重(添加到现有)',
|
||||
PasteOperation.subtract: '粘贴权重(从现有值中减去)',
|
||||
PasteOperation.replace: '粘贴权重(替换现有)',
|
||||
}
|
||||
|
||||
result = actions.define_action(parent, labels[operation], callback=paste_callback)
|
||||
result.setToolTip("Paste previously copied weights from clipboard")
|
||||
result.setToolTip("从剪贴板粘贴先前复制的权重")
|
||||
|
||||
@signal.on(session.events.currentLayerChanged)
|
||||
def on_selection_changed():
|
||||
|
||||
@@ -31,7 +31,7 @@ def buildAction_export(session, parent):
|
||||
|
||||
result = actions.define_action(
|
||||
parent,
|
||||
"Export Layers to Json...",
|
||||
"导出图层...",
|
||||
callback=export_callback,
|
||||
tooltip="Save layer info to external file, suitable for importing weights to different scene/mesh",
|
||||
)
|
||||
@@ -79,7 +79,7 @@ def buildAction_import(session, parent, file_dialog_func=None):
|
||||
t.customize_callback = transfer_dialog
|
||||
t.execute()
|
||||
|
||||
result = actions.define_action(parent, "Import Layers from Json...", callback=import_callback, tooltip="Load previously exported weights")
|
||||
result = actions.define_action(parent, "导入图层...", callback=import_callback, tooltip="Load previously exported weights")
|
||||
|
||||
@signal.on(session.events.targetChanged, qtParent=parent)
|
||||
def update():
|
||||
|
||||
@@ -28,8 +28,8 @@ def build_action_import_v1(session, parent):
|
||||
update_state()
|
||||
session.events.targetChanged.emitIfChanged()
|
||||
|
||||
result = actions.define_action(parent, "Convert From v1.0 Layers", callback=do_convert)
|
||||
result.setToolTip("Convert skinning layers from previous version of ngSkinTools; after completing this action, v1 nodes will be deleted.")
|
||||
result = actions.define_action(parent, "从v1.0图层转换", callback=do_convert)
|
||||
result.setToolTip("“转化旧版ngSkinTools的图层;完成此操作后,v1节点将被删除。")
|
||||
|
||||
@signal.on(session.events.targetChanged)
|
||||
def update_state():
|
||||
|
||||
@@ -28,7 +28,7 @@ def initializeLayers(createFirstLayer=True):
|
||||
layers = ngSkinTools2.api.init_layers(target)
|
||||
with ngSkinTools2.api.suspend_updates(target):
|
||||
if createFirstLayer:
|
||||
layer = layers.add("Base weights")
|
||||
layer = layers.add("基础权重") #Base weights
|
||||
layer.set_current()
|
||||
Mirror(target).set_mirror_config(config.mirrorInfluencesDefaults)
|
||||
|
||||
@@ -36,7 +36,7 @@ def initializeLayers(createFirstLayer=True):
|
||||
|
||||
if ngSkinTools2.api.is_slow_mode_skin_cluster(target):
|
||||
dialogs.info(
|
||||
"ngSkinTools switched to slow maya API for setting skin cluster weights for this skinCluster, to workaround a Maya bug when skinCluster uses dg nodes as inputs"
|
||||
"切换为设置皮肤集群权重,以解决 Maya皮肤集群使用装点作为输入时的错误。"
|
||||
)
|
||||
|
||||
|
||||
@@ -73,15 +73,15 @@ def build_action_initialize_layers(session, parent):
|
||||
def do_initialize():
|
||||
if import_v1_actions.can_import(session):
|
||||
q = (
|
||||
"Skinning layers from previous version of ngSkinTools are present on this mesh. This operation will initialize "
|
||||
"skinning layers from scratch, discarding previous layers information. Do you want to continue?"
|
||||
"来自旧版 ngSkinTools的皮肤层存在于此网格上。此操作将初始化"
|
||||
"从头开始剥离图层,丢弃之前的图层信息。您要继续吗?"
|
||||
)
|
||||
if not dialogs.yesNo(q):
|
||||
return
|
||||
|
||||
initializeLayers()
|
||||
|
||||
result = actions.define_action(parent, "Initialize Skinning Layers", callback=do_initialize)
|
||||
result = actions.define_action(parent, "初始化蒙皮层", callback=do_initialize)
|
||||
|
||||
@signal.on(session.events.nodeSelectionChanged)
|
||||
def update():
|
||||
@@ -95,7 +95,7 @@ def build_action_initialize_layers(session, parent):
|
||||
def buildAction_createLayer(session, parent):
|
||||
from ngSkinTools2.ui import actions
|
||||
|
||||
result = actions.define_action(parent, "Create Layer", callback=addLayer, icon=":/newLayerEmpty.png", shortcut=QtCore.Qt.Key_Insert)
|
||||
result = actions.define_action(parent, "创建图层", callback=addLayer, icon=":/newLayerEmpty.png", shortcut=QtCore.Qt.Key_Insert)
|
||||
|
||||
@signal.on(session.events.targetChanged)
|
||||
def update_to_target():
|
||||
@@ -109,7 +109,7 @@ def buildAction_createLayer(session, parent):
|
||||
def buildAction_deleteLayer(session, parent):
|
||||
from ngSkinTools2.ui import actions
|
||||
|
||||
result = actions.define_action(parent, "Delete Layer", callback=deleteSelectedLayers, shortcut=QtCore.Qt.Key_Delete)
|
||||
result = actions.define_action(parent, "删除图层", callback=deleteSelectedLayers, shortcut=QtCore.Qt.Key_Delete)
|
||||
|
||||
@signal.on(session.context.selected_layers.changed, session.events.targetChanged, qtParent=parent)
|
||||
def update_to_target():
|
||||
@@ -126,12 +126,12 @@ def setCurrentLayer(layer):
|
||||
:type layer: ngSkinTools2.api.layers.Layer
|
||||
"""
|
||||
if not session.active():
|
||||
logger.info("didn't set current layer: no session")
|
||||
logger.info("未设置当前图层:没有会话")
|
||||
|
||||
if not session.state.layersAvailable:
|
||||
logger.info("didn't set current layer: layers not enabled")
|
||||
logger.info("未设置当前图层:图层未启用")
|
||||
|
||||
logger.info("setting current layer to %r on %r", layer, session.state.selectedSkinCluster)
|
||||
logger.info("将当前图层设置为 %r on %r", layer, session.state.selectedSkinCluster)
|
||||
layer.set_current()
|
||||
session.events.currentLayerChanged.emitIfChanged()
|
||||
|
||||
@@ -158,7 +158,7 @@ def deleteSelectedLayers():
|
||||
|
||||
|
||||
class ToggleEnabledAction(Action):
|
||||
name = "Enabled"
|
||||
name = "启用图层" #Enabled
|
||||
checkable = True
|
||||
|
||||
def __init__(self, session):
|
||||
@@ -192,7 +192,7 @@ class ToggleEnabledAction(Action):
|
||||
for i in selected_layers:
|
||||
i.enabled = enabled
|
||||
|
||||
logger.info("layers toggled: %r", selected_layers)
|
||||
logger.info("图层已切换: %r", selected_layers)
|
||||
|
||||
session.events.layerListChanged.emitIfChanged()
|
||||
|
||||
@@ -209,8 +209,8 @@ def build_action_randomize_influences_colors(session, parent):
|
||||
:type session: ngSkinTools2.api.session.Session
|
||||
"""
|
||||
|
||||
result = QAction("Randomize colors", parent)
|
||||
result.setToolTip("Choose random colors for each influence, selecting from Maya's pallete of indexed colors")
|
||||
result = QAction("随机颜色", parent)
|
||||
result.setToolTip("为每个影响选择随机颜色,从Maya的索引色板中选择。")
|
||||
|
||||
def color_filter(c):
|
||||
brightness = c[0] * c[0] + c[1] * c[1] + c[2] * c[2]
|
||||
|
||||
@@ -9,8 +9,8 @@ log = getLogger("operations/paint")
|
||||
|
||||
|
||||
class FloodAction(Action):
|
||||
name = "Flood"
|
||||
tooltip = "Apply current brush to whole selection"
|
||||
name = "填充" # Flood
|
||||
tooltip = "将当前画笔应用于整个选择区域"
|
||||
|
||||
def run(self):
|
||||
session.paint_tool.flood(self.session.state.currentLayer.layer, influences=self.session.state.currentLayer.layer.paint_targets)
|
||||
@@ -28,8 +28,8 @@ class FloodAction(Action):
|
||||
|
||||
|
||||
class PaintAction(Action):
|
||||
name = "Paint"
|
||||
tooltip = "Toggle paint tool"
|
||||
name = "绘制" # Paint
|
||||
tooltip = "切换绘制工具"
|
||||
checkable = True
|
||||
|
||||
def run(self):
|
||||
|
||||
@@ -43,14 +43,14 @@ def list_custom_nodes_for_meshes(meshes):
|
||||
return list(itertools.chain.from_iterable([list_custom_nodes_for_mesh(i) for i in meshes]))
|
||||
|
||||
|
||||
message_scene_noCustomNodes = 'Scene does not contain any custom ngSkinTools nodes.'
|
||||
message_selection_noCustomNodes = 'Selection does not contain any custom ngSkinTools nodes.'
|
||||
message_scene_noCustomNodes = '场景中不包含任何自定义的ngSkinTools节点。'
|
||||
message_selection_noCustomNodes = '选择不包含任何自定义ngskinTools节点。'
|
||||
message_scene_warning = (
|
||||
'This command deletes all custom ngSkinTools nodes. Skin weights ' 'will be preserved, but all layer data will be lost. Do you want to continue?'
|
||||
'此命令删除所有自定义ngSkinTools节点。蒙皮权重“”将被保留,但所有图层数据都将丢失。您想继续吗?'
|
||||
)
|
||||
message_selection_warning = (
|
||||
'This command deletes custom ngSkinTools nodes for selection. Skin weights '
|
||||
'will be preserved, but all layer data will be lost. Do you want to continue?'
|
||||
'此命令删除要选择的自定义ngSkinTools节点。皮肤重量'
|
||||
'将被保留,但所有图层数据都将丢失。您想继续吗?'
|
||||
)
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ def remove_custom_nodes(interactive=False, session=None, meshes=None):
|
||||
|
||||
if PaintTool.is_painting():
|
||||
# make sure that painting is canceled to restore mesh display etc
|
||||
cmds.setToolTo("Move")
|
||||
cmds.setToolTo("移除") # Move
|
||||
|
||||
if session is not None:
|
||||
session.events.targetChanged.emitIfChanged()
|
||||
|
||||
@@ -54,7 +54,7 @@ def create_action__from_closest_joint(parent, session):
|
||||
if not options.all_influences():
|
||||
influences = layer.paint_targets
|
||||
if not influences:
|
||||
dialogs.info("Select one or more influences in Influences list")
|
||||
dialogs.info("在影响列表中选择一个或多个影响")
|
||||
return
|
||||
|
||||
if options.create_new_layer():
|
||||
@@ -77,8 +77,8 @@ def create_action__from_closest_joint(parent, session):
|
||||
__create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Assign From Closest Joint",
|
||||
action_tooltip="Assign 1.0 weight for closest influence per each vertex in selected layer",
|
||||
action_name=u"从最近的关节分配",
|
||||
action_tooltip="为选定层中每个顶点的最近影响分配权重1.0",
|
||||
exec_handler=exec_handler,
|
||||
),
|
||||
options,
|
||||
@@ -105,8 +105,8 @@ def create_action__unify_weights(parent, session):
|
||||
__create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Unify Weights",
|
||||
action_tooltip="For selected vertices, make verts the same for all verts",
|
||||
action_name=u"统一权重", # Unify Weights
|
||||
action_tooltip="对于选定的顶点,使所有顶点相同。", #对于选定的顶点,使所有顶点相同。
|
||||
exec_handler=exec_handler,
|
||||
),
|
||||
options,
|
||||
@@ -130,8 +130,8 @@ def create_action__merge_layers(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Merge",
|
||||
action_tooltip="Merge contents of this layer into underlying layer. Pre-effects weights will be used for this",
|
||||
action_name=u"合并", # Merge
|
||||
action_tooltip="将本层的元素合并到底层。预效果权重将用于此。",
|
||||
exec_handler=exec_handler,
|
||||
enabled_handler=enabled_handler,
|
||||
)
|
||||
@@ -155,8 +155,8 @@ def create_action__duplicate_layer(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Duplicate",
|
||||
action_tooltip="Duplicate selected layer(s)",
|
||||
action_name=u"复制",
|
||||
action_tooltip="复制选择的图层(多选)",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -176,8 +176,8 @@ def create_action__fill_transparency(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Fill Transparency",
|
||||
action_tooltip="All transparent vertices in the selected layer(s) receive weights from their closest non-empty neighbour vertex",
|
||||
action_name=u"填充透明度",
|
||||
action_tooltip="所选图层中的所有透明顶点接收其最近非空邻接顶点的权重,",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -195,8 +195,8 @@ def create_action__copy_component_weights(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Copy Component Weights",
|
||||
action_tooltip="Store components weights in memory for further component-based paste actions",
|
||||
action_name=u"复制组件权重",
|
||||
action_tooltip="将组件权重存储在内存中,以便进行进一步的基于组件的粘贴操作",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -214,8 +214,8 @@ def create_action__paste_average_component_weight(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Paste Average Component Weight",
|
||||
action_tooltip="Compute average of copied component weights and set that value to currently selected components",
|
||||
action_name=u"粘贴平均组件权重",
|
||||
action_tooltip="计算复制的组件重量的平均值,并将该值设置为当前选定的组件",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -229,7 +229,7 @@ def create_action__add_influences(parent, session):
|
||||
def exec_handler():
|
||||
selection = cmds.ls(sl=True, l=True)
|
||||
if len(selection) < 2:
|
||||
logger.info("invalid selection: %s", selection)
|
||||
logger.info("无效选择: %s", selection)
|
||||
return
|
||||
api.add_influences(selection[:-1], selection[-1])
|
||||
cmds.select(selection[-1])
|
||||
@@ -238,8 +238,8 @@ def create_action__add_influences(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Add Influences",
|
||||
action_tooltip="Add selected influences to current skin cluster.",
|
||||
action_name=u"增加影响",
|
||||
action_tooltip="将选定的影响添加到当前皮肤集群。",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -289,7 +289,7 @@ def create_action__select_affected_vertices(parent, session):
|
||||
return __create_tool_action__(
|
||||
parent,
|
||||
session,
|
||||
action_name=u"Select Affected Vertices",
|
||||
action_tooltip="Select vertices that have non-zero weight for current influence.",
|
||||
action_name=u"选择受影响的顶点",
|
||||
action_tooltip="选择当前影响中权重不为要的顶点。",
|
||||
exec_handler=exec_handler,
|
||||
)
|
||||
|
||||
@@ -12,10 +12,10 @@ def website_base_url():
|
||||
|
||||
class WebsiteLinksActions(Object):
|
||||
def __init__(self, parent):
|
||||
self.api_root = make_documentation_action(parent, "API Documentation", "/v2/api")
|
||||
self.user_guide = make_documentation_action(parent, "User Guide", "/v2/")
|
||||
self.changelog = make_documentation_action(parent, "Change Log", "/v2/changelog", icon=None)
|
||||
self.contact = make_documentation_action(parent, "Contact", "/contact/", icon=None)
|
||||
self.api_root = make_documentation_action(parent, "API 文档", "/v2/api")
|
||||
self.user_guide = make_documentation_action(parent, "用户指南", "/v2/")
|
||||
self.changelog = make_documentation_action(parent, "更新日志", "/v2/changelog", icon=None)
|
||||
self.contact = make_documentation_action(parent, "联系", "/contact/", icon=None)
|
||||
|
||||
|
||||
def make_documentation_action(parent, title, url, icon=":/help.png"):
|
||||
|
||||
Reference in New Issue
Block a user