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"

Problems whith AssetTypeActions

Hi, I making a pluging with my own Asset type. I registered asset types:

 void FMySuperModule::StartupModule()
 {
     // Register asset types
     IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
     MySuperAssetTypeActions = MakeShareable(new FMySuperAssetTypeActions);
     AssetTools.RegisterAssetTypeActions(MySuperAssetTypeActions.ToSharedRef());
 };

It's MySuperAssetTypeActions.h:

 #include "MySuperModulePrivatePCH.h"
 #include "AssetTypeActions_Base.h"
     
     class FMySuperAssetTypeActions : public FAssetTypeActions_Base
     {
     public:
         // IAssetTypeActions interface
         virtual FText GetName() const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_MySuperAsset", "My Super Asset"); }
         virtual FColor GetTypeColor() const override { return FColor(149, 70, 255); }
         virtual UClass* GetSupportedClass() const override { return UMySuperObject::StaticClass();}
         virtual uint32 GetCategories() override { return EAssetTypeCategories::Misc;}
         // End of IAssetTypeActions interface
     };


And there are errors:

 MySuperModule.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class FText __cdecl FMySuperAssetTypeActions::GetName(void)const " (?GetName@FMySuperAssetTypeActions@@UEBA?AVFText@@XZ)
 MySuperModule.cpp.obj : error LNK2001: unresolved external symbol "public: virtual struct FColor __cdecl FMySuperAssetTypeActions::GetTypeColor(void)const " (?GetTypeColor@FMySuperAssetTypeActions@@UEBA?AUFColor@@XZ)
 MySuperModule.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class UClass * __cdecl FMySuperAssetTypeActions::GetSupportedClass(void)const " (?GetSupportedClass@FMySuperAssetTypeActions@@UEBAPEAVUClass@@XZ)
 MySuperModule.cpp.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __cdecl FMySuperAssetTypeActions::GetCategories(void)" (?GetCategories@FMySuperAssetTypeActions@@UEAAIXZ)

What did I do wrong?

Product Version: UE 4.9
Tags:
more ▼

asked Oct 03 '15 at 01:21 PM in C++ Programming

artemavrin gravatar image

artemavrin
108 3 5 14

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

2 answers: sort voted first

OK.I opened MySuperAssetTypeActions.h not in VS project, there was functions without implementation, just

 virtual FText GetName() const override
 virtual FColor GetTypeColor() const override
 virtual UClass* GetSupportedClass() const override 
 virtual uint32 GetCategories() override

Adding implementation solved the problem

more ▼

answered Oct 03 '15 at 01:54 PM

artemavrin gravatar image

artemavrin
108 3 5 14

tgraupmann gravatar image tgraupmann 6 days ago

Thanks for this thread, it was super handy. Here's the source that I used from your example to make an asset type action work from a plugin.

https://github.com/tgraupmann/UE4ChromaSDK/commit/082ea19a3ca3fa49b738f25217d7065641856d8d

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

Did you add the UnrealED dependencies to the build.cs?

more ▼

answered Oct 03 '15 at 01:23 PM

lion032 gravatar image

lion032
901 31 80 51

artemavrin gravatar image artemavrin Oct 03 '15 at 01:25 PM

Yea

 PrivateDependencyModuleNames.AddRange(
                 new string[]
                 {
                     "Core",
                     "CoreUObject",
                     "AssetTools",
                     "UnrealEd"
                 }
             );
 
             PrivateIncludePathModuleNames.AddRange(
                 new string[]
                 {
                     "AssetTools",
                     "AssetRegistry"
                 }
             );
 
             PublicIncludePathModuleNames.Add("LevelEditor");
 
             DynamicallyLoadedModuleNames.AddRange(
                 new string[] { 
                     "AssetRegistry"
                 }
             );
(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