Python back ticks in parameters

   1200   2   0
User Avatar
Member
14 posts
Joined: 6月 2018
Offline
Hi all,

I'm trying to set the “rule” parameter in the Partition SOP to `@shop_materialpath` using Python but it does not seem to recognize the back ticks.

Any help?

Thanks.

# python partition node

obj = hou.node(“/obj”)

geo = obj.createNode('geo')
partition = geo.createNode('partition')

path = “`@shop_materialpath`”

partition.parm('rule').set(path)
Edited by GEODVS - 2020年6月16日 04:16:35
User Avatar
Member
182 posts
Joined: 4月 2009
Offline
it should work. I tried your code and the quotation marks were invalid. Try this one (made them all the same for consistency):
# python partition node

obj = hou.node('/obj')

geo = obj.createNode('geo')
partition = geo.createNode('partition')

path = '`@shop_materialpath`'

partition.parm('rule').set(path)
User Avatar
Member
14 posts
Joined: 6月 2018
Offline
Hey Thanks a lot Mariusz.

It seems to work as a shelf tool but it does not work with a Python SOP , HDA nor a NULL with a custom Python script.
Please give it a try if you can?

Thanks for picking up the inconsistency with the " and '.

Appreciate you looking into it.
  • Quick Links