View topic - YafaRay exporter for Blender 2.6x (beta)

YafaRay exporter for Blender 2.6x (beta)

Ask here your questions about development and about raytracing theory & implementation. Here you can post your patches for review.

YafaRay exporter for Blender 2.6x (beta)

Post Wed Aug 04, 2010 5:15 pm

How complete is it?
The exporter is on beta stage quickly transitioning to release candidate, most of the things already work. If you have time, help us to betatest it and report bugs on this thread. On the spreadsheet below you will find a list of features for the Blender 2.5 exporter, and what is working and what is not. Developers and betatesters are using it to guide their work on the exporter. Keep it up to date, please:

http://tinyurl.com/4bqox4r


Lates binaries several OS:
How to build it?
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Wed Aug 04, 2010 9:51 pm

Hi,

I am trying to test your exporter on ubuntu linux. I think I followed the installation procedure successfully but there is one issue I will explain in case I did do something wrong after all:

During the second step of your procedure when I was supposed to test loading the yafaray plugins in the 2.5 console, I did not get any output from those console commands that showed the plugins registering. But there were no error messages in the output, and subsequently when I tested a yafaray render of the default scene in blender 2.5 I got a render, so I guess the yafaray plugins are set up properly.

After a few minutes of testing I noticed some issues, but I don't know for sure if some of them are issues with the exporter or with a possibly faulty installation:

* Many settings initialize to zero in the ui, such as those for photon mapping or path tracing integrators, or DarkTide's sunsky. Obviously a value of zero isn't valid for many of these parameters.

* Using the pathtracing integrator always results in a black render for me.

* Background lighting seems to follow the old paradigm of a "Use Background" setting in the integrator settings, instead of the new way of having a "Use IBL" setting associated with the different yafaray background types.

* DarkTide sunsky doesn't work for me, a single color background gets exported instead

* Mesh objects with no assigned material aren't handled well, they cause a black render. These objects should be automatically assigned a default material when they are exported.

* Sometimes I get a flood of error messages in the blender console after a render is finished (or seems to be finished), and cpu usage pegs at 100%. The errors are all the same, and look like something like this:

...path/to/properties_yaf_texture.py, line 455, in draw
UnboundLocalError: local variable 'col' referenced before assignment

---

So as I said these problems could be the result of a bad installation, if you know that I shouldn't be having these problems then please tell me.

A final note: the blender 2.5 revision you are using is really old, it even predates the latest blender 2.5 beta. I tried to use your exporter with the latest blender revision, but I got other problems e.g. with settings panels disappearing so I gave up and installed the revision r30418 that you mentioned. (All the issues I mentioned above were using r30418.) Hopefully you can investigate making your exporter work with the latest blender revision, because a lot has changed in blender since r30418.

Thanks for all your hard work, having an exporter for blender 2.5 is really great! :D
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Thu Aug 05, 2010 4:17 am

First of all thanks a lot for your reply. In most of the cases, you are right. Here, I want to mention you a thing.Blender 2.5 python API is still an unstable one. Since I have started the project, I updated my code for three versions of svn. The last one was done near about July 13. So, its not an so old one :) . Porting for unstable versions again and again just is a waste of time. So, when the API will become stable, I will take steps to port it.

Here is your updates. I have updated the installation process doc and added a new step there. Please go and visit - http://somenewcolors.blogspot.com/2010/08/installing-yafaray-exporter-for-blender.html

Now about the bugs -
Many settings initialize to zero in the ui, such as those for photon mapping or path tracing integrators, or DarkTide's sunsky. Obviously a value of zero isn't valid for many of these parameters.

I will do this asap.

Using the pathtracing integrator always results in a black render for me.

Fixed.

DarkTide sunsky doesn't work for me, a single color background gets exported instead

Fixed.

Mesh objects with no assigned material aren't handled well, they cause a black render. These objects should be automatically assigned a default material when they are exported.

Fixed.

Sometimes I get a flood of error messages in the blender console after a render is finished (or seems to be finished), and cpu usage pegs at 100%. The errors are all the same, and look like something like this:

...path/to/properties_yaf_texture.py, line 455, in draw
UnboundLocalError: local variable 'col' referenced before assignment


