Page MenuHome

Can assign bpy.props to spline data type (bpy.Types.Spline)
Closed, ArchivedPublic

Description

System Information
Operating system: Windows-10 64 Bits
Graphics card: GeForce GTX 660 4.5.0 NVIDIA 416.94

Blender Version
Broken: version: 2.81 (sub 2), branch: master, commit date: 2019-08-18 20:41, hash: rB10001d909905, it dosent work in 2.8 too.
Worked: ?

Short description of error
Adding custom property to bpy.types.Spline will give error when writing value to it.

import bpy
bpy.types.Spline.test = bpy.props.StringProperty(name="Dosent work", default="aa")
bpy.types.Object.test = bpy.props.StringProperty(name="Works", default="aa")


obj = bpy.context.active_object

print(obj.test)  #works
obj.test = '123' #works

print(obj.data.splines[0].test) #it should be string but gives  <built-in function ...
obj.data.splines[0].test = '123' #error

Exact steps for others to reproduce the error
Open blend file and run script:


Using 'test' property on spline will fail.

Event Timeline

Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Aug 20 2019, 7:22 PM
Bastien Montagne (mont29) claimed this task.

that’s not a bug, not all RNA types can have customprops. Only IDs, and a few others (like posebones) can have them. thanks for the report anyway.