VL - Constraint Types

Are “ConstraintTypes” always going to be limited to 4? If I want to make a ‘join’ and ‘split’ nodes for my own custom types is it even necessary or is it just good practice?

Well, you could probably use more of them. They don’t do anything when called and only help you reducing type parameters.

Do you want your data type to be generic? If not you could also use type annotations.

For generic data types that don’t do anything the type can’t be inferred from the patch itself. So for that case ConstraintTypes is meant to be a workaround, as we lack the feature of adding type parameters manually to the patch and referring to them in type annotations.

Anyway where do you use it? I wouldn’t say it’s good practice, but just a workaround for a very specific case. If you don’t need it don’t do it.

I was was toying around with the bezier patch and looking at how the join and split nodes were made.

I wondered if more points could be made and if the ConstraintTypes node would expand its input pins like the math operation nodes (+, -, *).

The thinking was of generic types, but with no specific need, I was just surveying.

ah alright. well, if we don’t come up with a better solution and stick to the idea of constraining types via a node that doesn’t really do a thing (which doesn’t feel like the best solution ever), then we’ll probably sooner or later make it expand its inputs. anyway for now just use more of them to get the same, or just imagine…

Hello again.

I have a generic input called “Value” which is comes from the property of an object called “DataObject”

This Value could be a float, a vector or a boolean. If Value is a float or vector, I want to be able to send it to a Map , but if its a boolean I want to send it to BooleantoValue.

How can I check the DataObject.Value’s type?

You can try CastAs and use the Success output together with a if region.
Or you can use the TypeSwitch regions. With these you can check for different types and describe what to do in case the provided data actually is of the desired data type (e.g. Boolean).

in either case just use the provided typed value (T1) as if would be of the desired data. E.g. just connect nodes that work on Booleans, which thereby tells the system, that it needs to check for Booleans.

Hmmm. Give it a try. It sounds more complicated than it really is.

Cool, Thanks Gregsn!