Jump to content
Developer Wiki and Function Reference Links ×

Trying to modify this Choice Item node to take an input list


Guest unlimited

Recommended Posts

Guest unlimited

If anyone can help lift the veil on this it would be much appreciated.

In the attached file I have been looking at the Choice Item node which contains a hardcoded list and then presents that list as a pop up list in the PIO.

I would like to modify this Choice Item node to create an input port to take the list values from the preceding List node ( rather than the hard coded list that it contains currently ) - my current attempt creates an error when run (also included in the file).

Many thanks,

Martyn

Link to comment

Hi unlimited, I tried the same and didn't succed as well.

The problem is that list has the default value within the class Params defintion.

@Marionette.NodeDefinition

class Params(metaclass = Marionette.OrderedClass):

this = Marionette.Node( 'Choice Item' )

list = Marionette.PortInLists ( 9999 )

list.SetDescription( "The first input" )

print ( 'A', list.value) # will print the default value 9999

def RunNode(self):

print ('B', self.Params.list.value) # will print the incoming values

Edited by Patrick Winkler
Link to comment
  • Marionette Maven

This isn't currently possible because the OIP controls are defined before runtime. We can't dynamically refresh the OIP controls within the script, unfortunately.

I can't remember if this limitation is a hard limit or if we can find a workaround at a later time, but I'm going to guess it will be this way for at least another version.

Link to comment
Guest unlimited

OK thanks Marissa.

So, other than using the print node or the script warning dialogue, is there any way of showing the list generated by my script in any sort of dialogue ( even if its just read only )?

Thanks,

Martyn

Link to comment
  • Marionette Maven

Are you aware of Debug Mode?

Many users aren't completely satisfied with it in its current state, but to use it, have the Marionette tool selected and in the mode bar activate the Bug icon.

To use it, you can click on a wired output and it will activate a dialog box with the data that flows through that wire.

We're trying to find a more user friendly way to run it - right now, each time you select a wire, the entire network is rerun (annoying) but it provides at least another method of seeing what's flowing through your network.

Link to comment
Guest unlimited

Hi Marissa,

Yes I am aware of the Debug, and I can see how my question was misleading but I was looking for a way of showing a shortlist of items from a larger list, generated at runtime, in order for the user to choose from.

Any thoughts of any way to do this?

Link to comment
  • Marionette Maven

The closest I can think of would be to use the filter node to filter items from a list that meet a certain requirement...

But even then, the user wouldn't be able to choose one the way that I think you're asking for. There's not currently a way that I'm aware of to interrupt the script to have user selection.

There might be some hope if using dialog boxes, but I haven't explored that.

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...