Adam T Posted July 21, 2013 Share Posted July 21, 2013 (edited) Hi guys, I just tried asking this over on the official forums, but they died on me just as I hit submit so I've no idea if it was posted or not. Simply put, I'm looking for a way to get the resolution of a texture, specified in a SOP operator. I can get size from a COP 2 NET -> File node, but it seems I have to trigger the COP to update the size parameter - the only way I can see to do this is to physically switch to a compositor view. Is there either: i) A way to force the COP to update when I change the texture reference in my SOP or ii) A more elegant way of going about this? Perhaps through hscript/python or VEX, though I see the Resolution node and ixres/iyres functions are all COP context...I assume they'd leave me with the same issue? Any pointers appreciated. Thanks in advance. Edited July 21, 2013 by Adam T Quote Link to comment Share on other sites More sharing options...
anim Posted July 21, 2013 Share Posted July 21, 2013 you can use res() expression to get resolution of the COP node, it'll force it to update if necessary or if you want to avoid COPs you can use hou.imageResolution() to get resolution of image file directly res_of_the_image.hip 6 Quote Link to comment Share on other sites More sharing options...
Adam T Posted July 21, 2013 Author Share Posted July 21, 2013 Brilliant - both are great. Thanks Tomas, much appreciated! Quote Link to comment Share on other sites More sharing options...
Mykolas Posted August 4, 2014 Share Posted August 4, 2014 you can use res() expression to get resolution of the COP node, it'll force it to update if necessary or if you want to avoid COPs you can use hou.imageResolution() to get resolution of image file directly I was searching for that kind of elegant solution for a while. Thank you very much for your tip. Quote Link to comment Share on other sites More sharing options...
tfreitag Posted August 16, 2014 Share Posted August 16, 2014 yeess!! thanks anim thats all i needed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.