Jump to content
Developer Wiki and Function Reference Links Read more... ×
mickcullinan

Repeat / Loop a wrapped script

Recommended Posts

Hi all,

 

Just looking at Marionette for the first time for an upcoming project so apologies if I'm missing something obvious!

 

What I'm trying to create is a network which will generate a series of semi random tiles within a given set of paramaters. Something kind of like this:

 

image.thumb.png.b179d21d571fd2f20005ac38eecc394c.png

 

I've created a network which creates the first tile, then takes the top two vertices of that tile, adds a space, and uses those as the starting points for a new tile. Then the resulting tile is fed into a copy of the network and so on:

 

image.thumb.png.0e79ed8343d0e9c816971f98f773c1a3.png

 

So it's somewhat working. :) My question is, is there a way to get the wrapped script to repeat automatically, so it's not just copied and pasted like I have done, or is this a python job? Essentially it would be a for / while loop which keeps going untill the top vetex of a tile hits a maximum and then stops.

 

Thanks!

 

- Mick

 

Share this post


Link to post

There's not a traditional method of looping in Marionette, but if you incorporate the Sequence/Range/Series nodes, they can help to facilitate behavior similar to a loop.

Take a look at those, and if you need some guidance let me know and I'll try to find some time on Monday to help guide you 🙂

 

This will just be a matter of list manipulation, so check out all of the Data Flow nodes.

Share this post


Link to post

Thanks Marissa! I've had a look at those nodes, but I still can't quite figure it I'm afraid so any pointers would be great. My issue is that my wrapped network needs to be ran each time to generate the new starting points for the next tile, and I can't see how to implement this with any of the existing nodes. 

 

My network takes two starting points a and b then adds a random amount to the y value of each to make points c and d - to make the four points of a quad. Then it takes c and d, adds a vertical spacing amount to each, and then the new c and d should be the start of the next tile, but I'm at a loss as to how to get this to happen, without my original solution of just putting copies of the wrapped network one after the other. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×