Skip to content

Latest commit

 

History

History
83 lines (70 loc) · 8.13 KB

Readme.md

File metadata and controls

83 lines (70 loc) · 8.13 KB

GSoC 2017 final report:

appleseed: Python scripting feature

Original proposal

Python scripting feature for appleseed.studio

Brief results

  • All goals have been met
  • Over 30 pull requests were merged
  • Got experience with
    • Contributing to open-source product
    • Remote work
    • Development of C++ project with large codebase
    • Frameworks: Qt and PyQt, Boost and Boost.Python in particular

Pre-GSoC work:

Project description

After first contact with appleseed I fixed some bugs and implemented a small project to get familiar with people, codebase and workflow in organization. Project was to implement packaging appleseed projects to zip-based containers with appleseedz format.

appleseed project is consisted of main appleseed file and dependencies like textures. In appleseed file all paths to dependencies are listed. Previously you would need to keep original project structure or manually change paths in appleseed file to be able to open projet shared by another user. With applessedz projects users can easily share their scenes because all files are stored in the archive and project structure will always be the same.

During this project I designed and implemented zip-based project format called appleseedz and added ability to natively read and write appleseedz format in all appleseed components.

List of merged pull requests:

Key pull requests are in bold. There are also decriptions inside prs themselves.

GSoC work

Project description

Project decription

My summer project was to implement and explore possible use cases of Python scripting for appleseed.studio. appleseed.studio is a GUI for appleseed renderer that allows to inspect, modify and render scenes. Python scripting is a useful feature for applications like appleseed.studio as it allows to automate repetitive actions, speed up development and expand functionality with user plugins.

As appleseed is written in C++ it was necessary to provide Python bindings for its functionality. There already were bindings for core functionality and my goal was to add bindings for studio-specific functionality like GUI project management and direct access to GUI Qt classes. To provide bindings I implemented new Python module containing studio-specific functions using Boost.Python library. To keep the code clean this part required quite a lot of refactoring.

To use Python binding we should be able execute code inside appleseed.studio. To achieve this I integrated Python interpreter inside appleseed.studio. This part also required to change cmake configuration.

Python console widget was implemented to provide ability to write and modify Python scripts. With all its features: code highlighting, autoindentation, file management and others - I wrote a decent amount of new code to appleseed.studio and intensively used Qt framework.

With all this done, it became possible to make use of appleseed functionality exposed to Python. Next step was to let users expand functionality. It was achieved with plugins. Plugin is just a Python module with register function placed in a specific directory. To give an example of how plugins can be written, I created a plugin that converts all textures in project to tx format that is more effective than simple png or jpeg for rendering purposes. This plugin basically sums up all the work: it retrieves Qt classes to add menu to main window of applessed.studio, uses studio-specific and core appleseed bindings to replace old textures with converted ones and registers automatically with implemented plugin system.

During all development we with mentors discussed project daily. It had a huge influence on the process because they could guide me during implementation of every feature which made development process very productive. Also code was merged to master often giving whole community an ability to try new features, so I was receiving priceless feedback often and early. Thanks to many discussions prior to GSoC and thorough planning of timeline all goals were met and new functionality is ready to use.

Screenshots

  • appleseed.studio main window with opened project (appleseed shaderball). In the top menu bar you can see menu entry which is added with Python plugin bundled with appleseed, at the bottom Python console is opened. Studio Overview
  • Python console in details. Some features of console are highlighted. Python Console Overview
  • Gaffer (scene generation tool) opened in Qt widget that was created with script and inserted to appleseed.studio's main window. Studio Gaffer Browser

List of merged pull requests:

Key pull requests are in bold. There are also decriptions inside prs themselves.