Notifications
Clear all
[Closed] Attaching shapes
Sep 22, 2008 7:35 pm
Hello,
Ran into a problem.
if i want to attach two shapes together using maxscript how could i go about doing that…
i want to attach two circles together to make a control object… i can do this quite easily manually but it seems to be a bit more of a challenge when using maxscript
for instance if i were to do this manually i would create two circles rotate one and convert it to an editable spline… i can then go into the modify panel and select attach and click on the next object to have them attach
with maxscript i would like to avoid the user end of things and just have them attach, how could i do this?
2 Replies
Sep 22, 2008 7:35 pm
This code may help…
firstObj = objs[1]
disableSceneRedraw()
try
(
-- Convert First Object
convertTo firstObj SplineShape
-- Prep Progressbar
progressStart "attachSelectedObjects"
escapeEnable = false
numOfItems = objs.count
currentIteration = 0
-- Start process
for i = 2 to numOfItems do
(
if getProgressCancel() == true then exit
convertTo objs[i] SplineShape
currentIteration += 1
m = ((currentIteration as float)/(numOfItems as float))*100
addandweld firstObj objs[i] -1
progressUpdate m
)
progressEnd()
-- Convert
if centerPivot == true then firstObj.pivot = [(firstObj.max.x+firstObj.min.x)/2, (firstObj.max.y+firstObj.min.y)/2, (firstObj.max.z+firstObj.min.z)/2]
)
catch ()
enableSceneRedraw()
completeRedraw()
Sep 22, 2008 7:35 pm
thank you,
exactly what i was looking for, the addAnWeld command… not the most obvious but it sure does what i want it to