Custom Properties for ShaderNodeTree do not save in blend files #82384

Closed
opened 2020-11-03 23:00:09 +01:00 by Jeducious · 15 comments

System Information
system-info.txt

Operating system: MacOS Catalina 10.15.7 (19H2)
Graphics card: Intel Iris Graphics 6100 1536 MB graphics

Blender Version
Broken: 2.91.0, b0f34eee30, master, 2020-10-21
Worked: not sure

Short description of error
The Blender manual describes that Blender can save custom properties to its data blocks (see link). However upon attempting to save a custom property to a ShaderNodeTree type, particularly to the C.scene.world.node_treee, it is clear that the custom property is not saved to the blend file. Other data blocks appear to work just fine.

Exact steps for others to reproduce the error

Create a custom property on the C.scene.world.node_tree or on a material's node_tree;

import bpy
from bpy.props import StringProperty

bpy.types.ShaderNodeTree.uuid= StringProperty(
                    name="Unique Id for hashing",
                    default='')

bpy.context.scene.world.node_tree.uuid = 'hamburgers with cheese' 

  • Save the blend file, close blender
  • Open the file in blender and inspect the bpy.context.scene.world.node_tree to find the custom property and check its value.

The custom property no longer exists. Its not listed in the data block's keys or items so that

bpy.context.scene.world.node_tree['uuid'] raises a key error

The same approach for saving custom properties to other data blocks, like materials or objects, works as expected.

**System Information** [system-info.txt](https://archive.blender.org/developer/F9185902/system-info.txt) Operating system: MacOS Catalina 10.15.7 (19H2) Graphics card: Intel Iris Graphics 6100 1536 MB graphics **Blender Version** Broken: 2.91.0, b0f34eee30c4, master, 2020-10-21 Worked: not sure **Short description of error** The [Blender manual ](https://docs.blender.org/manual/en/latest/files/data_blocks.html#custom-properties) describes that Blender can save custom properties to its data blocks (see link). However upon attempting to save a custom property to a ShaderNodeTree type, particularly to the C.scene.world.node_treee, it is clear that the custom property is not saved to the blend file. Other data blocks appear to work just fine. **Exact steps for others to reproduce the error** # Create a custom property on the C.scene.world.node_tree or on a material's node_tree; ``` import bpy from bpy.props import StringProperty bpy.types.ShaderNodeTree.uuid= StringProperty( name="Unique Id for hashing", default='') bpy.context.scene.world.node_tree.uuid = 'hamburgers with cheese' ``` - Save the blend file, close blender - Open the file in blender and inspect the `bpy.context.scene.world.node_tree` to find the custom property and check its value. # The custom property no longer exists. Its not listed in the data block's keys or items so that ``` bpy.context.scene.world.node_tree['uuid'] raises a key error ``` The same approach for saving custom properties to other data blocks, like materials or objects, works as expected.
Author

Added subscriber: @JamesCrowther

Added subscriber: @JamesCrowther

Added subscriber: @rjg

Added subscriber: @rjg

This comment was removed by @rjg

*This comment was removed by @rjg*

I retract my previous comment, you're following the approach outlined here.

I retract my previous comment, you're following the approach outlined [here](https://docs.blender.org/api/current/bpy.props.html).

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Since ShaderNodeTree is a subclass of ID, this is supposed to work.

Since `ShaderNodeTree` is a subclass of `ID`, this is supposed to work.

This issue was referenced by 331614e09b

This issue was referenced by 331614e09be27335475ae1543f11b3d509c3c20a

Added subscriber: @mont29

Added subscriber: @mont29
Bastien Montagne self-assigned this 2020-11-04 18:15:15 +01:00

Same issue with master collections of scenes actually.

Same issue with master collections of scenes actually.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Author

@mont29 @rjg @lichtwerk Thanks guys :) Really appreciate you guys looking into this. Willing to test this as soon as its in a daily build if that will help.

@mont29 @rjg @lichtwerk Thanks guys :) Really appreciate you guys looking into this. Willing to test this as soon as its in a daily build if that will help.
Author

Weird, just checked this issue and can see its closed, but didn't get an update via e-mail, is that expected? I got the initial one about the issue being created!

Weird, just checked this issue and can see its closed, but didn't get an update via e-mail, is that expected? I got the initial one about the issue being created!

I got the mail... Yours might have ended up in spams? Got closed by the fixing commit.

I got the mail... Yours might have ended up in spams? Got closed by the fixing commit.
Author

In #82384#1062836, @mont29 wrote:
I got the mail... Yours might have ended up in spams? Got closed by the fixing commit.

Yeah maybe :) not sure, I had a look in there, nothing. never mind though, glad it got closed :)

> In #82384#1062836, @mont29 wrote: > I got the mail... Yours might have ended up in spams? Got closed by the fixing commit. Yeah maybe :) not sure, I had a look in there, nothing. never mind though, glad it got closed :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#82384
No description provided.