YafaRay and blender

Render > YafaRay Export 0.0.4 - 313 gives this error:


dll: C:\Program Files\YafaRay\zlib1.dll
dll: C:\Program Files\YafaRay\libpng3.dll
dll: C:\Program Files\YafaRay\jpeg62.dll
dll: C:\Program Files\YafaRay\pthreadGC2.dll
dll: C:\Program Files\YafaRay\Iex.dll
dll: C:\Program Files\YafaRay\Half.dll
dll: C:\Program Files\YafaRay\IlmThread.dll
dll: C:\Program Files\YafaRay\IlmImf.dll
dll: C:\Program Files\YafaRay\mingwm10.dll
dll: C:\Program Files\YafaRay\freetype6.dll
dll: C:\Program Files\YafaRay\yafraycore.dll
dll: C:\Program Files\YafaRay\yafarayplugin.dll
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Documents and Settings\Claus\Application Data\Blender Foundation\Blen
der\.blender\scripts\yafaray_ui.py", line 60, in <module>
    import yaf_export
  File "C:\Program Files\YafaRay\python\yaf_export.py", line 68, in <module>
    import yafrayinterface
  File "C:\Program Files\YafaRay\python\yafrayinterface.py", line 25, in <module
>
    _yafrayinterface = swig_import_helper()
  File "C:\Program Files\YafaRay\python\yafrayinterface.py", line 24, in swig_im
port_helper
    return _mod
UnboundLocalError: local variable '_mod' referenced before assignment

Im using Blender 2.49.2 and YafaRay 0.1.0 on Windows XP

what should I do?

I think probably you are mixing incompatible versions.

Blender 2.49.2 I believe is compiled with Python 2.6 while Yafaray 313 uses 2.5.2

It won’t help to simply try to use Python 2.5.x. You need to install Yafaray 0.1.1 RC 3
Have a look at this thread:-
http://www.yafaray.org/community/forum/viewtopic.php?f=13&t=2320&p=12417&hilit=UnboundLocalError%3A+local+variable+%27_mod%27+referenced+before+assignment

…and there are download links for Yafaray compatible with Python 2.6 and Blender 2.49 here:-
http://blenderartists.org/forum/showthread.php?t=159659

Be sure to remove all traces of the previous Yafaray install, including any python scripts before reinstalling. The new version only places one python script in Blender’s scripts folder, so if you leave any of the old ones it still won’t work.

EDIT - There is some useful advice here:- http://blenderartists.org/forum/showthread.php?t=161937

thanks, it works now :slight_smile: