105 Commits

Author SHA1 Message Date
dave jones2
59187b1cef Fixed Blueprint type autoconversion for variable nodes. (resubmit)
Unlike other nodes, the variable node is the only that has a ArePinTypesCompatible check. This created a discrepancy: type changes on function nodes would preserve the link and create a compilation error, but type changes on variable nodes would orphan the pin.

For consistency, this removes the ArePinTypesCompatible check. More importantly, this also fixes auto type conversion, which will analyze the link and insert a cast node at a later stage. However, there's also some legacy cruft that only applied to object pins with mismatched types. This particular edge case has been preserved, but it might need follow up to see if it's still needed.

Additionally, fixed a logic bug with bCanMatchSelfs.

#rb phillip.kavan

[CL 26055799 by dave jones2 in 5.3 branch]
2023-06-16 12:09:55 -04:00
dave jones2
481d54fa16 [Backout] - CL26019059
[FYI] dave.jones2
Original CL Desc
-----------------------------------------------------------------
Fixed Blueprint type autoconversion for variable nodes.

Unlike other nodes, the variable node is the only that has a ArePinTypesCompatible check. This created a discrepancy: type changes on function nodes would preserve the link and create a compilation error, but type changes on variable nodes would orphan the pin.

For consistency, this removes the ArePinTypesCompatible check. More importantly, this also fixes auto type conversion, which will analyze the link and insert a cast node at a later stage. However, there's also some legacy cruft that only applied to object pins with mismatched types. This particular edge case has been preserved, but it might need follow up to see if it's still needed.

#rb phillip.kavan

[CL 26052839 by dave jones2 in 5.3 branch]
2023-06-16 11:13:23 -04:00
dave jones2
7acf6aeab5 Fixed Blueprint type autoconversion for variable nodes.
Unlike other nodes, the variable node is the only that has a ArePinTypesCompatible check. This created a discrepancy: type changes on function nodes would preserve the link and create a compilation error, but type changes on variable nodes would orphan the pin.

For consistency, this removes the ArePinTypesCompatible check. More importantly, this also fixes auto type conversion, which will analyze the link and insert a cast node at a later stage. However, there's also some legacy cruft that only applied to object pins with mismatched types. This particular edge case has been preserved, but it might need follow up to see if it's still needed.

#rb phillip.kavan

[CL 26039282 by dave jones2 in 5.3 branch]
2023-06-16 03:19:41 -04:00
dave jones2
e203cea604 UE-183502 - BP autoconversion adds extraneous conversion nodes (resubmit)
(Resubmit: added check for "multiple self" connections. Even though the types mismatch, we permit these connections.)

The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#rb phillip.kavan

[CL 25834276 by dave jones2 in ue5-main branch]
2023-06-06 21:17:28 -04:00
bob tellez
89ca3b4813 [Backout] - CL25727793
[FYI] dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-183502 - BP autoconversion adds extraneous conversion nodes

The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#preflight 647102108145a219b1209905
#rb phillip.kavan

[CL 25748352 by bob tellez in ue5-main branch]
2023-06-01 19:38:24 -04:00
dave jones2
58bc468b87 UE-183502 - BP autoconversion adds extraneous conversion nodes
The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#preflight 647102108145a219b1209905
#rb phillip.kavan

[CL 25727812 by dave jones2 in ue5-main branch]
2023-06-01 11:29:35 -04:00
dan oconnor
c2b222968e Make sure we don't select skel class when accessing a sparse clas datamember that has been moved from a member variable
#preflight https://horde.devtools.epicgames.com/job/6467da78434f5536a3950d5b
#jira UE-186566
#rb Phillip.Kavan

[CL 25554705 by dan oconnor in ue5-main branch]
2023-05-19 19:05:49 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
dave jones2
d9397ab592 UE-172222 - Improve redirect support for Blueprints. (resubmit)
A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63d85cf57a39a1802189bdda
#rb phillip.kavan

[CL 24029327 by dave jones2 in ue5-main branch]
2023-02-06 09:08:45 -05:00
dave jones2
7b2e42b662 [Backout] - CL23629872 (Assorted BP compilation issues)
#fyi dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-172222 - Improve redirect support for Blueprints.

A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63b72580af3ebedd9988ae4c
#rb benjamin.fox,dan.oconnor

[CL 23657454 by dave jones2 in ue5-main branch]
2023-01-11 18:54:32 -05:00
dave jones2
1f3ca97244 UE-172222 - Improve redirect support for Blueprints.
A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63b72580af3ebedd9988ae4c
#rb benjamin.fox,dan.oconnor

