From 53d06887476acb7087f1397055d8b1cd314cbd56 Mon Sep 17 00:00:00 2001 From: Edward Lu Date: Thu, 3 Aug 2023 15:02:55 -0400 Subject: [PATCH] fix: #142 --- arena/objects/arena_object.py | 11 ++++++++++- examples/objects/image.py | 2 -- examples/objects/line.py | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arena/objects/arena_object.py b/arena/objects/arena_object.py index 941e92a0..b9b5a60b 100644 --- a/arena/objects/arena_object.py +++ b/arena/objects/arena_object.py @@ -1,5 +1,5 @@ from ..base_object import * -from ..attributes import Animation, Data, Color +from ..attributes import Animation, Data, Position, Rotation, Scale, Color from ..utils import * import uuid @@ -42,6 +42,15 @@ def __init__(self, evt_handler=None, update_handler=None, **kwargs): if "object_type" not in kwargs: kwargs["object_type"] = Object.object_type + if "position" not in kwargs: + kwargs["position"] = Position(0,0,0) + + if "rotation" not in kwargs: + kwargs["rotation"] = Rotation(0,0,0) + + if "scale" not in kwargs: + kwargs["scale"] = Scale(1,1,1) + # print warning if object is being created with the same id as an existing object if Object.exists(object_id): if not Object.get(object_id).persist: diff --git a/examples/objects/image.py b/examples/objects/image.py index 5cfbd5b3..0f79b9d0 100644 --- a/examples/objects/image.py +++ b/examples/objects/image.py @@ -13,6 +13,4 @@ def make_im(): url=image_url ) - scene.add_object(im) - scene.run_tasks() diff --git a/examples/objects/line.py b/examples/objects/line.py index 626cbe36..c33d4958 100644 --- a/examples/objects/line.py +++ b/examples/objects/line.py @@ -13,6 +13,5 @@ def make_line(): end=end, color=(0,255,0) ) - print(scene.add_object(line)) scene.run_tasks()