2
$\begingroup$

I've written some code that creates a clipping region using bpy.ops.view3d.clip_border(..) then to clear the clipping region I call bpy.ops.view3d.clip_border() again (with no values). This clears the region after a viewport re-draw, however, running context.space_data.region_3d.use_clip_planes() will return True and the viewport will still display "Clipped" in brackets in the info text.

Is there a way to completely clear the clipping through code, just like pressing Alt+B would do?

Clipping Border

$\endgroup$

1 Answer 1

2
$\begingroup$

use_clip_planes is not readonly, you can change its value. You can disable the label with context.space_data.region_3d.use_clip_planes = False. It won't update in the viewport until your mouse enters the 2D space or you manually call a redraw : context.space_data.region_3d.tag_redraw()

Link to the docs

$\endgroup$
1
  • 1
    $\begingroup$ Thanks very much for this. It fixed the issue. I can now set context.space_data.region_3d.use_clip_planes each time I clear the clipping region. I hadn't thought to check if it could be set. Cheers $\endgroup$
    – Dan
    Jun 9 at 12:25

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.