=== SceneInspector anchor:interface_sceneInspector[] The *SceneInspector* provides an interface for viewing and comparing the properties of specific items in the scene graph. These properties are the *attributes* created and modified by nodes in the node graph. Examples of properties that can be examined in the SceneInspector include bounding boxes, primitive variables, shader assignment, and object type. //// !!!SECOND SENTENCE - Are they really?? some are, but what about BB?? probably can be stated better!!! //// In addition the SceneInspector allows for the properties of the *globals* to be viewed. These properties do not belong to specific locations in the scene graph, but instead exist independent of the scene contents. Examples of global properties include render camera, resolution and motion blur settings, along with renderer specific options. When viewing properties in the SceneInspector, we are seeing a snapshot of what attributes exist and what values they have. This snapshot is defined by the processing applied by the specified node and by all the nodes connected upstream of it. It is important to grasp that the properties you are viewing can and likely will be different at different locations in the node graph. If you were to inspect a node upstream of your current selection, attributes may not exist yet or may have values that are changed at some point further down the graph. To help clarify, consider this usage example for the SceneInspector: * We have a script where we have set up a ShaderAssignment node. This node should be applying a red plastic material to an object in the scene, ballA. .The basic setup of our Gaffer session. Coming out of the "Group" node we have a scene containing "ballA" and "ballB". The two ShaderAssignment/PathFilter combos should be assinging the right shaders. image::images/autoGenerated_target/interface_sceneInspector_figAA.png[align="center"] * When we render the scene ballA is showing up green. This is not intended and it appears that it is picking up the shader destined for a different object, ballB. .Both balls appear to be picking up the same green shader. image::images/autoGenerated_target/interface_sceneInspector_figBA.png[align="center"] * If we use the SceneInspector to view the state of ballA at the first shader assignment we can see that the correct shader is infact assigned. .With "ShaderAssignmentA" active and ballA selected we can see it's properties. !!!NOTE shader:label is wrong. Requires #335!!! image::images/autoGenerated_target/interface_sceneInspector_figCA.png[align="center"] * However if we look further down the node graph and inspect the state at the second shader assignment node its clear that the earlier assignment is being overridden. The original value of the shader attribute is being changed to instead point at greenPlastic .Still looking at ballA but with "ShaderAssignementB" active !!!NOTE shader:label is wrong. Requires #335!!! image::images/autoGenerated_target/interface_sceneInspector_figDA.png[align="center"] * By then checking the properties at the node feeding immediately into the second shader assignment we can see that the shader value was correct just prior to ShaderAssignementB. This indicates that the mistake has been made in ShaderAssignementB and this is where we should look to fix the problem. .Everything looks ok when we inspect "CustomAttributes", so the problem must occur in the next node of the chain. !!!NOTE shader:label is wrong. Requires #335!!! image::images/autoGenerated_target/interface_sceneInspector_figEA.png[align="center"] * In this example, the problem was an incorrect path filter expression which is easily fixed. However, without the SceneInspector it may have been tricky to track down the root cause of the error, with the user having to fall back on trial and error testing to isolate the culpable node. ==== How to use the SceneInspector anchor:interface_howToUserTheSceneInspector[] To start, simply select a node from the NodeGraph then pick either one or two scene items. This item selection can be done from within either the 3D Viewer or the SceneHierarchy editor. In the case where you select just one item from the scene, the SceneInspector will display the properties of that single item. However, if you pick two items the SceneInspector will highlight the differences between them. Properties and/or values unique to the first item selected will be highlighted red, and those unique to the second item highlighted green. .!!!SCREEN GRAB OF SCENEINSPECTOR INTERFACE SHOWING SINGLE ITEM !!! image::images/placeHolder.png[align="center"] .!!!SCREEN GRAB OF SCENEINSPECTOR INTERFACE SHOWING TWO COMPARED ITEMS !!! image::images/placeHolder.png[align="center"] To aid the kind of scene debugging shown in the previous section (where you wish to compare different points in the node graph), the SceneInspector has an additional feature which enables users to display the property state of two nodes simultaneously. Simply select two nodes from any point in the graph with the SceneInspector is un-pinned, then pick a single scene graph item. [NOTE] In this mode the SceneInspector can only display the properties of a single scene graph location, so multiple item selection will not work. The SceneInspector will list the properties of the selected item indicating any that have been added, removed, or modified by the second node. * As when comparing two items, additions are shown highlighted in green. .!!!SCREEN GRAB OF SCENEINSPECTOR INTERFACE SHOWING SINGLE ADDED ATTRIBUTE !!! image::images/placeHolder.png[align="center"] * Similarly, if a property has been modified the old value is shown highlighted in red and the new value in green. .!!!SCREEN GRAB OF SCENEINSPECTOR INTERFACE SHOWING SINGLE MODIFIED ATTRIBUTE !!! image::images/placeHolder.png[align="center"]