Welcome, Guest |
You have to register before you can post on our site.
|
|
|
Python Fu - mkdir not working |
Posted by: BaconWizard17 - 01-27-2023, 03:52 AM - Forum: Scripting questions
- Replies (6)
|
 |
Hi all, I've got another Python-Fu question. I'm trying to set up a script for exporting a file. As part of that, I want to create a new folder for the output if it doesn't exist. Here's the code:
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from gimpfu import*
def folderCheck(filePath, newFolder):
filePath.append(newFolder)
outFolder = "/".join(filePath)
outFolderExists = os.path.exists(outFolder)
if outFolderExists == False:
os.mkdir(outFolder)
return outFolder
def exportPNG8(image, layer):
filePath = pdb.gimp_image_get_filename(image)
filePathSplit = filePath.split("/")
fileName = filePathSplit[-1]
outFolder = folderCheck(filePathSplit[0:-1], "PNG8")
register(
"python_fu_marvelmods_export_png8",
"Exports a texture to PNG8 format.",
"Exports a texture to PNG8 format.",
"BaconWizard17",
"BaconWizard17",
"January 2023",
"Export as PNG8",
"*",
[
(PF_IMAGE, "image", "Input image", None),
(PF_DRAWABLE, 'drawable', 'Layer, mask or channel', None)
],
[],
exportPNG8,
menu='<Image>/Marvel Mods/Export Textures/By Texture Format'
)
main()
Everything here is functional except for the part that creates the new folder. I don't have a function for exporting the image right now. My plan was to work on that after I got the folder creation part figured out. I tested the folderCheck function outside of GIMP in regular Python (with some expected inputs), and it worked completely fine and created the expected folder. Here's that test code for comparison, which worked flawlessly:
Code:
import os
def folderCheck(filePath, newFolder):
filePath.append(newFolder)
outFolder = "/".join(filePath)
outFolderExists = os.path.exists(outFolder)
if outFolderExists == False:
os.mkdir(outFolder)
return outFolder
filePath = "C:/Users/ethan/Desktop/Test.xcf"
filePathSplit = filePath.split("/")
fileName = filePathSplit[-1]
outFolder = folderCheck(filePathSplit[0:-1], "PNG8")
Does GIMP just not have permissions to create a new folder, does this function not work in GIMP, or is there something else going on here?
Edit: Something I thought of: Is creating the folder even necessary? Or will GIMP automatically create a folder if it doesn't exist for export?
|
|
|
Trouble Opening Gimp |
Posted by: Charles Page - 01-24-2023, 02:31 PM - Forum: OSX
- No Replies
|
 |
Good Morning, I recently downloaded Gimp to learn image editing (I have used PS in the past...poorly but I found it worked when I needed it) and to use for my personal projects/business. After downloading and installing the 2.10.32 version directly for Intel on my 2016 Macbook Pro (running Catalina) I had no problems with the drag and drop method of installation. When I click on the Gimp icon the program acts like it is opening but it just stalls out and force quit ends up saying that the program is not responding. This is after some time (setting the computer aside and waiting for the application to open). Have I missed something? Is there some step that I am not completing to run the software? Thank you guys.
Any help would be greatly appreciated!
|
|
|
GIMP3-ML install in gimp version 2.99.14 |
Posted by: rilla - 01-23-2023, 05:26 PM - Forum: Windows
- No Replies
|
 |
Im trying to install GIMP3-ML on windows 10 ive downloaded the file from github and extracted it i installed python 3.10 and i downloaded the weights but i confused on what to do with the weights and the extracted GIMP3-ML i need help im also using gimp version 2.99.14
|
|
|
Toolbox is Gone |
Posted by: cmontgomery1054 - 01-23-2023, 12:16 AM - Forum: General questions
- Replies (3)
|
 |
I understand that this might be a stupid question but I'm new to using the program and I'm still figuring out how to make it work. I was using my tablet today and I guess I accidently pressed something because all of the tabs disappeared. The drop-down menu that allowed you to see and change your tools is gone and the box on the right that listed your layers is also gone. All that I see when I open an image is the ruler and the menu bar. I've looked at tutorials and clicked on just about everything, but nothing seems to be working. I'm wondering if it's a glitch with the program or is there something that I am not seeing. Please help.
|
|
|
Wrapping path to cylinder |
Posted by: Ofnuts - 01-22-2023, 06:20 PM - Forum: Gallery
- Replies (9)
|
 |
Results of a script WIP to transform the sides, then ofn-bend-path to fit the vertical perspective. A bit contrived but still a lot easier than Map Object (because it still relatively WISIWYG) and since its done on the path the edges remain sharp.
How realistic does it look?
|
|
|
scale tool |
Posted by: rtalb7 - 01-21-2023, 09:07 PM - Forum: General questions
- Replies (2)
|
 |
The scale tool usually works smoothly but now it is jerky and it will not scale height and width at the same rate. Move tool is also jerky.
|
|
|
|