If you want to create a material asset with an embedded image, use the following expression to source the image:
opdef:`pythonexprs(“hou.pwd().type().nameWithCategory()”)`?image.jpg
…and remember to include/embed the image file into the “extras” tab of the type properties window for your asset.
That's it!
Creating material assets? Use this expression.
6076 4 2- compositor
- Member
- 237 posts
- Joined: April 2011
- Offline
- pbowmar
- Member
- 7025 posts
- Joined: July 2005
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
It used to work, still does. And then operator namespaces came along in H12.0 that makes this ambiguous if you are using namespaces to run two nodes with the same name/definition in the same scene:
http://www.sidefx.com/docs/houdini12.1/assets/namespaces [sidefx.com]
http://www.sidefx.com/docs/houdini12.1/assets/namespaces [sidefx.com]
There's at least one school like the old school!
- pbowmar
- Member
- 7025 posts
- Joined: July 2005
- Offline
OK good! I presume opdef:. will return the fully qualified name of the HDA? I can't imagine a situation where you'd want anything except pulling the script from the current definition. So if you have two versions, each would have their own script that would be referred to. Anything else would result in debugging madness
Cheers,
Peter B
Cheers,
Peter B
- AdamJ
- Member
- 268 posts
- Joined: July 2005
- Offline
The opdef in conjunction with images in shaders is currently experiencing issues (logged). It should work when used in other fields like file sops. The python expression is one way to get it to work; another is to use ‘optypeinfo’. Additional flag has been added to it to return fully namespaced optype name with the ‘o’ option.
opdef:`optypeinfo(“.”,“o”)`?image.jpg
opdef:`optypeinfo(“.”,“o”)`?image.jpg
-
- Quick Links