mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-23 07:52:16 -05:00
e955c94ed3
Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
# SPDX-FileCopyrightText: 2017-2022 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# ############################################################
|
|
# Importing - Same For All Render Layer Tests
|
|
# ############################################################
|
|
|
|
import unittest
|
|
|
|
from view_layer_common import *
|
|
|
|
|
|
# ############################################################
|
|
# Testing
|
|
# ############################################################
|
|
|
|
class UnitTesting(ViewLayerTesting):
|
|
def test_selectability(self):
|
|
"""
|
|
See if the depsgraph evaluation is correct
|
|
"""
|
|
import bpy
|
|
|
|
scene = bpy.context.scene
|
|
window = bpy.context.window
|
|
cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh'))
|
|
|
|
layer = scene.view_layers.new('Selectability Test')
|
|
layer.collections.unlink(layer.collections[0])
|
|
window.view_layer = layer
|
|
|
|
scene_collection_mom = scene.master_collection.collections.new("Mom")
|
|
scene_collection_kid = scene_collection_mom.collections.new("Kid")
|
|
|
|
scene_collection_kid.objects.link(cube)
|
|
|
|
layer_collection_mom = layer.collections.link(scene_collection_mom)
|
|
layer_collection_kid = layer.collections.link(scene_collection_kid)
|
|
|
|
layer_collection_mom.enabled = True
|
|
layer.update() # update depsgraph
|
|
cube.select_set(True)
|
|
|
|
self.assertTrue(cube.visible_get(), "Cube should be visible")
|
|
self.assertTrue(cube.select_get(), "Cube should be selected")
|
|
|
|
|
|
# ############################################################
|
|
# Main - Same For All Render Layer Tests
|
|
# ############################################################
|
|
|
|
if __name__ == '__main__':
|
|
UnitTesting._extra_arguments = setup_extra_arguments(__file__)
|
|
unittest.main()
|