Skip to content

Commit

Permalink
remove not used lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Neill3d committed Dec 13, 2024
1 parent b57012e commit 2686672
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 197 deletions.
20 changes: 2 additions & 18 deletions Src/MotionCodeLibrary/ClusterAdvance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,10 @@ void LinkedVertex::NormalizeWeights()

FBMatrix LinkedVertex::CalculateDeformedPositionMatrix()
{
/*
FBMatrix tm;
for (int i=0; i<links.GetCount(); ++i)
{
FBMatrix temp(links[i].tm);
for (int ii=0; ii<4; ++ii)
for (int jj=0; jj<4; ++jj)
tm(ii, jj) += temp(ii, jj) * links[i].weight;
}
return tm;
*/

double total=0.0;

FBMatrix lClusterDeformation;
//lClusterDeformation.Identity();


for (size_t i=0; i<links.size(); ++i)
{

Expand All @@ -116,7 +100,7 @@ FBMatrix LinkedVertex::CalculateDeformedPositionMatrix()
// Compute the influence of the link on the vertex
FBMatrix lInfluence = links[i].tm;

const double lScale = lWeight * 100000.0; // (total + 0.000001);
const double lScale = lWeight * 100000.0;
MatrixScale(lInfluence, lScale);

switch(mode)
Expand Down
182 changes: 3 additions & 179 deletions Src/Projects/tool_BlendShape/BlendShapeToolkit_tool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ void ORTool_BlendShape::UICreate()
-lB,kFBAttachLeft, "ButtonLoad", 1.0,
lH, kFBAttachNone, "", 1.0 );


/*
AddRegion( "ButtonAssignAuto", "ButtonAssignAuto",
lB, kFBAttachRight, "ButtonAssign", 1.0 ,
lB, kFBAttachTop, "", 1.0,
lW, kFBAttachNone, "", 1.0,
lH, kFBAttachNone, "", 1.0 );
*/

// scrollbox
AddRegion( "ScrollBox", "ScrollBox",
lB, kFBAttachLeft, "", 1.0 ,
Expand Down Expand Up @@ -175,7 +166,6 @@ void ORTool_BlendShape::UICreate()

SetControl( "LabelObject", mLabelObject );
SetControl( "ButtonAssign", mContainerObjects );
//SetControl( "ButtonAssignAuto", mButtonAutoAssign );
SetControl( "ButtonLoad", mButtonLoad );
SetControl( "ButtonSave", mButtonSave );

Expand Down Expand Up @@ -365,18 +355,6 @@ void ORTool_BlendShape::UICreatePanel()

//

/*
AddRegion( "ButtonSculptEnter", "ButtonSculptEnter",
0, kFBAttachLeft, "LabelOperations", 1.0 ,
lB*2, kFBAttachBottom,"LabelSculpt", 1.0,
lW, kFBAttachNone, "", 1.0,
lH, kFBAttachNone, "", 1.0 );
AddRegion( "ButtonSculptLeave", "ButtonSculptLeave",
0, kFBAttachLeft, "LabelOperations", 1.0 ,
lB, kFBAttachBottom,"ButtonSculptEnter", 1.0,
lW, kFBAttachNone, "", 1.0,
lH, kFBAttachNone, "", 1.0 );
*/
mLayoutSculpt.AddRegion( "ButtonSculptTool", "ButtonSculptTool",
lB, kFBAttachLeft, "", 1.0 ,
lB*2, kFBAttachTop, "", 1.0,
Expand Down Expand Up @@ -416,8 +394,6 @@ void ORTool_BlendShape::UICreatePanel()
mLayoutOperations.SetControl( "ButtonReComputeNormals", mButtonReComputeNormals );
mLayoutOperations.SetControl( "ButtonInvertNormals", mButtonInvertNormals );
//
//SetControl( "ButtonSculptEnter", mButtonSculptEnter );
//SetControl( "ButtonSculptLeave", mButtonSculptLeave );
mLayoutSculpt.SetControl( "ButtonSculptTool", mButtonSculptTool );
//
mLayoutInfo.SetControl( "ButtonAbout", mButtonAbout );
Expand All @@ -443,8 +419,7 @@ void ORTool_BlendShape::UIConfig()

mButtonAutoAssign.Caption = "Auto assign";
mButtonAutoAssign.Style.SetPropertyValue(kFBCheckbox);
//mButtonAutoAssign.OnClick.Add( this, (FBCallback) &ORTool_BlendShape::EventButtonAutoAssignClick );


mLabelCheck.Caption = "Check state: ";

mButtonCheckAll.Caption = "All";
Expand Down Expand Up @@ -597,59 +572,6 @@ void ORTool_BlendShape::FBDestroy()
}


/************************************************
* Button click callback.
************************************************/
/*
void ORTool_BlendShape::EventButtonTestClick( HISender pSender, HKEvent pEvent )
{
switch( mState )
{
case 0:
{
// Create a new marker
mHdlModel = new FBModelPlane("Tool_Template Model");
mButtonTest.Caption = "Make visible";
}
break;
case 1:
{
// Make the model visible
if(mHdlModel.Ok())
{
mHdlModel->Show = true;
}
mButtonTest.Caption = "Remove model";
}
break;
case 2:
{
// Remove model from visible set
if( mHdlModel.Ok() )
{
mHdlModel->Show = false;
}
mButtonTest.Caption = "Delete model";
}
break;
case 3:
{
// Delete model
if( mHdlModel.Ok() )
{
mHdlModel->FBDelete();
}
mButtonTest.Caption = "Create model";
}
break;
}
mState = (mState+1) % 4;
}
*/

void ORTool_BlendShape::EventContainerDragAndDrop( HISender pSender, HKEvent pEvent )
{
FBEventDragAndDrop lDragAndDrop( pEvent );
Expand All @@ -671,34 +593,10 @@ void ORTool_BlendShape::EventContainerDragAndDrop( HISender pSender, HKEvent pEv

void ORTool_BlendShape::SetupBlendShapes( FBModel *pModel )
{
//mContainerObjects.Items.Clear();
//mListProperties.Items.Clear();
/*
mEditProperty.Property = 0;
mEditPropertyModern.Property = 0;
mButtonPreviousProperty.Enabled = false;
mButtonNextProperty.Enabled = false;
*/
if( pModel )
{
mContainerObjects.Items.Add( pModel->Name, (kReference)pModel );
/*
int lIdx = 0;
int lNbProps = lModel->PropertyList.GetCount();
mListProperties.Items.Add( "<Select Property>", (kReference)0 );
mListProperties.ItemIndex = 0;
for( lIdx = 0; lIdx < lNbProps; ++lIdx )
{
FBProperty* lProp = lModel->PropertyList[lIdx];
if( lProp->IsInternal() && !lProp->GetPropertyFlag( kFBPropertyFlagHideProperty ))
{
mListProperties.Items.Add( lProp->GetName(), (kReference)lProp );
}
}
mButtonPreviousProperty.Enabled = true;
mButtonNextProperty.Enabled = true;
*/

UpdateBlendShapesView(true);
}
}
Expand Down Expand Up @@ -763,8 +661,6 @@ void ORTool_BlendShape::UpdateBlendShapesView(const bool resetCheckState)

mBlendshapes[idx].Caption = shapeName;
mBlendshapes[idx].CaptionSize = UI_BLENDSHAPE_CAPTION_SIZE;
//mBlendshapes[idx].Property = pModel->PropertyList.Find( shapeName );

idx++;
}
}
Expand All @@ -777,7 +673,6 @@ void ORTool_BlendShape::UpdateBlendShapesView(const bool resetCheckState)

void ORTool_BlendShape::EventContainerDblClick( HISender pSender, HKEvent pEvent )
{
//SetupBlendShapes( nullptr );
mContainerObjects.Items.Clear();

UpdateBlendShapesView(true);
Expand Down Expand Up @@ -921,36 +816,9 @@ void ORTool_BlendShape::EventButtonRemoveClick( HISender pSender, HKEvent pEvent
FBGeometry *pGeometry = pModel->Geometry;

PrepareCheckList( pModel, checkList );
/*
for(int i=0; i<shapesCount; ++i)
{
if (removeList[i])
{
FBProperty *pProperty = pModel->PropertyList.Find( pGeometry->ShapeGetName(i) );
if (pProperty)
pModel->PropertyRemove(pProperty);
}
}
*/


ModifyGeometryShapes( pGeometry, checkList.GetArray(), kFBShapeRemove );

/*
int propIndex = pModel->PropertyList.GetCount() - 1;
while(propIndex >= 0)
{
FBProperty *pProperty = pModel->PropertyList[propIndex];
const char *typeName = pProperty->GetPropertyTypeName();
if ( strstr(typeName, "shape") != nullptr )
{
pModel->PropertyRemove(pProperty);
}
propIndex -= 1;
}
*/
pModel->SetupPropertiesForShapes();
}

Expand Down Expand Up @@ -1243,16 +1111,9 @@ void ORTool_BlendShape::EventButtonCalcDeltaClick( HISender pSender, HKEvent pEv
lPropScale->GetData( scale, sizeof(double) * 3 );

FBTRSToMatrix( InvTM, pos, rot, scale );
//FBMatrixInverse( InvTM, InvTM );

//FBMatrix TM;
//pModelEDIT->GetMatrix(TM);

//FBMatrixMult( InvTM, TM, InvTM );
}
}


//
// Calculate difference between BaseModel and Model. Store difference in the third model DeltaModel
//
Expand Down Expand Up @@ -1283,29 +1144,16 @@ void ORTool_BlendShape::EventButtonCalcDeltaClick( HISender pSender, HKEvent pEv
FBModelVertexData *pVertexDataBASE = pModelBASE->ModelVertexData;
pVertexDataBASE->VertexArrayMappingRequest();

//int vertCountBASE = pVertexDataBASE->GetVertexCount();
int vertCountEDIT = pGeometryEDIT->VertexCount();
//int *indicesBASE = pVertexDataBASE->GetIndexArray();


ClusterAdvance clusterAdvance( nullptr );

bool UseCluster = clusterAdvance.Init(pModelBASE);

//unsigned int dubCount = 0;
//const int *dubIndices = pVertexDataBASE->GetVertexArrayDuplicationMap( dubCount );

FBVertex *positionsT = (FBVertex*) pVertexDataBASE->GetVertexArray( kFBGeometryArrayID_Point, false ); // before deform
//FBNormal *normalsT = (FBNormal*) pVertexDataBASE->GetVertexArray( kFBGeometryArrayID_Normal, false );

//FBVertex *positionsBASE = (FBVertex*) pVertexDataBASE->GetVertexArray( kFBGeometryArrayID_Point, true ); // after deform
//FBNormal *normalsBASE = (FBNormal*) pVertexDataBASE->GetVertexArray( kFBGeometryArrayID_Normal, true );

pVertexDataBASE->VertexArrayMappingRelease();


//FBTRSToMatrix( scaleM, FBTVector(), FBRVector(), FBSVector(0.5, 0.5, 0.5) );

FBMesh *pMeshDELTA = new FBMesh( FBString( strDELTA, "_mesh" ) );
pModelDELTA->Geometry = pMeshDELTA;

Expand All @@ -1329,11 +1177,8 @@ void ORTool_BlendShape::EventButtonCalcDeltaClick( HISender pSender, HKEvent pEv
FBMatrixInverse( m, clusterAdvance.CalculateDeformedPositionMatrix(i) );
}



// UNTRANSFORM SKELETAL ANIMATION

//FBVertexMatrixMult( v, m, positionsEDIT[i] );
FBVertexMatrixMult( v, m, v );

// UNTRANSFORM BLEND SHAPES
Expand All @@ -1354,7 +1199,6 @@ void ORTool_BlendShape::EventButtonCalcDeltaClick( HISender pSender, HKEvent pEv
}

pMeshDELTA->VertexSet( v, i );
//pMeshDELTA->VertexNormalSet( normalsBASE[i], i );
}

//
Expand Down Expand Up @@ -1424,26 +1268,6 @@ void ORTool_BlendShape::EventButtonBrushToolClick( HISender pSender, HKEvent pEv

void ORTool_BlendShape::EventButtonAboutClick( HISender pSender, HKEvent pEvent )
{
/*
FBModelList pList;
FBGetSelectedModels(pList);
try
{
if (pList.GetCount() != 1)
throw ("Please select a one snapshot model to calculate delta");
FBModel *pModel = pList.GetAt(0);
CalculateDeformedMesh(pModel);
}
catch( const char *message )
{
FBMessageBox( "BlendShape Toolkit", message, "Ok" );
}
*/

const char* szTitle = LoadStringFromResource1(IDS_TITLE);
const char* szVersion = LoadVersionFromResource();
const char* szMsg = LoadStringFromResource2(IDS_ABOUT);
Expand Down

0 comments on commit 2686672

Please sign in to comment.