# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import sys
import os
TESTS_PATH = "C:\\yafa-test"
YAFARAY_PATH = TESTS_PATH + "\\yafaray_v3\\bin" #Modify according to your system
sys.path.append(YAFARAY_PATH)
# Set Library Search options
if sys.platform == 'win32': #I think this is the easiest and most flexible way to set the search options for Windows DLL
os.environ['PATH'] = YAFARAY_PATH
# For Linux and MacOSX, set the RPATH in all the .so and .dylib libraries to relative paths respect to their location
import yafaray_v3_interface
yi = yafaray_v3_interface.yafrayInterface_t()
yi.setConsoleVerbosityLevel("debug")
yi.loadPlugins(YAFARAY_PATH + "\\yafaray-plugins")
yi.startScene()
yi.paramsClearAll()
yi.paramsSetInt("width", 400)
yi.paramsSetInt("height", 300)
yi.paramsSetString("type", "png")
ih = yi.createImageHandler(TESTS_PATH + "\\test.png")
co = yafaray_v3_interface.imageOutput_t(ih, TESTS_PATH + "\\test.png", 0, 0)
yi.paramsClearAll()
yi.paramsSetString("type", "perspective")
yi.paramsSetFloat("focal", 1.0)
yi.paramsSetInt("resx", 800)
yi.paramsSetInt("resy", 600)
yi.paramsSetPoint("from", 0.0, 0.0, 10.0)
yi.paramsSetPoint("up", 1.0, 0.0, 0.0)
yi.paramsSetPoint("to", 0.0, 0.0, 0.0)
yi.createCamera("camera1")
yi.paramsClearAll()
yi.paramsSetString("type", "directlighting")
yi.createIntegrator("integrator1")
yi.paramsClearAll()
yi.paramsSetString("type", "none")
yi.createIntegrator("volintegr1")
yi.paramsSetString("type", "shinydiffusemat")
yi.paramsSetColor("color", 1.0, 0.0, 0.0) #Let's try a red material
mat1 = yi.createMaterial("material1")
yi.paramsSetString("type", "shinydiffusemat")
yi.paramsSetColor("color", 0.0, 1.0, 0.0) #Let's try a green material
mat2 = yi.createMaterial("material2")
yi.paramsClearAll()
ID = yi.getNextFreeID()
yi.startGeometry()
vertices = 6
faces = 2
yi.startTriMesh(ID, vertices, faces, False, False, 0, 0)
yi.addVertex(0.0, 0.0, 0.0) #vertex 0
yi.addVertex(1.0, 0.0, 0.0) #vertex 1
yi.addVertex(1.0, 1.0, 0.0) #vertex 2
yi.addVertex(1.0, 1.0, 0.0) #vertex 3
yi.addVertex(2.0, 1.0, 0.0) #vertex 4
yi.addVertex(2.0, 2.0, 0.0) #vertex 5
yi.addTriangle(0, 1, 2, mat1)
yi.addTriangle(3, 4, 5, mat2)
yi.endTriMesh()
yi.endGeometry()
yi.paramsClearAll()
yi.paramsSetString("type", "pointlight")
yi.paramsSetPoint("from", 1.0, 1.0, 1.0)
yi.paramsSetColor("color", 1.0, 1.0, 1.0)
yi.paramsSetFloat("power", 2.0)
yi.paramsSetBool("light_enabled", True)
yi.createLight("light1")
yi.paramsClearAll()
yi.paramsSetInt("width", 400)
yi.paramsSetInt("height", 300)
yi.paramsSetString("camera_name", "camera1")
yi.paramsSetString("integrator_name", "integrator1")
yi.paramsSetString("volintegrator_name", "volintegr1")
yi.render(co)
test_number = 3 * 4
yi.printInfo("TEST: This is a test using YafaRay print function, test_number=" + str(test_number) + ")")
[16:45:32] INFO: YafaRay Core (v3.3.0-5-g3a98966) Windows 64bit MinGW GCC
[16:45:32] INFO: Environment: Loading plugins ...
[16:45:32] VERB: Environment: Registered Camera type 'angular'
[16:45:32] VERB: Environment: Registered Light type 'arealight'
[16:45:32] VERB: Environment: Registered Light type 'bgPortalLight'
[16:45:32] VERB: Environment: Registered Light type 'meshlight'
[16:45:32] VERB: Environment: Registered ShaderNode type 'texture_mapper'
[16:45:32] VERB: Environment: Registered ShaderNode type 'value'
[16:45:32] VERB: Environment: Registered ShaderNode type 'mix'
[16:45:32] VERB: Environment: Registered ShaderNode type 'layer'
[16:45:32] VERB: Environment: Registered Texture type 'blend'
[16:45:32] VERB: Environment: Registered Texture type 'clouds'
[16:45:32] VERB: Environment: Registered Texture type 'marble'
[16:45:32] VERB: Environment: Registered Texture type 'wood'
[16:45:32] VERB: Environment: Registered Texture type 'voronoi'
[16:45:32] VERB: Environment: Registered Texture type 'musgrave'
[16:45:32] VERB: Environment: Registered Texture type 'distorted_noise'
[16:45:32] VERB: Environment: Registered Texture type 'rgb_cube'
[16:45:32] VERB: Environment: Registered Texture type 'image'
[16:45:32] VERB: Environment: Registered Light type 'bglight'
[16:45:32] VERB: Environment: Registered Integrator type 'bidirectional'
[16:45:32] VERB: Environment: Registered Material type 'blend_mat'
[16:45:32] VERB: Environment: Registered Material type 'coated_glossy'
[16:45:32] VERB: Environment: Registered Integrator type 'DebugIntegrator'
[16:45:32] VERB: Environment: Registered Light type 'directional'
[16:45:32] VERB: Environment: Registered Integrator type 'directlighting'
[16:45:32] VERB: Environment: Registered Integrator type 'EmissionIntegrator'
[16:45:32] VERB: Environment: Registered Integrator type 'none'
[16:45:32] VERB: Environment: Registered VolumeRegion type 'ExpDensityVolume'
[16:45:32] VERB: Environment: Registered ImageHandler type 'exr'
[16:45:32] VERB: Environment: Registered Material type 'glass'
[16:45:32] VERB: Environment: Registered Material type 'mirror'
[16:45:32] VERB: Environment: Registered Material type 'null'
[16:45:32] VERB: Environment: Registered Material type 'glossy'
[16:45:32] VERB: Environment: Registered Background type 'gradientback'
[16:45:32] VERB: Environment: Registered ImageHandler type 'hdr'
[16:45:32] VERB: Environment: Registered Light type 'ieslight'
[16:45:32] VERB: Environment: Registered ImageHandler type 'jpg'
[16:45:32] VERB: Environment: Registered VolumeRegion type 'NoiseVolume'
[16:45:32] VERB: Environment: Registered Camera type 'orthographic'
[16:45:32] VERB: Environment: Registered Integrator type 'pathtracing'
[16:45:32] VERB: Environment: Registered Camera type 'perspective'
[16:45:32] VERB: Environment: Registered Camera type 'architect'
[16:45:32] VERB: Environment: Registered Integrator type 'photonmapping'
[16:45:32] VERB: Environment: Registered ImageHandler type 'png'
[16:45:32] VERB: Environment: Registered Light type 'pointlight'
[16:45:32] VERB: Environment: Registered Material type 'rough_glass'
[16:45:32] VERB: Environment: Registered Material type 'shinydiffusemat'
[16:45:32] VERB: Environment: Registered Material type 'light_mat'
[16:45:32] VERB: Environment: Registered Material type 'mask_mat'
[16:45:32] VERB: Environment: Registered Integrator type 'SingleScatterIntegrator'
[16:45:32] VERB: Environment: Registered Integrator type 'SkyIntegrator'
[16:45:32] VERB: Environment: Registered VolumeRegion type 'SkyVolume'
[16:45:32] VERB: Environment: Registered Light type 'spherelight'
[16:45:32] VERB: Environment: Registered Light type 'spotlight'
[16:45:32] VERB: Environment: Registered Integrator type 'SPPM'
[16:45:32] VERB: Environment: Registered Light type 'sunlight'
[16:45:32] VERB: Environment: Registered Background type 'sunsky'
[16:45:32] VERB: Environment: Registered Background type 'darksky'
[16:45:32] VERB: Environment: Registered Background type 'textureback'
[16:45:32] VERB: Environment: Registered Background type 'constant'
[16:45:32] VERB: Environment: Registered ImageHandler type 'tga'
[16:45:32] VERB: Environment: Registered ImageHandler type 'tif'
[16:45:32] VERB: Environment: Registered VolumeRegion type 'UniformVolume'
[16:45:32] VERB: Environment: Registered VolumetricHandler type 'beer'
[16:45:32] VERB: Environment: Registered VolumetricHandler type 'sss'
[16:45:32] DEBUG: denoiseEnabled=0 denoiseHLum=3 denoiseHCol=3
[16:45:32] VERB: Environment: Added ImageHandler 'C:\yafa-test\test.png' (png)!
[16:45:32] VERB: Environment: Added Camera 'camera1' (perspective)!
[16:45:32] INFO: Environment: View number=0, view name: '', camera name: 'camera1'
[16:45:32] VERB: Environment: Added Integrator 'integrator1' (directlighting)!
[16:45:32] VERB: Environment: Added Integrator 'volintegr1' (none)!
[16:45:32] VERB: Environment: Added Material 'material1' (shinydiffusemat)!
[16:45:32] VERB: Environment: Added Material 'material2' (shinydiffusemat)!
[16:45:32] VERB: Environment: Added Light 'light1' (pointlight)!
[16:45:32] DEBUG: Images autosave: none, 1, 300
[16:45:32] DEBUG: ImageFilm autosave: none, none, 1, 300
[16:45:32] WARNING: Environment: No AA filter defined defaulting to Box!
[16:45:32] VERB: Environment: Defaulting to Centre tiles order.
[16:45:32] VERB: Automatic Detection of Threads: Active.
[16:45:32] VERB: Number of Threads supported: [8].
[16:45:32] PARM: Using [8] Threads.
[16:45:32] VERB: Automatic Detection of Threads for Photon Mapping: Active.
[16:45:32] VERB: Number of Threads supported for Photon Mapping: [8].
[16:45:32] PARM: Using for Photon Mapping [8] Threads.
[16:45:32] DEBUG: adv_base_sampling_offset=0
[16:45:32] VERB: Scene: Mode "Triangle"
[16:45:32] INFO: Kd-Tree: Starting build (2 prims, cr:0.8 eb:0.33)
[16:45:32] VERB: Kd-Tree: Getting triangle bounds...
[16:45:32] VERB: Kd-Tree: Done.
[16:45:32] VERB: Kd-Tree: Starting recursive build...
[16:45:32] VERB: Kd-Tree: Stats (0.01s)
[16:45:32] VERB: Kd-Tree: used/allocated nodes: 3/256 (1.17188%)
[16:45:32] VERB: Kd-Tree: Primitives in tree: 2
[16:45:32] VERB: Kd-Tree: Interior nodes: 1 / leaf nodes: 2 (empty: 0 = 0%)
[16:45:32] VERB: Kd-Tree: Leaf prims: 2 (1 x prims in tree, leaf size: 1)
[16:45:32] VERB: Kd-Tree: => 1 prims per non-empty leaf
[16:45:32] VERB: Kd-Tree: Leaves due to depth limit/bad splits: 0/0
[16:45:32] VERB: Kd-Tree: clipped triangles: 4 (0 bad clips, 0 null clips)
[16:45:32] VERB: Scene: New scene bound is:(-0.002, -0.002, 0), (2.002, 2.002, 0)
[16:45:32] INFO: Scene: total scene dimensions: X=2.004, Y=2.004, Z=0, volume=0, Shadow Bias=0.0005 (auto), Ray Min Dist=5e-005 (auto)
[16:45:32] INFO: DirectLight: Photonmap building time: 0.0s (8 thread(s))
[16:45:32] VERB: Direct Light RayDepth=5 | photon maps: 0.0s [8 thread(s)]
[16:45:32] PARM: DirectLight: Rendering 1 passes
[16:45:32] PARM: Min. 1 samples
[16:45:32] PARM: 1 per additional pass
[16:45:32] PARM: Resampled pixels floor: 0.0% (0 pixels)
[16:45:32] VERB: AA_sample_multiplier_factor: 1.0
[16:45:32] VERB: AA_light_sample_multiplier_factor: 1.0
[16:45:32] VERB: AA_indirect_sample_multiplier_factor: 1.0
[16:45:32] VERB: AA_detect_color_noise: 0
[16:45:32] VERB: AA threshold:0.1
[16:45:32] VERB: AA_variance_edge_size: 10
[16:45:32] VERB: AA_variance_pixels: 0
[16:45:32] VERB: AA_clamp_samples: 0.0
[16:45:32] VERB: AA_clamp_indirect: 0.0
[16:45:32] PARM: Max. 1 total samples
[16:45:32] INFO: Rendering pass 1 of 1...
Progress: [ ] (0%)[16:45:32] INFO: DirectLight: Rendering pass 1 of 1...
[16:45:32] DEBUG: Sampling: samples=1 Offset=0 Base Offset=0 AA_pass_number=0
Progress: [##########################################################] (100%)
[16:45:32] INFO: DirectLight: Overall rendertime: 0.1s
[16:45:32] INFO: imageFilm: Flushing buffer (View number 0)...
[16:45:32] PARM: --------------------------------------------------------------------------------
[16:45:32] PARM: YafaRay (v3.3.0-5-g3a98966) Windows 64bit MinGW GCC | 400x300 | 1 passes | Render time: 0.091s | Total time: 0.091s | CPU threads=8
[16:45:32] PARM: Direct Light RayDepth=5 | photon maps: 0.0s [8 thread(s)]
[16:45:32] PARM: AA Settings (volintegr1): Tile size=32 passes=1 samples=1 inc_samples=1 resamp.floor=0
[16:45:32] PARM: sample.mul=1 light.sam.mul=1 ind.sam.mul=1
[16:45:32] PARM: col.noise=0 AA thr=0.05 var.edge=10 var.pix=0 clamp=0 ind.clamp=0
[16:45:32] PARM: --------------------------------------------------------------------------------
[16:45:32] INFO: Saving image files
[16:45:32] INFO: PNGHandler: Saving RGB file as "C:\yafa-test\test.png"...
[16:45:32] DEBUG: m_Denoise=0 m_DenoiseHLum=3 m_DenoiseHCol=3
[16:45:32] VERB: PNGHandler: Done.
[16:45:32] VERB: imageFilm: Done.
[16:45:32] INFO: TEST: This is a test using YafaRay print function, test_number=12)
[16:45:32] VERB: Interface: Deleting scene...
[16:45:32] INFO: Kd-Tree: Freeing nodes...
[16:45:32] VERB: Kd-Tree: Done
[16:45:32] VERB: Interface: Deleting environment...
[16:45:32] INFO: Interface: Done.
[16:45:32] VERB: Session: ended
Return to General Questions and Blender Exporter UI
Users browsing this forum: No registered users and 3 guests