Jump to content
Developer Wiki and Function Reference Links ×

Wire debug value doesn't match node input value


Recommended Posts

Posted (edited)

It was:
 

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
	# APPEARANCE
	this = Marionette.Node('Alert Dialog')
	this.SetDescription('Displays an alert dialog to the user.')

	# Input Ports
	runFlag = Marionette.PortIn(False, 'boolean')
	runFlag.SetDescription("If False, the alert dialog will run")

# BEHAVIOR
	this.SetListAbsorb()

def RunNode(self):
	# inputs
	run_flag = self.Params.runFlag.value

	# script
	vs.AlrtDialog("Greater than value is "+ str(run_flag))

 

Edited by Ben Garcia
Link to comment

I have no idea. I just tested your node in a less complicated network and I get the same output between the debug and the node.

 

image.thumb.png.78a0345fef46ad31457e7882c2c84677.png

 

Try something like the above and see if you can get the failure.

 

One a separate note, you might want to rename the Node to something like Alert Dialog 2 since there is already a default Alert Dialog node that does something different.

 

 

Link to comment
  • Marionette Maven
7 hours ago, Ben Garcia said:

It was:
 

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
	# APPEARANCE
	this = Marionette.Node('Alert Dialog')
	this.SetDescription('Displays an alert dialog to the user.')

	# Input Ports
	runFlag = Marionette.PortIn(False, 'boolean')
	runFlag.SetDescription("If False, the alert dialog will run")

# BEHAVIOR
	this.SetListAbsorb()

def RunNode(self):
	# inputs
	run_flag = self.Params.runFlag.value

	# script
	vs.AlrtDialog("Greater than value is "+ str(run_flag))

 

I think while trying to debug you got yourself all out of sorts here.

The issue, though, is the 

this.SetListAbsorb()

line. 
What this does is it takes everything that is wired into the port and takes it in as a list, so the boolean input you're receiving is actually

[True]

or 

[False]


Two ways to resolve this - 

1) take out the 

this.SetListAbsorb()

line. 

 

2) change

	# inputs
	run_flag = self.Params.runFlag.value

to 

	# inputs
	run_flag = self.Params.runFlag.value[0]

 

________
I imagine you want it to behave more like the following in the long run:
 

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
	# APPEARANCE
	this = Marionette.Node('Alert Dialog')
	this.SetDescription('Displays an alert dialog to the user.')

	runFlag = Marionette.PortIn(False, 'boolean')
	runFlag.SetDescription("If False, the alert dialog will run")

	# OIP Controls
	txt = Marionette.OIPControl('Text', Marionette.WidgetType.Text, '')
	txt.SetDescription('The alert message to be displayed')

# BEHAVIOR

def RunNode(self):
	# inputs
	text = self.Params.txt.value
	run_flag = self.Params.runFlag.value

	# script
	if not run_flag:
		vs.AlrtDialog(text)

 

  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...