Switch

https://user-images.githubusercontent.com/14288520/189731409-413d3278-54d4-4474-be18-90d959f0cbbf.png

Functionality

Switches between to sets of inputs. Also can work as filter.

Category

Logic -> Switch

Inputs

  • State - True or False (0 or 1)

  • A_0 - 10 - True, False or None

  • B_0 - 10 - True, False or None

Outputs

  • Out_0 - 10 - result of switching between two values

Parameters

Parameters

Type

Description

in/out number (N panel)

0 - 10

Number of socket sets

Usage

Generation of bool sequence easily:

https://user-images.githubusercontent.com/14288520/189741094-76efb8cf-bc66-4887-b486-7627cd714007.png

Working with different types of data:

https://user-images.githubusercontent.com/14288520/189732804-2d8be7a3-ba0c-435f-9ef6-605b5044ec3c.png https://user-images.githubusercontent.com/14288520/189732604-c36ab6c1-bbb4-4eee-b745-de5cc8e1b52e.gif

It is possible to deal with empty objects:

https://user-images.githubusercontent.com/14288520/189734577-f30d7df8-ef03-4469-9a7a-09f9fd7689fa.png

Using as filter:

https://user-images.githubusercontent.com/14288520/189739541-753f27e2-7129-4fe7-bc29-ce49637f9491.png

It has supporting of numpy arrays. Output is related with input from socket A and socket B. Output will be numpy array if at least one input sockets (A or B) has numpy array and another socket does not have list with two or more values.

https://user-images.githubusercontent.com/14288520/189739875-0cd27fc9-3e36-48fd-9b5a-e29de6cd2ff9.png

Alternative of list mask out node:

https://user-images.githubusercontent.com/14288520/189739962-68fc989e-38e6-4845-bc7f-dd473708308e.png

Working inside and outside of object level

Something unexpected can be with none iterable objects like matrix or Blender objects. On the picture below it can be expected that switch should add first matrix and second quaternion:

https://user-images.githubusercontent.com/14288520/189740102-41008bb1-8b2e-4abf-bc82-2d5bdef8de97.png

but for this states input should have values on first object level not on second data level:

https://user-images.githubusercontent.com/14288520/189740124-1ab19668-bf50-4f62-926a-7900cb8dbea1.png