Jump to content

export houdini animation to maya


ykcosmo

Recommended Posts

I got now a good script to import obj sequenzes into maya

its a script from tonytouch

global proc loadOBJsequence(string $directory)

{

int $startframe = 1;

string $file_list[] = `getFileList -folder ($directory + "/") -fs "*.obj"`;

for ($i=0;$i<`size $file_list`;$i++)

{

file -import -options "mo=0" ($directory + "/" + $file_list[$i]);

rename "polySurface1" ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i) -v 1 ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i -1) -v 0 ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i +1) -v 0 ("importObjSequence_" + $i);

}

}

loadOBJsequence("c:/temp/OBJfolder");

thank you for sharing this script. i did a simple sphere animated on TY.(50 secs) append a rop output(i don't remember exactly but it isthe last one on the list) even there is no obj in the list i just type in obj and manage to get obj sequence. no problem.

i import these sequence to maya via your script. but it is blinking. 12,24,48 frames seems to be problematic. do you have any suggestions?

Link to comment
Share on other sites

I've been experimenting with a couple of other ways of bringing animation from Houdini to Maya which is using CHOPs to write out the animation, and then bring back into Maya, so far it's a bit teedious and repetitive, but looking at finding a way of doing it faster.

Link to comment
Share on other sites

These past couple of days i've been looking at this problem and been thinking on 2 solutions for this sort of problem, one that i know works is exporting out the channels using CHOPs and then bringing them into Maya via a script which isn't that complicated, but the problem with this method is that it's slow and tedious, that you have to assign it back to all the objects animated.

A better solution to that would be to automate the assignment procedure by naming your channel data files correctly and dump them into a folder and have Maya go through a list of reading those files and assigning the keys from the files to them.

That method works, but it also creates another problem which is that it'll set a keyframe to all the frames, so what now be best to do is create a script that will read the animation keys in a smart fashion, instead of keying every frame values, have it create more refine curves by not keying the frames that the values stay the same.

I've been contemplating with this idea for a while now and there are many possibilities.

Link to comment
Share on other sites

  • 6 months later...

i got a new script

it works with blendshapes

global proc loadOBJsequence(string $directory)

{

int $startframe = 1;

string $file_list[] = `getFileList -folder ($directory + "/") -fs "*.obj"`;

string $group = `group -em -n "Blendshapegroup"`;

for ($i=0;$i<`size $file_list`;$i++)

{

file -import -options "mo=0" ($directory + "/" + $file_list[$i]);

rename "polySurface1" ("importObjSequence_" + $i);

select -r importObjSequence_0;

blendShape -frontOfChain -tc 0;

blendShape -e -tc 0 -t importObjSequence_0 ($i) ("importObjSequence_" + $i) 1 importObjSequence_0;

parent ("importObjSequence_" + $i) $group;

}

int $numBlendshapes = `size $file_list`;

int $frameNum;

for( $frameNum = 0; $frameNum < $numBlendshapes; $frameNum++)

{

currentTime $frameNum;

int $bshapeNum;

// fur alle auf 0 keyen

for( $bshapeNum = 0; $bshapeNum < $numBlendshapes; $bshapeNum++)

{

setAttr ("blendShape1.importObjSequence_" + $bshapeNum) 0;

setKeyframe ("blendShape1.importObjSequence_" + $bshapeNum);

}

setAttr ("blendShape1.importObjSequence_" + $frameNum) 1;

setKeyframe ("blendShape1.importObjSequence_" + $frameNum);

}

}

loadOBJsequence("c:/grafik/3d_szenen/houdini/meshtest");

Link to comment
Share on other sites

  • 5 months later...

For geometry with chaning poing count over time i would do something like this ( assume we ignore the Maya API to streamline the task ):

export the geometry per frame from Houdini as .obj file sequence.

create a reference in maya and point to this sequence of files.

script the path/file reference string to switch the files according to frame number.

create an empty mesh node.

each time when reloading the reference script_connect it's outMesh to the inMesh of this empty mesh node ( or maybe once done, maya keeps the connection - cannot remember anymore how exactly it worked, but either way it is not a problem ).

This workflow creates a stable point ( the mesh node ) from where to start building your graph network. It's like the fileSOP in houdini, but little clumsy.

As far as i can remember some version(s) of Maya had problem directly referencing .obj files, if you have the bad luck of using one of them, you will need to convert the .obj sequence to .mb or .ma format.

... problems with motion blur ...

Edited by peship
Link to comment
Share on other sites

  • 4 years later...

I got now a good script to import obj sequenzes into maya

its a script from tonytouch

global proc loadOBJsequence(string $directory)

{

int $startframe = 1;

string $file_list[] = `getFileList -folder ($directory + "/") -fs "*.obj"`;

for ($i=0;$i<`size $file_list`;$i++)

{

file -import -options "mo=0" ($directory + "/" + $file_list[$i]);

rename "polySurface1" ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i) -v 1 ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i -1) -v 0 ("importObjSequence_" + $i);

setKeyframe -at visibility -t ($startframe + $i +1) -v 0 ("importObjSequence_" + $i);

}

}

loadOBJsequence("c:/temp/OBJfolder");

thanks for this script

Link to comment
Share on other sites

thanks for this script

..or how to revive a thread started 9 years ago.

By the way, nowadays I'd suggest using alembic to transfer geometries between different packages.

I did it on a few projects with great results.

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