Jump to content
Developer Wiki and Function Reference Links ×

Draw Item selected from list


Recommended Posts

Hi,

 

I'm trying to create a marionette script that will allow me to select a choice from a list and only produce the item selected via the list.  The example I'm showing would be 3 different rectangles.  I've put them into an ordered list.  I've created a popup and used it as an index.  when i run the script it proceeds to create all 3 objects rather than just the indexed item.  Is there something else that I'm missing?

 

Thank you

DerekScreenShot2024-07-26at12_23_39PM.thumb.png.e530eb7c017cbaaebf15288025b4a145.png

Link to comment

You are just creating a simple list and selecting an handle but the rectangles at the beginning will be created anyway.
You should tell to the script how to filtering in some way what you want and what you do not want. 
You can create a IF sequence, or simply duplicating the rectangle you want and delete the others.


image.thumb.png.348b545f0ca9b1a7e7bd19ce5dcaa63e.png

Edited by FranAJA
Link to comment

Thank you,

 

I was able to get it to work by deleting and duplicating.  While this is working it's not ideal coding (drawing objects just to delete them). I think you are right and the items need to be filtered some way.  I'm trying to understand the IF node more but I'm having a hard time understanding how I can create a test that is not only "true or false". 

 

Thanks again

Derek

 

Link to comment

Ok, I was able to do more test and got it to work.  I think my issue was that I was thinking of my choices as multiple nested 'if-then-else' statements rather than just a bunch of different 'If' nodes.

 

I applied this method to a different script and now it only passes only the information selected and draws only 1 of the object.  I think this might be the cleaner solution.  I'm open to any further suggestions to keep my script from becoming overly bloated.

 

Thanks for your help and direction.

 

Derek

Screenshot 2024-07-31 at 11.49.35 AM.png

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