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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

4.7 UObject custom Serialize problems

I develop a C++ plugin, and I have big trouble with the 4.7 upgrade of one of my custom class.

I expected the UObject::Serialize function to be used for a kind-of custom properties serialization/deserialization, so called each time UE needs to save/load my object. But it seems more subtle, and I need more light on that one.

More details:

  • The concerned class is a simple UObject class, instantiated in an "Instanced" UPROPERTY of a USceneComponent.

  • Even before 4.7, copy-paste and asset migration did not seems to work properly, as if those actions did not use my Serialize function as I expected. ie: As the object is pasted, my Serialize is called to deserialize but the FArchive does not seem to contain the values of the old object (as if the copied instance was never Serialized).

  • After 4.7, I now get a lot of bugs and errors when loading an upgraded 4.6 project:

  • At first launch after upgrade, some deserialized values seems weird, and sometimes the scene got many actors randomly translated as if the scene was corrupted.

  • After saving and re-open, Most of my problematic class instantiated in Blueprint logs "Failed import for ..." then "Missing Class ... my problematic class instance ..."

  • To fix Blueprints "Failed import" I need to manually change a property to mark as unsaved to re-save it.

  • When I hit "Play", I see my object serializing with the good values, but when unserialized into a "UEDPIE" level, some instances get just zeros in serialized data and in some properties ?!

Anyway, I should have done something wrong, but does anyone could have any clue on what ?

EDIT: more investigation on StaticDuplicate:

As last resort, I'm walking/breakpointing UE code to see what happens, and I found a weird behavior when StaticDuplicate'ing the level for PIE.

As I understand it, StaticDuplicate diffs source object's fields against their archetypes, then re-apply the diff on duplicated objects. For "normal" objects, Archetypes are CDOs, BUT for Blueprints the Archetype seems to be an instance of the blueprint, and the diff is re-applied on object that do not seems to be duplicated from this archetype, their are just "recycle" default placeholder instances ! So, only the fields that differs from the archetype (typically relinked UObject* pointers) are duplicated correctly !?

EDIT 2: more investigation on CreateDefaultSubobject:

Looking into CreateDefaultSubobject when ctor'ing the duplicate of my the blueprint, my subobject is CreateDefaultSubobject but do not copy fields from the archetype of the blueprint, it seems because it checks if Outer is non-native (is blueprint), and here, my Outer is an ActorComponent (which is native), here the non-native is the actor at Outer->Outer.

So, it make me wondering if I am even allowed to create subobjects into components ? (which are already sub-objects of actors/BPActors).

Product Version: Not Selected
Tags:
more ▼

asked Mar 16 '15 at 12:52 PM in C++ Programming

avatar image

Jo_PkFX
49 3 5 13

avatar image Jo_PkFX Mar 16 '15 at 02:36 PM

I just discover that, my USceneComponent::PostLoad ask for something on my "problmatic class", but it is not yet loaded (EObjectFlags 0x9). It makes me wonder: When/How make sure that sub-object in properties are fully loaded ?

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

1 answer: sort voted first

I submitted a fix for subobject instancing issues in master branch: https://github.com/EpicGames/UnrealEngine/commit/14f9ba1fb1e5464618f010d791e16bdb852f4790

I believe it should fix those issues.

more ▼

answered Mar 19 '15 at 01:32 PM

avatar image

robert.manuszewski STAFF
318 8 3 9

avatar image Jo_PkFX Mar 19 '15 at 04:18 PM

Great Thank you ! I cherry-picked the commit on 4.7.3, and it works great ! Is there any hope to get this patch on 4.7.4 ? (as I develop a plugin-only thing, if the fix don't come soon enough, I would have to diry-workarround anyway to plublish my plugin on 4.7)

(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