any way to switch rgbimage of sequence by attribute

Houdini Integrated Plugin

Moderator: juanjgon

Post Reply
LLLOtoy
Licensed Customer
Posts: 34
Joined: Tue Jul 19, 2016 11:13 am

is there any possible way to switch numbering of an image sequence inside an rgbimage node´s filename parameter by a vertex attribute?
e.g. it´s perfectly possible to do something like
C:/filename_`padzero(3,$F)`.tga
for shure, but how to use an attribute instead of "$F"?

any ideas highly welcome!
& many thanks in advance!!

OSL is not working for this right? As i would need to select out of 50+ images

best

jn
LLLOtoy
Licensed Customer
Posts: 34
Joined: Tue Jul 19, 2016 11:13 am

i now have part of the solution,

i got an OSL Texture shader to display one image out of a sequence, triggered by a value,
as shown in the screenshot
but when i plug in a vertex attribute with the same value it stops working ...

but WHY?
Screenshot 2022-04-10 101737.png
Screenshot 2022-04-10 102134.png

(i used a vector value because i learned that osl doesn´t understand float vertex input somehow)

and also there seems to be no string format() function in OCTANE OSL ...!?!
i tried the following instead of using the hscript index-replacement, but with no success:
format("$HIP/FOOTAGE/seq/test_%i.png",int(idx[0]));

many thanks for any ideas!!

best

jn
User avatar
juanjgon
Octane Plugin Developer
Posts: 8867
Joined: Tue Jan 19, 2010 12:01 pm
Location: Spain

Sorry, currently Octane doesn't support string attributes, and I'm not even sure if OSL supports input parameters from attributes. Perhaps you could create an OSL shader including all your texture files and a float input to select them from a float attribute, but as I've said you should check if OSL supports inputs from attributes, I'm not sure about this right now.

Thanks,
-Juanjo
LLLOtoy
Licensed Customer
Posts: 34
Joined: Tue Jul 19, 2016 11:13 am

hi juanjo,

thanks for your reply!
i think you`re right,... load all tex into osl and then select by attrib should work...

by now i can tell that vertex attribs work in osl but only VECTOR not float (don`t know why)..
as in the following setup:

shader OSLTexture(
color a=0,
color b=0,
color c=0,
color index = 0,
output color out = 0
){
color indx[3] = {a,b,c};
out = indx[int(index[0]*3)];
}


best

jan
Attachments
Screenshot 2022-04-11 114035.png
Post Reply

Return to “Houdini”