You may need to post more of your plugin (and also I probably have a lack
of experience with the specific plugin type you are writing), but the
structure seems strange to me. I wouldn't expect that you should be doing
so much work within the constructor of the class. Is that how the plugin is
meant to be written?
Ideally you would show a UI before the plugin executes, and then your
plugin would run with the desired parameters being passed. It would be
backwards to think that other methods of your class should run first and
then supply information to your constructor.
 On 15/10/2014 12:10 AM, "likage" <dissidia....@gmail.com> wrote:

> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/0a1ae55d-2511-4bc4-8b2e-3bf5f304e226%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/0a1ae55d-2511-4bc4-8b2e-3bf5f304e226%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1Sid7NO-Ldm%3Dat5Wa4FkKEpj7dZ40ydiw6TWCXfwaRgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to