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
Fixed broken gizmo manipulations for Model component #8769
Conversation
(let [renderable (first renderables) | ||
node-id (:node-id renderable) | ||
request-id [::outline node-id]] | ||
(render/render-aabb-outline gl render-args request-id renderables rcount)))) |
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.
Mostly indentation. Wrapped in (when (= pass/outline (:pass render-args)) ...)
instead of asserting on the pass. We needed to add the renderable to pass/selection
or pass/opaque-selection
for it to be considered selectable.
:select-batch-key model-scene-resource-node-id | ||
:passes [pass/outline]} | ||
:select-batch-key :not-rendered ; The render-fn only does anything during the outline pass. | ||
:passes [pass/outline pass/opaque-selection]} ; Include in a selection pass to ensure it can be selected and manipulated. |
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.
It seems the correct way to do this is to have the root scene
include the :node-id
of the ResourceNode
(i.e. the ModelSceneNode
in our case), and include a :renderable
that is assigned to either pass/selection
or pass/opaque-selection
. It doesn't have to render anything, but this ensures it can be included in the :selected-renderables
output of the SceneRenderer
.
None of the :children
scenes should specify a :node-id
, unless they are actually from different nodes in the graph that can be transformed independently using the gizmo.
Yep! |
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.
LGTM!
@@ -355,8 +352,8 @@ | |||
:renderable {:render-fn render-outline | |||
:tags #{:model :outline} | |||
:batch-key nil ; Batching is disabled in the editor for simplicity. | |||
:select-batch-key model-scene-resource-node-id | |||
:passes [pass/outline]} | |||
:select-batch-key :not-rendered ; The render-fn only does anything during the outline pass. |
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.
A bit confusing, at first I thought this is a specially recognized key, but it's not :)
Fixes #8756