"""
Name: 'VRM'
-Blender: 228
+Blender: 237
Group: 'Export'
Tooltip: 'Vector Rendering Method Export Script'
"""
from Blender import Scene, Object, Lamp, Camera
from math import *
from Blender.Window import *
+from Blender.Scene import Render
def init():
print "Init\n"
- renderDir = scena.getRenderdir()
+ renderDir = context.getRenderPath()
+
# distance from camera Z'
def Distance(PX,PY,PZ):
camTyp = cam[0].getType()
- msize = scena.getWinSize()
+ msize = (context.imageSizeX(), context.imageSizeY())
xres = msize[0] # X res for output
yres = msize[1] # Y res for output
ratio = xres/yres
########
scena = Scene.GetCurrent()
+context = scena.getRenderingContext()
+
+#print dir(context)
+
init()
tacka = [0,0,0]
lice = [3,tacka,tacka,tacka,tacka]
-msize = scena.getWinSize()
+msize = (context.imageSizeX(), context.imageSizeY())
+print msize
-file=open("d:\proba.svg","w")
+file=open("proba.svg","w")
file.write("<svg width=\"" + `msize[0]` + "\" height=\"" + `msize[1]` + "\"\n")
file.write("xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" streamable=\"true\">\n")
Objects = Blender.Object.Get()
NUMobjects = len(Objects)
-startFrm = scena.startFrame()
-endFrm = scena.endFrame()
+startFrm = context.startFrame()
+endFrm = startFrm
+#endFrm = context.endFrame()
camera = scena.getCurrentCamera() # Get the current camera
for f in range(startFrm, endFrm+1):
#scena.currentFrame(f)
Blender.Set('curframe', f)
- DrawProgressBar (f/(endFrm+1-startFrm),"Rendering ..." + str(scena.currentFrame()))
+ DrawProgressBar (f/(endFrm+1-startFrm),"Rendering ..." + str(context.currentFrame()))
print "Frame: ", f, "\n"
if startFrm <> endFrm: file.write("<g id=\"Frame" + str(f) + "\" style=\"visibility:hidden\">\n")
# add/sorting in Z' direction
#Dodaj(px,py,Distance(vertxyz[0], vertxyz[1], vertxyz[2]))
file.write(`px` + ", " + `py`)
-# svetla = Blender.Lamp.Get()
-# svetlo = svetla[0]
-# print svetlo.LocX
ambient = -200
svetlo = [1,1,-1]
vektori = (norm[0]*svetlo[0]+norm[1]*svetlo[1]+norm[2]*svetlo[2])
#writesvg(objekat)
file.write("</svg>")
file.close()
+print file
DrawProgressBar (1.0,"Finished.")
print "Finished\n"