The function set has 3 sections: Node List, Scene View and checkbox contexttrueBlue wrote: ↑23 Mar 2023, 16:57Yes, I had to zip the bmpclintonman wrote: ↑23 Mar 2023, 16:35Good idea.
Did you have to zip it, did I forget to add bmp files to the forum upload options?
I would like to use:
var UUFS = Node.AccessFnSet('Scripts/UUCommands/UUFunctionSet');UUFS.Delete();
in your Clintons3dView Function Set for the UU9
Not sure where and where not to put it as there a lot of Node.Delete commands
These are the changes you would make for UUFS.Delete()
change openSceneView2, add the if statement before the return:
Code: Select all
//clear the store
var store = "/Scripts/CustomCommands/SceneView/Store";
var subObjCount = Node.SubObjectCount(store);
if(subObjCount > 0) {
for(var i=subObjCount-1; i>=0; i--) {
Node.Delete(store + "/"+ Node.SubObject(store,i));
}
}
//will start blank if nothing is selected - select first scene item
if(Node.SelectedCount() == 0) {
var scene = Space.CurrentScene();
Space.Select(scene + "/" + Node.SubObject(scene, 0));
}
//WindowsManager.CreateWindowFromCLSID('{DD2E0D6B-ED84-4b80-A624-757525B8A591}', '', '', '', 1);//node view window
WindowsManager.CreateWindowFromCLSID('{E9C4FE3C-C3C9-4dfd-8C85-E7F0F81029B4}', '', '', '', 1);//scene view 2
if(Node.Exists('Scripts/UUCommands/UUFunctionSet')) {
var sceneViewFS = "/Scripts/CustomCommands/SceneView/Clintons3dView Function Set";
var UUFS = Node.AccessFnSet('Scripts/UUCommands/UUFunctionSet');
sceneViewFS.UUFS = UUFS;
}
return;
Code: Select all
// This is a jScript Function Set
// Put usefull functions, constants, enumerators here and share them across your project
// Use Node.AccessFnSet / Node.AccessNearFnSet to get access here from your script commands
// Hint: do not use commands like System.ThisOwner, System.ThisName or Node.NearValue here, as they reffer to caller's command location
var UUFS;
Code: Select all
function SceneView_Delete(theselection)
{
if(Node.Exists('Scripts/UUCommands/UUFunctionSet')) {
Space.Select(theselection);
UUFS.Delete();
return;
}
Node.Delete(theselection);
}
change Clintons3dView Function Set, checkbox section:
Code: Select all
function SceneView_Delete_Ctx(thenodes)
{
var selArr = thenodes.split(";");
if(selArr[1] == "") return;//nothing checked
if(Node.Exists('Scripts/UUCommands/UUFunctionSet')) {
selArr.shift();
var selStr = selArr.join(";");
Space.Select(selStr);
UUFS.Delete();
return;
}
cmd = 'thenodes = "' + thenodes + '";'
cmd += 'var selArr = thenodes.split(";");'
cmd += 'selArr.shift();'
cmd += 'while(delnode = selArr.pop()) {'
cmd += ' Node.Delete(delnode);'
cmd += '}'
cmd += 'Space.Unselect();'
RsApp.RunScriptBuffer(cmd);
//
//var selArr = thenodes.split(";");
//if(selArr[1] == "") return;//nothing checked
//remove first item - the rmb clicked on item
//selArr.shift();
//TODO single delete form
//while(delnode = selArr.pop()) {
// Node.Delete(delnode);
//}
//Space.Unselect();//cleanup for script selection reads
}