Maya nParticle only calculates friction/stickness between particles and rigid bodies, not friction is encountered between particles. My guess is the algorithm complexity is too high. Anyway there is two relative easy ways to fake the effect, according to my searching.
想要用一个一包糖粒堆在物体(对又是它..)上的片段,发现Maya的nParticle只计算粒子和Rigid body的摩擦力不计算粒子和粒子间的摩擦力(想来是算法复杂度太高了),所以不管怎么搞最终都会摊成大烧饼,并且还会不停的抽搐.. 查了下大概有两个相对简单的方法
1. hold particles with a invisible rigid body. 2. Use RealFlow, which seems to have much more handy control over particles
I’m not happy with either. 1 is lame. 2 too much trouble, have to get hang of another environment. If I must do scripting, I choose to learn mel.

So the algorithm is:
It’s unlikely to mess with friction as I guessed above. I tried to modify per particle mass to let them stuck in the space. Yea that works but they tend to be headbutted by other particles and flying around.. for science. Later I googled out it’s possible to control force field per particle, with attribute named “Field name”_”option name”. That is to say adding attribute “gravityField1_magnitude” to nParticle2 will grant you control over per particle gravity from the field.
On creation:
[php]
global int $freezeCap=5; //be completely frozen after the cap rounds
global int $gravityPP=500;
global float $dragPP=100;
global float $accelerationTrigger=15; //the speed parameter to trigger ‘I’m free again!", which leads to free droping.
global int $n[100000]; //how many times have the particle been locked
global int $preVel[100000]; //velocity of last frame
global int $locked[100000];
nParticleShape4.dragField1_magnitude=0;
nParticleShape4.gravityField1_magnitude=$gravityPP;
global int $init=1;
if($init==1) {
int $i;
for($i=0;$i<100000;$i++) {
$n[$i]=0;
$locked[$i]=0;
}
$init=0;
}
[/php]
Before dynamics:
[php]
int $id=nParticleShape4.particleId;
float $vel=abs(nParticleShape4.velocity);
//print("nParticleShape2.velocity "+$nParticleShape2.velocity+"\n");
if($vel>$preVel[$id]+$accelerationTrigger) {
$n[$id]=0;
nParticleShape4.dragField1_magnitude=0; //If it’s free again, unlock and erase record
}
else {
$freezeFact=$n[$id]/$freezeCap; //progress bar of locking
if($freezeFact>1)
$freezeFact=1;
$n[$id]+=1;
nParticleShape4.dragField1_magnitude=$freezeFact*$dragPP; //increase drag force depending on locking level
nParticleShape4.gravityField1_magnitude=$gravityPP*(1-$freezeFact)*(1-$freezeFact); //parabola is better according to experiment
nParticleShape4.velocity=<<0,0,0>>;
}
$preVel[$id]=nParticleShape4.velocity;
[/php]
The script is not bad to me.. adjustable parameters are handy. Time efficiency is acceptable (as a former ACMer, I can confirm this is O(n), can’t be better). 20 million particles * 100 frames cost my i7 half an hour. Not perfect but enough for bragging.
1. 弄个透明的动画的rigid body来把粒子圈起来。 2. 用RealFlow,我只用RealFlow模拟水,但是显然那它对粒子的控制比Maya厉害得多。
两个方法我都不高兴,1太不屌爆,2太麻烦,要做很多熟悉另一个环境的工作,且要写脚本,所以不如来学下mel。下了本书叫Maya Python — for Games and Film,翻了一百页发现Python在Maya上基本是庞大的workflow中工程师为了其他人方便写的maya程序,并且也要有mel基础,不是我要的。

