New NURBS tools

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

Re: New NURBS tools

Post by clintonman »

I found a workaround for those nurbs primitives.
The tesselation has an effect on how it converts the mesh.
To get good quad result the U precision has to be an even number and the V precision has to be an odd number and it has to be single sided.
Clinton Reese

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

Re: New NURBS tools

Post by trueBlue »

Ah...I see
Are you planning an update?

Also, I found a way to stop Hair & Material from being applied to Lights & Cameras

So I thought, if I could modify the DeSelectNURBS script to include Hair, Lights & Cameras, I would not have to go back and fix all of the icon's/button's commands
DeSelectNURBS script
Edit: Got it!
By adding this to the IsNURBS(curNode) Function

Code: Select all


	if(Node.ConExists(curNode, "Camera")) {
		return true;
	}

	if(Node.ConExists(curNode, "TSLightProperties")) {
		return true;
	}

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

Re: New NURBS tools

Post by clintonman »

NURBStoolbar2.jpg
I've started updating the installer version of the NURBS tools to be on par with the Unofficial Updates version. While updating I decided to make some changes.
The toolbar above shows new icons for "Select Control Point Mesh", "Copy NURBS", "Delete NURBS", "Weld NURBS" and "NURBS Primitives".
The "Adjust Floaters" button is gone and is run from the utilities panel. The old select/utitlies button is now only utilities. The "NURBS Info" has also been moved into the utilities panel as the default and the original default panel functions were moved into the Misc panel.

Nothing really new at this point. Only new icons and reorganization of some panels. The only real change is that the copy function will select the copy instead of maintaining the original selection and when opening the utilities panel it will read the state of the Protect NURBS.

When I started I thought these scripts had already been converted to more undo friendly format. So after testing the current changes, that will be next.

Edit(s):
Changed the extend curve so that the new control handle is selected after the run.
Forgot to mention the first set of changes reduced the size of the scripts by 275kb.
Changes status display to use plugin based code.
Changed auto control point mesh selection to use a widget instead of selection change event node
Circles now have a check to make sure the same point isn't selected twice which would give an error.
Added missing nurbs name display to the rebuild nurbs panel
Split NURBS patch do not run on border edges
Fixed a bug in the split nurbs patch that gave bad looking handles when split in one direction, the other direction already gave a good result
Rename split patch result and select one of the patches
Sent bug report for plane loop select script

Testing complete for the basic conversion. Next up will be to make the undo friendly changes.
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: New NURBS tools

Post by clintonman »

Starting a new list of changes.

can convert double sided patches to normal polygon mesh, freeze it
checks patch for odd u precision or even v precision values when freezing a patch - gives question with option to adjust precision for good quad result
primitives sphere, cylinder and cone will freeze cleanly by default - other primitives are already ok for freezing
Fix Curve Mesh BB - added code to center the mesh origin
Fix Bug in polygon to curve script that gave bad result or crashed truespace - when reading selection data must read mesh from Editable shape node Input Mesh connector
Weld Nurbs - mesh origin to the center of the mesh and fix a "jumping" bug where welded object is in a different location than the original meshes
Clinton Reese

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

Re: New NURBS tools

Post by trueBlue »

If I accidentally select the Draw Curve toolbar button, the widget starts
If I right click to stop the widget, a curve is created
I think you need to add the following to the widget's End script
ScriptObject.RunCmd("graph package/conreset command", "Node", "/Scripts/CustomCommands/PickSelect/data", "Con", "NodeSelData")
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: New NURBS tools

Post by clintonman »

trueBlue wrote: 20 Jul 2021, 14:13 If I accidentally select the Draw Curve toolbar button, the widget starts
If I right click to stop the widget, a curve is created
I think you need to add the following to the widget's End script
ScriptObject.RunCmd("graph package/conreset command", "Node", "/Scripts/CustomCommands/PickSelect/data", "Con", "NodeSelData")
Thanks, fixed.
Added Node.Value(pickselect, "NodeSelData") = ""; to the start script
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: New NURBS tools

Post by clintonman »

Added request from trueBlue - when nurbs control point is selected via the auto control point selection, the patch panel will show and the curve shaper panel will show with the control point mesh panels.

Attached is what I have so far so you(trueBlue) can see if this was really what you were asking for.
the Default context widget reads the auto cp mesh flag from the utilities node and ignores it's own active input - attached goes inside /Widgets/Edit/ replacing the Default context
Attachments
Default context.RsObj
(70.48 KiB) Downloaded 128 times
NURBSScripts.RsObj
(2.65 MiB) Downloaded 116 times
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: New NURBS tools

Post by clintonman »

Removed buttons Select, Edit, and Navigate
Added "Select LOD Mesh" buttons so that visibility can be controlled and for assigning materials to the patch.
Un-exported the Invisible connector for the curve node and exported the ORA panel, so it's more like other tS objects. Both curves and patches are setup this way now.
Fixed the DrawCurve so it works with the new curve node.
Added the command

Code: Select all

Activity.Run(Node.Owner(System.ThisOwner()) + "/NURBSUtilities/Show NURBS Panel With CP Mesh");
to the exitcurvemode2 so all the panels show
OpenToolbar added warning if rsx plugin not installed.

Edit:
NURBS Info panel uses plugin based utility scripts to prevent and reduce the number of undos
NURBS auto control point mesh selection more undo friendly
Copy and Delete more undo friendly
Draw Curve more undo friendly, new: if click close to the starting point the curve will be "closed" - handles at start and end will line up, changed curve default to "opened" isaCurve=0, closed or not depends on PickSelect node Min Distance
points and polygon to nurbs more undo friendly and opens extra nurbs panels
circle more undo friendly and opens extra nurbs panels
all circle tools updated
extract curve and extend curve updated
insert control point, delete control point updated
rebuild nurbs updated
align handles updated
split nurbs updated

weld nurbs updated
create primitives updated
skin surface updated
rail and birail updated
lathe, extend patch, refine patch/add isocurve, unrefine patch/remove isocurve

Edit:

all tools have been updated to be more undo friendly
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: New NURBS tools

Post by clintonman »

The final addition is almost done. It has 2 new tools.
Grow selection for NURBS will grow a selection and restrict it to the handles.
Origin to control center will place the origin at the control point of the selection. So if a control handle edge or point is selected the origin will be placed at its control point.
TODO create toolbar button for this and then finish up with a few other things(Deselect nurbs, protect nurbs, main copy and delete, default context widget).
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: New NURBS tools

Post by clintonman »

Added a Fix Render Attributes button to the utilities panel. If the original Show Object Attribs button is used on NURBS it messes up their appearance. This fixes it.
Clinton Reese

http://clintons3d.com
Post Reply