Mon Mar 04, 2019 3:01 pm
Mon Mar 04, 2019 3:34 pm
Mon Mar 04, 2019 4:39 pm
Mon Mar 04, 2019 5:22 pm
Mon Mar 04, 2019 5:48 pm
_,layers=pdb.gimp_file_load_layers(image,'/tmp/layers.xcf')
for l in layers:
image.add_layer(gimp._id2drawable(l))
Mon Mar 04, 2019 6:00 pm
Mon Mar 04, 2019 8:16 pm
Randomsteve wrote:little over my head I think. don't know a ton about scheme, even less about python. Trying to wrap my head around one and translate concepts from one to the other is beyond me I think.
I've been trying to wrap my head around exactly what it is that the gimp-image-get-layers procedure does and in gimps procedure browser under return values it states this:
Return Values:
num-layers INT32 The number of loaded layers (num-layers >= 0)
layer-ids INT32ARRAY The list of loaded layers
This looks to me like the data of the layers ids returned from this procedure is handled with an array instead of a list? is this true? and if so how can I get this array to list out from me and print out into a console or something so I can see whats going on?
Tue Mar 05, 2019 8:13 am
Tue Mar 05, 2019 11:55 pm
Wed Mar 06, 2019 2:37 am
Wed Mar 06, 2019 3:33 am
Thu Mar 07, 2019 11:40 am
(define (script-fu-randomsteve filename)
(let*
(
(imageId (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(layerList (vector->list(cadr(gimp-image-get-layers imageId))))
)
(for-each
(lambda (layerId)
(gimp-message (string-append "layer " (car (gimp-layer-get-name layerId))))
) layerList
)
(gimp-display-new imageId)
(gimp-displays-flush)
)
)
(script-fu-register "script-fu-randomsteve"
"Randomsteve"
"This is Randonsteve's script"
"(C) Randomsteve"
"Randomsteve"
"0.0"
""
SF-FILENAME "File to load" ""
)
(script-fu-menu-register "script-fu-randomsteve" "<Image>")
Thu Mar 07, 2019 2:14 pm