Fixed adding links to output node of blend tree.
This commit is contained in:
parent
25776f2b2d
commit
acbe3a4ed5
@ -533,6 +533,12 @@ void HandleConnectionCreation(BlendTreeResource& current_blend_tree) {
|
|||||||
if (ax::NodeEditor::BeginCreate()) {
|
if (ax::NodeEditor::BeginCreate()) {
|
||||||
ax::NodeEditor::PinId input_pin_id, output_pin_id;
|
ax::NodeEditor::PinId input_pin_id, output_pin_id;
|
||||||
if (ax::NodeEditor::QueryNewLink(&input_pin_id, &output_pin_id)) {
|
if (ax::NodeEditor::QueryNewLink(&input_pin_id, &output_pin_id)) {
|
||||||
|
if (input_pin_id == output_pin_id) {
|
||||||
|
ax::NodeEditor::RejectNewItem();
|
||||||
|
ax::NodeEditor::EndCreate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ax::NodeEditor::PinId source_pin = input_pin_id;
|
ax::NodeEditor::PinId source_pin = input_pin_id;
|
||||||
ax::NodeEditor::PinId target_pin = output_pin_id;
|
ax::NodeEditor::PinId target_pin = output_pin_id;
|
||||||
|
|
||||||
@ -561,7 +567,7 @@ void HandleConnectionCreation(BlendTreeResource& current_blend_tree) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source_pin) {
|
if (!source_pin.Invalid) {
|
||||||
OutputPinIdToNodeIndexAndSocketIndex(
|
OutputPinIdToNodeIndexAndSocketIndex(
|
||||||
source_pin.Get(),
|
source_pin.Get(),
|
||||||
&source_node_index,
|
&source_node_index,
|
||||||
@ -586,7 +592,7 @@ void HandleConnectionCreation(BlendTreeResource& current_blend_tree) {
|
|||||||
const AnimNodeResource* target_node = nullptr;
|
const AnimNodeResource* target_node = nullptr;
|
||||||
const Socket* target_socket = nullptr;
|
const Socket* target_socket = nullptr;
|
||||||
|
|
||||||
if (target_pin) {
|
if (!target_pin.Invalid) {
|
||||||
InputPinIdToNodeIndexAndSocketIndex(
|
InputPinIdToNodeIndexAndSocketIndex(
|
||||||
target_pin.Get(),
|
target_pin.Get(),
|
||||||
&target_node_index,
|
&target_node_index,
|
||||||
@ -620,7 +626,7 @@ void HandleConnectionCreation(BlendTreeResource& current_blend_tree) {
|
|||||||
target_node_socket_index;
|
target_node_socket_index;
|
||||||
sNodeConnectionDebugState.targetSocket.socket = target_socket;
|
sNodeConnectionDebugState.targetSocket.socket = target_socket;
|
||||||
|
|
||||||
if (source_pin && target_pin) {
|
if (!source_pin.Invalid && !target_pin.Invalid) {
|
||||||
if (source_socket == nullptr || target_socket == nullptr
|
if (source_socket == nullptr || target_socket == nullptr
|
||||||
|| !current_blend_tree.IsConnectionValid(
|
|| !current_blend_tree.IsConnectionValid(
|
||||||
source_node,
|
source_node,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user