Face
Face is a domain property of Mesh.
mesh.faces = Face(self)
- class Face(data_socket, selection=None)
-
- property as_cloud_points
Type cast to CloudPoint.
- property as_control_points
Type cast to ControlPoint.
- property as_corners
Type cast to Corner.
- property as_edges
Type cast to Edge.
- property as_faces
Type cast to Face.
- property as_insts
Type cast to Instance.
- property as_splines
Type cast to Spline.
- property as_verts
Type cast to Vertex.
- attribute(node)
Define an input node as attribute
- Parameters
node (Node) – The node created by the domain
- Returns
The node argument
Called when creating an input node in a property getter. Performs two actions:
Call the method
Node.as_attribute()
to tag the node as being an attribute. This will allow theTree.check_attributes()
to see if it is necessary to create a Capture Attribute for this field.Set the nde property
field_of
to self in order to implement the transfer attribute mechanism.
- property count
Count the number of items by return static.max + 1
- Returns
Integer
getter:
AttributeStatistic
setter: read only
- delete(mode='ALL')
Delete geometry
Node
DeleteGeometry
- Parameters
mode – str (default = ‘ALL’) in (‘ALL’, ‘EDGE_FACE’, ‘ONLY_FACE’)
- Returns
self
mesh.verts(...).delete(mode='ALL') mesh.edges(...).delete(mode='EDGE_FACE') mesh.faces(...).delete(mode='ONLY_FACE')
- delete_all()
Delete all geometry.
call
delete()
with mode : ‘ALL’- Returns
self
mesh.verts(...).delete_all() mesh.edges(...).delete_all() mesh.faces(...).delete_all()
- delete_edges_faces()
Delete edges and faces.
call
delete()
with mode : ‘EDGE_FACE’- Returns
self
mesh.verts(...).delete_edges_faces() mesh.edges(...).delete_edges_faces() mesh.faces(...).delete_edges_faces()
- delete_faces()
Delete faces
call
delete()
with mode : ‘ONLY_FACE’- Returns
self
mesh.verts(…).delete_faces() mesh.edges(…).delete_faces() mesh.faces(…).delete_faces()
- distribute_points(distance_min=None, density_max=None, density=None, density_factor=None, seed=None, distribute_method='RANDOM')
Distribute points on faces.
- Parameters
distance_min – Float
density_max – Float
density – Float
density_factor – Float
seed – Integer
distribute_method (str) – (default = ‘RANDOM’) in (‘RANDOM’, ‘POISSON’)
- Returns
points : Points
normal : Vector
rotation : Vector
- Return type
Node with 3 sockets
node = mesh.faces.distribute_points(...) cloud = node.points normal = node.normal rotation = node.rotation
- duplicate(amount=None)
Duplicate domain.
Node
DuplicateElements
- Parameters
amount – Integer
- Returns
duplicate index
- extrude(offset=None, offset_scale=None, individual=None)
Extrusion.
Node
ExtrudeMesh
- Parameters
offset – Vector
offset_scale – Float
individual – Boolean
- Returns
tuple with top and side selections
top, side = mesh.verts(...).extrude(...) top, side = mesh.edges(...).extrude(...) top, side = mesh.faces(...).extrude(...) # Example of insetting and extruding the faces of a mesh top, _ = mesh.faces.extrude(offset_scale=0) top.scale(0.5) top1, _ = top.extrude(top.normal, .3)
- get_named_attribute(name, data_type='FLOAT')
Get a named attribute
Called by methods set_named_xxx:
- get_named_boolean(name)
Get named attribute of type BOOLEAN
- get_named_color(name)
Get named attribute of type FLOAT_COLOR
- get_named_float(name)
Get named attribute of type FLOAT
- get_named_integer(name)
Get named attribute of type INT
- get_named_vector(name)
Get named attribute of type FLOAT_VECTOR
- index_transfer(attribute, index=None)
Transfer attribute with INDEX mapping
- Parameters
attribute (Any) – The attribute to transfer
index (Integer) – Index
- Returns
Same as attribute
- is_planar(threshold=None)
Attribute is_planar
- Parameters
threshold – Float
- Returns
Boolean
getter:
FaceIsPlanar
setter: read only
- property island
Island node attribute
- Returns
Node MeshIsland
getter:
MeshIsland
setter: read only
- property island_count
island_count output socket of Island attribute
- Returns
Int
getter:
MeshIsland
setter: read only
- property island_index
island_index output socket of Island attribute
- Returns
Int
getter:
MeshIsland
setter: read only
- property material
Material attribute
getter: write only
setter:
SetMaterial
- property material_index
Material index attribute
- Returns
Integer
getter:
MaterialIndex
setter:
SetMaterialIndex
- material_selection(material=None)
Material selection attribule
- Parameters
material (str or bpy.types.Material) – The material to select
- Returns
Boolean
getter:
MaterialSelection
- nearest_face_transfer(attribute, source_position=None)
Transfer attribute with NEAREST_FACE_INTERPOLATED mapping
- Parameters
attribute (Any) – The attribute to transfer
source_position (Vector) – Source position socket
- Returns
Same as attribute
- nearest_transfer(attribute, source_position=None)
Transfer attribute with NEAREST mapping
- Parameters
attribute (Any) – The attribute to transfer
source_position (Vector) – Source position socket
- Returns
Same as attribute
- property neighbors
Neighbors node
- Returns
Node FaceNeighbors
getter:
FaceNeighbors
setter: read only
- property neighbors_faces
Neighbors faces attribute
- Returns
The output socket faces of the FaceNeighbors node.
- Return type
getter:
FaceNeighbors
setter: read only
- property neighbors_vertices
Neighbors vertices attribute
- Returns
the output socket vertices of the FaceNeighbors node.
- Return type
getter:
FaceNeighbors
setter: read only
- property offset
“Offset” attribute (offset socket of SetPosition node)
- Returns
Vector
getter:
Position
setter:
SetPosition
- property position
Position attribute
- Returns
Vector
getter:
Position
setter:
SetPosition
- proximity(source_position=None)
Proximity.
Node
GeometryProximity
- Parameters
source_position – Vector
- Returns
position : Vector
distance : Float
- Return type
Node with two sockets
mesh.verts(...).proximity() mesh.edges(...).proximity() mesh.faces(...).proximity()
- scale(scale=None, center=None, axis=None, scale_mode='UNIFORM')
Scale a face or an edge.
Node
ScaleElements
scale_uniform and scale_single_axis can be called without the argument scale_mode
- Parameters
scale – Float
center – Vector
axis – Vector
scale_mode – str (default = ‘UNIFORM’) in (‘UNIFORM’, ‘SINGLE_AXIS’)
- Returns
self
mesh.edges(...).scale(...) mesh.faces(...).scale(...)
- scale_single_axis(scale=None, center=None, axis=None)
Scale a face or an edge in single axis mode.
call
scale()
with mode=’SINGLE_AXIS’- Parameters
scale – Float
center – Vector
- Returns
self
mesh.edges(...).scale_single_axis(...) mesh.faces(...).scale_single_axis(...)
- scale_uniform(scale=None, center=None)
Scale a face or an edge in uniform mode.
call
scale()
with mode=’UNIFORM’- Parameters
scale – Float
center – Vector
- Returns
self
mesh.edges(...).scale_uniform(...) mesh.faces(...).scale_uniform(...)
- select(selection)
Select the domain
- Parameters
selection (Boolean) – The selection condition
If a selection is existing, the resulting selection is a logical and betwenn the two
- set_material(material)
Material attribute
- Parameters
material (str or bpy.types.Material) – The material to set
setter:
SetMaterial
- set_named_attribute(name, value, data_type=None)
Set a named attribute
Called by classes set_named_xxx:
- set_named_boolean(name, value)
Set named attribute of type BOOLEAN
- set_named_byte_color(name, value)
Set named attribute of type BYTE_COLOR
- set_named_color(name, value)
Set named attribute of type FLOAT_COLOR
- set_named_float(name, value)
Set named attribute of type FLOAT
- set_named_integer(name, value)
Set named attribute of type INT
- set_named_vector(name, value)
Set named attribute of type FLOAT_VECTOR
- property shade_smooth
Area attribute
- Returns
Boolean
getter:
IsShadeSmooth
setter:
SetShadeSmooth
- stack(node)
Make the owning socket jump to the output socket of the node passed in argumment.
- Parameters
node (Node) – The node to jump to
- statistic(attribute, data_type=None)
Attribute statistic
call
AttributeStatistic
- to_points(position=None, radius=None)
Convert to points cloud.
Node
MeshToPoints
- Parameters
position – Vector
radius – Float
- Returns
Points
Example
mesh.verts.to_points(…) mesh.edges.to_points(…) mesh.faces.to_points(…) mesh.corners.to_points(…)
- transfer_attribute(attribute, source_position=None, index=None, data_type=None, mapping='NEAREST_FACE_INTERPOLATED')
Transfer attribute
- Parameters
- Returns
As defined by data_type
If data_type is None, it is computed from the attribute type.
This method is called by a DataSocket with a property
field_of
pointing on the domain:# Domain Vertex verts = mesh.verts # Attribute position: position.field_of = verts position = verts.position # Transfer to a var location = position.index_transfer() # Which is equivalent to: location = verts.index_transfer(verts.position)
- transfer_attribute_interpolated(attribute, source_position=None, data_type=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- transfer_boolean_interpolated(attribute, source_position=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- transfer_color_interpolated(attribute, source_position=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- transfer_float_interpolated(attribute, source_position=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- transfer_integer_interpolated(attribute, source_position=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- transfer_vector_interpolated(attribute, source_position=None)
<method GeometryNodeAttributeTransfer>
for other mapping, use transfer_attribute
- triangulate(minimum_vertices=None, ngon_method='BEAUTY', quad_method='SHORTEST_DIAGONAL')
Triangulate faces.
Node
Triangulate
- Parameters
minimum_vertices – Integer
ngon_method (str) – (default = ‘BEAUTY’) in (‘BEAUTY’, ‘CLIP’)
quad_method (str) – (default = ‘SHORTEST_DIAGONAL’) in (‘BEAUTY’, ‘FIXED’, ‘FIXED_ALTERNATE’, ‘SHORTEST_DIAGONAL’, ‘LONGEST_DIAGONAL’)
- Returns
self
mesh.faces(...).triangulate(...)