Widget based rectangle selection

free scripts, plugins, models, textures
Post Reply
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Widget based rectangle selection

Post by clintonman »

This script/plugin does ray tracing through a rectangle "drawn" in the3d view window. The advantage it has over the older point edit based object selection scripts is that it doesn't start a pe mode to get the selection and it respects the locking of items.
The disadvantage is that the rectangle can't be seen while making the selection. To select small items in a large rectangle takes more rays which takes longer to perform. If there is not enough rays the small items can be missed.

http://clintons3d.com/plugins/truespace ... idget.html

requires the latest Clintons3dPlugin.rsx v.1638419
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Widget based rectangle selection

Post by clintonman »

Update: I realized I forgot to make the button unique. Made that change and updated the icon as well.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Widget based rectangle selection

Post by trueBlue »

Been testing this again.
If I rectangle select as shown, the small cube does not get selected.
RectangleSelect.png
RectangleSelect.png (46.21 KiB) Viewed 2518 times
But if I brush over the objects as shown, the small cube does get selected.
BrushSelect.png
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Widget based rectangle selection

Post by clintonman »

RectangleSelectRayTraced.jpg
RectangleSelectRayTraced.jpg (33.32 KiB) Viewed 2516 times
This is likely what is happening. The rectangle select sends out rays shown in blue and yellow for the 2 different selections. The small cube is not seen by the large selection because it is not under the ray in blue. The smaller selection ends on the small cube so it gets selected. The actual rectangle select sends out more than 5x5 but still things can be missed if they're small enough to fit in between the rays.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Widget based rectangle selection

Post by trueBlue »

Thank you for the explanation
Suggestion:
Exchange the command to:

Code: Select all

//Widgets.ReplaceWidget('{5C9008D4-B6B3-4359-9E63-18D2FC228A6E}','/Widgets/Tools/Rect select widget','Default','','')
Widgets.ActivateViewToolWidget('/Widgets/Tools/Rect select widget','Default');
Add
Close Widget Command
Close widget.png
That way you can continue using the rectangle select widget until you RMB click in 3D Space :mrgreen:
User avatar
trueBlue
Captain
Posts: 5206
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Widget based rectangle selection

Post by trueBlue »

LOL, I got your Invisible Rectangle Select Widget to work. :mrgreen:
Well sort of. ;)
Add your Rectangle Select Widget to the Rect zoom/Rect select node
RectSelectZoom.png
Edit: Almost perfect (Undo the Zoom) by adding two RsApp.Undo() lines to the data script

Code: Select all

RsApp.Undo()
RsApp.Undo()
	//System.Trace(sel)
	Space.Select(sel);
Comparing your Rectangle Select Widget with the Rectangle Zoom...
Your Rectangle Select Widget has an Enable check box that gets Checked/Unchecked in use.
The Rectangle Zoom has an Active checkbox that does not seem to get Checked/Unchecked in use.
Both are hooked up to the Render rect's Visible attribute
This may be why your Render rect does not work.
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Widget based rectangle selection

Post by clintonman »

Update September 6 2021

Uses new visible rectangle and keep active behavior both supplied by trueBlue

new rsx plugin version 1638430 required

Rewritten to handle selections inside the plugin code and enable standard trueSpace Ctrl and Shift modifiers to add and subtract from the selection.
New frustum bounding box selection mode that works with small items that may be missed using the ray tracing method. Also enables the ability to select through to objects hidden behind other objects.
I have a note that 2D encapulated objects don't work with the ray tracing mode, but they do work with the new frustum mode of operation.

The bounding boxes of objects can be visualized using the Unofficial update cage widgets. The bounding box not the geometry is used for the frustum based selection.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Widget based rectangle selection

Post by clintonman »

Fixed a bug in the script caused by empty selection.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Widget based rectangle selection

Post by clintonman »

Sept 8
Fixed a bug causing all invisible items in the scene to become visible.
Clinton Reese

http://clintons3d.com
Post Reply