Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_shader.cpp
| Show First 20 Lines • Show All 1,235 Lines • ▼ Show 20 Lines | for (b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) { | ||||
| if (!b_id->is_a(&RNA_Material)) { | if (!b_id->is_a(&RNA_Material)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| BL::Material b_mat(*b_id); | BL::Material b_mat(*b_id); | ||||
| Shader *shader; | Shader *shader; | ||||
| /* test if we need to sync */ | /* test if we need to sync */ | ||||
| if (shader_map.add_or_update(scene, &shader, b_mat) || update_all) { | if (shader_map.add_or_update(&shader, b_mat) || update_all) { | ||||
| ShaderGraph *graph = new ShaderGraph(); | ShaderGraph *graph = new ShaderGraph(); | ||||
| shader->name = b_mat.name().c_str(); | shader->name = b_mat.name().c_str(); | ||||
| shader->pass_id = b_mat.pass_index(); | shader->pass_id = b_mat.pass_index(); | ||||
| /* create nodes */ | /* create nodes */ | ||||
| if (b_mat.use_nodes() && b_mat.node_tree()) { | if (b_mat.use_nodes() && b_mat.node_tree()) { | ||||
| BL::ShaderNodeTree b_ntree(b_mat.node_tree()); | BL::ShaderNodeTree b_ntree(b_mat.node_tree()); | ||||
| ▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | for (b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) { | ||||
| if (!b_id->is_a(&RNA_Light)) { | if (!b_id->is_a(&RNA_Light)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| BL::Light b_light(*b_id); | BL::Light b_light(*b_id); | ||||
| Shader *shader; | Shader *shader; | ||||
| /* test if we need to sync */ | /* test if we need to sync */ | ||||
| if (shader_map.add_or_update(scene, &shader, b_light) || update_all) { | if (shader_map.add_or_update(&shader, b_light) || update_all) { | ||||
| ShaderGraph *graph = new ShaderGraph(); | ShaderGraph *graph = new ShaderGraph(); | ||||
| /* create nodes */ | /* create nodes */ | ||||
| if (b_light.use_nodes() && b_light.node_tree()) { | if (b_light.use_nodes() && b_light.node_tree()) { | ||||
| shader->name = b_light.name().c_str(); | shader->name = b_light.name().c_str(); | ||||
| BL::ShaderNodeTree b_ntree(b_light.node_tree()); | BL::ShaderNodeTree b_ntree(b_light.node_tree()); | ||||
| Show All 37 Lines | |||||