Geometry
- class dazpy.DazGeometry(client, identifier)[source]
Bases:
DazElementProxy for the
DzGeometryof a node’s current shape.Provides chunked access to vertices, faces, normals, UV sets, and face / material groups. Use
DazNodeor construct directly:from dazpy import DazClient, DazGeometry, NodeIdentifier geo = DazGeometry(DazClient(), NodeIdentifier("Genesis9")) verts = geo.vertex_positions_all()
- Parameters:
identifier (NodeIdentifier) – Identifies the scene node whose geometry to access.
- vertex_positions_all(chunk_size=5000)[source]
Return all vertex positions, automatically paginating by chunk_size.
- face_vertex_indices(start=0, count=1000)[source]
Chunked access to facet vertex indices. Returns {total, start, facets: [[v0,v1,v2(,v3)], …]}.
- normals(start=0, count=5000)[source]
Chunked access to face normals. Returns {total, start, normals: [[x,y,z], …]}.
- uv_positions(uv_set=0, start=0, count=5000)[source]
Chunked access to UV coordinates. Returns {total, start, uvs: [[u,v], …]}.
- vertex_positions_posed(start=0, count=5000)[source]
Fetch a chunk of fully-deformed world-space vertex positions.
Uses
DzObject.getCachedGeom()which returns the final mesh after morph deformations and skeleton skinning have been applied, in world-space coordinates. Usevertex_positions_posed_all()to retrieve all vertices automatically.- Returns:
{"total": int, "start": int, "count": int, "vertices": [[x, y, z], ...]}- Return type:
- vertex_positions_posed_all(chunk_size=5000)[source]
Return all world-space posed+morphed vertex positions.
The first call triggers
vertex_positions_posed()which forces a cache update; subsequent chunks reuse the same cached geometry.
- mesh_info()[source]
Fetch all mesh metadata in a single HTTP call.
Consolidates what would otherwise be 7+ separate property reads.
- Returns:
{vertex_count, facet_count, tris_count, quads_count, subdivision_level, uv_set_count, face_group_names, material_group_names}orNoneif the geometry is unavailable.- Return type:
dict | None
- bounding_box()[source]
Axis-aligned bounding box of the base mesh in one HTTP call.
Iterates all vertices server-side, avoiding the need to transfer every position to Python just to compute an AABB.
- Returns:
A
BoundingBox, orNoneif the geometry is unavailable or empty.- Return type:
BoundingBox | None
- bounding_box_posed()[source]
AABB of the world-space posed-and-morphed mesh in one HTTP call.
Uses
DzObject.getCachedGeom()after forcing a cache update, so the result reflects the current bone pose and all active morphs.- Returns:
A
BoundingBoxin world space, orNone.- Return type:
BoundingBox | None
- face_vertex_indices_all(chunk_size=1000)[source]
Return all face vertex indices, paginating automatically.
- uv_positions_all(uv_set=0, chunk_size=5000)[source]
Return all UV coordinates for uv_set, paginating automatically.
- face_group_faces(name)[source]
Return the face indices belonging to the named face group.
- Parameters:
name (str) – Face group name as returned by
face_group_names().- Returns:
List of 0-based face indices, or
[]if the group doesn’t exist.- Return type:
- material_group_faces(name)[source]
Return the face indices belonging to the named material group.
- Parameters:
name (str) – Material group name as returned by
material_group_names().- Returns:
List of 0-based face indices, or
[]if the group doesn’t exist.- Return type:
- static triangulate(faces)[source]
Convert a list of face index arrays (tris or quads) to all-triangles.
Quads are split along the 0→2 diagonal:
[v0, v1, v2, v3]→[v0, v1, v2]+[v0, v2, v3]. Triangles are passed through unchanged. Faces with any other vertex count are silently skipped.This is a pure-Python operation — no HTTP round-trip.
- Parameters:
faces (list) – List of faces, each a list/tuple of vertex indices, as returned by
face_vertex_indices_all().- Returns:
All-triangle face list.
- Return type:
- static as_vec3(vertices)[source]
Wrap
[[x, y, z], ...]vertex data inVec3objects.This is a pure-Python operation — no HTTP round-trip.
- Parameters:
vertices (list) – List of
[x, y, z]arrays, as returned byvertex_positions_all()orvertex_positions_posed_all().- Returns:
List of
Vec3.- Return type: