Sorry @brecht, for tagging you yet again just wanted to raise an issue I found that is contra blender’s documentation. I am working on blender 2.90.1 right now, and testing some new code we’re writing for the Crowdrender addon.
I’ve run into a problem though, we use custom properties to tag data blocks with a unique ID, this allows us to identify and check them across all computers that a user wants to use in network rendering or distributed rendering. It seems to work perfectly fine, apart from shader node trees.
For some reason, they are not being saved to the blend file with regards to the world shader. When I check bpy.types.ShaderNodeTree, I can see that there is a custom property called ‘uuid’ there, which I created in the usual way through the python api by;
from bpy.props import StringProperty type(data).uuid = StringProperty( name="Unique Id for hashing", default='')
Where data is a reference to the data block. I have checked that doing type(data) results in a reference to the same object in memory as the equivalent in bpy.types, so that the following holds:
bpy.types.ShaderNodeTree == type(data)
where the data argument to the type function is indeed a shader node tree.
I’ve verified by hand in the python console that specifying a simple StringProperty called ‘uuid’ and associating it with the bpy.types.Object type works, I can assign a uuid like string to it and this persists in the blend file. Doing the same thing for node trees does not work, and is contra what is in the blender manual for custom properties as described here → Blender manual - Custom Properties
This would prevent us, or anyone else from being able to store custom properties for a shader node tree.
Shall I report this as a bug?