When I create a string property for the object type, I can modify that property in the active object. But when I create another string property for the f-curve type, it said it is read-only.

The script:

import bpy
bpy.types.Object.objprop = bpy.props.StringProperty(name = "objString")
bpy.context.object.objprop = "mod_objString"

bpy.types.FCurve.fprop = bpy.props.StringProperty(name = "fString")
bpy.context.object.animation_data.action.fcurves[0].fprop = "mod_fString" # error occured on this line



some testing in the built in python interpreter:

in built in python interpreter

Edit: The blend file (although it is almost empty but just in case):


1 Answer 1


Assigning to Existing Classes

Custom properties can be added to any subclass of an ID, Bone and PoseBone

Neither are bones, so leaving that aside, can see below ID is subclass of Object not FCurve, and as such is the property is not "wired up" as a property on the fcurve.

>>> issubclass(bpy.types.Object, (bpy.types.ID,))

>>> issubclass(bpy.types.FCurve, (bpy.types.ID,))

another test for this would be trying to assign ID properties to an instance. This is how a non default value of a property is stored in blend file.

For example, for an Object type

>>> C.object["foo"] = 1

but not for an FCurve

>>> D.actions['CubeAction'].fcurves[0]

>>> D.actions['CubeAction'].fcurves[0]["foo"] = 1
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: bpy_struct[key] = val: id properties not supported for this type
  • $\begingroup$ thanks, so is there other ways I could store properties in individual fcurves? $\endgroup$
    – covector
    Feb 8, 2020 at 8:53
  • 2
    $\begingroup$ Off top of head could use collection property on action. Give item a datapath and array_index to lookup from FCurve. $\endgroup$
    – batFINGER
    Feb 8, 2020 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .