ASag Posted June 2, 2023 Share Posted June 2, 2023 Hello All, I’m still new to Marionette, but I’m trying to automate parts of our team's workflow. I’ve built multiple marionette networks that work perfectly for a single object, but the problem is that I need them to work across multiple/variable numbers of objects. The moment I try introducing multiple starting objects, I fall flat on my face. I have multiple examples I could post, but if someone can point me in a direction with 1 of them, that will allow me to understand the proper way to do it for my other ones. The attached file (2022 File) is basically a copy + paste of an example I found on another thread here weeks ago, but it is part of what we do in our workflow. I need to take polygons that we created and break them into individual lines. I realize this is easy to do with a menu command (convert to lines), but it is a small part of a bigger network we are trying to make. In the attached marionette, I have 4 polygons and the script only works properly on 1 of them (the most recently made one). Looking at the code/debug, I think I understand the fundamental issue, but I have been unable to figure out how to actually make it work properly... If someone could directionally point me on how to solve this, I think it would answer a lot of other nodes where I am currently stuck on similar issues. ScriptExample2022.vwx Quote Link to comment
Letti R Posted June 2, 2023 Share Posted June 2, 2023 Hello, sometimes it can be tricky to manage lists in Marionette networks. Fortunately in this case its an easy fix. Here is how the network could look like: First of all there was an error in your network. The "Sequence" node generated one index too much, so i replaced it with the "Series" node. Apart from that you have to manage the inputs of the "Get 2D Edge" node to make this network run correctly. Here are your inputs to the "Get 2D Edge" node before the fix: As you can see you have a mismatch of handles to a polygon and the indices. So what you get is the first edge of the first polygon, the second edge of the second polygon, the third edge of the third polyogn and the first edge of the fourth polygon. But now you "ran our of polygons" so i think Marionette just repeats the last polygon from the list like this: Thats why one Polyogn (the last one) was done "correctly" (even though some edges were done multiple times). This is easily fixed if we repeat the handle of each polygon by the amount of its vertecies. This can be done with the "Repeat" node. Now the inputs of the "Get 2D Edge" look like this: I hope i could help you a bit. Unfortunately my english reaches its limits when trying to explain things like this. Regards, Letti 3 Quote Link to comment
ASag Posted June 5, 2023 Author Share Posted June 5, 2023 @Letti R - Wow! Thank you so much for the detailed explanation! Looking at the solution here makes me realize I went down multiple, highly confusing paths to try to solve this issue. I am going to see if I can solve some of my other situations that, on the surface, appear to be very similar! I am going to make this a part 2 of my original post: After looking at situations like the one posted, I was highly convinced I needed to understand the Index node to get the desired result. In many cases, I've found that feeding my objects into a list and then making a "list explode" allowed me to get the desired result, but I needed to duplicate the following nodes on each object. After some googling and chatGPT, it sounded like Indexing was the alternative that would let me feed a variable amount of objects through an individual set of actions. In this specific case, it wasn't required, but can someone give me insight into the Index node and how it is appropriately used? I have found very few examples online of the index node being used, and the wording of the node's description doesn't provide me any clarity. Quote Link to comment
ASag Posted June 6, 2023 Author Share Posted June 6, 2023 @Letti R - I just wanted to let you know that thanks to your examples and showing your troubleshooting path, I have successfully fixed several of my other networks! 1 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.