Skip to content

Commit

Permalink
Ignore empty Expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahrkeenerh committed Aug 15, 2022
1 parent 6f901b1 commit 7ca2ee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion extended_scripting/Python/Expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def on_create(self, context):
self.add_execute_output()
self.inputs[0].set_hide(True)
self.outputs[0].set_hide(True)
self.add_dynamic_data_input("inp").changeable = True
self.add_dynamic_data_input("Input").changeable = True
self.add_data_output("Expression").changeable = True

def update_expression(self, context):
Expand Down Expand Up @@ -68,6 +68,9 @@ def evaluate(self, context):
expression = self.multiple_replace(self.expression, to_replace)
else:
expression = self.expression

if not expression:
expression = None

if self.require_execute:
self.code = f"return_{self.static_uid} = {expression}"
Expand Down
4 changes: 2 additions & 2 deletions extended_scripting/Python/Script Function.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def on_dynamic_socket_add(self, socket):
def on_create(self, context):
self.add_execute_input()
self.add_execute_output()
inp = self.add_dynamic_data_input("arg")
inp = self.add_dynamic_data_input("Argument")
inp.is_variable = True
inp.changeable = True
out = self.add_dynamic_data_output("out")
out = self.add_dynamic_data_output("Output")
out.is_variable = True
out.changeable = True

Expand Down

0 comments on commit 7ca2ee0

Please sign in to comment.