Jiceq Posted January 31, 2018 Share Posted January 31, 2018 Hi, this is my first post in the forum, ive been a maya user for quite a long time and now im tinkering with Houdini. In Maya im able to embed custom attribute values in a node and retrieve its UUID, which is a unique identifier per node. Im trying to figure out if its possible in Houdini to identify uniquely assets much the same way as in Maya. Does the concept UUID relate to Houdini? if not, is there anything similar allowing to uniquely identify objects in the scene? Thanks, looking forward to contribute to this forum a lot in the future. Quote Link to comment Share on other sites More sharing options...
Alexey Vanzhula Posted January 31, 2018 Share Posted January 31, 2018 23 minutes ago, Jiceq said: Hi, this is my first post in the forum, ive been a maya user for quite a long time and now im tinkering with Houdini. In Maya im able to embed custom attribute values in a node and retrieve its UUID, which is a unique identifier per node. Im trying to figure out if its possible in Houdini to identify uniquely assets much the same way as in Maya. Does the concept UUID relate to Houdini? if not, is there anything similar allowing to uniquely identify objects in the scene? Thanks, looking forward to contribute to this forum a lot in the future. 1. hou.Node.sessionId method: http://sidefx.com/docs/houdini/hom/hou/Node.html 2. hou.nodeBySessionId() 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted January 31, 2018 Share Posted January 31, 2018 (edited) You can use the node path. All node paths/names in Houdini are unique. Edited January 31, 2018 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Alexey Vanzhula Posted January 31, 2018 Share Posted January 31, 2018 (edited) 6 minutes ago, Atom said: You can use the node path. All node paths/names in Houdini are unique. The node can be renamed by user. sessionID is not attached to the name(path) Edited January 31, 2018 by Alexey Vanzhula Quote Link to comment Share on other sites More sharing options...
Atom Posted January 31, 2018 Share Posted January 31, 2018 SessionID has it's caveats as well. Depends upon what you want to do. Quote So there may be a Node with the same session id as a NetworkBox. Quote Link to comment Share on other sites More sharing options...
Alexey Vanzhula Posted January 31, 2018 Share Posted January 31, 2018 (edited) 10 minutes ago, Atom said: SessionID has it's caveats as well. Depends upon what you want to do. 1. hou.nodeBySessionId(ID) 2. hou.networkBoxBySessionId(ID) Jiceq want to get node by ID, so he should use hou.nodeBySessionId(ID) Edited January 31, 2018 by Alexey Vanzhula Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted February 1, 2018 Share Posted February 1, 2018 It's a coincidence that I'm working on the tools that require unique node identifiers. Unluckily Houdini doesn't provide us with a persistent UID which would be saved in a Hip file, only in the duration of the session, which is kinda useless in my opinion. Despite the fact that I don't like Maya, there is a unique ID attached to each Maya node and this guarantees that knowing the UID you can always retrieve the node. So in Houdini you can't rely on the node names since they inconsistent. What I ended up with is that I'm generating a UID by myself for every node I'm creating in the script. import hashlib, time def generate_uid(node): hash = hashlib.md5() hash.update(node.path() + str(time.time())) node.setUserData('uid', hash.hexdigest()[:10]) # To get the value: node.userData.get('uid') And there you go, you have a UID system in Houdini. 5 Quote Link to comment Share on other sites More sharing options...
animatrix Posted February 1, 2018 Share Posted February 1, 2018 I created an RFE for having a GUID before. It could be generated automatically by Houdini on demand thus it wouldn't impact anything unless you access the property on a node instance for example. I also think session ids are useless. Quote Link to comment Share on other sites More sharing options...
Jiceq Posted February 7, 2018 Author Share Posted February 7, 2018 What i ended up doing since session ids can be shared between different nodes of different categories according to documentation is a combination of the "session id" + "nodetype" + "nodetypeCategory". I think this guarantees a unique id. In order to use the hou.getNodeBySessionId() i check the node with nodetype and nodetypecategory and thats all. Quote Link to comment Share on other sites More sharing options...
kiryha Posted January 17, 2019 Share Posted January 17, 2019 According to userData() tips in docs if I prefix key with "nodeinfo_" prefix I should see it in Node Info window. It does not work for me... 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.