Well allmost certainly do not want the first and the second procedure the same. At minimum you want the second call custom argument be calling the first after a global reset of the guitem.
so this populates the list just fine but i cant figure out or find any documentation
on how to update the contents of the optio menu.
that would be the job of the second callcustom argument.
Presumably i would want to create some sort of procedure that gets called when the menu is clicked,
No don't do that you dont need it. Update the menu when the AEtemplate is made with the second procedure in callcustom. You shoudl look into AEcameraTemplate.mel for a good example
i woudlnt know how to access the option menu
well your a bit missuaing the attr thing, usually you want to pass $nodeName- Anyway usually you dont need to because you give a name to the meuitem you make, example:
global proc AElocatorTemplate( string $nodeName )
{
editorTemplate -beginScrollLayout;
editorTemplate -beginLayout (uiRes("m_AElocatorTemplate.kLocatorAttributes")) -collapse 0;
editorTemplate -callCustom "AE_custom_camera_menu_create" "AE_custom_camera_menu_edit" $nodeName;
AElocatorCommon $nodeName;
editorTemplate -endLayout;
AElocatorInclude $nodeName;
editorTemplate -addExtraControls;
editorTemplate -endScrollLayout;
}
global proc AE_custom_camera_menu_create(string $attr){
optionMenuGrp -label "Cameras" jooAeCustomCameraMenuItem;
string $cameras[] = `ls -cameras`;
for ($item in $cameras){
menuItem -label $item;
}
}
global proc AE_custom_camera_menu_edit(string $attr){
deleteUI jooAeCustomCameraMenuItem;
AE_custom_camera_menu_create($attr);
}
usually i would assign it to a global variable
then your usually doing things wrong, people almost instinctively use globals far too much, in 90% of cases theres really no meed for global even in cases that are shipped in autodesks built-in scripts. remeber names are global no matter what.
EDIT: made script simpler