PDG beginner here, I have a list of files in my python script, i want to create workitem or output them as attribute to process them further, please help.
Thanks!
PDG - Python list to work items
1420 4 1- Mohanpugaz
- Member
- 146 posts
- Joined: June 2016
- Offline
- mestela
- Member
- 1803 posts
- Joined: May 2006
- Offline
This should work in a python processor top:
import hou paths = [ '$HFS/houdini/pic/butterfly1.pic', '$HFS/houdini/pic/butterfly2.pic', '$HFS/houdini/pic/butterfly3.pic', '$HFS/houdini/pic/butterfly4.pic' ] for p in paths: new_item = item_holder.addWorkItem() new_item.setStringAttrib('texpath', hou.text.expandString(p))
- Mohanpugaz
- Member
- 146 posts
- Joined: June 2016
- Offline
Wow, Thanks a lot Matt. I was so close,and not aware of this function hou.text.expandString()
. I will try and get back.
. I will try and get back.
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
- mestela
- Member
- 1803 posts
- Joined: May 2006
- Offline
- Mohanpugaz
- Member
- 146 posts
- Joined: June 2016
- Offline
mestela
import hou
paths = [
'$HFS/houdini/pic/butterfly1.pic',
'$HFS/houdini/pic/butterfly2.pic',
'$HFS/houdini/pic/butterfly3.pic',
'$HFS/houdini/pic/butterfly4.pic'
]
for p in paths:
new_item = item_holder.addWorkItem()
new_item.setStringAttrib('texpath', hou.text.expandString(p))
This works perfect, the mistake I did was using the partitioner instead of the processor. silly me.
Thanks a lot for your valuable time!
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
-
- Quick Links