Results 1 to 2 of 2

Thread: [Maya][Python] Get Reference Transforms?

  1. #1
    integer PereBalsach's Avatar
    Join Date
    Apr 2015
    Location
    Barcelona
    Posts
    33

    Default [Maya][Python] Get Reference Transforms?



    Hi guys! ^_^
    Im building a tool integrate maya references to reference system in our game.

    I need to get the maya reference transfroms to apply to our reference system.

    I found that with the getReferenceEdits() I can get the world transforms, but I get a nastly list :
    Code:
     ['setAttr |balcony_avian_01:mesh.translate -type "double3" -10.856233 0 7.597423',
     'setAttr |balcony_avian_01:mesh.rotate -type "double3" 25.433341 -28.119516 18.401048',
     'setAttr |balcony_avian_01:mesh.scale -type "double3" 0.734496 0.734496 0.734496']
    Anyone know a solution to get the transforms from a maya reference? or a way to extract the transforms from the code above?

    Thanks ^_^

  2. #2

    Default

    Is this what you are after?

    Will extract all reference tranforms.
    Code:
    refXforms = []
    for refNode in cmds.ls(type='reference'):
        for node in cmds.referenceQuery(refNode ,nodes=True ):
            refXforms.append(node)
    print refXforms

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •