x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How do you call interface function from a different module in Blueprints?

I want to call ExportAssets from the IAssetTools interface. There's already an implementation of this interface in "Source/Developer/AssetTools/AssetTools.h" and its part of the AssetToolsModule. When I call the function in blueprint nothing happens.

alt text

However this does nothing. What I had to do was create a cpp class that includes that module and creates a function to call that function.

 #pragma once
 
 #include "CoreMinimal.h"
 #include "Engine/SceneCaptureCube.h"
 #include "AssetToolsModule.h"
 #include "SceneCaptureIng.generated.h"
 
 /**
  * 
  */
 UCLASS(Blueprintable)
 class CAPTUREENVIRONMENT_API ASceneCaptureIng : public ASceneCaptureCube
 {
     GENERATED_BODY()
 
     UFUNCTION(BlueprintCallable)
     void ExportAsset(const TArray<FString> assetsToExport, const FString exportPath) 
     {
         FAssetToolsModule::GetModule().Get().ExportAssets(assetsToExport, exportPath);
     }
     
 };

I just inherit from this cpp class in a blueprint and then call that function and it works. There has to be an easier way then this?

Product Version: UE 4.17
Tags:
more ▼

asked Oct 24 '17 at 07:51 PM in Blueprint Scripting

avatar image

Rynold
56 8 9 15

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

A Interface itself does nothing and the node will ignore everything that did not implement that Interface (Target). Since you want to call the already implemented Functionality of FAssetToolsModule the way you got it is correct. You could also implement the Interface on your Class but you would do the exact same thing there. The only benefit would be that you can call it trough the Interface.

You might want to lookup what a Interface is (easy to find on the Internet)

more ▼

answered Oct 24 '17 at 08:22 PM

avatar image

Nachtmahr
6.9k 143 25 171

avatar image Rynold Oct 24 '17 at 08:48 PM

I know what an interface is. I just wanted to know if there was a way for me to access the implementation that already exist in blueprints without having to make this cplusplus class.

avatar image Rynold Oct 26 '17 at 03:09 PM

That doesn't work. It's telling me the value it gets is a default implementation. However the function doesn't do anything. I put a break point in the code and got nothing. I also looked into the interface blueprints and I couldn't even inherit from IAssetTools. Is this just something you can't do in Blueprints?

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question