Announcement

Collapse
No announcement yet.

Passing parameters via MayaLiveLink

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Passing parameters via MayaLiveLink

    I'm basically mirroring my question from AnswerHub:
    https://answers.unrealengine.com/que...-livelink.html

    It looks like subjects can pass custom parameters via LiveLink and those can be accessed in MotionController's Motion Source: https://docs.unrealengine.com/en-us/...ve-Link-Plugin I've made custom blueprint derived from MotionController class, have set the MotionSource to my subject(Maya Live Link), overrided event on MotionControllerUpdate with added GetParameterValue node.
    MotionController component is hooked up to MayaLiveLink, since I can interact with it's transforms from Maya,but I can't get any parameters from GetParameterValue node (ValueFound bool is false). I've tried to use "Translation X", "Intensity" (when using Light subobject), I've tried to create custom attributes with simple names like "a", and so on, but nothing does seem to be picked up by GetParameterValue node. Should I setup subject's parameters in Maya in some special way? Or am I tying access wrong parameter names?

    #2
    Have been tracing variables, and noticed that curves from maya are empty.
    Then digging trough plugin source from current release branch, I have found something interesting. Chunk of code that is responsible for populating curve array is commented out (by "if 0"). Plus there is some test code inside. Basically it looks like passing curves of subjects from MayaLiveLink it's not finished feature. I'm wondering was it the reason why MayaLiveLink plugin didn't get into initial release of 4.19.0?

    The important part of the code:

    Code:
    virtual void OnStream(double StreamTime, int32 FrameNumber)
        {
            TArray<FTransform> JointTransforms;
            JointTransforms.Reserve(JointsToStream.Num());
    
            TArray<MMatrix> InverseScales;
            InverseScales.Reserve(JointsToStream.Num());
    
            for (int32 Idx = 0; Idx < JointsToStream.Num(); ++Idx)
            {
                const FStreamHierarchy& H = JointsToStream[Idx];
    
                MTransformationMatrix::RotationOrder RotOrder = H.JointObject.rotationOrder();
    
                MMatrix JointScale = GetScale(H.JointObject);
                InverseScales.Add(JointScale.inverse());
    
                MMatrix ParentInverseScale = (H.ParentIndex == -1) ? MMatrix::identity : InverseScales[H.ParentIndex];
    
                MMatrix MayaSpaceJointMatrix = JointScale *
                    GetRotationOrientation(H.JointObject, RotOrder) *
                    GetRotation(H.JointObject, RotOrder) *
                    GetJointOrientation(H.JointObject, RotOrder) *
                    ParentInverseScale *
                    GetTranslation(H.JointObject);
    
                //OutputRotation(GetRotation(jointObject, RotOrder));
                //OutputRotation(GetRotationOrientation(jointObject, RotOrder));
                //OutputRotation(GetJointOrientation(jointObject, RotOrder));
                //OutputRotation(TempJointMatrix);
    
                JointTransforms.Add(BuildUETransformFromMayaTransform(MayaSpaceJointMatrix));
            }
    
            TArray<FLiveLinkCurveElement> Curves;
    
    #if 0
            double CurFrame = CurrentTime.value();
            double CurveValue = CurFrame / 200.0;
    
            Curves.AddDefaulted();
            Curves[0].CurveName = FName(TEXT("Test"));
            Curves[0].CurveValue = static_cast<float>(FMath::Clamp(CurveValue, 0.0, 1.0));
    
            if (CurFrame > 100.0)
            {
                double Curve2Value = (CurFrame - 100.0) / 100.0;
                Curves.AddDefaulted();
                Curves[1].CurveName = FName(TEXT("Test2"));
                Curves[1].CurveValue = static_cast<float>(FMath::Clamp(Curve2Value, 0.0, 1.0));
            }
            //MGlobal::displayInfo(MString("CURVE TEST:") + CurFrame + " " + CurveValue);
    
            if (CurFrame > 201.0)
            {
                LiveLinkProvider->ClearSubject(SubjectToStream.SubjectName);
            }
            else
            {
                LiveLinkProvider->UpdateSubjectFrame(SubjectToStream.SubjectName, JointTransforms, Curves, StreamTime);
            }
    #else
            LiveLinkProvider->UpdateSubjectFrame(SubjectName, JointTransforms, Curves, StreamTime);
    #endif
        }
    Last edited by AyanMiru; 03-29-2018, 02:29 AM.

    Comment


      #3
      Kalvothe Can we get someone to look into this to make sure the Maya live link plugin works as intended? Thanks!
      ArtStation

      Comment


        #4
        Any update on this issue?! It's been a full year since the initial plugin release.
        ArtStation

        Comment


          #5
          Unfortunately nothing changed regarding this issue. Hope it will get some attention in near future.

          Comment


            #6
            I have made an update to the plugin for custom parameters. See the thread below.
            https://forums.unrealengine.com/deve...d-2015-support
            Programmer, Rigger, Animator - Demo Reel 2015 - My RnD / WIP thread - www.dennylindberg.com
            Worked on: Kitten'd - Guardians of Valor (Android, iOS)

            Comment

            Working...
            X