My reason for the optionMenu is so that User can choose between, to grab 
the frame range of the time slider, or to grab the 'keyframed' range of the 
selection (camera selection in this case). 
As such, in the following code, it handles the exporting of camera, and I 
would say the main focus would be the startAnimation and endAnimation 
(dependable on which option the user choose)

This is the initial code before implementation.

def __init__(self, transform, startAnimation, endAnimation, cameraObj):
    self.fileExport =[]
    mayaGlobal = OpenMaya.MGlobal()
    mayaGlobal.viewFrame(OpenMaya.MTime(1))

    for i in range(startAnimation, (endAnimation + 1)):

        focalLength = cameraObj.focalLength()
       
        vFilmApp = cameraObj.verticalFilmAperture()

        focalOut = 2* math.degrees(math.atan(vFilmApp * 25.4/ (2* 
focalLength)))

        myEuler = OpenMaya.MEulerRotation()
        spc = OpenMaya.MSpace.kWorld

        trans = transform.getTranslation(spc)

        rotation = transform.getRotation(myEuler)
        rotVector = OpenMaya.MVector(myEuler.asVector())

        self.fileExport.append((str(i) + '\t' + str(trans[0]) + "\t" + str(
trans[1]) + "\t" + str(trans[2]) + "\t" + str(math.degrees(rotVector[0])) + 
"\t" + str(math.degrees(rotVector[1])) + "\t" + str(math.degrees(rotVector[2
])) + "\t" + str(focalOut) + "\n"))

        mayaGlobal.viewFrame(OpenMaya.MTime(i))

def __call__(self):
    return self.fileExport

And so, I thought if I integrate in the optionMenu as I cited above, how 
can I make my __init__ function to recognize the values of the 
startAnimation and endAnimation based on the menu selection? 

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/0a1ae55d-2511-4bc4-8b2e-3bf5f304e226%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to