When recet morphs I recommend to keep current mode (Pose mode)

Issue #160 resolved
engetudouiti created an issue

I know there had been some changes from request, but I did not care much that time.

But today I feel it is not reasonable, change mode to object for some morph button functions.

I think, at least about morph sections buttons, it should not change current mode to object.

eg,, morph reset button I often use it with pose mode. now it return object mode everytime.

Actually when we tweak morphs (or pose controlelrs), we usualy keep Actor mode as pose mode.

without the Actor is static mesh..

So, that,, when we use functions to change shape, or posing, about Actor,, there is no need to change object mode

everytime. 😟

At least we can set current mode as variable, then return after finish the functions. About morph section functions (button action)

I like to keep current mode without it not work for the prupose.

Comments (6)

  1. engetudouiti reporter

    I tried to custom edit, then I found there have been used

    bpy.ops.object.XXXXmode_toggle() to change mode.

    I think it was to remove old up-date problem,,,

    (toggle mode was one way to force up-date dependencies )

    But I feel , when we change mode (or toglle) for some reasons,

    at first keep current mode, as

    c_mode = bpy.context.object.mode

    then run the method and change β€œmode” when we need for the function.

    but at last,. we may call

    bpy.ops.object.mode_set( mode = c_mode ) again.

    β€Œ

    β€Œ

    β€Œ

    β€Œ

    β€Œ

    β€Œ

    β€Œ

  2. Thomas Larsson repo owner

    A few months ago I introduced a change which meant that all buttons start and end in object mode. This avoids a lot of potential context errors, since each tool starts in a well-defined context. It also makes it possible to easily change characters after the tool has finished; if it ends in pose mode, you have to toggle into object mode to focus on another character.

    However, I agree that it is inconvenient with the pose tools, in particular the buttons in the various morph panels. This should change so the tools finish in pose mode. I think the best solution would be if the active object finishes in the same mode that it started in, but so far I have not figured out how to get the current mode, only how to set it.

    Edit: obviously I don’t know how to read. Will try bpy.context.object.mode.

  3. Thomas Larsson repo owner

    Seems like it works perfectly. So now the active object remains in the same mode after all tools.

  4. engetudouiti reporter

    It should work.. (c_mode = bpy.context.object.mode)

    but it is read only. so we need bpy.ops.object.mode_set( mode = c_mode )

    I suppose, you (not me ^^;) can make new funciton ,more smart , then call it only when it need. with use arguments.

    actually controller panell buttons must need to keep current mode^^; hope you add it.

    I understand and agree, when use operation, or functions , then it work with object mode well,, keep same mode untill finish the function. but about this case,, we need to re-turn original mode.

    (about this case, pose mode,, (set bone transform keys, with expression etc etc)

    β€Œ

  5. Thomas Larsson repo owner

    Yes, it is implemented in the latest commit. All buttons inherit the class DazOperator in error.py where the changes were made.

  6. Log in to comment