Atom Posted December 4, 2014 Share Posted December 4, 2014 (edited) Hi All, Is there any way to store a collection in a node? I checked the parameter list and there does not seem to be a list or collection property available. IS there any other way to attach a list to a node? Thanks Edited December 4, 2014 by Atom Quote Link to comment Share on other sites More sharing options...
jonp Posted December 4, 2014 Share Posted December 4, 2014 You can turn a parameter into a menu and store values that way. Or, I don't know if you want to use python for this but if you can you can pickle a list, store it as user data on the node and then unpickle and retreive it later. import json node = hou.node('/path/to/node') my_list = range(1,10) # store the list on the node node.setUserData('my_list', json.dumps(my_list)) # get the list back list_copy = json.loads(node.userData('my_list')) print list 1 Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted December 4, 2014 Share Posted December 4, 2014 In the past I've used pickle for this. Looks like json does a similar thing? https://docs.python.org/2/library/pickle.html It can be done at the node instance level like the example jonp posted and it can also be done at the OTL level so the data is persistent. http://www.sidefx.com/docs/houdini13.0/hom/hou/HDADefinition#setExtraInfo 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.