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
path: root/tests
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-08-04 10:18:21 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-04 10:28:18 +0300
commit3b0fab6dfaa00a6fd476d28c160fcd9219f9a973 (patch)
tree81026d0881c4ef9f438c83f1e9ae89a5497a4784 /tests
parenteffc0487106bc74590acf35a61541597b1149daa (diff)
Override: API update_operations.
The update_operations function will update the override structure of the local object. When working with overrides the override structure is only updated when the work-file is stored. When using scripts you might want to enforce the update of override properties and operations. This function removes a hack on the test cases. Reviewed By: mont29 Maniphest Tasks: T86656 Differential Revision: https://developer.blender.org/D10848
Diffstat (limited to 'tests')
-rw-r--r--tests/python/bl_blendfile_library_overrides.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/python/bl_blendfile_library_overrides.py b/tests/python/bl_blendfile_library_overrides.py
index c9c89c01cee..138c5fd13b5 100644
--- a/tests/python/bl_blendfile_library_overrides.py
+++ b/tests/python/bl_blendfile_library_overrides.py
@@ -45,10 +45,6 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
bpy.ops.wm.save_as_mainfile(filepath=str(self.output_path), check_existing=False, compress=False)
- def __ensure_override_library_updated(self):
- # During save the override_library is updated.
- bpy.ops.wm.save_as_mainfile(filepath=str(self.test_output_path), check_existing=False, compress=False)
-
def test_link_and_override_property(self):
bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
bpy.data.orphans_purge()
@@ -64,8 +60,7 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
assert(len(local_id.override_library.properties) == 0)
local_id.location.y = 1.0
-
- self.__ensure_override_library_updated()
+ local_id.override_library.update_operations()
assert(len(local_id.override_library.properties) == 1)
override_prop = local_id.override_library.properties[0]
@@ -101,7 +96,6 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
override_operation = override_prop.operations[0]
assert(override_operation.operation == 'NOOP')
assert(override_operation.subitem_local_index == -1)
-
local_id.location.y = 1.0
local_id.scale.x = 0.5
# `scale.x` will apply, but will be reverted when the library overrides
@@ -110,7 +104,7 @@ class TestLibraryOverrides(TestHelper, unittest.TestCase):
assert(local_id.scale.x == 0.5)
assert(local_id.location.y == 1.0)
- self.__ensure_override_library_updated()
+ local_id.override_library.update_operations()
assert(local_id.scale.x == 1.0)
assert(local_id.location.y == 1.0)