A place to talk about CG particles...
login.php profile.php?mode=register faq.php memberlist.php search.php index.php

Orbaz Technologies Forum Index » Scripting Particle Flow » Script- how to find a object position when rendering?
Post new topic  Reply to topic View previous topic :: View next topic 
Script- how to find a object position when rendering?
PostPosted: Tue Jan 26, 2010 12:33 am Reply with quote
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.
View user's profile Send private message
PostPosted: Tue Jan 26, 2010 11:32 am Reply with quote
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
)


Very Happy

_________________
Jeff Lim
View user's profile Send private message
PostPosted: Tue Jan 26, 2010 3:26 pm Reply with quote
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.
View user's profile Send private message
PostPosted: Tue Jan 26, 2010 9:14 pm Reply with quote
Galagast
Joined: 22 Feb 2005
Posts: 732
Location: Philippines




Hi, I attached a max file below. If you render it, you can see the text object updating.

I hope that helps. Very Happy



pf_test_dist_update.zip
 Description:
max9

Download
 Filename:  pf_test_dist_update.zip
 Filesize:  21.69 KB
 Downloaded:  113 Time(s)


_________________
Jeff Lim
View user's profile Send private message
Script- how to find a object position when rendering?
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  

  
  
 Post new topic  Reply to topic  


Copyright© 2004-2005 Orbaz Technologies, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group
phpBB Style by Vjacheslav Trushkin