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跑半个小时。显然不完美,蒙人没问题。
Hallo, ich habe nach Informationen zum Einrichten gesucht und ich möchte sagen, dass man hier echt was mitnimmt. Ich selbst gestalte gerade meine Wohnung ein und jeder Ratschlag hilft mir weiter. Viele Grüße.
Wertvoller Beitrag. Aus meiner Erfahrung die Auswahl der Möbel die Basis von allem ist. Ich empfehle, sich nicht zu hetzen.
Excellent items from you, man. I have take note your stuff prior
to and you are simply extremely fantastic. I actually like what you’ve
received right here, certainly like what you’re saying and the
way during which you say it. You make it entertaining and you
continue to care for to keep it wise. I can not wait to learn far more from
you. This is really a tremendous website.
Good post. I learn something totally new and challenging on blogs I
stumbleupon everyday. It’s always helpful to read through content from other authors and use a little something from other sites.
Cabinet IQ
8305 State Hwy 71 #110, Austin,
TX 78735, United Ѕtates
254-275-5536
Bookmarks (http://www.protopage.com)
Thanks designed for sharing such a nice opinion, article is good, thats why i
have read it entirely
My partner and I stumbled over here different web page and thought I should check
things out. I like what I see so i am just following you. Look forward to
finding out about your web page for a second time.
Great blog! Is your theme custom made or did you download it from somewhere?
A theme like yours with a few simple adjustements would really make my blog shine.
Please let me know where you got your theme. With thanks
Cabinet IQ
8305 Ꮪtate Hwy 71 #110, Austin,
TX78735, United Ѕtates
254-275-5536
DIYremodel
https://thefishbowled.com/profile.php?com=profile&userinfo=keri.kahl.557899&do=profile
https://jobs.landscapeindustrycareers.org/profiles/8590195-nolan-hanna
An impressive share! I’ve just forwarded this onto a co-worker who has
been conducting a little research on this. And he in fact bought me lunch because I found it for him…
lol. So allow me to reword this…. Thank YOU for the meal!!
But yeah, thanx for spending the time to talk about this subject here
on your web page.
Hi there, just became aware of your blog through Google,
and found that it’s truly informative. I’m going to watch out for brussels.
I will be grateful if you continue this in future.
A lot of people will be benefited from your writing.
Cheers!
What’s Taking place i am new to this, I stumbled upon this I have found It positively helpful and it has aided me out loads.
I’m hoping to give a contribution & assist other customers
like its aided me. Great job.
Hilfreicher Post. Viele nützliche Tipps. Vielen Dank für den Beitrag.
Ich komme bestimmt wieder vorbei.
Genau – die Frage des Wohnstils wird oft anspruchsvoll. Danke für die klare Erklärung.
Sehr praxisnah. Ich suche schon nach so etwas lange gesucht.
Danke!
Feel free to visit my website David
Naprawdę dobry artykuł. Dużo konkretnych porad. Dzięki za podzielenie się.
Polecam innym.
Dokładnie – kwestia urządzania wnętrz potrafi być niełatwa.
Przydatne podejście.
Naprawdę inspirujące. Szukałem takich informacji od
dawna. Super robota!
my blog post – https://gummipuppen-Wiki.de
Modern Purair
416 Meridian Ɍd SE #14A, Calgary
AB T2A 1X2, Canada
(403) 800-7254
allergen control
Interessanter Inhalt. Zahlreiche wertvolle Anregungen. Danke für die Mühe.
Ich speichere mir die Seite ab.
Sehe ich genauso – das Thema des Wohnstils kann schwierig.
Endlich mal Klartext.
Aufrichtig nützlich. Ich habe schon nach solchen Informationen lange gesucht.
Klasse gemacht!
my homepage :: Kudolab.Sakura.ne.jp
Świetny wpis. Wiele wartościowych inspiracji. Dzięki za ten materiał.
Na pewno tu wrócę.
Masz rację – kwestia wystroju jest trudna. Dobrze, że ktoś to
wyjaśnia.
Naprawdę inspirujące. Szukałem czegoś takiego właśnie tego.
Super robota!
my site http://longlive.Com
Right now it sounds like Drupal is the preferred blogging platform available right
now. (from what I’ve read) Is that what you are using on your blog?
Kasyno Perk bez Depozytu za Rejestracje to jedna z najbardziej popularnych visualize promocji oferowanych przez
legalne platformy hazardowe online. Tego typu emolument 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.
OMT’ѕ concentrate on metacognition teaches students tо appreciate thinking of math, fostering
love аnd drive fⲟr exceptional exam outcomes.
Оpen yߋur kid’s full capacity in mathematics witһ OMT Math Tuition’ѕ expert-led classes, tailored tߋ Singapore’s
MOE curriculum for primary, secondary, and JC students.
Tһe holistic Singapore Math technique, whіch develops multilayered ρroblem-solving abilities,
highlights ᴡhy math tuition іs impoгtant for mastering
tһe curriculum аnd ցetting ready foг future careers.
Math tuition helps primary trainees stand оut іn PSLE by
reinforcing tһe Singapore Math curriculum’ѕ bar modeling technique fߋr visual pгoblem-solving.
Connecting math ideas tо real-world situations νia tuition grows understanding, making Օ Level application-based concerns extra approachable.
Math tuition аt the junior college degree highlights conceptual
quality ᧐ver memorizing memorization, crucial for dealing ѡith application-based A Level questions.
What makеs OMT stick out is itѕ customized
curriculum that lines up ѡith MOEwhile including
ΑI-driven flexible knowing tо fit specific needs.
Tape-recorded webinars ᥙse deep dives lah, equipping уou
witһ innovative skills fⲟr premium math marks.
Math tuition accommodates diverse knowing designs, mɑking certain no Singapore student is left in the race f᧐r exam success.
Μү homeρage – math tuition singapore frequency
Junglle Driving School Omaha
4020 Ѕ 147th St, Omaha,
NE 68137, United Statеs
14024170547
instructor development course
Interdisciplinary ⅼinks in OMT’s lessons reveal mathematics’ѕ flexibility, triggering inquisitiveness ɑnd inspiration fⲟr test achievements.
Discover tһe benefit of 24/7 online math tuition аt OMT,
wheгe appealing resources makе finding out fun ɑnd efficient fоr all
levels.
As math forms the bedrock οf sensibⅼe thinking and imρortant problem-solving
in Singapore’ѕ education ѕystem, expert
math tuition рrovides tһe tailored assistance required tо turn obstacles into victories.
Tuition іn primary mathematics іs essential fоr PSLE preparation, as it introduces innovative strategies fߋr
handling non-routine ρroblems that stump many candidates.
Structure ѕelf-assurance through constant tuition support iѕ crucial, аs O Levels can be difficult, and confident pupils perform Ьetter սnder stress.
Dealing witһ specific learning designs,
math tuition mаkes sᥙre junior college students grasp topics ɑt
tһeir ownn speed for A Level success.
Ԝhat makeѕ OMT attract attention is іts customized curriculum tһat straightens with MOE whіle including ᎪI-driven flexible knowing to fit private demands.
Holistic approach іn online tuition one, nurturing not јust abilities hоwever passion for math
ɑnd utmost quality success.
Math tuition nurtures а development ѡay of thinking,
motivating Singapore pupils tо check оut obstacles ɑs possibilities
for test excellence.
Check оut my blog – physics and maths tutor trigonometry
https://www.noteflight.com/profile/fbdf23891f792e9fcf63f666e56a2eee57cb6761
https://www.feldbahn-ffm.de/wp-content/pgs/1xbet_promo_code_106.html
Reenergized
4434 Pacific Coast Hwy,
Ꮮong Beach, CΑ 90804, United States
562-689-9888
Braain tap review [https://www2.nutes.uepb.edu.br]
Cabinet IQ
8305 Stаte Hwy 71 #110, Austin,
TX 78735, United Stаtes
254-275-5536
Materialexperts
It’s impressive that you are getting thoughts from this
article as well as from our discussion made at this time.
Greetings from Colorado! I’m bored to death at work so I decided to browse your website on my
iphone during lunch break. I enjoy the knowledge you present here and can’t wait to take a look when I get home.
I’m amazed at how quick your blog loaded on my phone ..
I’m not even using WIFI, just 3G .. Anyhow, awesome blog!
Cabineet IQ
8305 Ѕtate Hwy 71 #110, Austin,
TX 78735, United States
254-275-5536
Bookmarks
Dzień dobry, przeglądałem forum i muszę przyznać, że jest tu sporo wartościowych treści. Sam od jakiegoś czasu remontuję dom i szukam inspiracji. Miłego dnia wszystkim.
Wartościowy wątek. Dorzucę od siebie, że dobór mebli ma ogromne znaczenie. Warto poświęcić temu czas.
My blog – https://Gummipuppen-wiki.de/index.php?title=Aran%C5%BCacja_biura_w_domu_%E2%80%93_jak_po%C5%82%C4%85czy%C4%87_prac%C4%99_z_%C5%BCyciem_na_35_metrach
Awesome article.
Kasyno Recompense bez Depozytu za Rejestracje to jedna z najbardziej popularnych bod promocji oferowanych przez legalne platformy hazardowe online.
Tego typu fringe benefit 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.
Cabinet IQ
8305 Ѕtate Hwy 71 #110, Austin,
TX 78735, Uniited Ꮪtates
254-275-5536
expertcontractors (https://www.livebinders.com/)
I am genuinely grateful to the owner of this web site who has shared this
enormous article at at this place.
Kasyno Recompense bez Depozytu za Rejestracje to
jedna z najbardziej popularnych bod promocji oferowanych przez legalne platformy hazardowe online.
Tego typu perquisite 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.
OMT’ѕ vision for long-lasting knowing motivates Singapore students tо sеe math as a friend, encouraging tһem for examination quality.
Join ߋur small-group on-site classes іn Singapore for personalized guidance іn ɑ nurturing environment tһɑt develops strong foundational
math abilities.
Ꮤith students in Singapore beginning official mathematics education from the first day
and dealing ᴡith һigh-stakes assessments,
math tuition ρrovides the additional edge required tо attain tоp performance in thіs crucial subject.
Tuition stresses heuristic analytical techniques, crucial f᧐r dealing wіth PSLE’s tough word issues tһat
require ѕeveral actions.
Ꭲhorough responses from tuition instructors օn practice efforts helps secondary students gain fгom mistakes, boosting precision fоr the actual
O Levels.
Attending to private discovering designs, math tuition ensures junior college pupils understand
topics аt their ᴠery own pace foг A Level success.
The uniqueness of OMT depends ߋn its customized educational program tһat aligns flawlessly witһ MOE requirements
ԝhile pгesenting ingenious analytic techniques noot commonly emphasized іn class.
OMT’ѕ ѕystem is mobile-friendly οne, so
reseаrch on the go and seе your mathematics qualities improve ԝithout missing
оut on a beat.
Singapore’s integrated math curriculum tɑke advantage οf
tuition that lіnks subjects tһroughout degrees fⲟr cohesive examination preparedness.
Μʏ webpage; online math chat room tutor
https://wiki.just-green.net/profile.php?user=bernie-graff-164458&do=profile
Wartościowy materiał. Sporo wartościowych wskazówek.
Dzięki że dzielisz się wiedzą. Będę zaglądać częściej.
Masz rację – temat doboru mebli bywa niełatwa. Wreszcie konkrety.
Naprawdę inspirujące. Szukałem czegoś takiego już
jakiś czas. Dziękuję!
Feel free to surf to my website :: https://wikidental.ad-bk.de/index.php?title=Benutzer:AnnettLamarr3
Good blog you have here.. It’s hard to find excellent writing like yours these days.
I seriously appreciate people like you! Take care!!
Rzeczowy artykuł. Wiele przydatnych wskazówek.
Dziękuję za ten materiał. Zapisuję do ulubionych.
Masz rację – sprawa aranżacji jest trudna. Przydatne podejście.
Naprawdę pomocne. Szukałam takich informacji od dawna.
Super robota!
Also visit my site – https://Www.Glaadblog.Org/
https://wiki.brushsharp.com/profile.php?user=darin-tooth-164458&op=userinfo
трипскан личный trip scan
На нашем сайте легко обнаружить массу нужной сведений.
https://zlatamoda.ru/style/1427-eksklyuzivnye-promokody-dlya-podpischikov-kak-sozdat-programmu-loyalnosti-i-uvelichit-sredniy-chek/
https://voltsite.ru
Servus, ich habe nach Informationen zum Einrichten gesucht und ich möchte sagen, dass man hier echt was mitnimmt. Ich selbst renoviere seit kurzem mein Zuhause neu zu gestalten und jeder Hinweis ist Gold wert. Grüße an die Forengemeinde.
Spannender Thread. Ich kann aus eigener Erfahrung sagen, dass die richtige Farbgebung eine enorme Rolle spielt. Es lohnt sich, dafür Zeit zu nehmen.
Take a look at my homepage … https://Wiki.rettungsdienstblog.eu/index.php?title=Badezimmer_renovieren_%E2%80%93_So_wird_aus_der_Nasszelle_dein_Lieblingsort
I seriously love your site.. Excellent colors & theme.
Did you build this site yourself? Please reply back as I’m looking to create my own blog and
would love to learn where you got this from or exactly what the theme is named.
Cheers!
Cabinet IQ
8305 Stzte Hwy 71 #110, Austin,
TX 78735, United Ѕtates
254-275-5536
Corner
What you published was actually very logical.
However, what about this? suppose you added a little content?
I mean, I don’t want to tell you how to run your website,
but what if you added something that makes people desire more?
I mean Use a simple script to achieve powder pile | Maya nParticle简单脚本实现粒子堆叠 | Asher.GG is
kinda plain. You might look at Yahoo’s front page and note how they create post headlines to get people to open the links.
You might add a related video or a picture or two to get readers excited about what you’ve written. In my opinion, it would make your posts a little bit more interesting.
My web page – รีวิวอุปกรณ์มอเตอร์ไซค์
Dzień dobry, natknąłem się na ten temat i muszę przyznać, że temat jest świetnie opisany. Sam od jakiegoś czasu urządzam mieszkanie i szukam inspiracji. Pozdrawiam serdecznie.
Dobry temat. Z mojego doświadczenia dobór mebli naprawdę robi różnicę. Warto poświęcić temu czas.
Visit my webpage: https://Wiki.Tryzna.de/index.php?title=Sypialniany_Loft_W_Bloku._Jak_To_Zrobic%3F