Houdini now has integrated mdd import/export from version 9.5 onwards, so you won't need this, go away! :)
I'll leave this up for reference if someone is writing something similar in the future..
--------------
MDD Reader
This is a minimal mdd reader for houdini 9.0 (and later, I hope),
implemented as a Python SOP.
TODO: spline interpolation, pre- and post-behaviours, timeshift
v 0.5 fixed by Colin Cohen
quoting Colin:
"I've found some small issues with writer. These relate to using the native .mdd reader in LW8; they may not be issues with Point Oven or with other readers."
- I had to flip the z-axis in the script.
- The last exported frame disappears in LW. It seems the reader in LW expects an extra record at the end. I appened one, and that fixed it.
- [not yet fixed:] If the exported range is in the middle of the timeline, it seems to be offset by a frame. For example, if I want to export from frames 400-450, I need to export from frame 399.
v 0.4
- fixed the reading error on last frame, it tried to read one frame too far to get the subframe motion. subframe motion now disabled for the last frame.
- added a frame offset parameter
v 0.3
- a lot faster, seeks to the correct position in mdd file instead of reading it all :)
v 0.2
- added linear interpolation
v 0.1
- first version, works, but barely
MDD Writer
This is a minimal mdd reader for houdini 9.0 (and later, I hope),
implemented as a Python SOP.
v 0.5 fixed by Colin Cohen
v 0.4
- major usability boost, now you can bake the desired range with a push of a button!
v 0.2
- fixed a bug, i had been lazy beforeand didn't write the proper frame times into the file, now it should work with less lax readers.
v 0.1
- this is very dirty. when currentframe==startframe it creates an empty mdd-file with endframe-startframe frames and after that just appends one frame of data to the file per every cook. You should be careful to properly step thru the frame range - if you scrub, you will end up with see-saw mation in the file and possibly a corrupt .mdd :)