Jump to content

Embedding Textures in OTLs


Recommended Posts

Hey guys, I'm new to using digital assets and would like to create one with an embedded image file to use in the shader but have not been able to figure out how to do so. I have seen people mention using opdef, and the documentation suggested it, but I am not clear on exactly how the syntax works. If someone could please give me a pointer to somewhere with a detailed description of how to reference embedded textures, that would be great. Particularly, when the documentation discusses the section, what does that mean? In case it matters I am trying to embed a .png file.

Thanks

Link to comment
Share on other sites

let's assume you have created the asset already and you are in Edit Operator Type Properties

go to Extra Files tab

on bottom left pick file you want to embed and fill in section name (this will be the section you are asking about and you will use this name to access the file)

then just click Add File to embed it

then to access it just use

opdef:/Network_type/asset_name?section[/CODE]

so if your asset is Sop type and you gave it a name my_hda and you've embedded image.png but named the section e.g. my_image then it will be

[size=4]

[CODE]opdef:/Sop/my_hda?my_image[/CODE]

[/size]

[size=4]or you can as well use relative path to some instance of the asset instead of it's type[/size]

[size=4]so if you are using it directly on some parm on your asset then you can just enter[/size]

[size=4]

[CODE]opdef:.?my_image[/CODE]

[/size]

[size=4]or if its on some node one level below(inside) your asset then[/size]

[size=4]

[CODE]opdef:..?my_image[/CODE]

[/size]

[size=4]etc[/size]

  • Like 2
Link to comment
Share on other sites

Thomas,

Does the above mean that, when all is said and done, this digital asset will forever contain the image file and the digital asset can be passed around without ever having to manage a seperate texture file?

What else can you embed into a DA in this manner? Could you include a point cloud file for example? Is there something I could not permanantly embed into the DA?

Thank you.

Edited by barad_dur
Link to comment
Share on other sites

Thomas,

Does the above mean that, when all is said and done, this digital asset will forever contain the image file and the digital asset can be passed around without ever having to manage a seperate texture file?

Yes. Unless you open up the asset and remove the section file.

What else can you embed into a DA in this manner? Could you include a point cloud file for example? Is there something I could not permanantly embed into the DA?

Any file on your file system can be embedded in to your HDA.

Yes you can embed a point cloud as either a .bgeo for SOPs or a .pc file for tiled lookups for shading/rendering.

Texture maps, text files, parameter dialogs, any hscript cmd files that you wish to carry along with the asset executed with call-back scripts (the way it was done before the internal python module was added), svg icon or bitmap for your asset icon, etc.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...