Page MenuHome

No explicit option to disable autopack
Closed, ResolvedPublic

Description

System Information
not important

Blender Version
2.69

Short description of error
Assume you are beginner....
You played with blender saved some userprefs and startup...
Somehow you saved with your preferences that auto-pack is enabled...

You started a new VSE project added some wav files (1GB) you save... a huge blend file.

Question:
How would you disable auto-pack feature ?

Exact steps for others to reproduce the error
Just use "File>>External Files>>Unpack into Files" and header says "... (auto-pack disabled)"
My suggestion is to add tooltip to the "Unpuack into Files" or think of something else (wiki).
I maybe the only one that was frustrated looking everywhere howto disable auto-pack but in my opinion its worth to mention it to the developers.

Event Timeline

Czarek Kopias (kopias) set Type to Bug.
Czarek Kopias (kopias) created this task.
Czarek Kopias (kopias) raised the priority of this task from to Needs Triage by Developer.
Brecht Van Lommel (brecht) renamed this task from disable auto-pack? to No explicit option to disable autopack.
Brecht Van Lommel (brecht) triaged this task as Confirmed, Medium priority.

We could make Autopack a toggle in the External Data menu that you can also toggle individually, unless there is some reason I'm missing that would make this not work.

I personally think a beginner would have no idea what "auto-pack" even means. I would think it would flow better to prompt the person when they load an external file that is greater than XXX MB if auto-pack is enabled. When they hit upload, let them know what uploading large files will do, and give them an option to disable auto-pack there.

I vote for toggle in External Data, but i would like to see some header info about packed images as well
(something like "auto-pack: filename (filesize) added") and in console

I'm probably going to feel really stupid in a moment, but where can you actually enable auto-pack in the first place?
I looked all over the place in blender itself, but neither that, nor googleing and searching in the wiki didn't return anything for me.

File > External Data > Pack into .blend file, that will enable autopack. It's not at all obvious that this happens, which is part of the problem.

Oh i see, well then your suggestion sounds good to me, and @Scott Petrovic (scottpetrovic)'s does as well (as an additional feature to have) ... If you think this thing is realistic to tackle for a newcomer in blender core development, I'd be willing to give it a shot! (after proposing the exact plan for the changes and having them approved, of course)

This will probably be quite doable for a newcomer yes.

Ok I looked into it - here's my current implementation (for @Brecht Van Lommel (brecht)'s feature suggestion):

  • Enable Auto-Pack: Only sets G_AUTOPACK
  • Disable Auto-Pack: Only unsets G_AUTOPACK
  • Pack Into .blend: Packs all currently used external files into .blend (Leaves G_AUTOPACK untouched)
  • Unpack Into Files: Unpacks all currently packed files (Leaves G_AUTOPACK untouched)

At the moment enabling auto-pack does NOT automatically pack all external files that you're already using into the .blend, but only affects any external files you add after enabling auto-pack. (So if you wanted all previously added external files to be packed as well, you'd have to also click "Pack Into .blend" afterwards) I was first going to solve it the other way round (That was also the main reason why I picked two seperate buttons for enabling/disabling instead of a toggle - to emphasize that not only a flag is toggled, but also actions are being performed), but either way I'd like your opinion on this, as I'm really not sure which way would be the best fit for most users.

As soon as we have a decision on that I can upload the diff! (The current implementation is basically finished and I just need to do some more testing before it's ready for review.)

I think that if you enable autopack, it should immediately pack all files because it's going to happen as soon as you save anyway. If you disable it, it probably should not unpack automatically?

I would have a single menu item, but maybe change the wording. The menu could look like this, with a checkmark to indicate if autopack is enabled, and the name "autopack" replaced by "keep packed" in the UI and popup messages.

✓ Keep Packed Into .blend
-----------------------------
  Pack Into .blend
  Unpack Into Files
-----------------------------
...

This would remove the "Disable Auto-pack, keep all packed files" option from the "Unpack Into Files" operator, though that operator would still disable autopack automatically.

CC'd a few people who might have feedback on this.

Fully agree with the single menu item toggle solution!

Something else I thought out about this:
When packing is handled automatically it's really a bit weird that the user still has the possibility to manually mess up the state that the program is trying to keep up; and that's also the reason why ambiguities like "If autopack is enabled, does manually unpacking also disable autopacking?" arise ... Consequently I think it would make a whole lot of sense to grey out "Pack into .blend" and "Unpack Into Files" altogether while "Keep Packed Into .blend" is toggled ON. As soon as it's toggled OFF I think that the current state should be retained (everything packed) and the user should be in full manual control again.

Additional idea for the manual functionality: Grey out "Pack Into .blend" if nothing is there to pack, and vice versa grey out "Unpack Into Files" if nothing is packed anyway? (I figure this would also show the user that everything is still packed, when he disables autopacking, taking away yet more ambiguity here)

Greying out these two when autopack is enabled sounds good to me.

Checking if there is anything to pack / unpack would improve things, but we generally try to keep operator poll functions quick, and you'd need to loop over all data to check if there is anything to pack/unpack. So I would avoid trying to do that for now.

Ok sure, performance matters as well! :)
Just out of dev curiosity: When are these poll functions run? Timer based or callback based? (on operation invoke/exec something?)

Before the operator runs and everytime the operator is displayed in some menu or button it runs to poll function to check if it should be shown disabled.

The particularly problematic cases are when the button is always shown in the UI, or when doing an operator search (spacebar), then it has to do the poll function for lots of operators.

Simon Repp (simonrepp) edited this Maniphest Task.Dec 19 2013, 3:12 PM

I'm kinda stuck implementing the toggle - i could not yet find any way to modify the icon via C, neither could I find a way to change the operator name on exec or something (although that's probably a bad idea anyway because of possible messup with localization? still need to read up on how localization is implemented actually, maybe I'm wrong :)) EDIT: Did my reading up on the internationalization thing: If I understand it correctly, changing the name on the fly should not pose a problem regarding internationalization. Correct me in case I'm wrong here!

As for the operator name, I am still pondering ...
I think finding a term that is not immediately understandable, but does consequently not lead to any wrong assumptions about the functionality might be the way to go here. I kind of get the feeling that any name I can come up with leaves out some aspect of the functionality. Or in other words, we need to find a phrase to explain "Everything that is not yet packed, gets packed now, and everything you add in the future will also automatically be packed into the .blend" ... If we don't find one I would prefer something like (but does not have to be) "Autopack", which is not understandable on its own, but can be understood through the tooltip/other documentation while not being susceptible to being misunderstood. Am I making sense? :) What do you all think about this?

Ah yes, the icon, there's no simple automatic way to do that for operators. I think you need add a "use_auto_pack" property to bpy.data in rna_main.c (similar to is_saved and rna_GameSettings_auto_start_get/set). Then you can specify the icon from the python script based on that setting.

For the operator name in the menu, I think something like "Keep Packed Into .blend" or "Automatically Pack Into .blend" is fine, it's impossible to explain completely. The tooltip can explain it more.

New diff is up, thanks for the hints, that helped a great deal!!

I added yet another revision, some things about this were still bothering me ... see the comments for the revision!

Fix committed in {632c29fef3a566d6aac9ea35e7875f08f3d1cf74}.

Thx simonrepp for your contributtion. This was a hell for me when i had a project in vse and didnt know howto disable autopack.

Simon Repp (simonrepp) edited this Maniphest Task.May 12 2014, 4:33 PM