Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
05-22-2023, 12:39 AM
(This post was last modified: 05-22-2023, 01:34 AM by y2keeth.)
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
Posts: 6,340
Threads: 272
Joined: Oct 2016
Reputation:
563
Operating system(s):
Gimp version: 2.10
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.
Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
05-22-2023, 08:51 AM
(This post was last modified: 05-22-2023, 09:01 AM by y2keeth.)
(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
Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
05-23-2023, 03:28 AM
(This post was last modified: 05-23-2023, 03:29 AM by y2keeth.)
(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?
Posts: 6,340
Threads: 272
Joined: Oct 2016
Reputation:
563
Operating system(s):
Gimp version: 2.10
(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".
Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
(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
Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
(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?
Posts: 27
Threads: 3
Joined: May 2023
Reputation:
0
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
05-27-2023, 05:21 AM
(This post was last modified: 05-27-2023, 07:05 AM by y2keeth.)
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
Posts: 7,132
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
If you go to Gimp menu Windows -> Help -> Procedure Browser you will find a listing of the required parameters.
Posts: 6,340
Threads: 272
Joined: Oct 2016
Reputation:
563
Operating system(s):
Gimp version: 2.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)
)
|