fcurves.find() won't work with drivers #47233

Closed
opened 2016-01-25 02:43:42 +01:00 by Mikhail Rachinskiy · 7 comments

System Information
Windows 8.1 x64
Renderer: GeForce GTX 860M/PCIe/SSE2

Blender Version
Broken: 2.76.8 017c45b

Short description of error
This patch D1427 added fcurves.find() method which works with fcurves fcurves, but does not with driver fcurves.

This code will output fcurve:
bpy.data.objects["Cube"].data.shape_keys.animation_data.action.fcurves.find('eval_time')

But this wont:
bpy.data.objects["Cube.001"].data.shape_keys.animation_data.drivers.find('eval_time')

So I have to write this every time I want to get driver fcurve:

fcus = ob.data.shape_keys.animation_data.drivers
    for fcu in fcus:
        if fcu.data_path == 'eval_time':
            # code...

Exact steps for others to reproduce the error

  • Open blend file fcus.blend
  • Copy and paste code examples in console
**System Information** Windows 8.1 x64 Renderer: GeForce GTX 860M/PCIe/SSE2 **Blender Version** Broken: 2.76.8 017c45b **Short description of error** This patch [D1427](https://archive.blender.org/developer/D1427) added `fcurves.find()` method which works with fcurves fcurves, but does not with driver fcurves. This code will output fcurve: ```bpy.data.objects["Cube"].data.shape_keys.animation_data.action.fcurves.find('eval_time')``` But this wont: ```bpy.data.objects["Cube.001"].data.shape_keys.animation_data.drivers.find('eval_time')``` So I have to write this every time I want to get driver fcurve: ``` fcus = ob.data.shape_keys.animation_data.drivers for fcu in fcus: if fcu.data_path == 'eval_time': # code... ``` **Exact steps for others to reproduce the error** - Open blend file [fcus.blend](https://archive.blender.org/developer/F277116/fcus.blend) - Copy and paste code examples in console
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Sybren A. Stüvel was assigned by Mikhail Rachinskiy 2016-01-25 02:43:42 +01:00
Author
Member

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung
Member

I'm guessing that this functionality simply hasn't been implemented for the driver FCurve list (which is on AnimData not Action), so it's currently falling back to using the Python provided function for general purpose lists.

So, I'll mark this as a todo item instead.

I'm guessing that this functionality simply hasn't been implemented for the driver FCurve list (which is on AnimData not Action), so it's currently falling back to using the Python provided function for general purpose lists. So, I'll mark this as a todo item instead.

This issue was referenced by blender/blender@45fd0847f4

This issue was referenced by blender/blender@45fd0847f459d011cd06e0c3975e463cac39fb19
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

Thank you!

Thank you!
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47233
No description provided.