Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 273738

Summary: media-gfx/yafaray-0.1.1 Ebuild Request
Product: Gentoo Linux Reporter: Robert Krig <rkrig>
Component: New packagesAssignee: Default Assignee for New Packages <maintainer-wanted>
Status: RESOLVED FIXED    
Severity: enhancement CC: fcoiffie, graphics+disabled, jstein, sattva
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.yafaray.org
See Also: https://bugs.gentoo.org/show_bug.cgi?id=639046
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: yafaray-0.1.1.ebuild
Yafaray ebuild with re-hardcoded plugin-path

Description Robert Krig 2009-06-11 15:39:04 UTC
Yafaray is a opensource Global Illumination Rendering Engine.

Yafray up to version 0.9 was tightly integrated into Blender. However, that branch is no longer being developed. Yafaray is new and improved and is a standalone renderer. It has good integration with Blender thanks to its export scripts and is much faster than the old Yafray.
Considering that this is a Global Illumination Renderer, it would be cool to have a gentoo ebuild for it. Since every bit of optimization helps to keep the render times down.

Reproducible: Always
Comment 1 SATtva 2009-06-14 18:41:11 UTC
I'd like to add that since blender-2.49 (see bug #272861) integrated support for the old yafray has been dropped in favor for yafaray, so media-gfx/yafray would become mostly obsolete, and there's a need for the new version of the renderer in the portage.
Comment 2 Robert Krig 2009-07-03 18:28:02 UTC
mmaekke, you are the ebuild maintainer for Yafray.
Would you perhaps have interest in maintaining the new Yafaray. Its become very useable and surpasses the old yafray in almost every way.
Comment 3 Markus Meier gentoo-dev 2009-08-01 10:41:00 UTC
Created attachment 199794 [details]
yafaray-0.1.1.ebuild

I've created an yafaray-ebuild and added it to my overlay [1]. could you verify if it actually works? =)

[1] http://git.overlays.gentoo.org/gitweb/?p=dev/maekke.git;a=summary
Comment 4 Robert Krig 2009-08-01 15:32:03 UTC
(In reply to comment #3)
> I've created an yafaray-ebuild and added it to my overlay [1]. could you verify
> if it actually works? =)

Sweet! That just made my day.

The ebuild seems to be missing the ~amd64 keyword.  I've added it manually.
Compiles fine on my AMD64 Gentoo System.

Test rendering failed. Yafaray shows up in Blender, but for example the material render previews dont work, nor does rendering a scene.

Here's the output from the console when I try to render a scene:

------------------------------------------------------------------
INFO: Adding Object: KnobBase.006
INFO: Adding World, type: Sunsky
error: don't know how to create background of type 'sunsky'!
INFO: Adding Render
INFO: Adding Integrator: Photon mapping
error: don't know how to create integrator of type 'photonmapping'!
INFO: Adding Volume Integrator: None
error: don't know how to create integrator of type 'none'!
creating new QApplication
specify an _existing_ integrator!!
finished, setting pixmap
~yafrayInterface_t()    delete scene...delete environment...done
-----------------------------------------------------------------------

The QT interface in Blender works. It just seems that Yafaray doesn't seem to know about its own shaders and rendering options.
Either that or the script is looking for some things in the wrong place.

It could also be just my system. I used to have Ubuntu on here. Since I've installed Gentoo again, I've kept my home directory.
Could it be that yafaray stores its settings in some directory or File I wasn't aware of and is still trying to find the relevant data in Directories which ubuntu had?
Comment 5 Robert Krig 2009-08-01 15:42:13 UTC
I did some further testing. I removed all blender related files and directories from my home directory. This time I use the "export to xml" function of yafaray. To see if it would render with the yafaray-xml commandline client.

No luck! It still chokes with the same error messages about not knowing how to create a integrator of a certain type.

Hmm... Judging by the error message, It seems like Yafaray is unable to call or find any of its own functions. All the Blender related stuff seems to work. The script adds objects and materials as it should. But chokes on anything which is strictly yafaray. e.g. Photonmapping, sunsky background, lighting methods, material shaders... etc.

I don't know if AMD64 could cause this error. I'm gonna test this out on my x86 laptop when I get the chance.
Comment 6 Reuben Martin 2009-08-01 20:54:59 UTC
Confirmed same type of problem.

x86, blender 2.49.2, python 2.6.2
Comment 7 Hendrik Iben 2009-08-12 14:56:52 UTC
Created attachment 201038 [details]
Yafaray ebuild with re-hardcoded plugin-path

