Current stable version: 0.1.1

Blender 2.5 Integration with YafaRay

Personal Information

Name:

Shuvro Sarker

Email/IRC/WWW:

My mail account is shuvro05@gmail.com .I am frequent at freenode in channel #yafaray with the nick shuvro.

Idea to implement

Synopsis and Goals:

Blender 3D has been changed a lot from 2.49 to 2.50. Changes include the graphical interface, codebase and the python API. Simply it is much more powerful now than any previous version. And the exporter for YafaRay can give YafaRay users the opportunity to use their favorite renderer for the current version of Blender. So, I think at present this is one of the most important projects for which the YafaRay community is waiting for.

Now how can this be done ? YafaRay has some options that are different from Blender. Building an exporter system for rendering Blender projects with YafaRay thus means developing a system that can take those extra parameters from the user  in a user friendly fashion and can also use those parameters that are common to both Blender and YafaRay. After that it should transfer those parameters to the python binding of YafaRay in proper way so that YafaRay can do it's magic.

Design Issue

A declarative UI design approach will be followed in designing the exporter. Which means, UI will be generated from the information provided by the plugins. More specifically, at startup blender exporter will ask every plugin about it's properties.After getting information from the plugins, the exporter module will draw the UI. Next it will collect data from the blender UI.After that it will send the data to yafrayinterface.

The two major benefits of this approach are -

  1. If a new plugin is added, the exporter module can know about it's properties in the next startup and can draw necessary UI for it.
  2. It will also be able to change the UI with the change of property requirement of any existing plugin.

Detailed description:

I think the change that can influence most for the design of the exporter system is the change in blender python API in blender 2.5.The main features of the API that we are interested about are -

  • The ability to access existing blender buttons from python scripts.
  • The flexibility of customize blender panels,when needed.

With these facilities the implementation will follow these two guidelines -

  • If a panel has one or more extra property/properties that YafaRay does not require, we just delete the panel from the UI keeping track of the necessary properties of the deleted panel.When we create a new panel we will use the common properties of the deleted panel and create additional property/properties for the unique yafaray related properties, if needed. We should add all the properties in a manner so that all of their values can be acessed from the blender python api,anytime.
  • If a panel has only the buttons/options that yafaray needs we will keep that panel intact.

I have written a simple script[1] to demonstrate deleting panel, redrawing it, adding custom data and modifying RNA of blender python API.This will make the above statements clear.All the above steps are necessary for taking inputs for YafaRay from the user .When this is done, it is needed to send the data with proper formats to the python binding of YafaRay. This job can be done by following steps -

  • Collect the data that were set from UI using the blender python API.
  • Do some conversion of data(where necessary), so that if can fit with the data types that YafaRay expects.
  • Send these collected and modified(if needed) data  to YafaRay python module.

Till now, this is the guideline.The design approach of the UI components can be changed later by the advice of mentors or current developers.I have written another small script to demonstrate how to add an external renderer in Blender and add additional UI and property for it[2].

Data and Layout

Now it's an important issue to decide what data should be supplied from the plugins and what else are needed . Till now,I think panel name,property names associated with the panel and their data types are necessary. I have written a script demonstrating this here[8]. But more information is needed in case of mentioning the UI specification properly. Which means the data about the layout info, UI component for each property(e.g. text button,scroll button,drop down list ) should be provided also. To supply these data a UI layout structure should be developed. With this we can specifically define which UI component we want to draw in the UI for which property.

Workflow and Usability

As I stated above this system will give the users a chance for using YafaRay for the current version of blender.And I think the using procedure will be pretty much same as the previous one.Users can just select YafaRay as their renderer, set the properties needed and ren der it with YafaRay.And they will get a more neat interface for setting the properties for YafaRay.

Tentative schedule

This is the tentative schedule of the project -

  • April 26 - May 23: In this period I will learn about the codebase of YafaRay and finalize the what to do's of the project.I will also take decision about the designing issues communicating with the mentor and developers.
  • May 24 - July 4:I will implement the UI, blender python API data extraction and feeding it to yafaray for some of the scene elements of YafaRay (e.g. light, camera, mesh, render params etc.),which means a woking exporter that can work with limited properties.
  • July 5 - July 11: Testing the implemented portion and fixing bugs will be done in this time period.
  • July 16: Midterm evalution
  • July 17 - August 4:The UI, blender python API data extraction and feeding it to YafaRay for the rest scene elements(e.g. texture, material, smooth, integrator, background etc.) will be don during this period.
  • August 5 - August 9: Testing the newly implemented portion of the code will be in this time.
  • August 9 - August 15: I will test the whole system now, scrub the code if needed and write necessary documentation.
  • August 16 : Firm pencil down date.

Availability

During the community bonding period my classes will be off .So I can give full time effort for this project in this time. In the tentative schedule I have mentioned that I will take preparation for starting the project during this period. But if the preparation is finished before the end of community bonding period, I can start the original coding too in this period. Also in other periods, I think I will be able to give enogh time for the project. And during Thursday and Friday of week I can give whole time for the project as these are my weekly vacation days.

And I also want to work as an active developer during post GSOC period with YafaRay. If possible, I want to work as a mentor for the future GSOC projects for this organization.

Bio

I'm 21 years old, a final year student of CSE in Bangladesh University of Engineering and Technology[3]. I love novels, music, rain and of course coding .I have started programming with C, then in C++ and so far I have programmed in platforms like Python,Java,PHP,Javascript,MySQL etc along with C and C++. My C and Java projects were mainly game oriented (e.g. board games with C/C++,chess game that has networking support in Java[4]). And I worked in several web crawler projects in PHP and python[5].I have studied about 3d technology,lighting system and texturing techniques in my university graphics course. And I have used YafaRay for blender 2.49.

With the progress of time my interests grow towards game,graphics,rendering and neural networks. And now I am doing a thesis about neural networks.I have made a simple FPS game in Blender Game Engine and I also worked with DarkBasic Game Engine. Recently I have submitted 2 patches[6 & 7] for the latest version of Blender(2.5). And now I am reading about the previous exporter codes of YafaRay and about the options that YafaRay handles.

References

  1. http://www.yafaray.org/community/forum/viewtopic.php?p=18593#p18593
  2. http://www.yafaray.org/community/forum/viewtopic.php?f=24&t=3261
  3. http://www.buet.ac.bd/
  4. http://code.google.com/p/networkchessgame/downloads/list
  5. http://code.google.com/p/gmycrawler/downloads/list
  6. https://projects.blender.org/tracker/index.php?func=detail&aid=21660&group_id=9&atid=127
  7. https://projects.blender.org/tracker/index.php?func=detail&aid=21617&group_id=9&atid=127