Blender 2.8 - 4.5 Support
This commit is contained in:
@ -96,7 +96,7 @@ def convert_image(image, path, file_format='JPEG'):
|
||||
ren.image_settings.color_mode = orig_color_mode
|
||||
|
||||
|
||||
def get_random_color_rgb() -> list[float]:
|
||||
def get_random_color_rgb() -> List[float]:
|
||||
"""Return a random RGB color with values in range [0, 1]."""
|
||||
return [random.random(), random.random(), random.random()]
|
||||
|
||||
@ -1162,7 +1162,7 @@ def get_link_web_server():
|
||||
return '' if not hasattr(addon_prefs, 'link_web_server') else addon_prefs.link_web_server
|
||||
|
||||
|
||||
def get_file_lnx_version_tuple() -> tuple[int]:
|
||||
def get_file_lnx_version_tuple() -> Tuple[int, ...]:
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
return tuple(map(int, wrd.lnx_version.split('.')))
|
||||
|
||||
@ -1218,9 +1218,9 @@ def cpu_count(*, physical_only=False) -> Optional[int]:
|
||||
return int(subprocess.check_output(command))
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
err_reason = f'Reason: command {command} exited with code {e.returncode}.'
|
||||
err_reason = 'Reason: command {} exited with code {}.'.format(command, e.returncode)
|
||||
except FileNotFoundError as e:
|
||||
err_reason = f'Reason: couldn\'t open file from command {command} ({e.errno=}).'
|
||||
err_reason = 'Reason: couldn\'t open file from command {} (errno={}).'.format(command, e.errno)
|
||||
|
||||
# Last resort even though it can be wrong
|
||||
log.warn("Could not retrieve count of physical CPUs, using logical CPU count instead.\n\t" + err_reason)
|
||||
|
Reference in New Issue
Block a user