Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

View Spline Knots Coordinate Values

View Spline Knots Coordinate Values

Anonymous
Not applicable
1,789 Views
9 Replies
Message 1 of 10

View Spline Knots Coordinate Values

Anonymous
Not applicable

So I have a Spline3D with knots on it. The values of these knot points are then extracted using GetKnot(i).Knot() which returns the point location (in Point3 form) for the i-th knot.

 

Now when I load this spline on 3ds max and I choose "select and move" on a knot point/vertex, I can see values on the Coordinate Display: 

getchamor_1-1587000068863.png

 

However, the extracted point location using GetKnot(i).Knot() is different from the values showing in the Coordinate Display, regardless of what Reference Coordinate System I choose (local, view, screen, etc).

 

e.g. first extracted point location using GetKnot(i).Knot() is [-297.29, 223.29, 925] but the values in the Coordinate Display differ (pictured above).

 

My questions are:

1. Is it actually possible to view the extracted point location (one obtained using GetKnot(i).Knot()) inside 3ds max UI?

2. If yes, am I checking the correct display window (Coordinate Display)? Or is there a different window/panel for this? If there is, I am hoping you would guide me to the right window/panel. 

3. If it should be viewable in the Coordinate Display, am I missing some settings/configuration which is causing the mismatch on the values that I am seeing?

4. Lastly, if ever I find the way to view this extracted point location, are the coordinate values modifiable inside 3ds max UI? <- Actually this is my final need: to manually modify the extracted point locations by editing the coordinate values in 3ds Max UI.

 

Any info or tip would be of great help. Thanks!

0 Likes
Accepted solutions (2)
1,790 Views
9 Replies
Replies (9)
Message 2 of 10

istan
Advisor
Advisor
C++ ?
0 Likes
Message 3 of 10

Anonymous
Not applicable

yes c++. sorry about that I forgot to mention it.

0 Likes
Message 4 of 10

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

You must get the Knot point and translate it using the transform of the node's object transform ((Point3 * Matrix3) or Matrix3::PointTransform(Point3)).
Spline3D knot value is in local space.You need the world position, which is displayed in the MAX transform type-in controls

0 Likes
Message 5 of 10

istan
Advisor
Advisor

Yep. MXS behaves in this detail different..

0 Likes
Message 6 of 10

leeminardi
Mentor
Mentor
Accepted solution

Check that your system units and display units are the same. Set the coordinate to world to world and then compare your script coordinate values to the world coordinates. 

image.png

lee.minardi
0 Likes
Message 7 of 10

istan
Advisor
Advisor

Wasn't he talking about C++ code?

0 Likes
Message 8 of 10

leeminardi
Mentor
Mentor

Yes but he was trying to verify the coordinates he was getting in his program with the coordinates he sees on the screen.  Screen coordinates will not agree with GetKnots coordinates  if the system and display units are not the same.

lee.minardi
0 Likes
Message 9 of 10

domo.spaji
Advisor
Advisor

Animate some spline verts and compare values in UI and curve editor.

0 Likes
Message 10 of 10

Anonymous
Not applicable

Hi all,

 

So I tried the following based on your suggestions:

1. @leeminardi I made sure that unit display and system display are in sync. Before the unit display was in meters but my system unit is in millimeters, so I changed the unit display to millimeters.

2. @denisT.MaxDoctor I performed Matrix3::PointTransform() for the knot points using the GetObjectTM() for the matrix.

 

I can now see the extracted values from the code in the Coordinate Display! Thanks a lot!

0 Likes