Current stable version: 0.1.1

Nodes editor for materials and textures, using QT

Personal Information:

 

  • Name: Korlam Gautam
  • E-mail address: korlamgautam@gmail.com 
  • IRC nick: kageiit, Server: irc.freenode.net
  • Jabber: kageiit@gmail.com

 

Idea to implement:

 

Synopsis and Goals:

 

Synopsis: To Design a Nodes editor for materials and textures. 

Why: Most 3D suites presently have some form of support for using node based materials and textures to create complex materials. Yafaray's interface in Blender does not have its own Material and texture node editor and this makes it difficult to create advanced materials for use with Yafaray using the simple editor for materials. Thus, there is a need to for a node based material and texture system in Yafaray and a node editor to accomplish the job.

Goals: To develop a new node based material system for Yafaray. To have a separate nodes editor with a smooth work flow and ease of use  similar to the one available in the native blender UI along with some advanced features. The editor can be started from within Yafaray and would function as an external component. 

Benefits:

  • This would benefit Yafaray by allowing users to access more complex and wider range of materials and a greater power over how their final renders look. 
  • Such a useful and intuitive feature would greatly increase Yafaray user base and motivate artists to use Yafaray for more complex jobs. 
  • Another advantage would be that the editor will function as a useful tool even if Yafaray is used with other 3D suites by not relying on the suite's set of features for material and texture creation using nodes explicitly. 

Deliverables: 

  1. Source code for the final editor program
  2. Source code for the new node based materials and their data structure specifications, an API reference to add new node types.
  3. Non-Code deliverables include testing performed at various phases to verify the correctness of the code and features implemented in general. Also detailed user and development documentation for using the editor will be added. If time permits a set of test cases will be added. 

Detailed Description:

 

Coding: I plan to develop the editor interface including most of the features of the blender's native editor, without having to rely on blender in anyway. This would ensure the editor to work out of the box with its only dependency being the Yafaray library, which makes it reusable with any other 3D suite along with Yafaray. I plan to use C++ and Qt libraries for developing the editor. Qt is cross platform and even runs on embedded OS like Symbian, Maemo etc. The code will be flexible enough to incorporate new changes later on if needed like integration of Sub-Surface Scattering, OSL etc.

Features to be implemented:

  • A node based material system. For creation of complex materials. An API to integrate new features and node types easily.
  • Intuitive Editor user interface. To provide smooth workflow similar to the node editor in blender.
  • Utilities like customizable keyboard shortcuts, automatic layout of nodes in editor to enhance user experience, cater to advanced users and increase productivity.
  • Custom importer/exporter plugin for materials, independent of the Yafaray XML Scene files. To allow users to create material libraries for easy distribution and sharing.
  • An importer function to import from an online repository of material libraries where users can share libraries and so that commonly used node based materials are easily available with just a few clicks.

About Nodes: There will be three types of basic nodes. They are:

  1. Input/Output – Material, Texture, Geometry, Color etc.
  2. Mixer – Color Mixer, Add Component etc.
  3. BSDF – Lambert, Diffuse etc.

Other types of nodes such as group nodes are provided for convenience in work flow. Each node will also have a small area for previewing the result until that point, when available.

For example, to create a matte yellow material could be as simple as compositing material -> Lambert BSDF (color set to yellow).

Changes in Yafaray: The node based material will be one single extra material. The new material will contain all the properties necessary for its implementation, being in the xml file or being the Yafaray structures themselves. It will also contain meta information regarding placement and size of nodes in editor, any node group they belong to etc. The old materials in Yafaray such as glass, shinydiffuse will still be available and usable. Users who wish to work with simple materials may choose not use nodes. For complex materials, users can choose to create a new material using nodes. So the Yafaray XML specification is extended to include the new node based materials and old materials are not affected consequently.

Structure of node based materials:

Each node based material will be represented as a nodes graph where the output node is at the root, the constituting nodes go down the hierarchy till we reach leaf nodes i.e input nodes. This is shown in the following schematic:

Simple Node Network

