-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove unused call GetSandboxObject #17756
feat: remove unused call GetSandboxObject #17756
Conversation
Code/Editor/AnimationContext.cpp
Outdated
camObjId = pEditorEntity->GetId(); | ||
} | ||
} | ||
|
||
// Switch camera in active rendering view. | ||
if (GetIEditor()->GetViewManager()) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we confirm that this is no longer having an effect? If we don't need the camera object id, and it is always null, can the rest of the function be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like it, GetSandboxObject is never connected to so there is nothing for ebus to call so yea it will always be null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this is done to avoid setting the value in the registry when the animation is playing or is this a different path for the fov to change? might want to verify changing the fov of the camera and see if its updating the value in the setting registry? kind of hard to say without any kind of historical context?
I feel we might want to have an animation with the fov and look at the registry settings sounds like this is a regression unrelated to this change?
// If looking through camera object and recording animation, do not allow camera shake | ||
if ((GetIEditor()->GetViewManager()->GetCameraObjectId() != GUID_NULL) && GetIEditor()->GetAnimation()->IsRecording()) | ||
{ | ||
if (GetIEditor()->GetMovieSystem()) | ||
{ | ||
GetIEditor()->GetMovieSystem()->EnableCameraShake(false); | ||
} | ||
} | ||
else | ||
{ | ||
if (GetIEditor()->GetMovieSystem()) | ||
{ | ||
GetIEditor()->GetMovieSystem()->EnableCameraShake(true); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was easy to remove the camera shake is unused code so its better to just remove it then keep faulty logic.
if (pRenderViewport->GetViewManager()->GetCameraObjectId() == GUID_NULL) | ||
{ | ||
SandboxEditor::SetCameraDefaultFovRadians(fovRadians); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like something to investigate further looks like this is done to prevent the setting from getting saved to settings registry. if its always null them maestro might just save it anyways. might add a breakpoint here and mess with the fov and see if this logic gets called.
df88a73
to
67af223
Compare
failed to build in release
|
67af223
to
a63328d
Compare
Signed-off-by: Michael Pollind <[email protected]>
Signed-off-by: Michael Pollind <[email protected]>
Signed-off-by: Michael Pollind <[email protected]>
Signed-off-by: Michael Pollind <[email protected]>
a63328d
to
108dfa7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
red code is best code
What does this PR do?
I can't find where ComponentEntityEditorRequests gets bound to, looks like this EBus should be removed at some point. I was going to start with removing GetSandboxObject and just remove this call. also helps that CEntityObject constructor is never called.