Have taken some measures to fix it. But can't test it properly, as you didn't mentioned the way to regenerate the bug in a specific way.

Without these I have added some extra features in the latest code. Added some operators for Sunsku and Darktide's Sunksy(See the installation doc to include it). The updated codes can be found in the git repository.
Thanks again for your post.
Stay Fine.

Shuvro
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Thu Aug 05, 2010 3:19 pm

Hi, thanks for your answers and also the bugfixes. All the fixes worked well except for pathtracing, now I get a segfault when I use this integrator. Here is the backtrace:

http://yafaraydev.pastebin.com/ez0vj8cT

I also get an exporter error when trying to render an object with an image texture. The same error also occurs with image texture world backgrounds, like HDRIs. Here is the error:

http://yafaraydev.pastebin.com/SBZRqfrM



I am still investigating the issue that results in cpu usage hitting 100%, your update fixed the error that appeared but I am still getting the problem. I am not sure how to reproduce this yet, when I figure that out I will let you know.


Also some thoughts about materials:

* I think it is not possible to add multiple materials to a single object from the yafaray ui.

* This isn't very important, but it would be nice if some of the settings that aren't being used in a particular context could be hidden in the ui. For example, if the fresnel option in the shinydiffuse shader is unchecked, then the fresnel IOR parameter shouldn't be shown.


One final note: The thing that makes testing most difficult for me now is that I can't open a yafaray scene already made in 2.49 and render, because all the yafaray settings are lost in 2.5. So I have mostly been recreating setups from scratch. I did try importing all objects from an old scene into 2.5 and redoing all the yafaray settings manually, but I ended up with this exporter error:

http://yafaraydev.pastebin.com/fqDppRNm

I guess I must have forgotten to set up a certain yafaray parameter correctly, but the problem is I have no idea which one. Can you give me any hints about what is wrong?

Thanks again for your work. :)
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Thu Aug 05, 2010 5:17 pm

Shuvro, can you post instructions and put the necessary stuff for download for those who work under Windows, please.
User avatar
Samo
 
Posts: 3056
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Fri Aug 06, 2010 3:01 am

Here are the present updates -

Many settings initialize to zero in the ui, such as those for photon mapping or path tracing integrators, or DarkTide's sunsky. Obviously a value of zero isn't valid for many of these parameters.


This is done.

All the fixes worked well except for pathtracing, now I get a segfault when I use this integrator.


I have noticed the bug. But I think it is related to the core code. So some time is needed to fix this.

I also get an exporter error when trying to render an object with an image texture. The same error also occurs with image texture world backgrounds, like HDRIs


Fixed. But this is tested for linux only. I think in windows it will not work. Here I am pasting my result that uses image as background, image texture and image based lighting.


tmp9pbVso.png


I think it is not possible to add multiple materials to a single object from the yafaray ui.


Now you can set up multi material from the UI. Exporter code is also updated for that support. Here is a test render -

tmpM0mAKJ.png
multimaterial test


This isn't very important, but it would be nice if some of the settings that aren't being used in a particular context could be hidden in the ui. For example, if the fresnel option in the shinydiffuse shader is unchecked, then the fresnel IOR parameter shouldn't be shown.


This design principle is used throughout the exporter UI. The specific case you mentioned it was not possible due to some technical reasons. I will keep this case in mind.

I did try importing all objects from an old scene into 2.5 and redoing all the yafaray settings manually, but I ended up with this exporter error


This was not your fault. Fixed this bug.

I am still investigating the issue that results in cpu usage hitting 100%, your update fixed the error that appeared but I am still getting the problem


I can tell you the reason. It happens when you select a type variable (e.g. cam type and texture type) that is not blender python api's own type element and which sets the blender python api's type variable also.
Possibly it is a bug of their API. I will talk to blender devs about this point.

The thing that makes testing most difficult for me now is that I can't open a yafaray scene already made in 2.49 and render, because all the yafaray settings are lost in 2.5


This should be. Because the python api, on which the present exporter is based on is completely different from the previous one. So, the scene elements of the present exporter has no relation with the previous one.

Thanks for your effort and post.

Shuvro
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Fri Aug 06, 2010 2:33 pm

