-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: gizmo rendering problem #58
Conversation
WalkthroughThe updates focus on enhancing the handling of wireframe meshes within an editor plugin. Multiple meshes can now be managed with a new array property, and mesh destruction has been refined with updated disposal methods. These changes streamline the graphics processing and resource management for a more robust and flexible editor experience. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (3)
- plugin-packages/editor-gizmo/src/gizmo-loader.ts (1 hunks)
- plugin-packages/editor-gizmo/src/gizmo-vfx-item.ts (3 hunks)
- plugin-packages/editor-gizmo/src/wireframe.ts (2 hunks)
Additional comments: 6
plugin-packages/editor-gizmo/src/gizmo-loader.ts (1)
- 161-174: The updated logic to handle an array of
wireframeMeshes
and the fallback to handle a singlewireframeMesh
is correctly implemented. The check forisDestroyed
before callingdestroyWireframeMesh
and removing the mesh from the render pass is a good practice to prevent unnecessary operations on already destroyed objects.plugin-packages/editor-gizmo/src/gizmo-vfx-item.ts (3)
99-99: The addition of the
wireframeMeshes
array property to theGizmoVFXItem
class is correctly implemented to store multiple mesh instances.201-208: The logic in the
createModelContent
method correctly initializes thewireframeMeshes
array and populates it with meshes created for each model in thems
array. This change supports the handling of multiple wireframe meshes.333-338: The
updateRenderData
method has been updated to handle multiple wireframe meshes. The loop correctly iterates over thewireframeMeshes
array and updates each mesh using theupdateWireframeMesh
function. Ensure that the length ofmeshes
andwireframeMeshes
arrays are always synchronized to prevent index out-of-bounds errors.plugin-packages/editor-gizmo/src/wireframe.ts (2)
51-52: The update to the
destroyWireframeMesh
function to usedispose
instead ofdestroy
onmesh.geometry
is correct and ensures proper resource cleanup. Themesh.dispose
call is also correctly updated to maintain textures while disposing of other materials and geometries.247-253: The
SharedGeometry
class has been updated with anoverride dispose
method that includes additional cleanup logic forbuffers
andbufferProps
. The basedispose
method is correctly called, and thesource
property is set to null post-disposal. The use of@ts-expect-error
is appropriate if the TypeScript error is expected and understood.
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files ignored due to filter (10)
- packages/effects-core/package.json
- packages/effects-helper/package.json
- packages/effects-threejs/package.json
- packages/effects-webgl/package.json
- packages/effects/package.json
- plugin-packages/alipay-downgrade/package.json
- plugin-packages/editor-gizmo/package.json
- plugin-packages/model/package.json
- plugin-packages/orientation-transformer/package.json
- plugin-packages/spine/package.json
Files selected for processing (1)
- plugin-packages/editor-gizmo/src/wireframe.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- plugin-packages/editor-gizmo/src/wireframe.ts
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- plugin-packages/editor-gizmo/src/wireframe.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- plugin-packages/editor-gizmo/src/wireframe.ts
Summary by CodeRabbit
Refactor
Bug Fixes