SVN merge r57320-57365 into soc-2013-dingto
authorThomas Dinges <blender@dingto.org>
Mon, 10 Jun 2013 21:16:29 +0000 (21:16 +0000)
committerThomas Dinges <blender@dingto.org>
Mon, 10 Jun 2013 21:16:29 +0000 (21:16 +0000)
1  2 
intern/cycles/blender/blender_shader.cpp

index fc388f4bbef14a05f9ce319f187fd919c0eeead6,a5fe5dbf12f494744e95ea9672a05166c1a927b5..a9db10b21d77d426a9f6f8f526c1c54d6e51112b
@@@ -397,9 -397,6 +397,9 @@@ static ShaderNode *add_node(Scene *scen
                wire->use_pixel_size = b_wireframe_node.use_pixel_size();
                node = wire;
        }
 +      else if (b_node.is_a(&RNA_ShaderNodeWavelength)) {
 +              node = new WavelengthNode();
 +      }
        else if (b_node.is_a(&RNA_ShaderNodeLightPath)) {
                node = new LightPathNode();
        }
@@@ -708,10 -705,13 +708,13 @@@ static void add_nodes(Scene *scene, BL:
                                graph->add(proxy);
                        }
                }
-               else if (b_node->is_a(&RNA_ShaderNodeGroup)) {
+               else if (b_node->is_a(&RNA_ShaderNodeGroup) || b_node->is_a(&RNA_NodeCustomGroup)) {
                        
-                       BL::NodeGroup b_gnode(*b_node);
-                       BL::ShaderNodeTree b_group_ntree(b_gnode.node_tree());
+                       BL::ShaderNodeTree b_group_ntree(PointerRNA_NULL);
+                       if (b_node->is_a(&RNA_ShaderNodeGroup))
+                               b_group_ntree = BL::ShaderNodeTree(((BL::NodeGroup)(*b_node)).node_tree());
+                       else
+                               b_group_ntree = BL::ShaderNodeTree(((BL::NodeCustomGroup)(*b_node)).node_tree());
                        ProxyMap group_proxy_input_map, group_proxy_output_map;
                        
                        /* Add a proxy node for each socket
@@@ -895,8 -895,8 +898,8 @@@ void BlenderSync::sync_world(bool updat
                        graph->connect(closure->output("Background"), out->input("Surface"));
                }
  
-               /* AO */
                if(b_world) {
+                       /* AO */
                        BL::WorldLighting b_light = b_world.light_settings();
  
                        if(b_light.use_ambient_occlusion())
                                background->ao_factor = 0.0f;
  
                        background->ao_distance = b_light.distance();
+                       /* visibility */
+                       PointerRNA cvisibility = RNA_pointer_get(&b_world.ptr, "cycles_visibility");
+                       uint visibility = 0;
+                       visibility |= get_boolean(cvisibility, "camera")? PATH_RAY_CAMERA: 0;
+                       visibility |= get_boolean(cvisibility, "diffuse")? PATH_RAY_DIFFUSE: 0;
+                       visibility |= get_boolean(cvisibility, "glossy")? PATH_RAY_GLOSSY: 0;
+                       visibility |= get_boolean(cvisibility, "transmission")? PATH_RAY_TRANSMIT: 0;
+                       background->visibility = visibility;
                }
  
                shader->set_graph(graph);