Visual scripting — Bolt — Reroute Node

Hey folks!

How to add "empty dots" in Bolt to make connections looks cleaner on diagrams?
There is such function in Unreal, does Bolt have something similar?

Best Regards, Dmitrii

Bolt Community Addons have a reroute node: https://github.com/RealityStop/Bolt.Addons.Community

2 Likes

Thank you

Hm, I adapted the script to Unity 2021 VisualScripting but unfortunately, even with [PortLabelHidden], the node is not as compact as with Bolt.

7539476--931292--Bolt Addons Community Value Reroute units work but are not compact.png

Unless I'm missing something?

This is what the Release page shows:


My adapted code:

// Adapted from Bolt Addons Community ValueReroute unit
// https://github.com/RealityStop/Bolt.Addons.Community/blob/master/Runtime/Fundamentals/Units/Utility/ValueReroute.cs
// https://github.com/RealityStop/Bolt.Addons.Community/blob/master/LICENSE (MIT License)

using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

namespace CommonsHelper
{
    [UnitCategory("Utility")]
    [UnitTitle("Value Reroute")]
    [UnitShortTitle("Value Reroute")]
    public sealed class ValueReroute : Unit
    {
        [DoNotSerialize]
        [PortLabelHidden]
        public ValueInput input;

        [DoNotSerialize]
        [PortLabelHidden]
        public ValueOutput output;

        [Serialize]
        public Type portType = typeof(object);

        protected override void Definition()
        {
            input = ValueInput(portType, "in");
            output = ValueOutput(portType, "out", flow => flow.GetValue(input));
            Requirement(input, output);
        }
    }
}
// Adapted from Bolt Addons Community FlowReroute unit
// https://github.com/RealityStop/Bolt.Addons.Community/blob/master/Runtime/Fundamentals/Units/Utility/FlowReroute.cs
// https://github.com/RealityStop/Bolt.Addons.Community/blob/master/LICENSE (MIT License)

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

namespace CommonsHelper
{
    [UnitCategory("Utility")]
    [UnitTitle("Flow Reroute")]
    [UnitShortTitle("Flow Reroute")]
    public class FlowRerouteUnit : Unit
    {
        [DoNotSerialize]
        [PortLabelHidden]
        public ControlInput input;

        [DoNotSerialize]
        [PortLabelHidden]
        public ControlOutput output;

        protected override void Definition()
        {
            input = ControlInput("in", flow => output);
            output = ControlOutput("out");
            Succession(input, output);
        }
    }
}

The reroutes are compact because we have a custom widget that overrides the background drawing. You can't get this with just the units themselves. Look for ValueRerouteWidget and FlowRerouteWidget to learn how the compact design is created. In fact, even now the block is completely hidden unless the node is selected or hovered. You can find the code for all the latest changes in the UVSsupport-Dev branch.

7540837--931471--Screenshot_20211002-095027.jpg