I had the exact same problem and (think I) solved it:

The problem is that the build process of yafaray is very naive and believes that the given PREFIX will actually be the position where the files will be installed; It uses this knowledge to hardcode (!) the path to the plugins in the plugin-loading mechanism thus making it impossible to find the plugins when the installed files get moved to the live system.

You can try this, if you want, by emerging yafaray as normal and additionally perform a 'ebuild <path/to/yafaray.ebuild> install' to generate the files at the hardcoded position. Yafaray should then also work as long as you keep the files...

Fortunately, you can again hardcode the plugin path to anything you like without breaking the build process.

The attached ebuild does just this. I tried some different things that looked smarter but they mostly broke the build process...
One thing to mention: the path is really hardcoded; if the libraries do not end up in '/usr/lib/yafaray' it will again not work...

Happy blending!
Comment 8 SATtva 2009-08-12 16:05:55 UTC
Have you managed to get it working? yafaray-0.1.1-r1.ebuild builds correctly (with gcc-4.3.2-r3), renderer gui and materials preview works, but trying to render a scene leads to segfaults:

Loading plugins ...
Registered integrator type 'EmissionIntegrator'
Registered integrator type 'pathtracing'
Registered material type 'coated_glossy'
Registered background type 'gradientback'
Registered material type 'blend_mat'
Registered light type 'pointlight'
Registered volumeregion type 'UniformVolume'
Registered light type 'directional'
Registered integrator type 'directlighting'
Registered light type 'sunlight'
Registered volumeregion type 'NoiseVolume'
Registered shader node type 'texture_mapper'
Registered shader node type 'value'
Registered shader node type 'mix'
Registered shader node type 'layer'
Registered shader node type 'vcolor'
Registered light type 'arealight'
Registered light type 'meshlight'
Registered light type 'bg_portal_light'
Registered volumeregion type 'ExpDensityVolume'
Registered texture type 'clouds'
Registered texture type 'marble'
Registered texture type 'wood'
Registered texture type 'voronoi'
Registered texture type 'musgrave'
Registered texture type 'distorted_noise'
Registered texture type 'rgb_cube'
Registered texture type 'image'
Registered volumeregion type 'GridVolume'
Registered integrator type 'SkyIntegrator'
Registered integrator type 'none'
Registered integrator type 'photonmapping'
Registered integrator type 'bidirectional'
Registered volumetric handler type 'beer'
Registered volumetric handler type 'sss'
Registered light type 'spherelight'
Registered volumeregion type 'SkyVolume'
Registered material type 'glossy'
Registered integrator type 'SingleScatterIntegrator'
Registered integrator type 'DebugIntegrator'
Registered background type 'darksky'
Registered light type 'spotlight'
Registered material type 'shinydiffusemat'
Registered background type 'textureback'
Registered background type 'constant'
Registered background type 'sunsky'
Registered material type 'glass'
Registered material type 'mirror'
Registered material type 'null'
Registered material type 'rough_glass'
Registered material type 'light_mat'
Registered material type 'mask_mat'
INFO: Adding Textures
INFO: Adding Materials
INFO: Adding Material: defaultMat
added Material 'defaultMat' (shinydiffusemat)!
INFO: Adding Material: Material
added Material 'Material' (glossy)!
INFO: Adding Lights
INFO: Adding Lamp: Lamp  type:  Point
added Light 'Lamp' (pointlight)!
INFO: Adding Objects
INFO: Adding Camera
added camera 'cam' (perspective)!
INFO: Adding Object: Plane
INFO: Adding World, type: Sunsky
sunsky: sun color = [0.435895 0.364548 0.306353]
added Light 'sunsky_SUN' (sunlight)!
added Background 'world_background' (sunsky)!
INFO: Adding Render
INFO: Adding Integrator: Photon mapping
added Integrator 'default'!
INFO: Adding Volume Integrator: None
added Integrator 'volintegr'!
creating new QApplication
Segmentation fault
Comment 9 Hendrik Iben 2009-08-12 17:05:29 UTC
(In reply to comment #8)
> Have you managed to get it working? yafaray-0.1.1-r1.ebuild builds correctly
> (with gcc-4.3.2-r3), renderer gui and materials preview works, but trying to
> render a scene leads to segfaults:
> ...

It works for me on x86 and amd64:
blender-2.49a, gcc-4.3.2, python-2.5.2-r8, qt-4.4.2 (on the amd64, the x86 box should be similar)

I have really no idea whats wrong, but I would guess it's either a problem with the python-binding or with qt.
Comment 10 Robert Krig 2009-08-13 08:17:14 UTC
(In reply to comment #7)
> I had the exact same problem and (think I) solved it:
> 


Thanks!! That did it!

It works perfectly now on my AMD64 System.

Thanks again to everyone involved.
Comment 11 Robert Krig 2009-08-14 19:00:02 UTC
(In reply to comment #8)
> Have you managed to get it working? yafaray-0.1.1-r1.ebuild builds correctly
> (with gcc-4.3.2-r3), renderer gui and materials preview works, but trying to
> render a scene leads to segfaults:
> 
> Loading plugins ...

> creating new QApplication
> Segmentation fault
> 


I'm no programmer, but from that log output it looks to me as Yafaray is properly doing its thing UNTIL it tries to create a QT Window. All the other stuff seems to be working. e.g. Add shaders and materials and preparing the geometry.

I would suggest you try a revdep-rebuild and see if that comes up qith an QT related broken dependancies. 
Comment 12 Miguel Marco 2009-08-15 15:00:42 UTC
Compiles fine, and can tell blender to use it to render, but when i try to render, i get this error message:

YafaRay (exportado)
~yafrayInterface_t()    delete scene...delete environment...done
YafaRay (exportado)
~yafrayInterface_t()    delete scene...delete environment...done
YafaRay (exportado)
Loading plugins ...
Registered light type 'arealight'
Registered light type 'meshlight'
Registered light type 'bg_portal_light'
Registered volumeregion type 'SkyVolume'
Registered material type 'blend_mat'
Registered background type 'sunsky'
Registered volumeregion type 'ExpDensityVolume'
Registered texture type 'clouds'
Registered texture type 'marble'
Registered texture type 'wood'
Registered texture type 'voronoi'
Registered texture type 'musgrave'
Registered texture type 'distorted_noise'
Registered texture type 'rgb_cube'
Registered texture type 'image'
Registered material type 'coated_glossy'
Registered background type 'gradientback'
Registered light type 'spherelight'
Registered background type 'textureback'
Registered background type 'constant'
Registered light type 'sunlight'
Registered integrator type 'directlighting'
Registered integrator type 'EmissionIntegrator'
Registered material type 'glass'
Registered material type 'mirror'
Registered material type 'null'
Registered material type 'rough_glass'
Registered light type 'pointlight'
Registered integrator type 'SingleScatterIntegrator'
Registered shader node type 'texture_mapper'
Registered shader node type 'value'
Registered shader node type 'mix'
Registered shader node type 'layer'
Registered shader node type 'vcolor'
Registered material type 'shinydiffusemat'
Registered background type 'darksky'
Registered light type 'spotlight'
Registered volumeregion type 'NoiseVolume'
Registered light type 'directional'
Registered volumetric handler type 'beer'
Registered volumetric handler type 'sss'
Registered integrator type 'photonmapping'
Registered integrator type 'pathtracing'
Registered volumeregion type 'UniformVolume'
Registered material type 'glossy'
Registered material type 'light_mat'
Registered material type 'mask_mat'
Registered integrator type 'bidirectional'
Registered integrator type 'SkyIntegrator'
Registered integrator type 'none'
Registered integrator type 'DebugIntegrator'
Registered volumeregion type 'GridVolume'
YafaRay (exportado)
Loading plugins ...
Registered light type 'arealight'
Registered light type 'meshlight'
Registered light type 'bg_portal_light'
Registered volumeregion type 'SkyVolume'
Registered material type 'blend_mat'
Registered background type 'sunsky'
Registered volumeregion type 'ExpDensityVolume'
Registered texture type 'clouds'
Registered texture type 'marble'
Registered texture type 'wood'
Registered texture type 'voronoi'
Registered texture type 'musgrave'
Registered texture type 'distorted_noise'
Registered texture type 'rgb_cube'
Registered texture type 'image'
Registered material type 'coated_glossy'
Registered background type 'gradientback'
Registered light type 'spherelight'
Registered background type 'textureback'
Registered background type 'constant'
Registered light type 'sunlight'
Registered integrator type 'directlighting'
Registered integrator type 'EmissionIntegrator'
Registered material type 'glass'
Registered material type 'mirror'
Registered material type 'null'
Registered material type 'rough_glass'
Registered light type 'pointlight'
Registered integrator type 'SingleScatterIntegrator'
Registered shader node type 'texture_mapper'
Registered shader node type 'value'
Registered shader node type 'mix'
Registered shader node type 'layer'
Registered shader node type 'vcolor'
Registered material type 'shinydiffusemat'
Registered background type 'darksky'
Registered light type 'spotlight'
Registered volumeregion type 'NoiseVolume'
Registered light type 'directional'
Registered volumetric handler type 'beer'
Registered volumetric handler type 'sss'
Registered integrator type 'photonmapping'
Registered integrator type 'pathtracing'
Registered volumeregion type 'UniformVolume'
Registered material type 'glossy'
Registered material type 'light_mat'
Registered material type 'mask_mat'
Registered integrator type 'bidirectional'
Registered integrator type 'SkyIntegrator'
Registered integrator type 'none'
Registered integrator type 'DebugIntegrator'
Registered volumeregion type 'GridVolume'
INFO: Adding Textures
INFO: Adding Materials
INFO: Adding Material: defaultMat
added Material 'defaultMat' (shinydiffusemat)!
INFO: Adding Lights
INFO: Adding Lamp: Lamp  type:  Point
added Light 'Lamp' (pointlight)!
INFO: Adding Objects
INFO: Adding Camera
added camera 'cam' (perspective)!
INFO: Adding World, type: Single Color
added Background 'world_background' (constant)!
INFO: Adding Render
INFO: Adding Integrator: Direct lighting
added Integrator 'default'!
INFO: Adding Volume Integrator: None
added Integrator 'volintegr'!
creating new QApplication
Traceback (most recent call last):
  File "/usr/share/blender/scripts/yafaray_ui.py", line 2165, in button_event
    yRender.render()
  File "/home/mmarco/.blender/scripts/yafaray/yaf_export.py", line 780, in render
    self.startRender(renderCoords)
  File "/home/mmarco/.blender/scripts/yafaray/yaf_export.py", line 717, in startRender
    guiSettings.fileName = outputFile
  File "/usr/share/yafaray/blender/yafqt.py", line 72, in <lambda>
    __setattr__ = lambda self, name, value: _swig_setattr(self, Settings, name, value)
  File "/usr/share/yafaray/blender/yafqt.py", line 28, in _swig_setattr
    return _swig_setattr_nondynamic(self,class_type,name,value,0)
  File "/usr/share/yafaray/blender/yafqt.py", line 21, in _swig_setattr_nondynamic
    if method: return method(self,value)
TypeError: in method 'Settings_fileName_set', argument 2 of type 'char const *'
~yafrayInterface_t()    delete scene...delete environment...done



It is an amd64 box, with gcc-4.3.2, blender-2.49a python-2.6.2-r1 and qt-4.5.1 
Comment 13 Hendrik Iben 2009-08-16 19:55:18 UTC
(In reply to comment #12)
> Compiles fine, and can tell blender to use it to render, but when i try to
> render, i get this error message:
> ...
>   File "/usr/share/yafaray/blender/yafqt.py", line 28, in _swig_setattr
>     return _swig_setattr_nondynamic(self,class_type,name,value,0)
>   File "/usr/share/yafaray/blender/yafqt.py", line 21, in
> _swig_setattr_nondynamic
>     if method: return method(self,value)
> TypeError: in method 'Settings_fileName_set', argument 2 of type 'char const *'
> ~yafrayInterface_t()    delete scene...delete environment...done

I think that there is a problem with the interface from Python to Qt. It is only a guess, but maybe you need to update dev-lang/swig or Qt. You also have to make sure that blender is compiled against the same python version that the yafaray ui uses. Maybe the fasted try would be an update to swig (and then re-emerging yafaray).

My swig here is pretty old (1.3.31, emerged a year ago) but I am also still using python 2.5.2.
Comment 14 Miguel Marco 2009-08-17 19:03:41 UTC
(In reply to comment #13)
Solved, thanks.
Comment 15 Markus Meier gentoo-dev 2009-09-21 15:57:49 UTC
this is now in portage, enjoy!
thanks to everybody who helped to create this ebuild... =)

*yafaray-0.1.1 (21 Sep 2009)

  21 Sep 2009; Markus Meier <maekke@gentoo.org> +yafaray-0.1.1.ebuild,
  +metadata.xml:
  initial import of yafaray, ebuild by me, bug #273738