odf opened this issue on Jul 07, 2010 · 17 posts
odf posted Thu, 08 July 2010 at 12:02 AM Online Now!
Thanks for the links, Jo! I've been perusing Kuroyume's unofficial spec on a regular basis and found it extremely useful. I've only heard good things about "Secrets of figure creation with Poser 5", but don't own a copy myself (yet?).
That Python parser definitely looks interesting, even though I'm not sure it is the most useful approach. The parser I'm using - implemented in 9 lines of Scala code - plays dumb and treats the file - syntactically - as a simple hierarchical structure. Everything else is then done via post-processing. If you want, you could say I'm using a multi-phase parser, with the second and subsequent phases operating on the tree structure produced by the first one. But I'm using a "lazy implementation" approach to this. I only add whatever functionality I find missing in my practical applications. That means that if I keep at it, at some point I will end up with the ultimate tool for all my (or your) Poser file manipulation purposes, with an API that perfectly balances expressive power with ease of use. :laugh: But until then, I'm afraid it's not going to be very useful for anyone but me.
For those "special" commands I asked about, I scan the structure for occurrences of these and then make the following lines children of the command node. Checks for correct parameter types and such could be done in a similar way. A lot of potential consistency issues in Poser files can't be expressed as syntax, anyway - or if they can, that syntax would have to be horrendously complicated. For example, look at the duplication of joint parameter channels and the addChild and weld commands.
I'm thinking about writing code to do some more rigorous checking of cr2 files, since I've had many problems related to inconsistencies or other bugs in Antonia's cr2 pointed out to me during the course of development, and I'm almost certain there are still quite a few hidden in there. If and when I do, I'll let you guys know.
-- I'm not mad at you, just Westphalian.