andygraph opened this issue on Feb 10, 2014 · 55 posts
andygraph posted Tue, 11 February 2014 at 2:47 AM
try it, change nothing :-(
import poser, os
scn = poser.Scene()
fig = scn.CurrentFigure()
sdir = "C:UsersAndryDesktopTEST"
frame = 0
myfiles = os.listdir(sdir)
print myfiles
for myfile in myfiles:
if myfile[-3:] == "obj":
cfile = os.path.join(sdir, myfile)
try:
print cfile
imex = scn.ImExporter()
options = imex.ImportOptions("obj", None)
options[poser.kImOptCodeMAKEPOLYNORMSCONSISTENT] = 0
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', cfile, options)
act = scn.CurrentActor()
act.SetName(myfile[:-4])
act.SetVisibleInRender(1)
frame = frame + 1
scn.SetFrame(frame)
act.SetVisibleInRender(0)
if frame > 2:
scn.SetFrame(frame - 2)
act.SetVisibleInRender(0)
scn.SetFrame(frame)
except:
print "t error on ",myfile
print "Done"