ldo/ShaderTools — comment on commit 2438d8ac3ee32ba48207e4b37132a925875d48ec
File:  line 0
By ldo:

Continuing on from my rework of the ImporterSQL routine, here is another change, shrinking the script by more than another 1500 lines. It is now less than half the size of the original! And it still (hopefully) works the same...

This change reuses the table of field/attribute definitions I previously created for the ImporterSQL rework, so there was a lot less writing of new code here, mainly the removal of redundant code. Whereas previously I wrote a routine called SetupObject to set the various Blender object attributes from database field values, here the GetObjectFields routine goes the other way, extracting all the object attributes and saving them in a dictionary which will be written as database field values.

In the process of doing this rework, I noticed various discrepancies, such as fields which were being saved but not restored, additional boolean fields not being properly converted etc. All these corrections are incorporated here as well.