path_from_id does not work on subproperties of a custom node
Open, Needs TriagePublic

Description

System Information
Windows 10, 64 bit

Blender Version
Broken: 7cb2974

Short description of error
I want to create a subproperty (Pointer/Collection) in my custom node. Inside I want to declare a property with an update function that somehow knows the parent node.
I found that I could use the path_from_id function and do some string manipulation to access the node. Beside that being not a very nice solution, it even does not seem to work.

I also tested registering subproperties in a Scene, there the path_from_id function works properly. In my custom node I get an error message with "found but does not support path creation". I can't really see if this is intended, a bug or just something that is not implemented yet.

Exact steps for others to reproduce the error

Here is a little test script that raises the exception:

import bpy
from bpy.props import *

class MyNodeTree(bpy.types.NodeTree):
    bl_idname = "MyNodeTree"
    bl_label = "My Node Tree"
    bl_icon = "COPY_ID"
    
class MyPropGroup(bpy.types.PropertyGroup):
    prop = BoolProperty()
    
    def test(self):
        print(self.path_from_id("prop"))
    
bpy.utils.register_class(MyPropGroup)
    
class MyNode(bpy.types.Node):
    bl_idname = "MyNode"
    bl_label = "My Node"
    
    prop = BoolProperty()
    subprop = PointerProperty(type = MyPropGroup)
    
    def test(self):
        print(self.path_from_id("prop"))
    
bpy.utils.register_class(MyNodeTree)
bpy.utils.register_class(MyNode)

tree = bpy.data.node_groups.new("Test Tree", "MyNodeTree")
node = tree.nodes.new("MyNode")

node.test()
node.subprop.test()

Details

Type
Bug