Syntax / functions to get world x,y,z into an attribute?

   2036   2   0
User Avatar
Member
20 posts
Joined: July 2012
Offline
Hi, I have a situation like this:


/obj/Geometry:

Sphere (or some dummy object)
|
xform (rotating arbitrarily)



/obj/AutoDopNetwork:

pyro node - (attributes) - Wind Tunnel


I want to get the direction the xform node is facing to be the wind tunnel direction for the pyro sim, but I'm getting stuck on how. In Maya, I would drop a locator parented under the node, offset it by one unit in X, and send its WorldPosition where I want it to go.

I imagine there's an elegant way to do this in Houdini, so what would you recommend?
Edited by - July 17, 2012 15:50:24
User Avatar
Member
20 posts
Joined: July 2012
Offline
So far I've tried these with no luck… I don't get errors or anything, but the channel stays at value ‘0’ even though ‘windtarget’ is transformed.


`chsop(“/obj/arrow_origin_ref/windtarget.position.x”)`

`origin(“”,“/obj/arrow_origin_ref/xform3”,“TX”)`
`origin(“”,“/obj/arrow_origin_ref/xform3”,“TX”)`

`vorigin(“”,“/obj/arrow_origin_ref/windtarget”).x`
`vorigin(“”,“/obj/arrow_origin_ref/windtarget”).x`

Also tried ‘vtorigin’.

I'm guessing it doesn't work because these are sops and not objects. I'll try with a point and ‘prim’, see if that works better.
User Avatar
Member
20 posts
Joined: July 2012
Offline
BACKTICKS!

It was the backticks. It didn't like them.


For whoever cares, this worked great:

in /obj/my_geometry:

Grid (rows=1 cols=1)
|
group (group name = windtarget)
|
merge (merged with rest of geometery)
|
xform (animated rotating)
|
delete (delete nonselected, group ‘windtarget’)
|
Null (named ‘windtarget’)



In dopnet, in the pyro node:

X = prim(“/obj/arrow_origin_ref/windtarget”,0,“P”,0)
Y = prim(“/obj/arrow_origin_ref/windtarget”,0,“P”,1)
Z = prim(“/obj/arrow_origin_ref/windtarget”,0,“P”,2)
  • Quick Links