Sign in to follow this  

problem with simple PoserPython script

Recommended Posts

Hi, im trying to create a script for poser that exports sprites as imagefiles. It is supose to export one image for each fram, then rotate the figure 45 deg and export every frame, and so on until it has gone a whole circle. I'm testing this out with 5 frames so it schoul produce 40 images. I have managed to do this, or, i get it to export my 40 images to the right directory and with the right names, but noting happens in my sceen. My figure does not rotate, and i cant seem to change frames, so now i basicaly have a script that produces 40 images of from the same frame and the same angle. I could need som help... Here is my code: ------
directions = ['a','b','c','d','e','f','g','h']
frames = 5
scene = poser.Scene()
figure = scene.Figure("Figure 1")
body = figure.Actor("Body")

#Iterate through the 8 directions and set the rotation angle
for dir in directions:
	if(dir == 'a'):
		ang = 180		
	elif(dir == 'b'):
		ang = 135
	elif(dir == 'c'):
		ang = 90
	elif(dir == 'd'):
		ang = 45
	elif(dir == 'e'):
		ang = 0
	elif(dir == 'f'):
		ang = 315
	elif(dir == 'g'):
		ang = 270
	elif(dir == 'h'):
		ang = 225

	body.SetAlignmentRotationXYZ(0,ang,0) #Rotate figure??
	print dir
	#Iterate through my 5 frames
	fra = 0
	while fra < frames:
		print (fra + 1)
		path = "export\\"+ str(dir) +"-00"+ str(fra+1)

		scene.SaveImage ("png", path)
		scene.NextKeyFrame() #Next frame??
		fra = fra + 1
------- Any help would me great as doing this by hand would be death... [edit: added code tags -SiCrane] [Edited by - SiCrane on June 8, 2006 7:55:22 AM]

Share this post

Link to post
Share on other sites
As an alternative to using a script, you may want to instead add a new transparent object, parent your figure to that object, replicate the animation eight times, and then use non-interpolated key frames to rotate the transparent object. Then a normal animation output to images should give you the frames of animation in each of the directions.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this