Search - User list
Full Version: Creating material assets? Use this expression.
Root » The Orbolt Smart 3D Asset Store » Creating material assets? Use this expression.
compositor
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!
pbowmar
You used to be able to do:

opdef:.?image.jpg

Does that no longer work? Python is great, except when you end up with this type of thing

Cheers,

Peter B
old_school
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]
pbowmar
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
AdamJ
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB