1

First of all, I am a total beginner in terms of Blender API. I have been working with Python and the Blender API for about 3 days now.

I already found out how to hide unwanted objects. Here is my code:

bpy.ops.object.select_pattern(pattern="*Collision")
original_type = bpy.context.area.type
bpy.context.area.type = "VIEW_3D"
bpy.ops.object.hide_view_set(unselected=False)
bpy.context.area.type = original_type

My goal here is to implement a checkbox so that when it's checked it will execute the code above. If it's unchecked it will reverse the code.

Can anybody help me?

Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125
  • You can either write a custom operator or create an extra panel for the checkbox along some callback function, see: https://blender.stackexchange.com/a/57332/31447 – brockmann Mar 20 '19 at 14:54

0 Answers0