relume Posted April 26, 2017 Share Posted April 26, 2017 Hello I am look for any hint or example how I can create a marionette network to implement a nested loop with standard nodes (otherwise I would be faster to write my owen traditional pyhton script)? My "challenge" is to iterate over a list of objects (ca. 2000 building objects) and test them against a second list of objects (ca. 30 quarter objects) in order to determine in which quarter object each building object is located. - So I create as first the building object list with an appropriate criteria. - Then I crate the quarter object list with its appropriate criteria. - Then I should iterate over the building object list, and for every building object item I should iterate over the entire quarter object list. - Finally for every actual building object item and quarter object item combination I test for overlapping. Many thanks for any hint. Quote Link to comment
Marionette Maven Marissa Farrell Posted April 26, 2017 Marionette Maven Share Posted April 26, 2017 I would use the 'Mix2' node with the List Matching set to 'Cross Reference' CompareLists_MFarrell.vwx Quote Link to comment
Pat Stanford Posted April 26, 2017 Share Posted April 26, 2017 If you already know Python (and preferably Pythonscript in VW), then I would recommend you do it that way. My personal opinion is that Marionette is great for creating objects, but that for modifying existing objects often a script is the easier way to go. It is relatively difficult to get user selected objects "into" a network to be able to work on them (at least as per VW2017). Quote Link to comment
Marionette Maven Marissa Farrell Posted April 26, 2017 Marionette Maven Share Posted April 26, 2017 Pat, Can I ask what you think is difficult about working with existing objects? The only limitation I can think of is that you cannot run your network on things physically selected, I believe almost every other method (if not all other methods) of getting the handles to objects is available within Marionette. In this case, since the objects would be selected based on criteria rather than if they are selected or not, Marionette is an acceptable tool for this. Not that I disagree that those who can script should just write their own, even I prefer scripting over Marionette in some cases. Quote Link to comment
Pat Stanford Posted April 27, 2017 Share Posted April 27, 2017 Probably just my lack of understanding of the guts of Marionette. You are correct that as long as you can use criteria it is relatively easy to get "objects" into a network to be processed. Not being able to use selection as part of the criteria is also pretty limiting. But I fairly rarely write scripts that use criteria. Almost everything is "semi-user-interactive" meaning selection the items you want to do something to and then run the script. So part of it is just the way I am used to working. BUT, you have to manually type in the criteria or use the criteria builder from someplace else and the copy and paste. Also, my lack of experience with Marionette makes it far harder for me to try and find the proper way to manipulate simple things like attributes using a network than using a script. All of the dragging is, to me, a drag. I also don't really like having to place an object in the drawing just to modify other objects. I know that a wrapped network is not really that big of deal, but for me, it is far easier to click on a script palette than to try to find a network, right click and select Run Network. Now if a network had options for what double clicking on it does (Say, like a viewport) so that I could just double click to run it, that would be a very interested capability. Double Click (opens selection dialog box, enters the wrapped network, runs the network [with check box to always do the selection]) Sorry for the rambling. I should not be trying to answer a serious question late at night. 1 Quote Link to comment
relume Posted April 27, 2017 Author Share Posted April 27, 2017 Hello Marissa and Pat Many thanks for your considerations and many thanks for the hint with the "Mix2" node. Yes with this approach I got my "challange" managed (see attachmend). Although VW worked for a longtime to process the network. I think it has to do with the n*m list combination that the "Mix2" node is creating - it is obvious that from set theory this matrix of combinations (items of outer loop and elements of inner loop) do the "analog" thing as a nested loop, but in regard of performance procedural nested loop may in certain case be faster. In regard to Pat's considrations, I agree mostly with his arguments. But I have to say that I am yet not very well trained with building Marionettes. I have in the german forum already some times ago suggested to implement the possibility to link Marionette-networks to script palettes. Also I would appreciate to organize Marionettes on a separate type of layer and not on construction layers with fixed scales. But in general I esteem the approach of Marionette to be a complementary scripting method - the possibility for easier interlinking both would be nice . Best regards, CompareObjectsForOverlapping.vwx Quote Link to comment
Wouter van Boekel Posted January 18, 2018 Share Posted January 18, 2018 Hi Marissa and Pat, This is a very useful network, I would have never thought of this construction by myself. Just to get rid of the error, i replaced the if node with the Filter node. Wouter CompareObjectsForOverlapping - filter node.vwx 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.