In the Vuforeal plugin, you can create an Image Observer, to track an Image target, using a new custom ActorComponent called “VuforealImageObserverComp“. Using this option will give you more in-editor control over how you want to set up and manipulate your ImageObserver.
Adding a VuforealImageObserverComp #
To add the ActorComponent to your BP Actor, go to the “Components Tab”, click on the +Add button, and search for VuforealImageObserverComp
Configuring the Image Target #
With the Vuforeal plugin, we gave the user different ways to configure a Target, one of which is implemented directly in the details panel of the VuforealObserverComp, under the Vuforeal Section.
To configure and associate a Target to your VuforealObserverComp, you need to follow these steps:
Choosing a Target Source #
In the Comp details panel under Vuforeal -> Target Source, choose from the dropdown the source of the Target.
we have for now:
- Imported Database
- Target Config
- Literal Name
Depending on the selected source, you’ll get slightly different options to select and configure a target:
Target Source: Imported Database #
If you choose the “Imported Database” source option, you’ll get under the “Target Configuration” section, an “Imported Database” input; this will filter all the imported Database Assets by the ObserverComp type, for example, in the case of an ImageObserverComp, you’ll only get the Image Databases imported to your project.
Once you select the actual Database Asset from the asset picker, the “Database Name” value, will be automatically filled with the Database’s unique name, and the “Target To Track” dropdown input will be populated with all the available image Targets from the selected Database. You can select from the list the target you want to track.
Target Source: Target Config #
To use a TargetConfig Asset as a Source, you need first to create one in your project. These are custom Assets that enable you to save a Target Configuration and use it in multiple places.
For more info on the TargetConfig Asset, check Vuforeal Target Config UAsset.
When you choose the Target Config option as a Target Source, you’ll have the Image Target Config input, this will filter all the available Image Target Config created in your project.
When you select a TargetConfig, the “Database Name” and the “Target To Track”, will get filled automatically with the values from your selected TargetConfig. These values are always in sync with the values of the selected TargetConfig, so they get updated with every change.
Target Source: Literal Name #
If you choose the “Literal Name” option, you will get two text inputs, where you can type the literal name of the Database and the Target.
Creating the actual ImageObserver Object #
With the VuforealImageObserverComp, you can create the VuforealImageObserverObject either via an automatic route or a manual route.
Automatic Creation #
This is the fastest way with minimal setup, to create the Image Observer Object and start tracking.
All you need to do, after configuring the Target, is to verify that the Auto options are set to true. You need to verify two booleans:
- The first is in the VuforealSessionConfig -> AutoCreateObservers (True by default).
- The second setting is in the VuforealImageObserverComp detail panel under
Vuforeal -> AutoSettings -> AutoCreateObserver (True by default).
For more details with a practical example, you can check the provided BP actor in the “Vuforeal_Project_Sample” under Content/BPs/BP_ImageCompAuto
Manual Creation #
This is using the same VuforealImageObserverComp, but here you disable the Auto options and set up the calls manually for more control.
You can opt into the Manual route either using:
The global control in the VuforealSessionConfig -> AutoCreateObservers (which is True by default), with this boolean you can enable or disable the Auto creation for all the ObserverComp types.
Or with a specific bool for each ObserverComp, under Vuforeal -> AutoSettings -> AutoCreateObserver, this allows for more control, where you can set each component to either take the Auto creation mode or the Manual mode.
Setting up the Manual mode:
- First, make sure you’ve set up the target you want to track.
- Then call the “Create Vuforeal Image Observer” BP function from the VuforealImageObserverComp:
This will output a “Vuforeal Image Observer” Object, identical to any other “VuforealObserver” object; for more info on these Observers check: Working with Vuforeal Observers
It’s always a good practice to call any Vuforeal function after the Vuforeal Session is ready since most of the features require a running session. But in the case of creating a VuforealObserver, you can actually call these functions even before the session is ready, because we put in place a system that saves all the Create calls that are made before the session is ready, and postpones their creation till after the session is ready. For more info on this system check: <insert link>.
For more details on the manual setup with a practical example, you can check the provided BP actor in the “Vuforeal_Project_Sample” under Content/BPs/BP_ImageCompManual