1#usda 1.0 2( 3 "This file describes the USD Shader schemata for code generation." 4 subLayers = [ 5 @usd/schema.usda@ 6 ] 7) 8 9over "GLOBAL" ( 10 customData = { 11 string libraryName = "usdUI" 12 string libraryPath = "pxr/usd/usdUI" 13 # dictionary libraryTokens = {} 14 } 15) 16{ 17} 18 19class "NodeGraphNodeAPI"( 20 inherits = </APISchemaBase> 21 doc = """ 22 This api helps storing information about nodes in node graphs. 23 """ 24) { 25 uniform float2 ui:nodegraph:node:pos ( 26 doc = """ 27 Declared relative position to the parent in a node graph. 28 X is the horizontal position. 29 Y is the vertical position. Higher numbers correspond to lower positions 30 (coordinates are Qt style, not cartesian). 31 32 These positions are not explicitly meant in pixel space, but rather 33 assume that the size of a node is approximately 1.0x1.0. Where size-x is 34 the node width and size-y height of the node. Depending on 35 graph UI implementation, the size of a node may vary in each direction. 36 37 Example: If a node's width is 300 and it is position is at 1000, we 38 store for x-position: 1000 * (1.0/300) 39 """ 40 customData = { 41 string apiName = "pos" 42 } 43 ) 44 45 uniform int ui:nodegraph:node:stackingOrder ( 46 doc = """ 47 This optional value is a useful hint when an application cares about 48 the visibility of a node and whether each node overlaps another. 49 50 Nodes with lower stacking order values are meant to be drawn below 51 higher ones. Negative values are meant as background. Positive values 52 are meant as foreground. 53 Undefined values should be treated as 0. 54 55 There are no set limits in these values. 56 """ 57 customData = { 58 string apiName = "stackingOrder" 59 } 60 ) 61 62 uniform color3f ui:nodegraph:node:displayColor ( 63 doc = """ 64 This hint defines what tint the node should have in the node graph. 65 """ 66 customData = { 67 string apiName = "displayColor" 68 } 69 ) 70 71 uniform asset ui:nodegraph:node:icon ( 72 doc = """ 73 This points to an image that should be displayed on the node. It is 74 intended to be useful for summary visual classification of nodes, rather 75 than a thumbnail preview of the computed result of the node in some 76 computational system. 77 """ 78 customData = { 79 string apiName = "icon" 80 } 81 ) 82 83 uniform token ui:nodegraph:node:expansionState ( 84 allowedTokens = ["open", "closed", "minimized"] 85 doc = """ 86 The current expansionState of the node in the ui. 87 'open' = fully expanded 88 'closed' = fully collapsed 89 'minimized' = should take the least space possible 90 """ 91 customData = { 92 string apiName = "expansionState" 93 } 94 ) 95 96 uniform float2 ui:nodegraph:node:size ( 97 doc = """ 98 Optional size hint for a node in a node graph. 99 X is the width. 100 Y is the height. 101 102 This value is optional, because node size is often determined 103 based on the number of in- and outputs of a node. 104 """ 105 customData = { 106 string apiName = "size" 107 } 108 ) 109} 110 111 112class "SceneGraphPrimAPI"( 113 inherits = </APISchemaBase> 114 doc = """ 115 Utility schema for display properties of a prim 116 """ 117) { 118 uniform token ui:displayName ( 119 doc = """When publishing a nodegraph or a material, it can be useful to 120 provide an optional display name, for readability. 121 """ 122 customData = { 123 string apiName = "displayName" 124 } 125 ) 126 uniform token ui:displayGroup ( 127 doc = """When publishing a nodegraph or a material, it can be useful to 128 provide an optional display group, for organizational purposes and 129 readability. This is because often the usd shading hierarchy is rather 130 flat while we want to display it in organized groups. 131 """ 132 customData = { 133 string apiName = "displayGroup" 134 } 135 ) 136} 137 138class Backdrop "Backdrop" ( 139 inherits = </Typed> 140 doc = """Provides a 'group-box' for the purpose of node graph organization. 141 142 Unlike containers, backdrops do not store the Shader nodes inside of them. 143 Backdrops are an organizational tool that allows Shader nodes to be visually 144 grouped together in a node-graph UI, but there is no direct relationship 145 between a Shader node and a Backdrop. 146 147 The guideline for a node-graph UI is that a Shader node is considered part 148 of a Backdrop when the Backdrop is the smallest Backdrop a Shader node's 149 bounding-box fits inside. 150 151 Backdrop objects are contained inside a NodeGraph, similar to how Shader 152 objects are contained inside a NodeGraph. 153 154 Backdrops have no shading inputs or outputs that influence the rendered 155 results of a NodeGraph. Therefore they can be safely ignored during import. 156 157 Like Shaders and NodeGraphs, Backdrops subscribe to the NodeGraphNodeAPI to 158 specify position and size. 159 """ 160) 161{ 162 uniform token ui:description ( 163 doc = """The text label that is displayed on the backdrop in the node 164 graph. This help-description explains what the nodes in a backdrop do. 165 """ 166 customData = { 167 string apiName = "description" 168 } 169 ) 170} 171 172