[Closed] object pos = particle pos problem
Hi all
I have a situation where i need objects to move along ‘pivot to pivot’ with particles. Getting them to move along is fine. There is a simple script in the max help that show you how to do this, also one of allan mckay’s tutorials shows this too. The problem is: the none of the objects are actually alligned exactly ‘pivot to pivot’ with their corresponding particle!
In this situation this is a big issue. If anyone could help me force the objects to behave as i have asked them to, it would be a great help.
Cheers in advance
Hey,
I wrote the following script a while back to lock objects’ position / rotation to PFlow particles using scripted controllers. It works for what I want, but if I look very closely at the pivot, the rotation is very slightly off. Is this what you’re talking about?
Cheers,
Dave
Hi thanks for the reply.
I’m having trouble getting ur script to work, does it support multiple objects ???
I basically have a simple pflow that doesn’t give birth until frame 25 and contains a total of 12 particles. The objects I’m trying to constrain are instanced omni lights which i’ve already created. If instancing is a problem, it would be ok if i had to make them all unique. Also you mensioned the rotations were slightly off, this isnt a problem, i only need the positions to be 100% locked on.
EDIT: And i get this error when trying to select multiple objects at once,
MAXScript Rollout Handler Exception: – Unknown property: “IScriptCtrl” in Controller:Position_Script <<
also i tried making them unique, didn’t work. i guess i’m still missing something
A little more explination on how to use your script would be much appreciated
Thanks
Ah, sorry about that.
Yeah – the script was actually written to do just what you’re doing… constrain lights to particles.
I’ll take a look now with a similar setup to your’s. First question though – are you running max 8?
Cheers,
Dave
This project requres max7 unfortunately. I have max8 but ultimately the final scene must be in max7. Are there elements of the script that are new to max8 and wont work in max7?
i’m interested in seeing what you come up with
Yeah, the new scripted controllers (IScriptCtrl) can use weak references to nodes in the scene, as oposed to the old “depndsOn”. If you like I can edit the script so that it works in max 7. Gimme 5 mins…
There you go… bit of an update. Thought I’d add teh scaling option too so now it’s a bit more versatile. If you wanted to extend it, you could probbaly bugger about with it and match the light’s colors to the particles.
Anyway, enjoy!
Dave
thanks for the update but i’m still having the same problem. ie. the position of the lights are still offset from the particle’s position. I posted on the orbaz forum and Oleg gave this response:
” The discrepancy in particle/object-light position is due to particle position adjustment in the following integration step. You need to “foresee” the particle position by adding the offset defined by the current particle speed and length of the integration interval. “
Now unfortunatly i’m not too good with maxscript at this current time so i’m not sure how to go about solving this issue. – could you be of further assistance ?
Hmmm… I probably could – but as with most busy people don’t have the time! In my head I think I know the maths, but it would take a bit of testing to get it right, and then to integrate it into the tool.
Strange that it doesn’t work for you. The position stuff is fine at my end…?
I’m really sorry I can’t be of more help!
Cheers anyway,
Dave