Drag Selection Example

This is a quick example I made for some practice in programming. I figured I’m not going to use it but someone else might, so I filled it full of pretty notes, and added a readme in the file. Feel free to use any part of it. I hope someone finds it usefull.

Drag Selection .Blend

http://img54.imageshack.us/img54/3301/dragselectyy1.jpg

Wow, that’s pretty niffty. I think I’ll have to have a good long look at the Python. Anicator might be interested in this for is RTS experiment, if he (she?) is still working on that.

Thanks for sharing :wink:

Very very nice…

Thank you very much for sharing…

:slight_smile:

Yes, very nice and useful! Thank you!
But, to be really useful ( as a template) we need some kind of “interactivity/output” I guess…
Let’s say that you click/select an object and this action set “objectONE” “int” property to “1” or activates an IPO action?!
Can you consider to do it please?
Bye

Nice looking stuff there.
Still, the greatest barrier of all in the drag selection has not be cracked yet, the old “box-that-is-drawn-around-the-selected-area”, someday blender will get there.

I never did think of having just the corner points in, I’m going to have to have a peeksie at the python, good job!

Any object that is selectable has the property select as an int. If the object is selected that property becomes 1, otherwise it is kept at 0. If you want to add a new selectable object, all you need to do is add the property select to any object. The orange rings that appear around selected objects are just logic bricks that use the select property to decide wether the ring should be visible or not. Its extremely easy to create and work with selectable objects, but not so easy to edit the scripts for selecting.

The drag selection part works by getting the centers of all of the objects and finding the ones that are inside the box. The click selection works by finding what object the mouse hit when you click. The readme in the file has all of the control information, please feel free to post any questions you may have.

I’ll upload it on Polorix. Files are lost on Savefile after a while.
Edit: http://uploader.polorix.net//files/1586/DragSelectFinal.blend

that’s nice !! , thanks gomer .

Why not? All you’d really need is a clear plane, a border and some scale alterations. If the plane is equal to one blender unit, you could use most of the maths in Gomer’s file.

If you really wanted to, you could even alter the vertices. I’m not going to make a demonstration file 'cause I gotta get going but the idea is easy enough, isn’t it?

I guess you could also use the new shape keys actuator now.

Lol, now Polorix is closed!
(Everything can always get broken :()

Hi
very nice
it could be used for strategy games

Well, FYI blends under 1mb can be upload on the forum, and for blends above 1mb use nickadimos’s blender file forge, cmon guys a whole file hosting site for blender.