Kappy Posted February 9, 2013 Share Posted February 9, 2013 Hi, I'm currently trying to implement a C++ library to read/write the new JSON .bgeo format, and I'm having extreme difficulty. I'm using the UT_JSONParser and UT_JSONHandle classes included in the HDK, since their use doesn't consume a Houdini license. I've figured out that I have to subclass UT_JSONHandle and override the json* and ua* callback methods. Then I just call the parser like this: UT_JSONParser parser;Geo *my_geo_obj = new Geo()UT_JSONHandle *handle = new Geo_JSONHandle( my_geo_obj );UT_IStream *is = new UT_IFStream("/tools/apps/houdini/hfs12.1.125/houdini/geo/defgeo.bgeo", UT_ISTREAM_BINARY);parser.parseObject( *handle, is );[/CODE]So far, though, all I'm able to do is print out the stream from the parsed JSON, but not organize it into any meaningful structure. The nested multi-typed data seems too unwieldy, without either a fairly sophisticated state machine, an extremely type-flexible hierarchical data structure, or both. I'm thinking there must be an easy way to do this. I know there's a Python implementation that ships with Houdini, but that's not proving too useful. Has anyone out there had any success at using these UT_JSON* libraries? Thanks!-James 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.