Thanks again for your answers and fixes. All your fixes work for me except the texture exporting, I still get the same crash. I don't know why it doesn't work for me when it works for you.

Some more things:

* Objects on all layers are exported regardless of which layers are active.

* I get a new exporter crash when using objects without an assigned material:

http://yafaraydev.pastebin.com/m3j6mpTU

* Area lights seem to have problems. An area light at default sizeX and sizeY provides no illumination regardless of what power setting I use, and if sizeX and sizeY are increased I get a weird result:

arealightresult.png


Also, if I increase sizeX and sizeY and enable "create geometry" too I get a segfault:

http://yafaraydev.pastebin.com/RmMRLEW9

BTW, what does the create geometry setting do? Does it turn the area light into a meshlight? And is the sizeX and sizeY parameters the only way to control the size of an area light? In 2.49 we were able to scale the area light in the viewport, and I find this control scheme more convenient. I hope this works in 2.5 too.

* What does the spot lamp distance parameter do for a yafaray render? All yafaray lights have inverse square falloff, and this parameter seems to have no visible effect anyway.

* Does it make sense to have a meshlight lamp type? I think it is enough that you can select a mesh object and enable meshlight in its object settings.

* Some of the new defaults for the photon mapping integrator seem way off compared to 2.49. Here are the discrepancies, with 2.49 defaults followed by your 2.5 defaults in parentheses:

depth: 5 (4)
diff. photons: 500000 (100000)
caus. photons: 500000 (0)
caus. radius: 1.0 (0.25)
search: 100 (1000)
fg bounces: 3 (100)
fg samples: 16 (100)

I think at least the fg settings should be changed.

* What I said before about world background ibl settings not matching the current 2.49 exporter still holds. For example, there is currently no way to use a single color or gradient background as a light source.


I am listing separately some unimportant things, feature requests, and other things that you shouldn't spend time on unless you want to:

* Minor thing: when I change from a sun lamp to a point light in the lamp settings, the lamp drawtype in the 3d window isn't updated. I only mention this because all other changes are updated perfectly.

* It would be nice to have an IES lamp type. Currently there is no way to use IES lights.

* In DarkTide's sunsky there are a couple new parameters like exposure and a gamma encoding toggle that aren't exposed in the 2.5 ui, so the builtin defaults are used. The problem is that the default for exposure is way too high, so it is very hard to get a sunsky render that looks nice and not washed out. It would be great to have control of the exposure parameter.

* It is too bad that completed render tiles aren't being sent to the image viewer so that we could see a render result in progress. I am sure this is very hard or impossible to accomplish with the current render api, so I am certainly not asking anything of you with this. I just felt like whining to nobody in particular. :D

---

Thanks again for all your hard work on this exporter. I want to say that the integration is everything I had hoped for, and the result is really excellent. :D
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Fri Aug 06, 2010 8:44 pm

Hi Shuvro,

