Grasshopper

algorithmic modeling for Rhino

Seeking help for py script to export Obj sequnces from gh animation.Have tried Vb and Centipede plugin available on forum and they didn't work. TIA.

import rhinoscriptsyntax as rs

def ExportObjSequqnce():
"Export obj files "


if not : return

# specify a path

filename = rs.SaveFileName("Save obj As")
if not filename: return

file = open( filename, "w" )
for pt in points:

file.write( ", " )

file.close()


if( __name__ == "__main__" ):
Export()

Views: 1335

Replies to This Discussion

Hi Shridhar

what is the problem with Rhino's command?

You could bake all objects, then call the Rhino command. Does it makes sense?

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

HI,Guilio i want a huge sequence of obj to use them directly for complex animations. and alos i m not good using python yet :D.

Maybe i can figure out to write just one obj exporting script but not a sequence. 

You could definitely write the OBJ file on your own (it's a good programming lesson, not terrible but requires some thinking) but also, you could use the FileObj.Write() method to write the contents of the document to a file. Of course, this would mean that you'd need to bake first. 

There are also several threads regarding this:

http://www.grasshopper3d.com/forum/topics/objdxfiges3ds-slider-export

Also, there are several add-ons that can save to OBJ, including Turtle and Centipede.

I hope this helps getting started,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Thank u Giulio .

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service