Json file to Vex String?

   421   4   0
User Avatar
Member
811 posts
Joined: April 2017
Offline
Hi!

I know absolutely nothing about python but I'm very comfortable with vex. I would like to store a .json content on a vex string. If it's not possible to read a .json directly from a vex wrangle, can somebody tell me exactly how to do it with python? ...could be stored in a Detail attribute.

Thanks

-Olivier
Edited by olivierth - Nov. 14, 2022 12:14:14
User Avatar
Member
811 posts
Joined: April 2017
Offline
Oh, thanks for the reply!
User Avatar
Member
6417 posts
Joined: Sept. 2011
Online
animatrix_
VEX has json functions:
https://www.sidefx.com/docs/houdini/vex/functions/json_loads.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/vex/functions/json_dumps.html [www.sidefx.com]

wow, is that from when they added dict type to vex?
User Avatar
Member
3634 posts
Joined: Feb. 2012
Offline
jsmack
animatrix_
VEX has json functions:
https://www.sidefx.com/docs/houdini/vex/functions/json_loads.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/vex/functions/json_dumps.html [www.sidefx.com]

wow, is that from when they added dict type to vex?

I think so as dictionary attributes were also added in 18.5.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

patreon.com/animatrix | vimeo.com/animatrix3d
  • Quick Links