purusoth_uae
Hi everyone,
                     I am new to this forum.

Sorry about my English. I think People will understand my problem.

I create bunch of particles, it's like the word "SAMPLE".

and i connect to this particles with volume axis field with following curve.

the problem is once my particles are out of the volume then it will connect

to the other field turbulence field ( volume shape - Sphere ). I add radial field to pull the particles in to the turbulence field.

I am using this expression in my own attribute called "isInsidePP".

vector $force = particleShape1.inputForce[1];

if (`mag $force`!= 0)

particleShape1.isInsidePP = 1; //particle inside the volume field

else

{

particleShape1.isInsidePP = 0; //particle outside the volume field

//print(particleShape1.isInsidePP + "\n");
connectDynamic -d -f volumeAxisField1 particle1;
connectDynamic -f turbulenceField1 particle1;

}

Result in the Script Editor : // Error: An execution error occurred in the runtime before dynamics expression for particleShape1. // 

Kindly help me.

JeremyR
Personally I wouldnt use a brute force way to determine how much magnitude a field has on particles plus this doesnt work on a per particle basis - as soon as even one particle has been influenced you are then disconnecting the field for all of them. Instead you can create per particle field attributes - its a hidden technique for some unknown reason goodness knows why as its pretty essential.

Anway what you do is create a custom per particle attribute like so...

"volumeAxisField1_magnitude" per particle float attribute.

Now you can use your expression using input force to set volumeAxisField1_magnitude =0;
for example, now it works per particle.

Its just works that way.
Reply 0 0
pshipkov
i think you didnt grasp how pp expressions work. so just to clarify - you want to eliminate the interfierence of two force fields and have only one or the other to influence your paricles based on where the particles are located ?
Reply 0 0
purusoth_uae
yes,
When my particles out of the volumeaxis field , The turbulence field should pull those particle into it. That's y i am using radial field along with turbulence field.
Reply 0 0
JeremyR
Not sure exactly the effect you want but you can see how the magnitude of the turbulence and radial field changes as the inputForce of the volumeAxis dies. BTW this value is already  a float value so theres no need for the mag function.
Reply 0 0
purusoth_uae
Oh my God,

Thanks, thanks a lot.

now i am understand. Last three day & night i can't sleep & get food also.

Very simple logic also i can't able to think.

Is there any good & nice tutorial about like this programming in MEL, can i have those plz.


Reply 0 0
JeremyR
Just look around there is a lot of mel stuff on the web and hang out at a place like cgsociety.org, ask questions and check out old threads.

Best of luck :)
Reply 0 0
purusoth_uae
Thanks a lot Moderators. I am very very beginner to learn programming & English also. If i ask anything anonymously kindly forgive me.

And i will check those sites & come back with some knowledge & will ask some intermediate questions here, And i hope that time also SOUP team will give help like me peoples.

Thanks a lot.
 
Reply 0 0
JeremyR
Mel is a great place to start learning programming, it was my first language also. When you get good with mel move onto python, this is also a very excellent first language to learn and a lot more powerful than mel. Both are used in Maya and both are a scripting language, meaning the code is interpreted on the fly without needing to be compiled first.
Reply 0 0
levi
Hello Aikiman, 

I realize that this thread is years old at this point, but if you're still around I was wondering if you have any recommendations on how to get a PP magnitude from SoUP's pointCloudField.  The pointCloudField appears to hook up the same way as all other fields, but using the *_magnitude trick when creating a PP float attribute doesn't produce the same (or any) results.
Reply 0 0
pshipkov
The point cloud field node takes directly data from its inWeightPP (not in front of Maya right now, so name may vary), so you won't need to do gimmicky tricks with particle expressions.
Just connect the particle magnitudePP (or any other node.attribute) to the mentioned above attribute of the pointcloud field node and that's it.
Reply 0 0
levi
Hello Mr Shipkov!

Thank-you for your response!  

I've had much success plugging arrays into the pointCloudField.MagnitudePP, which as I'm understanding it, weights the influence of the pointCloudField according to it's source geometry/pointCloud inputs.  

What I'm after is the ability to use the pointCloudField as an influence only during a specific portion of a particle's lifespan on a per particle basis.

As Aikiman mentioned in this thread years ago, with maya fields you can do this gimmicky custom attribute trick of naming a custom PP attribute "*_magnitude" and then plugging an arrayMapper with a ramp into the particleShape's age to control the influence of a field on a per-particle basis (over it's age).


While that weird *_magnitude trick doesn't work with pointCloudField, I thought it could be possible to string up a node network in a similar fashion with a ramp driven arrayMapper taking age information from a particleShape and point/weight information from another array, then feeding that into a pointCloudField's magnitudePP.  So far, I've been able to control a pointCloudField's influence only by the age of the entire particleShape, but not on a PP basis.

I'd gladly attach a scene if you had the time to look.

Thanks again!



Reply 0 0
pshipkov
I think this is much easier to achieve than you think.
If you have an example scene - pass it along (here or email it to me) and i can show you how.
Reply 0 0
levi
Hey again!  I've attached a 2016 scene which is ~clearly~ incorrectly setup, but it has two particle systems, one attracting towards a radial field over the course of the particles life, and a similar one that's trying to do the same with the pointCloudField but failing miserably.  The way it's setup now, the pointCloudField effects the entire particleShape over the course of the collective particleShape's life.  Thank you for your guidance!     
Reply 0 0
pshipkov
I made it work but you won't like the setup. I didn't like it either. So i updated the pointCloudField node to do what you are after. Will be in the next update.
Reply 0 0
Reply