0
$\begingroup$

Trying to interpolate using bpy.ops.gpencil.interpolate() and bpy.ops.gpencil.interpolate_sequence() which need a context override so I tried this code:

import bpy
from bpy import context

for window in context.window_manager.windows:
    screen = window.screen
    for area in screen.areas:
        if area.type == 'VIEW_3D':
            with context.temp_override(window=window, area=area):
                bpy.ops.gpencil.interpolate_sequence() 
            break

Results in a crash. Maybe it's not possible to do interpolation this way?

$\endgroup$
2
  • $\begingroup$ Hello and welcome. see this link for more information on how to use context properly blender.stackexchange.com/questions/6101/… $\endgroup$
    – Harry McKenzie
    Commented Dec 17, 2022 at 6:33
  • $\begingroup$ Thanks! I couldn't get the override to work, so a workaround is to run the code as an addon, then I don't need to override the context. $\endgroup$
    – ungivenNed
    Commented Dec 21, 2022 at 8:39

0

You must log in to answer this question.