@@ -1429,21 +1429,21 @@ protected bool ExportCommonConstraintProperties<T,U>(T uniConstraint, U fbxConst
1429
1429
return true ;
1430
1430
}
1431
1431
1432
- protected struct FbxConstraintSource
1432
+ protected struct ExpConstraintSource
1433
1433
{
1434
1434
public FbxNode node ;
1435
1435
public float weight ;
1436
1436
1437
- public FbxConstraintSource ( FbxNode node , float weight )
1437
+ public ExpConstraintSource ( FbxNode node , float weight )
1438
1438
{
1439
1439
this . node = node ;
1440
1440
this . weight = weight ;
1441
1441
}
1442
1442
}
1443
1443
1444
- protected List < FbxConstraintSource > GetConstraintSources ( IConstraint unityConstraint )
1444
+ protected List < ExpConstraintSource > GetConstraintSources ( IConstraint unityConstraint )
1445
1445
{
1446
- var fbxSources = new List < FbxConstraintSource > ( ) ;
1446
+ var fbxSources = new List < ExpConstraintSource > ( ) ;
1447
1447
var sources = new List < ConstraintSource > ( ) ;
1448
1448
unityConstraint . GetSources ( sources ) ;
1449
1449
foreach ( var source in sources )
@@ -1454,7 +1454,7 @@ protected List<FbxConstraintSource> GetConstraintSources(IConstraint unityConstr
1454
1454
{
1455
1455
continue ;
1456
1456
}
1457
- fbxSources . Add ( new FbxConstraintSource ( sourceNode , source . weight * UnitScaleFactor ) ) ;
1457
+ fbxSources . Add ( new ExpConstraintSource ( sourceNode , source . weight * UnitScaleFactor ) ) ;
1458
1458
}
1459
1459
return fbxSources ;
1460
1460
}
@@ -1479,10 +1479,7 @@ protected bool ExportPositionConstraint(IConstraint uniConstraint, FbxScene fbxS
1479
1479
FbxConstraintPosition fbxPosConstraint = FbxConstraintPosition . Create ( fbxScene , fbxNode . GetName ( ) + "_positionConstraint" ) ;
1480
1480
fbxPosConstraint . SetConstrainedObject ( fbxNode ) ;
1481
1481
var uniSources = GetConstraintSources ( uniPosConstraint ) ;
1482
- foreach ( var uniSource in uniSources )
1483
- {
1484
- fbxPosConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ;
1485
- }
1482
+ uniSources . ForEach ( uniSource => fbxPosConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ) ;
1486
1483
ExportCommonConstraintProperties ( uniPosConstraint , fbxPosConstraint , fbxNode ) ;
1487
1484
1488
1485
var uniAffectedAxes = uniPosConstraint . translationAxis ;
@@ -1511,10 +1508,7 @@ protected bool ExportRotationConstraint(IConstraint uniConstraint, FbxScene fbxS
1511
1508
FbxConstraintRotation fbxRotConstraint = FbxConstraintRotation . Create ( fbxScene , fbxNode . GetName ( ) + "_rotationConstraint" ) ;
1512
1509
fbxRotConstraint . SetConstrainedObject ( fbxNode ) ;
1513
1510
var uniSources = GetConstraintSources ( uniRotConstraint ) ;
1514
- foreach ( var uniSource in uniSources )
1515
- {
1516
- fbxRotConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ;
1517
- }
1511
+ uniSources . ForEach ( uniSource => fbxRotConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ) ;
1518
1512
ExportCommonConstraintProperties ( uniRotConstraint , fbxRotConstraint , fbxNode ) ;
1519
1513
1520
1514
var uniAffectedAxes = uniRotConstraint . rotationAxis ;
@@ -1547,10 +1541,7 @@ protected bool ExportScaleConstraint(IConstraint uniConstraint, FbxScene fbxScen
1547
1541
FbxConstraintScale fbxScaleConstraint = FbxConstraintScale . Create ( fbxScene , fbxNode . GetName ( ) + "_scaleConstraint" ) ;
1548
1542
fbxScaleConstraint . SetConstrainedObject ( fbxNode ) ;
1549
1543
var uniSources = GetConstraintSources ( uniScaleConstraint ) ;
1550
- foreach ( var uniSource in uniSources )
1551
- {
1552
- fbxScaleConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ;
1553
- }
1544
+ uniSources . ForEach ( uniSource => fbxScaleConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ) ;
1554
1545
ExportCommonConstraintProperties ( uniScaleConstraint , fbxScaleConstraint , fbxNode ) ;
1555
1546
1556
1547
var uniAffectedAxes = uniScaleConstraint . scalingAxis ;
@@ -1581,10 +1572,7 @@ protected bool ExportAimConstraint(IConstraint uniConstraint, FbxScene fbxScene,
1581
1572
FbxConstraintAim fbxAimConstraint = FbxConstraintAim . Create ( fbxScene , fbxNode . GetName ( ) + "_aimConstraint" ) ;
1582
1573
fbxAimConstraint . SetConstrainedObject ( fbxNode ) ;
1583
1574
var uniSources = GetConstraintSources ( uniAimConstraint ) ;
1584
- foreach ( var uniSource in uniSources )
1585
- {
1586
- fbxAimConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ;
1587
- }
1575
+ uniSources . ForEach ( uniSource => fbxAimConstraint . AddConstraintSource ( uniSource . node , uniSource . weight ) ) ;
1588
1576
ExportCommonConstraintProperties ( uniAimConstraint , fbxAimConstraint , fbxNode ) ;
1589
1577
1590
1578
var uniAffectedAxes = uniAimConstraint . rotationAxis ;
0 commit comments