Skip to content

Commit

Permalink
added multiply for graph node
Browse files Browse the repository at this point in the history
  • Loading branch information
johnroper100 committed Sep 3, 2016
1 parent 57ede36 commit 1371a38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cm_bpyNodes.py
Expand Up @@ -117,6 +117,8 @@ class GraphNode(LogicNode):
"""CrowdMaster graph node"""
bl_label = "Graph"

Multiply = FloatProperty(name="Mutilply", description="Multiply the outputted value by this number", default=1.0)

CurveType = EnumProperty(name="Curve Type",
items=[("RBF", "RBF", "", 1),
("RANGE", "Range", "", 2)])
Expand All @@ -130,6 +132,7 @@ class GraphNode(LogicNode):
RBFTenPP = FloatProperty(default=0.25) # Ten percent point

def draw_buttons(self, context, layout):
layout.prop(self, "Multiply")
layout.prop(self, "CurveType", expand=True)
if self.CurveType == "RBF":
layout.prop(self, "RBFMiddle")
Expand All @@ -141,6 +144,7 @@ def draw_buttons(self, context, layout):
layout.prop(self, "UpperZero")

def getSettings(self, node):
node.settings["Multiply"] = self.Multiply
node.settings["CurveType"] = self.CurveType
node.settings["LowerZero"] = self.LowerZero
node.settings["LowerOne"] = self.LowerOne
Expand Down
4 changes: 2 additions & 2 deletions cm_nodeFunctions.py
Expand Up @@ -65,9 +65,9 @@ def RBF(value):
with the same key""")
else:
if settings["CurveType"] == "RBF":
output[i.key] = RBF(i.val)
output[i.key] = (RBF(i.val)*settings["Multiply"])
elif settings["CurveType"] == "RANGE":
output[i.key] = linear(i.val)
output[i.key] = (linear(i.val)*settings["Multiply"])
# cubic bezier could also be an option here (1/2 sided)
return output

Expand Down

0 comments on commit 1371a38

Please sign in to comment.