Unselectable script

free scripts, plugins, models, textures
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Unselectable script

Post by trueBlue »

clintonman wrote: 04 Oct 2020, 17:24
trueBlue wrote: 04 Oct 2020, 17:18
clintonman wrote: 04 Oct 2020, 16:58
Good point.
Attached is the node I plan to use.
That works too.
I am going to add Space.Unselect() to the Down script
Right, I was going to ask you about that, but forgot. I'll do the same.
Correction
I am going to add Space.Unselect() to the Up script
I would also suggest creating an Enable/Disable button that gives indication of it's present state
Enable ONOff button.png
Enable ONOff button.png (11.65 KiB) Viewed 2553 times
The Close button insures the widget is restored to it's original state

Code: Select all

Node.Value("%THIS_NAME%", "Enable") = 0
Node.ConReset('%THIS_NAME%/Enable', 'Active_Out')
Activity.Run("Scripts/CustomCommands/unSelectable/DeactivateWidgetLocking");
Node.Delete('%THIS_NAME%')
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

unselectableInconsistency.jpg

I got it to work and tested it, but I don't like it. I don't like the checkbox and the on/off button both being available and the lights and cameras don't have the same look as meshes because of the exported connector.

Attached is the final work on this version in case you want it for the unofficial updates. My final version won't have the exported connector.

Also I don't see the unselectable widget as something that is turned off and on on a regular basis. I see it as enable one time and forget it.

If you do make the enable button an on/off button you will need to check whether the widget is active/installed or not each time the panel is opened and you will need to update the widget nodes based on a loaded scene unselectable script state. So if the scene was saved disabled you need to deactivate the widget, and if the scene was saved enabled then you need to activate the widget. Right now there's nothing in the code that really does that. It can be done, just takes some work.
Attachments
UnSelectable UnOfficial Update.RsObj
(181.49 KiB) Downloaded 159 times
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

There is another possibility
Do not export the UnSelectable boolean attribute
Create the UnSelectable attribute as a string
Untested, but you could even create it as hidden
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

trueBlue wrote: 05 Oct 2020, 02:17 There is another possibility
Do not export the UnSelectable boolean attribute
Create the UnSelectable attribute as a string
Untested, but you could even create it as hidden
I don't understand how that would work and isn't removing the export the opposite of what you wanted because of the flattening process?
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

Flattening an object that has an UnSelectable string does not remove the connector
Your plugin does not support it currently.
If your plugin supported the UnSelectable string, as in, if it exist, it would be locked.
Several earlier UnSeletable projects did in fact use the UnSelectable string
I believe you were the first to use a UnSelectable boolean
Seems in theory, both the UnSelectable boolean and string could both work together
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

trueBlue wrote: 05 Oct 2020, 03:38 Flattening an object that has an UnSelectable string does not remove the connector
Your plugin does not support it currently.
If your plugin supported the UnSelectable string, as in, if it exist, it would be locked.
Several earlier UnSeletable projects did in fact use the UnSelectable string
I believe you were the first to use a UnSelectable boolean
Seems in theory, both the UnSelectable boolean and string could both work together
Not seeing/understanding it and not really hearing anything to make me think it's all worth it just to protect the locked state of flattened meshes.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

There is two reasons why this should be supported with your new plugin and UnSelectable scripts.
1.) Flattening objects removes your selectionLocking node
2.) Backwards compatibility...
In the current Unofficial Update(s), your Workspace Layers 3's menuprocessor script has the following:
//copy selection locking node if does not exist
if(!Node.ConExists(thenode,"UnSelectable"))

I totally agree that your new way supporting Lights and Cameras is needed!
I also agree that exporting the UnSelectable attribute from the selectionLocking node is undesirable.

Seems simple really to add support for the above.
Clintons3dPlugin.rsx
Add
if(Node.ConExists(Node.Selection(), "UnSelectable") || Node.Exists(Node.Selection() + "/selectionLocking"))
{
System.Alert("One or the other exist!")
//Replace Alert with code here
}
Note:
I was not able to write/include the needed check for:
&& Node.Selection() + "/selectionLocking","UnSelectable") = true;
Additionally
You could add the selectionLocking node if it does not exist and the UnSelectable attribute exist

Lock script
Add one more line
Node.ConCreate(Node.Selection(), "UnSelectable", "string", 4);

UnLock and UnLockAll script
Add one more line
Node.ConRemove(Node.Selection(),"UnSelectable");
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

Flatten objects - still don't care

Workspace layers 3 - didn't know it's not working since I thought I made the last release compatible
From the last release
"supports old and new style locking - old exported connector, new exported node aspect"

Not sure what this refers to "I was not able to write/include the needed check for:
&& Node.Selection() + "/selectionLocking","UnSelectable") = true;"

Lock and Unlock still adding and removing connections that don't show on lights or cameras. So not sure what that solves.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

One other suggestion
RemoteCommand
Add check for the Selection locked widget
if(!Node.Exists("Widgets/Edit/Default context/Select/Selection locked widget"))
System.Alert("Widget based locking is Disabled")
//Replace Alert with code here
Activity.Run(System.ThisOwner() + "/ActivateWidgetLocking")
{
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Unselectable script

Post by trueBlue »

clintonman wrote: 05 Oct 2020, 15:36 Lock and Unlock still adding and removing connections that don't show on lights or cameras. So not sure what that solves.
if(Node.ConExists(Node.Selection(), "UnSelectable") || !Node.Exists(Node.Selection() + "/selectionLocking"))
{
Activity.Run(Space.CurrentScene() + "/unSelectable/lockIt")
}
Post Reply