Current stable version: 0.1.1

View topic - Yaf(a)Ray: Implementation of Sunsky in Blender exporter

Yaf(a)Ray: Implementation of Sunsky in Blender exporter

Post here general questions about usage of YafaRay and about the Blender Exporter UI

Yaf(a)Ray: Implementation of Sunsky in Blender exporter

Post Fri Oct 05, 2007 5:23 pm

Update 30. November 2007

The sunsky panel is now added to the python GUI script in svn (thanks again, Lynx), so you can just do a checkout of Yaf(a)Ray and Blender and compile both according to Lynx's documentation, or use recent binaries.

-------------------------------------------------------------------

2nd Update 21. November 2007

Here’s a small update to the Blender python exporter GUI (correction of tooltip for “From (update sun)” button):

Yaf(a)Ray GUI Python plugin for Blender:
yafaray_ui-193-sunsky-0.1.1.py.tar.gz

-------------------------------------------------------------------

Update 21. November 2007

As of svn revision 193, the sunsky exporter code for Blender is now included in the Yaf(a)Ray sources (thanks Lynx!), so you won't need my patch anymore. Just do a usual checkout of Yaf(a)Ray and Blender and compile both according to Lynx's documentation.

You still need my modified python script to access the sunsky setting from inside the exporter GUI:
yafaray_ui-188-sunsky-0.1.py.tar.gz

-------------------------------------------------------------------

Update 04. November 2007

I updated the exporter and python GUI to support the sunsky “from” value. It now supports what I initially aimed for, so this is now version 0.1.

It is made with Yaf(a)ray svn revision 188 and Blender svn revision 12463. It may well work with other Blender versions also, including official 2.45 sources, but I didn’t test this.

The python GUI for Blender is the latest version as of revision 188, with additional sunsky functionality, and with one other function changed: I disabled quit by escape key and added a quit button instead.

Here’s a screenshot of the sunsky GUI part:
Image

You can set the sun direction in the GUI with either the normal button (the sphere like button in the middle) or with the x, y, z value. You can also get the sun direction *or* position from a selected sun lamp in the 3d scene with the "From (get angle)" and "From (get position)" buttons. The last button, "From (update sun)" updates the selected sun lamp's position *and* direction according to the current GUI values.

Download

Patch for the Blender exporter code:
patch-188-blenderplugin-sunsky.txt

Modified Yaf(a)Ray GUI Python plugin for Blender:
yafaray_ui-188-sunsky-0.1.py.tar.gz

For Yaf(a)Ray svn revision 188

-------------------------------------------------------------------

05. October 2007

Hi all,

(I wasn't sure where to post this, here or in the developer forums, please move if wrong.)

I'm a long time Blender user and love to use Yaf(a)ray as a renderer. I tried to implement the Sunsky background in the Blender exporter, so it can be chosen from the Python GUI. I don't know C++ very well, but I managed to make it work for me.

What works: turbidity, parameters a to e
What doesn't yet: setting the sun direction

If anybody wants to have a look, here's a patch for the blender exporter code and a modified Python exporter script:

Patch
Python exporter GUI script

I made the patch against Yaf(a)Ray svn revision 183 and tested it with Blender svn revision 12210 (both today's checkouts). To apply the patch, copy the file to your yafaray blender exporter root and run:
Code: Select all
patch -p0 < patch-183-blenderplugin-sunsky.txt

Then recompile Blender with the patched exporter code.

Sanne
Last edited by Sanne on Fri Nov 30, 2007 11:42 am, edited 5 times in total.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Mon Oct 15, 2007 7:02 pm

Maybe of interest for some of you:
http://www.yafray.org/forum/viewtopic.php?p=6867#6867

Best regards,
Martin
sandstorm
 
Posts: 71
Joined: Mon Apr 11, 2005 6:20 pm
Location: Lucerne / Mannheim

Post Tue Oct 16, 2007 12:51 am

sandstorm wrote:http://www.yafray.org/forum/viewtopic.php?p=6867#6867

I used your tutorial and documentation of the sunsky parameters to familiarize myself a bit with them before dabbling with the exporter. :)

Thanks for your great work, Martin!
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Sat Nov 03, 2007 11:34 pm

Updated, see first post.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Wed Nov 07, 2007 9:33 pm

Hello Sanne, first of all thank you very much for this patch :)
Could you post the compiled version of blender with the physical sun/sky?
slipknot66
 
