bandit Posted December 4, 2006 Share Posted December 4, 2006 I got now a good script to import obj sequenzes into mayaits 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? Quote Link to comment Share on other sites More sharing options...
Ratman Posted December 4, 2006 Share Posted December 4, 2006 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. Quote Link to comment Share on other sites More sharing options...
Ratman Posted December 7, 2006 Share Posted December 7, 2006 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. Quote Link to comment Share on other sites More sharing options...
Alexander Weide Posted June 17, 2007 Share Posted June 17, 2007 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"); Quote Link to comment Share on other sites More sharing options...
icelab Posted November 24, 2007 Share Posted November 24, 2007 Does it work for changing topology? Say, in Houdini I animated and Generation of a Lsystem, can it be exported to Maya? Thanks! Quote Link to comment Share on other sites More sharing options...
icelab Posted November 24, 2007 Share Posted November 24, 2007 I mean, I did try, but it doesn't work. Don't know whether I have used the script correctly or not. Thanks! Quote Link to comment Share on other sites More sharing options...
peship Posted December 2, 2007 Share Posted December 2, 2007 (edited) 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 December 2, 2007 by peship Quote Link to comment Share on other sites More sharing options...
icelab Posted December 6, 2007 Share Posted December 6, 2007 Thanks, peship!! I will try your method soon. Quote Link to comment Share on other sites More sharing options...
amlabret Posted May 5, 2012 Share Posted May 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
br1 Posted May 5, 2012 Share Posted May 5, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.