[Sidefx-houdini-list] Python expression in a group sop

Mark Elendt mark at sidefx.com
Wed Apr 22 07:36:35 EDT 2009


On Wednesday Apr 22 at 12:30, Simon Barrick wrote:
>  Does anyone know how to get python expressions to evaluate in a group
> sop?
> 
> I have this expression that pulls a name from a path 
> 
> os.path.split(hou.pwd().parent().parm('file').eval())[1].split('.')[0]
> 
> But when I stick it in the Group Name field it won't actually evaluate.
> 
> Also, I'm having to use os.path which may not be available without
> importing 'os' so is there a hou way of doing this?

You might try something like:

    pythonexprs("__import__('os').path.split(...)")

Though that might be insanely expensive.

It might be better to create a python function which builds the
pattern string for you.

-- 
Mark Elendt




More information about the Sidefx-houdini-list mailing list