Discussions concerning programming of SOFTIMAGE©
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 16:55
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

-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Post
by EricTRocks » 15 Jan 2014, 17:52
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.
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 18:13
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.
Hi, thanks for your reply.
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.
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Post
by EricTRocks » 15 Jan 2014, 18:16
-
csaez
- Posts: 253
- Joined: 09 Jul 2012, 13:31
- Skype: csaezmargotta
- Location: Sydney, Australia
Post
by csaez » 15 Jan 2014, 19:43
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, 09:02
- Location: Montreal Canada
Post
by xsisupport » 15 Jan 2014, 20:00
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.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs:
Arnold |
Softimage
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 20:21
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
when I have compositing nodes selected.
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.
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 20:32
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.
Is there a command that can list attributes, so that I know what I can look for?
-
luceric
- Posts: 1252
- Joined: 21 Jun 2009, 22:08
Post
by luceric » 15 Jan 2014, 20:41
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.
NewScene, false
set oTree = CreateFxTree
AddFxOp oTree, "EdgeDetect"
set oTree = CreateFxTree
AddFxOp oTree, "File Input"
AddFxOp oTree, "Noise"
OpenView "Fx Tree"
set oFxView = Desktop.ActiveLayout.Views( "Fx Tree" )
LogMessage( oFxView.GetAttributeValue( "targetcontent" ) )
LogMessage( oFxView.GetAttributeValue( "selectednodes" ) )
' See result 1
set oFxView = Desktop.ActiveLayout.Views( "Fx Tree" )
oFxView.SetAttributeValue "targetcontent", "FxTree1"
LogMessage( oFxView.GetAttributeValue( "targetcontent" ) )
' See result 2
set oFxView = Desktop.ActiveLayout.Views( "Fx Tree" )
oFxView.SetAttributeValue "selectednodes", "FxTree1.Noise"
LogMessage( oFxView.GetAttributeValue( "selectednodes" ) )
' See result 3
set oFxView = Desktop.ActiveLayout.Views( "Fx Tree" )
oFxView.SetAttributeValue "selectednodes", "FxTree1.FileIn"
LogMessage( oFxView.GetAttributeValue( "selectednodes" ) )
' See result 4
-
xsisupport
- Posts: 713
- Joined: 09 Jun 2009, 09:02
- Location: Montreal Canada
Post
by xsisupport » 15 Jan 2014, 20:53
TwirlySocrates wrote: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.
Is there a command that can list attributes, so that I know what I can look for?
No. Unless something has changed, the only way I knew to find attributes was to grep the source code.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs:
Arnold |
Softimage
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 21:39
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'
-
csaez
- Posts: 253
- Joined: 09 Jul 2012, 13:31
- Skype: csaezmargotta
- Location: Sydney, Australia
Post
by csaez » 15 Jan 2014, 22:12
TwirlySocrates wrote:I tried using the attribute "selection" and it's only returning 'None'
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.
-
EricTRocks
- Moderator
- Posts: 754
- Joined: 25 Nov 2009, 00:41
Post
by EricTRocks » 15 Jan 2014, 22:13
As Luc-Eric said, the selected nodes view attribute was only added in 2014. Prior versions, you're out of luck.
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 22:17
EricTRocks wrote:As Luc-Eric said, the selected nodes view attribute was only added in 2014. Prior versions, you're out of luck.
Alrighty. Thank you.
-
luceric
- Posts: 1252
- Joined: 21 Jun 2009, 22:08
Post
by luceric » 15 Jan 2014, 23:11
so.. why do you want that selection, what were you going to do with it
-
TwirlySocrates
- Posts: 9
- Joined: 15 Jan 2014, 01:47
Post
by TwirlySocrates » 15 Jan 2014, 23:24
luceric wrote:so.. why do you want that selection, what were you going to do with it
I'm doing a lot of repetitive tasks in comp.
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.