Home Technical Talk

Max to Maya - Verts, Edge, Faces XYZ position

polycounter lvl 15
Offline / Send Message
Autocon polycounter lvl 15
Hey everyone so I have a project I have to do in Maya. Using Maya 2010 and I cant seem to find the Max equivalent of being able to select a vert, edge or face and being able to tell what its XYZ position. I can see the world position of the entire object on that right hand roll out but not the vert position at all.

I use this feature a ton in max where I can easily just copy and paste one verts XY or Z position to another so not being able to do so is a big hindrance. I can't imagine Maya's only option is to "just eyeball it" as that seems quite ridiculous.

While on the subject of this whole transforming XYZ positions I noticed Maya has the translate XYZ realitive and absolute position thing up on the top menu. It doesn't say what the current XYZ values are of the selected object : / Is there anyway to "break" this box thing off into a floater much like in Max and have it display both XYZ of absolute and realitive at the same time so I dont have to switch back and forth each time?

xyzk.jpg




Finally dose the "ignore version" of Maya destroy instancing of objects if a 2010 file was opened in 2008? Nothing more then modeling, instancing objects and basic, diffuse, specular, alpha and normal texturing was done.


Thanks for all the help in advance :)

Replies

  • neigan
    Options
    Offline / Send Message
    The component editor got the xyz position.
    Or you could do some thing like this:
    string $selectedVert[];
    $selectedVert = `ls -sl`;
    float $vtxPos[3] = `xform -q -ws -t $selectedVert`;

    And just put it on a button and you'll see the result in the command line. Not sure how to do it with a face/edge tho, now it reports all the verts in the selected edge or face(you could use that and calculate the centre of the face/edge.
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    thanks neigan. didnt know about the component editor. not as nice as Max's way as it takes up a ton of screen space but it will do.

    anyone else know about if opening a new maya version file in an old version will break instancing?
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    For verts specifically you can select the verts you care about and in the channel box click the CVs (click to show) and a new drop down will appear with the vert info you're after, wait I'm totally wrong not sure what that info is it shows there?
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    yeah im not sure what that info there is either. it seems like it would/should be. it shows the vert number and XYZ for something but most of the times there all just 0's with the occasional odd value in one of them like 1.19e-007.
  • neigan
    Options
    Offline / Send Message
    That is a local position based on the original position of where the vert was created(is reseted when you do stuff like combine, seperate..).
    And 1.19e-007 simply means that its rly close to zero(0,000000119).
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Wrote something up for ya. Will show the positions of selected object(s)/vert(s)/edge(s)/face(s), averaging their values if multiple are selected like in max:
    if (`window -exists xyzWindow`)
        deleteUI xyzWindow;
    window -wh 275 75 -mxb 0 -title "xyzWindow: component positions" xyzWindow;
    rowColumnLayout -numberOfColumns 2 -columnAttach 1 "right" 0
        -columnWidth 1 100 -columnWidth 2 150;
    
    text -label "X";
    global string $Xtf;
    $Xtf = `textField`;
    text -label "Y";
    global string $Ytf;
    $Ytf = `textField`;
    text -label "Z";
    global string $Ztf;
    $Ztf = `textField`;
    
    showWindow xyzWindow;
    
    
    scriptJob -parent xyzWindow -e SelectionChanged posProc;
    
    global proc posProc ()
    {
    global string $Xtf;
    global string $Ytf;
    global string $Ztf;
    
    $selectComp = `ls -sl -fl`;
    
    if ((`size $selectComp`) == 0)
        {
        textField -edit -tx ("") $Xtf;
        textField -edit -tx ("") $Ytf;
        textField -edit -tx ("") $Ztf;
        }
        
    if (`selectType -q -pv` == 1)
        {
        if ((`size $selectComp`) == 1)
            {
            $Pos = `xform -q -ws -t $selectComp[0]`;
            textField -edit -tx ($Pos[0]) $Xtf;
            textField -edit -tx ($Pos[1]) $Ytf;
            textField -edit -tx ($Pos[2]) $Ztf;
            }
        if ((`size $selectComp`) >= 2)
            {
            float $Xpos;
            float $Ypos;
            float $Zpos;
            
            for ($each in $selectComp)
                {
                $Pos = `xform -q -ws -t $each`;
                $Xpos = $Pos[0] + $Xpos;
                $Ypos = $Pos[1] + $Ypos;
                $Zpos = $Pos[2] + $Zpos;
                }
                
            textField -edit -tx ($Xpos / (`size $selectComp`)) $Xtf;
            textField -edit -tx ($Ypos / (`size $selectComp`)) $Ytf;
            textField -edit -tx ($Zpos / (`size $selectComp`)) $Ztf;
            }
        }
    
    if (`selectType -q -pe` == 1)
        {
        float $Xpos;
        float $Ypos;
        float $Zpos;
        
        if ((`size $selectComp`) >= 1)
            {
            $buff = `polyListComponentConversion -tv $selectComp`;
            $edjVrts = `filterExpand -sm 31 -expand 1 $buff`;
            for ($each in $edjVrts)
                {
                $Pos = `xform -q -ws -t $each`;
                $Xpos = $Pos[0] + $Xpos;
                $Ypos = $Pos[1] + $Ypos;
                $Zpos = $Pos[2] + $Zpos;
                }
                    
            textField -edit -tx ($Xpos / (`size $edjVrts`)) $Xtf;
            textField -edit -tx ($Ypos / (`size $edjVrts`)) $Ytf;
            textField -edit -tx ($Zpos / (`size $edjVrts`)) $Ztf;
            }
        }
        
    if (`selectType -q -pf` == 1)
        {
        float $Xpos;
        float $Ypos;
        float $Zpos;
        
        if ((`size $selectComp`) >= 1)
            {
            $buff = `polyListComponentConversion -tv $selectComp`;
            $facVrts = `filterExpand -sm 31 -expand 1 $buff`;
            for ($each in $facVrts)
                {
                $Pos = `xform -q -ws -t $each`;
                $Xpos = $Pos[0] + $Xpos;
                $Ypos = $Pos[1] + $Ypos;
                $Zpos = $Pos[2] + $Zpos;
                }
                    
            textField -edit -tx ($Xpos / (`size $facVrts`)) $Xtf;
            textField -edit -tx ($Ypos / (`size $facVrts`)) $Ytf;
            textField -edit -tx ($Zpos / (`size $facVrts`)) $Ztf;
            }
        }
    }
    

    Note this wont give correct results normally if you're in Multi-selection mode because it wont know who to determine what kind of component you want it to work on. It updates whenever the selection changes, not when the components are moved/rotated/scaled because scriptjobs don't have an event flag for that.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Must look into what script jobs are. Thanks Polyhertz for posting the code, understood most of it :)
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    Thanks polyhertz, awesome you would write that up. Will indeed be very helpful.

    Also makes me realize those months of learning mel scripting in college was total waste as I could never write a script now if I wanted ha. but at least I still understand most of it :)
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    while you expert maya users might still be looking at this thread is there a way to snap one object to another by vert position that dosnt require the pivot to be on the vert position?

    Example. I have 2 cubes. Both have there pivots centered. I want to snap one cube to the other from 1 vert to another. I dont want to destroy the location of the pivot. In Max you can turn on Snapping, hover your mouse over where a vert is, drag to where there is a vert on another object and it will snap the objects to each other aligned to that vert (even though the manipulator isnt there since you have the entire object selected)

    Is this possible in Maya or must you do it with the pivot? If you do have to do it with the pivot is there a "working pivot" you can set so it doesn't destroy your original pivots position?

    Thanks
  • 00Zero
    Options
    Offline / Send Message
    if i understand correctly, just select a vert, hold down "v" and drag to another vert. v snaps to verts. c snaps to lines, x snaps to grid points.

    nm, re reading your post, thats probably not what you were looking for. sry
  • ivars
    Options
    Offline / Send Message
    ivars polycounter lvl 15
    You can use the Snap Tool under the modify menu. Just press V and click and drag when selecting the positions.

    You'll also find some align tools there...
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    ah ok I knew about the holding v and dragging but that would always require the use of the current pivot point which was the problem.

    I had no idea you could select a vert on 1 object, select a second object then select a vert on that object at the same time and snap. Gets the exact result I wanted :)


    As for the align tools. I checked out the Align Tool and Align objects. I couldn't find a way to get things to align pivot to pivot. All it would allow me to do was Min, Avg, Max, Dist and Stack. Neither seems to have the option to align pivot to pivot on the desired XYZ. This align tool lets you align objects on XYZ much like Max which is nice but no pivot to pivot : /

    If my pivot is not on a vert this can become problematic. Maya help file didnt have anything on pivot to pivot aligning.


    Again thanks everyone for all the help.
Sign In or Register to comment.