3DSフォーマットをBlenderでPlyに変換出力した。
ありがとうございます。
#!/usr/bin/env python
from math import *
#export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/:$HOME/Fujiyama-Renderer/bin/
#from colorinc import si
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('ConstantShader')
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
#Calculate python fujicam.py -3 4 5 0 1.3 0
si.SetSampleProperty3('cam1', 'rotate', -24.85, -30.96, 0, 0)
si.SetSampleProperty3('cam1', 'translate', -3, 4, 5, 0)
#si.SetSampleProperty3('cam1', 'translate', 0, 1, 5, 0)
si.SetProperty1('cam1', 'fov', 30)
#Light
si.NewLight('light1', 'SphereLight')
si.SetProperty3('light1', 'translate', 10, 10, 10)
si.SetProperty3('light1', 'scale', .5, .5, .5)
si.SetProperty1('light1', 'intensity', 1.5)
si.SetProperty1('light1', 'sample_count', 16)
si.NewLight('light2', 'SphereLight')
si.SetProperty3('light2', 'translate', -5, 10, 10)
si.SetProperty3('light2', 'scale', .5, .5, .5)
si.SetProperty1('light2', 'intensity', 1.5)
si.SetProperty1('light2', 'sample_count', 16)
#Texture
si.NewTexture('tex1', '../mip/pisa.mip')
#Shader
si.NewShader('dome_shader', 'ConstantShader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
si.NewShader('floor_shader', 'PlasticShader')
si.SetProperty3('floor_shader', 'diffuse', .9, .2, .2)
si.SetProperty1('floor_shader', 'ior', 4)
intensity = 0
si.NewShader('sphere_shader', 'PlasticShader')
si.SetProperty3('sphere_shader', 'diffuse', intensity, intensity, intensity)
si.SetProperty1('sphere_shader', 'ior', 40)
si.NewShader('obj_shader', 'PlasticShader')
si.SetProperty3('obj_shader', 'diffuse', 0.2, 0.4, 0.6)
si.SetProperty3('obj_shader', 'reflect', 0.9, 0.9, 0.9)
si.SetProperty1('obj_shader', 'ior', 4)
si.NewShader('obj2_shader', 'PlasticShader')
si.SetProperty3('obj2_shader', 'diffuse', 1, 1, 0.1)
si.SetProperty1('obj2_shader', 'ior', 8)
#Mesh
si.NewMesh('dome_mesh', '../mesh/dome.mesh')
si.NewMesh('floor_mesh', '../mesh/floor.mesh')
si.NewMesh('senpuuki_mesh', '../mesh/senpuuki.mesh')
#ObjectInstance
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'rotate', 0, 0, 0)
#ObjectInstance
si.NewObjectInstance('sen1', 'senpuuki_mesh')
si.AssignShader('sen1', 'obj_shader')
si.SetProperty3('sen1', 'scale',1,1,1)
si.SetProperty3('sen1', 'translate',0,0.1,0)
si.SetProperty3('sen1', 'rotate',-90,0,0)
#si.SetProperty3('dome1', 'scale', -.5, .5, .5)
si.SetProperty3('dome1', 'scale', -2, 2, 2)
si.AssignShader('dome1', 'dome_shader')
si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'scale', 50, 50, 50)
si.SetProperty3('floor1', 'translate', 0, 0, 0)
si.AssignShader('floor1', 'floor_shader')
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'sen1')
si.AssignObjectGroup('sen1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 512, 384)
#si.SetProperty2('ren1', 'resolution', 160, 120)
si.SetProperty2('ren1', 'pixelsamples', 4, 4)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../mekas2.fb')
#Run commands
si.Run()
#si.Print()
- -
- -