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"

Need clarifications about packages and serialization.

I am currently working on a custom graph editor, taking inspiration from FSoundCueEditor and ran into this error, after calling MarkPackageDirty() on my object and then saving :

Can't save ../../../../../../[path_to_game_project]/LullabyGardens/Content/Lullaby/NPC/Abigail/AbigailDialogDatabase.uasset: Graph is linked to private object(s) in an external package. External Object(s): DialogGraph_0

I am pretty sure the error comes because of this member variable :

 [NPCDialogAsset.h]
 #if WITH_EDITORONLY_DATA
     UPROPERTY()
         TArray<UDialogNode*> AllNodes;
 
     UPROPERTY()
         class UEdGraph* DialogGraph;
 #endif

I think that the reference to the graph is causing the error. I then looked at the overriden method Serialize in USoundCue, and saw that the graph is serialized with the sound cue.

I then tried to do the same thing in my version of serialize, as follows :

 [NPCDialogAsset.h]
 void UNPCDialogAsset::Serialize(FArchive & Ar) {
     Super::Serialize(Ar);
 
     if (Ar.UE4Ver() >= VER_UE4_COOKED_ASSETS_IN_EDITOR_SUPPORT)
     {
         FStripDataFlags StripFlags(Ar);
 #if WITH_EDITORONLY_DATA
         if (!StripFlags.IsEditorDataStripped())
         {
             Ar << DialogGraph;
         }
 #endif
     }
 #if WITH_EDITOR
     else
     {
         Ar << DialogGraph;
     }
 #endif
 }

After changing Serialize, I couldn't launch the editor, as the serial size with the new functions was different.

This brings me to my questions :

1) How can I save a dirty asset that references my graph? Do I need to do call a function in the same vein as MarkPackageDirty() ?

2) How can I override Serialize(), while avoiding the size mismatch error?

Product Version: UE 4.15
Tags:
more ▼

asked Mar 13 '17 at 07:39 PM in C++ Programming

avatar image

MutualWolf
10 5 8 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Nevermind, I managed to solve the problem by looking at SavePackage.cpp and playing around with object flags.

more ▼

answered Mar 14 '17 at 09:13 PM

avatar image

MutualWolf
10 5 8 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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