Update
This commit is contained in:
@@ -432,7 +432,7 @@ class InfluenceMappingConfig(Object):
|
||||
return
|
||||
|
||||
if axis is not None and not isinstance(axis, int):
|
||||
raise Exception("invalid axis type, need int")
|
||||
raise Exception("无效的轴类型,需要整数")
|
||||
|
||||
self.__mirror_axis = axis
|
||||
|
||||
@@ -487,10 +487,10 @@ class InfluenceMapping(Object):
|
||||
|
||||
def __init__(self):
|
||||
self.config = InfluenceMappingConfig() # type:InfluenceMappingConfig
|
||||
"assigned config"
|
||||
"分配的配置"
|
||||
|
||||
self.influences = [] # type: list[InfluenceInfo]
|
||||
"Source influences list. Can be assigned to result of :py:meth:`Layers.list_influences`"
|
||||
"源影响列表. 可以分配给结果 :py:meth:`Layers.list_influences`"
|
||||
|
||||
self.destinationInfluences = None
|
||||
self.calculatedMapping = None
|
||||
@@ -498,7 +498,7 @@ class InfluenceMapping(Object):
|
||||
|
||||
def calculate(self):
|
||||
mirror_mode = self.config.mirror_axis is not None
|
||||
log.info("calculate influence mapping, mirror mode: %s", mirror_mode)
|
||||
log.info("计算影响映射,镜像模式: %s", mirror_mode)
|
||||
if self.destinationInfluences is None:
|
||||
self.destinationInfluences = self.influences
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class LayerEffects(Object):
|
||||
mirror_mask = mirror_dq = mirror_weights = everything
|
||||
|
||||
logger.info(
|
||||
"configure mirror: layer %s mask %r weights %r dq %r direction %r",
|
||||
"配置镜像: 图层 %s 遮罩 %r 权重 %r dq %r 方向 %r",
|
||||
self.__layer.name,
|
||||
mirror_mask,
|
||||
mirror_weights,
|
||||
@@ -103,7 +103,7 @@ class Layer(Object):
|
||||
@classmethod
|
||||
def load(cls, mesh, layer_id):
|
||||
if layer_id < 0:
|
||||
raise Exception("invalid layer ID: %s" % layer_id)
|
||||
raise Exception("无效图层 ID: %s" % layer_id)
|
||||
result = Layer(mesh, layer_id)
|
||||
result.reload()
|
||||
return result
|
||||
@@ -112,7 +112,7 @@ class Layer(Object):
|
||||
self.mesh = mesh
|
||||
self.id = id
|
||||
self.effects = LayerEffects(self) # type: LayerEffects
|
||||
"configure effects for this layer"
|
||||
"配置此图层的效果"
|
||||
|
||||
self.__state = None
|
||||
if state is not None:
|
||||
|
||||
@@ -63,7 +63,7 @@ class Mirror(Object):
|
||||
"""
|
||||
:type mapping: map[int] -> int
|
||||
"""
|
||||
log.info("mapping updated: %r", mapping)
|
||||
log.info("映射已更新: %r", mapping)
|
||||
|
||||
mapping_as_string = ','.join(str(k) + "," + str(v) for (k, v) in list(mapping.items()))
|
||||
plugin.ngst2Layers(self.target, configureMirrorMapping=True, influencesMapping=mapping_as_string)
|
||||
@@ -119,7 +119,7 @@ class Mirror(Object):
|
||||
existing_ref_mesh = self.get_reference_mesh()
|
||||
if existing_ref_mesh:
|
||||
cmds.select(existing_ref_mesh)
|
||||
raise Exception("symmetry mesh already configured for %s: %s" % (str(sc), existing_ref_mesh))
|
||||
raise Exception("对称网格已配置为 %s: %s" % (str(sc), existing_ref_mesh))
|
||||
|
||||
def get_shape(node):
|
||||
return cmds.listRelatives(node, shapes=True)[0]
|
||||
@@ -177,7 +177,7 @@ def set_reference_mesh_from_selection():
|
||||
selection = cmds.ls(sl=True, long=True)
|
||||
|
||||
if len(selection) != 2:
|
||||
log.debug("wrong selection size")
|
||||
log.debug("错误的选择尺寸")
|
||||
return
|
||||
|
||||
m = Mirror(selection[1])
|
||||
|
||||
@@ -83,7 +83,7 @@ class Session(Object):
|
||||
|
||||
@signal.on(self.events.targetChanged)
|
||||
def on_target_change():
|
||||
log.info("target changed: clearing target context")
|
||||
log.info("目标已更改:清除目标上下文")
|
||||
self.context.selected_layers.set([])
|
||||
|
||||
self.events.nodeSelectionChanged.emit()
|
||||
|
||||
@@ -67,7 +67,7 @@ def add_influences(influences, target):
|
||||
def long_names(names):
|
||||
result = set(cmds.ls(names, long=True))
|
||||
if len(result) != len(names):
|
||||
raise Exception("could not convert to a list of influences names: " + str(names))
|
||||
raise Exception("无法转换为影响名称列表: " + str(names))
|
||||
return result
|
||||
|
||||
existing = long_names([i.name if not i.path else i.path for i in list_influences(skin_cluster)])
|
||||
|
||||
@@ -103,7 +103,7 @@ def merge_layers(layers):
|
||||
# verify that all layers are from the same parent
|
||||
for i, j in zip(layers[:-1], layers[1:]):
|
||||
if i.mesh != j.mesh:
|
||||
raise Exception("layers are not from the same mesh")
|
||||
raise Exception("层不是来自同一个网格")
|
||||
|
||||
result = plugin.ngst2tools(
|
||||
tool="mergeLayers",
|
||||
|
||||
@@ -49,7 +49,7 @@ class LayersTransfer(Object):
|
||||
def calc_influences_mapping_as_flat_list(self):
|
||||
mapping_pairs = list(self.influences_mapping.asIntIntMapping(self.influences_mapping.calculate()).items())
|
||||
if len(mapping_pairs) == 0:
|
||||
raise Exception("no mapping between source and destination influences")
|
||||
raise Exception("源和目标影响之间没有映射")
|
||||
# convert dict to flat array
|
||||
return list(itertools.chain.from_iterable(mapping_pairs))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user