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.
Found 12 posts.
Search results Show results as topic list.
Technical Discussion » IMG File node tries to pad/complete generated file names automatically
- veritasone
- 12 posts
- Offline
Technical Discussion » IMG File node tries to pad/complete generated file names automatically
- veritasone
- 12 posts
- Offline
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
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
Edited by veritasone - Sept. 28, 2016 00:35:39
Technical Discussion » IMG File node tries to pad/complete generated file names automatically
- veritasone
- 12 posts
- Offline
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
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.
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.
Edited by veritasone - Sept. 27, 2016 23:58:56
Houdini Learning Materials » Documentation
- veritasone
- 12 posts
- Offline
I second this. I want to be able to put the help stuff on my tablet for offline use.
thanks
thanks
Technical Discussion » How do i create an attribute inside Python Sop?
- veritasone
- 12 posts
- Offline
@tamte
Thanks, that makes perfect sense and your solution works. However I have couple issues with adding attr in Python .
- It also creates “varmap” along with what I am trying to create. I understand that this must be the local vairable name but why does not create with the name I gave it? How do I access that “varmap” to change the name.
- It also does not set the value I give in the command, if the given value is a text entry (the entry in the spreadsheet is empty. For instance
I have to add another command to modify the value for the actual thing with this
Not a big deal but I wonder if it is a bug or the initial command parsing cant decide on the type of the variable (unlike what the doc says about it)
Thanks, that makes perfect sense and your solution works. However I have couple issues with adding attr in Python .
- It also creates “varmap” along with what I am trying to create. I understand that this must be the local vairable name but why does not create with the name I gave it? How do I access that “varmap” to change the name.
- It also does not set the value I give in the command, if the given value is a text entry (the entry in the spreadsheet is empty. For instance
geo.addAttrib(hou.attribType.Global, "test", "string test")
I have to add another command to modify the value for the actual thing with this
geo.setGlobalAttribValue("test", "string test")
Not a big deal but I wonder if it is a bug or the initial command parsing cant decide on the type of the variable (unlike what the doc says about it)
tamte
in Python SOP you can only modify current geometry, it doesn't have permissions to change geometry of other nodes like in your example
so you can only do this:node = hou.pwd() geo = node.geometry() geo.addAttrib(hou.attribType.Global, "test", 1)
and connect your /obj/surface/file as a first input of Python SOP
Edited by veritasone - Sept. 25, 2016 18:41:39
Technical Discussion » How do i create an attribute inside Python Sop?
- veritasone
- 12 posts
- Offline
node = hou.node('/obj/surface/file')
geo = node.geometry()
geo.addAttrib(hou.attribType.Global,“test”,1)
this gives me
return _hou.Geometry_addAttrib(*args)
GeometryPermissionError: Geometry is read-only
And the error code is not much helpful.
thanks
geo = node.geometry()
geo.addAttrib(hou.attribType.Global,“test”,1)
this gives me
return _hou.Geometry_addAttrib(*args)
GeometryPermissionError: Geometry is read-only
And the error code is not much helpful.
thanks
Technical Discussion » I cant use the Render preview tab when I duplicate a desktop
- veritasone
- 12 posts
- Offline
Something to do with tabs. If I randomly click on bunch of tabs and come back to the render tab it works again.
I am not able to produce this with certain steps, but I know that trying to change to a ssaved desktop causes ti for most of the time. I will file a bug when I can repeat it.
I am not able to produce this with certain steps, but I know that trying to change to a ssaved desktop causes ti for most of the time. I will file a bug when I can repeat it.
Houdini Lounge » FORUM DARK THEME
- veritasone
- 12 posts
- Offline
Thank you so much for this.
I hate how the whole web is so white as if producing “light” is cheap and as if pure directed bright white lights is good for your eyes. I wish every website made an effort to offer alternatives like SideFX forum did.
Good job
I hate how the whole web is so white as if producing “light” is cheap and as if pure directed bright white lights is good for your eyes. I wish every website made an effort to offer alternatives like SideFX forum did.
Good job
Houdini Lounge » Underscore? Sad face :(
- veritasone
- 12 posts
- Offline
Hi
I missed the huge jump between H12 annd H15. So I am trying to get used to the new stuff. There are alot of great additions, except a desicion that is made by SideFx which makes me a sad face everytime I see one of these.
First of all I am sorry if this a dead horse issue.
@MyC=@opinput1_Cd;
This is a sad choice for the syntax because the underscore char is a widely used character for naming stuff(especially to replace “ ” space char to make it cross platform) and it is definetely not a scripting contextual look. Now maybe this is my personal taste but lets follow some imaginary examples.
Please decide for yourself about which one looks more like a scripting context
(original)
(alternatives)
To me the original syntax looks the least attractive one as a scripting syntax because of the choice of that char.
Lets make it ugly
@My_Beautiful_Attribute_Parm=@opinput1_This_is_an_incoming_attrb;
I hope that SideFx reverts this desicion and come up with something better.
I missed the huge jump between H12 annd H15. So I am trying to get used to the new stuff. There are alot of great additions, except a desicion that is made by SideFx which makes me a sad face everytime I see one of these.
First of all I am sorry if this a dead horse issue.
@MyC=@opinput1_Cd;
This is a sad choice for the syntax because the underscore char is a widely used character for naming stuff(especially to replace “ ” space char to make it cross platform) and it is definetely not a scripting contextual look. Now maybe this is my personal taste but lets follow some imaginary examples.
Please decide for yourself about which one looks more like a scripting context
(original)
@MyC=@opinput1_Cd;
(alternatives)
@MyC=@opinput1->Cd;
@MyC=@opinput1.Cd;
@MyC=@opinput1[Cd];
@MyC=@opinput1(Cd);
@MyC=@opinput1:Cd;
@MyC=@opinput1&Cd;
@MyC=@opinput1#Cd;
@MyC=@opinput1\\Cd;
@MyC=@opinput1^^Cd;
@MyC=@opinput1_>Cd;
To me the original syntax looks the least attractive one as a scripting syntax because of the choice of that char.
Lets make it ugly
@My_Beautiful_Attribute_Parm=@opinput1_This_is_an_incoming_attrb;
I hope that SideFx reverts this desicion and come up with something better.
Edited by veritasone - Sept. 23, 2016 23:03:29
Technical Discussion » I cant use the Render preview tab when I duplicate a desktop
- veritasone
- 12 posts
- Offline
ajz3d
I'm frequently running into this bug if I use a custom desktop. Mantra displays “Generating Scene…” message that lasts forever.
If that happens, then in order to render anything I need to restart Houdini Indie and set desktop to one of the defaults, like Build. Then it works.
Yeah that is what I have too ;(
Houdini Lounge » Diffusion Limited Aggregation
- veritasone
- 12 posts
- Offline
Technical Discussion » I cant use the Render preview tab when I duplicate a desktop
- veritasone
- 12 posts
- Offline
Hi
Whenever I duplicate the standard Build desktop as Build2, the Render View tab does not work probably. It keeps saying “Generating Scene” and it nnever makes the preview at all. I go back to “Build” my preview is working fine.
What is happening here?
thanks
Whenever I duplicate the standard Build desktop as Build2, the Render View tab does not work probably. It keeps saying “Generating Scene” and it nnever makes the preview at all. I go back to “Build” my preview is working fine.
What is happening here?
thanks
-
- Quick Links