Skip to content

Commit

Permalink
Core: new arguments in create_proximity_constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Mar 1, 2024
1 parent 1908bf9 commit f75c33a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions release/scripts/mgear/core/applyop.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def gear_inverseRotorder_op(out_obj, in_obj):
return node


def create_proximity_constraint(shape, in_trans, existing_pin=None):
def create_proximity_constraint(shape, in_trans, existing_pin=None, mtx_connect=True, out_trans=None):
"""Create a proximity constraint between a shape and a transform.
Args:
Expand Down Expand Up @@ -883,12 +883,16 @@ def find_next_available_index(node, attribute):
shape_orig.outMesh >> pin.originalGeometry

# Connect in_trans to the found or default idx
in_trans.matrix >> pin.inputMatrix[idx]
if mtx_connect:
in_trans.matrix >> pin.inputMatrix[idx]
else:
pin.inputMatrix[idx].set(in_trans.matrix.get())

# Create the output transform
out_trans = pm.createNode(
"transform", n="{}_pinTrans{}".format(shape, idx)
)
if not out_trans:
# Create the output transform
out_trans = pm.createNode(
"transform", n="{}_pinTrans{}".format(shape, idx)
)

# Set the input connections for the output transform
pin.outputMatrix[idx] >> out_trans.offsetParentMatrix
Expand Down

0 comments on commit f75c33a

Please sign in to comment.