Home Technical Talk

Altering pivot point in Max

easterislandnick
polycounter lvl 17
Offline / Send Message
easterislandnick polycounter lvl 17
Hi, Is it possible to quickly move or rotate the pivot in max whilst in sub object mode, I have always altered the working pivot in Hierarchy whilst in object mode but this seems quite a long winded way of doing it. Also is it possible to align the pivot to the same rotation as a poly or snap it to a vert in object mode.

Thanks, Nick

Replies

  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    If you hold alt+rmb and change your coordinate space to 'local' the pivot point of the subobject selection will be aligned to that face. Not sure if that helps but with a whole bunch of options such as screen space etc you can quickly and efficiently alter the gizmo to work in the coordinate space desired without having to resort to actual pivot changes.
  • TakuanDaikon
    Offline / Send Message
    TakuanDaikon polycounter lvl 12
    I like to use the Working Pivot functionality frequently, especially when working in Vertex sub-object mode. Because of this, I wrote a macro script that will set the Working Pivot to the center of the current vertex selection, and assigned a hotkey to it. I select whatever vertex I want to use as the pivot point and press the hotkey to set the Working Pivot, do whatever it is that I need to do, and press SHIFT-CTRL-S to go back to the regular pivot (disables Working Pivot)

    The script could probably be easily modified to work in other sub-object modes as well, though I haven't much need for that personally.
    macroScript SetWorkingPivotToVertex
    category:"Custom Macros"
    tooltip:"Set Max's Working Pivot to the currently selected vertex (or center of multiple selected vertices)"
    buttontext:"Vertex->Pivot"
    (
        
        fn getSelectedVertices = (
            
            if selection.count == 1 then 
            (
                
                if (classof (modPanel.getCurrentObject())) == Edit_Poly then
                (
                    polyObj = modPanel.getCurrentObject()
                )
                else
                (
                    polyObj = $
                )
                
                if getSelectionLevel polyObj != #vertex then 
                (
                    messageBox "Please activate Vertex sub-object mode first"
                )
                else 
                (
                    
                    objClass = classOf polyObj
                    case objClass of 
                    (
                        
                        Editable_Poly:
                            (
                                temp = polyObj.selectedVerts
                                verts = for v in temp collect v.pos
                            )
                        
                        Editable_Mesh:
                        (
                            temp = polyObj.selectedVerts
                            verts = for v in temp collect v.pos
                        )
                    
                        Edit_Poly:
                            (
                                indices = polyObj.getSelection #vertex as array
                                verts = for index in indices collect polyObj.getVertex index
                            )
                            
                        default:
                            (
                                messageBox "Unhandled object type"
                            )
                            
                    )
                    
                )
                
            )
            
            verts
            
        )
        
        on Execute do
        (
            try
            (
                
                WorkingPivot.UseMode = false
                WorkingPivot.EditMode = false
            
                verts = getSelectedVertices()
                if verts != undefined AND verts.count > 0 then
                (
                    
                    minX = minY = minZ = 100000000 --initialize  min.values to very large numbers
                    maxX = maxY = maxZ = -100000000 --initialize max.values to very low numbers
    
                    for v in verts do  --loop through all vertices in the bitarray defined above
                    (
                        if v.x > maxX do maxX = v.x
                        if v.y > maxY do maxY = v.y
                        if v.z > maxZ do maxZ = v.z
                        if v.x < minX do minX = v.x
                        if v.y < minY do minY = v.y
                        if v.z < minZ do minZ = v.z
                    )
                    
                    theCenter = ([maxX,maxY,maxZ] + [minX,minY,minZ]) / 2.0 
                    
                    m = transMatrix theCenter
                    print ("Setting Working Pivot to " + (theCenter as string))
    
                    setSelectionLevel $ #object
                    setSelectionLevel $ #vertex
                    redrawViews
                    
                    WorkingPivot.setTM m
                    WorkingPivot.UseMode = true
                    WorkingPivot.EditMode = false
                    -- End HACK
    
                )
                
            )
            catch
            (
                msg = getCurrentException()
                messageBox msg title:"Set Working Pivot" beep:true
            )
        )
        
    )
    
  • SHEPEIRO
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    gonna try that out cheers dont like the working pivot workflow is a bit cumbersome out the box but this should sort it
  • TakuanDaikon
    Offline / Send Message
    TakuanDaikon polycounter lvl 12
    SHEPEIRO wrote: »
    gonna try that out cheers dont like the working pivot workflow is a bit cumbersome out the box but this should sort it
    I don't either, out of the box Working Pivot workflow is a real pain in the rear, which I guess is why I felt the need to write a hotkey-able macro. I use it all the time now :)

    .
  • gsokol
    Offline / Send Message
    gsokol polycounter lvl 14
    Awesome. Always wondered this myself. Both solutions here will be helpful. Thanks for putting this out there!
  • CodeFather
    Offline / Send Message
    CodeFather polycounter lvl 15
    You can use this script also:
    http://bryancavett.com/maxscripts/actionCenters.ms

    It works just like the actionCenter in Modo, placing the working pivot at the currently selected sub-object + aligning it properly to its normal (it does the job better than local coordinate space)
  • McGreed
    Offline / Send Message
    McGreed polycounter lvl 15
    I was looking for something like this as well, Softimage XSI has an awesome temporary move pivot tool, which makes it easy to snap pivot to a location on the fly and when you deselect it resets to model. They should make that for 3ds max because its really nice.
  • TakuanDaikon
    Offline / Send Message
    TakuanDaikon polycounter lvl 12
    McGreed wrote: »
    I was looking for something like this as well, Softimage XSI has an awesome temporary move pivot tool, which makes it easy to snap pivot to a location on the fly and when you deselect it resets to model. They should make that for 3ds max because its really nice.
    I really like the "reset on deselect" idea. I'll have to try incorporating that this weekend, I bet it would really help with workflow.
  • TakuanDaikon
    Offline / Send Message
    TakuanDaikon polycounter lvl 12
    CodeFather wrote: »
    You can use this script also:
    http://bryancavett.com/maxscripts/actionCenters.ms

    It works just like the actionCenter in Modo, placing the working pivot at the currently selected sub-object + aligning it properly to its normal (it does the job better than local coordinate space)
    Ooh, neat. Thanks for the link :)
  • yiannisk
    Offline / Send Message
    yiannisk polycounter lvl 14
    Try using Scene Transform axis with off center pivot point. just pan\orb your viewport around and place your pivot pretty much anywhere.

    doesn't work for all cases but for most it does .

    cheers!
  • Bryan Cavett
    Offline / Send Message
    Bryan Cavett polycounter lvl 19
    CodeFather wrote: »
    You can use this script also:
    http://bryancavett.com/maxscripts/actionCenters.ms

    It works just like the actionCenter in Modo, placing the working pivot at the currently selected sub-object + aligning it properly to its normal (it does the job better than local coordinate space)

    Thanks for the link. There is a bug in the poly sub object aligning. I haven't figured out how to fix nor have I updated this script since uploading it. It works in most cases but when you are trying to align it to a poly that has other polys surrounding it at extreme angles from one another it can get the alignment wrong. I should look at fixing this script at some point.
  • BradMyers82
    Offline / Send Message
    BradMyers82 interpolator
    Soulburn scripts has many awesome pivot placing tools. The one I use all the time is the pivot point alignment tool UI. Where it gives you a little interface with a 3d box on it (subdivided once), and you can select any vertex on it to place your pivot on.
    It's great for setting your pivot point on a 0 axis for the symmetry modifier. I just leave the tool open on my second screen, and one click, done!

    http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm
  • Mark Dygert
    Soulburn scripts has many awesome pivot placing tools. The one I use all the time is the pivot point alignment tool UI. Where it gives you a little interface with a 3d box on it (subdivided once), and you can select any vertex on it to place your pivot on.
    It's great for setting your pivot point on a 0 axis for the symmetry modifier. I just leave the tool open on my second screen, and one click, done!

    http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm
    This^
  • disanski
    Offline / Send Message
    disanski polycounter lvl 14
    Hey guys. Sorry to bring this back, but I am trying to use this pivot point alignment tool UI from Soulburn scripts and I can't get it working.
    What I do is select few vertical verts (on the same edge) and open the interface and select one of the points on the bottom of that cube- hit apply ...and nothing happens :) . The pivot stays on the middle of the selected verts. I did what I had to do, but I would really love to know how this works. Am I missing a step? Thanks in advance for any help.
  • Michael Knubben
    It sets the object's pivot point, it doesn't do anything on a sub-object level (at least, I don't think so)
  • Mark Dygert
    Pea's right, it places the pivot point in pre-defined places on the objects bounding box. It doesn't interact with the sub-object selection pivot. You want to use working pivot for what you're trying to do. You might want to hot key a toggle for use/edit working pivot if you plan to use it often.
  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    Dont know why nobody brought this up yet, there is also Arc Rotate Sub Object, its the 2nd dropdown button from the right on the bottom (in max9 atlest). Setting it to the yellow Arc Rotate Sub Object one will activate it, with it you will pretty much rotate around your selected vert, poly, etc. Useing Z (zoom extends all selected) along with it is very handy.
  • airbrush
    Offline / Send Message
    airbrush polycounter lvl 13
    Davision3D wrote: »
    Dont know why nobody brought this up yet, there is also Arc Rotate Sub Object, its the 2nd dropdown button from the right on the bottom (in max9 atlest). Setting it to the yellow Arc Rotate Sub Object one will activate it, with it you will pretty much rotate around your selected vert, poly, etc. Useing Z (zoom extends all selected) along with it is very handy.

    Yup, that's all I ever use, the orbit subobject button.
Sign In or Register to comment.