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-11-07Cleanup: unify struct declaration style for Python types, update namesCampbell Barton
Use struct identifiers in comments before the value. This has some advantages: - The struct identifiers didn't mix well with other code-comments, where other comments were wrapped onto the next line. - Minor changes could re-align all other comments in the struct. - PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line. Remove overly verbose comments copied from PyTypeObject (Python v2.x), these aren't especially helpful and get outdated. Also corrected some outdated names: - PyTypeObject.tp_print -> tp_vectorcall_offset - PyTypeObject.tp_reserved -> tp_as_async
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell Barton
2022-04-08Cleanup: separate format-units for Python argument parsingCampbell Barton
With the increased use of multi-character format units and keyword-only arguments these are increasingly difficult to make sense of. Split the string onto multiple lines, one per argument. While verbose it's easier to understand and add new arguments.
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-11-30LibLink/Append: Port `bpy.data.libraries.load` to new ↵Bastien Montagne
`BKE_blendfile_link_append` module. Note that this fully replaces the 'PyCapsule' storage of linked/appended items in the python API code by the generic storage of items in the `BlendfileLinkAppendContext` data. Maniphest Tasks: T91414 Differential Revision: https://developer.blender.org/D13331
2021-11-11Fix (unreported) bad handling of reports in `libraries.load` code.Bastien Montagne
rB60fee69682ac39 only partially fixed the issue, `BlendFileReadReport bf_reports` was now properly stored in `BPy_Library` `self` for the lifetime of the context, but its `reports` member was still referencing local variable to `bpy_lib_enter` function.
2021-07-15Library loading: Fix access of out-of-scope memory in py context managerSybren A. Stüvel
The `__enter__` function of the `bpy.data.libraries.load` context manager was storing a pointer to a stack-allocated variable, which was subsequently used in the `__exit__` function, causing a crash. This is now fixed. Thanks @Severin for the patch.
2021-06-24Fix linking code after own recent commit.Bastien Montagne
More stupid mistake in recent enhanced reports for file load code, rB82c17082ba0e left some read-after-free situations.
2021-06-24Cleanup: update clang-format so PyObject_HEAD indents properlyCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-23Revert "Revert "Enhanced stats/reports for blendfile reading.""Bastien Montagne
This reverts commit rB3a48147b8ab92, and fixes the issues with linking etc. Change compared to previous buggy commit (rBf8d219dfd4c31) is that new `BlendFileReadReports` reports are now passed to the lowest level function generating the `FileData` (`filedata_new()`), which ensures (and asserts) that all code using it does have a valid non-NULL pointer to a `BlendFileReadReport` data. Sorry for the noise, it's always when you think a change is trivial and do not test it well enough that you end up doing those kind of mistakes...
2021-06-08PyAPI: use keyword only argumentsCampbell Barton
Use keyword only arguments for the following functions. - addon_utils.module_bl_info 2nd arg `info_basis`. - addon_utils.modules 1st `module_cache`, 2nd arg `refresh`. - addon_utils.modules_refresh 1st arg `module_cache`. - bl_app_template_utils.activate 1nd arg `template_id`. - bl_app_template_utils.import_from_id 2nd arg `ignore_not_found`. - bl_app_template_utils.import_from_path 2nd arg `ignore_not_found`. - bl_keymap_utils.keymap_from_toolbar.generate 2nd & 3rd args `use_fallback_keys` & `use_reset`. - bl_keymap_utils.platform_helpers.keyconfig_data_oskey_from_ctrl 2nd arg `filter_fn`. - bl_ui_utils.bug_report_url.url_prefill_from_blender 1st arg `addon_info`. - bmesh.types.BMFace.copy 1st & 2nd args `verts`, `edges`. - bmesh.types.BMesh.calc_volume 1st arg `signed`. - bmesh.types.BMesh.from_mesh 2nd..4th args `face_normals`, `use_shape_key`, `shape_key_index`. - bmesh.types.BMesh.from_object 3rd & 4th args `cage`, `face_normals`. - bmesh.types.BMesh.transform 2nd arg `filter`. - bmesh.types.BMesh.update_edit_mesh 2nd & 3rd args `loop_triangles`, `destructive`. - bmesh.types.{BMVertSeq,BMEdgeSeq,BMFaceSeq}.sort 1st & 2nd arg `key`, `reverse`. - bmesh.utils.face_split 4th..6th args `coords`, `use_exist`, `example`. - bpy.data.libraries.load 2nd..4th args `link`, `relative`, `assets_only`. - bpy.data.user_map 1st..3rd args `subset`, `key_types, `value_types`. - bpy.msgbus.subscribe_rna 5th arg `options`. - bpy.path.abspath 2nd & 3rd args `start` & `library`. - bpy.path.clean_name 2nd arg `replace`. - bpy.path.ensure_ext 3rd arg `case_sensitive`. - bpy.path.module_names 2nd arg `recursive`. - bpy.path.relpath 2nd arg `start`. - bpy.types.EditBone.transform 2nd & 3rd arg `scale`, `roll`. - bpy.types.Operator.as_keywords 1st arg `ignore`. - bpy.types.Struct.{keyframe_insert,keyframe_delete} 2nd..5th args `index`, `frame`, `group`, `options`. - bpy.types.WindowManager.popup_menu 2nd & 3rd arg `title`, `icon`. - bpy.types.WindowManager.popup_menu_pie 3rd & 4th arg `title`, `icon`. - bpy.utils.app_template_paths 1st arg `subdir`. - bpy.utils.app_template_paths 1st arg `subdir`. - bpy.utils.blend_paths 1st..3rd args `absolute`, `packed`, `local`. - bpy.utils.execfile 2nd arg `mod`. - bpy.utils.keyconfig_set 2nd arg `report`. - bpy.utils.load_scripts 1st & 2nd `reload_scripts` & `refresh_scripts`. - bpy.utils.preset_find 3rd & 4th args `display_name`, `ext`. - bpy.utils.resource_path 2nd & 3rd arg `major`, `minor`. - bpy.utils.script_paths 1st..4th args `subdir`, `user_pref`, `check_all`, `use_user`. - bpy.utils.smpte_from_frame 2nd & 3rd args `fps`, `fps_base`. - bpy.utils.smpte_from_seconds 2nd & 3rd args `fps`, `fps_base`. - bpy.utils.system_resource 2nd arg `subdir`. - bpy.utils.time_from_frame 2nd & 3rd args `fps`, `fps_base`. - bpy.utils.time_to_frame 2nd & 3rd args `fps`, `fps_base`. - bpy.utils.units.to_string 4th..6th `precision`, `split_unit`, `compatible_unit`. - bpy.utils.units.to_value 4th arg `str_ref_unit`. - bpy.utils.user_resource 2nd & 3rd args `subdir`, `create` - bpy_extras.view3d_utils.location_3d_to_region_2d 4th arg `default`. - bpy_extras.view3d_utils.region_2d_to_origin_3d 4th arg `clamp`. - gpu.offscreen.unbind 1st arg `restore`. - gpu_extras.batch.batch_for_shader 4th arg `indices`. - gpu_extras.batch.presets.draw_circle_2d 4th arg `segments`. - gpu_extras.presets.draw_circle_2d 4th arg `segments`. - imbuf.types.ImBuf.resize 2nd arg `resize`. - imbuf.write 2nd arg `filepath`. - mathutils.kdtree.KDTree.find 2nd arg `filter`. - nodeitems_utils.NodeCategory 3rd & 4th arg `descriptions`, `items`. - nodeitems_utils.NodeItem 2nd..4th args `label`, `settings`, `poll`. - nodeitems_utils.NodeItemCustom 1st & 2nd arg `poll`, `draw`. - rna_prop_ui.draw 5th arg `use_edit`. - rna_prop_ui.rna_idprop_ui_get 2nd arg `create`. - rna_prop_ui.rna_idprop_ui_prop_clear 3rd arg `remove`. - rna_prop_ui.rna_idprop_ui_prop_get 3rd arg `create`. - rna_xml.xml2rna 2nd arg `root_rna`. - rna_xml.xml_file_write 4th arg `skip_typemap`.
2021-03-12Cleanup: remove workaround for MSVC PyTypeObject declarationsCampbell Barton
This is no longer needed for MSVC-2017.
2021-03-08PyAPI: add bpy.types.BlendFile.temp_data for temporary library loadingCampbell Barton
This adds support for creating a `BlendFile` (internally called `Main`), which is limited to a context. Temporary data can now be created which can then use `.libraries.load()` the same as with `bpy.data`. To prevent errors caused by mixing the temporary ID's with data in `bpy.data` they are tagged as temporary so they can't be assigned to properties, however they can be passed as arguments to functions. Reviewed By: mont29, sybren Ref D10612
2021-03-08readfile: add id_tag_extra argumentCampbell Barton
This allows adding ID tags when linking/loading data. This is needed to implement loading non 'G.main' ID data-blocks, see D10612.
2021-03-04Cleanup: Main `foreach ID` code: Remove `MAX_LIBARRAY` and improve comments.Bastien Montagne
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value now defined in `DNA_ID.h`, and it is no more useful. And comments were somewhat outdated. Also added an explanation about chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04PyAPI: use methods for bpy.data.libraries.load & writeCampbell Barton
Replace static methods with regular methods. Now the 'Main' value is taken from the collection. Needed to support multiple 'Main' instances in Python, see T86183.
2021-02-13Fix T85573: Building with Python 3.10a5 failsCampbell Barton
Replace deprecated _PyUnicode_AsString{AndSize} usage. T83626 still needs to be resolved before 3.10 is usable.
2021-02-12PyAPI: remove Python 3.7x compatibility codeCampbell Barton
This removes Python version checks needed to build with 3.8+ and 3.7x. Ref D10381
2021-02-04PyAPI: correct docstringCampbell Barton
2021-02-03BPY: allow `bpy.data.libraries.load()` to filter out non-asset data-blocks.Bastien Montagne
Differential Revision: https://developer.blender.org/D10237
2020-12-08Cleanup: Correct an own earlier commit to use an existing utility functionJulian Eisel
Didn't know this function existed, better to use it then to avoid verbosity.
2020-12-08Cleanup: Use guarded allocator for data-block names returned from file readingJulian Eisel
Direcly using the C library allocator functions is usually avoided in favor of our guarded allocator. It's more useful when debugging.
2020-11-11Cleanup: clang-formatCampbell Barton
2020-11-11Cleanup: use preprocessor version check for PyTypeObject declarationCampbell Barton
While `tp_print` was deprecated, Python 3.8+ uses this for 'tp_vectorcall_offset' which wasn't stated in the comment from efd71aad4f22ec0073d80b8dd296015d3f395aa8. Instead of suppressing clang-tidy, use preprocessor a check since this properly represents the difference between Python versions.
2020-10-15Cleanup: rename BPy_GetContext -> BPY_context_getCampbell Barton
Matching BPY_context_set.
2020-09-08Refactor: move library linking arguments into a parameter structCampbell Barton
Move arguments to BLO_library_link_{begin/named_part/end} into a single parameter struct, to ensure arguments always match. This allows is to skip tagging ID's LIB_TAG_DOIT when it's not needed, previously it was always cleared just in case it was needed. This also makes it possible to remove BLO_library_link_named_part_ex which was only used when tagging was needed.
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-05-29PyAPI: use bpy_rna_types_capi.c to set type methodsCampbell Barton
Remove use of '_bpy' as an intermediate module to store functions which were then assigned in bpy_types.py.
2020-03-19Cleanup/refactor: remove BKE_idcode, in favour of BKE_idtype.Bastien Montagne
Mpving utils from idcode to idtype proved to be somewhat painful for some reasons, but now all looks good. Had to add a fake/empty shell for the special snowflake too, `ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-02-10Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.Bastien Montagne
Note that `BKE_library.h`/`library.c` were renamed to `BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here. Part of T72604.
2019-10-16Cleanup: warnings building with Python 3.8Campbell Barton
2019-06-21Cleanup: spelling, grammar, and other correctionsCampbell Barton
D5084 by @nBurn with edits
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-04-16Cleanup: avoid adjacent C-style commentsCampbell Barton
Causes clang-format to give different results on a second run.
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-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-19Cleanup: add trailing commasCampbell Barton
Prevents clang-format merging into a single line.
2018-12-18Fix paste/append w/ local-viewCampbell Barton
Paste in local-view wasn't setting local-view bits.
2018-11-07Cleanup: remove some useless BKE_library and BKE_main includes.Bastien Montagne
Makes it simpler to make some changes... Also fix order of some includes (use alphabetical please).
2018-06-05Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/blenkernel/intern/blendfile.c source/blender/blenloader/intern/readfile.h source/blender/blenloader/intern/versioning_250.c source/blender/blenloader/intern/versioning_260.c source/blender/blenloader/intern/versioning_270.c source/blender/blenloader/intern/versioning_legacy.c source/blender/editors/render/render_shading.c source/blender/makesrna/intern/rna_movieclip.c source/blender/render/intern/source/pipeline.c source/blender/render/intern/source/voxeldata.c
2018-06-05Cleanup: use new accessors to blendfile path (Main.name).Bastien Montagne
2018-05-18Collections and groups unificationBrecht Van Lommel
OVERVIEW * In 2.7 terminology, all layers and groups are now collection datablocks. * These collections are nestable, linkable, instanceable, overrideable, .. which opens up new ways to set up scenes and link + override data. * Viewport/render visibility and selectability are now a part of the collection and shared across all view layers and linkable. * View layers define which subset of the scene collection hierarchy is excluded for each. For many workflows one view layer can be used, these are more of an advanced feature now. OUTLINER * The outliner now has a "View Layer" display mode instead of "Collections", which can display the collections and/or objects in the view layer. * In this display mode, collections can be excluded with the right click menu. These will then be greyed out and their objects will be excluded. * To view collections not linked to any scene, the "Blender File" display mode can be used, with the new filtering option to just see Colleciton datablocks. * The outliner right click menus for collections and objects were reorganized. * Drag and drop still needs to be improved. Like before, dragging the icon or text gives different results, we'll unify this later. LINKING AND OVERRIDES * Collections can now be linked into the scene without creating an instance, with the link/append operator or from the collections view in the outliner. * Collections can get static overrides with the right click menu in the outliner, but this is rather unreliable and not clearly communicated at the moment. * We still need to improve the make override operator to turn collection instances into collections with overrides directly in the scene. PERFORMANCE * We tried to make performance not worse than before and improve it in some cases. The main thing that's still a bit slower is multiple scenes, we have to change the layer syncing to only updated affected scenes. * Collections keep a list of their parent collections for faster incremental updates in syncing and caching. * View layer bases are now in a object -> base hash to avoid quadratic time lookups internally and in API functions like visible_get(). VERSIONING * Compatibility with 2.7 files should be improved due to the new visibility controls. Of course users may not want to set up their scenes differently now to avoid having separate layers and groups. * Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero files. There's a few things which are know to be not quite compatible, like nested layer collections inside groups. * The versioning code for 2.8 files is quite complicated, and isolated behind #ifdef so it can be removed at the end of the release cycle. KNOWN ISSUES * The G-key group operators in the 3D viewport were left mostly as is, they need to be modified still to fit better. * Same for the groups panel in the object properties. This needs to be updated still, or perhaps replaced by something better. * Collections must all have a unique name. Less restrictive namespacing is to be done later, we'll have to see how important this is as all objects within the collections must also have a unique name anyway. * Full scene copy and delete scene are exactly doing the right thing yet. Differential Revision: https://developer.blender.org/D3383 https://code.blender.org/2018/05/collections-and-groups/
2017-11-29Merge branch 'master' into blender2.8Campbell Barton
2017-11-29Cleanup: rename bpy_util -> bpy_capi_utilsCampbell Barton
This is for internal CAPI use only, avoid confusion w/ bpy.utils module.