总之,思路是:
想要计算摩擦力显然是不现实的,说过了。我先通过改质量的途径让粒子满足条件时失去质量以停在原地不受重力影响,停是能停住但是会被别的particle撞飞.. 非常科学。后来查到可以使用 <力场名>_<属性名> 的方式控制Per Particle的行为,即,给nParticle2添加名为gravityField1_magnitude的attribute程序就会使用它来控制它受到重力场1的magnitude。然后通过DragField让particle稳定。我在注释里详细说。
粒子生成时脚本:
[php]
global int $freezeCap=5; //be completely frozen after the cap rounds
global int $gravityPP=500;
global float $dragPP=100;
global float $accelerationTrigger=15; //the speed parameter to trigger ‘I’m free again!", which leads to free droping.
global int $n[100000]; //how many times have the particle been locked
global int $preVel[100000]; //velocity of last frame
global int $locked[100000];
nParticleShape4.dragField1_magnitude=0;
nParticleShape4.gravityField1_magnitude=$gravityPP;
global int $init=1;
if($init==1) {
int $i;
for($i=0;$i<100000;$i++) {
$n[$i]=0;
$locked[$i]=0;
}
$init=0;
}
[/php]
动态前的脚本:
[php]
int $id=nParticleShape4.particleId;
float $vel=abs(nParticleShape4.velocity);
//print("nParticleShape2.velocity "+$nParticleShape2.velocity+"\n");
if($vel>$preVel[$id]+$accelerationTrigger) {
$n[$id]=0;
nParticleShape4.dragField1_magnitude=0; //If it’s free again, unlock and erase record
}
else {
$freezeFact=$n[$id]/$freezeCap; //progress bar of locking
if($freezeFact>1)
$freezeFact=1;
$n[$id]+=1;
nParticleShape4.dragField1_magnitude=$freezeFact*$dragPP; //increase drag force depending on locking level
nParticleShape4.gravityField1_magnitude=$gravityPP*(1-$freezeFact)*(1-$freezeFact); //parabola is better according to experiment
nParticleShape4.velocity=<<0,0,0>>;
}
$preVel[$id]=nParticleShape4.velocity;
[/php]
个人感觉这个还不错,有很多参数可以控制,效率也还行(前ACMer表示这个就是O(n)..不能再低了),200万粒子100帧i7跑半个小时。显然不完美,蒙人没问题。
Ciekawy materiał. Sporo wartościowych inspiracji.
Dzięki za podzielenie się. Czekam na więcej.
Trafnie napisane – sprawa wystroju potrafi być niełatwa.
Wreszcie konkrety.
Szczerze pomocne. Szukałem podobnych porad już jakiś czas.
Pozdrawiam!
Feel free to visit my web site http://Www.junkie-Chain.jp
I couldn’t resist commenting. Exceptionally well written!
By highlighting theoretical proficiency, OMT reveals mathematics’ѕ internal charm,
sparking love ɑnd drive for leading exam qualities.
Join оur small-group on-site classes in Singapore fօr
customized assistance in a nurturing environment tһat
develops strong foundational math skills.
Ϲonsidered that mathematics plays а pivotal
function іn Singapore’s economic development аnd development, purchasing specialized math
tuition gears սp trainees ԝith the analytical skills
needed to prosper in a competitive landscape.
primary tuition іs neϲessary foг constructing strength agɑinst
PSLE’s difficult questions, ѕuch as tһose on possibility
ɑnd basic stats.
Tuition helps secondary trainees develop examination methods, ѕuch ɑs time
appropriation fοr botһ O Level mathematics papers, Ƅring
aboᥙt Ƅetter gеneral performance.
Junior college math tuition іs essential foг A Levels as іt ɡrows
understanding ⲟf innovative calculus topics ⅼike combination techniques aand differential equations, ᴡhich are
central to the examination syllabus.
OMT’ѕ custom-madе program distinctly supports tһе MOE curriculum by highlighting mistake analysis аnd improvement methods tо lessen blunders іn assessments.
Multi-device compatibility leh,ѕ᧐ change fгom
laptop сomputer to phone and maintain enhancing tһose grades.
Ꮃith advancing MOE guidelines, math tuition ҝeeps Singapore pupils
upgraded ⲟn curriculum modifications for exam readiness.
Ꮮooқ at my website math tuition singapore (Kristal)
Hiya! I know this is kinda off topic however , I’d figured I’d ask.
Would you be interested in exchanging links or
maybe guest authoring a blog article or vice-versa? My website discusses a lot
of the same subjects as yours and I believe we could greatly benefit from each other.
If you’re interested feel free to send me an e-mail.
I look forward to hearing from you! Awesome blog by the way!
І jᥙѕt cⲟuld not ɡo away yoiur web ite prior tߋ suggesting that Iextremely loved the usual info аn individual supply fоr yoᥙr guests?
Iѕ going to be bahk continuously tߋ check uр ᧐n new posts
Ηave a lоok at my web-site – math tuition singapore; Vaughn,
Thanks for this insightful article! I’ve been looking for natural ways to support
my overall wellness and this gave me some useful ideas. SightCare is
something I’ve been reading about lately.
Appreciate the info. https://juliacharakter.de/unbarmherzig-auf-deutschen-filmfestival-in-moskau/
https://letterboxd.com/bonubets26/
Witajcie, przeglądałem forum i muszę przyznać, że jest tu sporo wartościowych treści. Sama od jakiegoś czasu zmieniam wystrój i takie porady bardzo się przydają. Pozdrawiam serdecznie.
Ciekawa dyskusja. Moim zdaniem aranżacja wnętrza to podstawa. Lepiej raz a dobrze.
Feel free to visit my blog: http://Sorapedia.Plaentxia.eus/index.php/Aran%C5%BCacja_ma%C5%82ego_mieszkania_%E2%80%93_jak_zyska%C4%87_przestrze%C5%84_bez_generalnego_remontu
https://pixabay.com/users/888starzpromocode67-56754887/
These are in fact great ideas in concerning blogging. You have
touched some fastidious points here. Any way keep up wrinting.
https://neptunedirectory.com/listings13662178/bonus-on-registration
Fine way ߋf describing, and pleasant paragraph tօ ttake fcts concеrning my presentation topic, whiсh i am going to convey in university.
Aⅼso visit mү site :: learners lodge kembangan jc maths tuition 110
I’m amazed, I must say. Seldom do I encounter a blog that’s equally educative and entertaining, and without
a doubt, you have hit the nail on the head. The problem is something which
not enough people are speaking intelligently about.
I’m very happy that I came across this during my hunt for something concerning
this.
Hello there! Quick question that’s completely off topic.
Do you know how to make your site mobile friendly? My web site
looks weird when browsing from my iphone. I’m trying to find a theme or plugin that might be
able to fix this problem. If you have any recommendations,
please share. Thank you!
Hey there! I know this is sort of off-topic but I needed to ask.
Does managing a well-established blog like yours require a
lot of work? I’m brand new to operating a blog but I do write in my diary
every day. I’d like to start a blog so I will be able to share my own experience and feelings online.
Please let me know if you have any kind of suggestions or tips for brand
new aspiring blog owners. Appreciate it!
Hi there! I know this is somewhat off topic but I was wondering which blog platform are you using for this website?
I’m getting tired of WordPress because I’ve had issues with hackers and I’m
looking at options for another platform. I
would be awesome if you could point me in the direction of a good platform.
Thanks a bunch for sharing this with all people you really recognize what you are talking about! Bookmarked. Kindly also seek advice from my web site =). We can have a link alternate contract between us!
hello!,I love your writing very much! share we keep in touch extra about your post on AOL?
I require a specialist on this area to resolve my problem.
Maybe that is you! Having a look ahead to look you.
Hi, ich bin zufällig auf dieses Thema gestoßen und ich möchte sagen, dass das Thema hervorragend beschrieben ist. Ich gestalte gerade mein Haus und solche Tipps sind echt hilfreich. Einen schönen Tag euch allen.
Wertvoller Beitrag. Ich möchte hinzufügen, dass die richtige Farbgebung die Basis von allem ist. Es lohnt sich, dafür Zeit zu nehmen.
Here is my web-site https://Bbarlock.com/index.php/K%C3%BCchenm%C3%B6bel:_Mehr_als_nur_ein_Ort_zum_Kochen
Today, I went to the beach with my kids. I found a
sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
She placed the shell to her ear and screamed. There was a hermit crab
inside and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell
someone!
I ɑlmost neѵer write remarks, hoѡeveг i did a few searching and wound up here Use a simpple
script too achieve powder pile | Maya nParticle简单脚本实现粒子堆叠 | Asher.GG.
Andd Ι do hаve 2 questions fⲟr you if it’s allright.
Ӏs it only me or dieѕ it ѕeem lіke somе ⲟf
the responses ⅼooк lіke left by brain dead people?
:-PAnd, іf yoᥙ are writing ⲟn ᧐ther online social sites,Ι woᥙld lіke to
keep up withh anything fresh you һave to post. Woul ʏou make
a list of every one of all үour shared ρages lіke yoսr
linnkedin profile, Facebook ρage oг twitter feed?
Мy website :: math tuition tampines 110
It’s in fact very complicated in this busy life to listen news on Television, so
I just use world wide web for that purpose, and take the latest news.
I read this paragraph fully on the topic of the difference of most up-to-date and earlier technologies, it’s amazing article.
I have to disagree with most of the comments here, but maybe I’m just a contrarian.
https://livecityin.com/blogs/25147/%D0%9F%D1%80%D0%BE%D0%BC%D0%BE%D0%BA%D0%BE%D0%B4-%D0%9C%D0%B5%D0%BB%D0%B1%D0%B5%D1%82-%D0%9D%D0%B0-%D0%A1%D1%82%D0%B0%D0%B2%D0%BA%D1%83-2026-RUSH200-%D0%91%D0%BE%D0%BD%D1%83%D1%81-15-000
I constantly spent my half an hour to read this website’s articles or reviews daily along with a cup of
coffee.
Здорова, народ Брат потерял человеческий облик Дети боятся заходить в комнату Скорая не приедет на такой вызов Короче, единственные кто взялся за безнадёжный случай — наркология вывод из запоя в стационаре с детоксикацией Положили в палату В общем, не потеряйте контакты — запой стационар [url=https://lechenie.vyvod-iz-zapoya-v-stacionare-samara12.ru]запой стационар[/url] Не ждите пока станет хуже Перешлите тем кто в беде
If some one desires expert view on the topic of
blogging after that i suggest him/her to pay a visit this blog,
Keep up the good work.
Люди помогите советом Брат потерял человеческий облик Родственники в полном отчаянии В диспансер тащить — последнее дело Короче, спасла только госпитализация — запой стационар с комфортными условиями Врачи и медсёстры 24/7 В общем, телефон и цены тут — вывод из запоя в клинике самара [url=https://klinika.vyvod-iz-zapoya-v-stacionare-samara13.ru]https://klinika.vyvod-iz-zapoya-v-stacionare-samara13.ru[/url] Звоните прямо сейчас Перешлите тем кто в беде
I was able to find good advice from your blog articles.
http://domkodeks.ru/question/melbet-kg-promokod-2026-rush200-bonus-do-25-000
https://ontrip.80gigs.com/profile/talleymendoza3/
I am glad to be a visitor on this website!, regards for this rare information!
HARGATOTO menyediakan akses login resmi melalui link alternatif terpercaya
yang cepat dibuka, stabil digunakan, dan membantu pengguna masuk tanpa kendala
Самара, всем привет Брат потерял человеческий облик Родственники в полном отчаянии Платная клиника просит бешеные деньги Короче, спасла только госпитализация — вывод из запоя стационарно с психологом Положили в палату В общем, вся инфа по ссылке — вывод из запоя в наркологическом стационаре [url=https://kapelnicza.vyvod-iz-zapoya-v-stacionare-samara.ru]https://kapelnicza.vyvod-iz-zapoya-v-stacionare-samara.ru[/url] Стационар — это единственный выход Это может спасти жизнь
I do not even know how I ended up here, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you are not already 😉 Cheers!
I’m amazed, I have to admit. Seldom do I come across a blog that’s both equally
educative and interesting, and without a doubt, you’ve hit the nail on the head.
The issue is something too few men and women are speaking intelligently
about. I’m very happy I came across this in my search for something
regarding this.
Very shortly this site will be famous among all blogging and site-building people, due to it’s nice
posts
Good day I am so glad I found your blog page, I really
found you by accident, while I was searching on Aol for
something else, Regardless I am here now and would just like to say many thanks for a incredible post and a all round thrilling blog
(I also love the theme/design), I don’t
have time to go through it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the
excellent work.
bookmarked!!, I love your blog!
Many thanks! I enjoy this!
https://carina-e.ru/images/pages/1xbet-promokod-bonus.html
Tortoise For Sale tortoise for sale
I love what you guys tend to be up too. This kind of clever work and reporting!
Keep up the good works guys I’ve added you guys to blogroll.
Good day! I know this is kinda off topic however , I’d figured I’d ask.
Would you be interested in exchanging links or maybe guest writing a blog
article or vice-versa? My site goes over a lot of the same topics as yours and I feel we could greatly benefit from each other.
If you happen to be interested feel free to send me an email.
I look forward to hearing from you! Terrific blog by the way!
https://praca.uxlabs.pl/author/rorymuntz2026/
http://www.mirmafii.ru/article/11198
Hi, ich habe das Forum durchgeblättert und mir ist aufgefallen, dass das Thema hervorragend beschrieben ist. Ich bin gerade dabei, die Einrichtung neu zu und jeder Ratschlag hilft mir weiter. Danke und viele Grüße.
Spannender Thread. Ich kann aus eigener Erfahrung sagen, dass die Auswahl der Möbel eine enorme Rolle spielt. Es lohnt sich, dafür Zeit zu nehmen.
Kasyno Compensation bez Depozytu za Rejestracje to jedna z najbardziej popularnych conformation promocji oferowanych
przez legalne platformy hazardowe online. Tego typu gratuity
pozwala nowym uzytkownikom rozpoczac gre bez koniecznosci
wplacania wlasnych srodkow na konto. Wystarczy zazwyczaj zalozenie konta oraz spelnienie okreslonych warunkow regulaminowych, aby otrzymac
darmowe srodki lub darmowe obroty na wybranych automatach.
Dla wielu graczy jest to atrakcyjna mozliwosc sprawdzenia funkcji kasyna bez ponoszenia dodatkowych kosztow.
I think the admin of this site is really working hard in support of his
website, since here every information is quality based stuff.