From bdd8ab1fb093b7fe38a4e0c80fc0d4b28e7169c7 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sat, 9 Feb 2013 19:24:54 +0000 Subject: [PATCH] Feature: added constraint definitions that were added to blender 2.62 so that the loaded does not crash when meets one git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10385 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../ConstraintDefinitionCameraSolver.java | 26 +++++++++++++++++++ .../ConstraintDefinitionFactory.java | 4 +++ .../ConstraintDefinitionFollowTrack.java | 26 +++++++++++++++++++ .../ConstraintDefinitionObjectSolver.java | 26 +++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionCameraSolver.java create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFollowTrack.java create mode 100644 engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionObjectSolver.java diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionCameraSolver.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionCameraSolver.java new file mode 100644 index 000000000..ba327183b --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionCameraSolver.java @@ -0,0 +1,26 @@ +package com.jme3.scene.plugins.blender.constraints.definitions; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.math.Transform; +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Camera solver' constraint type in blender. + * @author Marcin Roguski (Kaelthas) + */ +/*package*/ class ConstraintDefinitionCameraSolver extends ConstraintDefinition { + private static final Logger LOGGER = Logger.getLogger(ConstraintDefinitionAction.class.getName()); + + public ConstraintDefinitionCameraSolver(Structure constraintData, BlenderContext blenderContext) { + super(constraintData, blenderContext); + } + + @Override + public void bake(Transform ownerTransform, Transform targetTransform, float influence) { + // TODO: implement 'Camera solver' constraint + LOGGER.log(Level.WARNING, "'Camera solver' constraint NOT implemented!"); + } +} diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFactory.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFactory.java index 664c76585..603bb6bfe 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFactory.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFactory.java @@ -70,6 +70,10 @@ public class ConstraintDefinitionFactory { CONSTRAINT_CLASSES.put("bTrackToConstraint", ConstraintDefinitionTrackTo.class); CONSTRAINT_CLASSES.put("bSameVolumeConstraint", ConstraintDefinitionSameVolume.class); CONSTRAINT_CLASSES.put("bTransLikeConstraint", ConstraintDefinitionTransLike.class); + //Blender 2.62+ + CONSTRAINT_CLASSES.put("bCameraSolverConstraint", ConstraintDefinitionCameraSolver.class); + CONSTRAINT_CLASSES.put("bObjectSolverConstraint", ConstraintDefinitionObjectSolver.class); + CONSTRAINT_CLASSES.put("bFollowTrackConstraint", ConstraintDefinitionFollowTrack.class); } /** diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFollowTrack.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFollowTrack.java new file mode 100644 index 000000000..458464d59 --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionFollowTrack.java @@ -0,0 +1,26 @@ +package com.jme3.scene.plugins.blender.constraints.definitions; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.math.Transform; +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Follow track' constraint type in blender. + * @author Marcin Roguski (Kaelthas) + */ +/*package*/ class ConstraintDefinitionFollowTrack extends ConstraintDefinition { + private static final Logger LOGGER = Logger.getLogger(ConstraintDefinitionAction.class.getName()); + + public ConstraintDefinitionFollowTrack(Structure constraintData, BlenderContext blenderContext) { + super(constraintData, blenderContext); + } + + @Override + public void bake(Transform ownerTransform, Transform targetTransform, float influence) { + // TODO: implement 'Follow track' constraint + LOGGER.log(Level.WARNING, "'Follow track' constraint NOT implemented!"); + } +} diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionObjectSolver.java b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionObjectSolver.java new file mode 100644 index 000000000..0d47e5710 --- /dev/null +++ b/engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionObjectSolver.java @@ -0,0 +1,26 @@ +package com.jme3.scene.plugins.blender.constraints.definitions; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.math.Transform; +import com.jme3.scene.plugins.blender.BlenderContext; +import com.jme3.scene.plugins.blender.file.Structure; + +/** + * This class represents 'Object solver' constraint type in blender. + * @author Marcin Roguski (Kaelthas) + */ +/*package*/ class ConstraintDefinitionObjectSolver extends ConstraintDefinition { + private static final Logger LOGGER = Logger.getLogger(ConstraintDefinitionAction.class.getName()); + + public ConstraintDefinitionObjectSolver(Structure constraintData, BlenderContext blenderContext) { + super(constraintData, blenderContext); + } + + @Override + public void bake(Transform ownerTransform, Transform targetTransform, float influence) { + // TODO: implement 'Object solver' constraint + LOGGER.log(Level.WARNING, "'Object solver' constraint NOT implemented!"); + } +}