Notifications
Clear all

[Closed] How to make an object unselectable??

Hi,

I am trying to make an object unselectable so that the control object (which is a shape) is the first thing that will be selected when you click on it in the viewport.

I realise that the objects can be frozen, the main downfall being that when ‘unfreeze all’ is selected the objects will be selectable again. In terms of usuability it would definitely be a bonus if there was a way make an object unselectable in the viewport.

Thanks for any help.

Spencer

11 Replies

I’ve done something similar where I’ve added user property data that says something like “selectable = false” and with a callback script triggered by selection changes I checked the selected objects for this value and deselected any object with this tag. Seemed to work well for my needs.

great thanks! Ill give that a try.

I cant seem to find a ‘selectable’ command having looked through the help.

I was hoping to write a custom attribute on my object that simply says – selectable:false

Ideally I could accomplish this without the need for a callback purely because with my limited knowledge of callbacks I presume it would be harder to install my script on others machines.

Does anyone else have any knowledge on this subject?

Thanks

Spencer

this may seem like a joke, but i’m seriously starting to think about a custom user interface for animators

this is just one of the reasons.

The selectable tag was one that assigned to the user properties. Sry this is not a max object properties.

Callbacks are a simple thing

Try the attached script to see if it does what you want.

USAGE: Select some objects, push the unselectable button, then press the big button on the bottom to enable the selection mask.

 PEN

One of the simplest ways is to write a selection filter. Usualy you would set it up so that it makes an object selectable if a certain parameter is true, in your case you could do one that makes object selectable if the parameter isn’t there.

What you are looking for is registerSelectFilterCallback.

Hi Blue,

Thanks for your script it seems to work.

So I assume your script triggers a callback? Callbacks only worry me because of the thought of slowing down a machine with it constantly checking the status of things but im sure if there are not too many running at the same time it wouldn’t cause a problem.

I will endeavour to learn more about them and practice with them.

Thanks again Paul for your input. I will looking into that callback function and see how it fits my needs.

One solution that seems apparent would be to use a callback that monitors the unfreezeAll button and then simply refeezes any nodes within a specified array.

Hi Spencer, if i correctly understood your problem, change handlers can help you. Assigning a select handler to the “unselectable” objects that will select the control object instead theoretically will do the job. I´m using “theoretically” cause i never used change handlers, made some tests at the most…

hope it helped and sorry if my english isn´t that clear,
Gustavo

Page 1 / 2