I found an easier way for fixing the unsupported Workspace tool's toolbar button Command
Example for
+ SDS button Command
Code: Select all
ScriptObject.Execute("Scripts/Commands/DeSelectNURBS");MeshModifiers.ChangeSSLevel(1)
It is easier because all I have to do is add the first part to the beginning of the Command
I bet you could even come up with a script that does that for me
The
DeSelectNURBS xml file/script
Code: Select all
function Execute(params)
{
// validate to avoid tS script selection bug
if(!IsValidSelection(Node.Selection())) {
return;
}
for (var i=0; i<Node.SelectedCount(); i++) {
var Sel = Node.Selected(i);
if(IsNURBS(Sel)) {
if(!Node.Exists("/Status Message")) return;
Node.Value("/Status Message", "Seconds") = 2000
Node.Value("/Status Message", "Message") = " NURBS are not supported ... Select a 3D Object"
Activity.Run("/Status Message/Status Message")
Space.Unselect()
return;
}
}
}
function IsValidSelection(selection)
{
if(!selection) return false;
var reWhiteSpace = /^\s/; // whitespace in first character position for cleaning selection text
var selectionArray = selection.split(";");
for(var i = 0; i < selectionArray.length; i++) {
var selClean = selectionArray[i].replace(reWhiteSpace, "");
if(!Node.Exists(selClean)) {
return false;
}
}
return true;
}
function IsNURBS(curNode)
{
var nurbsNode = curNode;
if(Node.ConExists(curNode, "Matrix"))
nurbsNode = Node.Owner(curNode);
if(Node.ConExists(nurbsNode, "isaCurve")) {
return true;
}
if(Node.Exists(nurbsNode + "/CP to patch CP")) {
return true;
}
return false
}