Final trueSpace7.61 Beta 8 Std Unofficial Update

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

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

clintonman wrote: 27 Jul 2020, 19:00 You can use something like this to check for the plugin installation.

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{

	// TODO: put your action code here
	if( pluginInstalled() )
		System.Alert("plugin is installed and loaded");
}

function pluginInstalled()
{
	// check that plugin is installed and loaded

	var xmldoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
	xmldoc.load(System.GetMainDir() + "\\Scripts\\Plugins.xml");

	var doc = xmldoc.documentElement;

	for(var i=0;i<doc.childNodes.length;i++)
	{
		var child = doc.childNodes.item(i);
		var grandchild = child.childNodes.item(0);
		var NAME = grandchild.getAttribute("NAME");

		if(NAME == "Clintons3D Package") {
			var STATUS = grandchild.getAttribute("STATUS");
			if(STATUS == "LOADED") {
				return true
			}
		}
	}

	System.Alert("Clintons3dView plugin must be installed and loaded.");

	return false;
}
Shouldn't you add:
params.SetTerminationFlag();//stop downstream execution
return;

as follows?

Code: Select all

	System.Alert("Clintons3dView plugin must be Installed and Loaded.");
			params.SetTerminationFlag();//stop downstream execution
			return;
	return false;
Edit:
Nope, Error: params is undefined
Can not get it to stop running if the plugin is not Loaded
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by clintonman »

trueBlue wrote: 27 Jul 2020, 19:22
clintonman wrote: 27 Jul 2020, 19:11
trueBlue wrote: 27 Jul 2020, 18:58 Okay thanks for the confirmation.
Also discovered the unSelectable script does not work when saving it with a scene
When you open the scene, with the unSelectable script Active, it does not work
Guessing the Check Box is in a undefined state
Looks more like the selection change is sleeping.
This added to the RemoteCommand seems to fix it.

Code: Select all

	RsTool.ToggleValue(System.ThisOwner() + "/Active");
	RsTool.ToggleValue(System.ThisOwner() + "/Active");
Yep that works.
Question is, since your version does not seem to be using the Show attribute, are you going to make the necessary changes?
I'll be adding those 2 commands.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by clintonman »

trueBlue wrote: 27 Jul 2020, 19:31 ...
Shouldn't you add:
params.SetTerminationFlag();//stop downstream execution
return;

as follows?

Code: Select all

	System.Alert("Clintons3dView plugin must be Installed and Loaded.");
			params.SetTerminationFlag();//stop downstream execution
			return;
	return false;
Edit:
Nope, Error: params is undefined
Can not get it to stop running if the plugin is not Loaded
Try this for the SetMaterialEditMode

Code: Select all

// Execute 
// Called to execute the command 
function Execute(params)
{
	var MatEditInstancing = params.ConValue('MatEditInstancing');

	if( !pluginInstalled() ) {
		System.Alert("Clintons3dView plugin must be installed and loaded.");
		params.SetTerminationFlag();//stop downstream execution
		return;
	}

	var meNode = "/Material Editor/Material Editor";

	if(!Node.Exists(meNode)) {
		System.Alert("Material Editor not found.");
		params.SetTerminationFlag();//stop downstream execution
		return;
	}

	var mei = System.CreateDO("Common Data Package/String Enum Data");
	mei = Node.Value(meNode,"Material instancing");

	params.ConValue('MatInstancingBackup') = mei.GetSelectedString();

	mei.SetSelectedString(MatEditInstancing);

	Node.Value(meNode, "Material instancing") = mei;
		

}

function pluginInstalled()
{
	// check that plugin is installed and loaded

	var xmldoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
	xmldoc.load(System.GetMainDir() + "\\Scripts\\Plugins.xml");

	var doc = xmldoc.documentElement;

	for(var i=0;i<doc.childNodes.length;i++)
	{
		var child = doc.childNodes.item(i);
		var grandchild = child.childNodes.item(0);
		var NAME = grandchild.getAttribute("NAME");

		if(NAME == "Clintons3D Package") {
			var STATUS = grandchild.getAttribute("STATUS");
			if(STATUS == "LOADED") {
				return true
			}
		}
	}

	//System.Alert("Clintons3dView plugin must be installed and loaded.");

	return false;
}
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

Yeah! That works!!
You also have

Code: Select all

	if(!Node.Exists(meNode)) {
		System.Alert("Material Editor not found.");
		params.SetTerminationFlag();//stop downstream execution
		return;
	}