The node graph can be stored as a complex network of nodes which can be represented by using a data structure such as adjacency list. This can be stored in the XML in the form of root node, list of child node ids, each child node further having its own children. To avoid repetition each unique node is stored once and the id is used to reference it for any node which uses it as a child.

For example, for the above shown network, the structure would be like:

  • root->[ramp_node_id,mix_node_id]
  • ramp_node->[simple_material_node_id]
  • mix_node->[rgba_node_id,simple_material_node_id,Lambert_bsdf_node_id]
Detailed specifications for every possible node type will be finally given so that the Yafaray Library implementation may be extended to account for these new changes. The methods of every node will act as an API to change node properties, add new parameters or link to existing nodes etc.

 

Integration with Yafaray: The editor would fetch the required data structures for materials/textures from Yafaray, allow the user to make changes using the editor UI and send the processed data back to Yafaray, i.e Yafaray performs the parsing of XML and the final saving to XML, the editor acts as an intermediary to add new materials, make changes to existing materials etc. this allows for a more flexible design from Yafaray's point of view.

 

Work Flow and Usability:


Work flow: The interface will be very similar to blender's node editor interface. Most common actions available in the blender editor will be implemented with customizable keyboard shortcuts for all actions such as duplicating a node, making groups of nodes etc. Node connections are made similar to blender in an intuitive fashion. Optionally, a feature to automatically organize nodes neatly on the screen when there are too many nodes will be available (if time permits).

Usability: The user can create materials from scratch or apply a set of operations on materials already imported to Yafaray from blender. The user will be presented with a preview of the material/texture at each step when possible. Common operations such as zooming in/out, moving nodes etc. will be available to the user.

A Typical Usage Scenario:

  • User launches the Yafaray export plugin (not necessarily in blender)
  • User chooses to create a new node based material, clicks the node editor button in the Yafaray interface
  • Editor inherits any existing materials from the exporter plugin. Now user may start working with such inherited materials, materials imported from external material library file, online material repository or start with new material nodes
  • User makes changes to material, viewing progress in the preview panels. User may save existing materials to external file or export back to Yafaray or both
  • Once the user is back in the Yafaray UI, the new node-based materials will be available in the material selection dialog. To edit such node based materials, user needs to relaunch the editor
  • Finally, user may render or export to Yafaray XML as usual

A rough initial view of the editor:

Draft Editor View


Tentative Schedule:


The project is realizable within a period of 3-4 months. The project is planned to be completed in 8 phases. Every phase includes documenting the progress during that phase. The timeline for each of these phases is given below:

Duration Description Details

 

May 5  May 15                                                                                                                      

Design Decisions and Initial preparation                                

Closely working with Yafaray community and mentor to learn more about the Yafaray code base in depth, reading Yafaray documentation and blender (if required). Obtain clarity of what to implement, Coding standards to be followed, potential problems that may be faced. Read up on various types of nodes to be implemented and their parameters. Design decisions are discussed and finalized.

 

May 16th – May 31st


Coding Phase I Make custom Qt widgets for nodes to get the look and feel of blender's node editor. The widgets will inherit from QWidget and be displayed on a QGraphicsView/Scene and interactions/events will be handled via QGraphicsProxyWidget. Milestone: GUI of editor complete

 

June 1st – June 20th


Coding Phase II Implement various node types, the operations possible on them, the parameters that can be input/output from them and the possible types of connections. Implement the internal logic for nodes and the node API for easy addition of new features. Milestone: Core of node-based materials complete

 

June 21st – June 25th


Testing Phase I Explicit testing of the above implemented features will be done and any major bugs will be fixed.

 

June 26th – July 15th


Coding Phase III Implement material/texture preview for nodes. Implement various work flow and usability features such as customizable keyboard shortcuts, Zoom in/out, grouping of nodes etc. Implement import/export to custom material format, allow import from online repository. Optional features such as automatic layout of nodes will be implemented if time permits. Milestone: Final node editor application completed.
 July 16th Mid-term Evaluation Submit code for mid term evaluation

 

July 22nd – July 27th


Testing Phase II Testing the features implemented in the previous phase and fixing any major bugs.

 

July 28th – August 2nd


