1
$\begingroup$

When I try to animate a property that is stored in a CollectionProperty attached to a custom node (by hovering it and pressing I), I get the following error message:

Failed to resolve path to property, try manually specifying this using a Keying Set instead

enter image description here

Here's my custom node definition:

class ColorRampItem(bpy.types.PropertyGroup):
    offset = bpy.props.FloatProperty(name='Offset', default=0.0, min=0, max=1)
    value = bpy.props.FloatVectorProperty(name='', min=0, soft_max=1, subtype='COLOR')


class MyCustomNode(Node, MyCustomTreeNode):
    '''A custom node'''
    bl_idname = 'CustomNodeType'
    bl_label = 'Custom Node'

    items = bpy.props.CollectionProperty(type=ColorRampItem)

    def init(self, context):
        # Add two test items
        item_0 = self.items.add()
        item_0.offset = 0
        item_0.value = (0, 0, 0)

        item_1 = self.items.add()
        item_1.offset = 1
        item_1.value = (1, 1, 1)

    def draw_buttons(self, context, layout):
        for item in self.items:
            split = layout.split(align=True, percentage=0.7)
            split.prop(item, 'offset', slider=True)
            split.prop(item, 'value')

Is this an error on my side, or is it a limitation of the custom nodes system?

Here is a Blender scene with the full working code. To reproduce, press "Run Script", switch the node editor type to the custom node tree and add the custom node, then try to press I while hovering one of the controls of the node.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.