put layers on center of canvas
put layers on center of canvas
Hello. I want to put layers on center of canvas like this video.
As you can see, all layers are placed differently,circle A is on x 100 y 200, circle B is on x 200 y 250,circle C is on x 300 y 0, etc.
So I need to check positions of all layers If I use keyframer.Seems It's not a best solution.
What is the best way to do that in TVPaint?
As you can see, all layers are placed differently,circle A is on x 100 y 200, circle B is on x 200 y 250,circle C is on x 300 y 0, etc.
So I need to check positions of all layers If I use keyframer.Seems It's not a best solution.
What is the best way to do that in TVPaint?
Re: put layers on center of canvas
Hmmm, looks like we do not have such a feature to do it easily.
I move your topic in Feature request
I move your topic in Feature request
Re: put layers on center of canvas
OK. I will move them manually.
Re: put layers on center of canvas
Yes, sorry :/
Re: put layers on center of canvas
I am not sure but if you import a png sequence all the pngs are aligned to the center of the canvas. So maybe if you have all circles as separate pngs you can import them into the project.
MAC OS 12.6.2 - TVpaint 11.7.1 PRO 64bit, Wacom Intuos Pro
Re: put layers on center of canvas
It would work only if the circles were orignally a image sequence.
If they were drawn in TVPaint, it's then more complex.
If they were drawn in TVPaint, it's then more complex.
Re: put layers on center of canvas
This might do what you want:
Create a new action in a custom panel, then cut and paste this script into the embed George script command.
Sven
Create a new action in a custom panel, then cut and paste this script into the embed George script command.
Code: Select all
Param none
ScriptName = "CenterAllLayers"
tv_GetWidth
Width = result
CenterX = Width / 2
tv_GetHeight
Height = result
CenterY = Height / 2
tv_LayerCurrentID
OriginalLayer = result
tv_LayerGetImage
OriginalImage = result
Counter = 0
LayerID = ""
For Counter = 0 to 1000
tv_LayerGetID Counter
LayerID = result
// tv_warn "counter = " Counter " layerid = " LayerID
ExitFlag = CMP(LayerID,"none")
IF ExitFlag == 1
EXIT
ELSE
tv_LayerSet LayerID
tv_BrushCut 0 0 Width Height 1 0
tv_BrushRestore Reset 1 Optimize 1
tv_Dot CenterX CenterY 0
END
END
tv_LayerSet OriginalLayer
tv_LayerImage OriginalImage
Sven
Last edited by Svengali on 23 Apr 2014, 23:58, edited 1 time in total.
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Re: put layers on center of canvas
Hmmm, I probably missed something because I can't use your script Svengali
Re: put layers on center of canvas
I just tried it and it seems to work. What do you get when you try it?Elodie wrote:Hmmm, I probably missed something because I can't use your script Svengali
Sven
- Attachments
-
- CenterAllLayers.tvpx
- (78.5 KiB) Downloaded 1087 times
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Re: put layers on center of canvas
Sorry I'm just too blond sometimes, I did a wrong copy paste
I confirm the script is working
This is a really great one, thank you Sven' !
I confirm the script is working
This is a really great one, thank you Sven' !
Re: put layers on center of canvas
Svengali wrote:This might do what you want:
Create a new action in a custom panel, then cut and paste this script into the embed George script command.
Code: Select all
Param none ScriptName = "CenterAllLayers" tv_GetWidth Width = result CenterX = Width / 2 tv_GetHeight Height = result CenterY = Height / 2 tv_LayerCurrentID OriginalLayer = result tv_LayerGetImage OriginalImage = result Counter = 0 LayerID = "" For Counter = 0 to 1000 tv_LayerGetID Counter LayerID = result // tv_warn "counter = " Counter " layerid = " LayerID ExitFlag = CMP(LayerID,"none") IF ExitFlag == 1 EXIT ELSE tv_LayerSet LayerID tv_BrushCut 0 0 Width Height 1 0 tv_BrushRestore Reset 1 Optimize 1 tv_Dot CenterX CenterY 0 END END tv_LayerSet OriginalLayer tv_LayerImage OriginalImage
Sven
Sorry for my ridiculously late reply.
Your script works greatly. Thank you Svengali . I will use it.