## wireless connections for everybody.

andromeda_girl
Fusionista
Posts: 320
Joined: Sun Feb 21, 2016 6:25 am
Been thanked: 1 time

### Re: wireless connections for everybody.

holy crap what a respnse.
and i actually edited my post to remove me ranting on about why i hate hidden connections in nuke, too
O_o

i have yet to read all this but it appears someone has already granted my wishes

but just for the record, i indeed despise hidden connections.
the reason is because nobody seems to use them in a logical and efficient manner, just willy-nilly making it impossible to take over another person's shot.
but having wireless connections in fusion can be designed [as i suggested] in a manner that makes it logical.
as long as a person knows there are hidden wires, then there is no harm done.
it's when they are hidden and you have no clue it's being done that people need to be chastised for it.

looking forward to trying out these new wireless tools, because only when i am rebuilding my PBR shaders in fusion for a model [such as my example with 524 shaders] does the desire to unsee a few wires starts to become a wishlist item.

otherwise, yeah. i am not a fan of hiding a damned thing.
Au

thibaud
Fusioneer
Posts: 133
Joined: Thu Sep 04, 2014 1:23 am
Been thanked: 1 time
Contact:

### Re: wireless connections for everybody.

ok, I did sound close minded and rigid... sorry about that
My feeling is that going wireless isn't the most elegant way to tackle the wire clutter problem...
there has to be some less sucking and more considerate options, like for example :
Alternate (dimmed/dashed) wire appearance combined with simple user action (rollover) to undim it

Unfortunately that's not going to happent until BMD adresses a long overdue node view experience improvement

JUNE
Fusioneer
Posts: 225
Joined: Wed Aug 06, 2014 5:45 am
Been thanked: 11 times
Contact:

### Re: wireless connections for everybody.

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

@JUNE Oh yeah.. It doesn't work... just an abandoned attempt. If you have any ideas to make that one or the WirelessMore fuse work you'd be forever awesome.

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

Okay...so I un-abandoned this and finally found a solution that works.

I've successfully combined wireless, wireless 3d and wireless materials into one tool that can actually pass on the result. This works similar to @SecondMan's "Wireless More" fuse and is partly based on it but creates inputs and outputs dynamically after initially selecting a mode.

For now, you get one opportunity to set the mode and then it is locked. If someone knows how to destroy an input and output via the NotifyChanged function then I can revise this. I've already tried

Code: Select all

self:RemoveOutput('outputName'), self:RemoveControl('outputName') and a few other variations
The Fuse:
WirelessAnything.fuse
Test Comp:
WirelessAnything Tests.comp
You do not have the required permissions to view the files attached to this post.

SirEdric
Fusionator
Posts: 1741
Joined: Tue Aug 05, 2014 10:04 am
Real name: Eric Westphal
Been thanked: 77 times
Contact:

### Re: wireless connections for everybody.

Cool stuff!
Just a wild guess here...
Maybe if there's only *one* (main) input and output, you can't destroy that one?
Did you try adding a second Input/Output first, and then destroying the first one?
(Again...just guessing...)

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

Yeah I tried first with a single input that accepts multiple types and just overwriting the same output but stuff gets mucked up along the way. It may be possible if certain things are executed in a very precise order.

SecondMan
Posts: 3367
Joined: Thu Jul 31, 2014 5:31 pm
Been thanked: 65 times
Contact:

### Re: wireless connections for everybody.

Well, it may not be as pretty as we'd like but I think we may have kind of almost nailed it, albeit a little hacky.

I couldn't resist trying, so now my brain hurts and I really need to go to bed. I'll explain later but here's something to test if I'm right

EDIT: I'm just thinking there may be a way to make this even better... but not now...
You do not have the required permissions to view the files attached to this post.

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

I tried something (many things actually) like this and the problem I ran into is how to destroy the Output first. Notice that whichever type you plug in first will remain the output type even after switching modes and then the output type gets updated to the previous on the next attempt.

Example:
-then reset
-then try '3d'. --The output is still in image mode.
-then try 'material'. --The output type finally switches to 3D.

An off-by-one or order of operations bug from NotifyChanged. This is why I simply hid the mode dropdown after the first choice is made.
My next thought was to create a completely new handler function that is called by each mode change from within NotifyChanged after all other updates... a function that will simply force refresh the tool.

