← All ideas
  • Published 11 Feb 2020

Allow Selecting of Hidden Objects

Recently I've been getting into using Boolean object modifiers, but it can be very hard to line up some objects when you're seeing something other than the final object, so I would like to be able to select hidden objects so I can manipulate them while only seeing the final product.

100%

Development Status: Open

Upvote 9 Downvote 0
evweb
11 Feb 2020

8 Comments

i've made a quick script to do what you need. See below.

1

* @3d illusions *

download the script here, open it with the text editor in blender, and then press play. It'll make all hidden objects that are used as boolean do what you wanted:

dropbox.com/s/02z8xb0dtj0jf1s/change%20hidden%20to%20bounds%20and%20unhide.py

1

* @3d illusions * I've just updated it to be a bit better , so re-download if you already downloaded it.

* @3d illusions * {attachment change_hidden_to_bounds_and_unhidepy}

I've just realised something. if you enable the bool tool addon that comes with blender, then it'll do this for you automatically when you do a boolean. ctrl + shift + b and then choose one of the brush boolean options.

evweb Author

* @3d illusions * Oh, very nice.

evweb Author

Thanks for the script. I was able to update it to run continuously, but maybe you'd have a better way to do it: Update Script

For reference:

import bpy

class SelectHiddenBoolObjectsOperator(bpy.types.Operator):
    bl_idname = "wm.select_hidden_bool_objects_operator"
    bl_label = "Select Hidden Bool Objects Operator"

    _timer = None

    def check_hidden(self):
        objects_to_swap_to_bounds_and_unhide = []

        for object in bpy.data.objects:
            try:
                new_object = object.modifiers["Boolean"].object
                hidden = new_object.hide_get(view_layer = None)
                if hidden:
                    objects_to_swap_to_bounds_and_unhide.append(new_object)
            except:
                continue

        for object in objects_to_swap_to_bounds_and_unhide:
            hidden = object.hide_get(view_layer = None)
            object.hide_set(False, view_layer = None)
            object.hide_render = True
            object.display_type = 'BOUNDS'
            object.cycles_visibility.camera = False
            object.cycles_visibility.shadow = False
            object.cycles_visibility.diffuse = False
            object.cycles_visibility.transmission = False
            object.cycles_visibility.glossy = False
            object.cycles_visibility.scatter = False

    def modal(self, context, event):
        if event.type == 'TIMER':
            self.check_hidden()

        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.5, window=context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)
        return {'CANCELLED'}

def register():
    bpy.utils.register_class(SelectHiddenBoolObjectsOperator)

def unregister():
    bpy.utils.unregister_class(SelectHiddenBoolObjectsOperator)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.select_hidden_bool_objects_operator()
Draise

Yes please.