Random Idea: meta data

Appologies in advance if this has been discussed already. It seems most new ideas for blender are typically not new, but searching, I didn’t find anything similar discussed.

While working on my bools script, I was thinking it would be handy for debugging if I could tag extra information on faces and vertices, that I could get back later after the script finished. (Specifically labeling verts as inside/outside/both). I was thinking about it some more, and surely export scripts could benefit a lot for tagging extra data onto materials for alternate shading systems. My conclusion is that blender would benefit from having the abiulity for python scripts to store arbitrary metadata in any blender object. Metadata would be stored in a heirarchy of dictionaries. For example, for my script, I create a “BooleanResultData” item in the object’s metadata dictionary. In the boolean result data dictionary, I store two items - “inside” and “outside”. There would probably need to be support for storing any base python type, as well as blender objects. (like other verts, etc)
Then, there would be an optional separate script that idenifies it self as a metadata manager stored in .blender/scripts. Somewhere in the bottons window probably, there will be a list of metdata dictionary items for the currently selected object/vertex/texture/world/camera/etc/etc. For each item in the list there is a button for “browse data structure”, and if a handler script exists a “manage” button. At the end of the list would be an add button, to add named metadata, or pick from a list of handled metadata. If the manage button is available, it runs the script to manage metadata with the name. If the “browse data structure” button is clicked, then a generic data browser is opened.
The metdata would be saved in the .blend.

The most useful case of this I can think of is managing advanced texture/shader data export/import. So for implementing, that’s probably the logical starting point. However I’d imagine it should be applied everywhere, just in case it may come in handy.

I’m not saying I plan to code this. I’m just throwing the idea out for feedback.

i know that would be helpful, especially in something like ToxicX, which needs to be able to store extra data about the materials that blender does not support.

Maybe all it would need is a “comment” data area to allow the script to add information, and it could hold a massive amount of data at that.

for mat in Blender.Material.Get():
    if mat.getCol == [0 0 0]:
        mat.comment = "black"

why can’t this be stored in a text file in a human-readable format?

[as in a blender text, there is a reasonable interface to this]

Yes. It is a good idea. It would be also useful for games too.

Well, the issue with human readable stuff is that it’s human readable, which means extra parsing work for a machine to read it. But of course text is probably the simplest to implement. As for not dumping it in a text area, it’s because I was thinking it would be useful to be tied to an object (using the term object to include cameras, textures, etc.). And like I mentioned there would be data handler scripts to assist managing it. So textures for instance could have a GUI to manage more advanced options for later use by an export script. Or an object is generated by a script, the generation parameters can be attached to the object, so they can be altered and the object regenerated. Or for a game, it may make sense to tie extra data to objects. Or maybe an external shader has extra per-vertex data, etc.