SDK plugin findings

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

SDK plugin findings

Post by clintonman »

I decided to read through every header file in the workspace sdk to see if there was anything interesting.

The first thing I found was a way to fix the quad toolbar popup location. It was a lot of trial and error to get something that worked and the change has already been released.

Another thing I found was the widget sample code.
Again after some dead ends I got mostly what I wanted out of it. I got a way to do a rectangle selection in the viewport. It has 2 flaws in that the rectangle doesn't show in the view and it gets a list of nodes by shooting rays through the rectangle into the scene. It takes too long to shoot a ray through every pixel so they have to be spaced out and small items can be missed.
More exciting than the rectangle selection is I found a way to do true viewport locking of items, so if they are marked as unselectable then they never even get to the point of being selected.
plugin_dev.jpg
circle generated from the SDK and display of rectangle select coordinates to be used in in another SDK function to "ray trace" a selection

I found some NURBS code for generating circles. The large boxes represent the control points. The smaller boxes would be the visual representation of the curve and is also supplied by the SDK code. My curve tools do everything in script from scratch. I plan to use the SDK to replace chunks of the NURBS curve scripts. Also found similar code for NURBS patches so it should be possible to do some patch modeling in workspace.
The SDK NURBS are completely separate from the modelspace curves and patches.

Since I will be making changes I also decided to put the Collada plugin code into it's own package like the FBX import/export plugin. This reduces the size of Clintons3dPlugin.rsx file from about 4 Mb down to less than 1Mb.
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: SDK plugin findings

Post by trueBlue »

Take a look at the Rectangle Zoom widget.
Looks like the rectangle is a semi transparent Static Widget
Render Rectangle Static Widget.png
Please let me know when you release your updated Clintons3dPlugin.rsx file.
Have you noticed any performance increase?
I would like to add it to the Unofficial Updates
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: SDK plugin findings

Post by clintonman »

I expect to publish something in a few hours or tomorrow. It will be the invisible rectangle select and the selection locking widget.
I haven't seen any performance improvements since everything so far has been to small to make any difference. In fact the rectangle select may be slow because it's basically doing a crude ray tracing into the view. Ray tracing is slow. A better solution would be to use bounding box intersections. I didn't see anything in the SDK that does it.
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: SDK plugin findings

Post by trueBlue »

Something like this in the tS761SDK?
IRdVolumeTree Interface Reference

HRESULT IRdVolumeTree::RayIntersection ( [in] RtPoint * p0,
[in] RtPoint * ray,
[out] IRsNodeList ** node
)
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: SDK plugin findings

Post by clintonman »

trueBlue wrote: 21 Sep 2020, 02:24 Something like this in the tS761SDK?
IRdVolumeTree Interface Reference

HRESULT IRdVolumeTree::RayIntersection ( [in] RtPoint * p0,
[in] RtPoint * ray,
[out] IRsNodeList ** node
)
Yep, something sort of like that. That is closer to what I have with a ray tracing approach. There is a similar command that returns a list of everything that's visible in the viewport. You feed it the 6 planes of the view frustum and it returns a list of nodes. The missing piece is creating a volume/6 planes from the 2D rectangle in the view. Actually, 2 of the planes would be easy since it's just the front and back. Getting the other 4 planes would take some math, so I don't see that happening in the near future.
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: SDK plugin findings

Post by clintonman »

widgetLocking.jpg
widgetLocking.jpg (34.05 KiB) Viewed 2473 times
Here's the panel added to the unselectable script.
No releases tonight. Ran into some gotchas while building this. Image below shows one.
widgetDanger.jpg
The locking widget node sits in front of the actual selection node. If the plugin file is not installed then the truespace selection system would be broken.
The disable button needs more r&d to make sure it doesn't break trueSpace in a permanent way. I just realized that a reset context might break the disable button. I think at this point it just needs a backup of the select widget so it can just put back the original if needed.

In any case I think tomorrow is the day.
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: SDK plugin findings

Post by clintonman »

NURBSpatch.jpg
Control point mesh surrounding the resulting NURBS patch


First working NURBS patch for workspace. It took a million hours to figure it out. I can create editable sphere, box, cone/cylinder and torus patches in test form. There is no way for me to create a primitive tool to create them so instead I'll create a conversion tool to convert sphere, box etc. meshes into NURBS patches. The missing piece at this point is editing to add and remove columns and rows from the patch. After that the plan is to import/export NURBS patches from modelspace to use the pre-existing modelspace tools to fill in all the other missing capabilities.

This system should be an improvement over the modelspace nurbs cage plugin for editing patches.

I had to do some weird things to make it work, so further testing is needed to see if it really works or if it will fail in some way, especially on larger patches.
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: SDK plugin findings

Post by clintonman »

nurbsPatchImportAndEditing.jpg
loaded nurbs cylinder from cob file, editing in progress

Those "weird things I had to do to make it work" came back and bit me. So now it's all normal stuff and its working.

Can now load a nurbs patch from a modelspace file into workspace as a true nurbs patch. Next is saving out to modelspace so can use the modelspace nurbs tools.
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: SDK plugin findings

Post by clintonman »

rayIntersectAndMarkers.jpg
Triangle index, point intersection and object name.
More widget goodness on the way.

This new widget will get the triangle index of the mesh under the mouse position on the screen and the point intersection with that triangle in world space coordinates. I believe the triangle plus the intersection point can be used to get a point selection. The backwards "te" and the white triangle are a test of markers that will be used to highlight the selection. Scripting has markers for text, but the triangle can only be done in plugin code.

I hope to use this to improve the face to face snapping and the object vertex snap scripts, by eliminating the need for the tool to take a mesh into point edit mode to perform some of those actions.
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: SDK plugin findings

Post by clintonman »

Spent an entire day on the new widget. Slowly making progress.
Ends up the triangle marker was stuck at the off white color, so I decided to go with lines instead. It can read the mesh triangles and vertices so it can now do hover and apply highlighting effects over the mesh. To do something useful I need to add ctrl and shift inputs to the widget selection and make a change to the data it writes out. Then can move forward with the scripts to use it.
Clinton Reese

http://clintons3d.com
Post Reply