Small fixes and additions to the OBJ to ABC converter

698 views
Skip to first unread message

Christopher Horvath

unread,
Oct 16, 2012, 6:31:07 PM10/16/12
to Barnaby Robson, alembic-d...@googlegroups.com
Hello Barnaby & Alembic Discussion,

I have been using the OBJ to ABC converter that's in examples/AbcClients/WFObjConvert to do some work, and came across a few problems parsing some obj files that I've encountered.  The boost::qi grammar for index triplets was always matching the first rule (with defunct vt and vn indices), and calling any face specification with '/' characters a syntax error. Changing the order of the rules in the parser fixes the problem. I tried this out on a few obj files with different face styles, and it seems to work on all of them now, though my testing is not exhaustive.  I also did my testing against version 1.0.5 of the library, rather than 1.1.0, but it doesn't look like there's many changes between versions in this example.

I also added in setting the bounding box, (selfBounds), and optionally setting UVs and normals on the PolyMesh. Since they're specified per-vertex, the UVs and normals are always added with a facevarying scope.

I've attached the modified files to this mail, hopefully this might help anybody out who was using this library. (I just tarred up the WFObjConvert directory, since there were changes to a few files).

Thanks,
Chris

WFObjConvert_Oct16_2012.tgz

Barnaby Robson

unread,
Oct 16, 2012, 6:58:47 PM10/16/12
to alembic-d...@googlegroups.com
Hi Chris,

Good to hear from you and thanks for the fixes ! ... We'll get that folded into our next release which should be coming out shortly.

barnaby.
--
 
 


Reply all
Reply to author
Forward
0 new messages