I am already testing it on windows, and I would like to point out four of five things:

  • In Windows, unless there is a C:\tmp folder to save images to, yafaray can not produce the image in the Blender windows. It will output a message like this:
    Code: Select all
    INFO: [##########################################################] (100%)
    INFO: DirectLight: Overall rendertime: 12.781s
    INFO: imageFilm: Flushing buffer...
    INFO: PNGHandler: Saving RGB file as "/tmp\tmpkd9uah.png"...
    ERROR: PNGHandler: Cannot open file /tmp\tmpkd9uah.png
    INFO: imageFilm: Done.
    INFO: Interface: Deleting scene...
    INFO: Kd-Tree: Freeing nodes...
    INFO: Kd-Tree: Done
    INFO: Interface: Deleting environment...
    INFO: Interface: Done.
    Traceback (most recent call last):
    File "C:\Documents and Settings\Alvaro\Datos de programa\Blender Foundation\Bl
    ender\2.53\scripts\addons\yafaray\io\yaf_export.py", line 184, in render
    ay.load_from_file(outputFile)
    SystemError: Error: RE_result_rect_from_file: failed to load '/tmp\tmpkd9uah.png'

  • The image loader panel gets confusing a bit more than necessary, with duplicated functions and other buttons which are new to me (fields and premultiply):

    Image
  • Some texturing options have got appeared yafaray did not bother with before, I wonder where they are coming from. I know it because I wrote the docs and I know what it is supported and what not, and they don't also appear in the new features list of yafaray 0.1.2 beta.

    I wonder where that stuff is coming from, whether Darktide implemented them in yafaray or it is just python coded utilities whose results can be feed into any render engine. Take for instance this section in the Texturing windows:

    Image

    Are mip maps and maps antialiasing really supported?

    If YafaRay is not affected at all by these settings, please kill these options with no mercy. The same should apply to all other texturing sections.

  • An last by now, in the Background settings, I think Single color and Gradient are missing an 'IBL mode' option available in the yafaray 0.1.2 beta exporter.

Thank you for your work Shuvro.
User avatar
Samo
 
Posts: 3056
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 12:55 am

Samo

would You mind sharing your windows files?
I went to the his blogspot but the instructions are for *inux.

Claas
...............................................
C l a a s E i c k e K u h n e n
Artist : Designer : Educator
User avatar
cekuhnen
 
Posts: 281
Joined: Mon Jan 10, 2005 10:00 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 7:16 am

I packaged together the win32 exporter with all the required scripts and binaries for YafaRay 0.1.2 beta here:
http://public.blu.livefilestore.com/y1pA_gDsI30q6eSA6jIZBO85oEctq_5t__G9w8x2oiyDRGNjbBrYCmVk8xpfBwDN-VrRFhZbz3BkwN-ZSAv8g9VZw/yafaray_0.1.2beta.zip?download&psid=1

1. Unzip into the blender installation directory scripts/addons, so that you have a folder called scripts/addons/yafaray. (folders like ui, io, bin should be right underneath that)
2. Restart blender, go to User Preferences, click Add-Ons, and go to the Render subpanel. Yafaray should be available to be activated.
3. Select YafaRay from the Render Engine dropdown list at the topmost bar.

You need Blender 2.53 to run these. I will post new zips with updated scripts that you can overlay as we bugfix.

- Kim
Kerbox
 
Posts: 18
Joined: Sun Jul 12, 2009 2:56 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 10:17 am

wizofboz your reply starts here -

All your fixes work for me except the texture exporting


This is how it was not working for you. Present blender python doesn't support relative path handling options yet. So, in any case of file choosing when you are in the file browser window, unmark the 'relative path' button. Everything will work fine. :) I tried to post an screenshot here but the board is not allowing me do so. :(


Objects on all layers are exported regardless of which layers are active.


Fixed. Now only the objects of the selected layers get rendered.

I get a new exporter crash when using objects without an assigned material:


Fixed

Area lights seem to have problems. An area light at default sizeX and sizeY provides no illumination regardless of what power setting I use, and if sizeX and sizeY are increased I get a weird result


I have noticed the problem, but looking the code, I could not figure it out. So, I will fix it later, otherwise I will remove the option of area light, this is not a must.

What does the spot lamp distance parameter do for a yafaray render? All yafaray lights have inverse square falloff, and this parameter seems to have no visible effect anyway.


This is only to control the display in the 3d view, otherwise it looks messy.

Does it make sense to have a meshlight lamp type? I think it is enough that you can select a mesh object and enable meshlight in its object settings.


Removed.

Some of the new defaults for the photon mapping integrator seem way off compared to 2.49. Here are the discrepancies, with 2.49 defaults followed by your 2.5 defaults in parentheses:


Fixed.

What I said before about world background ibl settings not matching the current 2.49 exporter still holds. For example, there is currently no way to use a single color or gradient background as a light source.


Added support :)

Minor thing: when I change from a sun lamp to a point light in the lamp settings, the lamp drawtype in the 3d window isn't updated. I only mention this because all other changes are updated perfectly.


Fixed.

It would be nice to have an IES lamp type. Currently there is no way to use IES lights.


Added.

In DarkTide's sunsky there are a couple new parameters like exposure and a gamma encoding toggle that aren't exposed in the 2.5 ui, so the builtin defaults are used.


Added exposure, gamma encoding and clamp RGB parameters.

