|
|
@ -625,7 +625,7 @@ public class ConstraintHelper extends AbstractBlenderHelper { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/* TODO: reading constraints for objects (implement when object's animation will be available) |
|
|
|
// TODO: reading constraints for objects (implement when object's animation will be available)
|
|
|
|
List<Structure> constraintChannels = ((Structure)objectStructure.getFieldValue("constraintChannels")).evaluateListBase(dataRepository); |
|
|
|
List<Structure> constraintChannels = ((Structure)objectStructure.getFieldValue("constraintChannels")).evaluateListBase(dataRepository); |
|
|
|
for(Structure constraintChannel : constraintChannels) { |
|
|
|
for(Structure constraintChannel : constraintChannels) { |
|
|
|
System.out.println(constraintChannel); |
|
|
|
System.out.println(constraintChannel); |
|
|
@ -636,14 +636,26 @@ public class ConstraintHelper extends AbstractBlenderHelper { |
|
|
|
List<Structure> constraints = ((Structure)objectStructure.getFieldValue("constraints")).evaluateListBase(dataRepository); |
|
|
|
List<Structure> constraints = ((Structure)objectStructure.getFieldValue("constraints")).evaluateListBase(dataRepository); |
|
|
|
Constraint[] result = new Constraint[constraints.size()]; |
|
|
|
Constraint[] result = new Constraint[constraints.size()]; |
|
|
|
int i = 0; |
|
|
|
int i = 0; |
|
|
|
|
|
|
|
|
|
|
|
for(Structure constraint : constraints) { |
|
|
|
for(Structure constraint : constraints) { |
|
|
|
int type = ((Number)constraint.getFieldValue("type")).intValue(); |
|
|
|
int type = ((Number)constraint.getFieldValue("type")).intValue(); |
|
|
|
String name = constraint.getFieldValue("name").toString(); |
|
|
|
String constraintName = constraint.getFieldValue("name").toString(); |
|
|
|
result[i++] = new Constraint(constraint, influenceFunctions[type], null, dataRepository);//TODO: influence ipos for object animation
|
|
|
|
String objectName = objectStructure.getName(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Ipo> objectConstraintsIpos = constraintsIpos.get(objectName); |
|
|
|
|
|
|
|
Ipo ipo = objectConstraintsIpos!=null ? objectConstraintsIpos.get(constraintName) : null; |
|
|
|
|
|
|
|
if (ipo == null) { |
|
|
|
|
|
|
|
float enforce = ((Number) constraint.getFieldValue("enforce")).floatValue(); |
|
|
|
|
|
|
|
ipo = ipoHelper.createIpo(enforce); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Space ownerSpace = Space.valueOf(((Number) constraint.getFieldValue("ownspace")).byteValue()); |
|
|
|
|
|
|
|
Space targetSpace = Space.valueOf(((Number) constraint.getFieldValue("tarspace")).byteValue()); |
|
|
|
|
|
|
|
result[i++] = new Constraint(constraint, influenceFunctions[type], null, |
|
|
|
|
|
|
|
ownerSpace, targetSpace, ipo, dataRepository);//TODO: influence ipos for object animation
|
|
|
|
} |
|
|
|
} |
|
|
|
this.constraints.put(objectStructure.getOldMemoryAddress(), result); |
|
|
|
this.constraints.put(objectStructure.getOldMemoryAddress(), result); |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
if (constraintsList.size() > 0) { |
|
|
|
if (constraintsList.size() > 0) { |
|
|
|
this.constraints.put(objectStructure.getOldMemoryAddress(), constraintsList.toArray(new Constraint[constraintsList.size()])); |
|
|
|
this.constraints.put(objectStructure.getOldMemoryAddress(), constraintsList.toArray(new Constraint[constraintsList.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|