A timid proposal: expanding the "Edit Source" concept to Objects
I am pretty new to Blender, so my proposal may indicate ignorance of an existing feature; but fairly energetic googling has not led to any evidence of this capability so I will dare to suggest it, timidly.
Blender 2.78 supports the "Edit Source" option when clicking on buttons in UI panes. If I "other-click" (non-select click) on any button in a properties pane, for example, I can choose "Edit Source;" and if I have a Text Block open at the time, the whole source for that pane will get dumped into my Text Block. I can then read it for enlightenment, use it as the template for a new Addon pane of my own, etc. This is terrific.
My proposal is this: could we possibly have a similar source code dump for Objects, or even for entire scenes? That is, could Blender dump low-level (not bpy calls) code for object creation and configuration? Could I select an object and get a dump of the Python code that would recreate it and customise its properties just as it appears at this moment? It seems the level of introspection is not that different, from my naive perspective. It would be particularly nice if the code dump was sensitive to default values and dumped only lines of code as necessary for non-default value setting, leaving out all default values.
This would be incredibly educational, also far faster than ctrl-Space completion or hunting through seemingly endless online api doco. As a beginner trying to write my first object creation python scripts, there is nothing I could wish for more (other than to eliminate that pesky need for sleep). Humbly submitted for your consideration...
2 Comments
That video tutorial is remarkable. Possibly the most exciting Blender tutorial I have ever viewed. Only one more layer of indirection would be needed to do exactly what I'm proposing :-) I think I have a new spare-time project!
many thanks for the links. creaprim.py is very much like what I was proposing, or at least a prototype thereof. it ignores reams of object properties, focusing only on the mesh geometry; I was dreaming of something that would include the whole enchilada (materials, textures, physics properties, modifiers). but I think that with (a lot of) time and creaprim.py as a guide, I could start to write it myself; it might be a really good excuse to get familiar with Blender innards :-) though vulnerability to version changes could be a chronic issue.