Home Technical Talk

[MAXScript] Rename a modifier

I thought this would be easy top dig up but I cannot for the life of me...

Given this:
tMod = turbosmooth()
addModifier $ tMod
tMod.name = "myTurbosmooth"

That will change the internal name of the modifier to "myTurbosmooth" but the display name in the modifier panel will still read "Turbosmooth". How can I change the display name instead of the internal name?

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    tMod = turbosmooth()
    tMod.name = "myTurbosmooth"
    addModifier $ tMod
    

    Works for me, but I have to deselect and reselect the object in the viewport. If you change the order of commands it'll rename it before it appears in the mod panel.
  • McGreed
    Options
    Offline / Send Message
    McGreed polycounter lvl 15
    Your problem isn't that the modifier doesn't get renamed/updated, but that the UI doesn't update (test by running your script again, and then deselect and select your object again).

    Disable the update for the UI while running the script and activate it again, should fix it. Like this:
    suspendEditing which:#modify
    tMod = turbosmooth()
    addModifier $ tMod
    tMod.name = "myTurbosmooth"
    resumeEditing which:#modify
  • WarrenM
    Options
    Offline / Send Message
    Oh, haha ... well, that was dumb. Thanks guys! :-/
Sign In or Register to comment.