On 01/04/2016 at 10:26, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I'm learning the FBX SDK and I'm having trouble with setting the weight values for each vertice.
I'm not sure if this is a C4D problem. Or if I'm doing something wrong in my FBX code.
But since C4D comes with an .fbx importer. Perhaps you guys can give me hint what's going wrong?
In my .fbx file I create a low res cylinder in the code.
It has 3 loop segments. Each with 4 points. Totaling 12 points(0-11).
In my code I create 3 joints. And position them inside of the cylinder as the joint skeleton rig.
When I open the .fbx file in C4D I get the cylinder, Weight tag, Skin deformer, and the 3 joints.
Everything is good, and in their proper places. Except the joint weights are doing wacky things.
In my .fbx code. I have created three clusters. One cluster for each joint.
Then I am setting the weight values for them by hand just as a test.
clusterA->AddControlPointIndex(0, 100);
clusterA->AddControlPointIndex(1, 100);
clusterA->AddControlPointIndex(2, 100);
clusterA->AddControlPointIndex(3, 100);
clusterA->AddControlPointIndex(4, 100);
clusterA->AddControlPointIndex(5, 100);
clusterA->AddControlPointIndex(6, 100);
clusterA->AddControlPointIndex(7, 100);
clusterA->AddControlPointIndex(8, 0);
clusterA->AddControlPointIndex(9, 0);
clusterA->AddControlPointIndex(10, 0);
clusterA->AddControlPointIndex(11, 0);
clusterB->AddControlPointIndex(0, 0);
clusterB->AddControlPointIndex(1, 0);
clusterB->AddControlPointIndex(2, 0);
clusterB->AddControlPointIndex(3, 0);
clusterB->AddControlPointIndex(4, 0);
clusterB->AddControlPointIndex(5, 0);
clusterB->AddControlPointIndex(6, 0);
clusterB->AddControlPointIndex(7, 0);
clusterB->AddControlPointIndex(8, 100);
clusterB->AddControlPointIndex(9, 100);
clusterB->AddControlPointIndex(10, 100);
clusterB->AddControlPointIndex(11, 100);
clusterC->AddControlPointIndex(0, 0);
clusterC->AddControlPointIndex(1, 0);
clusterC->AddControlPointIndex(2, 0);
clusterC->AddControlPointIndex(3, 0);
clusterC->AddControlPointIndex(4, 0);
clusterC->AddControlPointIndex(5, 0);
clusterC->AddControlPointIndex(6, 0);
clusterC->AddControlPointIndex(7, 0);
clusterC->AddControlPointIndex(8, 0);
clusterC->AddControlPointIndex(9, 0);
clusterC->AddControlPointIndex(10, 0);
clusterC->AddControlPointIndex(11, 0);
I have the mode set to this:
clusterA->SetLinkMode(FbxCluster::eTotalOne);
clusterB->SetLinkMode(FbxCluster::eTotalOne);
clusterC->SetLinkMode(FbxCluster::eTotalOne);
But in C4D. All of the point weights in clusterA & clusterB are being set to 100!?
And the total weight values are equaling 200!?
Can anyone tell me what's going on here?
Why are the weights getting messed up when the .fbx file opened in C4D?
Is this a C4D problem. Or am I setting the weight values wrong in the FBX code?
-ScottA