MJNorris Posted March 13, 2018 Share Posted March 13, 2018 Hi there, I'm trying to set custom data as meta data using the mantra render attribute: "vm_image_exr_attributes" according to the docs i should be able to parse the attribute a python dictionary object, however whenever I try to do this: test_dict = {"count" : 0, "path" : "/jobs/"} my_node.parm("vm_image_exr_attributes").set(test_dict) I get the following error: TypeError: in method 'Parm_set', argument 2 of type 'std::map<std::string,std::string,std::less<std::string >,std::allocator<std::pair<std::string const,std::string > > > const &' What I am trying to achieve is a dictionary comprised of file paths that I can then check in nuke. Can anyone shed any light on this? thanks Quote Link to comment Share on other sites More sharing options...
3dome Posted March 13, 2018 Share Posted March 13, 2018 i don't think you can parse it a python dict. What it does is it interprets the string you enter in that field as a python dict. If you feed it {"count":0, "path":"/jobs/"} it should work if you want to work with parsing it a dict then you will have to convert the dict into a string I guess Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted March 13, 2018 Share Posted March 13, 2018 You should be able to use python's json module to encode and decode that from dict to string or vice versa https://docs.python.org/2/library/json.html Quote Link to comment Share on other sites More sharing options...
MJNorris Posted March 14, 2018 Author Share Posted March 14, 2018 Thanks for the help, makes a lot more sense, although I'm finding it a bit temperamental, sometimes working, sometimes not. I'll keep investigating. Thanks again 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.