Age | Commit message (Collapse) | Author |
|
|
|
While this is very unlikely, always write the autosave file,
even if the `memfile` undo data is unexpectedly NULL.
Also use CLG for logging warnings.
|
|
- Split out auto-save file writing from timer code.
- Add wm_autosave_timer_begin so there are both begin & end functions.
- Replace WM_event_add_timer/WM_event_remove_timer with begin/end calls.
|
|
Also make wm_autosave_location a static function.
|
|
The previous naming made it seem as if the timer had already ended
where as this function ends the timers.
|
|
Previously all blend files included the path they were saved,
causing files distributed publicly to include users local paths.
This also included developers home directories for startup & userprefs
defaults & app-templates bundled with Blender.
Now recovery information is only written for auto-save & quit.blend
since this is the only time they're intended to be used.
|
|
No functional changes, make room for a write equivalent.
|
|
While this happened to be corrected by code that runs afterwards,
leaving this in an invalid state could cause problems in the future.
|
|
The check for undo-depth increment/decrement assumed a newly loaded
window manager would have a different pointer.
This broke bl_animation_fcurves test indirectly,
the change to undo-depth caused the redo panel to attempt to popup
in background mode - which isn't supported.
Now the pointer is unchanged, the undo-depth is assumed to match
the value used when calling the operator.
The undo-depth is now properly maintained between file loads,
which is an improvement on the original behavior which reset it.
|
|
Keep the pointer location from the initial window-manager
between file load operations.
This is needed as the Python API may hold references to keymaps for e.g.
which are transferred to the newly loaded window manager,
without their `PointerRNA.owner_id` fields being updated.
Since there is only ever one window manager, keep the memory at the same location so the Python ID pointers stay valid.
Reviewed By: mont29
Ref D10690
|
|
Previously many operations would run on file load, even if the file
did not load. Pre/post load handlers were called, timers canceled,
all undo data freed, editors exited ... etc.
Now keep the blend file in it's current state.
This simplifies updating this area of code as there is one less
possible situation to account for.
|
|
Currently file loading performs almost all reloading logic
even in the case loading the file fails, causing the file to be in
a state that isn't well defined: undo is cleared, timers are canceled &
scripts are re-registered.
|
|
- Don't set G.relbase_valid until the file is loaded.
- Remove unnecessary string pointer comparison.
- Remove unused filename being passed to 'setup_app_data'.
|
|
|
|
Saving the startup file now uses "Save Copy", so paths are preserved.
|
|
|
|
Removal of 'camera frame' around blend file thumbnail images.
Differential Revision: https://developer.blender.org/D10490
Reviewed by Brecht Van Lommel
|
|
When opening a Blender version for which there are no preferences, the splash
shows a button like "Load 2.92 Settings". Using this could cause a memory leak
of the storage for recently opened files.
|
|
Reloading preferences didn't update Python's `sys.path` to account
for the modified `script_directory`.
This meant the operator to load settings from a previous version
required a restart to initialize Python when this directory was set.
|
|
Caused by rB5b34d11b55e0.
Above commit restored the view matrices in ED_view3d_draw_offscreen
_before_ they can be stored in the ImBuff (see ED_view3d_draw_offscreen
/ texture_paint_image_from_view_exec).
Now make restoring the view matrices optional and dont do this in case
of reprojection, so the used matrices can still be saved in the ImBuff
later.
Reviewed By: campbellbarton
Maniphest Tasks: T85395
Differential Revision: https://developer.blender.org/D10331
|
|
Support custom revert actions, necessary for recover operations
to be able to reload the file with scripts enabled.
|
|
Support recovering blend files with scripts enabled,
needed to fix T85011, can be useful in general too.
Adding this also resolves an assert in BKE_autoexec_match,
since it ran even when scripts were enabled.
|
|
- Return success from WM_recover_last_session
- Avoid setting global variables is already called in WM_file_read.
While it didn't cause any problems, these assignments ran even when
recovering the session failed to load the file.
- Return OPERATOR_CANCELLED when the operator fails.
Returning success is needed to fix T85011.
|
|
New dialog box layout with large alert icon for the Python script execution warning popup.
Differential Revision: https://developer.blender.org/D9390
Reviewed by Hans Goudey
|
|
Shared helper function to create a split layout with an alert icon for popup dialogs.
Differential Revision: https://developer.blender.org/D9486
Reviewed by Julian Eisel
|
|
Also decrease the scope of variables related to the loops.
|
|
Use a dynamic name/description based on the set properties. This makes it more
clear what's going on and avoids confusion, as explained in the report.
|
|
`WM_operator_properties_filesel()` allows C operators to set a display or sort
type for the File Browser to use. But the File Browser would always override
that because of an invalid `_is_set()` check. (The operators don't actually set
the value, they only set the property's default value.)
The only operator affected by this is "Recover Auto Save". It is supposed to
show a vertical list ordered chronologically. It used settings from the
previous File Browser usage before this patch.
Operators using the File Browser should generally use
`FILE_DEFAULTDISPLAY`/`FILE_SORT_DEFAULT` now, except if they have a reason not
to. See comments at their definition.
----
This makes it so operators that set a different display or sort type
don't change the sort or display type for the next File Browser operation.
So using "Recover Auto Save" entirely isolates display and sort type from other
operations.
Differential Revision: https://developer.blender.org/D8598
Reviewed by: Bastien Montagne
|
|
|
|
Improved alignment of items on the File Close Dialog.
Differential Revision: https://developer.blender.org/D6938
Reviewed by Hans Goudey
|
|
Various changes to some labels and descriptions to be more accurate, clear, or less confusing.
Differential Revision: https://developer.blender.org/D8394
Reviewed by Hans Goudey
|
|
Scale widths of popovers and dialogs with Text Style font point changes.
Differential Revision: https://developer.blender.org/D9132
Reviewed by Hans Goudey
|
|
Also add static assert for struct size assumption.
|
|
This shows the file's full path, its modification date, and its size in
the tooltips for the open recent fiels menu. When no file path is set,
the original operator description is used.
Differential Revision: https://developer.blender.org/D9028
|
|
Change to monochrome version of the large alert icons and use 'Question' for the the Quit Confirm dialog box.
Differential Revision: https://developer.blender.org/D9062
Reviewed by Pablo Vazquez
|
|
This choice was made when preferences were not read in background mode,
so the temp dir needed to be initialized with something.
See bc9848f7e67c3e695403179f8bcdb78b0e5764a3.
Now preferences are always read there is no reason to ignore this
particular preference in background mode.
Anyone wanting to do background renders that ignore their preferences
can run with factory startup.
|
|
This last worked in v2.27 (2003) where all paths were initialized to "/"
which was still checked to initialize the temp directory.
This hasn't been the case since 932e9e831647604e0b129b55e5ab035
where it changed to "/tmp/", then an empty string (current default).
|
|
When blend files were loaded with app-templates,
setup_app_data was running before defaults were updated.
This is likely to cause problems with order of initialization
so always update the startup file beforehand.
|
|
Now versioning UserDef is run in readfile.c,
as is done for other Blender data.
Previously versioning was mixed with other run-time initialization,
so it needed to be called later by the window manager.
|
|
Version patching userpref.blend wasn't using the correct version,
causing settings not to be properly updated.
This seems the likely cause of T70196 and similar bugs.
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
There was no way to reset the current file to factory settings
without reloading the preferences (which disables & re-enables add-ons),
this slows down resetting files and can complicate tests.
|
|
|
|
Using a boolean to select between eval/exec behavior wasn't very
readable.
|
|
This commit renames 'execute' to 'run' because:
- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
making naming awkward (for future API refactoring).
|
|
Currently BPY_extern.h includes too much mixed functionality.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.
No functional changes.
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
Simply remove that check ob userdef's themes, we are never read any
userdef from startup file anymore, so this check makes no more sense.
To be backported to 2.83.
|
|
Previously if a modal operator is active, which might leave Blender in a state
where it's not safe to autosave, it would try again in 10s. Now try again in
10ms so it's much less likely to be missed, since overhead of such a timer is
negligble anyway.
Also remove the debug print that was added to investigate a bug at some point.
|