Instead of stopping it from running, why not open the Material Editor?
MeshModifiers.OpenMaterialEditor()
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

New Update for trueSpace7.61 Beta 8 Std Unofficial Update
viewtopic.php?f=55&t=3731
RC18 July 27, 2020

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

Material Editor
Update
D3D Material Converter

Toolbars
Update
Q_PESnappingToolbar
Update Icons.png
Update Icons.png (34.21 KiB) Viewed 2286 times
Cameras
Update
LMB = Normalize Rotatiion
RMB = Reset to Perspective
Camera updates.png
LMB = Camera Render to File
RMB = Open folder
Camera updates2.png
Camera updates2.png (13 KiB) Viewed 2286 times
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

@Clinton
I noticed that the Copy Attributes script does not really stop the script from running if the Clintons3dPlugin.rsx plugin is not Loaded
Using the code you shared with the Material Converter, does this seem to be correct for the Copy script?
Does it need to have the try & Catch and if so how would you implement that?

Code: Select all


var CONFLG_DIRTY = 1
var CONFLG_OUT = 2
var CONFLG_IN = 4
var CONFLG_INOUT = 6
var CONFLG_RESERVED = 8
var CONFLG_EXPORTED = 16
var CONFLG_HIDDEN = 32
var CONFLG_CACHING = 64
var CONFLG_NONOTIFY = 128
var CONFLG_CONTROLFLOW = 256
var CONFLG_DISABLECACHING = 512
var CONFLG_REGISTERED = 1024
var CONFLG_CUSTOM = 2048
var CONFLG_TOPOLOGY = 4096
var CONFLG_LOCAL = 8192
var CONFLG_LAST = 8193

function Execute(params)
{
	var Source = params.ConValue('Source');
	var Destination = params.ConValue('Destination');
	var Verify = params.ConValue('Verify');

	if(!Source) return
	if(!Destination) return

	if(!pluginInstalled() ) {
		System.Alert("Clintons3dView plugin must be Installed and Loaded.");
		params.SetTerminationFlag();//stop downstream execution
		return;
	}

//	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";
//	}


var utilitydata = System.CreateDO("Clintons3D Package/Utility functions");

	currentnode = Source;
	thedata = utilitydata.GetConnectorData(currentnode);
	connectors = thedata.split("\n");
	for(i=0;i<connectors.length;i++)
	{
	connector = connectors[i].split("\t");
//connector[0] = script connector name
//connector[1] = connector name
//connector[2] = connector type
//connector[3] = flags
	if(connector[3] & CONFLG_IN && !(connector[3] & CONFLG_HIDDEN)) {
//System.Trace(connector[0]);
		if(Node.ConExists(Destination, connector[0])) {
			System.Trace(connector[0]);
			try {
				if(Verify) {
				if(Question("Copy the " + "( " + connector[0] + " )" + " attribute to the Destination?"))
					Node.Value(Destination, connector[0]) = Node.Value(Source, connector[0]);
				}
				else
					Node.Value(Destination, connector[0]) = Node.Value(Source, connector[0]);
			} catch(e) {
//System.Trace("Failed to copy " + connector[0]);
//System.Error("Failed to copy " + connector[0]);
			}
			
		}
	}
}
	Node.ConReset(System.ThisOwner(),"Source")
	Node.ConReset(System.ThisOwner(),"Destination")
}

function pluginInstalled()
{
	// check that plugin is installed and loaded

	var xmldoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
	xmldoc.load(System.GetMainDir() + "\\Scripts\\Plugins.xml");

	var doc = xmldoc.documentElement;

	for(var i=0;i<doc.childNodes.length;i++)
	{
		var child = doc.childNodes.item(i);
		var grandchild = child.childNodes.item(0);
		var NAME = grandchild.getAttribute("NAME");

		if(NAME == "Clintons3D Package") {
			var STATUS = grandchild.getAttribute("STATUS");
			if(STATUS == "LOADED") {
				return true
			}
		}
	}

	//System.Alert("Clintons3dView plugin must be installed and loaded.");

	return false;
}

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;
}

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

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by clintonman »

trueBlue wrote: 28 Jul 2020, 14:04 @Clinton
I noticed that the Copy Attributes script does not really stop the script from running if the Clintons3dPlugin.rsx plugin is not Loaded
Using the code you shared with the Material Converter, does this seem to be correct for the Copy script?
Does it need to have the try & Catch and if so how would you implement that?

