Sequential OBJ.js

@ Hiroto: Very nice images/movies!
@ Martin: So we'll see some new physics in Cheetah then? ;-)

Regards,

Peter
 
hello.

I updated this script for bug fix. please update it if you try older version.

here is sample movie with this script.

http://www.youtube.com/watch?v=dEP1Ddn6YCA
http://www.youtube.com/watch?v=xa5-0imr-E0
http://www.youtube.com/watch?v=BTRy7vxKSVk

regards.

tg_jp, Hiroto.

Wow, that's very useful to know and pretty amazing visually. Thanks for sharing.

Martin said:
I can't await until I have some time to play with that physics engine
I would have thought a busy man like you makes the time for such things. ;)

Andrew
 
Hiroto (or anyone else)

Might not belong here but...

I can't seem to get the domain mesh out of blender. I only get the original cube that I set as the domain.

I'm trying to bring a fluid into cheetah.

I've searched like crazy and I believe I'm doing it right but if you could share your method to get it out of blender (the export), I'd appreciate it.

Thanks,

Martin
 
okay... realized I needed to select some other options in Blender on the export. Now, trying to setup the series of .obj for bringing into blender with script and not quite getting it.

are there steps..? I looked in the script and didn't find any. I basically just get a CUBE.

1. load script
2. SET first obj file 0001.obj
3. choose cache..


I see just the cube
 
hello, thank you for trying.

are there steps..? I looked in the script and didn't find any. I basically just get a CUBE.

please open that .obj file directly with Cheetah3D or Silo, and check it's exported correctly or not.

my steps are here.

in blender
1. create some object ( cloth, fluid.. )
2. select target object and export .obj file with some options ( see attached img ). script can import only one object at once, so you don't export whole scene to .obj file. and if fluid or cloth simulated object you want to export, you should check 'Apply Modifiers'.

in cheetah3d
1. load polygon script from menu.
2. set .obj file at 'Initialize' section ( any number will be ok. ).
2a. if .obj file is big, you can make cache file for speed. ( may take a long time. )
3. set 'frame' as you want to load in scene ( 1.0 -> anyname_000001.obj file will be loaded. ) and you can animate 'frame' parameter.

regards.

tg_jp, Hiroto.
 

Attachments

  • Blender_sz_001.jpg
    Blender_sz_001.jpg
    32.1 KB · Views: 1,011
This is a very good feature, but I can´t get it to work. I have exported to object-files from blender and when I import each of them at a time in Cheetah I can see that they change. So the export thing should be OK (?)

But when I import one .obj and try to ad the script, set the file and animate the frame-parameter nothing happens. I just see the static object that I have imported.

Please HELP! :confused: I can´t wait to try this scrip!
 
hello, thank you for trying to use. and sorry for inconvenient.

I fixed that problem, please download latest script file, and try again.
I checked that it work properly with that export settings I posted.

regards.

tg_jp, Hiroto.
 
Exporting Obj Sequence

Is there a script to export obj sequences from Cheetah? I am needing to export from cheetah to import into AE cs6 via Element 3d Plugin. The plugin allows for obj sequence import.

Thank you,

Jason
 
Little obj sequence exporter script

Is there a script to export obj sequences from Cheetah? I am needing to export from cheetah to import into AE cs6 via Element 3d Plugin. The plugin allows for obj sequence import.

Thank you,

Jason

[edit: cleaned it up a bit, cosmetically. sorry about the sound file thing -- commented out line that plays sound; maybe someone might like to customize this. I enjoy it.]

Here's one! I've been using that Element3D sequence feature a lot lately.

Save as Export OBJ Sequence.js in /Scripts/Tool/

Code:
function buildUI( tool ) { 
    tool.addParameterSeparator('Export OBJ Sequence');   
    tool.addParameterInt("fps", 30, 1, 1200, false, false);
    tool.addParameterInt("first frame", 0, 0, 100000, false, false);
    tool.addParameterInt("last frame", 1, 0, 100000, false, false);
    tool.addParameterString("*basename", "3DFrame_", true);
    tool.addParameterSeparator('');
    tool.addParameterSeparator('Relies on *basename (not dialog)!');
    tool.addParameterSeparator('');
  //  tool.addParameterSeparator('Dialog\'s directory path is used,');
  //  tool.addParameterSeparator('dialog\'s file name is NOT!');
  //  tool.addParameterSeparator('(So you can enter anything)');
    tool.addParameterButton("          OBJ Sequence", "Export ...", "exportObjSeq");

}
function exportObjSeq( tool ) {
   doc = tool.document();
   var basenm = tool.getParameter("*basename");
   //I admit this is kludgey - the path is used, the filename totally ignored; ui's basename is used
   svReturned=OS.runSavePanel("obj");
   if (svReturned != null) {
    var f=new File(svReturned);
    var dirPath = f.directory() + "/";
    var fps = tool.getParameter("fps");
    var thisFr = tool.getParameter("first frame");
    var lastFr = tool.getParameter("last frame");
   
    for ( var i = thisFr; i <= lastFr; i++ )
     {    
       doc.setAnimPosition(1/fps*(i));
       var svfile = dirPath + basenm + i.toString() + ".obj";
       doc.saveToFile(svfile, 'obj');
       0;
     }
    try {
       //I really like having it say 'I am a banana' when it finishes (see "Rejected" by Don Hertzfeldt)
       //OS.system("afplay \"/path/to/sound.aiff\"");
    } catch (error) {
       //
    }
    OS.messageBox('', "Done saving frames " + thisFr.toString() + " to " + lastFr.toString() + ".");
   }
}
 
Last edited:
Thank you so much cgreen for this 'Export OBJ Sequence.js" script. Works perfectly for exporting to Element 3d. I'm extra excited to see it even works with physics and morph animations. Did not work with particles though - any chance it can be updated to export a particle sequence?

Again, thanks for this great script!

Also - should this script be placed into its own post?
 
Hi pegot, glad you like it. I've used it about six thousand times in the last month.
In order for any particle stuff to be exported as anything, you need to convert it all to polygons first, if I'm not mistaken:
Tools/Particle/Particle->Polygon

BUT it doesn't really work, because there are too many limitations (like the inability to include animation, and the inability to correctly convert some parameters of the particle system, for example, a particle array's "Visible" parameter).
There's also a script called Particle Mesh -> Polygons, which does a better (if imperfect and clunky) job, but I'm still testing with it, and I might need to incorporate what I learn from this script into a new script to export particle system animation. But I'm a little suspicious that scripting and/or UI limitations might make this difficult or impossible. When I get more time to mess with it (I'm in the middle of a project right now), I'll take a look.
I think ideally a script would make an entirely new set of objects to export, then export them. Or a separate script would need to be run first, then the export script. I'm sure though, that whatever I work out, it is going to be kludgey!
Thanks for bringing this to my attention.

Thank you so much cgreen for this 'Export OBJ Sequence.js" script. Works perfectly for exporting to Element 3d. I'm extra excited to see it even works with physics and morph animations. Did not work with particles though - any chance it can be updated to export a particle sequence?

Again, thanks for this great script!

Also - should this script be placed into its own post?
 
Back
Top