-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Welcome to the Blueprint Component Reference Plugin wiki!
Blueprint Component Reference provides a universal way of referencing actor components during design time with component picker UI and rich customization.
There are several ways to install the plugin: from GitHub and from Marketplace (coming soon).
- Download source code archive from main or
Releasespage - Unpack the contents into "YourProjectFolder/Plugins/BlueprintComponentReferencePlugin" (create if missing)
- Activate plugin in editor
Pluginsmenu
- Find plugin in Unreal Engine Marketplace under
Code Pluginscategory:Blueprint Component Reference Plugin - Click on
Download, launcher would download it for you to specified engine - Activate plugin in editor
Pluginsmenu
Plugin provides following Blueprint APIs:
- Component Search is performed with
Get Referenced Component,Find Referenced Component,Get Referenced Componentsnodes. - Component Reference state can be checked with
Is Valid Component Reference,Is Null Component Referencenodes. - Equality and ToString conversion nodes.
Normal Variable:
- Create new variable of
Blueprint Component Referencetype in Actor Blueprint - In variable properties configure component selection rules and other traits
- Assign value to variable in details panel
- Locate referenced component within actor by using
Get Referenced ComponentorFind Referenced Componentnodes
Array Variable:
- Create new array variable of
Blueprint Component Referencetype in Actor Blueprint - In variable properties configure component selection rules and other traits
- Assign value to variable in details panel
- Locate referenced components within actor by using
Get Referenced Componentsnode
All plugin primary functions located in BlueprintComponentReference module BlueprintComponentReference.h file.
To add plugin features in project following steps are necessary:
- Enable
Blueprint Component Reference Pluginin Plugin Settings - Add
BlueprintComponentReferencemodule dependency in appropriateBuild.csfile - Use
BlueprintComponentReference.hheader file for theFBlueprintComponentReferencetype
FBlueprintComponentReference type can be used as a single property, array or map value.
Component selection rules and other traits can be specified with metadata specifiers. Latest list of specifiers can be found here
/* Reference to any actor component */
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FBlueprintComponentReference SingleComponentReference;
/* Array of references to any native component */
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(ShowNative=true, ShowBlueprint=false))
TArray<FBlueprintComponentReference> TargetComponents;
/* Map that uses reference as value and restricts to SceneComponents only */
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(AllowedClasses="/Script/Engine.SceneComponent"))
TMap<FGameplayTag, FBlueprintComponentReference> SimpleSceneCompReference;
More examples can be found in BlueprintComponentReferenceTests module.
Similar to engine component reference implementation FBlueprintComponentReference does not provide internal cache and each call of GetComponent will do resolve/search.
When repeated component search is an issue there are at least two ways to avoid repeated component search:
- caching search result separately
- using
TCachedComponentReferencehelper that wrapsFBlueprintComponentReferencewith a weak object pointer to found component.