Skip to content

Commit

Permalink
Fix the twist mult, the twist matrix scale, and the close plug (#33)
Browse files Browse the repository at this point in the history
* Fix the twist mult in the buidler, the twist matrix scale, and the close plug

* Bump the version number
  • Loading branch information
tbttfox authored Aug 19, 2024
1 parent 7ac8286 commit ee8553a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
24 changes: 12 additions & 12 deletions TwistSpline.mod
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
+ PLATFORM:win64 MAYAVERSION:2022 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:win64 MAYAVERSION:2022 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: windows-2022
[r] scripts: scripts

+ PLATFORM:linux MAYAVERSION:2022 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:linux MAYAVERSION:2022 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: linux-2022
[r] scripts: scripts

+ PLATFORM:mac MAYAVERSION:2022 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:mac MAYAVERSION:2022 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: mac-2022
[r] scripts: scripts

+ PLATFORM:win64 MAYAVERSION:2023 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:win64 MAYAVERSION:2023 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: windows-2023
[r] scripts: scripts

+ PLATFORM:linux MAYAVERSION:2023 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:linux MAYAVERSION:2023 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: linux-2023
[r] scripts: scripts

+ PLATFORM:mac MAYAVERSION:2023 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:mac MAYAVERSION:2023 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: mac-2023
[r] scripts: scripts

+ PLATFORM:win64 MAYAVERSION:2024 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:win64 MAYAVERSION:2024 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: windows-2024
[r] scripts: scripts

+ PLATFORM:linux MAYAVERSION:2024 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:linux MAYAVERSION:2024 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: linux-2024
[r] scripts: scripts

+ PLATFORM:mac MAYAVERSION:2024 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:mac MAYAVERSION:2024 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: mac-2024
[r] scripts: scripts

+ PLATFORM:win64 MAYAVERSION:2025 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:win64 MAYAVERSION:2025 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: windows-2025
[r] scripts: scripts

+ PLATFORM:linux MAYAVERSION:2025 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:linux MAYAVERSION:2025 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: linux-2025
[r] scripts: scripts

+ PLATFORM:mac MAYAVERSION:2025 TwistSpline 1.2.0 TwistSpline
+ PLATFORM:mac MAYAVERSION:2025 TwistSpline 1.2.1 TwistSpline
[r] icons: icons
plug-ins: mac-2025
[r] scripts: scripts
4 changes: 3 additions & 1 deletion scripts/twistSplineBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,13 @@ def makeTwistSpline(
connectTwistSplineMultiTangents(
cvs, twBfrs, oCtrls, iCtrls, oBfrs, iBfrs, oRests, iRests, closed=closed
)
twistMul = 1.0
else:
connectTwistSplineTangents(cvs, twBfrs, oCtrls, iCtrls, oBfrs, iBfrs, closed=closed)
twistMul = -1.0

splineTfm, splineShape = buildTwistSpline(
pfx, cvs, oCtrls, iCtrls, tws, maxParam, master, closed=closed, twistMul=-1.0
pfx, cvs, oCtrls, iCtrls, tws, maxParam, master, closed=closed, twistMul=twistMul
)

jPars, joints, group, cnst = None, None, None, None
Expand Down
2 changes: 1 addition & 1 deletion src/pluginMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SOFTWARE.

MStatus initializePlugin( MObject obj ) {
MStatus status;
MFnPlugin plugin( obj, "BlurStudio", "1.2.0", "Any");
MFnPlugin plugin( obj, "BlurStudio", "1.2.1", "Any");

status = plugin.registerData("twistSplineData", TwistSplineData::id, TwistSplineData::creator);
if (!status) {
Expand Down
7 changes: 5 additions & 2 deletions src/twistMultiTangentNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ SOFTWARE.
#include <maya/MFnUnitAttribute.h>
#include <maya/MGlobal.h>
#include <maya/MMatrix.h>
#include <maya/MTransformationMatrix.h>
#include <maya/MQuaternion.h>
#include <maya/MPlug.h>
#include <maya/MTypes.h>
#include <maya/MVector.h>
Expand Down Expand Up @@ -209,7 +211,6 @@ MStatus TwistMultiTangentNode::initialize()
aClosed = num_attr.create("closed", "cl", MFnNumericData::kBoolean, false, &status);
num_attr.setKeyable(true);
num_attr.setStorable(true);
num_attr.setMin(2);
addAttribute(aClosed);

aInTanX =
Expand Down Expand Up @@ -650,7 +651,9 @@ MStatus TwistMultiTangentNode::compute(const MPlug &plug, MDataBlock &data)
outTanLenHandle.setDouble(cur.outTan.doneTan.length());

auto outMatHandle = outHandle.child(aOutTwistMat);
outMatHandle.setMMatrix(cur.smoothMat * cur.piTwist);

MTransformationMatrix oriMat = cur.smoothMat * cur.piTwist;
outMatHandle.setMMatrix(oriMat.rotation().asMatrix());

auto outTwistHandle = outHandle.child(aOutTwistUp);
outTwistHandle.set3Double(cur.tfmMat(1, 0), cur.tfmMat(1, 1), cur.tfmMat(1, 2));
Expand Down

0 comments on commit ee8553a

Please sign in to comment.