print $referenceNode;
Gets the name of the current active ref/proxy - not the associated ref/proxy.

proxySwitch requires the name of the associated ref/proxy (ie: the one you want to switch TO, not from) :(

Nyro

12-04-2012, 08:57 AM

Yeah... uhm.. well I've never used a proxy before so I have not a clue, sorry :)

DeadlyNightshade

12-04-2012, 10:42 AM

Tried some of the flags to referenceNode and I still can't get the name of the associated proxy OR reference

Nyro

12-04-2012, 10:50 AM

To be honest, I don't even understand what you are referring to when you say "association".

How many reference nodes are we talking about here? What other reference node would you need to query but the one your object belongs to?

EDIT

Hang on, I think I was being a bit dense. I believe I now understand your problem. Give me a sec to create a test setup and investigate a solution ;)

DeadlyNightshade

12-04-2012, 11:22 AM

What I mean is that they are linked.
You add a proxy model to an already existing reference model - and they become link (or associated). Moving one of them, moves the other and so on.

I do not know "how" they are tied together though, as it doesn't seem to be a parent-child relationship.

Nyro

12-04-2012, 12:00 PM

Phew.

So I scoured proxyAdd.mel, proxySwitch.mel and proxyUtils.mel to see how it's done by Autodesk.
Long story short: I truly disliked all this stuff about connectionInfo and analyzing plugs, especially when we're dealing with frackin message attributes. Gave me a headache.

proxyQuickSwitch;
This code only works properly if there is only 1 Proxy; if you look at the final for-loop, you'll see that it stops as soon as it finds a referenceNode that is not the current reference node. If you had the original Reference and then two proxies, the code might just switch from one proxy to another, but never to the original, etc.
I'll leave it to you to figure out some logic to workaround that issue ;)

DeadlyNightshade

12-04-2012, 12:59 PM

Awesome - you've helped out more than enough.
Thanks a bunch!

Nyro

12-04-2012, 01:22 PM

no problemo

CGTalk Moderation

12-04-2012, 01:22 PM

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.