Expansion of structure of blender data base
Created by: Durman
Problem statement
As far as I know there are two ways to adding custom values to Blender objects. First is similar to working with Python dictionary. Second is creating attributes of object by assign to them a Blender property.
D.objects['Cube']['my_var'] = 1
bpy.types.Object.my_var = bpy.props.IntigerProperty()
D.objects['Cube'].my_var = 1
Viewer BMesh looks like using first way. While I worked with material node I found second way more useful because it allows to keep link to other objects like ths:
bpy.types.Object.my_mat = bpy.props.PointerProperty(name='my_mat', type=bpy.types.Material)
mat = D.materials['Material']
D.objects['Cube'].my_mat = mat
So I created quite complicated data structure and according this I have two questions:
Data stored in Material internal type of data of Blender:
Material - (type=ID)
└ sv_props - (type=Group)
├ sv_created - (type=Bool)
└ children_branch - (type=Collection)
├ nodes_data - (type=Collection)
│ └ required_number - (type=Int)
└ children - (type=Collection)
└ mat - (type=ID)
- Why Sverchok does not use second way more wide. Is it because this way have less stability or there was no use in using such way before?
- And If I'm going to develop this approach further where should I store the code of such data structure?