Getting parameters linked to a parameter

47 views
Skip to first unread message

Nicolas Burtnyk

unread,
Sep 24, 2012, 4:01:13 PM9/24/12
to soft...@listproc.autodesk.com
Hello list,

I'm trying to figure out if there's a quick way to get all parameters
that are linked to a given parameter via expressions.
For example, say I link the the red diffuse color of one shader to another:
Application.SetExpr("Sources.Materials.DefaultLib.Lambert.Lambert.diffuse.red",
"Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red", "")
i.e. the Scene_Material's diffuse.red drives the Lambert's diffuse.red.

Now given "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red"
how do I find out that it is being used to drive
"Sources.Materials.DefaultLib.Lambert.Lambert.diffuse.red"?

Thanks in advance for any tips!

-Nicolas

Steven Caron

unread,
Sep 24, 2012, 4:06:17 PM9/24/12
to soft...@listproc.autodesk.com

César Sáez

unread,
Sep 24, 2012, 4:38:25 PM9/24/12
to soft...@listproc.autodesk.com
Hi,
I think you can get it using ConnectionStackInfo() and parsing the xml, something like this...

from sipyutils import si, siut
from xml.dom.minidom import parseString
oParam = si().Dictionary.GetObject("Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red")
sData = siut().DataRepository.GetConnectionStackInfo(oParam)
for sObj in parseString(sData).getElementsByTagName("object"):
print sData.toxml()

Cheers!

César Sáez

unread,
Sep 24, 2012, 4:41:13 PM9/24/12
to soft...@listproc.autodesk.com
Oops, I've a typo... should be

from sipyutils import si, siut
from xml.dom.minidom import parseString
oParam = si().Dictionary.GetObject("Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse.red")
sData = siut().DataRepository.GetConnectionStackInfo(oParam)
for sObj in parseString(sData).getElementsByTagName("object"):
print sObj.toxml()

Nicolas Burtnyk

unread,
Sep 24, 2012, 5:21:18 PM9/24/12
to soft...@listproc.autodesk.com
@Steve: GetSource works the other way - that is if I have the target
of the expression I can easily find the source, but what I need is to
find the target given the source.

@C�sar: That does indeed give me (among other things) the name of the
expression object from which I can determine the target of the
expression.

Thanks guys!

Steven Caron

unread,
Sep 24, 2012, 5:26:34 PM9/24/12
to soft...@listproc.autodesk.com
ah yes...

//You can access the parameter to which an expression is connected by using the output port.
Application.LogMessage("Parameter owner of the expression " + oExpr.OutputPorts(0).Target2.FullName);

the c++ doesn't show OutputPort having GetTarget() but it inherits from Port.

http://download.autodesk.com/global/docs/softimage2012/en_us/sdkguide/index.html?url=si_cpp/classXSI_1_1Port.html,topicNumber=si_cpp_classXSI_1_1Port_html

s

On Mon, Sep 24, 2012 at 2:21 PM, Nicolas Burtnyk <nic...@redshift3d.com> wrote:
@Steve: GetSource works the other way - that is if I have the target
of the expression I can easily find the source, but what I need is to
find the target given the source.

@César: That does indeed give me (among other things) the name of the

expression object from which I can determine the target of the
expression.

Thanks guys!

Alan Fregtman

unread,
Sep 24, 2012, 5:28:02 PM9/24/12
to soft...@listproc.autodesk.com
This was asked before by the way. Here's alternate code from an old thread:


On Mon, Sep 24, 2012 at 5:21 PM, Nicolas Burtnyk <nic...@redshift3d.com> wrote:
@Steve: GetSource works the other way - that is if I have the target
of the expression I can easily find the source, but what I need is to
find the target given the source.

@César: That does indeed give me (among other things) the name of the

expression object from which I can determine the target of the
expression.

Thanks guys!

Nicolas Burtnyk

unread,
Sep 24, 2012, 7:35:57 PM9/24/12
to soft...@listproc.autodesk.com
Thanks Alan - I guess I should have searched before asking :)
I ended up implementing the technique using GetConnectionStackInfo and
parsing the xml and it works like a charm.

Cheers guys!


