Re: Programmatically Close a Torn off Menu
xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: if N.Type == Menu Window: print N.GetAttributeValue(metadata) This is gold! I'm really curious as to how you found that. I've been attempting to do more with menus for years, but the SDK functionality is just not there, and it doesn't seem to have any dev priority whatsoever. E.g., there is no method to get rid of factory-installed menu items, or insert custom menu items between factory-installed ones (can't enumerate menu items), or is there? This will return the name of the Menu Window...don't ask how I found that, pure luck. I now realize even getting the name won't be enough to know it's part of my menu. If someone tears off a sub-menu for instance, the name will not be the same name as the original Menu name. -tony On Mon, Jul 8, 2013 at 5:29 PM, Tony Barbieri great...@gmail.com wrote: Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.comwrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony -- - Stefan Kubicek ste...@keyvis.at - keyvis digital imagery Alfred Feierfeilstraße 3 A-2380 Perchtoldsdorf bei Wien Phone: +43 (0) 699 12614231 www.keyvis.at -- This email and its attachments are-- -- confidential and for the recipient only --
Re: Programmatically Close a Torn off Menu
Pure luck...I've never really worked with the Softimage API before, so perhaps my being nieve helped figure this out :). Also as I found out afterwards and this blog posthttp://xsisupport.com/2013/07/09/identifying-tear-off-menus/ states, you can pass any string to GetAttributeValue and it will return the Menu Window's title. -tony On Tue, Jul 9, 2013 at 2:58 AM, Stefan Kubicek s...@tidbit-images.com wrote: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: if N.Type == Menu Window: print N.GetAttributeValue(metadata**) This is gold! I'm really curious as to how you found that. I've been attempting to do more with menus for years, but the SDK functionality is just not there, and it doesn't seem to have any dev priority whatsoever. E.g., there is no method to get rid of factory-installed menu items, or insert custom menu items between factory-installed ones (can't enumerate menu items), or is there? This will return the name of the Menu Window...don't ask how I found that, pure luck. I now realize even getting the name won't be enough to know it's part of my menu. If someone tears off a sub-menu for instance, the name will not be the same name as the original Menu name. -tony On Mon, Jul 8, 2013 at 5:29 PM, Tony Barbieri great...@gmail.com wrote: Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.com wrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony -- --**--- Stefan Kubicek ste...@keyvis.at --**--- keyvis digital imagery Alfred Feierfeilstraße 3 A-2380 Perchtoldsdorf bei Wien Phone: +43 (0) 699 12614231 www.keyvis.at -- This email and its attachments are-- -- confidential and for the recipient only -- -- -tony
Re: Programmatically Close a Torn off Menu
That's funny ... there is a bug in the tear menu window get attribute method It's supposed to return the name of the menu for targetcontent but the instead it returns it if the name of the attribute is anything except targetcontent. so you could probably go GetAttributeValue(Luc-Eric) and it would work anyway. my apologies On Tue, Jul 9, 2013 at 2:58 AM, Stefan Kubicek s...@tidbit-images.com wrote: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: if N.Type == Menu Window: print N.GetAttributeValue(metadata) This is gold! I'm really curious as to how you found that. I've been attempting to do more with menus for years, but the SDK functionality is just not there, and it doesn't seem to have any dev priority whatsoever. E.g., there is no method to get rid of factory-installed menu items, or insert custom menu items between factory-installed ones (can't enumerate menu items), or is there? This will return the name of the Menu Window...don't ask how I found that, pure luck. I now realize even getting the name won't be enough to know it's part of my menu. If someone tears off a sub-menu for instance, the name will not be the same name as the original Menu name. -tony On Mon, Jul 8, 2013 at 5:29 PM, Tony Barbieri great...@gmail.com wrote: Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.comwrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony -- - Stefan Kubicek ste...@keyvis.at - keyvis digital imagery Alfred Feierfeilstraße 3 A-2380 Perchtoldsdorf bei Wien Phone: +43 (0) 699 12614231 www.keyvis.at -- This email and its attachments are-- -- confidential and for the recipient only --
Re: Programmatically Close a Torn off Menu
Thanks a lot, that's good to know. One exclamation mark at too much in the code I guess :-) That's funny ... there is a bug in the tear menu window get attribute method It's supposed to return the name of the menu for targetcontent but the instead it returns it if the name of the attribute is anything except targetcontent. so you could probably go GetAttributeValue(Luc-Eric) and it would work anyway. my apologies On Tue, Jul 9, 2013 at 2:58 AM, Stefan Kubicek s...@tidbit-images.com wrote: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: if N.Type == Menu Window: print N.GetAttributeValue(metadata) This is gold! I'm really curious as to how you found that. I've been attempting to do more with menus for years, but the SDK functionality is just not there, and it doesn't seem to have any dev priority whatsoever. E.g., there is no method to get rid of factory-installed menu items, or insert custom menu items between factory-installed ones (can't enumerate menu items), or is there? This will return the name of the Menu Window...don't ask how I found that, pure luck. I now realize even getting the name won't be enough to know it's part of my menu. If someone tears off a sub-menu for instance, the name will not be the same name as the original Menu name. -tony On Mon, Jul 8, 2013 at 5:29 PM, Tony Barbieri great...@gmail.com wrote: Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.comwrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony -- - Stefan Kubicek ste...@keyvis.at - keyvis digital imagery Alfred Feierfeilstraße 3 A-2380 Perchtoldsdorf bei Wien Phone: +43 (0) 699 12614231 www.keyvis.at -- This email and its attachments are-- -- confidential and for the recipient only -- -- - Stefan Kubicek ste...@keyvis.at - keyvis digital imagery Alfred Feierfeilstraße 3 A-2380 Perchtoldsdorf bei Wien Phone: +43 (0) 699 12614231 www.keyvis.at -- This email and its attachments are-- -- confidential and for the recipient only --
Programmatically Close a Torn off Menu
Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony
Re: Programmatically Close a Torn off Menu
Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony
Re: Programmatically Close a Torn off Menu
Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony
Re: Programmatically Close a Torn off Menu
Is it possible to disallow tearing off a menu? Because of the frequency of menu updates, there could be a lot of orphaned torn off menus about... On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony
Re: Programmatically Close a Torn off Menu
I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony
Re: Programmatically Close a Torn off Menu
Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.comwrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony
Re: Programmatically Close a Torn off Menu
xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: if N.Type == Menu Window: print N.GetAttributeValue(metadata) This will return the name of the Menu Window...don't ask how I found that, pure luck. I now realize even getting the name won't be enough to know it's part of my menu. If someone tears off a sub-menu for instance, the name will not be the same name as the original Menu name. -tony On Mon, Jul 8, 2013 at 5:29 PM, Tony Barbieri great...@gmail.com wrote: Thanks Luc-Eric. I am able to find the torn off menu but I'm trying to find the right one. Using this: xsi = Application ad = xsi.Desktop.ActiveLayout for N in ad.Views: print N.Name prints Menu Window. Is there a way to find the title of the torn off Menu Window so I can be sure it's the right one I want to close?' -tony On Mon, Jul 8, 2013 at 4:51 PM, Luc-Eric Rousseau luceri...@gmail.comwrote: I think you should be able to find the tear off menu view by searching for the floating window on the desktop, and then close that. doesn't it apear in the Window menu? On Mon, Jul 8, 2013 at 4:40 PM, Tony Barbieri great...@gmail.com wrote: Thanks for the reply, Brad!! Wasn't sure if you had messed with that...bummer... -tony On Mon, Jul 8, 2013 at 4:37 PM, Bradley Gabe witha...@gmail.com wrote: Hi Tony- I remember looking into that issue and coming up empty handed. I don't think the SDK provides any handles for menu windows, or at least it didn't in the versions we were using. -B Sent from my iPhone On Jul 8, 2013, at 3:08 PM, Tony Barbieri great...@gmail.com wrote: Hello! I am working on a project that is dynamically rebuilding menus with different entries. The menu building is all functioning correctly...unless a torn off menu exists. The non-torn off menu is updated correctly, but the torn off menu becomes orphaned because the old callbacks no longer exist in memory. Ideally (and I know this is a long shot) we would rebuild the torn off menu. If that is not possible then I would just like to close any torn off menus to limit confusion as to why pressing a menu item no longer does anything. Are either of these solutions currently possible? Thanks much! -- -tony -- -tony -- -tony -- -tony