Unselectable script
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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: 3198
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
- Contact:
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: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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.
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: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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
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
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: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
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();