On Mon, Sep 24, 2012 at 2:28 PM, Alan Fregtman <alan.f...@gmail.com> wrote:
> This was asked before by the way. Here's alternate code from an old thread:
> https://groups.google.com/forum/?fromgroups=#!search/get$20all$20the$20expressions$20driven$20by$20a$20parameter/xsi_list/O2-MFKolqqw/UYg9uj1VkisJ
>
>
> On Mon, Sep 24, 2012 at 5:21 PM, Nicolas Burtnyk <nic...@redshift3d.com>
> wrote:
>>
>> @Steve: GetSource works the other way - that is if I have the target
>> of the expression I can easily find the source, but what I need is to
>> find the target given the source.
>>
>> @C�sar: That does indeed give me (among other things) the name of the

Adam Seeley

unread,
Sep 25, 2012, 4:58:47 AM9/25/12
to soft...@listproc.autodesk.com
Morning all,

Has anybody come across any problems working with multiple workgroups and 2013?

e.g.
1 x General workgroup
1 x Arnold Workgroup
1 x Mootzoid type workgroup

Seems like a sensible way to be able to chop, change and access different versions of addons if need be.... if it's stable of course.

Ta much,

Adam.

Eric Thivierge

unread,
Sep 25, 2012, 5:18:27 AM9/25/12
to Adam Seeley, soft...@listproc.autodesk.com
Works fine for me at home on Win7. We have plenty (read tons!) of workgroups at work as well though that is on 2012.

For Species we are distributing our new versions as workgroups only as it is much simpler for users to upgrade.

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

Xavier Lapointe

unread,
Sep 25, 2012, 5:30:17 AM9/25/12
to soft...@listproc.autodesk.com

Works well on Linux 2013 as far as I know. Like Eric said works well with tons of them, but we don't use Arnold/sitoa or the other one stated.

Sandy Sutherland

unread,
Sep 25, 2012, 5:45:27 AM9/25/12
to soft...@listproc.autodesk.com
Works well here too - we are still on 2011.5 - have various workgroups depending on dept.

S.

_____________________________
Sandy Sutherland
Technical Supervisor
sandy.su...@triggerfish.co.za
_____________________________





From: softimag...@listproc.autodesk.com [softimag...@listproc.autodesk.com] on behalf of Xavier Lapointe [xl.mail...@gmail.com]
Sent: 25 September 2012 11:30
To: soft...@listproc.autodesk.com
Subject: Re: soft 2013 - multiple workgroups

Adam Seeley

unread,
Sep 25, 2012, 7:26:56 AM9/25/12
to soft...@listproc.autodesk.com
Thanks guys,

I'll give it a spin.

Adam.



From: Sandy Sutherland <Sandy.Su...@triggerfish.co.za>
To: "soft...@listproc.autodesk.com" <soft...@listproc.autodesk.com>
Sent: Tuesday, 25 September 2012, 10:45
Subject: RE: soft 2013 - multiple workgroups

Nic Groot Bluemink

unread,
Sep 25, 2012, 7:34:28 AM9/25/12
to soft...@listproc.autodesk.com
Multiple workgroups here as well. Since you mention accessing different versions of plugins - do be careful if you intend to live switch workgroups containing external renderers. As far as I'm aware that still results in some crashage, and doing a Softimage restart after a swap is safer.

Nic
--
Technical Pretty Picture Making Person
Kettle

Eric Turman

unread,
Sep 25, 2012, 1:11:47 PM9/25/12
to soft...@listproc.autodesk.com
Yep we have a ton of workgroups as well. The big thing with Arnold is that if you are switching to a project with a different Arnold version and need to switch workgroups, you'll need to restart Softimage afterwards like Nic said...not a big deal really.
--




-=T=-

Ed Manning

unread,
Sep 25, 2012, 1:26:57 PM9/25/12
to Adam Seeley, soft...@listproc.autodesk.com
Main thing to watch out for is how your render nodes (if any) are set up.  Easy but inefficient is to make them all point to a single workgroup that has all your add-ons, etc. in it, but that can also lead to conflicts, especially if you want to support multiple versions of things.

If you have a farm and are using Royal Render, it comes with a submission script module that will read the workgroup list from the submitting workstation and dynamically connect the render nodes to the right ones.  PSYOP does this and it works nicely. 

An added bonus is that it becomes easier to identify conflicts between add-ons.
Reply all
Reply to author
Forward
0 new messages