Jump to content


Photo

Switch Operator In Fusion?


  • Please log in to reply
37 replies to this topic

#1 Unaided

Unaided

    Member Pig

  • Adv Members
  • PipPip
  • 15 posts

Posted 13 December 2010 - 09:04 AM

Anyone knows a script or tool like Nuke switch op for Fusion?

Nuke's switch operator is in essence a node to connect input multiples branch and assign a integer number (id), and only one branch output is active switching the number.

Attached Files



#2 bfloch

bfloch

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 960 posts

Posted 13 December 2010 - 09:16 AM

Check Tilt's excellent switch fuse:
http://vfxpedia.com/...ird_Party_Fuses

#3 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 13 December 2010 - 09:16 AM

Anyone knows a script or tool like Nuke switch op for Fusion?

Nuke's switch operator is in essence a node to connect input multiples branch and assign a integer number (id), and only one branch output is active switching the number.


I wrote a Fuse recently for exactly the same reason :-)
You can find it here: http://www.vfxpedia....ird_Party_Fuses

That said, I haven't fully tested it in production yet. It's "AS IS".
Please make sure no connections get messed up if you save and reopen the comp.
And it won't pass through the DoD in case you depend on it.

Otherwise, there's the Switcher macro on Vfxpedia as well.

* edit: Ok, let me rephrase that :-) It won't blow up your PC. But I haven't tested what happens if you animate the slider, then copy-paste it to another comp, instance it 5 times and then... (you get the point :-) )

#4 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 13 December 2010 - 11:30 AM

Switch fuse calculate all input, and only after that thay give result. I think it's a big bug, please fix it.

#5 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 13 December 2010 - 11:39 AM

Switch fuse calculate all input, and only after that thay give result. I think it's a big bug, please fix it.


It shouldn't do this. I just checked and it seems like it renders the input when you first connect it. Once that is done (or if you close and reopen the comp or clear the cache) it works as expected.

I'll investigate this...

Thanks for the feedback!

#6 Unaided

Unaided

    Member Pig

  • Adv Members
  • PipPip
  • 15 posts

Posted 13 December 2010 - 02:22 PM

Thanks a lot Tilt for this fuse! and for all replies.

I check Switch Fuse in Fusion 6.0, but when I connect first input, don't make add a new input connector in Switch fuse node.
I try set INP_MaxAllowed = 5; but don't change nothing
Also, I uncommented this line in OnConnected function
print("inpNr = ",inpNr,"maxNr = ",maxNr,"old = ",old,"new = ",new)
but don't print nohting in Console when I connect or disconnect a input.

Thanks

#7 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 13 December 2010 - 03:21 PM

It's possible that Fuses in Fusion 6 doesn't support the necessary event call (OnConnected). In this case there would be nothing I can do, except writing an alternative version where there's a predefined number of inputs from the start. You could use the switch8r macro from vfxpedia. It supports 8 connections and is based on standard Fusion tools.

By the way, the INP_MaxAllowed is just the maximum number for the slider control. It doesn't produce new inputs if you change it.



#8 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 14 December 2010 - 05:35 AM

seems like the Fuse also resets the slider to 1 when you reopen the comp. That's what you get for releasing beta stuff :mf_pain:
I'll investigate this.

#9 bfloch

bfloch

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 960 posts

Posted 14 December 2010 - 08:43 AM

Don't be so hard on yourself. At least the price is unbeatable ;)

#10 Unaided

Unaided

    Member Pig

  • Adv Members
  • PipPip
  • 15 posts

Posted 14 December 2010 - 08:46 AM

Well, I tried in Fusion 6.1.697 and Switch Fuse runs ok for me. Thanks!

#11 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 14 December 2010 - 11:39 AM

Ok, guys, thanks for feedback and kind words :-) Here's an updated version that should actually work. There were a lot of issues I hadn't considered: The input priorities were only correct after you had used the slider at least once. Before that, it would still render undesired branches.
(I think I'll also compile a document about what event gets generated by Fusion when you add a Fuse to the flow... might be useful for other Fuse authors.).

Please try the following version 1.2.

Attached Files



#12 ploveday

ploveday

    Member Pig

  • Adv Members
  • PipPip
  • 28 posts

Posted 16 December 2010 - 09:11 PM

It would probably make your life easier if you just set all the image inputs to be INP_SendRequest = false, do away with CheckRequest and priority stuff, and then GetSource() the one you want in Process.

- Peter




#13 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 17 December 2010 - 05:27 PM

Yeah , now that I know about this nifty attribute :-) Thanks for pointing it out.
Is it available in Fuses from the start or was it added recently?

cheers
Stefan

#14 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 17 December 2010 - 05:59 PM

Yeah, nice tip, lousy docs. :)

#15 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 20 December 2010 - 09:06 AM

Updated version according to Peter's suggestion:

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users