Re: [Maya-Python] Create function for optionMenuGrp

2014-10-21 Thread Justin Israel
I don't know man. If you want to post another full updated version of your code on pastebin and point out lines, I am sure someone will take a look. But I don't think you will get much more detailed help at this point because no one really knows your code but you. On 22/10/2014 6:37 PM, "likage"

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-21 Thread likage
Well, I did not change any of the code that it has initially. I only added in more of the maya cmds into the exporting class. Likewise, the __call__ was part of the original code as well. As for self.fileExport, it will writes in the (animation) data - depending on the selection, and it is suppo

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-21 Thread Justin Israel
I don't see in your last example where your custom fileExporter class supports iteration, where you loop over it and write something to a file. Seems your example contains bits and pieces of things that are either not used or not defined. What are you expecting retuning that self.fileExport to do?

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-21 Thread likage
Thanks, turns out I also need to retweak a few stuff in my other functions. However, while the information capturing and all seems to be working, rather I got issues with the exporting. It does creates a file but it is of zero bytes size and I noticed that the following function wasn't exactly

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-20 Thread Justin Israel
This should be a pretty easy fix. In your constructor to the fileExporter class, you accept 4 arguments, but you don't save any of them, so they are lost: #- class fileExporter(): def __init__(self, transform, startAnimation, endAnimation, cameraObj): self.start = "" s

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-20 Thread likage
This may not be my best attempt but I would like to get some pointers if there are any. I tried to break up the exporting code, in hope that it may be easier, but I am getting errors in line 150 - *# NameError: global name 'transform' is not defined # *but if I am going to edit line 56 - *chanMe

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-17 Thread Justin Israel
Your exportWin function creates a window and shows it, right? Once that window is shown, your exportWin will return and the execution will continue through the rest of your writer. I think you are thinking the window should wait to collect input, but it does not. If you want to use a dialog to col

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-17 Thread likage
sorry, by shown dialog, do you mean to say the exportWin? On Friday, October 17, 2014 6:26:21 PM UTC+8, Justin Israel wrote: > > I'm pretty sure it is because you are calling showWindow() in your > exportWin, which shows the dialog but does not block. So the rest of your > export happens right a

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-17 Thread Justin Israel
I'm pretty sure it is because you are calling showWindow() in your exportWin, which shows the dialog but does not block. So the rest of your export happens right away. What you probably want to do is one of two options: Either have exportWin be the last line of your writer method, and allow it to

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-17 Thread likage
Okay, I think I have switched it to the use of checkboxes, as it seems slightly easier for me? Pardon my lack of understanding, but I was wondering if you could further elaborate second previous post - * move your logic that is in your __init__ into another method. Your writer plugin can then

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-16 Thread Justin Israel
Did you have a look at the documentation? http://download.autodesk.com/us/maya/2011help/CommandsPython/optionMenuGrp.html#flagchangeCommand You can attach a callback to the changeCommand and then use a query flag to get the value of the optionMenuGrp selected item. The callback may pass you the se

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-16 Thread likage
I am slowly trying to integrate parts by parts as I played and test around with it. However, I have a questions. Seeing that I have 2 menu options, while it is possible for me to create functions individually for each of the menu option, I am trying to add on a button in which it will fire the

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-15 Thread Justin Israel
Oh ok. This make a little more sense now. I can see that your fileExporter is a completely custom class and has nothing to do with the actual plugin class. What you probably want to do is to move your logic that is in your __init__ into another method. Your writer plugin can then create an instance

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-15 Thread likage
I am trying to tweak from a current script file, and as far as I know, when the plugin is loaded, user will just need to select the camera they would like to export (File>>Export selection) with format from the plugin -chan. I will not be posting all the code, but the portions that are affilated

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-15 Thread Justin Israel
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

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-14 Thread likage
So are there any ways that I can run my initialwindow first before the __init__? -- 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_

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-14 Thread likage
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 woul

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-14 Thread Justin Israel
On Tue, Oct 14, 2014 at 7:56 PM, likage wrote: > I have kind of manage to get it to work. > This is actually an exporting object plugin but I have got 2 problems. > 1. My initial window aren't popping up when I select my object >> File >> > Export selection > Not sure from what you posted. > 2

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-13 Thread likage
I have kind of manage to get it to work. This is actually an exporting object plugin but I have got 2 problems. 1. My initial window aren't popping up when I select my object >> File >> Export selection 2. Based on the selection, will it be possible for me to grab the different values based on t

Re: [Maya-Python] Create function for optionMenuGrp

2014-10-12 Thread Justin Israel
You are seeing that error because you are trying to pass a “non-keyword arg after keyword arg”: test1 = cmds.menuItem(label='Export using item selection range', test1_func()) test2 = cmds.menuItem(test2_func(), label='Export using time slide range', test2_func()) When you start using keyword arg