Hi there,

yes, Format is a custom class that looks up on the list of formats

In my case, in the list - wrkLs that I have created, it will simply append 
the name of formats as it print something like [<Format 'Working 
Extractions/35 mm' object at 0x765413696>, ... , <Format 'Working 
Extractions/HD 1080-2' object at 0x765778418>] etc

As for the mel files mentioned - AEcamerFilmbackNew.mel, it has 4 functions 
namely : 

   - AEresetFilmbackMenu
   - AEwhichCameraFilmback
   - AEcameraFilmbackReplace
   - AEcameraFilmbackNew
   
and all 4 needs to have 3 arguements called eg. AEcameraFilmbackReplace 
(string $hor, string $ver, string $squ)



On Thursday, June 23, 2016 at 12:21:57 PM UTC-7, Andres Weber wrote:
>
> I'm assuming Format is a custom class that you've created?
>
> In either case what Cesar mentioned is still applicable in this instance.  
> You need to hardcore a look up dictionary based on the format names for 
> each preset film back:
>
> format_lookup_table = {'16mm Theatrical': [0.404, 0.295],
>                                    'Super 16mm': [0.493, 0.292'],
>                                    <ETC>}
>
> Then you can use that to convert between the strings that you're listing 
> as the options and the preset film backs.  I didn't check out the 
> AETemplate that Cesar mentioned but I assume you could source the values 
> from that file (also depending on if they set more than just the film 
> backs...but I'm pretty sure that's all they do?).  Then you'd just use the 
> code I provided to actually set the film backs for the specified cameras 
> based on the values from the key you're giving the look up table.
>  
> On Thursday, June 23, 2016 at 2:43:01 PM UTC-4, likage wrote:
>>
>> While I am able to append the lists of formats by using the following 
>> code:
>> import maya.cmds as cmds
>>
>>
>> formatLs = Format.showDefaults()
>> wrkLs = []
>> for i in formatLs:
>>     if 'Working Extractions' in str(i):
>>           wrkLs.append(i)
>>
>>
>> def printNewFormat(item):
>>     print item
>>
>>
>> window = cmds.window()
>> cmds.columnLayout()    
>> cmds.optionMenu (label = 'Select a format', changeCommand = 
>> printNewFormat)
>> for x in wrkLs:
>>     cmds.menuItem(label=x)
>>
>>
>> cmds.showWindow( window )
>>
>>
>> I am still unable to append / change the film format of the selected 
>> camera to the option chosen in the ui, which is something I am having 
>> trouble with at the moment..
>>
>> Need some insights on that
>>
>>
>> On Wednesday, June 22, 2016 at 2:40:16 AM UTC-7, Cesar Saez wrote:
>>>
>>> Those are hardcoded presets, you can see what's going on by inspecting. 
>>>
>>> /usr/autodesk/maya/scripts/AETemplates/AEcameraFilmbackNew.mel
>>> (/usr/autodesk/maya/ is the directory where maya is installed on linux, 
>>> replace it for whatever makes sense in your system)
>>>
>>> Said that, I would not recommend you to modify/hack that file, maintain 
>>> custom AETemplates is not fun at all.
>>> If anything I would create my own generic templates, it's not more than 
>>> a dictionary mapping attrName/value exported in a markup language (json, 
>>> yaml or whatever makes sense to you) and a for loop setting those values or 
>>> populating the dictionary.
>>>
>>> Good luck!
>>>
>>

-- 
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/3431ceed-4cbe-494f-808f-9aca9d16ce5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to