2022-02-11 03:30:11 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2017-06-15 11:46:52 +00:00
|
|
|
# ############################################################
|
|
|
|
# Importing - Same For All Render Layer Tests
|
|
|
|
# ############################################################
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2017-11-22 12:52:39 +00:00
|
|
|
from view_layer_common import *
|
2017-06-15 11:46:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ############################################################
|
|
|
|
# Testing
|
|
|
|
# ############################################################
|
|
|
|
|
2017-11-22 12:52:39 +00:00
|
|
|
class UnitTesting(ViewLayerTesting):
|
2017-06-15 11:46:52 +00:00
|
|
|
def test_shared_layer_collections_copy_full(self):
|
|
|
|
"""
|
|
|
|
See if scene copying 'FULL_COPY' is working for scene collections
|
|
|
|
with a shared object
|
|
|
|
"""
|
|
|
|
import os
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
scene = bpy.context.scene
|
2017-11-22 12:52:39 +00:00
|
|
|
layer = bpy.context.view_layer
|
2017-06-15 11:46:52 +00:00
|
|
|
|
|
|
|
original_cube = layer.objects.get('Cube')
|
2018-11-07 21:51:03 +00:00
|
|
|
original_cube.select_set(True)
|
2017-06-15 11:46:52 +00:00
|
|
|
self.assertTrue(original_cube.select_get())
|
|
|
|
|
|
|
|
bpy.ops.scene.new(type='FULL_COPY')
|
2017-11-22 12:52:39 +00:00
|
|
|
new_layer = bpy.context.view_layer
|
2017-06-15 11:46:52 +00:00
|
|
|
|
|
|
|
self.assertNotEqual(layer, new_layer)
|
|
|
|
new_cube = new_layer.objects.get('Cube.001')
|
|
|
|
self.assertNotEqual(original_cube, new_cube)
|
|
|
|
self.assertTrue(new_cube.select_get())
|
|
|
|
|
|
|
|
|
|
|
|
# ############################################################
|
|
|
|
# Main - Same For All Render Layer Tests
|
|
|
|
# ############################################################
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2017-06-19 06:12:11 +00:00
|
|
|
UnitTesting._extra_arguments = setup_extra_arguments(__file__)
|
2017-06-15 11:46:52 +00:00
|
|
|
unittest.main()
|