I am trying to use the attractor to influence movements of particle. It works fine when there are something to input into the attractor object for output; however when there is no input into the attractor then the attractor has no output. Is there a way to get around with this?
I was trying to edit the attractor.fx file from girlpower, but it seems to fail. is there a user manual for how to program effects?
The other option i thought about is to detect an empty spread before going into the attractor, and if there is an empty spread then I diverge off to do something else. however i am having some trouble detecting a null spread. How do i do this?
i am attaching my patch for reference.
attractor test.v4p (19.9 kB)
just an update for everyone.
I was being stupid. I found out how to use the count(value) object to detect when a spread is empty. So i can move on with diverging the particle movements from the attractor directly to the renderer.
however, I would really prefer to learn how to write my own fx code. I believe that this option is a much clearer solution. My idea would be to integrate the count object into the attractor effect file, and if the incoming spread of attractor points are empty then the output of the attractor would simply be the same as the incoming transform.
anyone can shed some light on this?
this is for whoever is reading this post.
i am just giving a bit of an update for whoever bump into this thread and are wondering along the same line of information.
I found out that the fx code are written in something called HLSL (High Level Shader Language).
here is also a bit of a tutorial for anyone who are interested.
if the problem you describe (which is the reasonable behavior of a node missing information) is the only one you’ve got with the attractor, you can indeed fix that with Count (Value) and Switch (Value Input) , just replacing an empty spread with non-influential values.
if you would like to write your own nodes, you could also read HowTo: VVVV Plugins. but i suspect (no offense) that you can still discover a lot of nodes to help you along.
have a look here. somewhere around there also should be some ready made modules dealing with the nil behavior. anyway it’s super easy to patch custom solutions.
Why not use ReplaceEmpty (which comes with vvvv)?
because ReplaceEmpty has a lousy pinnaming.
and the provided modules are more orphaned than the node reference and the helppatches together.
These Modules all deal with the handling of empty spreads or NIL and have a proper pinnaming.
hopefully one of the devvvvs remembers and includes them OnNextBetaRelease.
@kalle: these are nice modules. i would sugest to put them into the
or do you want them to be in
? thanks for your work!
i would say the DEFAULT behaviour of any node should be like that no output without input in all pins.
however in case of the attractor node i would say it makes pretty much sense to just not distort the input and pass it through as the output, when there is no attractor specified.
if nobody is against it i would change that behaviour for the next version, even without putting a legacy module there. i would assume that in most cases the attractors are fed with some attractor data.
there are enough occurences of my name…
thanks everyone for their replies.
I have made some minor changes to my patch but i am still not having any luck. I tried several of the modules mentioned about detecting a nil/empty spread; however when i go down that path, i am stuck trying to figure out how to switch between what i have feeding into the attractor and what is coming out of the attractor.
another way that i have tried is to modify the attractor.fx file. I have added an extra logic that would check for how many pairs of coordinates i am dealing with. Inside the logic of the for loop, it should actually skip the for loop when the count is zero, and just output what is being fed in. But in reality, it is behaving differently.
Anyone could shed some light on this for me?
attractor test.rar (6.6 kB)
Sorry guys. I am just stupid. I should have used the switch (node input) instead. Sorry everyone.