Adding pin to CR node causes crash if input variable is assigned to one of the element

When a node has a variable assigned to one of its pins. You will get a crash every time you add a pin. I am sure this goes for all nodes with with the “add pin” functionality

[Image Removed]

Steps to Reproduce
Run the following script to create the control rig. Add a pin to the Concat node. You will get an immediate crash.

import unreal
unreal.load_module('ControlRigDeveloper')
factory = unreal.ControlRigBlueprintFactory
blueprint = factory.create_new_control_rig_asset(desired_package_path = '/BBF_Rig/Crashes/Concat')
hierarchy = blueprint.hierarchy
hierarchy_controller = hierarchy.get_controller()
blueprint.set_preview_mesh(unreal.load_object(name='None', outer=None))
import unreal
def create_asset():


	library = blueprint.get_local_function_library()
	library_controller = blueprint.get_controller(library)
	blueprint.set_auto_vm_recompile(False)
	function_new_function = library_controller.add_function_to_library('New Function', mutable=False)
	graph = function_new_function.get_contained_graph()
	library_controller.set_node_category_by_name('New Function', '')
	library_controller.set_node_keywords_by_name('New Function', '')
	library_controller.set_node_description_by_name('New Function', '')
	library_controller.set_node_color_by_name('New Function', unreal.LinearColor(1.000000, 1.000000, 1.000000, 1.000000))
	blueprint.get_controller_by_name('New Function').set_node_position_by_name('Entry', unreal.Vector2D(-250.000000, 0.000000))
	blueprint.get_controller_by_name('New Function').set_node_position_by_name('Return', unreal.Vector2D(300.000000, -0.000000))
	blueprint.get_controller_by_name('New Function').add_exposed_pin('A', unreal.RigVMPinDirection.INPUT, 'FName', '', '')
	blueprint.get_controller_by_name('New Function').add_exposed_pin('A_1', unreal.RigVMPinDirection.INPUT, 'double', '', '0.000000')
	blueprint.get_controller_by_name('New Function').add_template_node('Concat::Execute(in A,in B,out Result)', unreal.Vector2D(0.000000, 0.000000), 'Concat')
	blueprint.get_controller_by_name('New Function').resolve_wild_card_pin('Concat.A', 'FName', 'None')
	blueprint.get_controller_by_name('New Function').bind_pin_to_variable('Concat.A', 'A')
	blueprint.get_controller_by_name('New Function').add_template_node('Add::Execute(in A,in B,out Result)', unreal.Vector2D(52.626038, 248.894745), 'Add')
	blueprint.get_controller_by_name('New Function').resolve_wild_card_pin('Add.A', 'double', 'None')
	blueprint.get_controller_by_name('New Function').set_pin_default_value('Add.A', '0.000000')
	blueprint.get_controller_by_name('New Function').bind_pin_to_variable('Add.A', 'A_1')
	blueprint.get_controller_by_name('New Function').set_pin_default_value('Add.B', '0.000000')
	blueprint.get_controller_by_name('RigVMModel').add_unit_node_from_struct_path('/Script/ControlRig.RigUnit_BeginExecution', 'Execute', unreal.Vector2D(0.000000, 0.000000), 'RigUnit_BeginExecution')
	blueprint.get_controller_by_name('RigVMModel').add_function_reference_node(function_new_function, unreal.Vector2D(360.000000, 53.000000), 'New Function')
	blueprint.get_controller_by_name('RigVMModel').set_pin_default_value('New Function.A_1', '0.000000')
	blueprint.set_auto_vm_recompile(True)
create_asset()


[Image Removed]

Hey there,

Thanks for raising this, I can repro this pretty easily and I’ve logged an issue. If you like you can follow along at https://issues.unrealengine.com/issue/UE-315108.

Unfortunately, I don’t have a workaround or code change recommendation at the moment.

Dustin

Thanks Dustin