PDA

View Full Version : Simple MAxScript - Copy vertex coords


gmz1982
04-04-2006, 08:13 PM
Hi everybody!

I'm a newbie here and am Hungarian, so sorry for language
mistakes...

I simply don't have time for learning MaxScript since I work
at two places and have quite little time for modelling, but
I needed a simple button on the UI ( actually two buttons)
to - let me explain...:

1. You select a spline and turn on sub-object level, then goes the trick: One button which copies the coordinates of a vertex of a spline
2. You can select an other vertex, then press another button which pastes the previously copied coordinates into this vertex's data

so I need two buttons ( copy and paste ) to make two
different vertexes into one place...

Please, help me....
Thanks in advance

decon
04-06-2006, 08:20 AM
Take a look at scriptspot, http://www.scriptspot.com/download.asp?ID=3341 and another http://www.scriptspot.com/download.asp?ID=3342

cheers,
decon

losbellos
04-07-2006, 02:03 PM
my messy version :D Works on any shape wich have more spline in it as well.
l


/*
written by Los Bellos
*/

ClearListener()
global knot_point = #()

rollout cp "copy paste"

(
button copybutt "c" pos:[5,6] width:12 height:16
button pastebutt "p" pos:[22,6] width:12 height:16

on copybutt pressed do
(
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]
)
)

on pastebutt pressed do
(
if $ != undefined and subobjectlevel == 1 do
(
UpdateShape $
spline_int_s = #(0)

for h=1 to numsplines $ do
(
test_s = getKnotSelection $ h
if test_s[1] != undefined then spline_int_s = #(h)
)
knot_index_int_s = getKnotSelection $ spline_int_s[1]
setKnotPoint $ spline_int_s[1] knot_index_int_s[1] knot_point
UpdateShape $
)
)
)

if copypaste != undefined do
(
closerolloutfloater copypaste
)
copypaste = newRolloutFloater "CP" 120 60
addRollout cp copypaste

CGTalk Moderation
04-07-2006, 02:03 PM
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.