# Can I make my own Allow/Deny selection switch?

Let's say I restricted all objects from being selectable from the outliner except for one that I can use to control the state of other object's selectability.

I just need to know can an object's state affect the state of another object's selectability other than using the outliner? And how would I do it?

We can use drivers to control a property from another property. Note that there are some limits, for example, an objects visibility doesn't seem to trigger an update of drivers that use it.

1. Lets start with three objects, a cube a monkey and a torus.
2. Add a custom property to the cube (see below), click edit and rename it select_control then set the value to 1, as we enter a whole number it will prevent decimal numbers being entered.
3. In the outliner, right click on the selectability of Suzanne and choose Add Driver->Single From Target. This will give you an eyedropper cursor, click on the cubes custom property we just created. Note that the value is now highlighted in purple. This applies to 2.78, previous versions you choose Add Driver and then manually edit a driver expression.
4. Repeat for the torus

Now as you alter the value of the cubes property, the selectability of the monkey and the torus also change.

Drivers can be any python expression and can be edited in the graph editor in driver mode.

A custom properties panel can be found in several tabs of the properties editor, for this situation a property attached to an object makes sense, a scene property could also work. Adding a custom property is as simple as clicking the add button, it can be useful to also edit the property to give it a more meaningful name and adjust the limits if you want values larger than 1.0.

• Ah! So that's what those custom properties are for. Thanks for your help. – Eric Huelin Sep 10 '17 at 10:06
• I think step 2 is a little unclear without either screenshots or further steps on how to add a custom property. – Ray Mairlot Sep 10 '17 at 11:04
• @RayMairlot Not sure that showing an add button is helpful, they are available in most property contexts, the only confusing thing would be which location to use, here I expect an object property is relevant, a scene property could also make sense. Adding a link to the manual should help. – sambler Sep 10 '17 at 18:18
• Regardless of the 'add' buton, you don't even mention where a user could expect to find the custom properties. You know custom properties are added in a separate panel in most property contexts, but why should a user who has just come across this question? Linking to the manual helps, but I don't think it takes much to add that the custom property is added via a separate 'Custom Properties' panel in the 'Object' tab of the Properties Editor. – Ray Mairlot Sep 10 '17 at 18:54