Blender 2.90.1 does not adhere to manual - saving custom props

Hi there :slight_smile:

Sorry @brecht, for tagging you yet again :smiley: 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",

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?

Best Regards


You can report it as a bug.

1 Like

Yay! Ok, will do that man, thanks!

This is now a bug, you can see it at T82384

Thanks @brecht :slight_smile: