Message 1 of 3
attach to face using attachment contraint

Not applicable
03-31-2008
10:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i'm writing a script to attach a dummy object to the face of another object using the attachment constraint. here is what i have so far:
i'm stuck at the very end. i have searched through the max help files and documentation as well as online but i can't find the maxscript commands for the attachment constrain settings, mainly the object to attach, the face, and the A and B nodes associated with the attachment constrains
the reason I'm using the attachment constraint over a position script constraint is because the position script constrain doesn't seem to updates continuously, it only updates during playback.
rollout face_linker "Link to Face"(
Group "Pick Parent Face" (
pickButton parent_PkBtn "Pick Parent Object"
label Parent_lbl "Parent Object: (none selected)"
label getface_lbl ""
Button parentFace_Btn "Grab Face" enabled: off
label parentFace_lbl "Face Number: (none selected)"
)
Group "Creat Dummy-Child"(
label dummyname_lbl "Name of new Dummy-Child object"
edittext dummy_txt "" fieldWidth:200
button createDummy_btn "Create Dummy Child" enabled: off
)
Group "About"(
button help_btn "Help" pos: width: 50
button about_btn "About" pos: witdh: 50
)
--Button comamnds:
on parent_PkBtn picked obj do (
parentOBJ = obj
select parentOBJ
modPanel.addModToSelection (Mesh_Select ()) ui:on
subobjectLevel = 3
getface_lbl.text = "select a face, then press 'Grab Face'"
Parent_lbl.text = "Parent Object: " + parentOBJ.name
parentpicked = true
if parentpicked == true do parentFace_Btn.enabled = on
)
on parentFace_Btn pressed do (
select = parentOBJ
parentFace = (getFaceSelection $) as array
if parentFace.count > 0 do (
facenum = (parentFace)
parentFace = (facenum as string)
parentFace_lbl.text = "Face Number: "+ parentFace
)
subobjectLevel = 0
deleteModifier $ 1
facepicked = true
if facepicked == true do createDummy_btn.enabled = on
)
on createDummy_btn pressed do(
if dummy_txt != "" do (
new_obj = dummy ()
dummyname = dummy_txt.text + "_"
new_obj.name = (uniquename dummyname)
new_obj.pos.controller = Attachment ()
)
)
)
if MainFloater != undefined do(
closerolloutfloater MainFloater
)
MainFloater = newRolloutFloater "Link to Face" 250 310
addrollout face_linker MainFloater
i'm stuck at the very end. i have searched through the max help files and documentation as well as online but i can't find the maxscript commands for the attachment constrain settings, mainly the object to attach, the face, and the A and B nodes associated with the attachment constrains
the reason I'm using the attachment constraint over a position script constraint is because the position script constrain doesn't seem to updates continuously, it only updates during playback.