Merge remote-tracking branch 'origin/blender-v4.2-release'
This commit is contained in:
commit
d761634fb3
17
build_files/windows/autopep8.cmd
Normal file
17
build_files/windows/autopep8.cmd
Normal file
@ -0,0 +1,17 @@
|
||||
if NOT EXIST %PYTHON% (
|
||||
echo python not found, required for this operation
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set FORMAT_PATHS=%BLENDER_DIR%\tools\utils_maintenance\autopep8_format_paths.py
|
||||
|
||||
for %%a in (%PYTHON%) do (
|
||||
set PEP8_LOCATION=%%~dpa\..\lib\site-packages\autopep8.py
|
||||
)
|
||||
|
||||
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
||||
REM While we run with --no-subprocess a sub process is still used to get the version
|
||||
REM information, so we stil have to supply a valid --autopep8-command here.
|
||||
%PYTHON% -B %FORMAT_PATHS% --autopep8-command "%PEP8_LOCATION%" --no-subprocess %FORMAT_ARGS%
|
||||
|
||||
:EOF
|
@ -27,4 +27,6 @@ set PATH=%CF_PATH%;%PATH%
|
||||
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
|
||||
%PYTHON% -B %FORMAT_PATHS% %FORMAT_ARGS%
|
||||
|
||||
call "%~dp0\autopep8.cmd"
|
||||
|
||||
:EOF
|
||||
|
@ -82,11 +82,26 @@ def enum_sampling_pattern(self, context):
|
||||
5)]
|
||||
|
||||
debug_items = [
|
||||
('SOBOL_BURLEY', "Sobol-Burley", "Use on-the-fly computed Owen-scrambled Sobol for random sampling", 0),
|
||||
('TABULATED_SOBOL', "Tabulated Sobol", "Use pre-computed tables of Owen-scrambled Sobol for random sampling", 1),
|
||||
('BLUE_NOISE', "Blue-Noise (pure)", "Blue-Noise (pure)", 2),
|
||||
('BLUE_NOISE_FIRST', "Blue-Noise (first)", "Blue-Noise (first)", 3),
|
||||
('BLUE_NOISE_ROUND', "Blue-Noise (round)", "Blue-Noise (round)", 4),
|
||||
('SOBOL_BURLEY',
|
||||
"Sobol-Burley",
|
||||
"Use on-the-fly computed Owen-scrambled Sobol for random sampling",
|
||||
0),
|
||||
('TABULATED_SOBOL',
|
||||
"Tabulated Sobol",
|
||||
"Use pre-computed tables of Owen-scrambled Sobol for random sampling",
|
||||
1),
|
||||
('BLUE_NOISE',
|
||||
"Blue-Noise (pure)",
|
||||
"Use a blue-noise pattern, which optimizes the frequency distribution of noise, for random sampling",
|
||||
2),
|
||||
('BLUE_NOISE_FIRST',
|
||||
"Blue-Noise (first)",
|
||||
"Use a blue-noise pattern for the first sample, then use Tabulated Sobol for the remaining samples, for random sampling",
|
||||
3),
|
||||
('BLUE_NOISE_ROUND',
|
||||
"Blue-Noise (round)",
|
||||
"Use a blue-noise sequence with a length rounded up to the next power of 2, for random sampling",
|
||||
4),
|
||||
]
|
||||
|
||||
non_debug_items = [
|
||||
|
@ -384,6 +384,7 @@ def script_paths_system_environment():
|
||||
return [_os.path.normpath(env_system_path)]
|
||||
return []
|
||||
|
||||
|
||||
def script_paths(*, subdir=None, user_pref=True, check_all=False, use_user=True, use_system_environment=True):
|
||||
"""
|
||||
Returns a list of valid script paths.
|
||||
|
@ -5798,6 +5798,12 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
{
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (brush.sculpt_tool == SCULPT_TOOL_DISPLACEMENT_SMEAR) {
|
||||
if (!ss.pbvh || BKE_pbvh_type(*ss.pbvh) == PBVH_BMESH) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Not supported in dynamic topology mode");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
stroke = paint_stroke_new(C,
|
||||
op,
|
||||
|
@ -30,6 +30,14 @@ from typing import (
|
||||
VERSION_MIN = (1, 6, 0)
|
||||
VERSION_MAX_RECOMMENDED = (1, 6, 0)
|
||||
AUTOPEP8_FORMAT_CMD = "autopep8"
|
||||
AUTOPEP8_FORMAT_DEFAULT_ARGS = (
|
||||
# Operate on all directories recursively.
|
||||
"--recursive",
|
||||
# Update the files in-place.
|
||||
"--in-place",
|
||||
# Auto-detect the number of jobs to use.
|
||||
"--jobs=0",
|
||||
)
|
||||
|
||||
BASE_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
os.chdir(BASE_DIR)
|
||||
@ -119,13 +127,9 @@ def autopep8_ensure_version(autopep8_format_cmd_argument: str) -> Optional[Tuple
|
||||
def autopep8_format(files: List[str]) -> bytes:
|
||||
cmd = [
|
||||
AUTOPEP8_FORMAT_CMD,
|
||||
# Operate on all directories recursively.
|
||||
"--recursive",
|
||||
# Update the files in-place.
|
||||
"--in-place",
|
||||
# Auto-detect the number of jobs to use.
|
||||
"--jobs=0",
|
||||
] + files
|
||||
*AUTOPEP8_FORMAT_DEFAULT_ARGS,
|
||||
*files
|
||||
]
|
||||
|
||||
# Support executing from the module directory because Blender does not distribute the command.
|
||||
if cmd[0].endswith(".py"):
|
||||
@ -134,6 +138,15 @@ def autopep8_format(files: List[str]) -> bytes:
|
||||
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
|
||||
|
||||
def autopep8_format_no_subprocess(files: List[str]) -> None:
|
||||
cmd = [
|
||||
*AUTOPEP8_FORMAT_DEFAULT_ARGS,
|
||||
*files
|
||||
]
|
||||
from autopep8 import main
|
||||
main(argv=cmd)
|
||||
|
||||
|
||||
def argparse_create() -> argparse.ArgumentParser:
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
@ -154,6 +167,17 @@ def argparse_create() -> argparse.ArgumentParser:
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-subprocess",
|
||||
dest="no_subprocess",
|
||||
default=False,
|
||||
action='store_true',
|
||||
help=(
|
||||
"Don't use a sub-process, load autopep8 into this instance of Python. "
|
||||
"Works around 8191 argument length limit on WIN32."
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--autopep8-command",
|
||||
dest="autopep8_command",
|
||||
@ -216,6 +240,10 @@ def main() -> None:
|
||||
if not files:
|
||||
return
|
||||
|
||||
if args.no_subprocess:
|
||||
autopep8_format_no_subprocess(files)
|
||||
return
|
||||
|
||||
autopep8_format(files)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user