Page MenuHome

FBX export: Embedding textures does not work
Closed, ResolvedPublic

Description

The attached blend file has a packed texture. If I try to use the Embed Texture option, the exporter try's to call open on it's path (textures\mohogany_light.jpg) instead of grabbing the packed data from bpy. If you unpack the data, the path is still wrong since the "" for a relative path is a Blender thing that Python doesn't recognized. In other words, the Embed Texture isn't using a cleaned path for the open() call. And, in the warning, "embeding" should be "embedding."

Details

Type
Bug

Event Timeline

Mitchell Stokes (moguri) set Type to Bug.
Mitchell Stokes (moguri) created this task.
Mitchell Stokes (moguri) raised the priority of this task from to Needs Triage by Developer.
Bastien Montagne (mont29) triaged this task as Normal priority.May 21 2014, 10:43 PM

Committed changes in rBAdb6e3acd34cdbb74.

Still needs to be really tested, not quite sure this is working (my VM with Unity is kind of broken again, and FBX Converter seems to ignore our embedded textures :/).

Will disable this (optional) feature before release in case I can’t get it working in time.

The option works when exporting to Unity, but UDK doesn't seem to work to well with it. But, I'll just blame that on UDK. Packed texture still don't work, I get the following error when I try:

FBX export starting... 'D:\\Documents\\ExportTest\\Assets\\TCube.fbx'
Traceback (most recent call last):
  File "D:\blender\2.70\scripts\addons\io_scene_fbx\__init__.py", line 417, in execute
    return export_fbx_bin.save(self, context, **keywords)
  File "D:\blender\2.70\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2571, in save
    ret = save_single(operator, context.scene, filepath, **kwargs_mod)
  File "D:\blender\2.70\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2502, in save_single
    fbx_objects_elements(root, scene_data)
  File "D:\blender\2.70\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 2380, in fbx_objects_elements
    fbx_data_video_elements(objects, vid, scene_data)
  File "D:\blender\2.70\scripts\addons\io_scene_fbx\export_fbx_bin.py", line 1200, in fbx_data_video_elements
    elem_data_single_bytes(fbx_vid, b"Content", vid.packed_file.data)
AttributeError: 'PackedFile' object has no attribute 'data'

Here is a simplified file (the texture should be packed):

Okay, looks like UDK works if I embed a texture with an image format it likes.

Hu, 'data' is a whole new prop I had to add to PackedFile today, so you’ll have to test it with current master (rB7ab602b730 or newer). ;)

Okay, I'll test it when the build bot next updates (I don't have build tools setup on this machine).

Bastien Montagne (mont29) closed this task as Resolved.May 24 2014, 3:22 PM

Would assume this one is fixed for now (99.99% sure it is :P), we can always reopen if not.

Just confirming that the Embed Texture option works with packed textures with a new enough build.