/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.g3d.animation.ScalarInterpolator;\r
import org.simantics.proconf.g3d.animation.SlerpInterpolator;\r
import org.simantics.proconf.g3d.animation.TCBInterpolator;\r
+import org.simantics.proconf.g3d.base.AppearanceProvider;\r
+import org.simantics.proconf.g3d.base.AppearanceProviderRegistry;\r
import org.simantics.proconf.g3d.base.AppearanceTools;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.GeometryProvider;\r
\r
\r
G3DNode shape = getG3DNode(graph);\r
- if (renderStates == null)\r
+ //if (renderStates == null)\r
updateAppearance(shape);\r
\r
if (isVisible()) {\r
}\r
\r
protected void updateAppearance(IEntity shape) {\r
- Collection<IEntity> appearanceResource;\r
- if ((appearanceResource = shape.getRelatedObjects(Resources.g3dResource.HasAppearance)) != null && appearanceResource.size() > 0) {\r
- renderStates = AppearanceTools.getAppearance(new Appearance(shape.getGraph(),appearanceResource.iterator().next().getResource()), editor.getRenderingComponent().getDisplaySystem().getRenderer());\r
+ AppearanceProvider provider = AppearanceProviderRegistry.getAppearanceProvider(shape);\r
+ if (provider != null) {\r
+ renderStates = provider.getAppearanceFromResource(shape, editor.getRenderingComponent().getDisplaySystem().getRenderer());\r
} else {\r
renderStates = getMaterial();\r
}\r