All pastes #366872 Raw Edit

AE Motion BETA

public python v1 · immutable
#366872 ·published 2007-02-21 23:40 UTC
rendered paste body
import Blender as B#	Take the vals:ObjSelect = B.Object.GetSelected()[0]origName = ObjSelect.nameSC = B.Scene.GetCurrent()SCR = SC.getRenderingContext()SizeX = SCR.sizeXSizeY = SCR.sizeYAspectX = float(SCR.aspectRatioX())AspectY = float(SCR.aspectRatioY())Aspect = 1.4222 #	WTF should I add here exactly?FrameA = B.Get('curframe')FrameP = B.Get('staframe')FrameF = B.Get('endframe')FrameRate = SCR.fps#	Inicialazing ListsLocX = []LocY = []LocZ = []RotX = []RotY = []RotZ = []#-----------------------------------------------------#                    CREATING LISTS#	Moves to the starting frameB.Set('curframe', FrameP)FrameA = FramePwhile FrameA < (FrameF + 1):	B.Set('curframe', FrameA)		#	Worldspace matrix	mat= ObjSelect.mat		LocX.append (mat.translationPart().x)	LocY.append (mat.translationPart().y)	LocZ.append (mat.translationPart().z)		RotX.append (-mat.toEuler().x)	RotY.append (-mat.toEuler().y)	RotZ.append (-mat.toEuler().z)		FrameA += 1#-------------------------------------------------------#	File writing starts HERE!File = open ('AfterEffectsExporter.txt','w')#	The headerFile.write ('Adobe After Effects 5.0 Keyframe Data\n\n\	Units Per Second	%i\n\	Source Width	%i\n\	Source Height	%i\n\	Source Pixel Aspect Ratio	%.4f\n\	Comp Pixel Aspect Ratio	%.4f\n\'%(FrameRate, SizeX, SizeY, Aspect, Aspect))# Loc and Rot values are writen in an entirely diferent way, how clever...#	Write Loc values -----------------------------------File.write ('\nPosition\n\	Frame	X pixels	Y pixels	Z pixels')for i in range (FrameF-FrameP):	File.write ('\n	%i	%f	%f	%f	' % (i,LocX[i], LocY[i], LocZ[i]))#	Write Rot values -----------------------------------#	Z valuesFile.write('\n\nZ Rotation\n	Frame	degrees')for i in range (FrameF-FrameP):	File.write('\n	%i	%f' % (i, RotZ[i]))#	X valuesFile.write('\n\nX Rotation\n	Frame	degrees')for i in range (FrameF-FrameP):	File.write('\n	%i	%f' % (i, RotX[i]))#	Y valuesFile.write('\n\nY Rotation\n	Frame	degrees')for i in range (FrameF-FrameP):	File.write('\n	%i	%f' % (i, RotY[i]))#	THE END -----------------------------------File.write('\n\n\nEnd of Keyframe Data\n')B.Set('curframe', FrameP)print "\nExporting Done!\nYour file is located in \Blender root folder, now send bug reports to ZanQdo"