Hunkadoodledoo
03-30-2006, 03:34 AM
Big thanks goes to eeshlo at the Yafray forums!
Okay, so apparently the next version of Blender will be able to save to EXR without digging around in PATHs and XML and terminals. I have heard (http://forums.cgsociety.org/showthread.php?t=337773&page=1&pp=15#post3397003) mid-May, but that is vague and in no way guaranteed to stay the same. Anyway, I had hoped that this function would have been spelled out earlier, but hey, better late than never. Let's get at it.
Caution: I use both Windows and Linux, so these instructions will be catered towards those OS's. I am sure it wouldn't be that much different on OSX, but I just can't say for sure.
Prerequisites:
A comupter
An Operating System Windows, Linux etc.
Blender 2.41
Yafray 0.0.8 (A version with EXR support)
A text editor
Love
How-to:
Put Yafray In The Path -
For Windows users - Now, let's start with the basics. Unless you feel like running Yafray with the entire path in front of it every time (i.e. "C:\Program Files\Yafray\yafray.exe"), you will need to put the Yafray directory in the PATH environment variable. To do that, you can right click on My Computer and select Properties or Press your Windows key + Pause. That will bring up the System Properties window. In Windows XP, choose the Advanced tab. Now press the Environment Variables button. Now you have two options. One is to do a system wide PATH change or a user PATH change. I recommend the user change just in case you mess up your system path variable. Now, check to make sure that there isn't already a path variable in the User variables section. If there is already a PATH variable in the the User variable section, creating a new one will overwrite the old one. You don't want to do that. If there isn't already a PATH (or Path or path) User variable, click the New button under the "User variables for YOUR USERNAME" section. Make the Variable name "PATH" without the quotes and the variable value "C:\Program Files\Yafray" (or the path of your Yafray installation) withouth the quotes. If there is one there, you want to select it and click the Edit button. If there is already something listed you can add your Yafray directory by putting a semi-colon after what is there and typing your full Yafray path. Now, click OK all the way back to your desktop and logout. Log back in and open the Command Prompt (by typing the cmd command at the run prompt or Start>Programs>Accessories>Command Prompt). Type yafray at the prompt and press Enter. You should see the standard Yafray "Starting YafRay" jargon. That means we are done with this part.
For Linux users - I have no idea how to set Yafray to be a system-wide command under Linux. What I do know is that if you open a terminal and type yafray at the prompt and you see the standard "Starting Yafray" jargon, you're set and you can move to the next section. If anyone wants to expound on the area of setting paths in Linux, be my guest.
Setting Up Blender -
Okay. So now we can actually start having fun! In Blender, you don't have to do much, but if you don't do it, no EXR. First, when Blender loads, move your cursor to the bottom of the File menu so that you have the up and down grabby arrow cursor. Click and drag the menu down so that you can see the settings buttons. Click on the File Paths button on the far right. Make sure the YFexport text box has path that exist entered in it. If not, insert one. You can then slide the File menu back up. Just in case you want to keep doing this without having to set this every time you open Blender, I would recommend you save your default settings by going to File>Save Default Settings or by pressing Ctrl+U. Now, we need to tell Blender to use Yafray to render. Press F10. Under the Render tab, select Yafray as the rendering engine. When you do that, two new tabs appear called Yafray and Yafray GI. We are concerned with the Yafray tab. Click it to display its contents. I am not sure what the default setting is upon installation, but you want the XML button to be depressed. This causes Yafray to be called in the console instead of as a plugin. This also allows us to interact with the XML file created for Yafray to know what to render. After those settings are set, load your favorite Yafray friendly .blend and we're set to render!
First Time Render -
For Windows users - Start by pressing the Render button or by pressing F12. When Yafray starts doing its magic in the console, you need to be watching for "Render pass:". When you see that in the console, press Ctrl+C to stop the render. Yafray will give you an error, but it is okay. You could wait for Yafray to render all the way through, but if you are as impatient as I am, you're done. You can close Blender.
For Linux users - I don't know the best way to pull this off. Use my method AT YOUR OWN RISK. My biggest problem is that I haven't figured out to see the Blender console under Linux. It just hasn't been that much of a problem yet. Anyway, you will do the same as Windows users by pressing the Render button or by pressing F12. Now it gets sticky. Because I couldn't see the console, I just had to guess when it was done creating the XML file. I then killed it with the System Monitor tool. If you choose to go my way, you are done with this step. Otherwise, you can let Yafray finish rendering. You then can close Blender.
Edit the XML -
For both Windows and Linux users - Find the XML file created by Yafray. It should be called YBtest.xml. Make a copy of it and rename it something memorable (maybe love.xml). Now, open the memorably named XML file in your favoite text editor (Notpad, gedit, metapad, etc.). Go all the way to the bottom of the page (Ctrl+End is a good shortcut). Find the block of code that looks like this:
<render camera_name="MAINCAM"
raydepth="5" gamma="1.000000" exposure="0.000000"
AA_passes="2" AA_minsamples="4"
AA_pixelwidth="1.5" AA_threshold="0.05" bias="0.001000" clamp_rgb="on"
background_name="world_background"
>
<outfile value="/home/josh/YBtest.tga" />
</render>
All you need to add to the line <output_type value="exr" /> and change the name of the outfile. It will look like this:
<render camera_name="MAINCAM"
raydepth="5" gamma="1.000000" exposure="0.000000"
AA_passes="2" AA_minsamples="4"
AA_pixelwidth="1.5" AA_threshold="0.05" bias="0.001000" clamp_rgb="on"
background_name="world_background"
>
<output_type value="exr" />
<outfile value="/home/josh/love.exr" />
</render>
Save the file.
Second (And Last) Time Render -
For Windows users - Open the Command Prompt and navigate to where your XML is saved. In the DOS window, use CD (for Change Directory) and the path where the file exists:
C:\Documents and Settings\Josh>cd my documents
C:\Documents and Settings\Josh\My Documents>
Now run Yafray with the name of your XML like so:
C:\Documents and Settings\Josh\My Documents>yafray love.xml
Starting YafRay ...
When it finishes, you have an EXR file! Yay!
For Linux users - Open a terminal and navigate to where your XML is saved. In the terminal, use CD (for Change Directory) and the path where the file exists and pwd (for Print Working Directory) to verify:
josh@slappy:~$cd /home/josh
josh@slappy:~$pwd
/home/josh
josh@slappy:~$
Now run Yafray with the name of your XML like so:
josh@slappy:~$yafray love.xml
Starting YafRay ...
When it finishes, you have an EXR file! Yay!
That concludes the instructions. If you have anything to add, please do. If you have any questions, please PM me. I hope you have a lot of fun editing in HDR. Get your EXR on!
maybe you can complement that explaining the practical use of EXR files. Add some related links, an image or two and you have a nice tutorial.
Thanks!
CGTalk Moderation
03-30-2006, 05:30 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.