Ben Garcia Posted April 15 Share Posted April 15 When debugging, the wire value is True. When running, the alert shows that the value being passed to it is false. Has anyone experienced and what can I do to test or fix? Cache last run in Debug is disabled. Quote Link to comment
Pat Stanford Posted April 15 Share Posted April 15 What is the setup on your Alert Dialog node? Quote Link to comment
Ben Garcia Posted April 16 Author Share Posted April 16 (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 April 16 by Ben Garcia Quote Link to comment
Pat Stanford Posted April 16 Share Posted April 16 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. 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. Quote Link to comment
Marionette Maven Marissa Farrell Posted April 16 Marionette Maven Share Posted April 16 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) 2 Quote Link to comment
Recommended Posts
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.