[Closed] Scripting a custom wind spacewarp?
Hey all, I’ve just begun maxscripting, and I love it.
I’ve been modifying the saddle simpleMod example from the help files, to create a modifier that makes a custom sine-based modification of a geometrical object.
Now I want to make my own wind modifyer, with my own turbulence math, to affect particles.
But while I understand the maxscript syntax and the maths I want to use in my modifier, I don’t know what to write to create something that will come out as a space warp that can be bound to a particle system…
Any ideas?
Thanks,
- Jonas
I maybe be wrong but I don’t think you can with maxscript, it will only allow “simple” modifiers. Wind is a spacewarp… Sounds like SDK to me.
But there is this: Better wind from Grant Adam… maybe it is of use to you.
-Johan
‘fraid you can’t write a scripted spacewarp (there might be a maxscript-accessible plugin that does, I don’t recall).
Your options here include…
- use Particle Flow and use a script operator to affect the particles accordingly (or a third party particles plugin with similar openness to scripting)
- using PArray (or other particle systems that support the following), set the particles to coincide with mesh vertices, deform the mesh using your regular scripted modifier. Rather slow.
Thanks for the replies, guys!
I think I’ll just have to write a script operator for Pflow, then. Can I write one of those so it has a little GUI in the PFlow rollout? You know, spinners and such?
How do you mean “conincide with the mesh vertices” – using the Vector Field thingy?
Thanks,
- Jonas
nah – PArray is one of the old (but not that old) particle systems that essentially distributes its particles based on a mesh you pick. One of the distribution options is ‘at all vertices’. The other options may work as well, but I suspect the distribution would vary too much when you move the vertices around.
Oh ok, so you basically mean to distribute the particles on geometry (and stick to it), and then deform the geometry as I like, instead of making a custom wind?
I suppose that could work. But I couldn’t see why PArray would be better for that than Particle Flow?
And no, I don’t think the vector field thing would work either, because I don’t think it works with animated objects…
Thanks!
- Jonas
Correct
It wouldn’t – that’s why Particle Flow was first-mentioned But in case Particle Flow is not an option (for whatever reason), this approach should work.
Thanks, now I think I’m following.
How about particles inheriting some object motion, based on distance or something?
If for instance, I have 5-10 spheres rolling around the scene, and I want them to drive a kind of turbulence, would it be possible to make the particles inherit the sphere surfaces’ movement, based on distance to the spheres? (meaning, they shouldn’t actually stick on the surface)
(I know this is outside the scope of the original question, but hey, I’ve got your attention now. )
Thanks,
- Jonas