Age | Commit message (Collapse) | Author |
|
The real RNA path_resolve method supports indexing lists,
but the python version on the Context object does not. This
patch adds the missing feature for completeness.
Differential Revision: https://developer.blender.org/D15413
|
|
Was a bit oif a struggle since those functions take a first string which
is not our label, but should work fine now.
Reported/detected as part of D15418.
|
|
Without this check, corrupt files would raise a Python exception,
now early exit with a useful error.
|
|
Signature of this function changed at some point, regex to extract
messages from it was no longer working.
Reported/detected as part of D15418.
|
|
|
|
|
|
- Stop once `ENDB` is reached, as files could include additional data.
- Prevent the possibility of an infinite loop from malformed BHEAD
blocks that could seek backwards in the file.
|
|
Found via codespell -q 3 -S ./intern,./extern -L ans,ba,bording,datas,eiter,fiter,hist,inout,lod,ot,parm,parms,pixelx,pres,te
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D15155
|
|
Patch changes label from '한국 언어' to '한국어'
Reviewed By: persun, PratikPB2123, mont29
Maniphest Tasks: T98527
Differential Revision: https://developer.blender.org/D15120
|
|
- Use a context manager to handle file handlers (closing both in the
case of compressed files).
- Seek past BHead data instead of continually reading
(checking for 'REND').
- Write errors to the stderr (so callers can differentiate it from the
stdout).
- Use `surrogateescape` in the unlikely event of encoding errors
so the result is always a string (possible with files pre 2.4x).
- Remove '.blend' extension check as it excludes `.blend1` files
(we can assume the caller is passing in blend files).
- Define `__all__` to make it clear only one function is intended
to be used.
|
|
These changes make the curves sculpt mode keymap consistent
with other modes. They now show up in the keymap, for potential
editing of tool shortcuts, etc. I don't fully understand this system,
but at least these changes should make it consistent.
Differential Revision: https://developer.blender.org/D15112
|
|
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
|
|
Avoid in-lining large enums such as icons and event types, linking
to them instead.
This mitigates T76453, where long enums took a lot of space in the docs,
this was a problem with `UILayout` where each icon argument would list
all icons. [0] worked around the issue using CSS to scroll the list.
However this has the draw-back where some items are clipped in a way
that's not obvious, see: T87008.
The reason this isn't a complete solution is that Python defined enums
aren't written into their own pages which can be linked to, although
currently there are no large Python enums included in the API docs.
All in-lined enums are now under 20 items.
[0]: 1e8f2665916c049748a3985a2fce736701925095
|
|
Suppress printing unnecessary output when generating docs.
|
|
|
|
float_as_string(1000000) resulted in 1e+06.0 which isn't valid notation.
|
|
Failure to include this file caused script_load_modules test to fail.
|
|
The name 'console' for a module was too generic, move into a sub-package
of bl_console_utils, so other console utilities can be added
without creating new top-level modules.
|
|
|
|
|
|
Support RNA types using the Py/C-API PyGetSetDef defined properties.
Currently `WindowManager.clipboard` is the only instance of this.
|
|
|
|
Code would add a bit too often the identifier of an RNA class to
translated messages, this is only needed if there is no valid label
available for it.
|
|
An alternate to D14839, implemented in Python and
relying on bpy.data.user_map(). That function
gives us a mapping of what ID is referenced by
what set of IDs. The inverse of this would also
be useful, which is now available from
bpy_extras.id_map_utils.get_id_reference_map().
From there, we can use get_all_referenced_ids()
to get a set of all IDs referenced by a given ID
either directly or indirectly.
To get only the direct references, we can simply
pass the ID of interest as a key to the dictionary
returned from get_id_reference_map().
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D14843
|
|
Contrary to `CompositorNodeCustomGroup` or `ShaderNodeCustomGroup`,
`GeometryNodeCustomGroups` have to define their own poll function.
This is because their is no predefined poll function for `GeometryNode`,
and it may not be clear for addon developers why `GeometryNode` would
be special here.
This adds `GeometryNode` to `bpy_types.py` and defines such a function
for it like for other builtin node types.
Differential Revision: https://developer.blender.org/D14775
|
|
|
|
|
|
|
|
Added some regex magic in i18n py module to also extract UI names from
all of our units definitions.
Those enum values are fully dynamically generated, so they cannot be
extracted from RNA introspection.
|
|
Currently the "exclude" option for autopep8 isn't as reliable as it
should be since passing in absolute paths to autopep8 causes
the paths not to match. See: D14686 for details.
So explicitly disable autopep8 in this generated file (the generator
has already been updated).
Also use spaces for indentation otherwise autopep8 re-indents them.
This seems like a bug in autopep8 since it's changing lines with
autopep8 disabled. Use a workaround instead of looking into a fix since
it's simpler for all our Python files to use spaces instead of tabs and
there isn't much benefit mixing indentation for scripts.
|
|
|
|
|
|
Disable autopep8 for some regex blocks that use indentation
to signify regex grouping.
|
|
|
|
The following methods weren't included in API docs.
- BlendDataLibraries.load
- BlendDataLibraries.write
- Text.region_as_string
- Text.region_from_string
|
|
This doesn't cause any functional change as the RNA property
of Bone wasn't overridden by the _GenericBone's property,
however the `children` property was documented twice, causing a warning.
|
|
|
|
For some reasons(c) some base classes (like `bpy.types.Modifier`) are
not listed anymore by a call to
`bpy.types.ID.__base__.__subclasses__()`, unless they are first accessed
explicitely (e.g. by executing `bpy.types.Modifier` etc.).
|
|
No functional changes.
|
|
|
|
|
|
This avoids script authors using `eval("context.%s" % data_path)`
to access paths starting from the context,
which isn't good practice especially if the data_path isn't trusted.
Now it's possible to resplve paths such as:
context.path_resolve('active_object.modifiers[0].name')
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D14443
|
|
This tool can be used to rapidly edit curves. The current set of
functionalities for Bezier splines are as follows:
The functionalities are divided into three versions of the operator:
* Left-Click
* Ctrl + Left-Click
* Double Click
All current functionalities and their defaults are as follows:
* Extrude Point: Add a point connected to an existing point.
Enabled for Left-Click.
* Extrude Handle Type: Type of the handles of the extruded points.
Can be either Vector or Auto. Defaults to Vector.
* Delete Point: Delete existing point.
Enabled for Ctrl + Left-Click.
* Insert Point: Insert a point into a curve segment.
Enabled for Ctrl + Left-Click.
* Move Segment: Move curve segment.
Enabled for Left-Click.
* Select Point: Select a single point or handle at a time.
Enabled for Left-Click.
* Move point: Move existing points or handles.
Enabled for Left-Click.
* Close Spline: Close spline by clicking the endpoints consecutively.
Defaults to True.
* Close Spline Method: The condition for Close Spline to activate.
Can be one of None, On Press or On Click.
Defaults to On Click for Left-Click and None for the others.
* None: Functionality is turned off.
* On Press: Activate on mouse down.
This makes it possible to move the handles by dragging immediately
after closing the spline.
* On Click: Activate on mouse release.
This makes it possible to avoid triggering the Close Spline
functionality by dragging afterward.
* Toggle Vector: Toggle handle between Vector and Auto handle types.
Enabled for Double Click on a handle.
* Cycle Handle Type: Cycle between all four handle types.
Enabled for Double Click on the middle point of a Bezier point.
The keybindings for the following functionalities can be adjusted from
the modal keymap
* Free-Align Toggle: Toggle between Free and Align handle types.
Defaults to Left Shift. Activated on hold.
* Move Adjacent Handle: Move the closer handle of the adjacent vertex.
Defaults to Left Ctrl. Activated on hold.
* Move Entire: Move the entire point by moving by grabbing on the handle
Defaults to Spacebar. Activated on hold.
* Link Handles: Mirror the movement of one handle onto the other.
Defaults to Right Ctrl. Activated on press.
* Lock Handle Angle: Move the handle along its current angle.
Defaults to Left Alt. Activated on hold.
All the above functionalities, except for Move Segment and
those that work with handles, work similarly in the case of Poly
and NURBS splines.
Reviewed By: HooglyBoogly, weasel, campbellbarton
Differential Revision: http://developer.blender.org/D12155
|
|
|
|
There is a dedicated Library Override display mode now, and showing
these elsewhere just adds noise and makes the code problematic to
maintain (since the same element hierarchy will be used in two entirely
different contexts). The corresponding filter settings are removed too.
Part of T95802.
Reviewed by: Bastien Montagne
Differential Revision: https://developer.blender.org/D14411
|
|
Double back-ticks are used for RST literals.
|
|
Even though the default key-map didn't use NDOF types some key-maps did.
|
|
Use faster C code for getting the buffer from text.
|
|
|