Final trueSpace 7.61 Beta 8 Unofficial Update

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

Confused by one part.
Says recommend install vray 1.54 first then later says download vray 1.53 and gives a link.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Fixed :oops:
Thanks :)

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

@Clinton
The ReloadCustomScripts script does not work as you would expect.
Looks like you need to delete the CustomCommands node first.
Steps
Go to CustomCommands and make a change to one of your scripts without saving it to the CustomScriptsStore
Run Restore Custom Scripts from your toolbar
Results
The script that you changed is not replaced

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote:
25 Aug 2020, 20:02
@Clinton
The ReloadCustomScripts script does not work as you would expect.
Looks like you need to delete the CustomCommands node first.
Steps
Go to CustomCommands and make a change to one of your scripts without saving it to the CustomScriptsStore
Run Restore Custom Scripts from your toolbar
Results
The script that you changed is not replaced
I don't think deleting it is the way to go. Any script not converted to persistent installation would be lost.
Clinton Reese

http://clintons3d.com

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

This might work. Not tested.
It will delete the command nodes if they already exist if the user chooses to do so.
ReloadCustomScripts

Code: Select all

function Execute(params)
{
	var deleteExisting = false;
	if(Node.Exists("Scripts/CustomCommands")) {
		if(System.Question("Overwrite preexisting commands?")) {
			deleteExisting = true;
		}
	}
	if(!Node.Exists("Scripts/CustomCommands")) {
		var temp = Node.Create("Kernel Package/Object","/Scripts");
		var custcom = Node.Rename(temp,"CustomCommands");
	}
	var mainDir = System.GetMainDir();
	var scriptsFolder = mainDir + "\\Scripts\\clintonobjects\\CustomScriptsStore";
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if(!fso.FolderExists(scriptsFolder)) {
	  System.Alert("Scripts store folder not found");
		return;
	}
	var folder = fso.GetFolder(scriptsFolder); 
	var filesEnum = new Enumerator(folder.Files); 
	for (; !filesEnum.atEnd(); filesEnum.moveNext()) {
		var thefile = filesEnum.item();
		var basename = fso.GetBaseName(thefile);
		//if(Node.Exists("Scripts/CustomCommands/" + basename)) continue;
		if(Node.Exists("Scripts/CustomCommands/" + basename)) {
			if(deleteExisting) {
				Node.Delete("Scripts/CustomCommands/" + basename);
			} else {
				continue;
			}
		}
		RsFileIO.LoadObject(thefile, "Scripts/CustomCommands/");
	}
}
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Works as expected. :worship:
Restores all of the scripts in CustomCommands that are in the CustomScriptsStore folder and does not delete any other scripts in CustomCommands.

In the Unofficial Updates, the C3DButton runs Activity.Run("/Scripts/Commands/C3DRestore");
So I will update the C3DRestore script as follows:

Code: Select all

function Execute(params)
{

function Question(strText)
{
	var nSecondsToWait = -1;
	var strTitle = "Question"; // Titlebar text
	// values are hexadecimal
	var MB_YESNO = 4;
	var MB_SYSTEMMODAL = 4096;//1000L force on top
	var MB_ICONQUESTION = 32;//20L question mark symbol // 16;= 10L stop-sign symbol


	var nType = MB_YESNO+MB_SYSTEMMODAL+MB_ICONQUESTION;
	var IDYES = 6;
	var IDNO = 7;

	var shell = new ActiveXObject("WScript.shell");
	var button = shell.Popup (strText, nSecondsToWait, strTitle, nType);

	if(button == IDYES) return true;
	return false;
}


	var deleteExisting = false;
	if(Node.Exists("Scripts/CustomCommands")) {
		if(Question("Restore Custom Scripts?")) {
			deleteExisting = true;
Node.Value("/Status Message", "Seconds") = 5000
Node.Value("/Status Message", "Message") = "  Restoring Custom Scripts..."
Activity.Run("/Status Message/Status Message")
		}
	}
	if(!Node.Exists("Scripts/CustomCommands")) {
		var temp = Node.Create("Kernel Package/Object","/Scripts");
		var custcom = Node.Rename(temp,"CustomCommands");
	}
	var mainDir = System.GetMainDir();
	var scriptsFolder = mainDir + "\\Scripts\\clintonobjects\\CustomScriptsStore";
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if(!fso.FolderExists(scriptsFolder)) {
	  System.Alert("Scripts store folder not found");
		return;
	}
	var folder = fso.GetFolder(scriptsFolder); 
	var filesEnum = new Enumerator(folder.Files); 
	for (; !filesEnum.atEnd(); filesEnum.moveNext()) {
		var thefile = filesEnum.item();
		var basename = fso.GetBaseName(thefile);
		//if(Node.Exists("Scripts/CustomCommands/" + basename)) continue;
		if(Node.Exists("Scripts/CustomCommands/" + basename)) {
			if(deleteExisting) {
				Node.Delete("Scripts/CustomCommands/" + basename);
			} else {
				continue;
			}
		}
		RsFileIO.LoadObject(thefile, "Scripts/CustomCommands/");
	}
return;
}