Community wide Reviews, testing and evaluation Final phase of testing of the overall project, obtaining and consolidating the results and evaluation of the results. Requesting community to help me in final testing and closely working with testers.

 

August 3rd – August 10th


Scrubbing Code, Wrap-Up and Documentation

Fixing major and minor bugs if any. Writing User and Developer documentations and finalization. Milestone: Successfully completed GSOC.

Note: I shall not be available from July 16th to July 21st as I have to enroll in my university for a new semester, choose subjects etc. I apologize for it.

To get a better visual picture of the timeline you may visit [1].

 

Bio:

 

My name is Korlam Gautam. I am a third year undergraduate student at the Department of Computer Science and Engineering, Indian Institute of Technology, Kharagpur, India. I enjoy coding, music and occasional gaming.

I have two years experience in C++,Python and Qt. I also know C, Java, LISP, Prolog , Ocaml to a reasonable extent. I have completed a full semester course in Computer Graphics and 3D, which includes a lab component [2] . I started designing using blender as a hobby an year ago. I have started using Yafaray along with blender around the same time. I have attached some sample renders and screenshots below.

p> 

 

 

 

I have been in contact with Yafaray developers for a while now and they are a very exciting and energetic group and I am very enthusiastic to work under their guidance. I have been using blender and yafaray for a long time and i feel Yafaray greatly needs to have a material node editor as it is a valuable tool for many artists.

Related projects:

I am very interested in Computer Graphics and 3D. I made an application during my Computer Graphics Course to test my skills and familiarize myself with 3D. The application was made using C++ and Qt. OpenGL was used for drawing. 

The Application allows one to draw Surfaces of revolution by specifying a profile for rotation in the form of a b-spline. The surface is generated by a new algorithm which uses number theory to approximate digital curves with their straight line components. Then the surface can be textured, blended with color, illuminated with lights and can be exported to an image. A inbuilt help section is provided to make things clearer, so feel free to explore it if u like.

The windows version of the application and the source code(C++) can be found here (you will need Qt Libraries to compile it) : [3]

A screenshot of the application in action:

 

 

I also have an Open Source Project called PyBatch. PyBatch is a utility to batch convert/mux avi,mp4 etc. into mkv format. It can also be used to batch extract tracks from mkv files. The application was written using Python, PyQt and other opensource tools such as mkvmerge, mediainfo, mkvextract etc. I am the only contributor, so I decided to take part in GSOC and work with other interesting people so that I can contribute to Open Source Software in a more meaningful way. It can be found here : [4]

A screenshot of the application in action:

 

 

Another application called Blusic developed by me very recently which allows users to share music files over Bluetooth similar to a p2p network. supports fast file search, instant messaging, file downloading etc. It was developed by a group of 10 students with me as project leader. I was in responsible for the GUI and networking aspects. I also managed the administrative issues and SVN server for the project. It was developed for the Symbian mobile platform using Qt and Symbian C++ . A screenshot of the application in action:

 

 

More about me: My full bio is too long to include here so i am linking to it here : [5] (please download it in case the online viewer does not show the formatted text correctly)

Why me?: I want to express my deep commitment for this project and Yafaray in general. I always think in the user's viewpoint while designing user interfaces, which I have been doing for 2 years now, and have gained experience and insights into the features that users require, how to increase user's productivity without sacrificing user comfort etc. Also I will assure that I will continue my commitments with Yafaray well after GSoC. If you find any part of this proposal is not clear please contact me.

Why Yafaray?: To be honest, I love the way Yafaray has changed the way renders look for thousands of users worldwide for the better  and I am extremely interested to promote its growth as a FOSS project, by which I can affect many different users of varying communities and make the phrase "Yafaray : Free Rays for the Masses" a reality.

I'm fully available this summer and will be able to tune my day/night rhythm as per my mentor's requirement and assure a dedicated work of 35-40 hours/week.

References:

  [1] My GSOC Project Timeline

  [2] Computer Graphics Course Homepage

  [3] Texmap Project Homepage

  [4] PyBatch Project Homepage

  [5] My Detailed Bio

  [6] Qt by Nokia

  [7] Material Nodes in Blender