Code: Select all


var CONFLG_DIRTY = 1
var CONFLG_OUT = 2
var CONFLG_IN = 4
var CONFLG_INOUT = 6
var CONFLG_RESERVED = 8
var CONFLG_EXPORTED = 16
var CONFLG_HIDDEN = 32
var CONFLG_CACHING = 64
var CONFLG_NONOTIFY = 128
var CONFLG_CONTROLFLOW = 256
var CONFLG_DISABLECACHING = 512
var CONFLG_REGISTERED = 1024
var CONFLG_CUSTOM = 2048
var CONFLG_TOPOLOGY = 4096
var CONFLG_LOCAL = 8192
var CONFLG_LAST = 8193

function Execute(params)
{
	var Source = params.ConValue('Source');
	var Destination = params.ConValue('Destination');
	var Verify = params.ConValue('Verify');

	if(!Source) return
	if(!Destination) return

	if(!pluginInstalled() ) {
		System.Alert("Clintons3dView plugin must be Installed and Loaded.");
		params.SetTerminationFlag();//stop downstream execution
		return;
	}

//	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";
//	}


var utilitydata = System.CreateDO("Clintons3D Package/Utility functions");

	currentnode = Source;
	thedata = utilitydata.GetConnectorData(currentnode);
	connectors = thedata.split("\n");
	for(i=0;i<connectors.length;i++)
	{
	connector = connectors[i].split("\t");
//connector[0] = script connector name
//connector[1] = connector name
//connector[2] = connector type
//connector[3] = flags
	if(connector[3] & CONFLG_IN && !(connector[3] & CONFLG_HIDDEN)) {
//System.Trace(connector[0]);
		if(Node.ConExists(Destination, connector[0])) {
			System.Trace(connector[0]);
			try {
				if(Verify) {
				if(Question("Copy the " + "( " + connector[0] + " )" + " attribute to the Destination?"))
					Node.Value(Destination, connector[0]) = Node.Value(Source, connector[0]);
				}
				else
					Node.Value(Destination, connector[0]) = Node.Value(Source, connector[0]);
			} catch(e) {
//System.Trace("Failed to copy " + connector[0]);
//System.Error("Failed to copy " + connector[0]);
			}
			
		}
	}
}
	Node.ConReset(System.ThisOwner(),"Source")
	Node.ConReset(System.ThisOwner(),"Destination")
}

function pluginInstalled()
{
	// check that plugin is installed and loaded

	var xmldoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
	xmldoc.load(System.GetMainDir() + "\\Scripts\\Plugins.xml");

	var doc = xmldoc.documentElement;

	for(var i=0;i<doc.childNodes.length;i++)
	{
		var child = doc.childNodes.item(i);
		var grandchild = child.childNodes.item(0);
		var NAME = grandchild.getAttribute("NAME");

		if(NAME == "Clintons3D Package") {
			var STATUS = grandchild.getAttribute("STATUS");
			if(STATUS == "LOADED") {
				return true
			}
		}
	}

	//System.Alert("Clintons3dView plugin must be installed and loaded.");

	return false;
}

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;
}

Looks ok to me. The try catch is checking for the existence of the plugin, so it's not needed anymore.
The params.SetTerminationFlag();//stop downstream execution is only needed if another command node is connected to it. It stops the next connected command from running. So if the command node doesn't have any other command nodes connected to it's "Control Out" connector then that command is not needed.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

Okay thanks for the explanation.
I was misunderstanding that the 'stop downstream execution' was from within the script.
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

New Update for trueSpace7.61 Beta 8 Std Unofficial Update
https://united3dartists.com/forum/viewt ... =55&t=3731
RC19 July 28, 2020

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

Copy Attributes
Updated script with plugin check
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Final trueSpace7.61 Beta 8 Std Unofficial Update

Post by trueBlue »

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

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

Widgets
Rotate
Rotate.png
Rotate.png (8.09 KiB) Viewed 2282 times
RMB click the icon to Exit
Additional controls:
* Shift + LMB click in empty 3D Space deactivates Object widgets
Add
* Ctrl + LMB click rotates selected object +45 degrees
* Alt + LMB click rotates selected object -45 degrees

Toolbars
Workspace File Menu
Help
Update
United 3D Artist button
Changed link to: RsTool.OpenWebPage("www.united3dartists.com/forum");

Special thanks to Clinton Reese for all his help and awesome contributions in this update! :worship:
http://www.clintons3d.com
Post Reply