Python: Return list of selected compositing nodes
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Python: Return list of selected compositing nodes
Hi,
When I'm compositing, I noticed that there's a difference between selecting a node in the explorer (located in Scene_Root.FxTree.nodeName), and selecting a node in the compositing window. If I click a node in the GUI, it doesn't affect the highlighted node in the Explorer.
I'm trying to use a python script to return a list of selected objects in the compositing window. I can use "Application.Selection", but that returns the list of nodes/objects selected in the explorer, not in the compositing window.
Any help would be most appreciated
When I'm compositing, I noticed that there's a difference between selecting a node in the explorer (located in Scene_Root.FxTree.nodeName), and selecting a node in the compositing window. If I click a node in the GUI, it doesn't affect the highlighted node in the Explorer.
I'm trying to use a python script to return a list of selected objects in the compositing window. I can use "Application.Selection", but that returns the list of nodes/objects selected in the explorer, not in the compositing window.
Any help would be most appreciated
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: Python: Return list of selected compositing nodes
You probably have to find the FX Tree view object via the Application.Desktop.Views collection or something like that. Once you have the view there should be a view attribute that gives you a string of the selected nodes which you can then split out for your needs.
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
Hi, thanks for your reply.EricTRocks wrote:You probably have to find the FX Tree view object via the Application.Desktop.Views collection or something like that. Once you have the view there should be a view attribute that gives you a string of the selected nodes which you can then split out for your needs.
Would you know of any documentation that could help me find what I need?
I'm still pretty new to XSI's python api, so if any guesswork is involved, I probably won't figure it out.
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: Python: Return list of selected compositing nodes
View Collection Docs
http://download.autodesk.com/global/doc ... ction_html
View Docs
http://download.autodesk.com/global/doc ... _View_html
View Attributes Docs
http://download.autodesk.com/global/doc ... butes_html
http://download.autodesk.com/global/doc ... ction_html
View Docs
http://download.autodesk.com/global/doc ... _View_html
View Attributes Docs
http://download.autodesk.com/global/doc ... butes_html
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Python: Return list of selected compositing nodes
Looks like fxtree does not implement any view attribute :/
Code: Select all
views = Application.Desktop.ActiveLayout.Views
v = views.Find("Fx Tree") or views.Find("View Manager").Views.Find("Fx Tree")
if v:
print v.GetAttributeValue("selection") # None
- xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 11:02
- Location: Montreal Canada
- Contact:
Re: Python: Return list of selected compositing nodes
It implements at least one attribute: targetcontent.
The doc page is hidden; FxTree isn't listed on the View Attributes page, but it is possible to find it through the search.
But even I find that Search page ... opaque.
The doc page is hidden; FxTree isn't listed on the View Attributes page, but it is possible to find it through the search.
But even I find that Search page ... opaque.
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
csaez wrote:Looks like fxtree does not implement any view attribute :/
Code: Select all
views = Application.Desktop.ActiveLayout.Views v = views.Find("Fx Tree") or views.Find("View Manager").Views.Find("Fx Tree") if v: print v.GetAttributeValue("selection") # None
Thanks for your reply - this code executes, but it returns
Code: Select all
None
Is supposed to return a list... or maybe an object?
As xsisupport pointed out, the documentation hardly covers this at all. Even if I were able to find the Fx Tree page, it doesn't list "secection" as an attribute.
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
Is there a command that can list attributes, so that I know what I can look for?xsisupport wrote:It implements at least one attribute: targetcontent.
The doc page is hidden; FxTree isn't listed on the View Attributes page, but it is possible to find it through the search.
But even I find that Search page ... opaque.
Re: Python: Return list of selected compositing nodes
Yikes, that requires and archeology search, because nobody bothered to update the doc, and the softimage sdk doc sucks in general.
It's only documented in Consulting release documents.
The view attribute "selectednodes" was added in Softimage 2014
SOFT-8036 QFE: Please add view attributes support for the Fx Tree.
It's only documented in Consulting release documents.
The view attribute "selectednodes" was added in Softimage 2014
SOFT-8036 QFE: Please add view attributes support for the Fx Tree.
Nudity warning: [ Show ]
- xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 11:02
- Location: Montreal Canada
- Contact:
Re: Python: Return list of selected compositing nodes
No. Unless something has changed, the only way I knew to find attributes was to grep the source code.TwirlySocrates wrote:Is there a command that can list attributes, so that I know what I can look for?xsisupport wrote:It implements at least one attribute: targetcontent.
The doc page is hidden; FxTree isn't listed on the View Attributes page, but it is possible to find it through the search.
But even I find that Search page ... opaque.
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
Thanks for your sample code... would you have anything that works in Soft 2012?
I tried using the attribute "selection" and it's only returning 'None'
I tried using the attribute "selection" and it's only returning 'None'
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Python: Return list of selected compositing nodes
I know, forget about that snippet, it was just a shot in the dark hoping to find some consistency with similar views, but it doesn't work.TwirlySocrates wrote:I tried using the attribute "selection" and it's only returning 'None'
-
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 01:41
- Contact:
Re: Python: Return list of selected compositing nodes
As Luc-Eric said, the selected nodes view attribute was only added in 2014. Prior versions, you're out of luck.
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
Alrighty. Thank you.EricTRocks wrote:As Luc-Eric said, the selected nodes view attribute was only added in 2014. Prior versions, you're out of luck.
Re: Python: Return list of selected compositing nodes
so.. why do you want that selection, what were you going to do with it
-
- Posts: 9
- Joined: 15 Jan 2014, 02:47
Re: Python: Return list of selected compositing nodes
I'm doing a lot of repetitive tasks in comp.luceric wrote:so.. why do you want that selection, what were you going to do with it
Some of these tasks would include:
* Arrange selected nodes in an evenly spaced horizontal line.
* Comp selected nodes together using "over" nodes at .5 opacity
* Comp selected nodes together using "over" nodes at 1.0 opacity
It's easy to do by hand, but when you have to do it all day, it would be easier to script.
Who is online
Users browsing this forum: No registered users and 28 guests