- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As the title says I am trying to create curves from nParticles. With a little turbulence they make great organic lines.
I found this tutorial that shows just that, but there have been changes to MEL since 2016 apparently. https://www.youtube.com/watch?v=yiLZAz1L41M&t=349s
It works by creating a curve segment every 5 frames. The script bits go in the nParticleShape node/Per Particle (Array) Attributes.
I get errors about attributes not found. Can someone with more experience help me with this? Thanks.
Here is the original code:
CREATION:
vector $pos = particleShape1.position;
string $curveName = "curve_" + particleShape1.particleId;
int $objTest = `objExists $curveName`;
if ($objTest == 1)
{
delete $curveName;
}
curve -p ($pos.x) ($pos.y) ($pos.z) -n $curveName;
RUNTIME:
vector $pos = particleShape1.position;
string $curveName = "curve_" + particleShape1.particleId;
if (frame/5 == trunc(frame/5))
{
curve -append -p ($pos.x) ($pos.y) ($pos.z) $curveName;
}
Solved! Go to Solution.