Home Technical Talk
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

MaxScript - Spline Knot - Reset Tangents

greentooth
Offline / Send Message
marks greentooth
I'm trying to access this function via maxscript, but I can't find it documented anywhere at all :( and the quad menu is a dead end. Anybody used this before, or know where I should start looking?

resettangents.jpg

Replies

  • miauu
    Offline / Send Message
    miauu polycounter lvl 15
    Watch [ame="http://www.youtube.com/watch?v=auloqB-0bBo"]this video[/ame]

    This is the code:
    1. (
    2. curObj = selection[1]
    3. if classOf curObj == splineShape or classof curObj == Line then
    4. (
    5. -- get the indexes of selected knots
    6. selKnot = getKnotSelection $ 1
    7. if selKnot.count != 0 then
    8. (
    9. -- get knot type
    10. knotType = for k in selKnot collect (getKnotType $ 1 k)
    11. if selKnot != undefined do
    12. (
    13. for i in selKnot do setKnotType $ 1 i #smooth
    14. updateshape $
    15. )
    16. -- set the knot type
    17. for k=1 to knotType.count do setKnotType $ 1 selKnot[k] knotType[k]
    18. updateshape $
    19. )
    20. else
    21. messagebox "Select some knots!" title:"miauu Script Error!!!"
    22. )
    23. else
    24. messagebox "Select only one spline!" title:"miauu Script Error!!!"
    25. )
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    miauu: you could add this link from polycount in the description of the YT video.
  • miauu
    Offline / Send Message
    miauu polycounter lvl 15
    renderhjs, the link is added to the description.
    marks,is the code work for you or not? Now I see that the script can be optimized -there is no need for second check of selKnot.
  • marks
    Offline / Send Message
    marks greentooth
    Funnily enough thats exactly what our TA suggested trying, convert knot type to smooth and then back to bezier. I'll need to hack up the code to plug it into another function but it looks like it should work fine, thanks for the help - much appreciated.
Sign In or Register to comment.