当前位置: 首页>>代码示例>>Java>>正文


Java MatParam.getName方法代码示例

本文整理汇总了Java中com.jme3.material.MatParam.getName方法的典型用法代码示例。如果您正苦于以下问题:Java MatParam.getName方法的具体用法?Java MatParam.getName怎么用?Java MatParam.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.material.MatParam的用法示例。


在下文中一共展示了MatParam.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
 * Convert the material parameter to editable property.
 *
 * @param param    the material parameter.
 * @param material the material.
 * @return the editable property or null.
 */
@FXThread
private @Nullable EditableProperty<?, Material> convert(@NotNull final MatParam param,
                                                        @NotNull final Material material) {

    final EditablePropertyType propertyType = convert(param.getVarType());
    if (propertyType == null) {
        return null;
    }

    return new SimpleProperty<>(propertyType, param.getName(), 0.1F, material,
            object -> getParamValue(param, object),
            (object, newValue) -> applyParam(param, object, newValue));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:21,代码来源:MaterialPropertyBuilder.java

示例2: convert

import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
 * Convert the material parameter to an editable property.
 *
 * @param param    the material parameter.
 * @param material the material.
 * @param settings the settings.
 * @return the editable property or null.
 */
@FXThread
private @Nullable EditableProperty<?, ?> convert(@NotNull final MatParam param, @NotNull final Material material,
                                                 @NotNull final MaterialSettings settings) {

    final EditablePropertyType propertyType = convert(param.getVarType());
    if (propertyType == null) {
        return null;
    }

    return new SimpleProperty<>(propertyType, param.getName(), 0.1F, settings,
            object -> getParamValue(param, material),
            (object, newValue) -> applyParam(param, material, newValue));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:MaterialSettingsPropertyBuilder.java

示例3: MaterialProperty

import com.jme3.material.MatParam; //导入方法依赖的package包/类
public MaterialProperty(MatParam param) {
    this.type = param.getVarType().name();
    this.name = param.getName();
    if (param.getValue() != null) {
        try {
            this.value = param.getValueAsString();
        } catch (UnsupportedOperationException e) {
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:11,代码来源:MaterialProperty.java

示例4: findMaterialParamName

import com.jme3.material.MatParam; //导入方法依赖的package包/类
public String findMaterialParamName(String[] names, VarType type, MaterialDef scope) {
	for(String name2:names){
		for(MatParam mp:scope.getMaterialParams()){
			if(mp.getVarType()==type&&mp.getName().equalsIgnoreCase(name2)){ return mp.getName(); }
		}
	}
	return null;
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:9,代码来源:MaterialsMerger.java

示例5: checkPackedTextureProps

import com.jme3.material.MatParam; //导入方法依赖的package包/类
/**
 * Prompts user to save packed textures
 *
 * @param mat
 * @param param
 */
private void checkPackedTextureProps(Material mat) {
    Collection<MatParam> params = mat.getParams();
    for (Iterator<MatParam> it = new ArrayList<MatParam>(params).iterator(); it.hasNext();) {
        MatParam param = it.next();
        MaterialProperty prop = new MaterialProperty(param);
        if (prop.getValue() == null) {
            switch (param.getVarType()) {
                case Texture2D:
                case Texture3D:
                case TextureArray:
                case TextureBuffer:
                case TextureCubeMap:
                    try {
                        MatParamTexture texParam = mat.getTextureParam(param.getName());
                        Texture tex = texParam.getTextureValue();
                        Image img = tex.getImage();
                        if (img == null) {
                            logger.log(Level.INFO, "No image found");
                            return;
                        }
                        BufferedImage image = ImageToAwt.convert(img, false, false, 0);
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageWriter imgWrtr = ImageIO.getImageWritersByFormatName("png").next();
                        ImageOutputStream imgOutStrm;
                        imgOutStrm = ImageIO.createImageOutputStream(out);
                        imgWrtr.setOutput(imgOutStrm);
                        ImageWriteParam jpgWrtPrm = imgWrtr.getDefaultWriteParam();
                        imgWrtr.write(null, new IIOImage(image, null, null), jpgWrtPrm);
                        imgOutStrm.close();
                        out.close();
                        String texturePath = material.getName();
                        texturePath = "Textures/" + texturePath + "-" + param.getName() + ".png";
                        StoreTextureWizardWizardAction act = new StoreTextureWizardWizardAction(manager, out.toByteArray(), texturePath);
                        act.actionPerformed(null);
                        texturePath = act.getName();
                        TextureKey texKey = new TextureKey(texturePath);
                        TextureKey oldKey = (TextureKey)tex.getKey();
                        if(oldKey!=null){
                            Beans.copyProperties(texKey, oldKey);
                        }
                        //TODO: seems like flip is removed due to ImageToAwt
                        texKey.setFlipY(false);
                        Texture texture = manager.loadTexture(texKey);
                        MatParamTexture newParam = new MatParamTexture(texParam.getVarType(), texParam.getName(), texture, null);
                        materialParameters.put(newParam.getName(), new MaterialProperty(newParam));
                    } catch (Exception ex) {
                        Exceptions.printStackTrace(ex);
                    }
                    break;
                default:
            }
        } else {
            materialParameters.put(param.getName(), prop);
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:63,代码来源:EditableMaterialFile.java

示例6: MaterialProperty

import com.jme3.material.MatParam; //导入方法依赖的package包/类
public MaterialProperty(MatParam param) {
    this.type = param.getVarType().name();
    this.name = param.getName();
    Object obj = param.getValue();
    this.value = param.getValueAsString();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:7,代码来源:MaterialProperty.java


注:本文中的com.jme3.material.MatParam.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。