1
$\begingroup$

I have lots of f-curves (~100) cycle modifier applied to and I want to restrict same frame range for all of them simultaneously. how would the simple script looks like to do the action? it's pain to restrict same frame range for all curves manually. thank u guys in advance!

enter image description here

$\endgroup$
0
1
$\begingroup$

here it is working just fine:

import bpy

def mission1(obj):
if obj.animation_data is None or obj.animation_data.action is None:
    return

action = obj.animation_data.action

for fc in action.fcurves:
    print(fc.data_path)
    for mod in fc.modifiers:
        if mod.type == 'CYCLES':
            mod.frame_end = 303           
        mod.use_restricted_range = True

for obj in bpy.context.selected_objects:
mission1(obj)
$\endgroup$
1
  • 1
    $\begingroup$ Nice one. To markup script for bse: select code block and press control - K or click the code button {} Suggest rather than hard-coding 303 pass it as an argument to method. $\endgroup$
    – batFINGER
    Jan 4 '18 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.