Closed elfring closed 2 years ago
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.
diff --git a/mixer/blender_client/client.py b/mixer/blender_client/client.py index 66f33a9..22ad23d 100644 --- a/mixer/blender_client/client.py +++ b/mixer/blender_client/client.py @@ -547,7 +547,7 @@ class BlenderClient(Client): def build_save(self, data): filename, file_extension = os.path.splitext(bpy.data.filepath) if get_mixer_prefs().VRtist_suffix not in filename: - filename = filename + get_mixer_prefs().VRtist_suffix + file_extension + filename += get_mixer_prefs().VRtist_suffix + file_extension bpy.ops.wm.save_as_mainfile(filepath=filename, copy=True) def build_montage_mode(self, data): diff --git a/mixer/blender_client/mesh.py b/mixer/blender_client/mesh.py index 4f8b914..c52f9af 100644 --- a/mixer/blender_client/mesh.py +++ b/mixer/blender_client/mesh.py @@ -466,7 +466,7 @@ def decode_baked_mesh(obj: Optional[bpy.types.Object], data, index): face.loops[0][uv_layer].uv = uvs[current_uv_index] face.loops[1][uv_layer].uv = uvs[current_uv_index + 1] face.loops[2][uv_layer].uv = uvs[current_uv_index + 2] - current_uv_index = current_uv_index + 3 + current_uv_index += 3 except Exception: pass diff --git a/mixer/blender_data/specifics.py b/mixer/blender_data/specifics.py index 62c89c1..7c96050 100644 --- a/mixer/blender_data/specifics.py +++ b/mixer/blender_data/specifics.py @@ -104,7 +104,7 @@ soa_initializers: Dict[type, array.array] = { _node_groups: Tuple[type, ...] = (T.ShaderNodeGroup, T.CompositorNodeGroup, T.TextureNodeGroup) if bpy.app.version is not None and bpy.app.version >= (2, 92, 0): - _node_groups = _node_groups + (T.GeometryNodeGroup,) + _node_groups += (T.GeometryNodeGroup,) def dispatch_rna(no_rna_impl: Callable[..., Any]): diff --git a/mixer/blender_data/tests/test_end_to_end.py b/mixer/blender_data/tests/test_end_to_end.py index c332cbd..c682abb 100644 --- a/mixer/blender_data/tests/test_end_to_end.py +++ b/mixer/blender_data/tests/test_end_to_end.py @@ -51,7 +51,7 @@ class TestWorld(unittest.TestCase): changeset = self.bpy_data_proxy.update(self.diff, {}, False, safe_properties) updates = changeset.creations # avoid clash on restore - world.name = world.name + "_bak" + world.name += "_bak" codec = Codec() for update in updates: @@ -82,7 +82,7 @@ class TestWorld(unittest.TestCase): changeset = self.bpy_data_proxy.update(self.diff, {}, False, safe_properties) creations = changeset.creations # avoid clash on restore - world.name = world.name + "_bak" + world.name += "_bak" codec = Codec() for update in creations: diff --git a/mixer/broadcaster/common.py b/mixer/broadcaster/common.py index 8aa99e5..a9b0c7d 100644 --- a/mixer/broadcaster/common.py +++ b/mixer/broadcaster/common.py @@ -373,7 +373,7 @@ def encode_string_array(values): def decode_string_array(data, index): count = bytes_to_int(data[index : index + 4]) - index = index + 4 + index += 4 values = [] for _ in range(count): string, index = decode_string(data, index)
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.