Running save_as_mainfile breaks relative texture paths #33108

Closed
opened 2012-11-06 21:54:20 +01:00 by Ragnar Brynjúlfsson · 4 comments

Relates to: #32734

%%%When running save_as_mainfile, the relative texture paths for Cycles textures get changed to a invalid paths.

How to recreate:

  1. Download the attached sample.tar.gz, unpack and open the project/shot/sample.blend file.
  2. Hit F12 to render, you should get a plane with a picture on it.
  3. Run the following in the python console (replace /tmp path with something else if you're on Windows)
bpy.ops.wm.save_as_mainfile(filepath="/tmp/foo.blend", copy=True, relative_remap=True) 
  1. Hit F12 to re-render, and you get a purple plane where there used to be a picture.

The /tmp/foo.blend file that is saved out has working texture paths, but not the original one. In the original file the texture path has gone from:

//../txtr/kermit.jpg

 to

//../home/ragtag/project/txtr/kermit.jpg

Alternately, if you set relative_remap to False, the reverse is true. Your original file remains intact, but the texture paths in the copy file (/tmp/foo.blend) are broken.

Tested using both official release blender-2.64a-linux-glibc27-x86_64 and blender-2.64-r51699-linux-glibc27-x86_64 on Ubuntu 12.04 64-bit using AMD Radeon HD 5800 graphix card.

Bug #32734 seems like it might possibly be related.

Note that this only happens with Cycles textures, not Blender Internal Render textures.
%%%

**Relates to**: #32734 %%%When running save_as_mainfile, the relative texture paths for Cycles textures get changed to a invalid paths. How to recreate: 1. Download the attached sample.tar.gz, unpack and open the project/shot/sample.blend file. 2. Hit F12 to render, you should get a plane with a picture on it. 3. Run the following in the python console (replace /tmp path with something else if you're on Windows) ``` bpy.ops.wm.save_as_mainfile(filepath="/tmp/foo.blend", copy=True, relative_remap=True) ``` 4. Hit F12 to re-render, and you get a purple plane where there used to be a picture. The /tmp/foo.blend file that is saved out has working texture paths, but not the original one. In the original file the texture path has gone from: //../txtr/kermit.jpg ``` to ``` //../home/ragtag/project/txtr/kermit.jpg Alternately, if you set relative_remap to False, the reverse is true. Your original file remains intact, but the texture paths in the copy file (/tmp/foo.blend) are broken. - Tested using both official release blender-2.64a-linux-glibc27-x86_64 and blender-2.64-r51699-linux-glibc27-x86_64 on Ubuntu 12.04 64-bit using AMD Radeon HD 5800 graphix card. Bug #32734 seems like it might possibly be related. Note that this only happens with Cycles textures, not Blender Internal Render textures. %%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%fixed r51963.%%%

%%%fixed r51963.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @JonasEschenburg

Added subscriber: @JonasEschenburg
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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#33108
No description provided.