|
|
@ -457,17 +457,16 @@ class PlasmaAttribIntNode(PlasmaAttribNodeBase, bpy.types.Node): |
|
|
|
bl_idname = "PlasmaAttribIntNode" |
|
|
|
bl_idname = "PlasmaAttribIntNode" |
|
|
|
bl_label = "Numeric Attribute" |
|
|
|
bl_label = "Numeric Attribute" |
|
|
|
|
|
|
|
|
|
|
|
def _on_update_int(self, context): |
|
|
|
def _get_int(self): |
|
|
|
self.value_float = float(self.value_int) |
|
|
|
return round(self.value_float) |
|
|
|
self.inited = True |
|
|
|
def _set_int(self, value): |
|
|
|
|
|
|
|
self.value_float = float(value) |
|
|
|
def _on_update_float(self, context): |
|
|
|
def _on_update_float(self, context): |
|
|
|
self.value_int = int(self.value_float) |
|
|
|
|
|
|
|
self.inited = True |
|
|
|
self.inited = True |
|
|
|
|
|
|
|
|
|
|
|
pl_attrib = ("ptAttribFloat", "ptAttribInt") |
|
|
|
pl_attrib = ("ptAttribFloat", "ptAttribInt") |
|
|
|
pl_label_attrib = "value" |
|
|
|
pl_label_attrib = "value" |
|
|
|
value_int = IntProperty(update=_on_update_int, options={"HIDDEN"}) |
|
|
|
value_int = IntProperty(get=_get_int, set=_set_int, options={"HIDDEN"}) |
|
|
|
value_float = FloatProperty(update=_on_update_float, options={"HIDDEN"}) |
|
|
|
value_float = FloatProperty(update=_on_update_float, options={"HIDDEN"}) |
|
|
|
inited = BoolProperty(options={"HIDDEN"}) |
|
|
|
inited = BoolProperty(options={"HIDDEN"}) |
|
|
|
|
|
|
|
|
|
|
@ -499,13 +498,15 @@ class PlasmaAttribIntNode(PlasmaAttribNodeBase, bpy.types.Node): |
|
|
|
self.value = attrib.simple_value |
|
|
|
self.value = attrib.simple_value |
|
|
|
self.inited = True |
|
|
|
self.inited = True |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
def _get_value(self): |
|
|
|
def value(self): |
|
|
|
|
|
|
|
attrib = self.to_socket |
|
|
|
attrib = self.to_socket |
|
|
|
if attrib is None or attrib.attribute_type == "ptAttribInt": |
|
|
|
if attrib is None or attrib.attribute_type == "ptAttribInt": |
|
|
|
return self.value_int |
|
|
|
return self.value_int |
|
|
|
else: |
|
|
|
else: |
|
|
|
return self.value_float |
|
|
|
return self.value_float |
|
|
|
|
|
|
|
def _set_value(self, value): |
|
|
|
|
|
|
|
self.value_float = value |
|
|
|
|
|
|
|
value = property(_get_value, _set_value) |
|
|
|
|
|
|
|
|
|
|
|
def _range_label(self, layout): |
|
|
|
def _range_label(self, layout): |
|
|
|
attrib = self.to_socket |
|
|
|
attrib = self.to_socket |
|
|
|