Match Scale syntex

Match Scale syntex

Anonymous
Not applicable
909 Views
8 Replies
Message 1 of 9

Match Scale syntex

Anonymous
Not applicable
Hi,
I am new to max script.
I have take sphere with 50.0 radius.
Spline circle take with 25.0 radius then convert it to editable spline.
I want to match scale of circle to the sphere.
Can anybody help in find out proper syntax for this ?

Thanx in advance
0 Likes
910 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
something like
s = sphere radius:50
c = circle radius:25
convertToSplineShape c

------------------
c.scale =

-- or ------------
bb = c.max - c.min
c.scale.x *= s.radius / bb
c.scale.y *= s.radius / bb
0 Likes
Message 3 of 9

Steve_Curley
Mentor
Mentor
With all the usual caveats about not scaling at the object level. May not be relevent in this specific case but it's worth pointing out.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 4 of 9

Anonymous
Not applicable
I know what you mean, but did you have better idea for scaling shapes?
(i exclude processing knots as option as its too complicated)
0 Likes
Message 5 of 9

Anonymous
Not applicable
If that help, here is a script online "Resize Splines From First":
http://www.scriptspot.com/3ds-max/scripts/resize-splines-from-first
0 Likes
Message 6 of 9

Steve_Curley
Mentor
Mentor
That would be the "proper" way I suppose, but indeed complicated.
An alternative might be to use ResetXForm<node> then CollapseStack<node> - the equivalent of what would normally be done in the viewports.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 7 of 9

Anonymous
Not applicable
I have tried this script:


s = sphere radius:50
c = circle radius:25
convertToSplineShape c

bb = c.max - c.min
c.scale.x *= s.radius / bb
c.scale.y *= s.radius / bb

But spline shape not matched remain as it is.

c.scale = works but for unknown parameter mesh
what should i do?

Thank you
0 Likes
Message 8 of 9

Anonymous
Not applicable
Yep, there is little maths mistake, next is correct:
c.scale.x *= (s.radius * 2) / bb
c.scale.y *= (s.radius * 2) / bb
and what "unknown parameter mesh" means? If your object is strored in variable then access it '.scale' prop using varName.scale, if you work on selected object then selection.scale
0 Likes
Message 9 of 9

Anonymous
Not applicable
Thank you so much
0 Likes