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-06-02Cleanup: remove "<pep8 compliant>" from headersCampbell Barton
It can be assumed that all scripts comply with basic pep8 formatting regarding white-space, indentation etc. Also remove note in best practices page & update `tests/python/pep8.py`. If we want to exclude some scripts from make format, this can be done by adding them to `ignore_files` in: source/tools/utils_maintenance/autopep8_format_paths.py Or using `# nopep8` for to ignore for individual lines. Ref T98554
2022-04-07Cleanup: remove incorrect commentSybren A. Stüvel
No functional changes.
2022-04-05Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14443
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-17cleanup: fix typos in comments and docsluzpaz
Followup to https://developer.blender.org/D10288 Reviewed By: Blendify Differential Revision: https://developer.blender.org/D10346
2021-11-09Expose BLI_string_flip_side_name as bpy.utils.flip_nameDemeter Dzadik
Expose a new function in `bpy.utils.flip_name(name, strip_number=False) that allows flipping bone names, eg "Bone.L" -> "Bone.R". Useful for add-ons to avoid re-implementing Blender's name flipping. Ref D12322
2021-10-23Docs: Fixes and improvements in API documentationXavier Cho
Fixes several notable mistakes and missing information regarding the API documentation (*.rst). This will allow API stub generators like bpystubgen or fake-bpy-module to produce more accurate result. Differential Revision: https://developer.blender.org/D12639
2021-09-21Keymap: preference for fallback-tool with RMB selectCampbell Barton
Expose a key-map preference "Fallback Tool (RMB)", disabled by default. The right mouse button uses the fallback tool (currently visible selection tool in the toolbar), instead of always tweaking. When any selection tool is active, right mouse always tweaks. To enable fallback selection on RMB, set the "Right Mouse Select Action" to "Selection Tool". Internal changes: - Add fall-back key-maps, separate key-maps needed for when the tool is run as a fall-back. This is needed so RMB-select can support fall-back tools, so left-mouse can be used when it's the active tool and RMB can be used as a fall-back action when another tool is active. - Add options field to tools so tools without gizmos can enable the full-back tool keymap. - Support multiple key-maps for keymap handlers. - Fall-back keymaps now co-exist with the tool-keymaps. So both keymaps may be active at once - using different mouse buttons. When gizmos are in use, a highlighted gizmo prioritizes the tool-keymap over the fall-back keymap. Resolves T83690. Reviewed By: JulienKaspar Ref D12493
2021-08-26ToolSystem: support per-tool gizmo group propertiesCampbell Barton
Also add gizmo group example to the tool-template.
2021-08-09Cleanup: remove redundant importsCampbell Barton
The module was importing it's own functions.
2021-07-06Cleanup: pep8Campbell Barton
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-06-04Update Camera presetsFynn Grotehans
The (tracking) camera presets have not been updated in the last 7 or more years, so they are very outdated. I found it pointless to have a few specific camera models in the list and instead add the most commonly used sensor sizes/film sizes. This way the list is shorter, easier to maintain/becomes later outdated, and is more user friendly for most people who don't own any of the specific cameras. I added the Crop Factor to the Beginning of the name, so it gets sortet in the correct order and presets are easier to find based on the size. Reviewed By: #render_cycles, #motion_tracking, brecht, sergey Differential Revision: https://developer.blender.org/D10739
2021-05-13PyAPI Docs: Cleanup FormattingAaron Carlisle
2021-02-19PyAPI: bpy.utils.execfile temporarily overrides the __main__ moduleCampbell Barton
This is needed to support Python 3.10's `typing.get_type_hints`, to access the name-space used when creating the class. Also added a docstring for execfile.
2021-02-16Fix reloading preferences ignoring 'script_directory'Campbell Barton
Reloading preferences didn't update Python's `sys.path` to account for the modified `script_directory`. This meant the operator to load settings from a previous version required a restart to initialize Python when this directory was set.
2021-02-04Fix T79822: Custom preset casing not preservedAnkur Deria
When adding a new preset the name would be converted to lower case and then displayed in the interface in title case. This was confusing because the name didn't reflect what was typed, and there are many cases when the name shouldn't be forced into title case (like 8K UHDTV for example). This commit leaves the custom preset names in the original casing, and removes the conversion of filenames to title case for preset lists. Differential Revision: https://developer.blender.org/D10224
2021-02-04Presets: Cleanup preset namingNathan Craddock
Before committing D10224, bundled preset names that are lowercase need updating to title case for display in the UI. This changes several of the preset file names to title case, and fixes a couple of other naming issues in the preset names. A few strings in the code are also changed to reflect the new filename of the Blender keymap.
2020-12-10PyAPI: add bpy.utils.unescape_identifierCampbell Barton
Utility to perform the reverse of `bpy.utils.escape_identifier`
2020-10-08Cleanup: use '_' prefix for internal bpy.ops variablesCampbell Barton
Even though these weren't included in __dir__, they are still accessible from `vars(bpy.ops)`, use '_' to hint they are private.
2020-10-08PyAPI: use real modules for bpy.opsCampbell Barton
Python 3.7x added support for module `__getattr__` & `__dir__`. Make use of this for operator access, previously these were module like classes. No functional changes, this is mostly to use a type which is expected, rather than faking the type with a class instance.
2020-10-02Cleanup: pep8, blank linesCampbell Barton
2020-09-17Fix T63651: ImagePreviewCollection.new,load don't work as documentedCampbell Barton
Update doc-strings, add note for why this decision was made.
2020-09-14Fix T80694: Crash reloading scripts from the Python consoleCampbell Barton
Running `bpy.ops.script.reload()` from Python was crashing since the operator being called was it's self freed. Change the reload operator to defer execution - as supporting re-registration during execution is quite involved for a corner-case.
2020-09-01PyAPI: expose 'bl_options' for operators in bpy.opsCampbell Barton
Useful for checking which operators are only for internal use.
2020-07-17Cleanup: remove f-string use in favor of percentage for formattingCampbell Barton
2020-06-26Cleanup: use percentage formattingCampbell Barton
`str.format` and `f-string` use was minimal. Prefer using a single style of string formatting unless an alternative is more widely adopted.
2020-04-21Fix: Incorrect f-string in previews.pyJacques Lucke
Contributed by @deadpin Differential Revision: https://developer.blender.org/D7458
2020-03-27Fix T66655: Add-on tool keymap not working after restartCampbell Barton
- Use addon keyconfig for registered tools so reloading the keymap doesn't clear them. - Ensure there is a default keymap, needed for addon keymaps to be available in the user keyconfig.
2020-01-28Error in last comment (redundant assignment)Campbell Barton
2020-01-28Fix T69213: App-Template doesn't run scripts in BLENDER_USER_SCRIPTSCampbell Barton
2020-01-27Fix T73409: error deleting preset saved on different drive than Blender installBrecht Van Lommel
2019-11-01Fix python error when trying to delete presetsSebastian Parborg
In some cases the default data paths for blender does not exist. For example on windows when using the portable install. This would lead to errors when trying to lookup default paths in is_path_builtin. Now we handle cases like this gracefully.
2019-10-31Cleanup: comments for is_path_builtinCampbell Barton
Also reduce scope of import.
2019-10-30Fix T59065: Blender default keyset is deletable by user!Sebastian Parborg
Previously, you could delete presets that were part of the blender default install. Now we check if the preset file resides in the bundled file paths. If so, prevent deletion of the preset. Reviewed By: Campbell Differential Revision: http://developer.blender.org/D4522
2019-10-28PyAPI: change behavior of bpy.path.module_namesCampbell Barton
Instead of checking for names that contain ".", only skip files that start with a "." (since they're used for ".git" & ".arcconfig"). While other path names may fail to import, it's not the purpose of this function to validate the path, have the caller must raise an error instead of silently skipping them. See D6140.
2019-08-15Fix T68014: Add-on's override Python built-in modulesCampbell Barton
Append addon paths to the sys.path to avoid name collisions with system modules.
2019-08-11Cleanup: spellingCampbell Barton
2019-07-23Fix T63775: Toolbar icons ignore BLENDER_SYSTEM_DATAFILESCampbell Barton
The environment variable to locate system data-files was ignored by toolbar icons. Add bpy.utils.system_resource to match Blender's internal data-file access.
2019-06-19Fix T65398 - Fix frame rate base use in Python SMPTE functionsRichard Antalik
Differential Revision: https://developer.blender.org/D5064 Reviewed By: brecht
2019-06-13Cleanup: tweak logic for skipping modulesCampbell Barton
Startup is the special case, so match against this instead of 'modules'.
2019-06-04Fix (unreported) missing updates in scripts/docs after `scene.update()` removal.Bastien Montagne
This should really have been done together with API changes, simple usage of grep does the trick to catch most places needing updates.
2019-05-09Fix bpy.utils.script_paths ignoring user_pref argCampbell Barton
2019-05-09Cleanup: unused args/vars/imports in modulesCampbell Barton
2019-03-17Cleanup: unused variablesCampbell Barton
2019-03-15Tool System: add tool registration APICampbell Barton
This mimics RNA style class registration, keeping the same internal data types. Currently there is a template which shows an example of adding a tool group with a keymap. Icon generation still needs to be exposed for general use.
2019-02-14Fix T61497: Old keymap causes error on startupCampbell Barton
When a keymap has an error loading, don't make it active since it will be partially loaded and not usable.
2019-01-25Fix UI extension removalCampbell Barton
App-templates & keymap names had their extensions removed twice. Confusing for filenames containing dots.
2019-01-05UI: Preferences Redesign Part 2Severin
(Part 1 was 00963afc14978b) Does the following changes visible to users: * Use panels and sub-panels for more structured & logical grouping * Re-organized options more logically than before (see images in D4148) * Use flow layout (single column by default). * New layout uses horizontal margin if there's enough space. * Change size of Preferences window to suit new layout. * Move keymap related options from "Input" into own section. * Own, left-bottom aligned region for Save Preferences button. * Adjustments of names, tooltips & icons. * Move buttons from header into the main region (except editor switch). * Hide Preferences header when opened in temporary window. * Use full area width for header. * Don't use slider but regular number widget for UI scale. * Gray out animation player path option if player isn't "Custom" Internal changes: * Rearrange RNA properties to match changed UI structure. * Introduces new "EXECUTE" region type, see reasoning in D3982. * Changes to panel layout and AZone code for dynamic panel region. * Bumps subversion and does versioning for new regions. RNA changes are documented in the release notes: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Preferences_API Design & implementation mostly done by @billreynish and myself. I recommend checking out the screenshots posted by William: https://developer.blender.org/D4148#93787 Reviewed By: brecht Maniphest Tasks: T54115 Differential Revision: https://developer.blender.org/D4148
2018-12-21RNA: naming, user-preferences -> preferencesCampbell Barton