sibarrick Posted April 14, 2006 Share Posted April 14, 2006 Hi, anyone got any pointers on using groups in HDK sops? I've used the flatten.C example and I can pass groups into the sop via a group menu but how do you set it up so that the user can interactively select points or whatever from the viewport directly? Either on creation of the node or when they hit reselect. cheers Quote Link to comment Share on other sites More sharing options...
edward Posted April 14, 2006 Share Posted April 14, 2006 I think you need to do it by running an omsbind hscript command. For some examples, you can check out $HH/OPbindings ... esp. the bindselector stuff. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 14, 2006 Author Share Posted April 14, 2006 cheers Edward I'll check it out Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 17, 2006 Author Share Posted April 17, 2006 That does it, but you can only have one OPbindings file? If I make one in my $HOME directory it reads that one and not the normal one as well, that means you have to edit the distributed one which is something of a pain, is that correct? Quote Link to comment Share on other sites More sharing options...
edward Posted April 17, 2006 Share Posted April 17, 2006 Yes. However, did you manage to use omsbind instead? If that works, you can run it in when the node is created or something perhaps? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 17, 2006 Author Share Posted April 17, 2006 Oh I see, I didn't follow what you meant, I guess I make a create script to do it. cheers. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 17, 2006 Author Share Posted April 17, 2006 Ok, so that kinda worked, but of course because its a creation script it doesn't get run til after the node is created. So re-selecting now works but when you put the first node down it doesn't work. So in the end I've put it in my 456.cmd, I guess that's ok, feels a bit hacky but it works. cheers. Quote Link to comment Share on other sites More sharing options...
edward Posted April 18, 2006 Share Posted April 18, 2006 Maybe you could try doing this ... UT_String cmd; cmd = "omsbind ...."; OPgetDirector()->getCommandManager()->sendInput(cmd); ... in your newSopOperator() function right after you added your operator table entry. This will only work if the omsbind command is installed prior to your newSopOperator() function being called though. Might be worth a try anyhow. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 18, 2006 Author Share Posted April 18, 2006 Cunning! I'll give it a go. I didn't know you could perform such trickery! Quote Link to comment Share on other sites More sharing options...
edward Posted April 18, 2006 Share Posted April 18, 2006 I didn't say it would work. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 19, 2006 Author Share Posted April 19, 2006 Close, but no banana. If I put it in the newSopOperator function houdini complains on start up of an unknown function omsbind, so I guess sops are declared before hscript? I can move it to my sop constructor and then it will work but only after you have put down one sop, so a little like the creation script problem (unsurprisingly) So it's a pay off between having it always work and easy of install... Maybe you could think about adding a "before first cook" type of function call for nodes so that this sort of thing could be handled there. Or is there such a thing already? Quote Link to comment Share on other sites More sharing options...
edward Posted April 20, 2006 Share Posted April 20, 2006 It can always be an easy install by appending to the user's 456.cmd I don't think there's such a thing as a "before first cook" because there wouldn't be a sensible time to run it. Another attempt would be to create your own HDK command and see if that gets loaded after omsbind. But this is all really more trouble than it's worth. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 20, 2006 Author Share Posted April 20, 2006 I don't think there's such a thing as a "before first cook" because there wouldn't be a sensible time to run it. 26704[/snapback] Well I guess I meant a before first created really. Just like hda's. So after the user has selected the node but before it has arrived in the network..... Actually thinking about it some more, it has to go in the 456.cmd because I assume omsbind commands aren't stored in the hip file, so if you had existing nodes and wanted to use re-select then it would fail until you put down a new version. Can you have more than one 456.cmd in your path? That would help a lot, I don't really like the idea of having to get people to keep editing that file just to install/uninstall sops. Quote Link to comment Share on other sites More sharing options...
Jason Posted April 20, 2006 Share Posted April 20, 2006 Nope, it always loads the last 456.cmd in the HOUDINI_PATH. We have one "real" 456.cmd and have a few source statements in it to cascade through the path. 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.