Some questions about PSD correction



  • Recently I was trying to use RBF to drive pose morph. At the stage of the integration process ,I encountered some problems.

    • Question 1: When using PSD correction to convert to relative pose morph, the result is not correct.

      1. (psd ---->relative use script): In the picture,using script to convert to relative pose morph, in the final skeleton pose, can get the final desired result. Script algorithm: expected result = skin + engraving = skin (original + pose morph) algorithm from j.p.lewis <Pose Space Deformation Notes>

      2. (psd ---->relative use help doc): Use the help document function converted to a relative pose morph using PSD correction,in the final skeleton pose,can not get the final desired result

    • Question 2: What's the algorithm of PSD correction ?

      1. Although the correct relative distortion can be obtained by using script, the intermediate transition result is not as good as PSD correction (contrast results are shown in the figure).

    picture:

    0_1542635579440_PSD_output.png


  • Global Moderator

    Hello,

    we discussed your thread quite a while this morning. Unfortunately we are not completely sure, if this is an API/development related question or if it's rather a user side issue which you would need to ask to our user support.

    On the other hand you mention a script. Could you maybe show us some code of the script causing the actual problem? And while asking this, is it correct to assume you are looking for a Python solution?

    And I should prepare you, that we will most likely not disclose any internal information of algorithms used inside of Cinema 4D. But lets see, maybe that's not needed to solve your problem.

    Lastly I already want to thank you for taking the time of making such a nice image describing the issue. I assume this will help tremendously as soon as we can see the code side, too.

    Cheers,
    Andreas



  • @a_block Thank you for your reply!
    This problem stems from the fact that when I tried to convert PSD to relative, I couldn't get the final result equivalent to PSD, so I started my journey of exploring PSD.

    After reading a lot of articles about PSD, I tried to implement an algorithm I can understand in C4D. I thought I solved this problem, but I didn't. I found that the PSD of C4D is different. (C4D has better. The intermediate state + the correct result, but can not be correctly converted to relative), so this caused my interest, I want to further understand, so I sent this post.

    It is understandable that any commercial software will not easily leak algorithms.

    Here is the code: (currently a simple test phase, the calculation results are correct as in the picture)

    def main():
    
        obj = doc.GetActiveObject()     #select after sculpt mesh
    
        tag = obj.GetTag(c4d.Tweights)
    
        objmg = obj.GetMg()
    
        plist = [objmg * pos for pos in obj.GetAllPoints()]
    
        cnt = len(plist)
    
        jcnt = tag.GetJointCount()
    
        doc.AddUndo(c4d.UNDOTYPE_CHANGE,obj)
    
        for pid in xrange(cnt):
    
            m = 0 * c4d.Matrix()
    
            for j in xrange(jcnt):
    
                rs = tag.GetJointRestState(j)
    
                jsmi = rs["m_bMi"]
    
                joint = tag.GetJoint(j)
    
                jmg = joint.GetMg()
    
                weight = tag.GetWeight(j,pid)
    
                if not weight:
    
                    continue
    
                m += weight * jmg * jsmi
    
            plist[pid] = ~m * plist[pid]
    
        plist = [~objmg*pos for pos in plist]
    
        obj.SetAllPoints(plist)
    
        obj.Message(c4d.MSG_UPDATE)
    
        c4d.EventAdd()

  • Global Moderator

    Hi @chuanzhen, just to inform you, your topic is currently in discussion with the development team.
    In any case, the algorithm will not be disclosed, only the conversion from PSD to Relative is involved.

    Cheers,
    Maxime.



  • @m_adam Understand your practices and thank you for your patience.
    (Maybe I express unclearly before, so the translation may seem a bit reckless. I just want to get some guidelines instead of asking for the algorithm directly. I respect the labor results of maxon or everyone
    It's ok, I have got your feedback,continue my exploration😉


  • Global Moderator

    Hi @chuanzhen, the development team just came back to me.

    There is currently no way to get a vertex position of a PSD morph from a 3rd party developer.
    This also means there is no way to convert PSD to relative.

    Cheers,
    Maxime.



  • @m_adam Thank you for your team's reply.
    I will share my exploration in this post in the future.☺