Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/collada/Materials.cpp
| Show All 19 Lines | MaterialNode::MaterialNode(bContext *C, Material *ma, KeyImageMap &key_image_map) | ||||
| : mContext(C), material(ma), effect(nullptr), key_image_map(&key_image_map) | : mContext(C), material(ma), effect(nullptr), key_image_map(&key_image_map) | ||||
| { | { | ||||
| bNodeTree *new_ntree = prepare_material_nodetree(); | bNodeTree *new_ntree = prepare_material_nodetree(); | ||||
| setShaderType(); | setShaderType(); | ||||
| if (new_ntree) { | if (new_ntree) { | ||||
| shader_node = add_node(SH_NODE_BSDF_PRINCIPLED, 0, 300, ""); | shader_node = add_node(SH_NODE_BSDF_PRINCIPLED, 0, 300, ""); | ||||
| output_node = add_node(SH_NODE_OUTPUT_MATERIAL, 300, 300, ""); | output_node = add_node(SH_NODE_OUTPUT_MATERIAL, 300, 300, ""); | ||||
| add_link(shader_node, 0, output_node, 0); | add_link(shader_node, 0, output_node, 0); | ||||
| ntreeUpdateTree(CTX_data_main(C), ntree); | |||||
| } | } | ||||
| } | } | ||||
| MaterialNode::MaterialNode(bContext *C, | MaterialNode::MaterialNode(bContext *C, | ||||
| COLLADAFW::EffectCommon *ef, | COLLADAFW::EffectCommon *ef, | ||||
| Material *ma, | Material *ma, | ||||
| UidImageMap &uid_image_map) | UidImageMap &uid_image_map) | ||||
| : mContext(C), material(ma), effect(ef), uid_image_map(&uid_image_map) | : mContext(C), material(ma), effect(ef), uid_image_map(&uid_image_map) | ||||
| Show All 18 Lines | #if 0 | ||||
| add_link(ntree, nmap["mix"], 0, nmap["out"], 0); | add_link(ntree, nmap["mix"], 0, nmap["out"], 0); | ||||
| /* experimental, probably not used. */ | /* experimental, probably not used. */ | ||||
| make_group(C, ntree, nmap); | make_group(C, ntree, nmap); | ||||
| #else | #else | ||||
| shader_node = add_node(SH_NODE_BSDF_PRINCIPLED, 0, 300, ""); | shader_node = add_node(SH_NODE_BSDF_PRINCIPLED, 0, 300, ""); | ||||
| output_node = add_node(SH_NODE_OUTPUT_MATERIAL, 300, 300, ""); | output_node = add_node(SH_NODE_OUTPUT_MATERIAL, 300, 300, ""); | ||||
| add_link(shader_node, 0, output_node, 0); | add_link(shader_node, 0, output_node, 0); | ||||
| ntreeUpdateTree(CTX_data_main(C), ntree); | |||||
| #endif | #endif | ||||
| } | } | ||||
| void MaterialNode::setShaderType() | void MaterialNode::setShaderType() | ||||
| { | { | ||||
| #if 0 | #if 0 | ||||
| COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType(); | COLLADAFW::EffectCommon::ShaderType shader = ef->getShaderType(); | ||||
| /* Currently we only support PBR based shaders */ | /* Currently we only support PBR based shaders */ | ||||
| ▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines | |||||