SHARE
TWEET

Curvy Shape Transpose Patch

metroidsnes Mar 23rd, 2018 (edited) 18 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2.  .../Curvy/Base/CG Modules/BuildShapeExtrusion.cs   | 26 ++++++++++++++++++----
  3.  1 file changed, 22 insertions(+), 4 deletions(-)
  4.  
  5. diff --git a/Assets/3dPartyTools/Curvy/Base/CG Modules/BuildShapeExtrusion.cs b/Assets/3dPartyTools/Curvy/Base/CG Modules/BuildShapeExtrusion.cs
  6. index b5b8f6951..59edffdb6 100644
  7. --- a/Assets/3dPartyTools/Curvy/Base/CG Modules/BuildShapeExtrusion.cs 
  8. +++ b/Assets/3dPartyTools/Curvy/Base/CG Modules/BuildShapeExtrusion.cs 
  9. @@ -102,11 +102,20 @@ namespace FluffyUnderware.Curvy.Generator.Modules
  10.          [Label("Reverse Normal", "Reverse Vertex Normals?")]
  11.          [SerializeField]
  12.          bool m_CrossReverseNormals;
  13. -        #endregion
  14.  
  15. -        #region TAB: Scale
  16. +       [Header("Transpose")]
  17. +       [SerializeField]
  18. +       float m_TransposeX = 0;
  19. +
  20. +       [SerializeField]
  21. +       [AnimationCurveEx("Transpose X Curve")]
  22. +       AnimationCurve m_TransposeCurveX = AnimationCurve.Linear(0, 0, 1, 0);
  23. +
  24. +       #endregion
  25.  
  26. -        [Tab("Scale")]
  27. +       #region TAB: Scale
  28. +
  29. +       [Tab("Scale")]
  30.          [Label("Mode")]
  31.          [SerializeField]
  32.          ScaleModeEnum m_ScaleMode = ScaleModeEnum.Simple;
  33. @@ -696,7 +705,16 @@ namespace FluffyUnderware.Curvy.Generator.Modules
  34.                      Quaternion R = Quaternion.LookRotation(path.Direction[sample], path.Normal[sample]);
  35.  
  36.                      getScaleInternal(scaleFArray[sample], baseScale, ref scl);
  37. -                    Matrix4x4 mat = Matrix4x4.TRS(path.Position[sample], R, scl);
  38. +
  39. +                   // transpose shape
  40. +                   float transposeCurveXValue = 1 - m_TransposeCurveX.Evaluate(scaleFArray[sample]);
  41. +                   float multiplier = m_TransposeX * transposeCurveXValue;
  42. +                   Vector3 samplePos = path.Position[sample];
  43. +                   Vector3 samplePosForward = R * samplePos;
  44. +                   Vector3 pos = samplePos + samplePosForward * multiplier;
  45. +
  46. +                   Matrix4x4 mat = Matrix4x4.TRS(pos, R, scl);
  47. +
  48.                      Matrix4x4 matHollow = volHollow
  49.                          ? Matrix4x4.TRS(path.Position[sample], R, scl * (1 - HollowInset))
  50.                          : default(Matrix4x4);
  51. --
  52. 2.16.1.windows.1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top