how to get two or more point coordinate on spline at the same time

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  04 April 2009
how to get two or more point coordinate on spline at the same time

how to get two or more point coordinate on spline at the same time ?

Thanks Help!
__________________
fghfgh
 
  04 April 2009
have a peek at pathInterp and lengthInterp; not sure what you mean by "at the same time", though..

Originally Posted by MaxScript docs: Shape Common Properties, Operators, and Methods
pathInterp <shape> [ <curve_num> ] <parameter>
Return a point3 coordinate on the numbered curve (defaults to 1) corresponding to the parameter value (0.0 to 1.0) that matches the 3ds Max Path controller percentage (vertex-based) interpolation.

lengthInterp <shape> [ <curve_num> ] <parameter> [ steps:<integer> ]
Return a point3 coordinate on the numbered curve (defaults to 1) corresponding to the parameter value (0.0 to 1.0) that is that fraction along the curve's total length.
 
  04 April 2009
Hi, ZeBoxx2

The script only get one point coordinate ,If i want to get two point coordinate,How to do
I would like a long time, but no results.

if $ != undefined and subobjectlevel == 1 do
(
UpdateShape $
spline_int = #(0)

for i=1 to numsplines $ do
(
test = getKnotSelection $ i
if test[1] != undefined then spline_int = #(i)
)
knot_index_int = getKnotSelection $ spline_int[1]
knot_point = getKnotPoint $ spline_int[1] knot_index_int[1]
)
__________________
fghfgh
 
  04 April 2009
err.. not entirely sure what your code is supposed to do - but I'm going to guess you want an array of the positions of the currently selected knots?


fn getSelectedKnots = (
	local mySelectedKnotsPositions = #()
	if (((getCurrentSelection()).count == 1) AND (subObjectLevel == 1)) do (
		for i = 1 to (numSplines $) do (
			for knotIndex in (getKnotSelection $ i) do (
				append mySelectedKnotsPositions (getKnotPoint $ i knotIndex)
			)
		)
	)
	mySelectedKnotsPositions
)
getSelectedKnots()
 
  04 April 2009
I mean is get coordinate of the currently selected knots,
your fn back results:

#([-64.2512,-3.77987e-006,86.4734], [-61.3527,-4.43449e-007,10.1449])

I want to get, like this:

[-64.2512,-3.77987e-006,86.4734]
[-61.3527,-4.43449e-007,10.1449]
--------------------------------------------------------
I modify that script but sometimes it can't correctly run
(
if $ != undefined and subobjectlevel == 1 do
(
UpdateShape $
spline_int = #(0)

for i=1 to numsplines $ do
(
test = getKnotSelection $ i
if test[1] != undefined then spline_int = #(i)
)
knot_index_int = getKnotSelection $ spline_int[1]
knot_point = getKnotPoint $ spline_int[1] knot_index_int[1]
)
)

(
if $ != undefined and subobjectlevel == 1 do
(
UpdateShape $
spline_int2 = #(0)

for k=1 to numsplines $ do
(
test2 = getKnotSelection $ k
if test2[2] != undefined then spline_int2 = #(k)
)
knot_index_int2 = getKnotSelection $ spline_int2[1]
knot_point2 = getKnotPoint $ spline_int2[1] knot_index_int2[2]
)
)
__________________
fghfgh
 
  04 April 2009
Hi ZeBoxx2

Thank you very much! I understand !
Use your code


mySelectedKnotsPositions = #()
if (((getCurrentSelection()).count == 1) AND (subObjectLevel == 1)) do (
for i = 1 to (numSplines $) do (
for knotIndex in (getKnotSelection $ i) do (
append mySelectedKnotsPositions (getKnotPoint $ i knotIndex)
)
)
)
mySelectedKnotsPositions
v1 = mySelectedKnotsPositions[1]
v2 = mySelectedKnotsPositions[2]


Thank you once again
__________________
fghfgh
 
  04 April 2009
Yep - correct

Good luck with your script!
 
  04 April 2009
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:16 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.