Jump to content

Importing FBX with Python H18.5


nbjsargent

Recommended Posts

For some reason, I simply can't get the hou.hipFile.importFBX function to work. It always sends me an error message that says 'Attempted operation failed. Cannot read file_name. I've been just experimenting with this snippet of code, trying to get it to work: 

fbx = hou.hipFile.importFBX('C:/string/path/to/file.fbx')
# Set FBX scale
fbx[0].parm('scale').set(0.01) 

# Get and print FBX nodes
listNodesFBX = fbx[0].children()
for node in listNodesFBX:
    print node

Did something change with the function in 18.5 or am I doing something wrong? 

For context, I'm just getting into coding and building my own tools in Houdini. I want to perform the same operation as File > Import FBX camera but with Python. 

Link to comment
Share on other sites

It works fine for me when I use the Python shell (18.5.408). You may want to add the merge_into_scene argument to True to make sure it imports the fbx file into your scene and not create a new file from it.

hou.hipFile.importFBX("D:/Path/To/My/FBX/file.fbx", merge_into_scene=True)

 

Cheers,

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...