Skip to content

Commit 83b9227

Browse files
authored
Merge pull request #901 from compas-dev/blender_hints
Add type hints to blender artists
2 parents f379db7 + 0d04622 commit 83b9227

File tree

6 files changed

+271
-98
lines changed

6 files changed

+271
-98
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## Unreleased
9-
* Added `Plane.offset`
9+
1010
### Added
1111

1212
* Added `draw_vertexlabels`, `draw_edgelabels`, `draw_facelabels`, `draw_vertexnormals`, and `draw_facenormals` to `compas_blender.artists.MeshArtist`.
13+
* Added `Plane.offset`.
14+
* Added `draw_node_labels` and `draw_edgelabels` to `compas_blender.artists.NetworkArtist`.
15+
* Added `compas_blender.artists.RobotModelArtist.clear`.
1316

1417
### Changed
1518

1619
* Fixed bug in `compas_blender.draw_texts`.
20+
* `compas_blender.artists.RobotModelArtist.collection` can be assigned as a Blender collection or a name.
21+
* Generalized the parameter `color` of `compas_blender.draw_texts` and various label drawing methods.
1722

1823
### Removed
1924

src/compas_blender/artists/frameartist.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import bpy
2+
from typing import List
3+
from typing import Optional
4+
5+
from compas.geometry import Frame
6+
17
import compas_blender
28
from compas_blender.artists import BaseArtist
39

@@ -55,7 +61,10 @@ class FrameArtist(BaseArtist):
5561
artist.draw()
5662
5763
"""
58-
def __init__(self, frame, collection=None, scale=1.0):
64+
def __init__(self,
65+
frame: Frame,
66+
collection: Optional[bpy.types.Collection] = None,
67+
scale: float = 1.0):
5968
super(FrameArtist, self).__init__()
6069
self.collection = collection
6170
self.frame = frame
@@ -65,7 +74,7 @@ def __init__(self, frame, collection=None, scale=1.0):
6574
self.color_yaxis = (0, 255, 0)
6675
self.color_zaxis = (0, 0, 255)
6776

68-
def draw(self):
77+
def draw(self) -> None:
6978
"""Draw the frame.
7079
7180
Returns
@@ -76,7 +85,7 @@ def draw(self):
7685
self.draw_origin()
7786
self.draw_axes()
7887

79-
def draw_origin(self):
88+
def draw_origin(self) -> List[bpy.types.Object]:
8089
"""Draw the origin of the frame.
8190
8291
Returns
@@ -93,7 +102,7 @@ def draw_origin(self):
93102
self.objects += objects
94103
return objects
95104

96-
def draw_axes(self):
105+
def draw_axes(self) -> List[bpy.types.Object]:
97106
"""Draw the axes of the frame.
98107
99108
Returns

0 commit comments

Comments
 (0)