gronk33 Posted June 2, 2013 Share Posted June 2, 2013 Hi there, I’m trying to move a shape to the origin, project uvs and then move it back to its original position. I’m actually using a technique from Kim Goossen’s excellent Procedural Roads I tutorial on CMIVFX. However it’s not working. Nor does it work in the project files I downloaded as part of the course. Simply, I’m adding a transform node to my shape (call it transform1 for this example) and entering the following in tx, ty, and tz: -$CEX, -$CEY, -$CEZ This moves the circle to the origin no matter where it was in world space and allows me to project uvs easily. When I want to move my circle back to its original position I add a transform node after the projectuvs node. In the tx, ty, and tz parameters I enter: -ch(“../transform1/tx”), -ch(“../transform1/ty”), -ch(“../transform1/tz”) However it doesn’t work and my circle stays at the origin. I’ve attached my file if anyone has the time to offer suggestions. Thanks in advance! normalizeTest.hipnc Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 2, 2013 Share Posted June 2, 2013 I_Prefer_To_Do_It_This_Way.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted June 2, 2013 Share Posted June 2, 2013 you're right, it seems to be broken in current versions of Houdini $CEX, Y, Z used to give the actual value back to parameter so it can be referenced now it just using them internally and puts 0 in parameters which is very bad and it's probably breaking lot's of HDAs you can use centroid() function instead which should work Quote Link to comment Share on other sites More sharing options...
gronk33 Posted June 2, 2013 Author Share Posted June 2, 2013 You guys are great. Thanks for the fast reply. As mantragora demonstrates, centroid() in the pivot parameter works perfectly. Now my challenge is to normalize and unnormalize scaling. I'm using the following if statement in my scale parameters for the first transform: 1/if($SIZEZ>if($SIZEX>$SIZEY,$SIZEX,$SIZEY),$SIZEZ,if($SIZEX>$SIZEY,$SIZEX,$SIZEY)) It doesn't seem to be working as it should. It works when I use $CEX, $CEY and $CEZ in the transforms... But because of the value in the pivot (I think) it's not scaling around the center of the object. Second, like $CEX it seems to be broken and doesn't return anything but zero. I've attached a modified version of mantragora's file with a second branch where I try to normalize and unnormalize the scale. Thanks again if you've got any advice! P.S. I thought I was going crazy with the $CEX-not-returning-a-value problem. Anim, thanks for verifying that it's broken. I_Prefer_To_Do_It_This_Way_with_scale.hipnc Quote Link to comment Share on other sites More sharing options...
anim Posted June 2, 2013 Share Posted June 2, 2013 for scale you can use bbox() expression instead of $SIZEX, ... you don't need to use pivot and to get your transform back it's easier to use referenced transform node with Invert Transform checked to make sure it's properly transformed back (still needs proper referencable values on original SOP) normalize_with_scale_fix.hipnc 1 Quote Link to comment Share on other sites More sharing options...
gronk33 Posted June 2, 2013 Author Share Posted June 2, 2013 Wow, you rock anim. Thank you very much - it's just what I needed. Plus I get it now. 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.