If you are using the network to compute material assignments, create a single Parameter VOP at the end of the network to represent the “return” value. If you are assigning to parameters to override material attributes, remember to set the Parameter VOP’s Export parameter to “Always” or “When input is connected”. If the Assign Material node is creating bindings, you can add corresponding Parameter VOPs in this network to represent the bound VEX variables. This provides the basic inputs ( primpath, elemnum, and numelem). If you are doing multiple assignments in the Assign Material node, using multiple CVEX networks, they must each have unique names.ĭive inside the CVEX Builder node and put down a USD Global Parameters node. Rename the CVEX Builder with a memorable name based on what the network will do (for example, material_assignment). Dive inside, press ⇥ Tab and create a CVEX Shader Builder network node. The most convenient place to create the CVEX VOP network is inside the Assign Material node itself (it contains a VEX Builder network). Set either Specify material using or Parameters override to “CVEX”. Unless you need a very elaborate VOP network to do the computation, or want to re-use some existing VOPs, writing a VEX snippet is much easier. As detailed below, CVEX networks require multiple steps to set up. We strongly encourage you to use VEXpressions instead of CVEX VOP networks. The snippet must return a string containing the material path to assign to the current primitive.įor example, this snippet alternates between assigning rough_red and rough_blue based on whether a primitive is at an odd or even position in the list of selected primitives: (If you don’t want to or can’t use autobinding, you can manually set up individual mappings between parameter names and VEX variable names using the multiparm under “CVEX Bindings”.) This allows you to assign different materials based on a primitive’s attribute values. The path of the current primitive is available as The index of the current primitive is available as the total number of selected primitives is available as “CVEX Bindings”, when Autobind by name is on (the default), each attribute on the current primitive is available as a VEX variable of the same name. The snippet is run once for each selected primitive. In the VEXpression box, enter a VEX snippet to compute the material to assign to each primitive. Set Specify material using to “VEXpression”. You can also use primitive patterns for advanced matching. You can click the select button beside the text box to choose the primitives from the scene graph tree. In the Primitives parameter, specify the primitive(s) you want to assign the material to. You can click the select button beside the text box to choose the material from the scene graph tree.Īssign computed materials using VEX (advanced) Set Material path to the path of the USD material you want to assign. Set Specify material using to “Explicit path”. If you assign a material to all prims in a collection, you probably also want to set the Method (under “Material Binding”) to “Collection based”, so the node assigns the material to the collection itself, rather than individually to each prim currently in the collection.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |