Clinton comes to the rescue AGAIN!
What a tough nut to crack.
I like the unselecting too!
The Show and ShowAll scripts are an old version and they do not work.clintonman wrote: 25 Jun 2020, 15:53 Here are the latest xml files for Hide, Show, HideAll, ShowAll and CloseORASettings nodes.
Think we should pass on this.clintonman wrote: 25 Jun 2020, 22:22 Rosetta with V6
Fine by me, but I pretty much get the same thing when I run the updates. I have to disable my anti-virus or it doesn't go well. I don't think there's any problem with the full version dll files though.trueBlue wrote: 26 Jun 2020, 00:16Think we should pass on this.clintonman wrote: 25 Jun 2020, 22:22 Rosetta with V6
WIN 10
Rosetta.png
Found another problem with these filesclintonman wrote: 25 Jun 2020, 15:53 Here are the latest xml files for Hide, Show, HideAll, ShowAll and CloseORASettings nodes.
Thinking it would be better to supply the original files along with the modified files, and create a script to install them.clintonman wrote: 26 Jun 2020, 00:37Fine by me, but I pretty much get the same thing when I run the updates. I have to disable my anti-virus or it doesn't go well. I don't think there's any problem with the full version dll files though.trueBlue wrote: 26 Jun 2020, 00:16Think we should pass on this.clintonman wrote: 25 Jun 2020, 22:22 Rosetta with V6
WIN 10
Rosetta.png
Code: Select all
System.Alert("trueSpace 7.61 Unofficial Update Version 6");WindowsManager.OpenAboutBox();
Photoshop. It's a mockup it's not real.trueBlue wrote: 26 Jun 2020, 12:35 How in the heck did you do that?![]()
Please do share!
There are a lot of possibilities for sure.
Another example, you could add a script to the Help/About command
WindowsManager.OpenAboutBox();//Insert code here
Or simply:...Code: Select all
System.Alert("trueSpace 7.61 Unofficial Update Version 6");WindowsManager.OpenAboutBox();
The selection is only altered if a spotlight, camera or projection light is selected. You can't hide them if they are selected.trueBlue wrote: 26 Jun 2020, 12:35 There is one thing I would suggest we change with the Hide and HideAll scripts since there is a loss of selection.
Try it without selecting:
Hide
Line 76
//Space.Select(sel);
Note: Activity.Run(System.ThisOwner() + "/CloseORASettings");
Is not working
HideAll
Line 46
//Space.Select(sel);
Note: Activity.Run(System.ThisOwner() + "/CloseORASettings");
Is not working
Don't know what you mean by this. Maybe you can post a picture of what's missing.trueBlue wrote: 26 Jun 2020, 12:35 Not sure really about this with the not selecting part.
It is good in one aspect but the whole concept about showing the Object Render Attributes only works on the first selected object.
Before, the original command, use to show all of them.
I finished my research and the code you have here would probably be best.trueBlue wrote: 26 Jun 2020, 12:35 How in the heck did you do that?![]()
Please do share!
There are a lot of possibilities for sure.
Another example, you could add a script to the Help/About command
WindowsManager.OpenAboutBox();//Insert code here
Or simply:Code: Select all
System.Alert("trueSpace 7.61 Unofficial Update Version 6");WindowsManager.OpenAboutBox();
1.) Activity.Run(System.ThisOwner() + "/CloseORASettings"); is not working for Hide and HideAll. Where as if have Settings open, it is not switching to Panels. In Panels, only the first selected in the selection is showing.clintonman wrote: 26 Jun 2020, 19:57The selection is only altered if a spotlight, camera or projection light is selected. You can't hide them if they are selected.trueBlue wrote: 26 Jun 2020, 12:35 There is one thing I would suggest we change with the Hide and HideAll scripts since there is a loss of selection.
Try it without selecting:
Hide
Line 76
//Space.Select(sel);
Note: Activity.Run(System.ThisOwner() + "/CloseORASettings");
Is not working
HideAll
Line 46
//Space.Select(sel);
Note: Activity.Run(System.ThisOwner() + "/CloseORASettings");
Is not working
Don't know what you mean by this. Maybe you can post a picture of what's missing.trueBlue wrote: 26 Jun 2020, 12:35 Not sure really about this with the not selecting part.
It is good in one aspect but the whole concept about showing the Object Render Attributes only works on the first selected object.
Before, the original command, use to show all of them.
Might be useful but it's not the same thing. You can still select the item, edit it, change it's materials etc. Also the rename will need unique names for more than one locked item at a time.trueBlue wrote: 27 Jun 2020, 19:38 @Clinton
What do you think about a different approach for Unselectable objects?
Lock
var lock = LE.ExpandMatrix(selectedObj_ + "/Matrix")
Node.Rename(Space.CurrentScene() + "/ExpandInMatrix") = "Lock"
Unlock
Node.Disconnect(Space.CurrentScene() + "/Lock", "Matrix", selectedObj_, "Matrix")
Node.Delete(Space.CurrentScene() + "/Lock")
On top of the KillAll this comment from the old version on my web site might apply as well, " ...this process can interfere with other scripts that depend on selection changes."trueBlue wrote: 27 Jun 2020, 20:00 Looks like this
viewtopic.php?t=5536
is compatible with your Workspace Layers
But it uses Activity.KillAll()
Code: Select all
try {
utilitydata = System.CreateDO("Clintons3D Package/Utility functions");
} catch(err) {
System.Error("Requires the " + "("+" Clintons3dPlugin.rsx )" + " plugin to be Installed and Loaded in the Package Manager")
return "Requires Clintons3dPlugin.rsx plugin";
}
I don't see this at all. It has no effect on the Object Render Attributes and the exported aspect does not change.trueBlue wrote: 28 Jun 2020, 15:29 Found an issue with Workspace Layers
Selecting Locked from the menu replaces the Object Render Attributes node for Lights and Cameras, maybe other objects too!
This is an issue in the Updates because of the modified Object Render Attributes, that has the Default aspect Exported out.
It exposes the none working Invisible attribute, that is hookup to the Object Hider.
Any chance you can update your Workspace Layers to not replace the Object Render Attributes if it Exist?
The lock is added to all items in a layer, not every object in the scene unless all items are in one layer. It works on layer items not all items.trueBlue wrote: 28 Jun 2020, 15:29 Also, If your unSelectable.RsObj is installed, selecting Locked from the menu, installs the selectionLocking.RsObj to every object in the scene.
Any chance you can update your unSelectable.RsObj - UnLock All and Unlock It code to delete the selectionLocking.RsObj in every object in the scene and or selected objects?
WorkspaceLayersandUnSelectable.png
Also if your Workspace Layers unlock code could remove the selectionLocking.RsObj in every object in the scene, would be good too!
IE: Restoring the objects back to their original state.
No, the unSelectable does not require the layers and can be used without the layers, so I'm not going to duplicate it inside the layers scripts. If unSelectable is available layers will use it, otherwise it ignores it.trueBlue wrote: 28 Jun 2020, 15:29 Ultimately, if your Workspace Layers could have the unSelectable.RsObj incorporated and coexist with your plugin, would be awesome!
Might be a good idea.trueBlue wrote: 28 Jun 2020, 15:29 And maybe a check to see if your required plugin(s) is Installed and Loaded?
As an example:Above example is missing the Clintons3dRsView.rsxCode: Select all
try { utilitydata = System.CreateDO("Clintons3D Package/Utility functions"); } catch(err) { System.Error("Requires the " + "("+" Clintons3dPlugin.rsx )" + " plugin to be Installed and Loaded in the Package Manager") return "Requires Clintons3dPlugin.rsx plugin"; }
How would you check for this plugin?
This would be good to have in case a user unloads and or uninstalls your plugin(s)
Thanks for the steps, I'll give it a go.trueBlue wrote: 28 Jun 2020, 18:50 Steps
Current tS 761 Unofficial Update
New Scene
Open Panels
Select Spot light
Notice that the Object Render Attributes does Not show in Panels
Before.png
Load Workspace Layers
Select Visible or Locked
Notice that the Object Render Attributes Does show in Panels
After.png
Results: All Lights and Camera has their Object Render Attributes replaced
Code: Select all
function emptylayerrecursive(thenode,layer)
{
//System.Trace(thenode);
if( (Node.IsRenderable(thenode) || isActor(thenode) || isGroup(thenode) ) && !(Node.IsCamera(thenode) || Node.IsLight(thenode)) )
if(Node.Exists(thenode + "/Object Render Attributes"))
if(Node.Value(thenode + "/Object Render Attributes","Layer index") == layer)
{
if(Node.ConExists(thenode,"RenderAttributes"))
{
Node.ConRemove(thenode, "RenderAttributes")
}
Node.Delete(thenode + "/Object Render Attributes")
if(isActor(thenode)) return;
}
That explains why I couldn't find it. That has nothing to do with the locking.trueBlue wrote: 28 Jun 2020, 19:24 Check the menuprocessor scriptCode: Select all
function emptylayerrecursive(thenode,layer) { //System.Trace(thenode); if( (Node.IsRenderable(thenode) || isActor(thenode) || isGroup(thenode) ) && !(Node.IsCamera(thenode) || Node.IsLight(thenode)) ) if(Node.Exists(thenode + "/Object Render Attributes")) if(Node.Value(thenode + "/Object Render Attributes","Layer index") == layer) { if(Node.ConExists(thenode,"RenderAttributes")) { Node.ConRemove(thenode, "RenderAttributes") } Node.Delete(thenode + "/Object Render Attributes") if(isActor(thenode)) return; }
Code: Select all
var Sel = Node.FirstSelected()
D3DView.ShowRenderAttribsForObject('', Sel)
RsStackView.SetPanelExportInfo(Sel + '/Object Render Attributes','Default',1,1);
Code: Select all
// need to run ever time for case of a child is explicitly shown
//if(!Node.Exists(Sel + "/Object Render Attributes")) {
if(!Node.IsCamera(Sel) && !Node.IsLight(Sel)) {
D3DView.ShowRenderAttribsForObject('', Sel);
ORA_was_created = true;
FindOrphanORA(Sel);
}
Got it, Thanksclintonman wrote: 29 Jun 2020, 16:46 Found new bug in the Hide command script
create 2 cubes
3d encapsulate them
hide the group
show one of the cubes
hide the group - fail, shown cube still visible
fix change toCode: Select all
// need to run ever time for case of a child is explicitly shown //if(!Node.Exists(Sel + "/Object Render Attributes")) { if(!Node.IsCamera(Sel) && !Node.IsLight(Sel)) { D3DView.ShowRenderAttribsForObject('', Sel); ORA_was_created = true; FindOrphanORA(Sel); }
HideAll/ShowAll - hiding lights and cameras in the LE does not look like a good thing
Put it back in. In most cases it's not needed, but if you load an object from "not updated tS" that has ORA then it never shows and you lose access to that feature.trueBlue wrote: 29 Jun 2020, 17:03Got it, Thanksclintonman wrote: 29 Jun 2020, 16:46 Found new bug in the Hide command script
create 2 cubes
3d encapsulate them
hide the group
show one of the cubes
hide the group - fail, shown cube still visible
fix change toCode: Select all
// need to run ever time for case of a child is explicitly shown //if(!Node.Exists(Sel + "/Object Render Attributes")) { if(!Node.IsCamera(Sel) && !Node.IsLight(Sel)) { D3DView.ShowRenderAttribsForObject('', Sel); ORA_was_created = true; FindOrphanORA(Sel); }
HideAll/ShowAll - hiding lights and cameras in the LE does not look like a good thing
I'll remove the LE properties commands.
I am okay with:
RsStackView.SetPanelExportInfo(Sel + '/Object Render Attributes','Default',1,1);
Just through me for a loop thinking the panel was being replaced.
So In or Out?
Your call!
Code: Select all
RsStackView.SetPanelExportInfo(CurrentNode + '/Object Render Attributes','Default',1,1);
No. ShowAll/HideAll don't work the same as Hide/Show. The Show/Hide in the workspace layers is also different, similar, but different.trueBlue wrote: 29 Jun 2020, 17:49 Just noticed that the ShowAll does not have the:command and HideAll does.Code: Select all
RsStackView.SetPanelExportInfo(CurrentNode + '/Object Render Attributes','Default',1,1);
Should it be included and if so where at in the script?
Code: Select all
if(Node.ConExists(childnode, "Skeleton") && thenode != Space.CurrentScene()) {
return true;
}
Yep, forgot about that one. The note for it is from 2015, a few years ago.trueBlue wrote: 29 Jun 2020, 20:55 Ugh! Reading about your Workspace Layers at your website, I found another issue with the Hiding/Showing scripts.
Poor Bobby has invisible Hair![]()
NoHair.png
Looks like you are avoiding SkeletonsCode: Select all
if(Node.ConExists(childnode, "Skeleton") && thenode != Space.CurrentScene()) { return true; }
What? From somebody that can read and write to xml files?Workspace Layers there is no known way to check for the installation of the Clintons3dRsView.rsx plugin
Very nice.trueBlue wrote: 30 Jun 2020, 01:48
What? From somebody that can read and write to xml files?Workspace Layers there is no known way to check for the installation of the Clintons3dRsView.rsx plugin![]()
IE: Plugins.xml
Code: Select all
function Execute(params)
{
if (Node.ConExists('', "UnSelectable"))
{
RsApp.Undo()
Node.Value(System.ThisOwner(), "Active") = -1
}
}
Code: Select all
if(datafromweb.command == "LockNode")
{
//copy selection locking node if does not exist
if(!Node.ConExists(datafromweb.path,"UnSelectable"))
{
newnode = Node.Copy(owner + "/selectionLocking",datafromweb.path);
Node.ExportConnector(newnode, "UnSelectable", "", 1, 1);
}
Node.Value(datafromweb.path,"UnSelectable") = true;
return;
}
Code: Select all
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible");
Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible");
I don't see this. Check out the new version I just released.trueBlue wrote: 01 Jul 2020, 17:19 Also it looks like you need to update your Visibility Function Set
IE: The disconnecting of the Object Hider
Code: Select all
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible"); Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible");
Good idea.trueBlue wrote: 01 Jul 2020, 17:10
Feedback
The Locking and Unlocking UI seems unconnected
At first use, I did not realize that you needed to start the Server and Check "Enable Selection Locks"
IMO... having a button on the Workspace Layers and or call the server from code would help.
Enable Locking button.png
Sorry to report but the new version also has the above.clintonman wrote: 01 Jul 2020, 17:25I don't see this. Check out the new version I just released.trueBlue wrote: 01 Jul 2020, 17:19 Also it looks like you need to update your Visibility Function Set
IE: The disconnecting of the Object Hider
Code: Select all
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible"); Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible");
Downloaded from the website, verified july 1 datetrueBlue wrote: 01 Jul 2020, 19:19Sorry to report but the new version also has the above.clintonman wrote: 01 Jul 2020, 17:25I don't see this. Check out the new version I just released.trueBlue wrote: 01 Jul 2020, 17:19 Also it looks like you need to update your Visibility Function Set
IE: The disconnecting of the Object Hider
Code: Select all
Node.Disconnect(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible"); Node.ConnectTo(Sel + "/Object hider", "Invisible", Sel + "/Object Render Attributes", "Invisible");
How do you apply hair from code?trueBlue wrote: 01 Jul 2020, 19:29 With your newest Workspace Layers, Locking/Unlocking does not install the selectionLocking.RsObj to an object that has Hair applied from code.
The unSelectable.RsObj does.
Also selecting *Visible, hides the Hair but not the object it is attached to.
Looking at my previous post, I was not clear I was referring to your Web Server/Visibility Function Setclintonman wrote: 01 Jul 2020, 19:49Downloaded from the website, verified july 1 datetrueBlue wrote: 01 Jul 2020, 19:19Sorry to report but the new version also has the above.clintonman wrote: 01 Jul 2020, 17:25
I don't see this. Check out the new version I just released.
installed
Still don't see it. Do you have a line number for that code?
What I meant "from code" is the scripts from the Workspace Layersclintonman wrote: 01 Jul 2020, 20:00How do you apply hair from code?trueBlue wrote: 01 Jul 2020, 19:29 With your newest Workspace Layers, Locking/Unlocking does not install the selectionLocking.RsObj to an object that has Hair applied from code.
The unSelectable.RsObj does.
Also selecting *Visible, hides the Hair but not the object it is attached to.
If you add a mesh to the scene and then apply hair to it you get hair on layer 0 and the mesh on layer 1. Is this what you are seeing?
If that's the case, the only way to unify them is to select the main object and assign it to a layer.
I can't reproduce it.trueBlue wrote: 01 Jul 2020, 20:17What I meant "from code" is the scripts from the Workspace Layersclintonman wrote: 01 Jul 2020, 20:00How do you apply hair from code?trueBlue wrote: 01 Jul 2020, 19:29 With your newest Workspace Layers, Locking/Unlocking does not install the selectionLocking.RsObj to an object that has Hair applied from code.
The unSelectable.RsObj does.
Also selecting *Visible, hides the Hair but not the object it is attached to.
If you add a mesh to the scene and then apply hair to it you get hair on layer 0 and the mesh on layer 1. Is this what you are seeing?
If that's the case, the only way to unify them is to select the main object and assign it to a layer.
Here is a screen shot of a new scene with the Head object that has Hair applied, then I load the Workspace Layers
Note:
no layer count = 3
layer0 = menu 1
layer1 = menuL 5
Note also that it is set to menuL which is unexpected. Normally it is set to menu
Also do not understand why no layer count is 3
Add ObjectwithHairLoad Layers.png
Following your steps, screen shot shows that the Head is not locked.clintonman wrote: 01 Jul 2020, 20:41I can't reproduce it.trueBlue wrote: 01 Jul 2020, 20:17What I meant "from code" is the scripts from the Workspace Layersclintonman wrote: 01 Jul 2020, 20:00
How do you apply hair from code?
If you add a mesh to the scene and then apply hair to it you get hair on layer 0 and the mesh on layer 1. Is this what you are seeing?
If that's the case, the only way to unify them is to select the main object and assign it to a layer.
Here is a screen shot of a new scene with the Head object that has Hair applied, then I load the Workspace Layers
Note:
no layer count = 3
layer0 = menu 1
layer1 = menuL 5
Note also that it is set to menuL which is unexpected. Normally it is set to menu
Also do not understand why no layer count is 3
Add ObjectwithHairLoad Layers.png
Load head from the library - it has no render attributes.
Apply hair from the library - hair has render attributes indicating layer 0.
open layers
there is no locking
choose lock on layer 0 and selectionlocking node appears inside the hair node, displays "menu L" as expected to indicate locked layer
picture doesn't help with steps to reproduce
no layer count does not take everything into account.
Code: Select all
var Sel = Node.FirstSelected()
if(Node.IsRenderable(Sel)) {
System.Alert("Test")
return;
}
Now I understand and I was able to get it to work.Items get into the layer system by having an ORA which holds the layer info. Objects without ORA are not used because they have no layer info.
Code: Select all
function Execute(params)
{
SceneRoot = Space.CurrentScene();
var i=0;
while (i<Node.SubObjectCount(SceneRoot)) {
if (Search(SceneRoot + '/' + Node.SubObject(SceneRoot, i))) {
return;
}
i = i + 1;
}
}
function Search(CurrentNode)
{
if (Node.SubObjectCount(CurrentNode) == 0)
return false;
if(Node.Exists(CurrentNode + "/Object hider")) {
Node.Value(CurrentNode + "/Object hider", "Invisible") = true;
Node.Value(CurrentNode + "/Object hider", "Invisible") = false;
Node.Value(CurrentNode + "/Object Render Attributes", "Invisible") = -1
Node.Value(CurrentNode + "/Object Render Attributes", "Invisible") = 0
return false
}
if (Node.IsRenderable(CurrentNode) && Node.Exists(CurrentNode + "/Object Render Attributes")) {
try {
Node.Value(CurrentNode + "/Object Render Attributes", "Invisible") = 0
} catch (e) {}
return false;
}
//Add tB
if (!Node.Exists(CurrentNode + "/Object Render Attributes")) {
try {
D3DView.ShowRenderAttribsForObject('', CurrentNode);
} catch (e) {}
Activity.Run(System.ThisOwner() + "/CloseORASettings");
return false;
}
//End tB
var j=0;
while (j < Node.SubObjectCount(CurrentNode)) {
if(Node.Exists(CurrentNode + "/Object Render Attributes")) {
try {
Node.Value(CurrentNode + "/Object Render Attributes", "Invisible") = 0
} catch (e) {}
}
if(Search(CurrentNode + '/' + Node.SubObject(CurrentNode, j))) {
return true;
}
j = j + 1;
}
return false;
}
Right, trueSpace creates the ORA when the hair is added and layer 0 is what it assigns to the layer attribute.trueBlue wrote: 02 Jul 2020, 00:57Now I understand and I was able to get it to work.Items get into the layer system by having an ORA which holds the layer info. Objects without ORA are not used because they have no layer info.
I guess I was stumped by thinking the Refresh button or On Load added any objects in the scene to layer1
I was not understanding about hair objects being automatically added the layer0
There still is problem though.
This is the results using Layers with the Hair object
Note the missing ORA panel?
LayersHairORAProblem.png
This is the results using tS ORA command
tS ORA command on Obj with Hair.png
You're going to have to refresh my memory. We've been talking about hair for so long I have no idea what the ShowAll changes are for.trueBlue wrote: 02 Jul 2020, 01:58 Cross post
Please read about the updated ShowAll
The only thing it is missing is deleting the orphaned ORA
My thought is, if this works as expected it could be a complete solution for the ShowAlL and maybe a possible use for your Layers.
Meaning you could include this script to run before the Refresh
Code: Select all
function Execute(params)
{
var scene = Space.CurrentScene();
var numTopLevel = Node.SubObjectCount(scene);
for(var i=0; i< numTopLevel; i++) {
var item = scene + "/" + Node.SubObject(scene, i);
Search(item)
}
}
function Search(curNode)
{
if(Node.ConExists(curNode, "WldMatrix")) {
D3DView.ShowRenderAttribsForObject('', curNode)
Node.Value(curNode + "/Object Render Attributes", "Invisible") = 0
RsStackView.SetPanelExportInfo(curNode + '/Object Render Attributes','Default',1,1);
Activity.Run(System.ThisOwner() + "/DeleteORA");
Activity.Run(System.ThisOwner() + "/ShowCameraAndLights");
Activity.Run(System.ThisOwner() + "/CloseORASettings");
return;
}
if(Node.IsRenderable(curNode) || Node.IsCamera(curNode) || Node.IsLight(curNode)) return;
var numChildren = Node.SubObjectCount(curNode);
for(var i=0; i< numChildren ; i++) {
var child = curNode+ "/" + Node.SubObject(curNode, i);
Search(child);
}
}
Code: Select all
function Execute(params)
{
var scene = Space.CurrentScene();
var numTopLevel = Node.SubObjectCount(scene);
for(var i=0; i< numTopLevel; i++) {
var item = scene + "/" + Node.SubObject(scene, i);
Search(item)
}
}
function Search(curNode)
{
if(Node.Exists(curNode + "/RenderAttributes")) {
Node.Delete(curNode + "/Object Render Attributes")
return;
}
if(Node.IsRenderable(curNode) || Node.IsCamera(curNode) || Node.IsLight(curNode)) return;
var numChildren = Node.SubObjectCount(curNode);
for(var i=0; i< numChildren ; i++) {
var child = curNode+ "/" + Node.SubObject(curNode, i);
Search(child);
}
}