Home Technical Talk

[3dsMax script] Create point based on vertex ID

polycounter lvl 7
Offline / Send Message
dg3duy polycounter lvl 7
I'm using a script to create points in the vertices just by changing the ID number creates the points.
The question is how to create a menu where the user can add the ID number where the point is going to be created?


fn attachObjectToVertex objToAttach targetMesh vertexIndex =
(

controlador= attachment()
pot.pos.controller = controlador
controlador.node = btn_OBJECT.object
controlador.align = false
addnewKey controlador 0f
posicionAttach= attachCtrl.getKey controlador 1
theMesh = snapshotAsMesh btn_OBJECT.object
theFaces = (meshOp.getFacesUsingVert btn_OBJECT.object vertexIndex) as array
theFace = getFace btn_OBJECT.object theFaces[1]
posicionAttach.face = theFaces[1]-1
posicionAttach.coord =if theFace.x == vertexIndex then [1,0] else if theFace.y == vertexIndex then [0,1] else [0,0]


)
attachObjectToVertex $point $btn_OBJECT_REFERENCIA 30

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You'll need to make a rollout to give it a UI.
    You can make pretty much any UI event launch your function. 

    It's all covered pretty thoroughly in the maxscript docs. 
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    poopipe said:
    You'll need to make a rollout to give it a UI.
    You can make pretty much any UI event launch your function. 

    It's all covered pretty thoroughly in the maxscript docs. 
    I'm confused by the fact that the current script needs an ID number to work, I think that creating a menu is the least complicated in this case. The issue is how to connect the number entered in the menu and make the script work. Thanks for the help anyway.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You make a UI control for the user to enter the number and feed the value from that control to your function (3rd argument) when it's called by whatever event you want to call it from.

    As I said above,  look in the help.  This is very basic and will be covered in the examples. 

  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    poopipe said:
    You make a UI control for the user to enter the number and feed the value from that control to your function (3rd argument) when it's called by whatever event you want to call it from.

    As I said above,  look in the help.  This is very basic and will be covered in the examples. 

    At the moment I can not make it work, thank you very much for the information.
    I will continue to investigate
Sign In or Register to comment.