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
2022-07-05Python: remove invalid Py_TPFLAGS_HAVE_GC usageCampbell Barton
Blender wouldn't start with Python 3.11 because of an error in Py_TPFLAGS_HAVE_GC usage for `bpy.app.handlers.persistent`. Remove this flag as it's not necessary. Part of fix for T99277.
2022-06-03Compositor: add pre/post/cancel handlers and background job infoPhilipp Oeser
Main motivation is from T54314 where there was no way to read from a Viewer image datablock after the compositor has run. The only solution there was to do a full rerender (which obviously takes much longer). Adding a handler avoids having to rerender. This uses new syntax from rBf4456a4d3c97 and also adds "COMPOSITE" as a job type that can be queried by `bpy.app.is_job_running`. NOTE: there is another issue when multiple viewers are used and these get active via RNA (compo execution is not triggered there yet -- unlike when a viewer is selected in the Editor -- this is an issue of `ED_node_set_active` vs. only `nodeSetActive`, but this will be tackled separately) Maniphest Tasks: T54314 Differential Revision: https://developer.blender.org/D15078
2022-06-02Expose background job info to PythonSybren A. Stüvel
Add `bpy.app.is_job_running(job_type)` as high-level indicator. Job types currently exposed are `WM_JOB_TYPE_RENDER`, `WM_JOB_TYPE_RENDER_PREVIEW`, and `WM_JOB_TYPE_OBJECT_BAKE`, as strings with the `WM_JOB_TYPE_` prefix removed. The functions can be polled by Python code to determine whether such background work is still ongoing or not. Furthermore, new app handles are added for `object_bake_{pre,complete,canceled}`, which are called respectively before an object baking job starts, completes sucessfully, and stops due to a cancellation. Motivation: There are various cases where Python can trigger the execution of a background job, without getting notification that that background job is done. As a result, it's hard to do things like cleanups, or auto-quitting Blender after the work is done. The approach in this commit can easily be extended with other job types, when the need arises. The rendering of asset previews is one that's likely to be added sooner than later, as there have already been requests about this. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14587
2022-04-26Cleanup: use boolean arguments and return valuesCampbell Barton
2022-04-26PyAPI: support persistent handlers for class & static methodsCampbell Barton
Support methods being used as persistent callbacks. Resolves T97555.
2022-03-28Cleanup: use "num" as a suffix in: source/blender/pythonCampbell Barton
See T85728
2022-03-08Cleanup: spelling in comments, use C++ comments for disabled codeCampbell Barton
2022-03-07Python: Add new `annotation_pre` & `annotation_post` handlersAntonio Vazquez
Annotation tool is used as a general mark tool for many add-ons. To be able to detect when an annotation is done is very handy to integrate the annotation tool in add-ons and other studio workflows. The new callback names are: `annotation_pre` and `annotation_post` Both callbacks are exposed via the Python module `bpy.app.handlers` Example use: ``` import bpy def annotation_starts(gpd): print("Annotation starts") def annotation_done(gpd): print("Annotation done") bpy.app.handlers.annotation_pre.clear() bpy.app.handlers.annotation_pre.append(annotation_starts) bpy.app.handlers.annotation_post.clear() bpy.app.handlers.annotation_post.append(annotation_done) ``` Note: The handlers are called for any annotation tool, including eraser. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14221
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-07-16Cleanup: remove redundant parenthesesCampbell Barton
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-02Docs: formalize naming for generic callbacks in BKE_callbacks.hCampbell Barton
Add a doc-string explaining the purpose of each call back and how they should be used. Also add a currently unused callback 'POST_FAIL' that is to be used in cases the action fails - giving script authors, a guarantee that a call to `pre` will always have a matching `post/post_fail` call. - D11422: adds a callback that can use 'post_fail'. - T88696: proposed these conventions.
2021-05-15XR Controller Support Step 1: Internal Abstractions for OpenXR ActionsPeter Kim
Adds internal API for creating and managing OpenXR actions at the GHOST and WM layers. Does not bring about any changes for users since XR action functionality is not yet exposed in the Python API (will be added in a subsequent patch). OpenXR actions are a means to communicate with XR input devices and can be used to retrieve button/pose states or apply haptic feedback. Actions are bound to device inputs via a semantic path binding (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles), which serves as an XR version of keymaps. Main features: - Abstraction of OpenXR action management functions to GHOST-XR, WM-XR APIs. - New "xr_session_start_pre" callback for creating actions at appropriate point in the XR session. - Creation of name-identifiable action sets/actions. - Binding of actions to controller inputs. - Acquisition of controller button states. - Acquisition of controller poses. - Application of controller haptic feedback. - Carefully designed error handling and useful error reporting (e.g. action set/action name included in error message). Reviewed By: Julian Eisel Differential Revision: http://developer.blender.org/D10942
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2020-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-08-20Cleanup: use const variables where possible in the Python APICampbell Barton
2020-08-07Cleanup: Python, 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/python` module. No functional changes.
2020-06-02Fix T77126: Documented frame_change_pre and frame_change_post handlersSybren A. Stüvel
The documentation for the `frame_change_pre` and `frame_change_post` handlers was really sparse, and suggested that `frame_change_pre` is called before the frame changes. This is not the case; it's called after the frame has changed, but before the dependency graph has been updated for it. No functional changes, just updated documentation. Differential Revision: https://developer.blender.org/D7905 Reviewed by: sergey
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2019-12-20Cleanup: remove redundant 'char *' castsCampbell Barton
2019-09-11Python: Fix to support old-style handlersSergey Sharybin
Can not re-use single typle even if there is a single input pointer: the all-arguments-typle consists of 2 elements.
2019-09-11Python handlers: Pass depsgraph to events where it makes senseSergey Sharybin
The goal is to make it possible to access evaluated datablocks at a corresponding context. For example, be able to check evaluated state if an object used for rendering. Allows to write scripts in a safe manner for T63548 and T60094. Reviewers: brecht Differential Revision: https://developer.blender.org/D5726
2019-09-09Move callbacks API from BLI to BKESergey Sharybin
Preparing for the bigger changes which will be related on passing dependency graph to various callbacks which need it. Differential Revision: https://developer.blender.org/D5725
2019-05-22Preferences: add handler for loading factory preferencesCampbell Barton
Allows app-templates to define their own adjustments to preferences. This matches `load_factory_startup_post`, use when loading preferences.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-03-29Cleanup: style, use braces for the Python APICampbell Barton
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-03Cleanup: trailing commasCampbell Barton
Needed for clan-format not to wrap onto one line.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-03Cleanup: preprocessor indentationCampbell Barton
2018-11-30PyAPI: add load_factory_startup_post handlerCampbell Barton
Needed so we can apply changes to the startup file, only in the case when it's load loaded from a user-saved startup.
2018-11-23Python API: bpy.app.handlers.depsgraph_update_pre/postJacques Lucke
Reviewers: brecht Differential Revision: https://developer.blender.org/D3978
2018-09-19Merge branch 'master' into blender2.8Campbell Barton
2018-09-19BLI_utildefines: rename pointer conversion macrosCampbell Barton
Terms get/set don't make much sense when casting values. Name macros so the conversion is obvious, use common prefix for easier completion. - GET_INT_FROM_POINTER -> POINTER_AS_INT - SET_INT_IN_POINTER -> POINTER_FROM_INT - GET_UINT_FROM_POINTER -> POINTER_AS_UINT - SET_UINT_IN_POINTER -> POINTER_FROM_UINT
2018-07-12Merge branch 'master' into blender2.8Campbell Barton
2018-07-12PyAPI: add undo redo handlersCampbell Barton
Useful so Python can clean up before/after undo steps.
2018-04-17Removing Blender Game Engine from Blender 2.8Dalai Felinto
Folders removed entirely: * //extern/recastnavigation * //intern/decklink * //intern/moto * //source/blender/editors/space_logic * //source/blenderplayer * //source/gameengine This includes DNA data and any reference to the BGE code in Blender itself. We are bumping the subversion. Pending tasks: * Tile/clamp code in image editor draw code. * Viewport drawing code (so much of this will go away because of BI removal that we can wait until then to remove this.
2017-08-08Fix T46329: scene_update_{pre,post} doc needs clarificationSybren A. Stüvel
The documentation for the bpy.app.handlers.scene_update_{pre,post} handlers states that they're called "on updating the scenes data". However, they're called even when the data hasn't changed. Of course such handlers are useful, but the documentation should reflect the current behaviour. Reviewers: mont29, sergey Subscribers: Blendify Maniphest Tasks: T46329 Differential Revision: https://developer.blender.org/D1535
2017-05-28Merge branch 'master' into blender2.8Bastien Montagne
2017-05-27Remove MinGW supportAaron Carlisle
The Issue ======= For a long time now MinGW has been unsupported and unmaintained and at this point, it looks like something that we should just leave behind and move on. Why Remove ========== One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based. However, now that this is no longer true we have basically stopped updating the need CMake files. Along with the CMake files, there are several patches to the extern libs needed to make this work. For example, see: https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch If we wanted to keep MinGW then we would need to make more custom patches to the external libs and this is not something our platform maintainers are willing to do. For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3 Fixes T51301 Differential Revision: https://developer.blender.org/D2648
2017-05-06PyAPI: Remove bpy.app.handlers.scene_updateCampbell Barton
This is routinely mis-used to continuously run scripts, causing performance problems. This should be replaced with more specific handlers, or possibly timers. See: T47811
2016-10-20Fix T49797: Exception from scene update handler might leak external engine ↵Sergey Sharybin
descriptors This was causing memory leaks in Cycles. Some more detailed information in the comment in the code. Seems to be safe and nice enough for 2.78a.
2015-01-06PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RETCampbell Barton
Setting all values of a tuple is such a common operation that it deserves its own macro. Also added Py_INCREF_RET to avoid confusing use of comma operator.
2014-12-01Python: add 'render_write' callbackCampbell Barton
This is useful for addons which intend to write data next to the rendered image/movie, but not for preview renders.
2014-10-13Fix T42005: Reset py-handlers could crashCampbell Barton
Wasn't acquiring the GIL.
2014-08-29Add callback for starting a render-jobCampbell Barton
We had complete/cancel, but no matching init for rendering, render_pre/post callbacks aren't always usable.
2014-08-28Fix T41473: Cycles volume rendering is too darkSergey Sharybin
The issue was caused by the changed defaults from the Cycles side. Because of those properties being saved as an IDProp and not being saved to the file, every change to the defaults would ruin someone's day updating the values. Added a bpy.app.handler.version_update which is run after the regular do_versions() are done and could be sued by the scripts to apply versioning code on their settings. Reviewers: campbellbarton Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D761
2014-06-16Use ARRAY_SIZE to replace (sizeof(a) / sizeof(*a))Campbell Barton