Jump to content
  • Advertisement
Sign in to follow this  
Tuss

problem with simple PoserPython script

This topic is 4396 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!