-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[FEATURE] Interactive viewer plugins #2004
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
base: main
Are you sure you want to change the base?
Conversation
|
This feature looks very convenient! |
|
Do you consider this as a "universal" plugin or something pyrender-specific? This would give you the answer :)
I'm not a fan of these objects. Overly complicated and not very pythonic in my view.
That would be great! But we need a way to expose this in a clean way. |
98601bb to
1e672b0
Compare
|
@Milotrince If you could finish this PR I would be happy to review it and merge it :) |
1e672b0 to
343e8cb
Compare
|
@duburcqa Could I get your opinion on the state of the PR? there are some design decisions I'd like your input on!
I still need to add tests. |
Sure ! I will do it this week ! Could you fix the conflicts in the meantime? Thank you :) |
7639573 to
0a14941
Compare
|
Small comment on snapshots PR: https://huggingface.co/datasets/Genesis-Intelligence/snapshots/discussions/6 |
examples/drone/interactive_drone.py
Outdated
| # Register keybindings | ||
| from pyglet.window import key |
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.
Could you add from pyglet.window import key in your new keybindings module, so that users can do:
from genesis.ext.pyrender.interaction.keybindings import keyThis would avoid breaking encapsulation of pyglet, that should be an implementation details for users.
Similarly, it would be great to expose your keybindings module outside ext, that is also supposed to be an implementation details for the end user. This would be relaying not the same mechanism I just mentioned. Ideally the user should be able to replace genesis.ext.pyrender.interaction.keybindings by genesis.vis.keybindings
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.
leaving a note here: on mac (untested with other machines), when i import pyglet or pyglet.window.key at the top level before viewer does, I get
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication macOSVersion]: unrecognized selector sent to instance 0x1618b7df0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000198f498ec __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000198a22418 objc_exception_throw + 88
2 CoreFoundation 0x000000019902b7e8 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
...
87 python3.12 0x000000010436e1f0 builtin_exec + 404
88 python3.12 0x00000001042bb45c cfunction_vectorcall_FASTCALL_KEYWORDS + 92
89 python3.12
libc++abi: terminating due to uncaught exception of type NSException
By claude's suggestion I added it as a lazily loading module to safely expose key at genesis.vis.keybindings.
|
Could you split the introduction of You can open a (stacked) PR for the second part right away, merging on top of this branch instead of main (with draft status). |
| ray_direction_world = ti_normalize(ti_transform_by_quat(ray_dir_local, link_quat), gs.EPS) | ||
|
|
||
| # --- 2. BVH Traversal --- | ||
| # FIXME: this duplicates the logic in LBVH.query() which also does traversal |
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.
Why FIXME disappeared? You actually implemented the fix?!
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 removed it because I think the FIXME note isn't quite accurate, raycaster.py does ray-AABB tests while LBVH.query() checks AABB-AABB. There might be a bit of duplicated logic but i think it'd be more complicated to split it up into smaller ti.funcs so may as well leave as is.
f530fdc to
f89c2e8
Compare
Description
nice-to-have feature, allows users to integrate interactive viewer plugins.
Related Issue
N/A
Motivation and Context
ViewerPluginenables directly interfacing with pyviewer mouse/keyboard controls.pynputHow Has This Been / Can This Be Tested?
added
tests/test_viewer.pyScreenshots (if appropriate):
Screen.Recording.2025-11-17.at.18.03.51.mov
Checklist:
Submitting Code Changessection of CONTRIBUTING document.