/** * replaces a variable name in a shaderNode source code by prefixing it * with its nameSpace and "_" if needed. * @param nodeSource the source to modify * @param var the variable to replace * @return the modified source */ protected String replaceVariableName(String nodeSource, ShaderNodeVariable var) { String namePrefix = getAppendableNameSpace(var); String newName = namePrefix + var.getName(); nodeSource = replace(nodeSource, var, newName); return nodeSource; }
String namePrefix = getAppendableNameSpace(rightVariable); source.append(namePrefix); source.append(rightVariable.getPrefix());
/** * replaces a variable name in a shaderNode source code by prefixing it * with its nameSpace and "_" if needed. * @param nodeSource the source to modify * @param var the variable to replace * @return the modified source */ protected String replaceVariableName(String nodeSource, ShaderNodeVariable var) { String namePrefix = getAppendableNameSpace(var); String newName = namePrefix + var.getName(); nodeSource = replace(nodeSource, var, newName); return nodeSource; }
String namePrefix = getAppendableNameSpace(mapping.getRightVariable()); source.append(namePrefix); source.append(mapping.getRightVariable().getPrefix());