Skip to content

Commit

Permalink
Fix: Import bhkMalleableConstraint
Browse files Browse the repository at this point in the history
Not tested because I didn't find one in the wild, but it has the exact same pattern found in bhkLimitedHingeConstraint, and no sub_constraint attribute is noted in the nif.xml, but the corrected ones are.
  • Loading branch information
HENDRIX-ZT2 committed Sep 13, 2019
1 parent ca8e075 commit 7b26095
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions pyffi/formats/nif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2406,24 +2406,24 @@ class bhkMalleableConstraint:
def apply_scale(self, scale):
"""Scale data."""
# apply scale on transform
self.sub_constraint.ragdoll.pivot_a.x *= scale
self.sub_constraint.ragdoll.pivot_a.y *= scale
self.sub_constraint.ragdoll.pivot_a.z *= scale
self.sub_constraint.ragdoll.pivot_b.x *= scale
self.sub_constraint.ragdoll.pivot_b.y *= scale
self.sub_constraint.ragdoll.pivot_b.z *= scale
self.sub_constraint.limited_hinge.pivot_a.x *= scale
self.sub_constraint.limited_hinge.pivot_a.y *= scale
self.sub_constraint.limited_hinge.pivot_a.z *= scale
self.sub_constraint.limited_hinge.pivot_b.x *= scale
self.sub_constraint.limited_hinge.pivot_b.y *= scale
self.sub_constraint.limited_hinge.pivot_b.z *= scale
self.ragdoll.pivot_a.x *= scale
self.ragdoll.pivot_a.y *= scale
self.ragdoll.pivot_a.z *= scale
self.ragdoll.pivot_b.x *= scale
self.ragdoll.pivot_b.y *= scale
self.ragdoll.pivot_b.z *= scale
self.limited_hinge.pivot_a.x *= scale
self.limited_hinge.pivot_a.y *= scale
self.limited_hinge.pivot_a.z *= scale
self.limited_hinge.pivot_b.x *= scale
self.limited_hinge.pivot_b.y *= scale
self.limited_hinge.pivot_b.z *= scale

def update_a_b(self, parent):
"""Update the B data from the A data."""
transform = self.get_transform_a_b(parent)
self.sub_constraint.limited_hinge.update_a_b(transform)
self.sub_constraint.ragdoll.update_a_b(transform)
self.limited_hinge.update_a_b(transform)
self.ragdoll.update_a_b(transform)

class bhkMoppBvTreeShape:
def get_mass_center_inertia(self, density=1, solid=True):
Expand Down

0 comments on commit 7b26095

Please sign in to comment.