本文整理汇总了Python中sverchok.data_structure.updateNode函数的典型用法代码示例。如果您正苦于以下问题:Python updateNode函数的具体用法?Python updateNode怎么用?Python updateNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updateNode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updatePreset
def updatePreset(self, context):
if self.preset != "0":
# if preset, set preset
if self.previousSetting != self.preset:
using = self.p[self.preset]
self.source = using[0]
self.vTrunc = using[1]
self.eTrunc = using[2]
self.dual = using[3]
self.snub = using[4]
else:
using = self.p[self.preset]
result0 = self.source == using[0]
result1 = abs(self.vTrunc - using[1]) < 0.004
result2 = abs(self.eTrunc - using[2]) < 0.0015
result4 = using[4] == self.snub or ((using[4] == "Left") and
self.snub in ["Left", "Right"])
if (result0 and result1 and result2 and result4):
if self.p[self.previousSetting][3] != self.dual:
if self.preset[0] == "d":
self.preset = self.preset[1:]
else:
self.preset = "d" + self.preset
else:
self.preset = "0"
updateNode(self, context)
示例2: update_angles
def update_angles(self, context):
""" Convert angle values to selected angle units """
if self.last_angle_units == "RAD":
if self.angle_units == "RAD":
au = 1.0 # RAD -> RAD
elif self.angle_units == "DEG":
au = 180.0 / pi # RAD -> DEG
elif self.angle_units == "UNI":
au = 0.5 / pi # RAD -> UNI
elif self.last_angle_units == "DEG":
if self.angle_units == "RAD":
au = pi / 180 # DEG -> RAD
elif self.angle_units == "DEG":
au = 1.0 # DEG -> DEG
elif self.angle_units == "UNI":
au = 1.0 / 360 # DEG -> UNI
elif self.last_angle_units == "UNI":
if self.angle_units == "RAD":
au = 2 * pi # UNI -> RAD
elif self.angle_units == "DEG":
au = 360 # UNI -> DEG
elif self.angle_units == "UNI":
au = 1.0 # UNI -> UNI
self.last_angle_units = self.angle_units
self.updating = True # inhibit update calls
self.twist = au * self.twist # convert to current angle units
self.phase = au * self.phase # convert to current angle units
self.updating = False
updateNode(self, context)
示例3: mode_change
def mode_change(self, context):
# just because click doesn't mean we need to change mode
mode = self.mode
if mode == self.current_mode:
return
if mode == 'VERTEX':
n = 2 if "Vert A" in self.inputs else 1
while len(self.inputs) > n:
self.inputs.remove(self.inputs[-1])
if n == 1:
self.inputs.new('VerticesSocket', "Vert A", "Vert A")
if mode == 'AXIS':
n = 2 if "Vert A" in self.inputs else 1
if n == 2:
while len(self.inputs) > n:
self.inputs.remove(self.inputs[-1])
self.inputs.new('VerticesSocket', "Vert B", "Vert B")
else:
while len(self.inputs) > n:
self.inputs.remove(self.inputs[-1])
self.inputs.new('VerticesSocket', "Vert A", "Vert A")
self.inputs.new('VerticesSocket', "Vert B", "Vert B")
if mode == 'PLANE':
while len(self.inputs) > 1:
self.inputs.remove(self.inputs[-1])
self.inputs.new('MatrixSocket', "Plane", "Plane")
self.current_mode = mode
updateNode(self, context)
示例4: update_mode
def update_mode(self, context):
self.inputs['Radius'].hide_safe = (self.mode not in ['BySphere', 'ByPlane', 'ByCylinder', 'BBox'])
self.inputs['Center'].hide_safe = (self.mode not in ['BySphere', 'ByPlane', 'ByCylinder', 'Outside', 'BBox'])
self.inputs['Percent'].hide_safe = (self.mode not in ['BySide', 'ByNormal', 'EdgeDir', 'Outside'])
self.inputs['Direction'].hide_safe = (self.mode not in ['BySide', 'ByNormal', 'ByPlane', 'ByCylinder', 'EdgeDir'])
updateNode(self, context)
示例5: mode_change
def mode_change(self, context):
if not (self.items_ == self.current_op):
self.label = self.items_
self.update_outputs_and_inputs()
self.current_op = self.items_
updateNode(self, context)
示例6: mode_change
def mode_change(self, context):
if not (self.selected_hyper == self.current_hyper):
self.label = self.selected_hyper
self.update_outputs_and_inputs()
self.current_hyper = self.selected_hyper
updateNode(self, context)
示例7: update_mode
def update_mode(self, context):
if self.mode == self.last_mode:
return
self.last_mode = self.mode
self.update_sockets(context)
updateNode(self, context)
示例8: update_mode
def update_mode(self, context):
self.outputs['NewVertices'].hide_safe = not self.show_new
self.outputs['NewEdges'].hide_safe = not self.show_new
self.outputs['NewFaces'].hide_safe = not self.show_new
self.outputs['OldVertices'].hide_safe = not self.show_old
self.outputs['OldEdges'].hide_safe = not self.show_old
self.outputs['OldFaces'].hide_safe = not self.show_old
updateNode(self, context)
示例9: property_change
def property_change(node, context, origin):
if origin == 'input_mode_one':
node.inputs[0].prop_name = {'Float': 'x_', 'Int': 'xi_'}.get(getattr(node, origin))
elif origin == 'input_mode_two' and len(node.inputs) == 2:
node.inputs[1].prop_name = {'Float': 'y_', 'Int': 'yi_'}.get(getattr(node, origin))
else:
pass
updateNode(node, context)
示例10: update_value
def update_value(self, context):
if self.int_ < self.minim:
self.int_ = self.minim
return
if self.int_ > self.maxim:
self.int_ = self.maxim
return
updateNode(self, context)
示例11: update_mode
def update_mode(self, context):
self.inputs['Verts A'].hide_safe = self.nest_objs
self.inputs['Polys A'].hide_safe = self.nest_objs
self.inputs['Verts B'].hide_safe = self.nest_objs
self.inputs['Polys B'].hide_safe = self.nest_objs
self.inputs['Verts Nested'].hide_safe = not self.nest_objs
self.inputs['Polys Nested'].hide_safe = not self.nest_objs
updateNode(self, context)
示例12: update_mode
def update_mode(self, context):
self.inputs['Matrices'].hide_safe = (self.transform_mode != "Matrix")
self.inputs['Height'].hide_safe = (self.transform_mode != "Normal")
self.inputs['Scale'].hide_safe = (self.transform_mode != "Normal")
if self.transform_mode == "Normal":
self.multiple = True
updateNode(self, context)
示例13: update_mode
def update_mode(self, context):
# switch radii input sockets (R,r) <=> (eR,iR)
if self.mode == 'EXT_INT':
self.inputs['R'].prop_name = "ring_eR"
self.inputs['r'].prop_name = "ring_iR"
else:
self.inputs['R'].prop_name = "ring_R"
self.inputs['r'].prop_name = "ring_r"
updateNode(self, context)
示例14: update_mode
def update_mode(self, context):
if self.mode == 'EXT_INT':
self.inputs['R'].prop_name = "torus_eR"
self.inputs['r'].prop_name = "torus_iR"
else:
self.inputs['R'].prop_name = "torus_R"
self.inputs['r'].prop_name = "torus_r"
updateNode(self, context)
示例15: update_type
def update_type(self, context):
if self.numType == 'INT':
self.inputs['v1'].prop_name = "value_int1"
self.inputs['v2'].prop_name = "value_int2"
else: # float type
self.inputs['v1'].prop_name = "value_float1"
self.inputs['v2'].prop_name = "value_float2"
updateNode(self, context)