Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
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.
|
|
Allows including null bytes in the resulting string.
|
|
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
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
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.
|
|
Done using:
source/tools/utils_maintenance/c_sort_blocks.py
|
|
|
|
Allows for avoiding `__import__` in expressions,
was already supported for BPY_execute_string_as_* API calls.
|
|
|
|
Avoids having to use `__import__` to access modules.
|
|
|
|
Utility to get an int or pointer from a Python expression.
|
|
Store the compiled expressions on the original driver.
Ref T55442.
|
|
Utility to execute a string and get the resulting string,
matching BPY_execute_string_as_number.
Not used just yet but generally useful function.
|
|
|
|
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.
|
|
Driver code used incomplete list of Py keywords
|
|
Use BPY_execute_* prefix for all Python execution commands
|
|
This works like Python's -c argument, handy to be able to avoid writing small scripts to disk.
|
|
|
|
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.
|
|
paste errors), also remove BKE_script.h
|
|
|
|
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.
|
|
|
|
also renamed function added prev commit
|
|
code and then referenced from python.
now further access in python gives an exception at the line when the freed data is accessed.
|
|
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.
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|
|
- no need to link to scenes when using a frame from the pydriver, this made linking rigs for eg, quite messy.
- advantage that we get subframe values (where scenes from was fixed to a whole number).
|
|
are loaded.
this works by tagging functions, eg:
def my_func(scene):
pass
bpy.app.handlers.permanent_tag(my_func, True) # <-- important bit
bpy.app.handlers.frame_change_pre.append(my_func)
|
|
minor edits to defvert_verify_index() - no functional change.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
in BLI_ functions.
|
|
Python:
* adds bpy.app.handlers which contains lists, each for an event type:
render_pre, render_post, load_pre, load_post, save_pre, save_post
* each list item needs to be a callable object which takes 1 argument (the ID).
* callbacks are cleared on file load.
Example:
def MyFunc(scene): print("Callback:", data)
bpy.app.handlers.render_post.append(MyFunc)
C:
* This patch adds a generic C callback api which is currently only used by python.
* Unlike python callbacks these are not cleared on file load.
|
|
|
|
with python fails, in rare cases its possible a valid python expression could get units applied to it.
|
|
freed ID's.
This uses pythons GC so its no overhead during runtime but makes removing ID's slower.
Commented definition 'USE_PYRNA_INVALIDATE_GC' for now, so no functional change.
|
|
- errors would jump to the line which gets in the way.
- the window wouldn't always redraw.
|
|
|
|
also set minimum cmake version to 2.8
|
|
- remove unused code.
- BPY_run_python_script() split in 2, BPY_filepath_exec, BPY_text_exec
- renamed funcs.
|
|
BPy_GetContext() again.
|
|
- remove some redundant declarations
- changed VertexTangent and Path structs to avoid compiler alignment padding.
|
|
drivers allow scripts to add functions directly.
- bpy.app.driver_namespace, read-only dictionary, edit in-place.
- reset on file load and new file.
- on errors the namespace used to be reset, this should not be needed.
simple example.
def driverFunc(val):
return val * val
bpy.app.driver_namespace['driverFunc'] = driverFunc
... now all drivers can access this function.
|
|
flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.
Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
|
|
blender and drop into a python console, (useful for debugging some problems on a renderfarm over ssh)
- Also made it so sys.stdin isnt overwritten anymore, instead the interactive consoel overwrites while it executes and restores after.
- removed hope folder from sphinx patch path
|