Jump to content

Loading multiple image textures from csv file


Recommended Posts

Hello everyone!

I am trying to load 1000 images from my disk to a geometry node consisting of 1000 grid planes. The paths of the images are inside a csv file, which I handle with a table import node. In the table import I create a point attribute named "path" which contains the content of the correct column of the csv file. I generate the geometry with a copy stamp node. In the copy stamp node I create a variable named as textureident = $PT. I use this variable in order to call the different textures with an attribute I create named "textureid". The attribute has a string value, and a primitive class. In its string value I call an expression : points("../ray1", stamp("../copy2", "textureident", 1), "path") that is supposed to return the string value of the attribute "path" (generated from csv file) for each point. Afterwards I send the local variable of the texture attribute =e.g $TEXTYREID to a material SOP, where I use overrides to declare a texture. Unfortunately the function works fine, but I get a mantra error declaring that it cannot load the called texture (Unable to load texture 'points("../ray1", stamp("../copy2", "textureident", 1), "path")'). I am guessing that something goes wrong in the transfer of a point attribute ("path") to a primitive attribute ("textureid") or something is messed up with the string conversion. The texture paths must be loaded from a csv file. Any ideas?

nodesH.JPG

planesH.JPG

Link to comment
Share on other sites

for string parms you need to enclose expressions in ``

however there is no need to copystamp 

just directly copy the attribute from your points by typing 'path' into the To Primitive parm on CopyToPoints SOP

you can of course rename it afterwards to whatever is the name of the material string parameter you want to override with the content of 'path' attribute

Link to comment
Share on other sites

anim, thanks for your reply. I have tried what you suggested but the geometry appears to not have any texture at all-instead it has the red colored texture that looks like a mantra error. I am sending you some snips of the COPYToPoints SOP node, as well as the material node, the geometry spreadsheet with the format of paths, and the viewport geometry. Is it possible that the path attribute needs to be written in a different format? Or that I have to call the path primitive attribute inside the material override parameter in a different way? And finally one last question, if I manage to apply the textures to the geometry, will I be able to export the geometry as an fbx node that includes all 1000 materials?

P.S the reason I chose to work with a copystamp sop was to reference the paths with a variable enclose in ``. But some of my images are in jpeg format, whereas others ar in png format so this did not work in a path variable of the format "C:\My\Path\text`stamp("..\copy2", textureid, 0)`.jpg because it obviously could only load the images that ar of jpeg type.

 

materialSOPH.JPG

copySOPH.JPG

geometryspreadsheet.JPG

geometryH.JPG

Link to comment
Share on other sites

hard to tell from just images, but it's possible that the paths are not found, you may want to doublecheck

you can also try just renaming 'path' attribute to 'basecolor_texture' directly instead of using material override, even though that should give you the same result

 

and no, you will not most probably not get 1000 separate materials to FBX this way, I'm not very familiar with Houidini FBX export features in regards to materials, however my guess would be that it needs FBX Surface Shader SHOP and you may need to create 1000 materials with your 1000 textures using python and create shop_materialpath attribute on your grids to point to them individually

 

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...