krill krill

veritasone

About Me

EXPERTISE
Freelancer

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

IMG File node tries to pad/complete generated file names automatically Sept. 28, 2016, 6:06 p.m.

I got bitten by the misleading python error. The error made it look like it was trying to find bunch of files but not able to find it. In reality I was feeding only a single result from Python. So that is why the error line was showing it with the glob pattern which is weird. Why would the Python interpreter tell me that it cant find bunch of files instead of it cant find the evaluated file?


The second issue is the slashes. The file node does not windows slashes at all. Every other node thjat I plug this code in did not have a problem with the backslashes except the file node in the IMG context. So basically the file node wants only the linux slashes in the path encoding.

IMG File node tries to pad/complete generated file names automatically Sept. 28, 2016, 12:06 a.m.

A bit more digging.

Any kind of expression evaluation be it python or simple hscript (`chs(“/out/mantra_OUT/obj_name”)`_$F.exr) in the file name makes the file node to do this crazy globbing. I cant get around it.

Maybe it is not trying to glob, just trying to tell me it is not finding the file but the file and the path is correct. Maybe the evaluated text is not passsed to the node properly?

My suspicion is tha ttrying to write a text that looks like a Windows path does not work in the node.

I am on Windows

IMG File node tries to pad/complete generated file names automatically Sept. 27, 2016, 11:29 p.m.

Hi

I have been going nuts here to see what was going on when I was trying to generate file names to load in the IMG context

Here is what I have in the File's file channel

 
if os.path.isdir(finalfolder):
    return finalcomppath
    
else:
    os.mkdir(finalfolder)
    return finalcomppath


The problem is that the file node throws an error that goes like this

Can not find “……/myfile_*.exr”



Now I do not know why the node does not respect the python evalutation and tries to pad or glob the file name like this. As you see it is trying to replace the numbers with glob pattern. I tried different name numbers combinations and it tried to glob the numbers in the names in all cases.


The file name would be something like this “myfile_1.exr”…“”myfile_20.exr" . The finalcomppath is correct which is like finalfolder\myfile_1.exr

I am using the same code pretty much in the mantra node and there is no problem there, it renders and saves the image.

The weird thing is that the string in the file name channel is evaluated/rendered correctly. Somehow internally it is doing that pattern replacement.