magneto Posted February 11, 2012 Share Posted February 11, 2012 So I am watching the 3dbuzz videos and in one of the videos, they show how to transform the last point using the Transform SOP and writing this into the group field: `$NPT-1` but when I do it in H11, it says "Undefined variable (group)". Right now I created a group to do this, so it works but how are they able to do this in 9.5? Is something changed since then? Also I set the Group Type to "Points" like in the video: Thanks Quote Link to comment Share on other sites More sharing options...
Macha Posted February 11, 2012 Share Posted February 11, 2012 Don't have H with me now, but what happens if you type 'npoints(opinputpath(".",0))-1' Quote Link to comment Share on other sites More sharing options...
magneto Posted February 12, 2012 Author Share Posted February 12, 2012 I get invalid group but as a warning and transforming doesn't do anything. But if I enter the last point index manually, then I can see the change. So not sure what's going on Quote Link to comment Share on other sites More sharing options...
Macha Posted February 12, 2012 Share Posted February 12, 2012 (edited) To further test this, what happens if you type tgat expression into a spare parameter and then reference it in the group parameter? Int to string maybe? Edited February 12, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
magneto Posted February 12, 2012 Author Share Posted February 12, 2012 I pasted the same expression you posted into PivotY (py), and then looked up the current value and it was the correct number. Then wrote this into the group: `chs("py")` and it worked. So this is a bug then? In fact, writing it as: `ch("py")` automatically turns it into: `chs("py")` Thanks Quote Link to comment Share on other sites More sharing options...
gaurav Posted February 12, 2012 Share Posted February 12, 2012 (edited) I get invalid group but as a warning and transforming doesn't do anything. So not sure what's going on Works for me. Funny thing is that, even if i leave the back tick at the end, it evaluates as string. Is it something expected ? EDIT- Though as a good procedural hygiene i will never use something like that in group filed for any op. In group sop i trust. Edited February 12, 2012 by vectorblur Quote Link to comment Share on other sites More sharing options...
axebeak Posted February 12, 2012 Share Posted February 12, 2012 Also, you can try using `eval("$NPT-1")` - works for me in H11.0. Quote Link to comment Share on other sites More sharing options...
magneto Posted February 12, 2012 Author Share Posted February 12, 2012 Wow I am surprised, I tried `eval("$NPT-1")` but still same result. My build is in the 70s though, but axebeak said he is using 11.0, so not sure. Also is using this technique not procedural? I thought it's just some expression Quote Link to comment Share on other sites More sharing options...
gaurav Posted February 13, 2012 Share Posted February 13, 2012 (edited) Wow I am surprised, I tried `eval("$NPT-1")` but still same result. My build is in the 70s though, but axebeak said he is using 11.0, so not sure. Also is using this technique not procedural? I thought it's just some expression Indeed it is. But the point i was trying to make was more of a standard practice used with the large scripts or tool built for others. True it is just an expression and most of the sops which have group field will work with it. Yes its handy too if you quickly want to do a test on specific selection. For me, Its more of a organizing work flow, commenting script so its easy to read, debug and edit not only for me, but for others too. And with group sop, one can rest assured that selection will be available further down the chain at any point. In the end Houdini gives freedom so use it as you like. Cheers, Edited February 13, 2012 by vectorblur 1 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.