Notifications
Clear all

[Closed] Simple MAxScript – Copy vertex coords

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

2 Replies

my messy version 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