FBX export: Embedding textures does not work #40303

Closed
opened 2014-05-21 22:33:28 +02:00 by Mitchell Stokes · 11 comments

furniture.blend

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

[furniture.blend](https://archive.blender.org/developer/F89627/furniture.blend) 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."
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Bastien Montagne was assigned by Mitchell Stokes 2014-05-21 22:33:28 +02:00
Author
Member

Added subscriber: @Moguri

Added subscriber: @Moguri

Committed changes in db6e3acd34.

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.

Committed changes in db6e3acd34. 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.
Author
Member

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):
embed_tex_export.blend

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): [embed_tex_export.blend](https://archive.blender.org/developer/F89759/embed_tex_export.blend)
Author
Member

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

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 (blender/blender@7ab602b730 or newer). ;)

Hu, 'data' is a whole new prop I had to add to PackedFile today, so you’ll have to test it with current master (blender/blender@7ab602b730 or newer). ;)
Author
Member

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

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

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

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

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

Fixed by db6e3acd34, btw.

Fixed by db6e3acd34, btw.
Author
Member

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

Just confirming that the Embed Texture option works with packed textures with a new enough build.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#40303
No description provided.