Jump to content

Embed Texture in FBX


emilguder

Recommended Posts

Hey guys,

I am trying to create a workflow with which it is possible to embed texture image files in a FBX. I know that I will probably have to write a python script to do so. Maybe one of you has already done anything like that and could help me out?

Regards, Emil

Edited by emilguder
Link to comment
Share on other sites

  • 3 weeks later...

I've build a post-render script in the fbx ROP. I export the file as name_temp.fbx and the script takes the name and builds the processing string.
I've used the autodesk fbx exporter that's freely available. Here's the code in my HDA pythonModule that I call in the script field.

def convertFBX(exe, tempfile, finalfile):
    
    # FBX_CNVRT = 'C:\\Program Files\\Autodesk\\FBX\\FBX Converter\\2013.3\\bin\\FbxConverter.exe'
    
    if exe != '' and tempfile != '' and finalfile != '':
        #print(arg)
        subprocess.call([exe, tempfile, finalfile, '/e'])
        if os.path.isfile(tempfile):
            os.remove(tempfile)

        #with open('Z:\\projects\\T3D_Scanner\\01_settings\\houdini\\convertFBX.log', 'a') as f:
        #    f.write('{} : {}\n'.format(datetime.datetime.utcnow(), arg))
        #    f.close()

    else:
        print('Not enough args, need old name and new name')

 

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