def collection(self, value: Union[str, bpy.types.Collection]): if isinstance(value, bpy.types.Collection): self._collection = value elif isinstance(value, str): self._collection = compas_blender.create_collection(value) else: raise Exception('Collection must be of type `str` or `bpy.types.Collection`.')
def __init__(self, assembly, layer=None): super(AssemblyArtist, self).__init__(assembly, layer=layer) # self.settings.update({ # 'color.vertex' : (0, 0, 0), # 'color.vertex:is_support' : (0, 0, 0), # 'color.edge' : (0, 0, 0), # 'color.interface' : (255, 255, 255), # 'color.force:compression' : (0, 0, 255), # 'color.force:tension' : (255, 0, 0), # 'color.selfweight' : (0, 255, 0), # 'scale.force' : 0.1, # 'scale.selfweight' : 0.1, # 'eps.selfweight' : 1e-3, # 'eps.force' : 1e-3, # }) layer = layer or "Assembly" self.assembly_collection = compas_blender.create_collection(layer) self.node_collection = compas_blender.create_collection("Nodes", parent=self.assembly_collection) self.link_collection = compas_blender.create_collection("Links", parent=self.assembly_collection) self.block_collection = compas_blender.create_collection("Blocks", parent=self.assembly_collection) self.interface_collection = compas_blender.create_collection("Interfaces", parent=self.assembly_collection)
def facelabelcollection(self) -> bpy.types.Collection: if not self._facelabelcollection: self._facelabelcollection = compas_blender.create_collection( 'FaceLabels', parent=self.collection) return self._facelabelcollection
def vertexlabelcollection(self) -> bpy.types.Collection: if not self._vertexlabelcollection: self._vertexlabelcollection = compas_blender.create_collection( 'VertexLabels', parent=self.collection) return self._vertexlabelcollection
def edgecollection(self) -> bpy.types.Collection: if not self._edgecollection: self._edgecollection = compas_blender.create_collection( 'Edges', parent=self.collection) return self._edgecollection
def collection(self): if not self._collection: self._collection = compas_blender.create_collection(self.mesh.name) return self._collection
def collection(self): if not self._collection: self._collection = compas_blender.create_collection('Mesh') return self._collection