Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Quote - Is there a way to set the preview window size from python.
poser.Scene().SetOutputRes(x,y) does not set the preview window.
I think it's possible for P8, but not earlier versions.
Quote - set end frame for animations ? how ?
I'm pretty sure that you can't change the number of frames directly via Python, but there may be a trick involving writing a temp file and then reading it.
The temp PZ2 is still the only way to change frame count. I'm surprised they
haven't fixed that........
Here's the way to do it, in the form of a function that returns the same number
you asked for on success, or 0 on failure.
def FakeFrames(DesiredCount):
# Write a short PZ2 file forcing the desired number of
# frames; load it; delete it.
BasePathUncut=poser.AppLocation()
BasePath=BasePathUncut[:(-len('poser.exe'))]
DirName=os.path.join(BasePath, 'runtime', 'libraries', 'pose', 'fakes')
try:
os.mkdir(DirName)
except:
pass # ignore 'already exists' error
PZ2Name=os.path.join(DirName,'ztemp.pz2')
fpFake=open(PZ2Name,'wt')
if not fpFake: return 0
fpFake.write('{nversionnt{ntnumber 4.2nt}nmovieInfont{nt')
fpFake.write('numFrames %dnt}n}' % DesiredCount)
fpFake.close()
try:
scene.LoadLibraryPose(PZ2Name)
except:
return 0
os.remove(PZ2Name)
return DesiredCount
My python page
My ShareCG freebies
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Is there a way to set the preview window size from python.
poser.Scene().SetOutputRes(x,y) does not set the preview window.
also , set end frame for animations ? how ?
thanks