It seems to be working here. Do you have anything you can share to show it not working?trueBlue wrote: ↑14 Jan 2021, 12:32This is not working for ShortcutstrueBlue wrote: ↑11 Jan 2021, 23:20So far I have fixed these toolbar commands for the Navigation toolbarclintonman wrote: ↑11 Jan 2021, 05:57 Are you also planning to put restrictions on all the other tools too? I see many that will probably not work properly with nurbs.
Skeleton tools
Paint a material on a curve, or the control meshes
Hair tool on cp meshes.
SDS tool
any editing tool that would change the mesh
several of the custom tools
etc.
Simplify Mesh
Build Normalmap
ChangeSSLevel(1)
ChangeSSLevel(-1)
Reset SDS
Heal Vertices
Scissors
PE Poly draw
PE Edge draw
PE Vertex draw
Sub Divide
Smooth Divide
Hair Length
Hair Blowdryer
Hair Softness
Hair Direction
Hair Density
Add Morph
Paint Face
Material Editor
D3D & VRay Paint Face
I do not see anything else that causes problems for Patches nor Curves
If I am missing something, give me steps and what to look for
As an example for Add SDS in PE mode
Node.Value("Scripts/Commands/RestrictNURBS", "Cmd") = "MeshModifiers.ChangeSSLevel(1)";Activity.Run("Scripts/Commands/RestrictNURBS");
Best I can tell, the first part using Node.Value does not work for Shortcuts
Activity.Run does work for Shortcuts
Assigning the shortcut does not work either
New NURBS tools
- clintonman
- Captain
- Posts: 5428
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: New NURBS tools
- spacekdet
- Captain
- Posts: 1799
- Joined: 27 May 2009, 15:00
- Type the number ten into the box: 10
- Location: On the day shift at the Utility Muffin Research Kitchen
- Contact:
Re: New NURBS tools
Είναι όλα ελληνικά για μένα
Re: New NURBS tools
Me too
Code: Select all
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- clintonman
- Captain
- Posts: 5428
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: New NURBS tools
Here is an update of the RunCommand script that has an alternate way of calling it. The previous way of calling also still works.
Code: Select all
obj={cmd:"MeshModifiers.SimplifyMesh('')",RsApp:RsApp,Node:Node};RsApp.SendCustomEvent("Scripts/Commands/RunCommand", obj);
Code: Select all
obj={cmd:"MeshModifiers.ChangeSSLevel(1)",RsApp:RsApp,Node:Node};RsApp.SendCustomEvent("Scripts/Commands/RunCommand", obj);
- Attachments
-
- RunCommand.RsObj
- (7.31 KiB) Downloaded 156 times
Re: New NURBS tools
Implemented your new way and it works using scripts and toolbar commands but I am not able to get a shortcut to work
Had to modify the script to get it to import correctly from a xml file
First of all you had a typo with the evetData
Node = evetData.Node;
Correct
Node = eventData.Node;
Lots of other tweaks as well
If you want me to explain the process, I will try
One of the main changes is replacing params to ret
Or you can study the xml files included here
The two shortcuts are for Add SDS & Subtract SDS
Also Shift L for Workspace Layers
Best to replace the two xml files in the tS761 directory and Reset the Default Context(Required) to import the RestrictNURB into Commands internally
After that you can copy the code from the Scripts/Commands/RestrictNURB and paste it into a jScript
Button command for Add SDS
Also includes the new CloseORASettings.xml file
Edit: I created new script by way of Exporting the script using params and that works as well, so scratch using ret
The only difference is when Exporting is there is no GUID
Still can not get the shortcut to work
And NOW my SpaceBar shortcut does not WORK!!! Every time I edit the shortcut xml file and add the above shortcut, they both will not WORK
Also notice with this new way the CmdName never enters the Command
Had to modify the script to get it to import correctly from a xml file
First of all you had a typo with the evetData
Node = evetData.Node;
Correct
Node = eventData.Node;
Lots of other tweaks as well
If you want me to explain the process, I will try
One of the main changes is replacing params to ret
Or you can study the xml files included here
The two shortcuts are for Add SDS & Subtract SDS
Also Shift L for Workspace Layers
Best to replace the two xml files in the tS761 directory and Reset the Default Context(Required) to import the RestrictNURB into Commands internally
After that you can copy the code from the Scripts/Commands/RestrictNURB and paste it into a jScript
Button command for Add SDS
Code: Select all
obj={cmd:"MeshModifiers.ChangeSSLevel(1)",RsApp:RsApp,Node:Node};RsApp.SendCustomEvent("Scripts/Commands/RestrictNURBS", obj);
Edit: I created new script by way of Exporting the script using params and that works as well, so scratch using ret
The only difference is when Exporting is there is no GUID
Still can not get the shortcut to work
And NOW my SpaceBar shortcut does not WORK!!! Every time I edit the shortcut xml file and add the above shortcut, they both will not WORK
Also notice with this new way the CmdName never enters the Command
- Attachments
-
- RestrictNURBS.zip
- (6.49 KiB) Downloaded 158 times
- clintonman
- Captain
- Posts: 5428
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: New NURBS tools
What is ret?
Are you saying none of the shortcuts work or that 4 of the shortcuts don't work?trueBlue wrote: ↑15 Jan 2021, 13:09 Implemented your new way and it works using scripts and toolbar commands but I am not able to get a shortcut to work
...
The two shortcuts are for Add SDS & Subtract SDS
Also Shift L for Workspace Layers
...
Still can not get the shortcut to work
And NOW my SpaceBar shortcut does not WORK!!! Every time I edit the shortcut xml file and add the above shortcut, they both will not WORK
Did you try assigning the shortcut using the shortcut dialog to see how it differs from your manual shortcut edit?
Sorry about that, must have posted an old version
Re: New NURBS tools
What I do first is fix the toolbar button commands and save the toolbars
Test to see that they work
Manually edit the shortcut file with the same commands
So far I have only tried two shortcuts +SDS & -SDS
So far with the previous way & the newer way, every time I test the modified shortcuts, the Spacebar shortcut (probably others) stop working!
I have been editing the shortcut file this way for several years without issues.
I have made a point NOT to use tS761's shortcut dialog because, number 1, it makes a mess of the file and 2, there is several toolbars with the same icons/buttons. My concern is, if I did it this way which would be very time consuming, there is the very possibility of failure!
The shortcut dialog captures the toolbar's Name, the Help text, and the context, and if this is different from the toolbar and toolbar button, the shortcuts do not work!
I suspect that this new way is not even using the script's CmdName string because it is always blank.
What is the Script Buffer?
RsApp.RunScriptBuffer(eventData.cmd);
Test to see that they work
Manually edit the shortcut file with the same commands
So far I have only tried two shortcuts +SDS & -SDS
So far with the previous way & the newer way, every time I test the modified shortcuts, the Spacebar shortcut (probably others) stop working!
I have been editing the shortcut file this way for several years without issues.
I have made a point NOT to use tS761's shortcut dialog because, number 1, it makes a mess of the file and 2, there is several toolbars with the same icons/buttons. My concern is, if I did it this way which would be very time consuming, there is the very possibility of failure!
The shortcut dialog captures the toolbar's Name, the Help text, and the context, and if this is different from the toolbar and toolbar button, the shortcuts do not work!
I suspect that this new way is not even using the script's CmdName string because it is always blank.
What is the Script Buffer?
RsApp.RunScriptBuffer(eventData.cmd);
- clintonman
- Captain
- Posts: 5428
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: New NURBS tools
I'm not suggesting you give up maually editing the shortcuts file, just saying do 1 shortcut via the dialog to see if there is a difference. If you see a difference then you can use that knowledge to manually edit the file.trueBlue wrote: ↑15 Jan 2021, 16:56 What I do first is fix the toolbar button commands and save the toolbars
Test to see that they work
Manually edit the shortcut file with the same commands
So far I have only tried two shortcuts +SDS & -SDS
So far with the previous way & the newer way, every time I test the modified shortcuts, the Spacebar shortcut (probably others) stop working!
I have been editing the shortcut file this way for several years without issues.
I have made a point NOT to use tS761's shortcut dialog because, number 1, it makes a mess of the file and 2, there is several toolbars with the same icons/buttons. My concern is, if I did it this way which would be very time consuming, there is the very possibility of failure!
The shortcut dialog captures the toolbar's Name, the Help text, and the context, and if this is different from the toolbar and toolbar button, the shortcuts do not work!
I suspect that this new way is not even using the script's CmdName string because it is always blank.
What is the Script Buffer?
RsApp.RunScriptBuffer(eventData.cmd);
Also watch out for single quotes vs double quotes.
A buffer is usually just a kind of temporary storage. So in this case the eventData.cmd is placed into the buffer and then run from there.
Re: New NURBS tools
Okay, I tried applying +SDS to the WORKSPACENAV toolbar
The shortcut works for a 3D object and a NURBS but the NURBS was damaged from the +SDS
So I am at a loss here
I am guessing that the script is not running, that only the tS command is running.
How did you get success?
As said, I have success with this new way form a jScript, toolbar command, but not a shortcut
I have another idea
How do you turn this first part of the script shown below into an if else?
if(IsNURBS(Sel)) {
return;
}
If possible just and an Alert to the else part
Code: Select all
<RS_ACC KEY="ADD" GROUP="WORKSPACENAV" CONTEXT="" DESC="+ SDS - Add SDS" COMMAND="obj={cmd:"MeshModifiers.ChangeSSLevel(1)",RsApp:RsApp,Node:Node};RsApp.SendCustomEvent("Scripts/Commands/RestrictNURBS", obj);" />
So I am at a loss here
I am guessing that the script is not running, that only the tS command is running.
How did you get success?
As said, I have success with this new way form a jScript, toolbar command, but not a shortcut
I have another idea
How do you turn this first part of the script shown below into an if else?
if(IsNURBS(Sel)) {
return;
}
If possible just and an Alert to the else part
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)) {
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
}
- clintonman
- Captain
- Posts: 5428
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: New NURBS tools
Because the new way doesn't use it.