Povanim is yet a core of functions:
#--------------------------
# Exporter for povray 3.5,
# GUI-less
# -------------------------
# (c) jm soler 02/2002-->5/2003
#--------------------------
#---- Core function -----
#--------------------------
# ATTENTION
#--------------------------
#
# BEFORE USING THIS SCRIP
# PAY ATTENTION TO THE PLACE
# WHERE YOU PUT THE .PYO PART,
# (the compiled part of the script) .
#
# THERE ARE TWO POSSIBLE CHOICES:
# 1/ in the blender executable
# directory
# 2/ in the directory of the
# exported file
#
# DO NOT FORGET TO LOAD THIS
# SCRIPT AND DO "alt-p".
# And be patient...
#-------------------------
#-------------------------
# ANIMATION:
#-------------------------
# Blender 2.25/2.26:
# To export meshes modified by armature
# motion you need at least one OPEN
# 3D WINDOW
#--------------------------
#-------------------------
# RENDERER ADDRESS : please document...
#-------------------------
render="""F:\\Program Files\\POV-Ray for Windows v3.5\\bin\\pvengine.exe"""
import sys
import Blender
L=sys.path
ls0=Blender.Get('filename')
ls=Blender.sys.dirname(ls0)
ls0=ls0.replace(ls+Blender.sys.dirsep,'')
if ls not in sys.path:
sys.path.append(ls)
import povanim226_14e
reload(povanim226_14e)
from povanim226_14e import *
povanim=povanim226_14e
#-----------------------------------
# Needed data for the function
# Test_exportVers
#-----------------------------------
patch=0 # 0 = povray, 1= megapov 0.7, 2 = megapov1.0, 3 =
debug='rien' # 'rien' or 'debug'
format='inc' # 'inc' or 'txt'
gi=[['','']] # gi option too complex but empty buy default
uv_opt=0 # unused
anim=[0, # 0 or 1, animation on/off
0, # first frame
0, # last frame
0, # no anim cam
0, # no anim mat
0] # no anim lamp
layer=[1,1,1,1,1, 1,1,1,1,1,
1,1,1,1,1, 1,1,1,1,1] # 1 exported , 0 not
export=[
1, # unused
1, # main or not
1, # world or not
1, # mesh or not
1, # material or not
1, # lamp or not
1, # camera or not
0, # currentframe 0 << better !!
0, # expertmode optional
[
[0, 0.0], # Global Reflection val
[0, 0.0], # Global uvMap Val
[0, 0.0], # Global vertex Paint Val
[0, 0.0], # light Fade Power optional
[0, 0.0], # Interpolate Type optional
[1,0.65], # global light need to be always 1 (or good night)
[0, 0.6], # global diffuse optional
[0, 0.1], # global ambient optional
[0, 1.0], # global brilliance optional
[0, 1.0], # TSky_sphere_povray, optional
[0, 1.0], # TSky_sphere_from_cam,
# TSky_s_fc_Scale.val optional optional
[0, 0], # TMedia_Attenuation,
#TAtmospheric_media optional
],
0, # recalcnormal
0] # to only export selected objects and lamps.
# They are joined to the yet exported files
texturestype=[
1, # exportation non optimisée or exportation optimisée
0, # average pigment_map or average texture_map
0] # standard text_list or separate textures file and text_list
postproc=[] # for megapov 0.7 only
xySize=[320, # x size always greater than y
240 # y size
]
#-------------------------------------
# THE function
#-------------------------------------
povanim.Test_exportVers(
patch,
debug,
format,
gi,
uv_opt,
anim,
layer,
export,
texturestype,
postproc,
xySize
)
# ----------------------- to try to render after export comment the next line:
"""
import os
inifile=ls+os.sep+'povanim'+os.sep+'ini'+ls0.replace('.blend','')+'.ini'
print inifile, render
if sys.platform!='win32':
os.system(render+" "+inifile)
else:
cmd = render
args =(cmd," /RENDER ",inifile)
if sys.platform=='win32':
os.spawnv(os.P_NOWAIT, cmd, args)
# -------------------------------------------------------- and the next one too:
"""