[CL 23629872 by dave jones2 in ue5-main branch]
2023-01-10 13:35:44 -05:00
dave jones2
8c46603276 UE-169957 - Rewiring split pins after a type change creates an orphaned pin
Allow rewiring split pins that have had their type changed, which ERedirectType_Name permits. Oddly, the Break Struct nodes already work in this case, but that's because they completely bypass UK2Node_Variable::DoPinsMatchForReconstruction, and call the implementation in UK2Node::DoPinsMatchForReconstruction instead.

#jira UE-169957
#preflight 6377b83af514e1ded9b9258f
#rb phillip.kavan,ben.hoffman

[CL 23197324 by dave jones2 in ue5-main branch]
2022-11-18 12:10:46 -05:00
bryan sefcik
925161d3e2 Another IWYU pass on Engine/Source/Editor/...
#jira

[CL 21716486 by bryan sefcik in ue5-main branch]
2022-08-30 23:04:40 -04:00
bryan sefcik
0837230669 Ran IWYU again on half of the Engine/Source/Editor/... source files.
#jira

[CL 21716414 by bryan sefcik in ue5-main branch]
2022-08-30 23:03:03 -04:00
benjamin fox
afdf0e750d Fix conflicting LOCTEXT keys
#jira UE-161692
#rb trivial
#preflight skip

[CL 21509489 by benjamin fox in ue5-main branch]
2022-08-23 11:48:15 -04:00
benjamin fox
0d7969323a Improve UX of Suppressed Deprecation Messages
#jira UE-160751
#jira UE-160753
#rb trivial
#preflight skip

[CL 21496738 by benjamin fox in ue5-main branch]
2022-08-22 18:45:26 -04:00
benjamin fox
9560c093d9 Allow users to supress BP compiler deprecation warnings for specific properties or functions via project settings
#jira UE-160577
#preflight 62f2b7df3f500fb6dcfa7513
#preflight 62f2bceaf75a2a539c44a908
#rb marc.audy
#fyi kriss.gossart

[CL 21321899 by benjamin fox in ue5-main branch]
2022-08-10 13:41:00 -04:00
jordan hoffmann
0e53056bc6 Clang now optimizes away this==nullptr. Calls to IsChildOf from a null UObject pointer will cause undefined behavior. This is a retroactive attempt to pad potentially dangerous calls to IsChildOf with a null check in the following directories:
- Plugins/BlueprintContext
- Editor/GlueprintGraph
- Editor/GraphEditor
- Editor/Kismet
- Editor/KismetCompiler
- Editor/UnrealEd/Private/Kismet2

note: if you're seeing this CL in the perforce history because you're trying to figure out why there's a null check that doesn't make sense, This is why. The goal of this CL is to preserve the behavior before IsChildOf changed rather than analyze whether that behavior makes sense. Use your best judgement

#rb marc.audy
#preflight 6299023a6438e3c731307a69

[CL 20474984 by jordan hoffmann in ue5-main branch]
2022-06-02 16:09:18 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
jamie dale
d6a0168c56 Favor instance data over sparse data when resolving BP pins to properties
#preflight 6210063353204823ae89dcb1
#rb Fred.Kimberley
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19057231 via CL 19057259 via CL 19057314 via CL 19057347 via CL 19059615
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066310 by jamie dale in ue5-main branch]
2022-02-21 02:04:20 -05:00
dave belanger
4b72e06fd5 Disable code navigation when C++ is not allowed in the editor
#rb Rex.Hill
#preflight 6202c1f2e85c7a08bbf3987b

#ROBOMERGE-OWNER: dave.belanger
#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 18918552 via CL 18918618 via CL 18918624 via CL 18918631 via CL 18922663 via CL 18923570
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18923679 by dave belanger in ue5-main branch]
2022-02-09 15:28:22 -05:00
benjamin fox
9d8c9ae050 Fix crash when pasting local variable from parent blueprint into child event graph
#jira UE-116043
#rb phillip.kavan
#preflight 61df303a9c1e5c90b6127974

#ROBOMERGE-AUTHOR: benjamin.fox
#ROBOMERGE-SOURCE: CL 18588428 in //UE5/Release-5.0/... via CL 18588452 via CL 18588494
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18588505 by benjamin fox in ue5-main branch]
2022-01-12 15:07:43 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
benjamin fox
27cd82d09a Allow pasted variable get nodes in function scope to look for parameters
#jira UE-114666
#rb phillip.kavan

#ROBOMERGE-AUTHOR: benjamin.fox
#ROBOMERGE-SOURCE: CL 17546012 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17546017 by benjamin fox in ue5-release-engine-test branch]
2021-09-16 19:12:11 -04:00