|
@@ -13,34 +13,44 @@ class Object(base_classes.BaseNode):
|
|
|
else:
|
|
|
self._root_setup()
|
|
|
|
|
|
+ @property
|
|
|
+ def data(self):
|
|
|
+ """
|
|
|
+
|
|
|
+ :return: returns the data block of the node
|
|
|
+
|
|
|
+ """
|
|
|
+ return api.data(self.node)
|
|
|
+
|
|
|
+
|
|
|
def _init_camera(self):
|
|
|
"""Initialize camera attributes"""
|
|
|
logger.debug("Object()._init_camera()")
|
|
|
- self[constants.FAR] = api.camera.far(self.node)
|
|
|
- self[constants.NEAR] = api.camera.near(self.node)
|
|
|
+ self[constants.FAR] = api.camera.far(self.data)
|
|
|
+ self[constants.NEAR] = api.camera.near(self.data)
|
|
|
|
|
|
if self[constants.TYPE] == constants.PERSPECTIVE_CAMERA:
|
|
|
- self[constants.ASPECT] = api.camera.aspect(self.node)
|
|
|
- self[constants.FOV] = api.camera.fov(self.node)
|
|
|
+ self[constants.ASPECT] = api.camera.aspect(self.data)
|
|
|
+ self[constants.FOV] = api.camera.fov(self.data)
|
|
|
elif self[constants.TYPE] == constants.ORTHOGRAPHIC_CAMERA:
|
|
|
- self[constants.LEFT] = api.camera.left(self.node)
|
|
|
- self[constants.RIGHT] = api.camera.right(self.node)
|
|
|
- self[constants.TOP] = api.camera.top(self.node)
|
|
|
- self[constants.BOTTOM] = api.camera.bottom(self.node)
|
|
|
+ self[constants.LEFT] = api.camera.left(self.data)
|
|
|
+ self[constants.RIGHT] = api.camera.right(self.data)
|
|
|
+ self[constants.TOP] = api.camera.top(self.data)
|
|
|
+ self[constants.BOTTOM] = api.camera.bottom(self.data)
|
|
|
|
|
|
#@TODO: need more light attributes. Some may have to come from
|
|
|
# custom blender attributes.
|
|
|
def _init_light(self):
|
|
|
"""Initialize light attributes"""
|
|
|
logger.debug("Object()._init_light()")
|
|
|
- self[constants.COLOR] = api.light.color(self.node)
|
|
|
- self[constants.INTENSITY] = api.light.intensity(self.node)
|
|
|
+ self[constants.COLOR] = api.light.color(self.data)
|
|
|
+ self[constants.INTENSITY] = api.light.intensity(self.data)
|
|
|
|
|
|
if self[constants.TYPE] != constants.DIRECTIONAL_LIGHT:
|
|
|
- self[constants.DISTANCE] = api.light.distance(self.node)
|
|
|
+ self[constants.DISTANCE] = api.light.distance(self.data)
|
|
|
|
|
|
if self[constants.TYPE] == constants.SPOT_LIGHT:
|
|
|
- self[constants.ANGLE] = api.light.angle(self.node)
|
|
|
+ self[constants.ANGLE] = api.light.angle(self.data)
|
|
|
|
|
|
def _init_mesh(self):
|
|
|
"""Initialize mesh attributes"""
|