-
Notifications
You must be signed in to change notification settings - Fork 117
Added bindings to JavascriptEditorViewport #8
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
Conversation
…d inputs, keyboard inputs, to set the viewport type and the view mode, and to project/unproject from screen to world
FCanvasBoxItem Box(Widget->SelectionBeginPoint, Widget->SelectionEndPoint - Widget->SelectionBeginPoint); | ||
Box.SetColor(FColor::White); | ||
Box.LineThickness = 1.0; | ||
Box.Draw(Canvas); |
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 function seems to handle draw behavior for specific use case. I think there should be some functions which exposes FCanvas*Item accessible to BP.
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.
Yes, I fully agree, I updated my pull request.
I exposed the FCanvas
as a UCanvas
like in JavascriptEdMode
.
For this purpose, I moved GetCanvasByName()
from JavascriptEdMode.cpp
to JavascriptEditorLibrary.h
to be able to access it from JavascriptEdMode.cpp
and JavascriptEditorViewport.cpp
.
Tell me if there is a better solution.
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.
I forgot to make some changes... Working on it...
It is recommended to hold UObject references by FGCObject. Could you transform your code not to call AddToRoot? |
…Viewport::ProjectWorldToScreen/DeprojectSceneToWorld()
Ok, I did something, I'm not sure that it is a good solution though. I added
to Instead, I could override In
(In the same way, I could also add I also fixed some bugs in |
You may create a private object which inherits from FGCObject and override AddReferencedObjects. In this way, GC ref management can be done in right way. :) I think uproperty only for gc isn't a good way. |
Ok, but why it is better to create a private object which inherits from FGCObject than to override |
Is it better now? |
Thanks, it is looking good to me! |
Added bindings to
JavascriptEditorViewport
to be able to:Also added a hack to be able to simply draw a selection rectangle on the viewport canvas in
FJavascriptEditorViewportClient::Draw(FViewport* Viewport, FCanvas* Canvas)
, withSelectionBeginPoint
andSelectionEndPoint
. This should be improved, but it would probably mean exposing FCanvas and FCanvasBoxItem to Blueprint/Javascript.