Issue in SceneComposer with shift and an edit tool

The problem is in two parts, when you are using a tool (Move / Rotate / Scale) in the SceneComposer :

  1. I Don’t know if it’s a feature or a bug, but with or not shift you can use the tool in the scene composer. (for example you can move a spatial in scene while moving the view - with shift)
  2. This one is a bug. When you do the following action (see below) with any tools the action you will not be able to undo it.

actions :

hold shift
hold left mouse button 
hover a tool (quads)
do some modification 
release left mouse button 
release shift
try undo the modification

The bug is easier to see when your modification is different from the last one (for example do scale or rotate after a move)

Ps : I already find an solution on the last version of the SDK, and test it (with build ect …). I order to contribute with more scenecomposer features and want to start with this “fix” to learn how to make a good issue and pull request on git.

old version :
https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/ComposerCameraController.java#L91

New ComposerCameraController at L80:

@Override
    public void checkClick(int button, boolean pressed) {
        if (!forceCameraControls || !pressed) { // dont call toolController while forceCam but on button release (for UndoRedo)
            if (button == 0) {
                toolController.doEditToolActivatedPrimary(new Vector2f(mouseX, mouseY), pressed, cam);
            }
            if (button == 1) {
                toolController.doEditToolActivatedSecondary(new Vector2f(mouseX, mouseY), pressed, cam);
            }
        }
    }

    @Override
    protected void checkDragged(int button, boolean pressed) {
        if (!forceCameraControls || !pressed) {
            if (button == 0) {
                toolController.doEditToolDraggedPrimary(new Vector2f(mouseX, mouseY), pressed, cam);
            } else if (button == 1) {
                toolController.doEditToolDraggedSecondary(new Vector2f(mouseX, mouseY), pressed, cam);
            }
        }
    }

Is that’s with 3.0? or with the master?

Both, but I am going to make a pull request for the master

Edit : here is the pull request Fix issue #255 - scenecomposer : forcedCamera by dokthar · Pull Request #256 · jMonkeyEngine/jmonkeyengine · GitHub

1 Like

I was going to ask, thanks you :wink: