how to keep a running total in MCG without static varibles ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I know maxscript exceptionally well but I'm a new to MCG.
I looking to create some parameteric towers but i seem to be failing at the first hurdle.
Basically i'd like to make tower of random objects as a geometry plugin in MCG were the user supplies a list of object an a integer number, and a random seed..
But without a varible to keep a running total of the height I'm getting a bit lost. I realise that we are meant to follow a functional programing model in MCG but it just feels unreasonably convoluted
If this was maxscript i'd do something like:-
- set height to zero
- initialise empty array of meshes
- for i = 1 to n (
- pick object from list
- move the object up by the current value of height
- height = height + object.BBox.z
- append object to array
- )
- output mesh array as geometry
In the image below i've managed to make a simple array of clones, but this only works because i can simply multiple the index by a set value.
How do I keep a running total of the current height without some sort of global varible to keep a running total as i do in my maxscript example? Should I use the cache node ? Is this overkill ?
Programming without variables is kinda melting my brain I've used a bunch of other visual programing languages in which this would be really easy.
What's a good approach to make a tower of randomly sized objects ? How do i keep a running total of the height to offset the next object in the tower ?
Thanks in advance for any help
-ken
mcg tower