It is too bad that completed render tiles aren't being sent to the image viewer so that we could see a render result in progress


It is not possible with the current blender python API. :(

Again my sincere thanks to you for noticing the bugs and point those here.
Good Day.

Shuvro
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 10:24 am

Samo, this reply is for you. At first thanks for testing it on windows. I have no windows installed in my pc, so it was not possible for test in windows for me.

In Windows, unless there is a C:\tmp folder to save images to, yafaray can not produce the image in the Blender windows. It will output a message like this


When choosing any kind of file from the file browser, or setting output directory uncheck the variable 'relative path'. Please see the previous reply of me in this thread to get a bit detail.

The image loader panel gets confusing a bit more than necessary, with duplicated functions and other buttons which are new to me (fields and premultiply)


Fixed.

Some texturing options have got appeared yafaray did not bother with before, I wonder where they are coming from.


Fixed. Now there is no texturing option in the UI that is not used by the exporter. :)

An last by now, in the Background settings, I think Single color and Gradient are missing an 'IBL mode' option available in the yafaray 0.1.2 beta exporter.


Added.

Thanks again for pointing the bugs.

Shuvro
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 10:25 am

And this reply goes to master Kim.
Thanks a lot for your helpful effort.

Shuvro
shuvro
 
Posts: 26
Joined: Mon Mar 22, 2010 1:02 am

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 2:20 pm

Thanks for your latest work, it looks good. I hope you get area lights working, they are a very important light source. The relative paths issue isn't much of a problem, now that I know I'll just disable relative paths in the user preferences so I don't have to remember it all the time. I just have a couple points on the latest updates:

* Thanks for the new sunsky options. I think gamma encoding can be enabled by default like with 2.49.

* For IES lights, I think the samples parameter is only used with soft shadows, is it possible to hide this if soft shadows is unchecked, or are there technical limitations here too? Also I think cone angle is not used by yafaray for IES lights, unless you are using it for something else.


I have some things on render settings:

* I tried to use the border render function, but I got a segfault:

http://yafaraydev.pastebin.com/56vuBaNV

I'm not sure how helpful that backtrace is. The border render appears in /tmp with the appropriate region inside the rectangular border rendered, but I don't know if this can be integrated with the image viewer.

* I can't find a way to save a render with an alpha channel. There is an option to select RGBA in the output panel, but it doesn't work correctly. Also the option to render the z-buffer is missing. Like the border render a z-buffer image is created in /tmp for every render but I don't know if or how it could be sent to the image viewer.

* Can parameters be restricted to certain values? For example, many parameters in the render settings (and elsewhere) can be set to negative values, which is bad.

* AA threshold needs to be settable to at least three decimal places, eg "0.001", also volumetric step size in the object settings needs this. If technically possible the AA inc. samples setting can be hidden unless passes > 1.

* In the general render settings I think auto threads can be enabled by default. Also if possible the threads setting can be hidden if auto threads is enabled.

* What does the 'draw sam pix' setting do? If this refers to the resample mask then it can be removed because there is no interactive resampling with the 2.5 image viewer.

* Does auto save and auto alpha work correctly? Where are the images saved to by default?

* I feel that these render panels can be organized a bit better. I will list an idea that you could discuss with Kerbox and Samo if you want, or reject as you wish. :)

The general settings panel has quite a few options in it, and it seems a bit cramped to me. Also the output panel has some options that yafaray doesn't use. I think a new output panel could be created with the options yafaray uses plus some of the options from the general render settings to free some space there. You can use the 2.49 exporter as a guide to see which are render settings and which are output settings.

--

Thanks again for your effort. :D
User avatar
wizofboz
 
Posts: 235
Joined: Tue Sep 16, 2008 7:00 pm

Re: Alpha release: YafaRay exporter for Blender 2.5x

Post Sat Aug 07, 2010 5:35 pm

Kerbox

looks like you link does not work.
The file cannot be found.
...............................................
C l a a s E i c k e K u h n e n
Artist : Designer : Educator
User avatar
cekuhnen
 
Posts: 281
Joined: Mon Jan 10, 2005 10:00 pm

Next

Return to Developers' Corner



Who is online

Users browsing this forum: No registered users and 2 guests

cron