GSOC 2022 – Draft Proposal Outliner Code Refactoring

This is a draft and not the final proposal. I will be making changes to this draft before final submission, but till then I would like to collect feedback from the community and developers regarding the ideas mentioned. Any form of feedback is welcome and I’m open to any discussions that may concern the clarity of ideas, scope of the project and adding/substituting new ideas.

Name

Chirag Mathur

Contact

Email: mchirag2002@gmail.com

Blender.chat nickname: @mchirag2002

LinkedIn: [mchirag2002]

GitHub: mchirag2002

Synopsis

The project focuses on the refactoring of the code using C++ and basic object-oriented programming. The main goal is to convert the old legacy code written in C according to the new system based on C++ and Object-Oriented Concepts. A good subset of the suggested improvements and smaller requests make ideal tasks that can be accomplished in a GSOC project.

Benefits

There are a lot of benefits of porting the entire code from the legacy C-style code to C++ and that too in an object-oriented approach. It offers modularity in the code for easier troubleshooting, efficient reusability via inheritance. This would also bring on the table the additional features that come with C++ like better UI changes and integrations.

Deliverables

  • Port the remaining elements of the legacy code to the new outliner code
    • Convert camel case function names to snake case function names
  • Replace switch-case logic with virtual function calls
  • Remove ‘TreeElement.directdata’ and create a new ‘AbstractTreeElement’ sub-class to store the exact data and publicly show when needed
  • Replace entire ‘TreeElement’ code to ‘AbstractTreeElement’
  • Document the new Outliner Architecture

Project Details

  • The project size is estimated around 175 hours and hence falls in the medium sized category.

  • The Outliner code is compiled in C++ now, and a big part of the tree building logic has been ported to a new object-oriented design from the old legacy C-style code.

  • Elements in the tree are represented by a ‘AbstractTreeElement’ sub-class, e.g. ‘TreeElementGPencilLayer’, ‘TreeElementNLATrack’. Not all tree element types are ported to this new design yet.

  • The purpose of the project is to port the entire code into the new format and hence also progress towards the new proposed UI design for the tree:

  • The base work of this project would revolve around the files in the directory – ‘source/blender/editors/space_outliner/tree/’.

  • The progress would include writing new methods and sub-classes for the ‘AbstractElementTree’ class and using them in the most efficient way.

Point of Concern : There is no documentation available for the already ported code base and as to how it is implemented and what pattern has to be followed along the way.

Addressing the Concern : One of the most optimum approaches can be going through all the header files where the code has been converted and then manually understanding and tracing all these changes.

Project Schedule

May 20 – June 12 (Community Bonding Period)

I would utilize this community bonding time period in going through the required code base and familiarizing myself with the code structure along with doing a few minor bug fixes. Along with discussing with the mentor about how to further proceed with the task in the most efficient way.

June 13 – July 24 (Evaluation 1)

During this time period I would implement the changes proposed under the supervision of the mentor and port the code base to the new C++ object-oriented format.

July 25 – September 4 (Evaluation 2)

During this time period I would like to optimize the code written during the first evaluation period so that the code is easily readable and in a proper format. All the documentation regarding the new Outliner Architecture would also be done during this time frame and there will be easily one week buffer period to accommodate any further changes.

Time Constraints: As per the instructions from our university, we would be having our end-semester examinations around the month of June or July so I would have to devote a week over there during which I would not be able to work.

Bio

My Bio isn’t the impressive one, I am not a prodigy or anything. I am a 2nd year BTech student studying Computer Science and Engineering at JECRC Foundation, Jaipur, India. I am 20 years old and a tech enthusiast. I was always curious about how the things we use in our day-to-day lives work and always wished I could play my part in making them. I started using blender around 2019 while working on a pet project related to game development via Unity. After using it for quite some time I wanted to contribute to its development. I am an efficient coder in C, C++. Java and Python and have made several projects in them.

16 Likes