Jump to content

New geo/bgeo format custom reader/writer


Recommended Posts

Hi!

I'm writing an reader/writer for another software, for the new json based bgeo (and geo) format. Right know

i'm working in the reader and i'm using the UT_JSONParser class together with the UT_JSONHandle class to process the file

using the callbacks.

I'm thinking about writing some kind of state machine to handle the actual interpretation of the file.

Say for instance the jsonString callback gets triggered and the value is "vertexattribute" then i can set

some state so that when "name" is sent to the jsonString callback i know that it is the name of the vertexattribute etc.

Iḿ doing this cause o haven't managed to figure out any other way of doing it. I guess it would have

been nice to be able to actually step through the json file e.g step to the beginning of the next

array, read the next string etc. anyone know if this is possible?

Has anyone had any attempts at writing a reader/writer for the new format? any ideas or thoughts on this?

best /christopher

Link to comment
Share on other sites

Hi!

I'm writing an reader/writer for another software, for the new json based bgeo (and geo) format. Right know

i'm working in the reader and i'm using the UT_JSONParser class together with the UT_JSONHandle class to process the file

using the callbacks.

I'm thinking about writing some kind of state machine to handle the actual interpretation of the file.

Say for instance the jsonString callback gets triggered and the value is "vertexattribute" then i can set

some state so that when "name" is sent to the jsonString callback i know that it is the name of the vertexattribute etc.

Iḿ doing this cause o haven't managed to figure out any other way of doing it. I guess it would have

been nice to be able to actually step through the json file e.g step to the beginning of the next

array, read the next string etc. anyone know if this is possible?

Has anyone had any attempts at writing a reader/writer for the new format? any ideas or thoughts on this?

best /christopher

I assume you've seen $HH/public/geo/hgeo.py?

% hython hgeo.py $HH/geo/defgeo.bgeo
+++  0.002 ( 0.002): Loading /hfs/houdini/geo/defgeo.bgeo
+++  0.002 ( 0.000): Done Loading /hfs/houdini/geo/defgeo.bgeo
+++  0.003 ( 0.000): Loaded Topology
+++  0.003 ( 0.000): Loaded Attributes
+++  0.003 ( 0.000): Loaded Primitives
+++  0.003 ( 0.000): Loaded Groups
========== /hfs/houdini/geo/defgeo.bgeo ==========
          80 Points
          96 Vertices
          12 Primitives
----- Attributes -----
Point Attributes
    numeric P[4]
12 Primitives
         12 Poly
Primitive 0 is a Poly and has 4 vertices.
  Vertex[0]->Point[3]  P= [0.5, -0.5, -0.5, 1.0]
  Vertex[1]->Point[0]  P= [-0.5, -0.5, -0.5, 1.0]
  Vertex[2]->Point[1]  P= [-0.5, -0.5, 0.5, 1.0]
  Vertex[3]->Point[2]  P= [0.5, -0.5, 0.5, 1.0]

Link to comment
Share on other sites

Yes, i've looked at it and its somewhat a good reference to the schema and the different properties (not complete).

But i'm writing it in c++ and i have no idea whats going on in hjson lib when the file is parsed -> fdata = hjson.load(fp).

Link to comment
Share on other sites

If you're feeling lazy, you could write .hclassic from Houdini. I haven't really looked at the new file format, but at least the classic is easy to read.

Probably not the optimal solution, but hey..

Link to comment
Share on other sites

If you're feeling lazy, you could write .hclassic from Houdini. I haven't really looked at the new file format, but at least the classic is easy to read.

Probably not the optimal solution, but hey..

not an option unfortunately..

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...