Examples of OgreMaterialKey


Examples of com.jme3.scene.plugins.ogre.matext.OgreMaterialKey

            if (materialList == null || materialList.isEmpty()) {
                // NOTE: No materials were found by searching the externals section.
                // Try finding a similarly named material file in the same folder.
                // (Backward compatibility only!)
                OgreMaterialKey materialKey = new OgreMaterialKey(sceneName + ".material");
                try {
                    materialList = (MaterialList) assetManager.loadAsset(materialKey);
                } catch (AssetNotFoundException ex) {
                    logger.log(Level.WARNING, "Cannot locate {0} for scene {1}", new Object[]{materialKey, key});
                    materialList = null;
View Full Code Here

Examples of com.jme3.scene.plugins.ogre.matext.OgreMaterialKey

            if (!ignoreItem) {
                String materialPath = attribs.getValue("name");
                String materialName = new File(materialPath).getName();
                String matFile = folderName + materialName;
                try {
                    MaterialList loadedMaterialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(matFile));
                    materialList.putAll(loadedMaterialList);
                } catch (AssetNotFoundException ex) {
                    logger.log(Level.WARNING, "Cannot locate material file: {0}", matFile);
                }
            }
View Full Code Here

Examples of com.jme3.scene.plugins.ogre.matext.OgreMaterialKey

                materialList = meshKey.getMaterialList();
                String materialName = meshKey.getMaterialName();

                // Material list not set but material name is available
                if (materialList == null && materialName != null) {
                    OgreMaterialKey materialKey = new OgreMaterialKey(folderName + materialName + ".material");
                    try {
                        materialList = (MaterialList) assetManager.loadAsset(materialKey);
                    } catch (AssetNotFoundException e) {
                        logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{materialKey, key});
                    }
                }
            } else {
                // Make sure to reset it to null so that previous state
                // doesn't leak onto this one
                materialList = null;
            }

            // If for some reason material list could not be found through
            // OgreMeshKey, or if regular ModelKey specified, load using
            // default method.
            if (materialList == null) {
                OgreMaterialKey materialKey = new OgreMaterialKey(folderName + meshName + ".material");
                try {
                    materialList = (MaterialList) assetManager.loadAsset(materialKey);
                } catch (AssetNotFoundException e) {
                    logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{materialKey, key});
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.