Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-04Fix T87489: Text Data-Blocks get deleted on Recursive PurgeSebastian Parborg
Text data block were not considered special in the recursive purge function. So they would get deleted if they had no actual users. To fix this we instead make text data block use "fake user" so that addon authors can specify script files that should be removed if nothing is using it anymore. Per default, new text object have "fake user" set. So functionality wise, the user has to explicitly specify that they want the text object to be purge-able. Reviewed By: Bastien Differential Revision: http://developer.blender.org/D10983
2021-04-08Text Editor: don't force other views to follow the cursorCampbell Barton
While the existing behavior worked as intended, it wasn't possible to have two views on the same file at different locations. Since there isn't much use in having two views open at the same location allow one view to be at a different scroll location. UI edit-source and selecting a text data block now need explicit calls to scroll to the cursor location. Resolves T87284
2021-03-18Cleanup: spellingCampbell Barton
2021-02-16Assets: Remove appended asset when dropping operation failsJulian Eisel
When dropping an asset somewhere, it is appended and then a drop operation is called to actually add it to the scene based on current context. If this drop operation fails, the appended data-block is now still in the .blend. The user may not notice and not expect this. Instead idea is to rollback any changes done by dropping code if the operation fails, namely removing the appended data-block again. Adds a new `cancel()` callback which is called if the drop operator returns `OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets on drop failure. Also removes the `free_id_on_error` property of the `NODE_OT_add_group` operator, which was used as ad-hoc solution to get this same behavior.
2021-02-10Cleanup: remove redundant headers in source/blender/editors/Campbell Barton
Remove redundant headers using `./source/tools/utils_maintenance/code_clean.py` Reviewed By: jmonteath Ref D10364
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-05Cleanup/refactor: Undosys: Get rid of the magic values for undo direction.Bastien Montagne
Move `eUndoStepDir` to `BKE_undo_system.h` and use its values everywhere. Note that this also introduce the `STEP_INVALID` value in that enum. Finally, kept the matching struct members in some lower-level readfile code as an `int` to avoid having to include `BKE_undo_system.h` in a lot of unrelated files.
2021-01-25Cleanup: pass 'rctf' rectangle to 2D box drawing functionsCampbell Barton
Passing 4x arguments for the rectangle, mixed in with round-box radius & color wasn't very readable. Instead, pass a `rctf` as the first argument to UI box drawing functions.
2021-01-19Cleanup: use 'const' argument for parameter argumentCampbell Barton
2021-01-19UI Code Quality: Use "params" struct for area and region callbacksHans Goudey
These functions with many arguments can be unwieldy. Aside from the obvious issues with rewriting the list of arguments and the opportunities for error and frustration that presents, the long list of arguments make these systems hard to change. So when an argument should be added, someone might skip that and add some hack instead. So, as proposed in T73586#1037210, this patch instead uses a "params" struct for each of these callbacks. - Use param argument for `ARegionType.listener` - Remove unused window field in region listener - Use param argument for `SpaceType.listener` - Use params struct for `ARegionType.message_subscribe` Differential Revision: https://developer.blender.org/D9750
2021-01-06UndoType: Refactor: replace `use_context` boolean by a bitflag.Bastien Montagne
We will soon need more options here, sinmpler and cleaner to use a bitflag then.
2021-01-06Undo: Further tweak/fixes the 'use context' flag of undo types.Bastien Montagne
Note that this is fairly fragile still, especially in cases like paint cureve undo, which actually does not use context in most cases (and can be called with a NULL context), but do need it in one case. This will need a proper rework at some point.
2021-01-06Cleanup/refactor: UndoType: Clarify `use_context` variable.Bastien Montagne
Rename it to mark it is only for `encode` callbacks, fix `encode` callback of text undo to early fail in case it gets a NULL context, add an assert to `BKE_undosys_step_push_with_type` that context is not NULL when undotype requires a valid one. Note that in practice this should not change anything, currently it seems that we always get a valid context in `BKE_undosys_step_push_with_type`?
2021-01-04Cleanup: redundant code, minor inconsistenciesCampbell Barton
- Remove ternary operators when both values are the same. - Remove break after return. - Remove redundant NULL checks for code which handles those cases immediately beforehand.
2020-12-15Asset System: Support dragging assets and appending on dropJulian Eisel
For the Asset Browser, it needs to be possible to drag assets into various editors, which may not come from the current .blend file. In other words, the dragging needs to work with just the asset metadata, without direct access to the data-block itself. Idea is simple: When dragging an asset, store the source file-path and data-block name and when dropping, append the data-block. It uses existing drop operators, but the function to get the dropped data-block is replaced with one that returns the local data-block, or, in case of an external asset, appends the data-block first. The drop operators need to be adjusted to use this new function that respects assets. With this patch it only works for dragging assets into the 3D view. Note that I expect this to be a short-lived change. A refactor like D4071 is needed to make the drag & drop system more future proof for assets and other use cases. Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1 project milestone on developer.blender.org. Differential Revision: https://developer.blender.org/D9721 Reviewed by: Bastien Montagne, Brecht Van Lommel
2020-12-13UI: Remove Unused 'U.wheellinescroll' PropertyYevgeny Makarov
Remove 'U.wheellinescroll' preference, currently hidden and unused. Differential Revision: https://developer.blender.org/D9616 Reviewed by Brecht Van Lommel
2020-12-10Cleanup: Remove unused c popup menu for text editorAaron Carlisle
This code hase been usused for 10 years and the right click menu is now in python.
2020-12-03Cleanup: view-port --> 2D/3D ViewportAaron Carlisle
2020-11-23Fix T82849: Assert When Unlinking "Edit Source" Text Data-block.Bastien Montagne
Simplify and sanitize handling of usercounts for Text IDs generated trhough `BKE_text_load_ex`.
2020-11-06Cleanup: use ELEM macro (>2 args)Campbell Barton
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-11-03Fix C operators can't set default display or sort type for File BrowserJulian Eisel
`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
2020-10-30Text: support "Text to 3D Object" for read-only dataCampbell Barton
Add poll function for read-only text data, for operators that don't require the text to be editable.
2020-10-29UI: use "Save As" when saving un-saved image/text filesYevgeny Makarov
Now the behaviors are consistent for blend, image and text files: - If the file is not writable, will report it. - If the file is new (without a path), save as will be used. - If the file was deleted, will try to recreate it. Ref D6755
2020-10-24UI: Capitalization CorrectionsYevgeny Makarov
Approximately 141 changes of capitalization to conform to MLA title style. Differential Revision: https://developer.blender.org/D8392 Reviewed by Julian Eisel
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-02Cleanup: Use enum for return values in context callbacksSybren A. Stüvel
Define enum `eContextResult` and use its values for returns, instead of just returning 1, 0, or -1 (and always having some comment that explains what -1 means). This also cleans up the mixup between returning `0` and `false`, and `1` and `true`. An inconsistency was discovered during this cleanup, and marked with `TODO(sybren)`. It's not fixed here, as it would consititute a functional change. The enum isn't used everywhere, as enums in C and C++ can have different storage sizes. To prevent issues, callback functions are still declared as returning`int`. To at least make things easier to understand for humans, I marked those with `int /*eContextResult*/`. This is a followup of D9090, and is intended to unify how context callbacks return values. This will make it easier to extend the approach in D9090 to those functions. No functional changes. Differential Revision: https://developer.blender.org/D9095
2020-10-02Fix text editor auto-complete refinement featureCampbell Barton
Left/right arrow keys can refine the completion, this wasn't redrawing and there was an off-by-one error checking the next character.
2020-10-02Fix text editor auto-complete mouse interactionCampbell Barton
- Remove MMB for activating an auto-complete item (use LMB instead). - Update on cursor motion.
2020-09-12Cleanup: Remove GLEW dependencies outside of GL moduleClément Foucault
2020-09-09Cleanup: reduce variable scopeJacques Lucke
2020-09-09Cleanup: spellingCampbell Barton
2020-09-04Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fixSebastian Parborg
No functional changes
2020-08-28Fix for T75369: Text Editor Line ColorHarley Acheson
Use correct text color when syntax highlighting is off but line numbers are on. Differential Revision: https://developer.blender.org/D7337 Reviewed by Hans Goudey
2020-08-23Cleanup: GPU: Use explicit clear value in GPU_clear* commandsClément Foucault
This replace `GPU_clear()` by `GPU_clear_color()` and `GPU_clear_depth()`. Since we always set the clear value before clearing, it is unecessary to track the clear color state. Moreover, it makes it clearer what we clear the framebuffer to.
2020-08-18Cleanup: GPUState: remove double GPU_blend callsClément Foucault
2020-08-18GPUState: GPU_blend final API renamingClément Foucault
We now use GPU_blend for enabling / disabling blending and explicitly set the blend equation.
2020-08-18Cleanup: GPUState: Replace blend func separate by enumClément Foucault
2020-08-17Cleanup: move Python script execution into BPY_extern_run.hCampbell Barton
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).
2020-08-07Cleanup: declare arrays arrays where possibleCampbell Barton
2020-08-07Merge branch 'blender-v2.90-release' into masterJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-08-04Refactor: rename SpaceType->new to SpaceType->createJacques Lucke
The data member `new` was conflicting with the `new` keyword when `BKE_screen.h` was included in C++ files. Reviewers: sergey Differential Revision: https://developer.blender.org/D8459
2020-07-03Cleanup: Editors/Space/Text, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/editors/space_text` module. No functional changes.
2020-06-27Docs: correct invalid doxygen params & referencesCampbell Barton
2020-06-24Text: add replace all operatorCampbell Barton
D8032 by @Poulpator with minor edits
2020-06-23Cleanup: move text.c comments to the struct/flag declarationsCampbell Barton
Also update/correct some of the comments.
2020-06-23Cleanup: rename 'name' to 'filepath' for DNA typesCampbell Barton
Using 'name' for the full path of a file reads badly, especially when id.name is used in related code.
2020-06-22UI: report when reloading unsaved textCampbell Barton
Address confusion from T78114.