[Solved] Getting texture resolution

   2332   1   0
User Avatar
Member
184 posts
Joined: June 2010
Offline
Hi,

I'm building an otl for creating in-game UI elements & schemas. For this I need to know the resolution of the texture/s being used at the time.

I know I can easily get size from a COP 2 Net -> File node, but the problem is that the node won't read a pasted Relative Reference for it's file input, referenced from the upper level SOP interface (i.e. chs(“../../tpage”)).

The only reference to image resolution I can find in the docs is the COP VOP node Resolution (http://www.sidefx.com/docs/houdini12.5/nodes/vop/res [sidefx.com])…inspecting the inline code for this leads me to the VEX functions ixres/iyres…again, COP contexts. Before I delve into VOPs to figure out how to expose these outputs, am I just going to end up with the same problem (input can't take a reference from my Obj interface)?

Is there a better (simpler) way to go about this? It seems a lot of hoops to jump through just to get the dimensions of a texture file.

Thanks in advance.
User Avatar
Member
184 posts
Joined: June 2010
Offline
Sorted. I got a solution to this over on odforce: hou.imageResolution(), and discovered res() for updating the COPs.

Cheers
  • Quick Links