Open ThomasAlban opened 4 months ago
To clarify with an example: if an entity has use_rotation: false
, then the gizmo does not affect the entity's rotation. If it has GizmoTarget
as well as another entity with use_rotation: true
, and both entities are rotated about the median point with the gizmo, then the entity with use_rotation: false
would still move, but its rotation would not be affected.
The current system does not support entity-specific configuration, but something like that GizmoTargetConfig
could indeed work. In the meantime it could perhaps be implemented outside the gizmo plugin with a system that reverts any changes to scale, rotation or translation, depending on which of them are editable.
Yeah sounds good. Does the current underlying gizmo implementation support turning off certain axes e.g. for entities which should only be translated in the x and z axes (then the gizmo would only show the relevant arrows)? This would be another feature that would be nice to have in the entity-specific gizmo config if it was implemented!
The current main version does not yet support that, but that is implemented in the more-modes
branch: https://github.com/urholaukkarinen/transform-gizmo/commit/c7c89923618d525ce7d6dd0794e2e62aaf16d7fa
It allows you to mix and match the "sub-modes" however you like.
Is there any way with the current system to configure certain
GizmoTarget
s to not be editable in certain gizmo modes? For example, I want some entities to not be rotatable and some not scaleable (the gizmo would just do nothing to those entities' rotations/scales if edited in that mode). I'm not exactly sure of the best way this could be implemented (unless it is already possible and I'm missing it!). Perhaps an optionalGizmoTargetConfig
component which contains properties such asuse_rotation
/use_scale
. If the entity has bothGizmoTarget
andGizmoTargetConfig
, the config options would be applied to that specific entity. This approach could be good, as it would open the door to potentially more entity-specific gizmo config options in the future.