Hello,
I'm trying to set a parameter of a string in Python like this:
hou.parm('/obj/global/textb').set(“obj001_001.$F3.png”)
…but the result is this:
obj001_001.001.png
…so it seems to be using the result of the expression instead of using “$F3” instead like this:
obj001_001.$F3.png
How should I format the .set() parameter so it shows “$F3” instead of “001”?
Thank you!
Python file padding issue
2794 8 0-
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
-
- jsmack
- Member
- 8123 posts
- Joined: Sept. 2011
- Offline
-
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
-
- graham
- Member
- 1925 posts
- Joined: Nov. 2006
- Offline
What you are doing is correct. I have no problems running a hou.Parm.set(“foo.$F4.bgeo”) on a string parameter and getting the expected value in the interface field:
>>> hou.parm('/obj/geo1/font1/text').set("foo.$F4.bgeo") >>> hou.parm('/obj/geo1/font1/text').unexpandedString() 'foo.$F4.bgeo'
Graham Thompson, Technical Artist @ Rockstar Games
-
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
hmmm. What I've done was “Edit parameter interface” of a Null named “global”, then added a string parameter named “textb”. The result of my python call is not the same result as yours(the “$F4”), my result is the expanded string (“001”). FYI the python call is in the Post-Render Script of an OpenGL ROP; not sure if that matters. (i tried adding screenshots but it wouldn't take)
Edited by caesar - March 21, 2017 21:07:09
-
- jsmack
- Member
- 8123 posts
- Joined: Sept. 2011
- Offline
-
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
-
- jsmack
- Member
- 8123 posts
- Joined: Sept. 2011
- Offline
-
- caesar
- Member
- 143 posts
- Joined: March 2014
- Offline
-
- Quick Links