Limiting nodes within an material shader hda
1408 1 0- ettylka
- Member
- 9 posts
- Joined: 12月 2009
- Offline
- rafal
- スタッフ
- 1455 posts
- Joined: 7月 2005
- Offline
There are some mechanisms for filtering nodes inside a parent node. For VOPs, the standard way to achieve it is thru their "render mask" and "vopnet mask". Render mask roughly corresponds to the shader language (eg, RIS vs. VEX), while vopnet mask allows further filtering within the same language (eg, "surface" vs "displacement" vs "cvex" kind of shader networks).
The VOPs "render mask" is used in conjunction with settings in Edit > Preferences > Rendering, but I don't think that's what you are enquiring about, so won't pursue it here.
On the other hand, Pixar's "pxrmaterialbuilder" is implemented in C++ HDK, and most likely uses vopnet mask to filter the VOPs. In HDK, you can use `OP_OperatorFilter` class to filter VOPs. There is an example in `$HFS/toolkit/samples/VOP/VOP_CustomContext.C` that illustrates this. In your `allowOperatorAsChild()` you can do something like this
```VOP_OperatorInfo *info = dynamic_cast<VOP_OperatorInfo *>(op->getOpSpecificData());
return info->getVopnetMask() = "my_special_keyword";```
The VOPs "render mask" is used in conjunction with settings in Edit > Preferences > Rendering, but I don't think that's what you are enquiring about, so won't pursue it here.
On the other hand, Pixar's "pxrmaterialbuilder" is implemented in C++ HDK, and most likely uses vopnet mask to filter the VOPs. In HDK, you can use `OP_OperatorFilter` class to filter VOPs. There is an example in `$HFS/toolkit/samples/VOP/VOP_CustomContext.C` that illustrates this. In your `allowOperatorAsChild()` you can do something like this
```VOP_OperatorInfo *info = dynamic_cast<VOP_OperatorInfo *>(op->getOpSpecificData());
return info->getVopnetMask() = "my_special_keyword";```
-
- Quick Links