Path for embedded image in DA

   4651   6   1
User Avatar
Member
85 posts
Joined: June 2015
Offline
Hello all,

I'm struggling to find the right path for a embedded image in a digital-asset.
According the help file the following should be applied: opdefNetwork_type/asset_name?section_name

So in my case I have a digital asset: ColorTest, inside it is a cube and a SHOP net called Materials which contains a Material Shader Builder called TestVop.

The way I understand it is that the path should be:
opdefSHOP/Materials/DancerLargeBG.jpg
or maybe more likely:
opdefSubnetwork/ColorTest/DancerLargeBG.jpg

I tried many different variations to no avail, also embedded the variations in:
texture(“………”) like suggested in the helpfile.

I once succeeded with a relative path (that I cannot reproduce) it would render in the original file but brought back in, in Houdini or C4D it would fail to load the image.

Ofcourse the image got embedded in the type property's window
:wink:

Many thanks, Robert
Houdini, Cinema4D, 3Dcoat, Marvelous Designer
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
RMB on your asset and select Type Properties
on the last TAB - Extra Files
make sure that the image file is listed
if not you can add it at the bottom left:
browse for the file and select Add File
click Apply or Accept

once the file is there you can access it using the syntax from the help
opdefNetwork_type/asset_name?section_name

the simplest way to do this is to use a file browser
inside your asset
put down a SHOPNET
inside put down a Principled Shader
turn on Base Color > Use Texture
now click the File Chooser
at the top on the left you'll see some short cuts:
Home Folder
Desktop
opdef
/
/bla/bla

click on opdef
now click on the network_type
this will be Object in your case
then scroll down the list until you see ColorTest
now you should see the files listed in the Extra Files section
select one and now you 'll have your path


HTH
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
85 posts
Joined: June 2015
Offline
Oh great thanks a lot Michael,

That solved part of the problem, but not all :wink:

The aim of this little expedition was to try and bring in color and bitmap into C4D as a material. Although the DigitalAsset does create a material it does not produce either color or a bitmap.

So there is still a step missing I guess.

Thanks for helping.
Regards, Robert
Houdini, Cinema4D, 3Dcoat, Marvelous Designer
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
can you attach your hda and image - or a simple example?
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
85 posts
Joined: June 2015
Offline
With pleasure

Attachments:
CtoC4d2.hdalc (91.6 KB)

Houdini, Cinema4D, 3Dcoat, Marvelous Designer
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
ah ha!
now I remember
from the docs:
Specifying files inside an asset using opdef:

You can embed files inside the digital asset, using the Extra files tab in the Type properties window.

In parameters where you can specify a file path, you can use the following syntax to instead specify the content of a section inside an asset:

opdefNetwork_type/asset_name?section_name

You can use this to include all the files an asset needs (such as textures) in the asset itself.

For example:

opdefObject/my_asset?Texture.png

You can also use opdef:.?section (to get a file from the current asset) and opdef:..?section (to get a file from the parent of the current node). For example, if you have a File node directly inside an asset, you can load a geometry file from the asset using:

opdef:..?test.bgeo

Note that relative opdef: may not work in all places. For example, in a shader you can say texture(“opdefShop/foo/texture.rat”) but you can’t use opdef:.. because the compiled VEX has no concept of a parent node.

Attachments:
CtoC4d2.hdalc (98.0 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
85 posts
Joined: June 2015
Offline
Thanks a lot Michael, very much appreciated :-)

It seems that where I went wrong was…. on insisting to use the MaterialShaderBuilder (despite your suggestion).

So why is it that C4D is unable to use a color from that shader, after all, after bringing it back in into Houdine as a DA, it render just fine.
The reason why I'm going through all this, is that I would like to transfer a random color to C4D trough a C4D material.
So far I was unable to find a possible way of doing this.
Maybe its not even possible at the moment?

Many thanks again,
Robert
Houdini, Cinema4D, 3Dcoat, Marvelous Designer
  • Quick Links