Jump to content

Getting The Unique Id Of An Op


Recommended Posts

is there a way without using the HDK to get the unique ID of an op? I see in the class definition of OP_Node, it has an INT unique ID. Also, is this actually the case - is every OP guaranteed of having a unique id?

if this is the case, and there isn't already a function, it would be handy to have a function which retrieves this, although i suppose in many cases it's also a recipe for disaster. every time you loaded in the hip file the numbers would be different.

also, how does this work with OTLs? if i have 5 identical OTLs and they all have a "point1" sop in them, do the 5 "point1" sops each have a unique id??

thanks,

alan

Link to comment
Share on other sites

okay, i'm partly answering my own question. yes, each node has a unique ID and the nodes of multiple instances of an OTL have different values. i wasn't sure if laying down an OTL is actually laying down an op network or reusing the same one, like a programming function would do.

still don't know if there's a handy function to get it.

Link to comment
Share on other sites

Your answers to your question are correct. Each node has a unique id assigned to it when it is created. That id is globally unique for the whole hip file. I believe that the id is not guaranteed to be the same when you load a hip file as when you save it (depending on save order, presence of locked assets, etc). And no, there is no such function. But as I'm sure you know it would take about 10 seconds to implement one with the HDK...

Mark

Link to comment
Share on other sites

true, but we're trying desperately to keep our custom ops to a minimum. otherwise poor king tapir has the responsibility of recompiling them all every time we get a new version of houdini.

i've decided to create an uber-sop that does all the silly little things that need doing. it'll be ugly.

thanks mark

Link to comment
Share on other sites

  • 11 years later...

Hey, resurrecting 11 years old post is not a big deal right? :P I NEVER needed an unique ID for a years! But now this is what i'm looking for. We have hou.Node.sessionId() but it's valid for current session only.

Ideally i would like to have hou.Node.uniqueId() and hou.nodeById()

It's really rarely needed, but in my case would be a solution.

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