Jump to content

Passing Python string to hou.hscript....?


CiaranM

Recommended Posts

Hi,

is it possible to pass a python string as one of the arguments to an hscript command called through hou.hscript?

I'm calling the hscript command fbximport, which AFAIK has no Python equivalent. So how can I get the path argument from the rest of my code into the hscript command?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

Im trying to batch import a lot of fbx files.

Could you elaborate on how you pass the path argument to the hscript command.

So far I think it's the only thing I'm missing ...


import os
directory = "//xxxxxxx/fbx/"
listFiles = os.listdir(directory)
for fbx in listFiles :
fbxFullPath = directory+fbx
print fbxFullPath
hou.hscript("fbximport fbxFullPath")
[/CODE]

thx for you help

Edited by ben
Link to comment
Share on other sites

ok, get it ! Big string as you said...

for the record :

import os

directory = "//xxxxxxx/fbx/"

listFiles = os.listdir(directory)

for fbx in listFiles :

fbxFullPath = directory+fbx

print fbxFullPath

command = "fbximport "+fbxFullPath

hou.hscript(command)

Edited by ben
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...