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-12-10Cleanup: move public doc-strings into headers for 'python/intern'Campbell Barton
Ref T92709
2021-12-02Cleanup: move public doc-strings into headers for 'python'Campbell Barton
2021-07-23Cleanup: code comments punctuation / spacingCampbell Barton
2021-07-16Cleanup: sort struct declarationsCampbell Barton
2021-02-24PyAPI: Fix memory leak of parameters used for python 'draw_callbacks'Germano Cavalcante
When closing the blender, while the callbacks are removed, the reference count of the object used as `customdata` is not decremented. This commit adds two functions that correctly release the python `draw_callbacks` before releasing all `draw_callbacks`. Differential Revision: https://developer.blender.org/D10478
2020-12-16Cleanup: remove redundant struct declarationsCampbell Barton
2020-10-15Cleanup: remove duplicate context variable (__py_context)Campbell Barton
The context was stored both in __py_context & bpy_context_module. This avoids duplicate functions to update them too.
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-09-17Fix T66256: Context overrides crash when operators change contextCampbell Barton
Using context overrides in Python caused problems for any operator that changed the context and require these changes to be read back. CTX_wm_area_set() for e.g. would set the struct member but future calls to CTX_wm_area() would still return the value defined by Python callers context overrides. This also resolves a mismatch between polling and calling operators from Python, where poll would override the Python context where calling only overrode the context when a new context was passed in.
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-17Cleanup: split BPY_extern_python into it's own headerCampbell Barton
Currently BPY_extern.h includes too much mixed functionality.
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-06Merge branch 'blender-v2.90-release' into masterCampbell Barton
2020-08-06Workaround release builds failingCampbell Barton
Issue caused by e9c4325515aed.
2020-08-06Merge branch 'blender-v2.90-release' into masterCampbell Barton
2020-08-06Python: include Python stack trace in the crash logDaniel Bailey
This helps Python developers troubleshoot errors when Python causes a crash.
2020-07-27UI: improve errors when evaluating a number button failsCampbell Barton
Showing the Python error without any explanation is often not enough information and doesn't hint that the error was in the user input. The error report from a invalid expression such as '..1' used to be: ('invalid syntax', ('<string>', 1, 1, '..1')) Now reads: Error evaluating number, see Info editor for details: invalid syntax Address issue raised by T78913.
2020-07-20T77086 Animation: Passing Dependency Graph to DriversSybren A. Stüvel
Custom driver functions need access to the dependency graph that is triggering the evaluation of the driver. This patch passes the dependency graph pointer through all the animation-related calls. Instead of passing the evaluation time to functions, the code now passes an `AnimationEvalContext` pointer: ``` typedef struct AnimationEvalContext { struct Depsgraph *const depsgraph; const float eval_time; } AnimationEvalContext; ``` These structs are read-only, meaning that the code cannot change the evaluation time. Note that the `depsgraph` pointer itself is const, but it points to a non-const depsgraph. FCurves and Drivers can be evaluated at a different time than the current scene time, for example when evaluating NLA strips. This means that, even though the current time is stored in the dependency graph, we need an explicit evaluation time. There are two functions that allow creation of `AnimationEvalContext` objects: - `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time)`, which creates a new context object from scratch, and - `BKE_animsys_eval_context_construct_at(AnimationEvalContext *anim_eval_context, float eval_time)`, which can be used to create a `AnimationEvalContext` with the same depsgraph, but at a different time. This makes it possible to later add fields without changing any of the code that just want to change the eval time. This also provides a fix for T75553, although it does require a change to the custom driver function. The driver should call `custom_function(depsgraph)`, and the function should use that depsgraph instead of information from `bpy.context`. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D8047
2020-05-08Cleanup: take includes out of 'extern "C"' blocksJacques Lucke
Surrounding includes with an 'extern "C"' block is not necessary anymore. Also that made it harder to add any C++ code to some headers, or include headers that have "optional" C++ code like `MEM_guardedalloc.h`. I tested compilation on linux and windows (and got help from @LazyDodo). If this still breaks compilation due to some linker error, the header containing the symbol in question is probably missing an 'extern "C"' block. Differential Revision: https://developer.blender.org/D7653
2020-03-06Cleanup: Fix forward declaration of headersDalai Felinto
2020-01-16Python: disable environment variables by defaultCampbell Barton
This avoids the problem where Blender doesn't start because the PYTHONPATH points to an incompatible Python version, see T72807. Previously we chose to assume people who set the PYTHONPATH know what they're doing, however users may have set this for non Blender projects. So it's not obvious that this is the cause of Blender not to launch on their system. To use Python's environment vars, pass the argument: --python-use-system-env Note that this only impacts Python run-time environment variables documented in `python --help`, Access from `os.environ` remains.
2019-12-11PyAPI: add utility functions get the size from an evaluated stringCampbell Barton
Allows including null bytes in the resulting string.
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-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-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-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-11-10Merge branch 'master' into blender2.8Campbell Barton
2018-11-10PyAPI: add imports arg to BPY_execute_stringCampbell Barton
Allows for avoiding `__import__` in expressions, was already supported for BPY_execute_string_as_* API calls.
2018-09-03Merge branch 'master' into blender2.8Campbell Barton
2018-09-03PyAPI: add optional imports to expression eval APICampbell Barton
Avoids having to use `__import__` to access modules.
2018-08-31Merge branch 'master' into blender2.8Campbell Barton
2018-08-31C/Python API: Add PyC_RunString_AsIntPtrCampbell Barton
Utility to get an int or pointer from a Python expression.
2018-06-11Drivers: ensure Python expressions are cached with copy-on-write.Brecht Van Lommel
Store the compiled expressions on the original driver. Ref T55442.
2017-03-18PyAPI: add BPY_execute_string_as_stringCampbell Barton
Utility to execute a string and get the resulting string, matching BPY_execute_string_as_number. Not used just yet but generally useful function.
2017-03-18Cleanup: use return args last and 'r_' prefix.Campbell Barton
2016-07-30Py-Driver: add 'self' optionCampbell Barton
Drivers can use this to refer to the data which the driver is applied to, useful for objects, bones, to avoid having to create a variable pointing to its self.
2016-04-01Generic check for string being a Py keywordCampbell Barton
Driver code used incomplete list of Py keywords
2015-12-31Cleanup: Py API namingCampbell Barton
Use BPY_execute_* prefix for all Python execution commands
2015-06-11Add argument --python-expr to pass Python directlyCampbell Barton
This works like Python's -c argument, handy to be able to avoid writing small scripts to disk.
2014-01-04UI: Use bool rather then int/short's where possibleCampbell Barton
2013-12-17Partial fix for T37604: Deadlock when stopping rendered viewport (Blender ↵IRIE Shinsuke
Internal) - Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS macros cannot be used here, because the Py_BEGIN_ALLOW_THREADS causes a crash when quitting Blender. - The low level function PyEval_ReleaseLock() is used assuming the Python library was built with multi-threads support.
2013-07-02remove nan copyrights from code added since blender become opensource (copy ↵Campbell Barton
paste errors), also remove BKE_script.h
2013-06-10code cleanup: group python reset functions in BPY_python_reset()Campbell Barton
2013-01-20Python i18n API. Many thanks to Campbell and Brecht for the reviews and ↵Bastien Montagne
suggestions! This commit adds: * A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.). * The ability for addons to feature translations, using the (un)register functions of above module. * Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...). Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled). Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it. Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
2013-01-07code cleanup: warnings and use stdbool for bpy* funcs.Campbell Barton
2012-10-26fix [#31661] Custom properties do no respect min/max valuesCampbell Barton
also renamed function added prev commit
2012-10-26fix for crash when a python operator or render engine was freed in the C ↵Campbell Barton
code and then referenced from python. now further access in python gives an exception at the line when the freed data is accessed.
2012-05-09Python/context: python could get invalid bpy.data in scene update handler afterBrecht Van Lommel
undo. The way this got updated from the context is a bit unreliable, and for handlers the update couldn't happen because there is no context passed in. Now it's updated from setup_app_data, which is where the change actually happens. I left in the other updates to be sure but they should not be needed anymore.