# morph importer # import poser, os # scn = poser.Scene() fig = scn.CurrentFigure() # sdir = "c:\\temp\mynewproduct" # def Importit(myfnam): imex = scn.ImExporter() options = imex.ImportOptions("obj", None) options[poser.kImOptCodeMAKEPOLYNORMSCONSISTENT] = 1 options[poser.kImOptCodeOFFSETZ] = 0.0 options[poser.kImOptCodeOFFSETY] = 0.0 options[poser.kImOptCodeOFFSETX] = 0.0 options[poser.kImOptCodeFLIPUTEXTCOORDS] = 0 options[poser.kImOptCodeWELDIDENTICALVERTS] = 0 options[poser.kImOptCodeCENTERED] = 0 options[poser.kImOptCodePERCENTFIGSIZE] = 0 options[poser.kImOptCodeFLIPVTEXTCOORDS] = 0 options[poser.kImOptCodeFLIPNORMS] = 0 options[poser.kImOptCodePLACEONFLOOR] = 0 imex.Import('obj', 'File Format Wavefront', myfnam, options) return # frame = 0 myfiles = os.listdir(sdir) for myfile in myfiles: if myfile[-3:] == "obj": cfile = os.path.join(sdir, myfile) try: Importit(cfile) act = scn.CurrentActor() act.SetName(myfile[:-4] act.SetOnOff(1) frame = frame + 1 scn.SetFrame(frame) act.SetOnOff(0) if frame > 2: scn.SetFrame(frame - 2) act.SetOnOff(0) scn.SetFrame(frame) except: print "\t error on ",myfile