Jump to content

Hdk Basics


Recommended Posts

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

Thank you, edward.

Now I need to get the node's name. That is - I need to get the name of the Node that is created in the network viewer - not an arbotary node - but the node that I first compiled - and then create that node on Houdini. Is there a way to make a variable in the node's code (e.g. my_sop) that will get the name of the node as soon as the node is created in Houdini? (e.g. my_sop1, my_sop2, my_sop3, etc..)

I think that must deal with OP Node.h somehow, but not sure about that.

thanks.

Link to comment
Share on other sites

Thank you, edward.

  Is there a way to make a variable in the node's code (e.g. my_sop) that will get the name of the node as soon as the node is created in Houdini? (e.g. my_sop1, my_sop2, my_sop3, etc..)

20564[/snapback]

You might be able to do what you want with a Creation script. This is a snippet of hscript that gets run when particular node is created. Is that what you want? I'm pretty sure this is documented in the Houdini docs.

Link to comment
Share on other sites

...  Is there a way to make a variable in the node's code (e.g. my_sop) that will get the name of the node as soon as the node is created in Houdini? (e.g. my_sop1, my_sop2, my_sop3, etc..).

20564[/snapback]

Depending on where you need it, you have access to getName() from your cook method. It returns a UT_String which can be cast to a (const char *) if needed. I would avoid using or caching this method's result in the constructor, because by the time the node is constructed, I don't believe it has its correct name set yet.

Hope that helps.

George.

Link to comment
Share on other sites

Depending on where you need it, you have access to getName() from your cook method.  It returns a UT_String which can be cast to a (const char *) if needed.  I would avoid using or caching this method's result in the constructor, because by the time the node is constructed, I don't believe it has its correct name set yet.

Hope that helps.

George.

20594[/snapback]

Thanks, George. That's almost what I need. I do understand that the user may decide to change the node's name - but I think it's ok for the project I am currently working on.

Thank you, Jason, for your reply. Your suggestion is slightly different from what I need, but it can aslo be valuable.

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