@brobes05 wrote:
Hi,
I have been looking around batch export scripts on this forum and have not found a solution. I have automated Grasshopper to create sequential baking. The end goal is to bring the animation into Maya. If I choose to have 6 seconds then I will have 600 meshes.Is there a way to export them as .obj files in the order that they are baked? Or possibly to skip storing them in Rhino altogether?
Thank you.
import rhinoscriptsyntax as rs import Rhino #load grsshopper plugin as GH gh = Rhino.RhinoApp.GetPlugInObject("Grasshopper") for func in dir(gh): if not func.startswith('_'): print func #SetSliderValue("GUID," Number) rs.EnableRedraw(True) for i in range(0,6,1): gh.SetSliderValue("ff322d6c-afb3-4bba-8e93-bde17d9499f7", i) gh.RunSolver("animationGH_Test2") #Bake data in object baked = gh.BakeDataInObject("e7188adf-dd85-4399-ad96-61fe88b556c7") #move baked iterations transVect = (0, 100*i, 0) rs.MoveObject(baked, transVect)
#export section that is not working
path = "C:\Users\ERIK SVEN BROBERG\Desktop\teste\test.obj" #C:\MyFolder\ObjectName.obj
cmd = "_-Export " + path + " _EnterEnd"
rs.Command(cmd)
Posts: 11
Participants: 3