Unselectable script

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

Re: Unselectable script

Post by trueBlue »

Not sure how your new plugin based locked code works or what it looks for to make an object unselectable.
If you Flatten an object that has the selectionLocking node, the selectionLocking node is removed but the exported UnSelectable attribute is not removed.
Even though the UnSelectable attribute exist, it is selectable with your plugin.
Is your plugin code looking for the selectionLocking node?
If so, maybe it would be better if it worked like your WebView works.
Edit:
The lock can be removed by either disabling the locking on the internal script or web ui window. For web ui locking, the lock can also be removed by select the locked node and uncheck the "UnSelectable" checkbox in the panel view.
User avatar
clintonman
Captain
Posts: 5430
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: 26 Sep 2020, 14:32 Not sure how your new plugin based locked code works or what it looks for to make an object unselectable.
If you Flatten an object that has the selectionLocking node, the selectionLocking node is removed but the exported UnSelectable attribute is not removed.
Even though the UnSelectable attribute exist, it is selectable with your plugin.
Is your plugin code looking for the selectionLocking node?
If so, maybe it would be better if it worked like your WebView works.
It looks for the node, I'll see what I can do.
Clinton Reese

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

Re: Unselectable script

Post by clintonman »

Made the change. The next version of the plugin will check for the "UnSelectable" connector and read it's value, checked is locked, unchecked is unlocked.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

:bananathumb:
User avatar
clintonman
Captain
Posts: 5430
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

Updated Unselectable Script and a new corresponding rsx plugin has been released.

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

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

Uses a new style of locking. The old way was to export the UnSelectable connector from inside the object. Lights and cameras did not show the exported connector. The new style exports the node aspect, so the locking state for lights and cameras can be seen.
The new scripts are backward compatible with the old style and the new rsx plugin v.1638420 will also work with both new and old styles of locking.

Altered the UI to be more in line with the Unofficial Update version of the script.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

Notice you are no longer exporting the UnSelectable attribute.
As reported, Flattening an object removes the selectionLocking node and it no longer works with your UnSelectable scripts and your Workspace Layers 3
Workspace Layers 3 does export the UnSelectable attribute.
I suspect that your Web UI is not going to work with Checking/Unchecking the missing exported UnSelectable attribute.

Not sure why you would want to keep the Selection Change Event/Undo given the conflict with other Selection Change Event activities. :shock:
Your plugin base option is far superior! :worship:
User avatar
clintonman
Captain
Posts: 5430
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

Thanks for the heads up. I thought the flatten problem was part of the update, I guess I missed it.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

clintonman wrote: 30 Sep 2020, 15:04 Thanks for the heads up. I thought the flatten problem was part of the update, I guess I missed it.
The flatten problem is fixed in your plugin.
Made the change. The next version of the plugin will check for the "UnSelectable" connector and read it's value, checked is locked, unchecked is unlocked.
The problem now is, you are no longer exporting the UnSelectable attribute in the Lock script

Also Workspace Layers 3 does not add a selectionLocking node if the object has an Unselectable attribute. Still works though.
User avatar
clintonman
Captain
Posts: 5430
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Unselectable script

Post by clintonman »

lightLockExported.jpg
lightLockExported.jpg (37.24 KiB) Viewed 2395 times
Stack view: The light is locked and the connector has been exported. Can't tell if it's locked.
Can go to the link editor to the expanded aspect to see the lock and uncheck it.

lightLockNotExported.jpg
lightLockNotExported.jpg (38.55 KiB) Viewed 2395 times
Stack view: The light aspect is exported so can tell if item is locked and can uncheck to unlock it.
If the connector is exported as well then it can be seen but not changed, link editor only way to get to it.

I'm exporting the node aspect instead of exporting the connector so the locking state can be seen on cameras and lights.

Disadvantage is that flattening a locked object loses the lock. The lock was either removed or overridden to select the locked item and flatten it, so it shouldn't be a problem to just lock it again after flattening.
Clinton Reese

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

Re: Unselectable script

Post by trueBlue »

Thank you for the explanation.
There is a solution to support your new way and Locked objects that have been Flattened.
Add a On/Off button with an assigned boolean to the selectionLocking node.
selectionLocking button.png
selectionLocking button.png (10.42 KiB) Viewed 2392 times
Script on Up - Deactivate

Code: Select all

Node.ConRemove("%THIS_OWNER_NAME%", "UnSelectable")
Node.Value("%THIS_NAME%", "UnSelectable") = 0
Node.ExportConnector("%THIS_NAME%", "UnSelectable", "", 1, 1)
Script on Down - Activate

Code: Select all

Node.ConRemove("%THIS_OWNER_NAME%", "UnSelectable")
Node.Value("%THIS_NAME%", "UnSelectable") = -1
Node.ExportConnector("%THIS_NAME%", "UnSelectable", "", 1, 1)
Lock script
Change Node.ConExists to Node.Exists, add Node.ConRemove, and add Node.ExportConnector

Code: Select all

			//copy selection locking node if does not exist
			//if(!Node.ConExists(cursel,"UnSelectable"))
			if(!Node.Exists(cursel +"/selectionLocking"))
			{
				Node.ConRemove(cursel, "UnSelectable")
				newnode = Node.Copy(owner + "/selectionLocking",cursel);
				Node.ExportConnector(newnode, "UnSelectable", "", 1, 1);			
			}
Post Reply