import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
import org.simantics.equation.solver.Solver;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
+import org.simantics.animation.stubs.Animation;\r
import org.simantics.layer0.utils.Property;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.EntityFactory;\r
solver.pushToGraph(graph);\r
Collection<Animation> animations = model.getAnimation();\r
for (Animation animation : animations) {\r
- Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
- for (org.simantics.g2d.stubs.anim.Interpolator interpolator : interpolators) {\r
+ Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+ for (org.simantics.animation.stubs.Interpolator interpolator : interpolators) {\r
IEntity target = interpolator.getTarget();\r
// check all model properties\r
for (Property p : modelProperties) {\r
import javax.vecmath.AxisAngle4d;\r
import javax.vecmath.Quat4d;\r
\r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
+import org.simantics.animation.stubs.Interpolator;\r
import org.simantics.animation.curve.SlerpCurve;\r
import org.simantics.animation.curve.TCBCurve;\r
import org.simantics.proconf.g3d.Resources;\r
body.attachChild(mesh);\r
return false;\r
}\r
- org.simantics.g2d.stubs.anim.Animation animation = new org.simantics.g2d.stubs.anim.Animation(graph,res);\r
+ org.simantics.animation.stubs.Animation animation = new org.simantics.animation.stubs.Animation(graph,res);\r
G3DNode shape = getG3DNode(graph);\r
G3DNode modelResource = G3DTools.getModelFromResource(graph,shape.getResource());\r
assert (modelResource != null);\r
G3DModel model = new G3DModel(graph,modelResource.getResource());\r
- Collection<org.simantics.g2d.stubs.anim.Animation> animations = model.getAnimation();\r
+ Collection<org.simantics.animation.stubs.Animation> animations = model.getAnimation();\r
boolean found = false;\r
- for (org.simantics.g2d.stubs.anim.Animation a : animations) {\r
+ for (org.simantics.animation.stubs.Animation a : animations) {\r
if (a.getResource().equals(animation.getResource())) {\r
found = true;\r
break;\r
ErrorLogger.getDefault().logWarning("Shape " + shape.getResource() + " cannot handle animation " + animation.getResource() + " because it isn't model's animation", null);\r
return false;\r
}\r
- Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
- List<org.simantics.g2d.stubs.anim.Interpolator> handled = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
- List<org.simantics.g2d.stubs.anim.Interpolator> precalculated = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
- for (org.simantics.g2d.stubs.anim.Interpolator i : interpolators) {\r
+ Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+ List<org.simantics.animation.stubs.Interpolator> handled = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+ List<org.simantics.animation.stubs.Interpolator> precalculated = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+ for (org.simantics.animation.stubs.Interpolator i : interpolators) {\r
IEntity target = i.getTarget();\r
if (G3DTools.hasProperty(graph,shape.getResource(),target.getResource()))\r
handled.add(i);\r
\r
this.animation = new Animation();\r
\r
- org.simantics.g2d.stubs.anim.Interpolator[] pos = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] ambient = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] diffuse = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] specular = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] emissive = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] pos = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] ambient = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] diffuse = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] specular = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] emissive = new org.simantics.animation.stubs.Interpolator[3];\r
\r
Builtins builtins = graph.getBuiltins();\r
\r
\r
- for (org.simantics.g2d.stubs.anim.Interpolator i : handled) {\r
+ for (org.simantics.animation.stubs.Interpolator i : handled) {\r
IEntity target = i.getTarget();\r
//if (target.isInstanceOf(Resources.g3dResource.LocalOrientation)) {\r
if (target.isInstanceOf(Resources.g3dResource.Orientation) && target.getRelatedObjects(Resources.g3dResource.LocalOrientationOf).size() == 1) {\r
ErrorLogger.getDefault().logWarning("Cannot map animation interpolator " + i.getResource() + " to target (Position ?)" + target.getResource(), null);\r
}\r
} else if (parent.isInstanceOf(Resources.g3dResource.Color)) {\r
- org.simantics.g2d.stubs.anim.Interpolator[] color = null;\r
+ org.simantics.animation.stubs.Interpolator[] color = null;\r
if (parent.isInstanceOf(Resources.g3dResource.Color) && parent.getRelatedObjects(Resources.g3dResource.AmbientColorOf).size() > 0) {\r
color = ambient;\r
} else if (parent.isInstanceOf(Resources.g3dResource.Color)&& parent.getRelatedObjects(Resources.g3dResource.DiffuseColorOf).size() > 0) {\r
return true;\r
}\r
\r
- private void addColorInterpolator(G3DNode shape, org.simantics.g2d.stubs.anim.Interpolator[] color, int type) {\r
+ private void addColorInterpolator(G3DNode shape, org.simantics.animation.stubs.Interpolator[] color, int type) {\r
if (color[0] != null || color[1] != null || color[2] != null) {\r
ScalarInterpolator xIp;\r
ScalarInterpolator yIp;\r