Unselectable script
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Unselectable script
Update to the "unselectable" script used to lock object selections. The new version uses the web ui plugin to deselected locked items when they are selected. The big change is that it locks link editor selections where the old version only locked 3d view selections and it requires the web ui plugin/script to be installed. Still not ideal since it deselects instead of preventing selection in the first place. It's the best that can be done without source code access.
http://clintons3d.com/plugins/truespace ... selectable
Related and required is an update to the web scene view, which processes the selection change events. Locking has been added the the browser based scene view.
http://clintons3d.com/plugins/truespace ... webui.html
Related as well is the workspace layers. Changed to use the new locking and some fixes like camera and spotlights could not be hidden. It also allows items to be hidden and locked at the same time. This requires the web ui plugins/scripts for locking items.
http://clintons3d.com/plugins/truespace ... ayers.html
http://clintons3d.com/plugins/truespace ... selectable
Related and required is an update to the web scene view, which processes the selection change events. Locking has been added the the browser based scene view.
http://clintons3d.com/plugins/truespace ... webui.html
Related as well is the workspace layers. Changed to use the new locking and some fixes like camera and spotlights could not be hidden. It also allows items to be hidden and locked at the same time. This requires the web ui plugins/scripts for locking items.
http://clintons3d.com/plugins/truespace ... ayers.html
-
Draise
- Captain
- Posts: 3200
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
Re: Unselectable script
I still haven't managed to get the Webui system going yet. I'll have to give it another try once I'm done delivering and going into a lull for the end of the year.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update June 2020
when unlocking the lock data node is removed
installer clears the recent files list before saving tS state
when unlocking the lock data node is removed
installer clears the recent files list before saving tS state
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update July 2020
reintroduced script based locking based on trueBlue "undo" technique
script based locking works by undo if it finds a locked node in the selection. if you select a several items at once and one is locked the entire selection will revert to it's previous state via undo action. plugin based locking will keep the selection for items that are not locked
if the web server panel is open the internal script based locking will be disabled.
reintroduced script based locking based on trueBlue "undo" technique
script based locking works by undo if it finds a locked node in the selection. if you select a several items at once and one is locked the entire selection will revert to it's previous state via undo action. plugin based locking will keep the selection for items that are not locked
if the web server panel is open the internal script based locking will be disabled.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Have you noticed that if you select an object that has the UnSelectable attribute twice or more, there can be two Object Navigation Widgets?
Even if the other object that has the additional Object Navigation Widget has an UnSelectable attribute!
In the UnDo script, I added:
This also fixes an issue with the Active attribute unchecking.
IE: If an object that has the UnSelectable attribute is selected before Activating the Undo script
Also with the unlockAll script, I added:
You may also want to reconsider having the scripts located in CustomCommands, where a user could leave it Active!
IMO... It would be safer if it was loaded into a scene!
With an option to have the panel auto load when the scene loads.
Even if the other object that has the additional Object Navigation Widget has an UnSelectable attribute!
In the UnDo script, I added:
Code: Select all
RsApp.Undo();
MeshModifiers.ActivateSelectionTool() //<----
break;IE: If an object that has the UnSelectable attribute is selected before Activating the Undo script
Also with the unlockAll script, I added:
Code: Select all
function Execute(params)
{
scene = Space.CurrentScene();
Node.Value(System.ThisOwner(), "Active") = 0 //<----
//recursively search scene and set unlock selection
ExploreNode(scene);
}IMO... It would be safer if it was loaded into a scene!
With an option to have the panel auto load when the scene loads.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Added inactive to unlock all.trueBlue wrote: 18 Jul 2020, 13:30 Have you noticed that if you select an object that has the UnSelectable attribute twice or more, there can be two Object Navigation Widgets?
Even if the other object that has the additional Object Navigation Widget has an UnSelectable attribute!
In the UnDo script, I added:Also with the unlockAll script, I added:Code: Select all
RsApp.Undo(); MeshModifiers.ActivateSelectionTool() //<---- break;Code: Select all
function Execute(params) { scene = Space.CurrentScene(); Node.Value(System.ThisOwner(), "Active") = 0 //<---- //recursively search scene and set unlock selection ExploreNode(scene); }
No idea what you're talking about with the 2 object nav widgets. How do you make it happen?
tried it with lockig active and inactive
1. add unselectable attribute
2. select the object twice or more
nothing
1. add multiple unselectable attributes
2. select the object twice or more
nothing
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Yeah I can not seem to replicate that issue that I saw this morning.
But it did happen.
Did you notice the other issue:
But it did happen.
Did you notice the other issue:
This also fixes an issue with the Active attribute unchecking.
IE: If an object that has the UnSelectable attribute is selected before Activating the Undo script
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Okay try this:
Select an object that has an UnSelectable attribute
Activate the UnDo script
Rectangle select multiple objects in the LE
Results:
The Undo Active checkbox unchecks.
Select an object that has an UnSelectable attribute
Activate the UnDo script
Rectangle select multiple objects in the LE
Results:
The Undo Active checkbox unchecks.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Mis-posted before.
Meant to say Added inactive to unlock, not "Added inactive to unlock all."
Why is it needed for unlock all?
"You may also want to reconsider having the scripts located in CustomCommands, where a user could leave it Active!"
Not gonna recode the rsx plugin for the web server to look in the scene. It takes much more work to make rsx changes and I'm just not willing to put in the time.
Meant to say Added inactive to unlock, not "Added inactive to unlock all."
Why is it needed for unlock all?
"You may also want to reconsider having the scripts located in CustomCommands, where a user could leave it Active!"
Not gonna recode the rsx plugin for the web server to look in the scene. It takes much more work to make rsx changes and I'm just not willing to put in the time.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Ok, I'm confusing myself. Here are the untested changes I've made.
Unlock All
Undo
LockIt
Unlock All
Code: Select all
Node.Value(System.ThisOwner(), "Active") = false;
Undo
Code: Select all
if (Node.ConExists(sel, "UnSelectable") && Node.Value(sel, "UnSelectable")) {
RsApp.Undo();
//below needed for case:
// 1. selected object is locked and unselectable is inactive then
// 2. unselectable is activated and the same object is selected - no real selection change so will undo the activation
Node.Value(System.ThisOwner(), "Active") = true;
break;
}Code: Select all
var validSelection = false;
if(num < 1) return;
for(i=0;i<num;i++)
{
cursel = Node.SelectionGetAt(sel,i);
System.Trace(cursel);
//valid scene object
if(Node.ConExists(cursel,"WldMatrix"))
{
//copy selection locking node if does not exist
if(!Node.ConExists(cursel,"UnSelectable"))
{
newnode = Node.Copy(owner + "/selectionLocking",cursel);
Node.ExportConnector(newnode, "UnSelectable", "", 1, 1);
}
Node.Value(cursel,"UnSelectable") = true;
validSelection = true;
}
}
if(validSelection)
Space.Unselect();
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Just makes sense that you uncheck Active if all of the scene objects do not have the attribute.clintonman wrote: 18 Jul 2020, 14:52 Mis-posted before.
Meant to say Added inactive to unlock, not "Added inactive to unlock all."
Why is it needed for unlock all?
"You may also want to reconsider having the scripts located in CustomCommands, where a user could leave it Active!"
Not gonna recode the rsx plugin for the web server to look in the scene. It takes much more work to make rsx changes and I'm just not willing to put in the time.
And for safety purposes too!
I am not sure what effect it would have with your plugin.
I am only referring to running it with your toolbar icon.
IE: Separately from the Workspace Layers
For an example try this:
viewtopic.php?t=5536
It has been updated with your code and with my modifications
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
I tested my changes mentioned above and they fix this problem.trueBlue wrote: 18 Jul 2020, 14:50 Okay try this:
Select an object that has an UnSelectable attribute
Activate the UnDo script
Rectangle select multiple objects in the LE
Results:
The Undo Active checkbox unchecks.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Like I said before I was getting confused, by making changes and at the same time adding your changes.trueBlue wrote: 18 Jul 2020, 15:01Just makes sense that you uncheck Active if all of the scene objects do not have the attribute.clintonman wrote: 18 Jul 2020, 14:52 Mis-posted before.
Meant to say Added inactive to unlock, not "Added inactive to unlock all."
Why is it needed for unlock all?
"You may also want to reconsider having the scripts located in CustomCommands, where a user could leave it Active!"
Not gonna recode the rsx plugin for the web server to look in the scene. It takes much more work to make rsx changes and I'm just not willing to put in the time.
And for safety purposes too!
I am not sure what effect it would have with your plugin.
I am only referring to running it with your toolbar icon.
IE: Separately from the Workspace Layers
For an example try this:
viewtopic.php?t=5536
It has been updated with your code and with my modifications
The effect it would have on the plugin would be to break... wait a minute... hmm, maybe it will work...
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Gotta leave now. Here's what I have so far.
It uses a different method for the popup that doesn't use timers.
untested
-
It uses a different method for the popup that doesn't use timers.
untested
-
- Attachments
-
- unSelectabled559.RsObj
- (49.89 KiB) Downloaded 204 times
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Seems to work.
Personally I would like the UI to be as small as possible Save the unSelectable,RsObj in the scene somewhere around the top or left
Save the selectionLocking.RsObj location too
Add
Node.Delete(Space.CurrentScene() + "/unSelectable,1")
Node.Delete(Space.CurrentScene() + "/unSelectable, 1")
In the RemoteCommand script
Create a button that will Close / Open the panel
Toolbar icon
LMB = Node.Copy("Scripts/CustomCommands/unSelectable", Space.CurrentScene());
RMB = UserInterface.OpenToolPanelViewEx2("" , "" ,"/Scripts/CustomCommands/unSelectable", 4, 1, 0);
Personally I would like the UI to be as small as possible Save the unSelectable,RsObj in the scene somewhere around the top or left
Save the selectionLocking.RsObj location too
Add
Node.Delete(Space.CurrentScene() + "/unSelectable,1")
Node.Delete(Space.CurrentScene() + "/unSelectable, 1")
In the RemoteCommand script
Create a button that will Close / Open the panel
Toolbar icon
LMB = Node.Copy("Scripts/CustomCommands/unSelectable", Space.CurrentScene());
RMB = UserInterface.OpenToolPanelViewEx2("" , "" ,"/Scripts/CustomCommands/unSelectable", 4, 1, 0);
- Attachments
-
- unSelectablee866.RsObj
- (49.26 KiB) Downloaded 214 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
July 23 2020 Update
script loaded into the scene
automatic floating panel when loading
various trueBlue fixes previously discussed
LMB - copy script and open window or just open window if script is already in the scene
RMB - opens window in the side panel if the script is already in the scene
http://clintons3d.com/plugins/truespace ... selectable
script loaded into the scene
automatic floating panel when loading
various trueBlue fixes previously discussed
LMB - copy script and open window or just open window if script is already in the scene
RMB - opens window in the side panel if the script is already in the scene
http://clintons3d.com/plugins/truespace ... selectable
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update Sept 21:
Unselectable script has the option of using a new widget based locking mechanism.
This should be an improvement over the undo command used internally and doesn't need an extra process to be running like the web ui window option. There is no undo or deselecting so it should work well with all processes and scripts.
http://clintons3d.com/plugins/truespace ... table.html
To use the new locking requires update to the Clintons3dPlugin file. Overwriting the file with the new version doesn't work because the xml file associated with the plugin won't update to indicate the new version was loaded.
Uninstall the old rsx plugin, restart truespace then install the new version.
The script checks the version of the installed plugin by reading the xml file, if it's not new enough then the new widget won't be used.
If you reset to default context then the widget would need to be re-enabled.
Unselectable script has the option of using a new widget based locking mechanism.
This should be an improvement over the undo command used internally and doesn't need an extra process to be running like the web ui window option. There is no undo or deselecting so it should work well with all processes and scripts.
http://clintons3d.com/plugins/truespace ... table.html
To use the new locking requires update to the Clintons3dPlugin file. Overwriting the file with the new version doesn't work because the xml file associated with the plugin won't update to indicate the new version was loaded.
Uninstall the old rsx plugin, restart truespace then install the new version.
The script checks the version of the installed plugin by reading the xml file, if it's not new enough then the new widget won't be used.
If you reset to default context then the widget would need to be re-enabled.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Widget Based Locking is not working for me when selecting an unSelectable object in the Link Editor
Seems to work in 3D only
Seems to work in 3D only
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Right, widgets only work in the 3D view. It works great for me since the 3D view is the only place I want to lock things. If you want to lock LE items I think the widget is compatible with the internal unselectable scripts.trueBlue wrote: 22 Sep 2020, 18:33 Widget Based Locking is not working for me when selecting an unSelectable object in the Link Editor
Seems to work in 3D only
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
I have been stumped a couple of times yesterday and today using, as you call, "Widget Base Locking"
It is not clear that you need to Lock the objects first using the Default aspect!
Suggest you give a better explanation on how to use this.
Maybe a better name like, "Update Select Widget" or something?
And add the Lock, UnLock, and UnLock All buttons to the Widget aspect?
Would it be possible to add code to your plugin, to check that the UnSelectable script exist in the scene and if it does not stop execution?
Widget Base Locking seems to suggest that you are using the widget to Lock objects, which is what I was trying to do.
It is not clear that you need to Lock the objects first using the Default aspect!
Suggest you give a better explanation on how to use this.
Maybe a better name like, "Update Select Widget" or something?
And add the Lock, UnLock, and UnLock All buttons to the Widget aspect?
Would it be possible to add code to your plugin, to check that the UnSelectable script exist in the scene and if it does not stop execution?
Widget Base Locking seems to suggest that you are using the widget to Lock objects, which is what I was trying to do.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Can you rephrase that?trueBlue wrote: 23 Sep 2020, 18:24 ...
Would it be possible to add code to your plugin, to check that the UnSelectable script exist in the scene and if it does not stop execution?
...
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Code: Select all
if(!Node.Exists(Space.CurrentScene() + "/unSelectable")) {
return;
}
Meaning, if possible, your Selection locked widget only works if your plugin and the unSelectable script exist.
Been testing your Selection locked widget with other scripts and activities, and it seems to work great.
Can not think of any reason not to remove the Selection Change Event/Undo portion.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
No, I don't see how that could be possible. The widget based on the plugin would have to look at itself to see if the plugin it's based on is installed. circular so it's a no go.trueBlue wrote: 23 Sep 2020, 20:55What I was thinking , that maybe your modifications to the Select widget could be permanent.Code: Select all
if(!Node.Exists(Space.CurrentScene() + "/unSelectable")) { return; }
Meaning, if possible, your Selection locked widget only works if your plugin and the unSelectable script exist.
Been testing your Selection locked widget with other scripts and activities, and it seems to work great.
Can not think of any reason not to remove the Selection Change Event/Undo portion.
UnSelectable.png
Agreed, no reason to remove the Undo style unselect.
I've noted your earlier suggestions and I think I'll also change the toolbar button to also lock the selected item(s) instead of just opening the panel.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
The RSXcheck is not working
If it is Uninstalled, no Alerts and does not update the Select widget portion
Incorporated your new UnSelectable scripts (Update Select Widget portion only) into Workspace Layers 3 and removed the Selection Change Event/Undo.
Seems to be working!
If it is Uninstalled, no Alerts and does not update the Select widget portion
Incorporated your new UnSelectable scripts (Update Select Widget portion only) into Workspace Layers 3 and removed the Selection Change Event/Undo.
Seems to be working!
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Did you see this part?trueBlue wrote: 24 Sep 2020, 18:42 The RSXcheck is not working
...
"To use the new locking requires update to the Clintons3dPlugin file. Overwriting the file with the new version doesn't work because the xml file associated with the plugin won't update to indicate the new version was loaded.
Uninstall the old rsx plugin, restart truespace then install the new version.
The script checks the version of the installed plugin by reading the xml file, if it's not new enough then the new widget won't be used."
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
I did read it.
So why does the Alert not work?
System.Alert("Clintons3D plugin v.1638419 or higher is required. Widget locking is disabled until the plugin is updated.");
So why does the Alert not work?
System.Alert("Clintons3D plugin v.1638419 or higher is required. Widget locking is disabled until the plugin is updated.");
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
OK, I see, you uninstalled the plugin.
add an alert before the final return false in the RSXcheck function
RSXcheck is working, just not giving an error message.
add an alert before the final return false in the RSXcheck function
RSXcheck is working, just not giving an error message.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
That works, thanks!
Wonder why the Alert did not work?
Could it be because of the v in the xml file
VERSION="v.1638419"
Wonder why the Alert did not work?
Could it be because of the v in the xml file
VERSION="v.1638419"
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
It looks for the plugin in the xml file.
If it finds it it checks that it is loaded, if not error message.
Then it checks the version number is high enough, if not then error message
if it doesn't find it at all then it gives the new/missing error message.
The purpose of RSXcheck is to make sure everything is good with the plugin, the error messages are just a bonus, so to speak.
Important thing is if the rsx file doesn't have the unselectable code then the widget would break and make it impossible to select anything in the 3d view. The combination of RSXcheck and the emergency restore is there to prevent any unforeseeable "permanent" damage.
If it finds it it checks that it is loaded, if not error message.
Then it checks the version number is high enough, if not then error message
if it doesn't find it at all then it gives the new/missing error message.
The purpose of RSXcheck is to make sure everything is good with the plugin, the error messages are just a bonus, so to speak.
Important thing is if the rsx file doesn't have the unselectable code then the widget would break and make it impossible to select anything in the 3d view. The combination of RSXcheck and the emergency restore is there to prevent any unforeseeable "permanent" damage.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
I was not testing the version part correctly.
It does work as expected.
Thanks!
It does work as expected.
Thanks!
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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:
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.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
It looks for the node, I'll see what I can do.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.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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.
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.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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.
Your plugin base option is far superior!
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.
Your plugin base option is far superior!
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Thanks for the heads up. I thought the flatten problem was part of the update, I guess I missed it.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
The flatten problem is fixed in your plugin.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 problem now is, you are no longer exporting the UnSelectable attribute in the Lock scriptMade 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.
Also Workspace Layers 3 does not add a selectionLocking node if the object has an Unselectable attribute. Still works though.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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.
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.
Can go to the link editor to the expanded aspect to see the lock and uncheck it.
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.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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. Script on Up - Deactivate
Script on Down - Activate
Lock script
Change Node.ConExists to Node.Exists, add Node.ConRemove, and add Node.ExportConnector
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. 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)Code: Select all
Node.ConRemove("%THIS_OWNER_NAME%", "UnSelectable")
Node.Value("%THIS_NAME%", "UnSelectable") = -1
Node.ExportConnector("%THIS_NAME%", "UnSelectable", "", 1, 1)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);
}-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Not perfect, but it works.
After flattening only the connector remains, so the exported panel disappears.
I had to swap the up and down scripts to get it to work. Removed the checkbox because the button takes care of it. Changed up text is "Unlocked" and down text is "Locked".
After flattening only the connector remains, so the exported panel disappears.
I had to swap the up and down scripts to get it to work. Removed the checkbox because the button takes care of it. Changed up text is "Unlocked" and down text is "Locked".
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Remove the checkbox?
I think your plugin honors the checkbox, checked or unchecked.
The default state of the selectionLocking node in your UnSelectable scripts is Unlocked
I think your plugin honors the checkbox, checked or unchecked.
The default state of the selectionLocking node in your UnSelectable scripts is Unlocked
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
But the checkbox doesn't honor the code in the button, so button replaces it.
Edit:
Maybe your button isn't connected to the UnSelectable value? Mine is linked to it.
Edit:
Maybe your button isn't connected to the UnSelectable value? Mine is linked to it.
Last edited by clintonman on 04 Oct 2020, 16:27, edited 1 time in total.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Yep, already fixed here.trueBlue wrote: 04 Oct 2020, 16:15 ...
The default state of the selectionLocking node in your UnSelectable scripts is Unlocked
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Correct, it is not linked to the UnSelectable attribute and is assigned to a new boolean, UnLock_Lock.clintonman wrote: 04 Oct 2020, 16:22 But the checkbox doesn't honor the code in the button, so button replaces it.
Edit:
Maybe your button isn't connected to the UnSelectable value? Mine is linked to it.
I changed the text to Up = UnLock and Down = Lock
This matches the UI, Lock and Unlock
For backwards compatibility, it might be necessary to delete the unSelectable node in the scene, in order to replace it in an existing scene
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Good point.trueBlue wrote: 04 Oct 2020, 16:40 ...
For backwards compatibility, it might be necessary to delete the unSelectable node in the scene, in order to replace it in an existing scene
Attached is the node I plan to use.
- Attachments
-
- selectionLocking.RsObj
- (8.59 KiB) Downloaded 201 times
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Untested check for and remove old version:
Added to the Lockit and the RMB scripts.
Added to the Lockit and the RMB scripts.
Code: Select all
//check for old version and remove it
if(Node.Exists(Space.CurrentScene() + "/unSelectable") && !Node.ConExists(Space.CurrentScene() + "/unSelectable", "Source")) {
Node.Delete(Space.CurrentScene() + "/unSelectable");
}-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
That works too.clintonman wrote: 04 Oct 2020, 16:58Good point.trueBlue wrote: 04 Oct 2020, 16:40 ...
For backwards compatibility, it might be necessary to delete the unSelectable node in the scene, in order to replace it in an existing scene
Attached is the node I plan to use.
I am going to add Space.Unselect() to the Down script
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
I'll wait for your official update and add it to the unofficial updates.clintonman wrote: 04 Oct 2020, 17:14 Untested check for and remove old version:
Added to the Lockit and the RMB scripts.
Code: Select all
//check for old version and remove it if(Node.Exists(Space.CurrentScene() + "/unSelectable") && !Node.ConExists(Space.CurrentScene() + "/unSelectable", "Source")) { Node.Delete(Space.CurrentScene() + "/unSelectable"); }
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Right, I was going to ask you about that, but forgot. I'll do the same.trueBlue wrote: 04 Oct 2020, 17:18That works too.clintonman wrote: 04 Oct 2020, 16:58Good point.trueBlue wrote: 04 Oct 2020, 16:40 ...
For backwards compatibility, it might be necessary to delete the unSelectable node in the scene, in order to replace it in an existing scene
Attached is the node I plan to use.
I am going to add Space.Unselect() to the Down script
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Correctionclintonman wrote: 04 Oct 2020, 17:24Right, I was going to ask you about that, but forgot. I'll do the same.trueBlue wrote: 04 Oct 2020, 17:18That works too.clintonman wrote: 04 Oct 2020, 16:58
Good point.
Attached is the node I plan to use.
I am going to add Space.Unselect() to the Down script
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 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%')
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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 199 times
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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
Do not export the UnSelectable boolean attribute
Create the UnSelectable attribute as a string
Untested, but you could even create it as hidden
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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?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
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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
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
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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.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
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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");
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");
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
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.
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.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
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")
{
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")
{
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
if(Node.ConExists(Node.Selection(), "UnSelectable") || !Node.Exists(Node.Selection() + "/selectionLocking"))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.
{
Activity.Run(Space.CurrentScene() + "/unSelectable/lockIt")
}
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Have not tested your new versionclintonman wrote: 05 Oct 2020, 15:36 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"
Seems like another reason to update your plugin to support "old exported connector" which it currently does not.
Backwards compatibility!
Your Workspace Layers has been out since Dec 2011
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
I'll add the similar code found in the lockit script to the RemoteCommand and RMB scripts.trueBlue wrote: 05 Oct 2020, 16:02 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")
{
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
What does that mean in English?trueBlue wrote: 05 Oct 2020, 16:22if(Node.ConExists(Node.Selection(), "UnSelectable") || !Node.Exists(Node.Selection() + "/selectionLocking"))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.
{
Activity.Run(Space.CurrentScene() + "/unSelectable/lockIt")
}
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
I thought it did.trueBlue wrote: 05 Oct 2020, 16:43 ...
Seems like another reason to update your plugin to support "old exported connector" which it currently does not.
...
From the website, "altered lock selection widget to look at the node and the node conn value as well as looking at the exported conn value"
Can you give me some steps so I can fix it?
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Add a 3D Objectclintonman wrote: 05 Oct 2020, 16:56I thought it did.trueBlue wrote: 05 Oct 2020, 16:43 ...
Seems like another reason to update your plugin to support "old exported connector" which it currently does not.
...
From the website, "altered lock selection widget to look at the node and the node conn value as well as looking at the exported conn value"
Can you give me some steps so I can fix it?
Create the UnSelectable string to that 3D object
Node.ConCreate(Node.Selection(), "UnSelectable", "string", 4);
Enable your plugin widget
It is still selectable in the 3D View
Again suggesting you add this to your plugin
if(Node.ConExists(thenode,"UnSelectable"))
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Fix for a Flattened objectclintonman wrote: 05 Oct 2020, 16:54What does that mean in English?trueBlue wrote: 05 Oct 2020, 16:22if(Node.ConExists(Node.Selection(), "UnSelectable") || !Node.Exists(Node.Selection() + "/selectionLocking"))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.
{
Activity.Run(Space.CurrentScene() + "/unSelectable/lockIt")
}
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
So this is to make it compatible with the 2011 version of locking? If so I'm ok with breaking compatibility with something that old.trueBlue wrote: 05 Oct 2020, 17:21Add a 3D Objectclintonman wrote: 05 Oct 2020, 16:56I thought it did.trueBlue wrote: 05 Oct 2020, 16:43 ...
Seems like another reason to update your plugin to support "old exported connector" which it currently does not.
...
From the website, "altered lock selection widget to look at the node and the node conn value as well as looking at the exported conn value"
Can you give me some steps so I can fix it?
Create the UnSelectable string to that 3D object
Node.ConCreate(Node.Selection(), "UnSelectable", "string", 4);
Enable your plugin widget
It is still selectable in the 3D View
Again suggesting you add this to your plugin
if(Node.ConExists(thenode,"UnSelectable"))
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Is there a problem adding this support (in Bold) to your plugin?clintonman wrote: 05 Oct 2020, 17:29So this is to make it compatible with the 2011 version of locking? If so I'm ok with breaking compatibility with something that old.trueBlue wrote: 05 Oct 2020, 17:21Add a 3D Objectclintonman wrote: 05 Oct 2020, 16:56
I thought it did.
From the website, "altered lock selection widget to look at the node and the node conn value as well as looking at the exported conn value"
Can you give me some steps so I can fix it?
Create the UnSelectable string to that 3D object
Node.ConCreate(Node.Selection(), "UnSelectable", "string", 4);
Enable your plugin widget
It is still selectable in the 3D View
Again suggesting you add this to your plugin
if(Node.ConExists(thenode,"UnSelectable"))
if(Node.ConExists(Node.Selection(), "UnSelectable") || Node.Exists(Node.Selection() + "/selectionLocking"))
{
System.Alert("One or the other exist!")
//Replace Alert with code here
}
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Yes there is. making changes to a plugin is a massive pain in the butt. I need a clear explanation of what you're requesting. You said you want compatibility with old code, then give me new never before seen code, so it sounds like you're asking for something new. The code is also given out of context so I don't know where it lives or what it is supposed to accomplish. I need it to be 100% clear before I even think about touching the plugin code.trueBlue wrote: 05 Oct 2020, 17:37Is there a problem adding this support (in Bold) to your plugin?clintonman wrote: 05 Oct 2020, 17:29So this is to make it compatible with the 2011 version of locking? If so I'm ok with breaking compatibility with something that old.trueBlue wrote: 05 Oct 2020, 17:21
Add a 3D Object
Create the UnSelectable string to that 3D object
Node.ConCreate(Node.Selection(), "UnSelectable", "string", 4);
Enable your plugin widget
It is still selectable in the 3D View
Again suggesting you add this to your plugin
if(Node.ConExists(thenode,"UnSelectable"))
if(Node.ConExists(Node.Selection(), "UnSelectable") || Node.Exists(Node.Selection() + "/selectionLocking"))
{
System.Alert("One or the other exist!")
//Replace Alert with code here
}
In English, no code, what exactly do you want the plugin code to do? You may have said so 10 or 20 posts back, don't be afraid to repeat yourself.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Sorry did not realize the problems with making a plugin!
Plain and simple.
I am suggesting that your plugin support any objects that have an UnSelectable attribute, be none selectable for backwards compatibility.
There is two possibilities that can exist with older scenes that have 3D objects, lights, and cameras with Unselectable attributes.
This includes scenes that have your Workspace Layers.
One is a string and the other is a boolean. I have tested both successfully with a script that checks for the UnSelectable attribute and it does not mater if it is a string or boolean.
As said, flattening an object removes your selectionLocking node but does not remove the UnSelectable attribute.
The reason I am suggesting a string, it does not interfere with your new way supporting lights and cameras and being able to check or uncheck.
Plain and simple.
I am suggesting that your plugin support any objects that have an UnSelectable attribute, be none selectable for backwards compatibility.
There is two possibilities that can exist with older scenes that have 3D objects, lights, and cameras with Unselectable attributes.
This includes scenes that have your Workspace Layers.
One is a string and the other is a boolean. I have tested both successfully with a script that checks for the UnSelectable attribute and it does not mater if it is a string or boolean.
As said, flattening an object removes your selectionLocking node but does not remove the UnSelectable attribute.
The reason I am suggesting a string, it does not interfere with your new way supporting lights and cameras and being able to check or uncheck.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
So you're asking for the plugin widget to treat an object that has an UnSelectable string connector/attribute as locked and if no connector exists then it's treated as unlocked?
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
I do not know how your plugin works, but that sounds like what it should do additionally to what it does currently.clintonman wrote: 05 Oct 2020, 19:34 So you're asking for the plugin widget to treat an object that has an UnSelectable string connector/attribute as locked and if no connector exists then it's treated as unlocked?
When I brought this up previously before your last plugin update, I suggested it worked like the Workspace Layers 3 did.
I would be really curious to see, if the UnSelectable string connector was created as "hidden", everything would still work.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Yep, it will be in addition to what the plugin already does. This mod is pretty much for you since I don't expect to be using that part of it.trueBlue wrote: 05 Oct 2020, 22:42I do not know how your plugin works, but that sounds like what it should do additionally to what it does currently.clintonman wrote: 05 Oct 2020, 19:34 So you're asking for the plugin widget to treat an object that has an UnSelectable string connector/attribute as locked and if no connector exists then it's treated as unlocked?
When I brought this up previously before your last plugin update, I suggested it worked like the Workspace Layers 3 did.
I would be really curious to see, if the UnSelectable string connector was created as "hidden", everything would still work.
I think I can have the change in by tonight.
-
trueBlue
- Captain
- Posts: 5548
- Joined: 06 Jul 2009, 22:50
- Type the number ten into the box: 10
Re: Unselectable script
Here is the script I used to test a hidden connector
Code: Select all
//Node.ConCreate(Node.Selection(), "UnSelectable", "string", 1); //1 = hidden 4 = visible
//Node.ConRemove(Node.Selection(), "UnSelectable")
if(Node.ConExists(Node.Selection(), "UnSelectable")) {
System.Alert("Yep")
}-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
OK, change to the plugin is done. New plugin version 1638421. Good luck
You can pick it up here:
http://clintons3d.com/plugins/truespace ... index.html
You can pick it up here:
http://clintons3d.com/plugins/truespace ... index.html
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update October 2020
updated the Unofficial Update backup node to match the new Unofficial Update release
bug: default locking node to a locked state
don't run if object is in point edit mode
will replace the old version of the script in the scene
new unlock button - the shortcuts of "L" and "U" can be assigned to the buttons
updated the Unofficial Update backup node to match the new Unofficial Update release
bug: default locking node to a locked state
don't run if object is in point edit mode
will replace the old version of the script in the scene
new unlock button - the shortcuts of "L" and "U" can be assigned to the buttons
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
I just found a limitation of the locking widget.
If you place a locked object inside an unlocked group it will still be selectable.
I don't see any way around it. The command used in the plugin can see the top object, the group or another command can see the bottom object but then not be aware of the group.
So to lock objects inside of groups activate the "Use old script based locking" checkbox in the notes tab of the panel.
If you place a locked object inside an unlocked group it will still be selectable.
I don't see any way around it. The command used in the plugin can see the top object, the group or another command can see the bottom object but then not be aware of the group.
So to lock objects inside of groups activate the "Use old script based locking" checkbox in the notes tab of the panel.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
I found a solution to the group locking problem and it's working in an unreleased revision of the rsx plugin. I'll update this post when it is released.
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update to the plugin has been released.
Fixes the problem of locked children of groups being selectable.
To select a group that has some items locked you click on one of the unlocked members of the group.
The old plugin worked by looking at the top group item only, so it was possible to select locked children.
The new way is that the plugin looks at the bottom child and works it's way up the heirachy until it finds a lock or the scene level is reached. If it reaches the scene then it's not locked.
new plugin version v.1638424
http://clintons3d.com/plugins/truespace ... index.html
Fixes the problem of locked children of groups being selectable.
To select a group that has some items locked you click on one of the unlocked members of the group.
The old plugin worked by looking at the top group item only, so it was possible to select locked children.
The new way is that the plugin looks at the bottom child and works it's way up the heirachy until it finds a lock or the scene level is reached. If it reaches the scene then it's not locked.
new plugin version v.1638424
http://clintons3d.com/plugins/truespace ... index.html
-
clintonman
- Captain
- Posts: 5659
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
Re: Unselectable script
Update Aug 28 2021
Updates Edit/Default context/Select to support NURBS selection to control point mesh selection conversion
alt-click object no longer bypasses the NURBS selection to control point mesh selection conversion process
lock, unlock and unlock all coded for single undo
enable/disable single undo style code replaces clear history for widget modifications
updated the installer for latest toolbars - list from trueBlue
locking is applied to the NURBS node instead of it's control point mesh - matches the workspace layers 4 locking behavior
http://clintons3d.com/plugins/truespace ... table.html
Updates Edit/Default context/Select to support NURBS selection to control point mesh selection conversion
alt-click object no longer bypasses the NURBS selection to control point mesh selection conversion process
lock, unlock and unlock all coded for single undo
enable/disable single undo style code replaces clear history for widget modifications
updated the installer for latest toolbars - list from trueBlue
locking is applied to the NURBS node instead of it's control point mesh - matches the workspace layers 4 locking behavior
http://clintons3d.com/plugins/truespace ... table.html








