Bug in undo or?

A forum dedicated to George scripting questions
Post Reply
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Bug in undo or?

Post by Mads Juul »

I have made this script to break exposures on all layers that is not locked

Code: Select all

PARAM none
tv_LayerCurrentID
curLayer = result
tv_layerGetImage
curImage = result
tv_UpdateUndo
tv_undoOpenStack
run = 1
pos = 0
WHILE run
	tv_LayerGetID pos
	id = result
	IF CMP(id,"none")
		run =0
		tv_layerSet curLayer
	ELSE
		tv_layerlock id
		IF CMP("On",result)!=1
			tv_layerSet id
			tv_exposurebreak curImage
		END
	END
	pos =pos+1
END
tv_undoCloseStack  "exposuresBreakLayers"
It works as expected unless the current layers is an locked layer or the current frame is after or before the start/end of the current layer. then when I press undo I go back to where I was before the script runs but I suddenly change layer??
It also did this before i put tv_updateundo into the script. Can i do something to prevent this undesired behaviour?
I guess it's because changind layers is not part of undo? But still I would like to go back to the same layer Before the Script was run even though I'm not on a locked layer.
_mads
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
User avatar
Hervé
Site Admin
Posts: 3490
Joined: 08 Feb 2006, 17:00
Location: Metz France
Contact:

Re: Bug in undo or?

Post by Hervé »

Congratulation, you find a bug in the cmd tv_exposurebreak if the position is not in the layer.
Hervé ADAM, TVPaint Team
Post Reply