Home Technical Talk

XSI + / - smooth function in max, if you know how please tell me,

Hi well basically what the title says, I tried looking for it in the forum without chance, so yeah I want to use + and - commands in the keyboard to go up and down iterations in turbosmooth, like you do in XSI, also toggle turbosmooth on/off if possible but mostly the first feature, so if you know of a script that does this I'll appreciate you show it to me. Thanks.

Replies

  • Ryan Smith
    Options
    Offline / Send Message
    Ryan Smith polycounter lvl 11
    you could just map the "Toggle end result" to the space bar and when you are editing the polygon object you can just hit space to toggle your turbosmooth that way. As for the + and - thing, who cares? just stick 2 or 3 iterations and work like that. Any iteration above 3 is going to look the same anyways, amirite?

    to map space to toggle end result in the modifier stack, go to customize>customize user interface. under category drop down choose modifier stack, then map "Show End Result" to space bar.
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Show end result' for on/off, and here's the two scripts I use for going up/down iterations:
    macroScript TSdivUp
    category: "GregsScripts"
        (
        curObjs = (selection) as array
        count = curObjs.count
        for i in curObjs do
            (
            if (ClassOf i.modifiers[1]) == turbosmooth then
                (
                if (i.modifiers[#TurboSmooth].iterations == 2) then
                    i.modifiers[#TurboSmooth].iterations = 3
                if (i.modifiers[#TurboSmooth].iterations == 1) then
                    i.modifiers[#TurboSmooth].iterations = 2
                if (i.modifiers[#TurboSmooth].iterations == 0) then
                    i.modifiers[#TurboSmooth].iterations = 1
                )
            )
        )
    
    macroScript TSdivDown
    category: "GregsScripts"
        (
        curObjs = (selection) as array
        count = curObjs.count
        for i in curObjs do
            (
            if (ClassOf i.modifiers[1]) == turbosmooth then
                (
                if (i.modifiers[#TurboSmooth].iterations == 1) then
                    i.modifiers[#TurboSmooth].iterations = 0
                if (i.modifiers[#TurboSmooth].iterations == 2) then
                    i.modifiers[#TurboSmooth].iterations = 1
                if (i.modifiers[#TurboSmooth].iterations == 3) then
                    i.modifiers[#TurboSmooth].iterations = 2
                )
            )
        )
    
    They could be improved, but they should work fine so long as your not in the habbit of renaming your modifiers I think. They'll work on the highest turbosmooth modifier applied on the stack only, and can be used on multiple objects at the same time.

    Also, this is really more of a tech-talk subject.
  • j_bradford
    Options
    Offline / Send Message
    j_bradford polycounter lvl 17
    http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm

    There is a function called "modifySubdivIters" which will do just this, via NURMS in editable poly. I like the functionality of this through nurms because it lets you do multiple objects at once and also doesn't go back up the stack if you isolate selection. Just find the toggle in the shotcutkey editor once you install it and you can assign it to + and - . You can also asign ctrl + and alt + to toggle cage and isoline too if you wanted more XSI functions as well.
  • maze
    Options
    Offline / Send Message
    Hi everyone sorry for the late answer, much thanks for taking the time pointing me to those links I will indeed go take a closer look at them! thanks again you rock!!!

    Polyhertz, I am new to macroscripting can you tell me how to load it in max?
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Sure, do this:

    Create a new txt file and paste either one or both scripts into it and save. Then rename the txt file extension (actual file name doesn't matter) to .mcr and in max go to MaxScript>Run script and load the mcr file. Now they should show up in your customize hotkeys menu (customize>customize user interface) under catagory GregsScripts. Just assign whatever hotkeys you want press OK and you'll be set.

    Alternativly, if you dont want to keep a file of them for the future, you can just copy/paste them into the script editor (f11), highlight them, and press shift+enter to install and then setting the hotkeys.

    One other thing you might like to know is in customize>customize user interface, if you go under 'toolbars' intead of 'keyboard' tab you can drag/drop any hotkeyable command as a button onto maxs toolbar at the top.
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi Greg, I hope you don't mind if I've just taken the liberty to refine your code. It does exactly the same as yours, working on the topmost TurboSmooth if available, limited to iteration level 3.
    macroScript TSdivUp
    category: "GregsScripts"
    (
        local theSelection = Selection as Array
    
        for theNode in theSelection where (validModifier theNode TurboSmooth) do
        (
            local modSet = false
    
            for theMod in theNode.Modifiers where ((classOf theMod) == TurboSmooth) while (modSet == false) do
            (
                if (theMod.iterations < 3) do
                    theMod.iterations += 1
    
                modSet = true
            )
        )
    )
    
    macroScript TSdivDown
    category: "GregsScripts"
    (
        local theSelection = Selection as Array
    
        for theNode in theSelection where (validModifier theNode TurboSmooth) do
        (
            local modSet = false
    
            for theMod in theNode.Modifiers where ((classOf theMod) == TurboSmooth) while (modSet == false) do
            (
                if (theMod.iterations > 0) do
                    theMod.iterations -= 1
    
                modSet = true
            )
        )
    )
    
  • maze
    Options
    Offline / Send Message
    Polyhertz thanks again for your time dude, I appreciate it!!!
  • maze
    Options
    Offline / Send Message
    syncviews I actually used your improved version, thanks a lot
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Personally i prefer this. Its a little slower than turbo smooth but requires no stack. Drag and drop onto the UI and it will Toggle Smoothing on any editable poly
    if(classof selection[1] == editable_poly) then
    (
     selection[1].surfSubdivide = (not selection[1].surfSubdivide)
    )
    

    I added this to the script above. now it will work with NURMs if no modifier is found.
    macroScript TSdivUp
    category: "GregsScripts"
    (
        local theSelection = Selection as Array
    
        for theNode in theSelection where (validModifier theNode TurboSmooth) do
        (
            local modSet = false
    
            for theMod in theNode.Modifiers where ((classOf theMod) == TurboSmooth) while (modSet == false) do
            (
                if (theMod.iterations < 3) do
                    theMod.iterations += 1
    
                modSet = true
            )
    		if (modSet == false) and (classof theNode == editable_poly) then
    		(
    			
    			theNode.surfSubdivide = true
    			if(theNode.iterations < 3) then
    			(
    				theNode.iterations +=1
    			)
    		)
        )
    )
    
    macroScript TSdivDown
    category: "GregsScripts"
    (
        local theSelection = Selection as Array
    
        for theNode in theSelection where (validModifier theNode TurboSmooth) do
        (
            local modSet = false
    
            for theMod in theNode.Modifiers where ((classOf theMod) == TurboSmooth) while (modSet == false) do
            (
                if (theMod.iterations > 0) do
                    theMod.iterations -= 1
    
                modSet = true
            )
    		if (modSet == false) and (classof theNode == editable_poly) then
    		(			
    			if(theNode.iterations > 0) then
    			(
    				theNode.iterations -=1
    			)
    			theNode.surfSubdivide = (theNode.iterations > 0)
    		)
        )
    )
    
    
  • SyncViewS
    Options
    Offline / Send Message
    SyncViewS polycounter lvl 13
    In my experience NURMS subdivision is quite slower than TurboSmooth. Anyway you don't need a custom script to toggle it. It can be found in Customize > Customize User Interface... under Category: Editable Polygon Object, Action: NURMS Toggle (Poly). It is also available in default quad menu for Editable Poly Objects, Panel: Tools 1
  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Totally, its much slower. I find more convenient to work with when im modelling though. Generally i work with smoothing off and toggle it on for a preview and then disable it, I collapse the stack alot so i end up constantly having to add new modifiers which is a pain. I find Nurms is nice for a quick preview. Once im done modeling i use TS. Its just a preference really. I liked the script and added Nurms to it so i figured id post it for anyone else with the same preference.

    I find it especially annoying that there isnt an option to use TS as part of the Epoly
  • CodeFather
Sign In or Register to comment.