Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp native batch convert?
#1
anybody give me a example of using scriptfu to convert a entire directrory of tga to dds RXGB dtx5 

since bimp don't work anymore for dds
Reply
#2
An example with Python-fu.

In your case you would slip the photocopy/cartoon calls, and replace the file_jpeg_save() with a  file_dds_save() with the adequate parameters.
Reply
#3
(05-22-2023, 07:28 AM)Ofnuts Wrote: An example with Python-fu.

In your case you would slip the photocopy/cartoon calls, and replace the file_jpeg_save() with a  file_dds_save() with the adequate parameters.

thanks  a lot
Reply
#4
(05-22-2023, 12:39 AM)y2keeth Wrote: anybody give me a example of using scriptfu to convert a entire directrory of tga to dds RXGB dtx5 

since bimp don't work anymore for dds

" slip the photocopy/cartoon calls"
what does "slip" mean?
Reply
#5
(05-23-2023, 03:28 AM)y2keeth Wrote:
(05-22-2023, 12:39 AM)y2keeth Wrote: anybody give me a example of using scriptfu to convert a entire directrory of tga to dds RXGB dtx5 

since bimp don't work anymore for dds

" slip the photocopy/cartoon calls"
what does "slip" mean?

I meant "skip".
Reply
#6
(05-23-2023, 12:38 PM)Ofnuts Wrote:
(05-23-2023, 03:28 AM)y2keeth Wrote:
(05-22-2023, 12:39 AM)y2keeth Wrote: anybody give me a example of using scriptfu to convert a entire directrory of tga to dds RXGB dtx5 

since bimp don't work anymore for dds

" slip the photocopy/cartoon calls"
what does "slip" mean?

I meant "skip".

oh ok lol
Reply
#7
(05-24-2023, 04:55 AM)y2keeth Wrote:
(05-23-2023, 12:38 PM)Ofnuts Wrote:
(05-23-2023, 03:28 AM)y2keeth Wrote: " slip the photocopy/cartoon calls"
what does "slip" mean?

I meant "skip".

oh ok lol

any examples of dds settings?
Reply
#8
found this code also but dont see where you set the dds type?

(define (convToDDS pattern)
(define filelist (cdr (file-glob pattern 1)))
(define filelist (car filelist))
(while (not (null? filelist))
(define filename (car filelist))
(define image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(define drawable (car (gimp-image-get-active-layer image)))
(define filename (string-append (substring filename 0 (- (string-length filename) 3)) "dds"))
(file-dds-save RUN-NONINTERACTIVE image drawable filename filename 1 1 0 0 -1 0 0 )
(set! filelist (cdr filelist))))

i know its 7 for rxgb
Reply
#9
If you go to Gimp menu Windows -> Help -> Procedure Browser you will find a listing of the required parameters.

   
Reply
#10
Filters ➤ Python-fu ➤ Console  ➤ Browse and ennter DDS in the search bar:

   

And if you hit Apply the python console is pre-filled with a call:

   

So, possibly, using the same names as in the python example code:

Code:
pdb.file_dds_save(image, drawable, outfile, outfile, 7, 0, 0, 0, 0, 7, 0, True,True,2.24,True,False,.5)

Where the 7 is the documented value for RXGB (DXT5).

The python documentation should be read with a grain of salt because it is auto-generated from the same sources as the script-fu docs and Pythin and Scheme have a different syntax.
  • Dashes in variable/constant names should be replaced by underscores
  • When present, the run-mode first argument should be ignored, it is not used in Python (it is actually optional, and specified differently)
  • Toggles that are specified as INT32 can be entered as boolean (False: 0, True: 1, and mind the initial capital). This is a bit more readable.
  • Many calls define constants names for their arguments when necessary, better use them when they exists (alas, not for the DDS plugin, it they had existed you could have used DDS_FORMAT_RXGB_DXT5 and DDS_MIPMAPS_NONE that are a bit less mysterious than 7 and 0)
  • For long calls, you can also enter the call like this, to put a comment with each argument, only the first line needs to be correctly indented:
Code:
pdb.file_dds_save(image, drawable, outfile, outfile,
                    7,      # DDS type
                    0,      # no mipmaps
                    0,      # save layer
                    0,      # Default pixel format
                    0,      # Transparent color is First
                    7,      # Lanczos filtering
                    0,      # Default wrap mode
                    True,   # gamma-correct filtering
                    True,   # Use sRGB
                    2.24,   # Gamma value
                    True,   # Perceptual compression
                    False,  # Preserve alpha
                    .5,     # Alpha (ignored, due to previous)
                    )        
Reply


Forum Jump: