pane command for IPR viewer

   2583   2   0
User Avatar
Member
12461 posts
Joined: July 2005
Offline
Hi all,

Does anyone know of the right way to extract infomation from the IPR viewer? It seems like the “iprview” command only lets you set 2 things (not the ROP to render from) and, mostly importantly, doesn't let you extract information. I would like to get the information about which ROP is pointed to in the IPR viewer.

I was trying to experiment with the dragdrop.cmd ipr viewer pickscript; I was adding the condition when it encounters a light dropped on an object. I was going to snap the object to the reflection vector in order to get the specular to appear in the location you dropped the light, but I've run into several problems:

*/ Getting the information from the viewer on which ROP was rendered. This is so that I can find out which camera was used.
*/ There is no good or easy way to query the true rendered normal, unless you force the user to output the Normal in the deep raster settings of the ROP. The pickscript could set this up if the above point is possible. Also the big issue is that the hscript vector and matrix support is terribly weak compared to the lovely power in the VEX vector and matrix functions. I so wish we could script in VEX. (big hint!). There is also no way I know of to query into the actual IPR file on disk to extract the norrmal information. There is also missing light transform information that you'd need to do this.
*/ So I decided that I will have to query the primitive normal of the object under the cursor - which is OK, but not a great solution considering that a lot of the time we Render From File and so the primitive normal information is not available inside of Houdini. This and primitive types make this approach not ideal but probably workable.

Anyhow, I'd love to complete this snippet from ipr/dragdrop.cmd:




else if ( $type == “obj:light” ) then
set prim = `iprquery(“object.primitive”, $pane, $px, $py)`
set objsop = $obj/__render_sop__
set N =
set N = `vector($N)`
set P =
set P = `vector($P)`
set Light = `vtorigin(“”,$name)`

### the “i wish” portion
#set L = `$Light-$P`
#set Eye = `vtorigin(“”,chs(“$the_rop_from_iprviewer/camera”))`
#set I = `$Eye - $P`
#set R = `reflect($I,$N)`
#set distFromSurface = `length($L)`
#set newLight = `$P + normalize($N)*$distFromSurface`
#opparm $name t ( $newLight )
###…. or something like this.

echo $pane:Moving the light $name to get reflection angle for ($prim) P:$P Light:$Light N:$N




Any ideas how I can do this in the best way? Vector math and reflection code stuff notwithstanding… :wink:
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
1002 posts
Joined: July 2005
Offline
jason_iversen
*/ Getting the information from the viewer on which ROP was rendered. This is so that I can find out which camera was used.

I believe you should be able to use iprquery(“rop”) to get the string path for the ROP node that was rendered. You can use iprquery(“render.name”) to get the renderer type that was used (eg. VMantra or RIB).

jason_iversen
*/ There is no good or easy way to query the true rendered normal, unless you force the user to output the Normal in the deep raster settings of the ROP. The pickscript could set this up if the above point is possible. Also the big issue is that the hscript vector and matrix support is terribly weak compared to the lovely power in the VEX vector and matrix functions. I so wish we could script in VEX. (big hint!). There is also no way I know of to query into the actual IPR file on disk to extract the norrmal information. There is also missing light transform information that you'd need to do this.

I'm thinking that the deep raster solution is probably the best in this case. You could even set up the shader so that the reflection vector is output, so that you don't need to do this in hscript. This way, most of the processing could be done in vex. The IPR cache file does not store a raster of normal information, so it would not make sense to query this information directly from the file.

Andrew
User Avatar
Member
12461 posts
Joined: July 2005
Offline
andrewc
I believe you should be able to use iprquery(“rop”) to get the string path for the ROP node that was rendered. You can use iprquery(“render.name”) to get the renderer type that was used (eg. VMantra or RIB).

Of course, sorry about that - I will try that now. However, this *should* be possible, no? It seems like it would be logical for any hscript process to query the pane settings and not have to query the ipr buffer at all.

I'm thinking that the deep raster solution is probably the best in this case. You could even set up the shader so that the reflection vector is output, so that you don't need to do this in hscript. This way, most of the processing could be done in vex. The IPR cache file does not store a raster of normal information, so it would not make sense to query this information directly from the file.

I was kinda hoping to make it as generic support as possible, although the reflection vector method would be the easiest to compute because as you say, it's VEX. I'd really hate to force every shader we use to have this written into it.

Any chance of having all the cool (applicable) VEX functions pulled into hscript? Perhaps there is an “automatic” way?

Thanks for your reply, Andrew

Jason
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
  • Quick Links