The documentation: https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Reference/Metadata/index.html
shows the RestrictedToClasses meta syntax as being RestrictedToClasses="Class1, Class2", but the actual code that applies the restrictions expects a space as a delimiter and not a comma.
In BlueprintActionFilterImpl::IsRestrictedClassMember:
bIsClassListed = (ClassName == ClassRestrictions) || !!FCString::StrfindDelim(*ClassRestrictions, *ClassName, TEXT(" "));
Changing to using spaces instead of commas works properly:
UCLASS(meta=(RestrictedToClasses="Class1 Class2"))
I would suggest changing the actual code to look for commas because using purely spaces as delimiters like this is weird and is unlike every other meta specifier syntax in Unreal which are comma-based.
1.Create a New C++ Project in Unreal 4.22
2.Create an UBlueprintFunctionLibrary with at least one Blueprint-exposed function and use the RestrictedToClasses UCLASS meta as shown here to restrict it to more than 1 class: https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Reference/Metadata/index.html
Expected: All classes listed using the syntax shown in the documentation should be permitted to use the function.
Results: Only the last class in the list will be permitted to use the function from the library instead of all the classes listed.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-77597 in the post.
0 |
Component | UE - Gameplay |
---|---|
Affects Versions | 4.21, 4.22, 4.23 |
Target Fix | 4.23 |
Created | Jul 19, 2019 |
---|---|
Resolved | Jul 22, 2019 |
Updated | Sep 6, 2020 |
6058 - projectgheist |