 |  | | Script- how to find a object position when rendering? |
|  |
Posted: Tue Jan 26, 2010 12:33 am |
|
|
| CodeRedFox |
|
|
 |
| Joined: 26 Jan 2010 |
| Posts: 2 |
|
|
|
 |
 |
 |
|
Script to update a object position.
Its being used as a script test but in the code below I just posted a operator script test for visual feedback
The issue I'm having is that at render time the distance calculation does not get updated. It will update if you manually click ahead on the time slider. But this number will not update at render time. If anyone can give me some help I would really appreciate it.
Steps to reproduce:
- Create a basic particle system with a script operator
- Create two objects Point01 and Point02
- Animate those two object doing any kinda of XYZ movement
- Open Particle Flow
- Open your max script listener
- Scrub the timeline and watch the output number change
- Number should update the distance between objects
-----
- Now with your listener open render a few frames (can be blank frame/no output)
- Output number do not change!
| Quote: |
on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useSpeed = true
pCont.usePosition = true
)
on Init pCont do
(
)
on Proceed pCont do
(
Print (distance (at time currenttime $Point01.pos) (at time currenttime $Point02.pos)) -- $Point01.pos and $Point02.pos are objects
)
on Release pCont do
(
)
|
Thank in advance, this problem is killing me. |
|
|
|
|
 | |  |
Posted: Tue Jan 26, 2010 11:32 am |
|
|
| Galagast |
|
 |
 |
| Joined: 22 Feb 2005 |
| Posts: 732 |
| Location: Philippines |
|
|
 |
 |
 |
|
Hi, try using pCont.getTimeEnd() instead of currentTime.
create a Text object and use this script:
| Code: |
on Proceed pCont do
(
t = pCont.getTimeEnd()
$text01.baseobject.text = (distance (at time t $Point01.pos) (at time t $Point02.pos)) as string
)
|
 |
|
_________________ Jeff Lim |
|
|
|
 | |  |
Posted: Tue Jan 26, 2010 3:26 pm |
|
|
| CodeRedFox |
|
|
 |
| Joined: 26 Jan 2010 |
| Posts: 2 |
|
|
|
 |
 |
 |
|
Thanks for taking a look
That didnt seem to work either, maybe I'm not setting something up right.
I passed a test file to a few pflow guys and they had no luck. Always ending with try on of the pflow box. But if the standard maxversion cant process it I dont have the time right now to hope a box upgrade will do it. In the mean time a "PFlow Baker" by Ofer Zelichover has at least been able to reproduce it to a point I can render it properly.
So maybe I'm just missing a bit of code that will update object position pre frame like you have above. But so far no one knows. |
|
|
|
|
Posted: Tue Jan 26, 2010 9:14 pm |
|
|
|
|
| Orbaz Technologies Forum Index » Scripting Particle Flow |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
|
Copyright© 2004-2005 Orbaz Technologies, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group phpBB Style by Vjacheslav Trushkin
|