Hey!
Some questions on tv_undoOpenStak and tv_undoCloseStack.
On a button, if it's an embedded comand script, what is the difference between putting just "tv_undoCloseStack" and, as on the wiki, "tv_undoCloseStack "Action Name""?
I've seen on the animator panel a button with his button name as the "action name". Also can a button have a name with "/" ou spaces or things like that and stille me recognize as a name? And on a script, why do we have to put an action name when we close it but not when we open it? What is, concretly, the "action name"?
And what about update undo? I don't really understand the wiki too.
I've seen some curious things with my undo and my own buttons with "tv_undoX", it undoes but keeps some actions, i think the last ones, even if i undo everything.
Thank you
Nathan
tv_undoOpenStack / CloseStack
- NathanOtano
- Posts: 1209
- Joined: 01 Apr 2014, 07:07
- Location: Biarritz, France
- Contact:
tv_undoOpenStack / CloseStack
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Re: tv_undoOpenStack / CloseStack
I don't know if putting a name after tv_undoCloseStack does do something. Maybe it is a mistake it is written in the WIKI?NathanOtano wrote: as on the wiki, "tv_undoCloseStack "Action Name""?
does some from the TVPaint team know?
I do not fully understand tv_updateUndo either. But if you do script do not undo properly. that means if your project have one state A. and you execute some script surrounded with tv_undoOpenStack and tv_undoCloseStack. and you Update one time. and You don't go back to the same Situation as before the script. then maybe you can solve it with tv_updateUndo. I have noticed especially when switching layers with George mistakes can happen.NathanOtano wrote: And what about update undo? I don't really understand the wiki too.
I've seen some curious things with my undo and my own buttons with "tv_undoX", it undoes but keeps some actions, i think the last ones, even if i undo everything.
I will show you an example
If I have this script to duplicate part of layers to other part of layers
Code: Select all
tv_undoOpenStack
getBounds = "68 139 1091 735"
setBounds = "68 736 1091 1332"
PARSE setBounds x1 y1 x2 y2
dotX = x1+((x2-x1)/2)
dotY = y1+((y2-y1)/2)
run = 1
layerPos = 0
WHILE run
tv_LayerGetID layerPos
lid = result
IF CMP(lid,"NONE")==0
tv_layerSet lid
tv_BrushCut getBounds
tv_restorebrush "subpixel 0"
tv_dot dotX dotY
layerPos = layerPos+1
ELSE
run =0
END
END
tv_undoCloseStack
Clearly not the disired effect of an undo
But if I place tv_unpdateUndo just before I switch layers in my script like this
Code: Select all
tv_undoOpenStack
getBounds = "68 139 1091 735"
setBounds = "68 736 1091 1332"
PARSE setBounds x1 y1 x2 y2
dotX = x1+((x2-x1)/2)
dotY = y1+((y2-y1)/2)
run = 1
layerPos = 0
WHILE run
tv_LayerGetID layerPos
lid = result
IF CMP(lid,"NONE")==0
tv_updateUndo // PLEASE NOTICE I PLACED A TV_UPDATEUNDO HERE!!!!!!
tv_layerSet lid
tv_BrushCut getBounds
tv_restorebrush "subpixel 0"
tv_dot dotX dotY
layerPos = layerPos+1
ELSE
run =0
END
END
tv_undoCloseStack
I find this a confusing behaviour. And i think it could be nice if tv_UndoOpenStack and tv_UndoCloseStack would work witout tv_updateUndo. I actually think it is a bug and I already have submitted it to the developers and I hope some day they would look at it. But then again it is not that big deal because we can fix it with putting in tv_updateUndo before a layer switch.
A last note on undo Some things you cannot undo forinstance setting the stencil with tv_layerStencil 0 On cannot be undo. But it wil also not be undone if you do it manually in TVPaint(Which I think could be nice. So I just sneak a little feature request in to add momodifying stencil to undo history)
Hope it Helps
-Mads
- NathanOtano
- Posts: 1209
- Joined: 01 Apr 2014, 07:07
- Location: Biarritz, France
- Contact:
Re: tv_undoOpenStack / CloseStack
Thank you for your reply I understand now, cool to have your experience with it here. Really helpfull!
And now that you say it, i think my problem of non-undoing things was mainly with layers yes.
Du you think that if i put an updateundo just after (or before?) the undoopen it would always work for the whole script? If i dont want to put it right where the problem is on the script.
And now that you say it, i think my problem of non-undoing things was mainly with layers yes.
Du you think that if i put an updateundo just after (or before?) the undoopen it would always work for the whole script? If i dont want to put it right where the problem is on the script.
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Re: tv_undoOpenStack / CloseStack
I think you need to put it right before the problem in the script. that mean before tv_layerSet lid in my exampleNathanOtano wrote: Du you think that if i put an updateundo just after (or before?) the undoopen it would always work for the whole script? If i dont want to put it right where the problem is on the script.
- NathanOtano
- Posts: 1209
- Joined: 01 Apr 2014, 07:07
- Location: Biarritz, France
- Contact:
Re: tv_undoOpenStack / CloseStack
Ok i think i understood by testing it. I think you always have to put an updateundo beacause the tv_openstack doesn't do it, it just stops the recordings of the actions (just after the action of launching the button that is recorded). And for some reason with some actions is also updates the stack even when it's open, but if you put an updateundo it always goes back to the updateundo place instead when you undo.
Seems ok for you? If you put the update undo just after the openstack in your script it should work, no?
Seems ok for you? If you put the update undo just after the openstack in your script it should work, no?
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Re: tv_undoOpenStack / CloseStack
Like this?NathanOtano wrote: Seems ok for you? If you put the update undo just after the openstack in your script it should work, no?
Code: Select all
tv_undoOpenStack
tv_updateUndo //PLACING TV_UPDATEUNDO HERE DOES NOT WORK!!!
getBounds = "68 139 1091 735"
setBounds = "68 736 1091 1332"
PARSE setBounds x1 y1 x2 y2
dotX = x1+((x2-x1)/2)
dotY = y1+((y2-y1)/2)
run = 1
layerPos = 0
WHILE run
tv_LayerGetID layerPos
lid = result
IF CMP(lid,"NONE")==0
// PLEASE NOTICE I PLACED A TV_UPDATEUNDO HERE!!!!!!
tv_layerSet lid
tv_BrushCut getBounds
tv_restorebrush "subpixel 0"
tv_dot dotX dotY
layerPos = layerPos+1
ELSE
run =0
END
END
tv_undoCloseStack
-Mads
- NathanOtano
- Posts: 1209
- Joined: 01 Apr 2014, 07:07
- Location: Biarritz, France
- Contact:
Re: tv_undoOpenStack / CloseStack
thank you ok, so if somebody of the team can explain it, it would be nice.
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.