Posts: 13
Joined: Sun Aug 27, 2006 6:29 pm
Location: Brazil

Post Wed Nov 07, 2007 10:24 pm

Thanks for your interest, slipknot66. :)

But: it is highly unlikely that my build will be useful to people, unless they have a similar system. If it is, I'll post it. But before I try to find somewhere to upoad to, let me first ask if you are able to run it at all: it is compiled for Kubuntu Linux 6.06 (Dapper) 64bit and Python 2.4.

If you have a 64bit Linux system, it *might* work. On 32bit systems it will not work. In general it should be far better to compile Blender yourself, which is not very hard (on Linux... no idea about Windows).

So, do you think you could use my build?
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Wed Nov 07, 2007 11:40 pm

Hello Sanne :)
Oh you are right, actually im using Windows x64 here :(
so guess i will have to compile my self.
But anyway, Thank you vey much for the patch :)
slipknot66
 
Posts: 13
Joined: Sun Aug 27, 2006 6:29 pm
Location: Brazil

Post Thu Nov 08, 2007 12:45 am

You're welcome, slipknot66, I hope it works out for you. Sorry I couldn't help more.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Sunsky questions

Post Mon Nov 19, 2007 8:53 pm

Hello everybody, I would like to ask how to install and work with sunsky plugin.
Where I can download it and where can I find the panel with controls? I am working on win vista 64. Thanx a lot for any help.

lorem
lorem
 
Posts: 33
Joined: Mon Nov 19, 2007 8:38 pm

Re: Sunsky questions

Post Mon Nov 19, 2007 10:48 pm

lorem,

you would need to compile Yaf(a)Ray and Blender from source after patching the source with my patch (link in first post). Unfortunately I can't help you how to do that in Windows, which I also can't provide binaries for, sorry.

My system is Linux, Kubuntu Dapper 6.06.1 amd64, with Python 2.4. If anybody has this system also and wants to try my binaries, please tell me. It might even work on other 64Bit Linux distros also, but certainly not on Windows.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Wed Nov 21, 2007 12:21 am

Update, exporter code with sunsky now in svn, see first post.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Wed Nov 21, 2007 12:25 pm

Another small update (tooltip correction), see first post.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Wed Nov 21, 2007 3:34 pm

Btw, you can just install Sanne's Python script alongside the "normal" one...gets an extra menu entry.

Still haven't tried to merge them, every time i touch the script i break something, most of the code is not from me anyway. And it really starts to become too much code for a single script...for my taste at least...

The sphere picker is kind of cool though :)
No idea what the other people think of the "x" button though...

And the yafray code still misses the calculation of the actual sun intensity/color for the chosen settings, ironically it seems to be like 2/3 of the whole code from the sunsky paper even though it's only called once :shock:
Lynx
 
Posts: 750
Joined: Wed Jan 12, 2005 5:07 am
Location: Germany

Post Wed Nov 21, 2007 5:50 pm

Lynx,

if you want, I can make a merge of the current svn yafaray_ui.py with only the sunsky part of my version of the script, without my other customizations (like the close button and disabling of ESC key quit). Would you like me to do that?

I agree that the script becomes quite long, not easy to work on it anymore. It might be worth thinking about splitting the code to several files. A single file has the advantage of easy distribution and installing, though.

...calculation of the actual sun intensity/color...

Ah, didn't know that. To be honest, I don't really understand the sunsky paper, I just managed to copy/paste/modify some lines in the Blender exporter code for the sunsky settings, which surprisingly worked. :)

If you add something to the sunsky part which needs a corresponding addition to the python script, I could probably help with that.
Sanne
 
Posts: 97
Joined: Fri Oct 05, 2007 4:50 pm

Post Thu Nov 22, 2007 12:56 am

Well i first had to merge some changes i had done on an outdated script version to SVN, must've forgotten to update my scripts folder...
Only a few lines though, just commited...

I'm not strictly against the "x" button, i just don't feel comfortable when people try to "sneak in" their favourite behavior changes, without having a clue if other people will apreciate it, or rahter complain (feedback welcome) ;)

Of course you could also talk to Bert, the actual author of the script, you'll find him in IRC most of the time...usually he convinces me that my ideas is the worse one anyway :P
Lynx
 
Posts: 750
Joined: Wed Jan 12, 2005 5:07 am
Location: Germany

Next

Return to General Questions and Blender Exporter UI

Who is online

Users browsing this forum: Luca62, paulo_gomes and 0 guests