Preferably not using selection, tried bpy.data.meshes.remove don't works for it

  • $\begingroup$ not a duplicate, simply using bpy.ops.delete will not remove the Curve data, until save and reopen, but my code below will. $\endgroup$
    – zeffii
    Commented Jun 12, 2015 at 16:24
  • $\begingroup$ related: blender.stackexchange.com/questions/27234/… $\endgroup$
    – p2or
    Commented Jun 12, 2015 at 16:31

1 Answer 1


Something like this,

  • First remove the Object that uses the Curve
  • Then remove the Curve data


curves = bpy.data.curves
objects = bpy.data.objects
scene = bpy.context.scene

# remove the object
obj = bpy.data.objects[object_name]
cu = obj.data  # the curve

# remove the associated curve, if you need to and it doesn't have other users. 

You won't be able to remove Curve data if there are remaining Objects associated with that Curve data. cu.users will tell you how many users the Curve has, if that returns 0, the curve data can be removed with no other steps, but if it's more than 0 then other Objects are referencing the curve and you need to clear those references first.


You must log in to answer this question.

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