Hi all,
I tried to use script to remove particular animation channels of an object.
here are the scripts after setting the
.select of the channels to
True of those channels
area_type_original = bpy.context.area.type
bpy.context.area.type = 'GRAPH_EDITOR'
bpy.ops.anim.channels_delete()
bpy.context.area.type = area_type_original
however, channels are not deleted
Blender returns
False If I replace the line
bpy.ops.anim.channels_delete() to
bpy.ops.anim.channels_delete.poll()
I tried changing the area type to
'DOPESHEET_EDITOR', but this also failed
Would any one please help me with this? what should I do to delete specific animation channels?
System information: Blender 2.63a, Win7 64bit English
Thank you very much.
JNg
I would rather use low-level functions like this:
| Code: |
action = bpy.context.object.animation_data.action
for f in action.fcurves:
# find X Location fcurve
if f.data_path == 'location' and f.array_index == 1:
a.fcurves.remove(f)
break
|
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
sorry, it's Y Location (array_index 0 = X, 1 = Y, 2 = Z / if it's a quaternion then 0-3 = wxyz)
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Hi CoDEmanX,
Thank you very much. It works great! Problem solved.