Week 7 -
So understanding how data flow worked in an attempt to write new and clean code for softbody required a lot more effort than I earlier expected. A lot of time was spent on understanding how the current RNA-DNA system worked. It made me realise that the system is not very obvious and an all encompassing document about the same could help a lot. I’ll try to make one properly after the project but for now, just posting what I learnt about the same:
- In general
DNA_*.h
files hold data that we wish to write to disk when saving a file. In case of simulations, we wish to store the simulation settings, thus they’re defined in the DNA files. - Since these settings are also taken as input from user, they’re connected to the UI which is defined in
properties_*.py
using RNA code. - These RNA codes for each modifier are however not written individually and are auto-generated from using their respective
RNA_*.c
code - The code in
RNA_*.c
file consists of 2 parts, Runtime functions and UI connector functions. The runtime functions are generally for get()/set() while the UI connector functions define the function, associate it to the respective variable in the DNA struct and set the range and default values for these properties. - The code for reading and writing data to disk can be found in
blenkernal/intern/*.c
for the respective data structure
While there are a lot more specifics that I can add, I’ve tried to cover the basic flow to the best of understanding as of now. I also understand that most of what I’ve understood here is specific to softbodies and this flow may not necessarily be entirely the same for others (I’d however love for it to be more in sync with what might be the norm now)
I hope that with this effort I’ll be able to clean out the simulation code a lot. Over the next week I want to establish the basic stack for simulation that I can keep adding to.