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"

Moving Components in Editor Instances Has No Callback

Hi there,

We are running Unreal 4.11 and I have run into a bug where if you move a scene component that is not the root component of an actor that none of the expected callbacks are called.

In the blueprint editor, moving a non root scene component (You obviously cannot move the root component), causes the component to have PostEditComponentMove called on it. You can see this in FSCSEditorViewportClient::InputWidgetDelta.

However this function is only called in other place, on the root component when the actor itself moves. So doing the same action (moving a sub component) in the actual editor viewport does not trigger this code.

When you edit the actual transform values in the property window (via the numbers), both the blueprint editor and the main editor scene both call FComponentTransformDetails::OnSetLocation which in turn call PostEditChangeProperty on the component.

When you drag the sub component in the level editor window on an instance the equivalent InputWidgetDelta function is FLevelEditorViewportClient::InputWidgetDelta. To do its work, it then calls ApplyDeltaToActors which hits an if part way to do, which splits its functionality between if you have components selected or actors selected :

 if ( !Actor->bLockLocation )
 {
     if (GEditor->GetSelectedComponentCount() > 0)
     {
         //code applies delta to components
         Eventually Calls FLevelEditorViewportClient::ApplyDeltaToComponent
     }
     else
     {
         //code applies delta to actors
         Eventually Calls FLevelEditorViewportClient::ApplyDeltaToActor
     }
 }

In the ApplyDeltaToActor case it calls the GEditor->ApplyDeltaToActor function which in turn calls PostEditMove on that actor at the end.

In ApplyDeltaToComponent is calls GEditor->ApplyDeltaToComponent. This function does not call PostEditComponentMove (and this function is also used as part of FSCSEditorViewportClient::InputWidgetDelta).

I am not sure if the fix is to simply add a PostEditComponentMove callback to FLevelEditorViewportClient::ApplyDeltaToComponent or a bigger change. But it would be nice to have consistent behaviour or at least a way to catch changes to the transform of a sub component.

Product Version: UE 4.11
Tags:
more ▼

asked May 17 '16 at 02:26 PM in Bug Reports

avatar image

Ben.Driehuis
496 18 27 142

avatar image Ben.Driehuis May 17 '16 at 03:32 AM

Note: From what I can tell only UPhysicsConstraintComponent uses the PostEditComponentMove to do anything, but as it stands the code it has there to update the constraint frames wont be called if you move it using this method (Moving the instanced component in the level viewport).

Also not sure if its relevant or bad, but if you move the whole actor it might be worth calling PostEditComponentMove on all components, because again in this case of UPhysicsConstraintComponent , it won't update its constraint frames.

avatar image Doug E ♦♦ STAFF May 17 '16 at 05:40 PM

Hey Ben-

For clarity, you're saying that moving a component (independent of the actor's root) calls PostEditComponentMove() if done from the blueprint viewport but does not call that function if done from the main editor viewport? If this is not the bug you're reporting, can you explain what behavior you're seeing?

avatar image Ben.Driehuis May 17 '16 at 10:51 PM

That is correct :) Sorry for the information overload, just wanted to try and show all the code paths that I was following to help track it down.

But yes if you move a non root component in the blueprint editor, PostEditComponentMove is called. In the level viewport it is not called.

Editing the location/rotation/scale values in the property window (editing the numbers), in both cases will make PostEditChangeProperty happen (but not PostEditComponentMove). I am not sure if that is a problem and for my needs I can just catch the change in there anyway.

The main issue I am running into is that there is no hook at all, no PostEditChange and no PostEditComponentMove. For consistency it seems it should be a PostEditComponentMove but I am happy for any solution.

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

2 answers: sort voted first

Has this been resolved? I'm still experiencing the same issue where MyCustomComponent::PostEditComponentMove is not firing when manipulating it in editor viewport.

The owning Actor's PostEditMove is being called, but unfortunately that doesn't provide me with the information I'm looking for ie. which component has just been moved.

more ▼

answered May 15 '18 at 05:41 PM

avatar image

Lex_Typhoon
6 1

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

Thank you for the clarification. I was able to reproduce the issue and have submitted the bug report UE-30945 for investigation.

Cheers

Doug Wilson

more ▼

answered May 18 '16 at 02:20 PM

avatar image Messiah_of_Savants Apr 29 '17 at 09:24 PM

Hi, I'm using engine 4.15 and this problem still seems to be happening. I checked the tracker and it says it's fixed, but the changes still don't show in the editor viewport on PostEditComponentMove.

avatar image Doug E ♦♦ STAFF May 01 '17 at 03:22 PM

Hey Savants-

What exactly are you seeing on your end? After testing the provided repro steps available in the public issue (https://issues.unrealengine.com/issue/UE-30945) , the sample code was updated as expected in the viewport. If you are having issues with PostEditComponentMove not being called, please provide the setup steps used to help me test the behavior on my end.

avatar image Messiah_of_Savants May 02 '17 at 09:18 PM
 void UMyComponent::PostEditComponentMove(bool bFinished)
 {
     //if(bFinished)
         SetRelativeTransform(FTransform());
 
     Super::PostEditComponentMove(bFinished);
 }


This is all I'm trying todo on a custom component. When I move it in the blueprint editor viewport, I am expecting it to go back to 0,0. If I do this in PostEditChangeProperty it works fine. This is a non-root component.

avatar image Doug E ♦♦ STAFF May 03 '17 at 08:08 PM

When I add the code you provided to a scene component class the component resets to the actor's center whenever the component is moved specifically. If you are moving the actor itself, this function isn't getting called.

(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