PDA

View Full Version : How to make an object unselectable??


Snape
09-20-2006, 09:15 AM
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

Blue
09-20-2006, 05:16 PM
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.

Snape
09-20-2006, 05:54 PM
great thanks! Ill give that a try.

Snape
09-20-2006, 06:59 PM
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

Aearon
09-20-2006, 07:52 PM
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.

Blue
09-20-2006, 10:57 PM
The selectable tag was one that assigned to the user properties. Sry this is not a max object properties.

Blue
09-20-2006, 11:32 PM
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
09-21-2006, 12:56 AM
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.

Snape
09-21-2006, 09:46 AM
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.

Guga001
09-21-2006, 12:22 PM
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

Snape
09-22-2006, 09:47 AM
That sounds like a good solution. I will look into that. Thanks Guga!

Snape
09-25-2006, 11:45 AM
Does anyone know if you can use change handlers within a custom attribute?

Ive tried but it doesnt seem to like it.

Thanks

Spencer

CGTalk Moderation
09-25-2006, 11:45 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.