03 March 2013 | |
![]() |
|
Green
portfolio
eikonoklastes
USA
|
Randomize Inheritance Morph Motion Object
That's the shortest title I could think of, honest.
Basically, I have a Matrix grid (25x25), whose visibility is being affected by a volume effector. Then, I have a cloner, with far fewer objects (just 50) than the Matrix object. I am using the Inheritance Effector with Morph Motion Object to move the cloner objects to the Matrix objects positions. Unfortunately, they all stack up neatly at the bottom of the Matrix grid. I need them to be distributed randomly amongst the Matrix grid. Is this possible? Or am I approaching it the wrong way entirely? Basically, I need to specify a large, empty grid, and then randomly distribute objects on it. Thanks! |
03 March 2013 | |
![]() |
|
Expert
portfolio
douwe
Brussels,
Belgium
|
You could use a Python Effector to shuffle the indexes of the Matrix Object.
You shouldn't need much more than this information :
you can use a User Data for a seed value. you're a clever guy, you should be able to fill in the blanks. have fun, d |
03 March 2013 | |
![]() |
|
Expert
portfolio
Yader
Art Director, Motion Designer
Berlin,
Germany
|
Take a Plain Effector and make everything but 50 matrices invisible with a MoSelection?
Last edited by typografschaft : 03 March 2013 at 10:59 AM. |
03 March 2013 | |
![]() |
|
Green
portfolio
eikonoklastes
USA
|
douwe, thanks for pointing me in the right direction. That's exactly what I wish to achieve - randomize the indexes of the matrix object.
Unfortunately, your faith in my abilities was a bit misplaced. I've never written a python script in C4D before and this is what I've managed to put together from various huntings:
That doesn't seem to do anything to the matrix. It would seem that I would need a loop on the marr[i]=marrshuffled[i] line, but I can't be sure. Why this isn't built into the Grid arrays is beyond me. |
03 March 2013 | |
![]() |
|
Expert
portfolio
Paul T
United Kingdom
|
Ah - the old shuffle thing (Hi Douwe)
Didn't ever work out why you have to close and reopen the file everytime time you change the cloner or matrix numbers. But it does shuffle both. Anyhow file included if its of any help - or if anyone knows how to reinitialise the effector without having to close and reopen the scene btw - can't believe in this day an age that the upload limit is a ridiculously minute 1 meg! |
03 March 2013 | |
![]() |
|
Expert
portfolio
douwe
Brussels,
Belgium
|
You're close eikono,
Check out this example : douwe-randomindexeffector.c4d Hey Paul, the old shuffle thing indeed ![]() the issue you mention (my example also has it) may be fixed already if you get the Array again right before you do that shuffle. Finally, yader is right : Just a MoSelection is a lot easier and faster to set up. cheers, d |
03 March 2013 | |
![]() |
|
Green
portfolio
eikonoklastes
USA
|
Thanks deepshade. I'm almost there now.
The only issue is that the indexes seem to keep randomizing. I've added douwe's seedvalue bits to the code in your file, but it still seems to use a random seed every time. I need to just generate a random set of positions and then lock that down. Here's the modified code:
|
03 March 2013 | |
![]() |
|
Green
portfolio
eikonoklastes
USA
|
Ah that was quick! Ignore my previous post. Thanks douwe, I think I'm sorted now.
typografschaft's suggestion is indeed simpler, but not flexible enough for what I need to do. The array I'm dealing with is quite large and the number of clones is quite large too (the numbers I used in my first post were for illustration only). That's a lot of manual, tedious work, especially when you consider that the positions are subject to change. I really hope that "Randomize Index" makes a checkbox appearance in the next version. |
03 March 2013 | |
![]() |
|
Expert
|
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. |
Thread Closed share thread |
«
Previous Thread
|
Next Thread
»
|
|
|