Texture Paint: how to save it?

I disagree that saving within the blend file is going to alleviate the issue - I am actually starting to think that it might actually cause more of a problem than thought once every image generated is saved in a blend. The link to the mentioned thread.

I think that if you really spend a lot of time with using generated images to start your project, you figure out pretty quickly that the weak link is that they should be committed only when the user is ready to, or if blender closes. Packing into the blend then still means you need to unpack to file path outside of the blend file to edit again, and then you will need to save them. Better option imo is to deal with the idea of where to save and when to save dirty images that have no home path other than the blend file. I mean, inside the blend file is more of a problem since unpacking to work with them is a hassle on its own.

I’m trying to figure this out as what is the best route to take myself, since I want to try tackling things in the future beyond just python addons.

Unless I misread your rant,

sorry … not a rant… an attempt to explain how it works…
if your just thinking that I’m ranting… then I will just let you guys figure this out on your own…

but know this… gripping at the developers… and the coders who do all this work for you for Zero pay…

is not going to get you very far…

If you guys want to think that’s brain dead thinking…
LOL!
hey be my guest…
it’s really no skin off my back…
later…
I got better things to do…

Sorry you feel that way, norvman, I just think that this is a good time to talk about how to go about fixing it until the 2.8 real fix comes along. I have a few ideas, and I am trying to work out whether I can make an addon to do this temporarily, and maybe I can get some help from Spirou4D or proxe if I get stuck.

Essentially, I am thinking that a simple operator could be made as a save file dialogue that includes a few python operators to look for unsaved images, and look for user preferences like if there is a default texture folder and if not, where the tmp folder is set up at. The textures are named byt the type they are if generated form the texture slot tab button, so they coudl be easy to write to disk I think.

Spirou4D helped me with the save file parts of our Artist Panel addon that he is still cleaning up, and he worked out the iteration of the image there. This doesn’t sound too far off from there.

Attachments


Hm, I guess maybe the problem might be more involved than I imagined.

I haven’t had the need to worry about bloated .blend file due to textures, but admittedly, most of the times, I would generate the UV map image from Blender, use that to create the texture externally (e.g. Krita), then load the newly saved texture into Blender.
Where I tended to lose work is when I did further painting in Blender (more details, covering up seams, etc.) and forgot to separately save the texture.

I didn’t see a problem with just auto-packing unsaved textures because I tend not to have many textures created just in Blender. As such, I wouldn’t have minded them just being auto-packed into Blender and I could manually save them out, if I wanted, upon opening the file next time.

If you can take a crack at a temp solution, sounds good to me!

Would your addon also auto-save image files loaded from a directory?
Or is it just to save all unsaved images to a designated directory when saving/quitting? (Or did I misread what you’re aiming to do?)

I’m not sure what the full scope of your intentions are (and what can be done), but I have a few ideas.

  1. When generating an image in Blender, create a checkbox at the bottom saying “Pack into .blend”. If not checked, “Save to…” button.
  2. When running the file save command ([Ctrl]+[s]), have it automatically save images that are already packed or are loaded from a directory.
  3. When exiting, if there are images not saved to .blend or external image sources, show a warning box with a list with options like “Pack all to .blend” “Save all to temp directory” “Save all to…”.

Do these sound feasible at all?

We are talking about the same thing, it just depends on what I can manage as an addon myself compared to what we need for future 2.8 main. I do intend on making something that would be easy to use, so I’ll be testing it myself to get things worked out as well as post here when I get something workable. I barely started dabbling in python a bit ago, but I am confident some simple things can help for now - mainly at least something to account for images not already saved to disk somehow.

edit: perhaps the best approach is to consider generating a project folder for the textures that is in the same directory as the blend, and even save ALL the images in use in the file to the project folder as an option as well.

Well, hats off to you for trying your hand at this. Looking forward to seeing what comes of it!

Hi

Try this:

Paint in Texturepaint…Go T -panel and use the save all images in the slots tap.

It will give a Invalid path: In Menuline.

Go Uv - Editor and save as image…It will pack the painting: into Blender and save it to disk.

Now the painting is saved on disk and in the Blendfile.

Close Blend.file and open it again.

Paint a little more…Before You leave Texturepaint use the Save all image in T -panel and save Blendfile.

Image is now saved in the Blendfile but not in the External file on disk.

Now jsut remember to save the painting in the T panel before You leave Texturepaint.

Could also use the save image in the Uv - edtor to save it to disk.

Ctrl + s in Uv -Editor save to disk Just rememeber Mouse curser have to be in Uv -editor window when You use it.

Save all images in T -panel save to the Blendfile…Packed

Blender show if file is not saved…In Uv - Editor menuline - Image…If not saved there are a little star after image.

Blendfile have the same little star in top menuline if not saved…)

Tai

The initial system for painting in blender was built around the UV/Image Editor and painting there, you would normally think that the natural thing to do would be to generate and image, then save it to disk, then paint, and then finally save image/save image as.

That isn’t the natural flow now since the tools were improved, and I think BlenderSensei addressed this in the ZeroBrush addon that he sells - that you tend to generate the image there in the 3d view toolbar in the Slots tab, and paint on it, generate another in another slot, paint, etc. until you have all this work - then you save the file, close, and it’s gone since pressing the ‘save all images’ button is really only effective if the image has been written to disk first.

Spirou4d set up an incremental save button on the Artist Panel addon, and that also only works with an image that has a home on disk prior to attempting to save. The next thing to do is for me to figure the way to get all the images that are not saved, get their names, and determine a path to save them to, and write them either as a single button available in the paint tool bars or from the header.

I’ll look at this more after work and see what I can do. Even a small utility addon to test this will at least be better than nothing, right?

Hi

When You press the save all Image in T - panel first time It tell You it can’t save the file: Invalid path.

So You go UV -Editor and save the Image to disk If You have automatically pack into Blend. Ticked
It will pack the file when You save Blend file.

Now it work…Save all image in T - panel save to the Blend and save Image in the editor save to disk.

If You want the image to be saved External You have to save it in the Uv - editor.

Tai

Yes, I get that - and I do save my images to disk as soon as I have decided if the resolution they are at is sufficient for detail, since changing the resolution in the N panel in the 2D editor erases all strokes anyway. If I make a 2k image, then save it to disk as an unique named image to my folder, and then continue painting - I can save all, save as, save… that is fine. This doesn’t answer the question of what about when you generate the image from the Texture Slot Tab in 3d view, and there is not a ‘save image to disk’ option there, but a ‘save all images’ that returns a missing filepath. THIS is what needs to be fixed IMO, and I aim to figure it out if I can.

I wrote some notes to myself for later, and basically I see two things needed:

  1. User Prefs: bool option to save all images to filepath in designated ‘Texture’ folder, default to ‘tmp’ if unspecified.
  2. Tick box/Bool in the Generate Image initial dialogue (Slots tab, Texture Properties Panel, and Image Editor) that allows save to blend file path if saved - so maybe the image is saved at that point, and then ‘save all images’ button will work.

Aiaiaia 2.80 beta and still no option to either automatically save or warn the user

1 Like

I had to bite my tongue to not be sarcastic and therefore be ungrateful to the always friendly developers.

Just wait for UI (LMB, Active Tool, etc) is finished, and I think that the old problems that features have are going to be corrected and improved.

I wonder, i see this issue in threads from 2014, that was around 2.74
Im thinking about making my own addon know. I just found an addon which incrementally saved blend files using a timer. Ill check i can use some parts.

1 Like