You can now specify a target view when creating a new drawing. See #1153.

This commit is contained in:
Dion Moult
2022-01-29 21:11:23 +11:00
parent 46e1a46dd2
commit 074fe0d3a6
7 changed files with 95 additions and 57 deletions
+22
View File
@@ -18,6 +18,7 @@
import os
import bpy
import mathutils
import ifcopenshell
import blenderbim.core.tool
import blenderbim.tool as tool
@@ -30,6 +31,17 @@ class TestImplementsTool(NewFile):
assert isinstance(subject(), blenderbim.core.tool.Drawing)
class TestCreateCamera(NewFile):
def test_run(self):
obj = subject.create_camera("Name", mathutils.Matrix())
assert obj.name == "Name"
assert obj.matrix_world == mathutils.Matrix()
assert obj.data.type == "ORTHO"
assert obj.data.ortho_scale == 50
assert obj.data.clip_end == 10
assert obj.users_collection[0] == bpy.context.scene.collection
class TestCreateSvgSheet(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
@@ -149,6 +161,11 @@ class TestGetSheetFilename(NewFile):
subject.get_sheet_filename(document) == "X - FOOBAR"
class TestGenerateDrawingMatrix(NewFile):
def test_returning_the_origin_as_a_fallback(self):
assert subject.generate_drawing_matrix("PLAN_VIEW", None) == mathutils.Matrix()
class TestGenerateSheetIdentification(NewFile):
def test_run(self):
ifc = ifcopenshell.file()
@@ -266,6 +283,11 @@ class TestOpenSvg(NewFile):
pass
class TestRunAssignClassOperator(NewFile):
def test_nothing(self):
pass
class TestUpdateTextValue(NewFile):
def test_updating_arbitrary_strings(self):
TestGetTextLiteral().test_run()