I'm looking through the scripting guide now and see a couple things to try:
INPB_ForceNotify
INPI_Priority

I'll fiddle with this later today.

SecondMan
Posts: 3367
Joined: Thu Jul 31, 2014 5:31 pm
Been thanked: 65 times
Contact:

### Re: wireless connections for everybody.

That sounds familiar.

I should combine this into the previous topic, lest we're eating our tails here...

That will be my contribution for today

JUNE
Fusioneer
Posts: 225
Joined: Wed Aug 06, 2014 5:45 am
Been thanked: 11 times
Contact:

### Re: wireless connections for everybody.

WirelessAnything.fuse
try again
You do not have the required permissions to view the files attached to this post.

Midgardsormr
Fusionator
Posts: 1002
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 47 times
Contact:

### Re: wireless connections for everybody.

Something that has always bothered me about the Wireless Link is that copy-paste breaks the Input connection (naturally, that's how all the tools work, after all). I decided to hack at this one for a little while to see if I could come up with a way to have it save its input into CustomData so that when it's copied that information comes along. Then you could just push a button to relink it. Or better yet, push a button and relink all the WirelessAnythings in the comp. This would make it so easy to copy-paste templates—something that I anticipate doing 41 times tomorrow afternoon.

While I can easily save and load CustomData in the Fuse, I can't quite figure out how to get the Connected Output's name from the Input itself. I tried querying several things in an OnConnected() function, but all I could ever get Fusion to tell me was 'struct cdata'.

It's possible that I'm just going about it all wrong. Anybody have any ideas? I mean, I can do it with a script button, and I may well do that tomorrow, but it would be cool if it could be built into the tool.

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

I had that same issue when working out some other things, Bryan....One of the reasons I had to make all the linked inputs and outputs dynamic and in their own namespaces. The 'hack' that I came up with is to first make that InMode dropdown and everything else is based on it...maybe if that selection is also stored you'll get the right output since the output is actually created using notifychanged from the InMode input.

...or are you referring to storing the referenced tools name like this?

Code: Select all

if tool.InImage then SrcName = tool.InImage:GetConnectedOutput():GetTool():GetAttrs()['TOOLS_Name'] end
print (SrcName)

(which is already used in the fuse BTW but for the rename button under the guise "GetNewName")
Last edited by intelligent machine on Sat Mar 09, 2019 10:24 pm, edited 1 time in total.

intelligent machine
Fusionista
Posts: 399
Joined: Fri May 13, 2016 10:01 pm
Location: Austin, Texas, USA
Been thanked: 28 times
Contact:

### Re: wireless connections for everybody.

Also, I've already started on incorporating a 'wireless merge' and 'wireless merge3d' into the tool...promising so far but had to place it on hold until I after I take care of some client work.

Midgardsormr
Fusionator
Posts: 1002
Joined: Wed Nov 26, 2014 8:04 pm
Location: Los Angeles, CA, USA
Been thanked: 47 times
Contact:

### Re: wireless connections for everybody.

Kinda... I experimented with storing the data using a button. Actually, I just inserted it into your GetSource command for testing:

Code: Select all

	GetSource = [[
if tool.InImage then
comp:SetActiveTool(tool.InImage:GetConnectedOutput():GetTool())
tool:SetData('source', tool.InImage:GetConnectedOutput():GetTool())
end
if tool.In3D then comp:SetActiveTool(tool.In3D:GetConnectedOutput():GetTool()) end
if tool.InMtl then comp:SetActiveTool(tool.InMtl:GetConnectedOutput():GetTool()) end
if tool.InPtcl then comp:SetActiveTool(tool.InPtcl:GetConnectedOutput():GetTool()) end
]]

That successfully stores the Output. But I couldn't make it work in OnConnected(), which is where it would be most convenient, since it would store the metadata as soon as a connection was made.

Code: Select all

function OnConnected(link, old, new)

Once the data is in there, using a button to restore it works fine. I didn't get to the point of trying to restore it in OnAddToFlow(), although a little experimentation just now wasn't promising. But I need to get to work, so for today's project I'll just MacGyver it with a script.