mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[nodes] SfMTransform: change name from gizmo to manual + enabled param
This commit is contained in:
parent
9a7e4fe16d
commit
1c14159cde
2 changed files with 30 additions and 26 deletions
|
@ -23,29 +23,29 @@ Entity {
|
|||
|
||||
// Update node SfMTransform slider values when the gizmo has changed: translation, rotation, scale
|
||||
transformGizmo.onGizmoChanged: {
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.x"), translation.x)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.y"), translation.y)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.z"), translation.z)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.x"), translation.x)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.y"), translation.y)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.z"), translation.z)
|
||||
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.x"), rotation.x)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.y"), rotation.y)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.z"), rotation.z)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualRotation.x"), rotation.x)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualRotation.y"), rotation.y)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualRotation.z"), rotation.z)
|
||||
|
||||
// Only one scale is needed since the scale is uniform
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("transformGizmo.gizmoScale"), scale.x)
|
||||
_reconstruction.setAttribute(root.currentSfMTransformNode.attribute("manualTransform.manualScale"), scale.x)
|
||||
}
|
||||
|
||||
// Automatically evalutate the Transform: value is taken from the node OR from the actual modification if the gizmo is moved by mouse.
|
||||
// When the gizmo has changed (with mouse), the new values are set to the node, the priority is given back to the node and the Transform is re-evaluated once with those values.
|
||||
property var nodeTranslation : Qt.vector3d(
|
||||
root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.x").value,
|
||||
root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.y").value,
|
||||
root.currentSfMTransformNode.attribute("transformGizmo.gizmoTranslation.z").value
|
||||
root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.x").value,
|
||||
root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.y").value,
|
||||
root.currentSfMTransformNode.attribute("manualTransform.manualTranslation.z").value
|
||||
)
|
||||
property var nodeRotationX: root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.x").value
|
||||
property var nodeRotationY: root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.y").value
|
||||
property var nodeRotationZ: root.currentSfMTransformNode.attribute("transformGizmo.gizmoRotation.z").value
|
||||
property var nodeScale: root.currentSfMTransformNode.attribute("transformGizmo.gizmoScale").value
|
||||
property var nodeRotationX: root.currentSfMTransformNode.attribute("manualTransform.manualRotation.x").value
|
||||
property var nodeRotationY: root.currentSfMTransformNode.attribute("manualTransform.manualRotation.y").value
|
||||
property var nodeRotationZ: root.currentSfMTransformNode.attribute("manualTransform.manualRotation.z").value
|
||||
property var nodeScale: root.currentSfMTransformNode.attribute("manualTransform.manualScale").value
|
||||
|
||||
transformGizmo.gizmoDisplayTransform.translation: transformGizmo.focusGizmoPriority ? transformGizmo.gizmoDisplayTransform.translation : nodeTranslation
|
||||
transformGizmo.gizmoDisplayTransform.rotationX: transformGizmo.focusGizmoPriority ? transformGizmo.gizmoDisplayTransform.rotationX : nodeRotationX
|
||||
|
@ -53,4 +53,4 @@ Entity {
|
|||
transformGizmo.gizmoDisplayTransform.rotationZ: transformGizmo.focusGizmoPriority ? transformGizmo.gizmoDisplayTransform.rotationZ : nodeRotationZ
|
||||
transformGizmo.objectTransform.scale3D: transformGizmo.focusGizmoPriority ? transformGizmo.objectTransform.scale3D : Qt.vector3d(nodeScale, nodeScale, nodeScale)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue