Jump to content

Using Groups


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

It can always be an easy install by appending to the user's 456.cmd :P

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...