Ahoj. Zaujimalo by ma, ci novy GIMP dokaze vkladat vrstvy na presnu polohu numericky - t.j. mam vrstvu a chcem ju dat presne na suradnice x=100 y=120 cez klavesnicu editaciou nie posuvanim.
Myslim, ze s tymto bol doteraz v GIMPE problem, aspon teda ja som takyto sposob v starsej verzii ani neobjavil. Rad sa necham poucit.
Do okna v Script-Fu Console napísať:
(gimp-layer-translate (car (gimp-image-get-active-layer 1)) 100 120)
Toto spôsobí posun aktívnej vrstvy v obrázku 1 o x=+100 y=+120 pixelov. Pokiaľ je id obrázku iné, je potrebné použiť aktuálne číslo (je to to číslo, ktoré sa zobrazuje v lište okna s obrázkom).
Pokiaľ to chcete používať s GUI rozhraním a s klávesovou skratkou ktorá vyvolá okno pre zadanie parametrov na posun vrstvy, stačí na to napísať krátky skript -- vhodný úvod do Script-Fu je aj na týchto stránkach: http://www.root.cz/clanky/piseme-skripty-pro-graficky-editor-gimp-ve-scheme/
BTW, ako tak pozerám na popisy funkcií požitých v príkazoch gimp-layer-translate a gimp-image-get-active-layer, obidva sú datované na roky 1995-1996 a napísané sú ešte pôvodnými autormi GIMP-u -- Spencer Kimball & Peter Mattis, takže problém s tým nebol už od prvých verzií GIMP-u :-)
Skusane v GIMP 2.6, ale predpokladam ze bude fungovat aj v 2.8:
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; Move active layer for GIMP 2.6
; Copyright (C) 2012 mpro
; --------------------------------------------------------------------
; version 0.1 by mpro 2012/05/09
; - Initial relase
; --------------------------------------------------------------------
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
(define (script-fu-move-active-layer img hmove vmove)
(gimp-layer-translate (car (gimp-image-get-active-layer img)) hmove vmove)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-move-active-layer"
_"<Image>/Layer/Transform/Move active layer"
"Move active layer."
"mpro"
"mpro"
"2012, May"
"RGB* GRAY* INDEXED*"
SF-IMAGE "Image" 0
SF-VALUE "Horizontal move" "0"
SF-VALUE "Vertical move" "0"
)
;---end of file move_active_layer.scm---