### Create bind constraint with createBindConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a bind constraint in Blender using the HiPhy add-on. Binds primitives (triangle or curve) between two simulation objects, with support for zero rest length. ```python from bl_ext.user_default.HiPhy.utils import create_bind_constraint # name: name for the constraint # sim_obj_1: the reference to the first simulation object # sim_obj_2: the reference to the second simulation object # indices1: the indices of the vertices of the first simulation object for each bond primitive # indices2: the indices of the vertices of the second simulation object for each bond primitive # bind constraints bind primitive to primitive (triangle to triangle, curve segment to curve segment, or triangle to curve segment) # indices for each primitives must be a triplet such as [v1, v2, v3] for triangle faces, [v1, v2, v1] for curve segment (the duplicated indices serves a sentinel value) # binding_positions1: the position of the vertices in the first simulation object for the constraint, in the world space # binding_positions2: the position of the vertices in the first simulation object for the constraint, in the world space # weights1: the barycentric weight/linear weight for binding_positions of each binding point for the first simulation object. # weights2: the barycentric weight/linear weight for binding_positions of each binding point for the second simulation object. # the weights are triplets as well. # if the simulation object is a triangle mesh, it will be the barycentric weight [w1, w2, w3]. # if the simulation object is a curve, it will be the linear weight [w1, w2, 0]. # zero_length_binding: if the binding constraint is zero rest length. If false, the distance between the binding_positions will be used to compute the rest length of the constraint. create_bind_constraint.createBindConstraintObject(name, sim_obj_1, sim_obj_2, indices1, indices2, binding_positions1, binding_positions2, weights1, weights2, zero_length_binding) ``` -------------------------------- ### create_bind_constraint.createBindConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a bind constraint that binds primitives (triangle to triangle, curve segment to curve segment, or triangle to curve segment) between two simulation objects. ```APIDOC ## create_bind_constraint.createBindConstraintObject ### Description Creates a bind constraint that binds primitives (triangle to triangle, curve segment to curve segment, or triangle to curve segment) between two simulation objects. ### Method Python function call ### Signature ```python create_bind_constraint.createBindConstraintObject(name, sim_obj_1, sim_obj_2, indices1, indices2, binding_positions1, binding_positions2, weights1, weights2, zero_length_binding) ``` ### Parameters - **name** (string) - Required - Name for the constraint. - **sim_obj_1** (object) - Required - The reference to the first simulation object. - **sim_obj_2** (object) - Required - The reference to the second simulation object. - **indices1** (list) - Required - The indices of the vertices of the first simulation object for each bond primitive. - **indices2** (list) - Required - The indices of the vertices of the second simulation object for each bond primitive. Indices for each primitive must be a triplet such as [v1, v2, v3] for triangle faces, [v1, v2, v1] for curve segment (the duplicated index serves as a sentinel value). - **binding_positions1** (list) - Required - The position of the vertices in the first simulation object for the constraint, in world space. - **binding_positions2** (list) - Required - The position of the vertices in the second simulation object for the constraint, in world space. - **weights1** (list) - Required - The barycentric weight/linear weight for binding_positions of each binding point for the first simulation object. The weights are triplets as well. If the simulation object is a triangle mesh, it will be the barycentric weight [w1, w2, w3]. If the simulation object is a curve, it will be the linear weight [w1, w2, 0]. - **weights2** (list) - Required - The barycentric weight/linear weight for binding_positions of each binding point for the second simulation object. The weights are triplets as well. If the simulation object is a triangle mesh, it will be the barycentric weight [w1, w2, w3]. If the simulation object is a curve, it will be the linear weight [w1, w2, 0]. - **zero_length_binding** (bool) - Required - If the binding constraint is zero rest length. If false, the distance between the binding_positions will be used to compute the rest length of the constraint. ### Usage Example ```python from bl_ext.user_default.HiPhy.utils import create_bind_constraint create_bind_constraint.createBindConstraintObject(name, sim_obj_1, sim_obj_2, indices1, indices2, binding_positions1, binding_positions2, weights1, weights2, zero_length_binding) ``` ``` -------------------------------- ### Create point constraint with createPointConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a point constraint in Blender using the HiPhy add-on. The function takes the simulation object, a list of vertices to constrain, a name, and an optional operator for error reporting. ```python # Modify the user_default to your default repository from bl_ext.user_default.HiPhy.utils import create_point_constraint # obj: the reference to the simulation object # verts: list of vertices to be constrained # name: name for the constraint # operator: (optional) a Blender operator to report error messages create_point_constraint.createPointConstraintObject(obj, verts, name, operator) ``` -------------------------------- ### Create mesh constraint with createMeshConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a mesh constraint in Blender using the HiPhy add-on. The function binds simulation vertices to a mesh object using barycentric weights and local coordinates. ```python from bl_ext.user_default.HiPhy.utils import create_mesh_constraint # sim_obj: the reference to the simulation object # mesh_obj: the reference to the mesh object # name: name for the constraint # bond_indices: the indices of the vertices in the simulation object for the constraint # bond_points: the position of the vertices in the simulation object for the constraint, in the world space # bond_face_ids: the id for the face of the mesh object bond by each constraint vertices # bond_barycentric_weights_on_mesh: the barycentric weight for closest point on the mesh object bond by each constraint vertices # bond_local_coord: the local coordinate for each constraint vertices in each bond mesh face frame. # If the three vertices of the mesh face are (v1, v2, v3), the frame (u, v, n) is defined as # u = (v2 - v1).Normalized() # n = u.Cross((v3 - v1)).Normalized() # v = n.Cross(u) create_mesh_constraint.createMeshConstraintObject(sim_obj, mesh_obj, name, bond_indices, bond_points, bond_face_ids, bond_barycentric_weights_on_mesh, bond_local_coord) ``` -------------------------------- ### create_mesh_constraint.createMeshConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a mesh constraint object that binds simulation object vertices to a mesh object using barycentric coordinates. ```APIDOC ## create_mesh_constraint.createMeshConstraintObject ### Description Creates a mesh constraint object that binds simulation object vertices to a mesh object using barycentric coordinates. ### Method Python function call ### Signature ```python create_mesh_constraint.createMeshConstraintObject(sim_obj, mesh_obj, name, bond_indices, bond_points, bond_face_ids, bond_barycentric_weights_on_mesh, bond_local_coord) ``` ### Parameters - **sim_obj** (object) - Required - The reference to the simulation object. - **mesh_obj** (object) - Required - The reference to the mesh object. - **name** (string) - Required - Name for the constraint. - **bond_indices** (list) - Required - The indices of the vertices in the simulation object for the constraint. - **bond_points** (list) - Required - The position of the vertices in the simulation object for the constraint, in world space. - **bond_face_ids** (list) - Required - The id for the face of the mesh object bond by each constraint vertex. - **bond_barycentric_weights_on_mesh** (list) - Required - The barycentric weight for closest point on the mesh object bond by each constraint vertex. - **bond_local_coord** (list) - Required - The local coordinate for each constraint vertex in each bond mesh face frame. The frame (u, v, n) is defined as: u = (v2 - v1).Normalized(), n = u.Cross((v3 - v1)).Normalized(), v = n.Cross(u). ### Usage Example ```python from bl_ext.user_default.HiPhy.utils import create_mesh_constraint create_mesh_constraint.createMeshConstraintObject(sim_obj, mesh_obj, name, bond_indices, bond_points, bond_face_ids, bond_barycentric_weights_on_mesh, bond_local_coord) ``` ``` -------------------------------- ### Create joint constraint with createCreateConstraint Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a joint constraint in Blender using the HiPhy add-on. For a single affine body, pass None for sim_obj_2. The function accepts an optional operator for error reporting. ```python from bl_ext.user_default.HiPhy.utils import create_joint_constraint # sim_obj_1: the reference to the first simulation object # sim_obj_2: the reference to the second simulation object, if the joint constraint is for a single affine body, this is None # joint_location: the location for the joint in world space # name: name for the constraint create_joint_constraint.createCreateConstraint(sim_obj_1, sim_obj_2, joint_location, name, operator = None): ``` -------------------------------- ### create_point_constraint.createPointConstraintObject Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a point constraint object that constrains a list of vertices on a simulation object. ```APIDOC ## create_point_constraint.createPointConstraintObject ### Description Creates a point constraint object that constrains a list of vertices on a simulation object. ### Method Python function call ### Signature ```python create_point_constraint.createPointConstraintObject(obj, verts, name, operator) ``` ### Parameters - **obj** (object) - Required - The reference to the simulation object. - **verts** (list) - Required - List of vertices to be constrained. - **name** (string) - Required - Name for the constraint. - **operator** (Blender operator) - Optional - A Blender operator to report error messages. ### Usage Example ```python from bl_ext.user_default.HiPhy.utils import create_point_constraint create_point_constraint.createPointConstraintObject(obj, verts, name, operator) ``` ``` -------------------------------- ### create_joint_constraint.createCreateConstraint Source: https://hiphyengine.github.io/aux-nodes/constraints-in-blender Creates a joint constraint between two simulation objects, or for a single affine body if the second object is None. ```APIDOC ## create_joint_constraint.createCreateConstraint ### Description Creates a joint constraint between two simulation objects, or for a single affine body if the second object is None. ### Method Python function call ### Signature ```python create_joint_constraint.createCreateConstraint(sim_obj_1, sim_obj_2, joint_location, name, operator = None) ``` ### Parameters - **sim_obj_1** (object) - Required - The reference to the first simulation object. - **sim_obj_2** (object) - Required - The reference to the second simulation object. If the joint constraint is for a single affine body, this is None. - **joint_location** (vector) - Required - The location for the joint in world space. - **name** (string) - Required - Name for the constraint. - **operator** (Blender operator) - Optional - A Blender operator to report error messages. ### Usage Example ```python from bl_ext.user_default.HiPhy.utils import create_joint_constraint create_joint_constraint.createCreateConstraint(sim_obj_1, sim_obj_2, joint_location, name, operator = None) ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.