Jump to content
eetu

Mdd Reader

Recommended Posts

Hi all!

I wrote a simple .mdd reader for Houdini in Python.

Some obvious features are still missing, but it should work.

http://undo.fi/houdini/mdd/

This is my first foray into Python SOPs and hda/otls so apologies if I've done something stupidly :)

eetu.

Edited by eetu

Share this post


Link to post
Share on other sites

that is simply fantastic!!!

I was about to do a request for the next version of Point Oven for such a thing!!

:))

(what about an exproter? ;)

many thanks !!!

J

Share this post


Link to post
Share on other sites

Great !! ... and thanks.

I was searching two days ago for a MDD exporter,

for export Houdini animation in MODO and render there.

Share this post


Link to post
Share on other sites

Yeah exporter will be next.

It's just a tad trickier as you need to know how many frames you will write before

writing to the file. Probably good exercise :)

And I forgot to say; if any of you want to make it better, feel free to build on it

but please post any improved version here..

eetu.

Share this post


Link to post
Share on other sites

Ok, here's a very raw .mdd exporter.

http://undo.fi/houdini/mdd/

It's 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 motion in the file and possibly a corrupt .mdd :)

(I also made a .geo importer for LW, but I guess that belong in the 'other software' forum.)

None of these have seen any real production use yet, so proceed with caution.

eetu.

Share this post


Link to post
Share on other sites

Hi eetu,

I have tried your mdd exporter from Houdini, and followed the instructions, it is writing a file out, but when I use point oven in 3ds max to read the file in, there is no motion. I'm not sure what the problem is.

Thanks

Share this post


Link to post
Share on other sites
I have tried your mdd exporter from Houdini, and followed the instructions, it is writing a file out, but when I use point oven in 3ds max to read the file in, there is no motion. I'm not sure what the problem is.

I guess I know what the problem is, I skipped creating proper key times for the mdd file as I thought they're not really used anywhere,

stupid of me :) I tried a couple of mdd readers in lightwave, one played back the animation and two didn't, so I guess I just originally tested

with a lazily implemented reader.. Expect a fix shortly.

EDIT: v0.2 now up, i hope it works better now

eetu.

Edited by eetu

Share this post


Link to post
Share on other sites

hi eetu!

I really like your efforts to make this mdd import/export. Thank You for that!

The reader works pretty well, but the exporter still unusable. I tried to import back the written mdd file and the geometry dissapears in Houdini and in Maya too.

I got python error on node. Try it.

Share this post


Link to post
Share on other sites

The exporter works for me with both Houdini and 3ds max point oven. Thank you so much!

All we're missing now is a script to play through the timeline so that it recorded with less hassle. But it is totally usable in its current state.

edit:

Just so you know, it seems like the last two or three frames of the export are always messed up. It has happened the two times I've used it so far. But so far this is the best bridge yet getting animation between Houdini and other software. Now if only there were obj or geo sequence importers for max and xsi...

Edited by shikung444

Share this post


Link to post
Share on other sites
I got python error on node. Try it.

It worked for me with houdini and lightwave.

What's the error it gives you?

Have you tried with an easy case, e.g. a rotating cube?

All we're missing now is a script to play through the timeline so that it recorded with less hassle. But it is totally usable in its current state.

edit:

Just so you know, it seems like the last two or three frames of the export are always messed up. It has happened the two times I've used it so far. But so far this is the best bridge yet getting animation between Houdini and other software. Now if only there were obj or geo sequence importers for max and xsi...

Nice to know it's not completely messed up :)

I obviously do have to test it a little more.

A button to play back the frames is the next step of course ;)

eetu.

Edited by eetu

Share this post


Link to post
Share on other sites

just so you know how useful it is, I am now using it to send a Houdini particle simulation to 3ds max and rendering with afterburn and final render.

I had no way to do this before. Thanks so much! I'm looking forward to this tool being perfected.

Share this post


Link to post
Share on other sites

I tried with a more complex geometry from maya, also tried with a torus in houdini added some animated noise, and it worked flawlessly. With maya modell i got the following error:

Error: Python error: Traceback (most recent call last):

File "<stdin>", line 33, in <module>

File "D:\SIDEEF~1\HOUDIN~1.783\python\lib\python2.5\struct.py", line 87, in unpack

return o.unpack(s)

error: unpack requires a string argument of length 4

hope it helps

Share this post


Link to post
Share on other sites

Hiya, I did some small updates on both reader and writer;

The writer is now quite a bit handier to use, it has a button that automatically steps thru and cooks the desired range.

The reader now has a frame offset parameter.

I also fixed a bug when loading the last frame - it tried to read one frame too far to establish subframe motionblur..

(which did give me the error dbukovec saw, but only on the last frame)

There might still be something funky with the last frame, I'll investigate further when I next get free r&d time :)

eetu.

Share this post


Link to post
Share on other sites

to have it simple i tested it on a simple torus and sphere, deforming them with the mountain SOP. Wrote out the mdd file and used the Point OVen plugin in maya to read it back, unfortunately i had misplaced vertices.

Share this post


Link to post
Share on other sites

How the heck did I miss this thing for so long...this gonna be a godsend! :notworthy:

Share this post


Link to post
Share on other sites

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.

1. I had to flip the z-axis in the script.

2. 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.

3. 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.

Thank you for this very useful asset.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×