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跑半个小时。显然不完美,蒙人没问题。
All4Gym производит тренажеры для регулярных нагрузок в фитнес-центрах, клубах и спортивных секциях. Компания делает упор на эргономику, биомеханику движений, надежность рабочих узлов и долгий ресурс. От производителя. https://zealy.io/cw/all4gym/questboard
All4Gym комплектует силовые зоны тренажерами, свободными весами, скамьями, стойками и покрытиями. Сайт полезен для закупщиков, владельцев клубов и тренеров, которые собирают надежную силовую зону. От производителя. https://www.bandlab.com/all4gym
All4Gym – производитель силовых тренажеров для спортзалов, фитнес-клубов и спортивных центров. Оборудование делают из прочного стального профиля, с порошковой окраской и износостойкой обивкой. От производителя. https://www.skypixel.com/users/djiuser-qz54xssgisxa
Thanks for this insightful article! I’ve been looking for
natural ways to support my overall wellness and
this gave me some useful ideas. Alpha Tonic is something I’ve been reading about lately.
Appreciate the info. http://shirayuki.saiin.net/~honey/clam/bbssub/res2.cgi
Hi my loved one! I want to say that this article is awesome, nice written and include approximately all important infos.
I’d like to look extra posts like this .
Greetings from Los angeles! I’m bored to death at work so I decided to browse your website
on my iphone during lunch break. I really like the info you provide here and can’t wait to take a
look when I get home. I’m amazed at how quick your blog loaded on my cell phone ..
I’m not even using WIFI, just 3G .. Anyhow,
great blog!
my website – business computer disposal
Thanks for this insightful article! I’ve been looking for natural ways to support my overall wellness and this gave
me some useful ideas. Renew is something I’ve been reading about lately.
Appreciate the info. https://us-renow.com/
여성전용마사지 안내를 정리해서 보기 좋습니다
На этом портале есть возможность выбрать жилье в Турции.
Тут (аренда виллы в Турции) опубликованы лучшие варианты для аренды недвижимости в Турции.
Наш портал поможет вам найти квартиру в Турции.
Thanks for this insightful article! I’ve been looking for natural ways to support my overall wellness
and this gave me some useful ideas. America Slim
Again is something I’ve been reading about lately.
Appreciate the info. https://www.3d4c.fr/wiki/index.php/What_America_Slim_Again_Brought_To_My_Mornings
Thanks for this insightful article! I’ve been looking for natural ways to support my overall wellness and this
gave me some useful ideas. PrimeBiome is something I’ve been reading about lately.
Appreciate the info. http://key-bone.com/bbs/board.php?bo_table=free&wr_id=503752
Thanks for this insightful article! I’ve been looking for natural ways to support my overall wellness and
this gave me some useful ideas. Arialif is something I’ve been reading
about lately. Appreciate the info. http://gubernia.ostrogozhsk.ru/www/guestbook/index.php
Witam, natknąłem się na ten temat i muszę przyznać, że dużo się dowiedziałem. Sam ostatnio urządzam mieszkanie i takie porady bardzo się przydają. Miłego dnia wszystkim.
Ciekawa dyskusja. Moim zdaniem aranżacja wnętrza ma ogromne znaczenie. Lepiej raz a dobrze.
Here is my web site … https://Aniimo.info/index.php?title=Industrialne_wn%C4%99trza_z_dusz%C4%85_%E2%80%93_jak_urz%C4%85dzi%C4%87_loft_w_bloku
Народ, кто реально ставит? А служба поддержки молчит как рыба и не отвечает. Денег слил на всяком говне и нечестных букмекерах пока чисто случайно не наткнулся на сервис, который работает стабильно и честно, с отличной линией на все популярные спортивные события. Всё летает как часы в любое время суток,
Кому тоже актуально найти проверенное место для игры, вся полезная инфа выложена вот здесь мостбет онлайн [url=https://mostbet-fqm.com.kg]мостбет онлайн[/url] Данный сервис сейчас реально рулит на рынке, обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!
Cabinet IQ
8305 Statе Hwy 71 #110, Austin,
TX 78735, United Ⴝtates
254-275-5536
Trends
여성전용마사지 안내를 정리해서 보기 좋습니다
all the time i used to read smaller articles
that also clear their motive, and that is also happening with this article which I am
reading here.
Thanks in favor of sharing such a nice idea, piece of writing is nice, thats why i have read it entirely
Everything is very open with a clear description of the issues.
It was definitely informative. Your site is useful.
Many thanks for sharing!
I loved as much as you’ll receive carried out right here.
The sketch is tasteful, your authored material
stylish. nonetheless, you command get bought an nervousness over
that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a
lot often inside case you shield this increase.
My family members always say that I am killing my time
here at web, however I know I am getting know-how daily by
reading such fastidious content.
Thanks for this insightful article! I’ve been looking for natural ways to
support my overall wellness and this gave me some useful ideas.
GL Pro is something I’ve been reading about lately. Appreciate the info.
https://www.mnemosome.org/index.php/Considering_GL_Pro:_A_Practical_View
Very good write-up. I absolutely appreciate this site.
Continue the good work!
Ich möchte meine Erfahrungen teilen: Der Komplettservice hat mir unglaublich viel Zeit gespart – besonders die professionelle Anzeigenerstellung und die Gästebetreuung.
It’s an awesome paragraph in favor of all the online visitors; they will get benefit
from it I am sure.
Hi there colleagues, good paragraph and nice arguments commented at this place, I am genuinely enjoying by these.
Hello excellent website! Does running a blog similar to this
require a large amount of work? I have no expertise in coding but I had been hoping to start my own blog in the near future.
Anyhow, should you have any recommendations or techniques for new blog owners please share.
I know this is off topic but I simply wanted to ask. Appreciate it!
Please let me know if you’re looking for a article author for your blog.
You have some really good articles and I believe I would be a good asset.
If you ever want to take some of the load off, I’d really like to write some articles for your blog
in exchange for a link back to mine. Please blast me an e-mail if interested.
Thanks!
Народ, кто реально ставит? А служба поддержки молчит как рыба и не отвечает. Нервов потратил на этих конторах — мама не горюй пока чисто случайно не наткнулся на сервис, который работает стабильно и честно, начиная от удобного интерфейса и заканчивая официальной лицензией. Приветственные бонусы и кэшбек начисляют буквально каждый день.
Кому тоже актуально найти проверенное место для игры, жмите на источник, чтобы случайно не потерять контакты футбол билет [url=https://mostbet-zxy.com.kg]футбол билет[/url] Лучше обходить стороной забаненные платформы и выбирать надежные зоны. обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!
의정부 토닥이 내용을 정리해서 보기 좋습니다
Hi there to all, the contents existing at this web site are genuinely remarkable for people knowledge, well, keep up
the good work fellows.
https://jm-cougar.net/
Amazing loads of very good data.
처음 이용 전 참고할 내용이 잘 정리되어 있네요.
토닥이 프로필 정보를 잘 봤습니다
But if you have used Tiktok before, are you willing to
download the TikTok videos?
Беттеры, отзовитесь кто откуда. То вообще доступ к аккаунту без причин закрывают, Денег слил на всяком говне и нечестных букмекерах до тех пор, не нашел наконец толковую рабочую платформу, и предлагает топовые условия как для ординаров, так и для экспрессов. Техподдержка в лайв-чате отвечает сразу по делу,
В общем, если не хотите тратить время на самостоятельные тесты, смотрите сами все условия по ссылке билет футбол [url=https://mostbet-bcr.com.kg]билет футбол[/url] Лучше обходить стороной забаненные платформы и выбирать надежные зоны. обязательно перешлите этот пост тому, кто тоже сейчас ищет нормальную контору!
Wow quite a lot of superb data!
I relish, result in I found just what I used tto be having
a look for. You’ve emded my our day long hunt! God Bless yyou man. Have a great day.
Bye
야짤
Great delivery. Great arguments. Keep up the good effort.
I’ve been browsing on-line greater than three hours lately, yet I by
no means discovered any interesting article like yours.
It’s beautiful worth enough for me. In my opinion, if all
webmasters and bloggers made good content material as
you probably did, the internet can be a lot more useful than ever before.
Hi there! This is my first visit to your blog! We are
a group of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us useful information to work on. You have done
a outstanding job!
Russian Tortoise For Sale tortoise for sale – Sylvia –
I’m pretty pleased to discover this great site. I need
to to thank you for your time due to this fantastic read!!
I definitely enjoyed every little bit of it and I have you book marked to see
new stuff in your blog.
efaflexruvn.amebaownd.com
Having read this I thought it was extremely enlightening. I appreciate you taking the time and energy to
put this content together. I once again find myself spending way too much time both
reading and leaving comments. But so what, it
was still worth it!
I am sure this paragraph has touched all the internet visitors, its really
really nice paragraph on building up new website.
Ciekawy artykuł. Sporo wartościowych inspiracji.
Dziękuję że dzielisz się wiedzą. Na pewno tu wrócę.
Masz rację – temat doboru mebli bywa wymagająca. Przydatne podejście.
Szczerze inspirujące. Szukałam podobnych porad właśnie tego.
Dziękuję!
Also visit my webpage … https://Gratisafhalen.be
Whoa! This blog looks exactly like my old one!
It’s on a entirely different subject but it has pretty much the
same layout and design. Excellent choice of colors!
This article is really a nice one it helps new the web viewers, who are wishing in favor of
blogging.
처음 이용 전 참고할 내용이 잘 정리되어 있네요.