The only thing that I am not sure of is the return; at the bottom of the script

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

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by clintonman »

trueBlue wrote:
26 Aug 2020, 18:17
Works as expected. :worship:
Restores all of the scripts in CustomCommands that are in the CustomScriptsStore folder and does not delete any other scripts in CustomCommands.

In the Unofficial Updates, the C3DButton runs Activity.Run("/Scripts/Commands/C3DRestore");
So I will update the C3DRestore script as follows:

Code: Select all

function Execute(params)
{

function Question(strText)
{
	var nSecondsToWait = -1;
	var strTitle = "Question"; // Titlebar text
	// values are hexadecimal
	var MB_YESNO = 4;
	var MB_SYSTEMMODAL = 4096;//1000L force on top
	var MB_ICONQUESTION = 32;//20L question mark symbol // 16;= 10L stop-sign symbol


	var nType = MB_YESNO+MB_SYSTEMMODAL+MB_ICONQUESTION;
	var IDYES = 6;
	var IDNO = 7;

	var shell = new ActiveXObject("WScript.shell");
	var button = shell.Popup (strText, nSecondsToWait, strTitle, nType);

	if(button == IDYES) return true;
	return false;
}


	var deleteExisting = false;
	if(Node.Exists("Scripts/CustomCommands")) {
		if(Question("Restore Custom Scripts?")) {
			deleteExisting = true;
Node.Value("/Status Message", "Seconds") = 5000
Node.Value("/Status Message", "Message") = "  Restoring Custom Scripts..."
Activity.Run("/Status Message/Status Message")
		}
	}
	if(!Node.Exists("Scripts/CustomCommands")) {
		var temp = Node.Create("Kernel Package/Object","/Scripts");
		var custcom = Node.Rename(temp,"CustomCommands");
	}
	var mainDir = System.GetMainDir();
	var scriptsFolder = mainDir + "\\Scripts\\clintonobjects\\CustomScriptsStore";
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	if(!fso.FolderExists(scriptsFolder)) {
	  System.Alert("Scripts store folder not found");
		return;
	}
	var folder = fso.GetFolder(scriptsFolder); 
	var filesEnum = new Enumerator(folder.Files); 
	for (; !filesEnum.atEnd(); filesEnum.moveNext()) {
		var thefile = filesEnum.item();
		var basename = fso.GetBaseName(thefile);
		//if(Node.Exists("Scripts/CustomCommands/" + basename)) continue;
		if(Node.Exists("Scripts/CustomCommands/" + basename)) {
			if(deleteExisting) {
				Node.Delete("Scripts/CustomCommands/" + basename);
			} else {
				continue;
			}
		}
		RsFileIO.LoadObject(thefile, "Scripts/CustomCommands/");
	}
return;
}

The only thing that I am not sure of is the return; at the bottom of the script
The bottom of a function automatically returns, so the return at the bottom isn't needed.
It would also be cleaner to have the question function on the outside of the execute function.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

Okay, thank you!

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

New Update for trueSpace7.61 Beta 8 Unofficial Update
viewtopic.php?f=55&t=3732
Final Update August 26, 2020

Recommend that you completely Uninstall and Install trueSpace7.61 Beta 8 to a clean directory before installing this update. This update precedes all previous updates and recommend that you delete any and all previous updates

Recommend that you install Vray version 1.54 first before applying this update.
After applying this update, open trueSpace, Install/Load Vray from the Package Manager and Reset to Default Context
You can download Vray for tS7.61 version 1.54 here:
https://united3dartists.com/index.html

Lights
Widget / LightPanelFrame
Disable - SnapToRatio

Spot & Projector
Preferences / Spot Cone
Add
LMB click opens the Shadow Map & Image Browser
New Projector and Spot lights.png
AnimPrefPanelFrame
Disable - SnapToRatio

Update WS - Default light setup
Update Scene Lights & Camera

Select - Author Clinton Reese
Add
None button

Widgets
Camera(s)
Add
RMB select the Camera Widget's (sides) shows the Camera's floating panel
CameraFloatingPanel.png
View Widget
Encircle 'Green' / Perspective
Add
Alt + RMB click resets the Perspective view
Note: This is using new values and is different then trueSpace's Reset View command

C3DRestore.xml - Author Clinton Reese
Update

User avatar
trueBlue
Captain
Posts: 2990
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace 7.61 Beta 8 Unofficial Update

Post by trueBlue »

New Update for trueSpace7.61 Beta 8 Unofficial Update
viewtopic.php?f=55&t=3732
Final Update August 28, 2020

Recommend that you completely Uninstall and Install trueSpace7.61 Beta 8 to a clean directory before installing this update. This update precedes all previous updates and recommend that you delete any and all previous updates

Recommend that you install Vray version 1.54 first before applying this update.
After applying this update, open trueSpace, Install/Load Vray from the Package Manager and Reset to Default Context
You can download Vray for tS7.61 version 1.54 here:
https://united3dartists.com/index.html

Toolbars - Object button(s)
Select - None button
Link Editor Navigation - Ctrl+ button
Camera(s) - Camera Window script
All of the above have been updated to remove the selection in the Stack/Panels when Unselecting

Post Reply