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"

USTRUCT properties in FAnimNode not initialized properly

Hello,

I am having a similar problem to the one posted in this question :

https://answers.unrealengine.com/questions/38371/question-fanimnode-instance-inside-fanimgraphnode.html

I have a USTRUCT TArray property in FAnimNode, and in the USTRUCT I have other UPROPORTY variables. When I create the AnimNode in the Animation Blueprint, the USTRUCT array has the correct number of elements as I have created in the AnimGraph, however the contents of the USTRUCT is not initialized properly. Below is more details and code definitions:

  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Tasks, meta = (PinHiddenByDefault))
  TArray<FMyStruct> Tasks;

With MyStruct being defined as:

USTRUCT() struct FIKinemaPenetrationTask { GENERATED_USTRUCT_BODY()

  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
      FBoneReference BoneRef;
 
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  bool Penetrating;
  
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  bool OffsetHips;
 
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  bool WorldRayTrace;
 
  /** MeshOffset Depth of the bone/joint inside the mesh */
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  float MeshOffset;
 
  /** Reference frame of Penetration Plane. */
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  TEnumAsByte<EBoneControlSpace> PlaneTransformSpace;
 
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  FVector PlanePos;
 
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = FloorPenetration)
  FVector PlaneNormal;

};

In the AnimGraph editor, I can edit the BoneReference in MyStruct and when setting a break point in the FAnimGraphNode I see the correct values, however setting a break point in the FAnimNode::Evaluate fuction shows the array Tasks to have the correct number of items but wrong data in its members.

Just as a note, with UE4.3 This works fine with no problem.

Thanks Ahmed

Product Version: Not Selected
Tags:
more ▼

asked Oct 24 '14 at 10:30 AM in C++ Programming

avatar image

IKinema
66 2 2 4

avatar image Tim C ♦♦ STAFF Nov 11 '14 at 07:19 PM

Hi IKinema,

I have been trying to reproduce this issue, but have not had any luck so far. Are you able to see this behavior in a new project from one of the templates? If so, could you provide the exact steps you are following and precisely where you are putting the code you provided above?

Tim

avatar image IKinema Nov 12 '14 at 10:16 AM

Hello Tim,

I have not tested on a new project from template. We are developing a plugin and this code is part of a custom animation node that we create. If I have a UPROPERTY() of the struct in the animation node it initializes fine with out any issues. However, having a TArray of the USTRUCTs elements of the array don't get initialized. Is the initialization of the variables in the AnimNode has changed in any way in latest releases.

I will try to reproduce a minimal reproducible code and report back.

Thanks Ahmed

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

1 answer: sort voted first

Problem resolved on a new project from template. Thank you for your help

more ▼

answered Nov 17 '14 at 12:33 PM

avatar image

IKinema
66 2 2 4

avatar image Tim C ♦♦ STAFF Nov 17 '14 at 03:18 PM

Hi IKinema,

I am glad to hear that things are working for you now. If you run into this issue again, and especially if you discover a way to reproduce it, please let us know.

Tim

(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