Skip to main content
GameDev.net gamedev.net
🔒 Locked

problem with simple PoserPython script

Started by Tuss Jun 8, 2006 at 7:38 AM 1 replies 950+ views
Original Post
Tuss
Tuss
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]
SiCrane
SiCrane
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.
Tuss
Tuss
Not sure i follow you... cold you elaborate?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.