blender/tests/python/view_layer/test_view_layer_rename.py
Dalai Felinto 110373de6a Fix T53638: View layer renaming crashes 2/2
This fixes renaming the view layer via Python.

This bug was introduced originally in 3a95bdfc65d. Although I suspect it was
around for longer, since this commit didn't touch this part of the code.

But basically we need the id of the RNA property to be the one that owns
the data (view layer).
2017-12-27 13:39:28 -02:00

34 lines
960 B
Python

# ############################################################
# Importing - Same For All Render Layer Tests
# ############################################################
import unittest
import os
import sys
from view_layer_common import *
# ############################################################
# Testing
# ############################################################
class UnitTesting(ViewLayerTesting):
def test_view_layer_rename(self):
"""
See if we can rename view layers.
"""
import bpy
view_layer = bpy.context.view_layer
print("View layer name: " + view_layer.name)
view_layer.name = "New Name"
# ############################################################
# Main - Same For All Render Layer Tests
# ############################################################
if __name__ == '__main__':
UnitTesting._extra_arguments = setup_extra_arguments(__file__)
unittest.main()