clones intersecting


#6

just don’t forget to fill out the feature request :smiley:


#7

Surface Spread has a minimum distance parameter.


#8

The dynamics/follow position thing Per mentioned is super easy, and does what you want, so it is a standard option. I use it all the time. Admittedly, its not intuitively obvious… but once you are clued in… :hmm:

Nick


#9

Sorry to beg… but could you guys post a simple scene showing non intersecting objects?
:love:


#10

Happy to oblige:

File

Things to look for:

  • Press play to see the effect

  • See on cloner, dynamics tag > Force > Follow position setting, and dynamics tag > Collision > Individual elements > Top level

  • note no gravity in this scene, but there could be…

Nick


#11

workaround is what I’d call it, what’s wrong with just having a tickbox giving you the option to not have clones go through each other

cheers for the example though


#12

I found my tickbox :smiley:

random effector with visibility ticked


#13

OK, Just for you guys here is a COFFEE effector with three methods that you can use to avoid overlap based on a radius set in the Effector.

The controls are:

Radius - Controls the minimum radius between the clones.

Method - Options are:
Hide - Hides the clones that overlap other clones
Offset Along Z - Moves the clones out along Z creating stacked clones
Push Apart - Pushes the clones apart from each other

Push Apart Iterations - Repeats the action this number of times for when once isn’t enough to get a good effect.

This is an R12 file only. Enjoy.


#14

you sir, are a genius :buttrock:

this thread needs sticking somewhere so it doesn’t get buried :smiley:


#15

wicked! thanks per!


#16

Fantastic! :applause:

This should be built-in as an effector type!


#17

Anders,
Is it possible to re-write that code without using those Bitwise operators?
Or is there no other way to write this without using them?

-ScottA


#18

…and for those of us who don’t have R12 and can’t use that scene file… here’s Per’s effector in R11.5 format:)

Thanks for whipping this up Per:)

-kvb


#19

The flags are bits, so that’s why you’d want to use the bitwise operators to set them, it’s the fastest and cleanest possible route. They match up to the MODATAFLAG’s found in the C++ API (there are no COFFEE constants for them unfortunately currently).


#20

Hi !

First of all thank you Per for this great effector !

Sorry if i’ve missed the tip somewhere around but how on earth can i add this effector to the others ones in the mograph menu ?

Thanks

Sorry for my cheap english


#21

Ok thanks.
I assume the flags you’re talking about refers to this: GetArray(MODATA_FLAGS); right?

I’ve never used those bitwise operators before. I’ve read about them before, but I’ve never used them. So I’m a bit confused about how to use them. All I know is that they shift things in memory. But not much more than that.
If you have any other Coffee examples of them I’d love to see them. It might help me get a better understanding of how to use them.

-ScottA


#22

Well that’s jolly clever and useful - thanks

Agreed - should be part of Mograph functionality

Pls put it on the list


#23

@maharadjah - You’d need to access it as a preset from the content browser, possibly a coffee or python script could be made and then you’ll drop that into your menu/layout.

@Scott Ayers - They’re standard to most languages, just do a google for them. The basic operators are & (and) | (or) << (shift left) >> (shift right) ~ (invert) ^ (xor) see here : http://www.eskimo.com/~scs/cclass/int/sx4ab.html

The most common things you’ll ever do withthem are set and remove flags so to set a single bit you can first make a flag with that bit:

var myflag1 = (1<<0), myflag2 = (1<<1), myflag3 = (1<<2); //sets each flag to sequentiall bit 0, 1, 2

Then you can use them to set or unset values

flags |= myflag1; // Set flag 1 on top of whatever is already in flags

or

flags = myflag1|myflag2; //set flags to have flag1 and 2 set only

You can unset with the inverse

flags &= ~myflag1; //Removes flag 1

Then you can check with a simple &, because if that value & that flag == that flag (or not false in programming logic), then the bit must be set at that flag.

if (flags&myflag3) do something.

For more complex checks you need to make sure it equals the correct value. e.g.

if (flags&(myflag1|myflag2)) //if flag1 or flag2 is set
if ((flags&(myflag1|myflag2) == myflag1|myflag2) //if both flags are set

So you’d normally want to do the second compare in that situation.


#24

To use it with other effectors. The Coffee effector has to be the last effector listed in your cloner’s list of effectors.
If you want to see another example. I posted a Coffee effector script that interacts with a light (or any object) here: http://forums.cgsociety.org/showthread.php?f=182&t=898979&page=3

-ScottA

Edit- Doh! Cross posted with you there Anders.
Thanks for the info about the bitwise stuff. I’m probably going to have to play with them for while before I really get it.


#25

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.