wm.link_append() never appends despite link=False #38924

Closed
opened 2014-03-03 01:32:59 +01:00 by CodeManX · 14 comments
Member

System Information
Windows 7

Blender Version
Broken: 2.69 (and at least 2.67, 2.65, 2.57)

Short description of error
bpy.ops.wm.link_append() called from script ignores the link-argument and always links. If you try it with a scene, you can't even make it local in UI afterwards. It works fine via File / Link/Append

Exact steps for others to reproduce the error

Example code:

import bpy

bpy.ops.wm.link_append(
filepath= "//slave.blend",
filename= "Scene",
directory= "C:/Program Files/Blender Foundation/slave.blend/Scene/",
link=False,
relative_path=True)
**System Information** Windows 7 **Blender Version** Broken: 2.69 (and at least 2.67, 2.65, 2.57) **Short description of error** `bpy.ops.wm.link_append()` called from script ignores the link-argument and always links. If you try it with a scene, you can't even make it local in UI afterwards. It works fine via *File / Link/Append* **Exact steps for others to reproduce the error** Example code: ``` import bpy bpy.ops.wm.link_append( filepath= "//slave.blend", filename= "Scene", directory= "C:/Program Files/Blender Foundation/slave.blend/Scene/", link=False, relative_path=True) ```
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX
Author
Member

This was actually reported earlier, but closed as invalid:

https://developer.blender.org/T30172

It might be platform-specific.

This was actually reported earlier, but closed as invalid: https://developer.blender.org/T30172 It might be platform-specific.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

I tried this and link option is respect as it is from running the operator directly.

Could you upload sample blend files which fail?

Also possible (but unlikely) a bug for ms-windows, tested on 64bit Linux.

Not being able to make local looks like a real bug though, checking on that
correction - its not implemented. id_make_local

I tried this and `link` option is respect as it is from running the operator directly. Could you upload sample blend files which fail? Also possible (but unlikely) a bug for ms-windows, tested on 64bit Linux. Not being able to make local looks like a real bug though, checking on that **correction** - its not implemented. `id_make_local`

Note that using bpy.ops.wm.link_append from python is quite limited, we have an API for linking which lets you inspect data in the blend file.

http://www.blender.org/documentation/blender_python_api_2_69_release/bpy.types.BlendDataLibraries.html

Note that using `bpy.ops.wm.link_append` from python is quite limited, we have an API for linking which lets you inspect data in the blend file. http://www.blender.org/documentation/blender_python_api_2_69_release/bpy.types.BlendDataLibraries.html
Author
Member

It is indeed a Windows problem, it occurs if a Blender path with slashes is used:

     
  # Fails to append
    bpy.ops.wm.link_append(filepath="//Scene", directory="D:/append.blend/Scene/", filename="Scene", link=False)

  # Appends successfully
    bpy.ops.wm.link_append(filepath="//Scene", directory="D:\\append.blend/Scene/", filename="Scene", link=False)

A standard Windows path with backslashes works.

It is indeed a Windows problem, it occurs if a Blender path with slashes is used: ``` ``` # Fails to append ``` bpy.ops.wm.link_append(filepath="//Scene", directory="D:/append.blend/Scene/", filename="Scene", link=False) ``` # Appends successfully ``` bpy.ops.wm.link_append(filepath="//Scene", directory="D:\\append.blend/Scene/", filename="Scene", link=False) ``` A standard Windows path with backslashes works.

This should be made to work (or at least give some error on invalid args),
but since theres already a python api for this and it only fails when called with incorrect args, Id postpone any changes here until after 2.70

This should be made to work (or at least give some error on invalid args), but since theres already a python api for this and it only fails when called with incorrect args, Id postpone any changes here until after 2.70
Campbell Barton was assigned by Sergey Sharybin 2014-04-10 19:12:08 +02:00

Added subscriber: @Sergey

Added subscriber: @Sergey

@ideasman42, mind looking into the fix?

@ideasman42, mind looking into the fix?

This issue was referenced by blender/blender-addons-contrib@1eb1351976

This issue was referenced by blender/blender-addons-contrib@1eb13519768f5735c9931fec0da07d92155796f1

This issue was referenced by blender/blender@1eb1351976

This issue was referenced by blender/blender@1eb13519768f5735c9931fec0da07d92155796f1

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit blender/blender@1eb1351976.

Closed by commit blender/blender@1eb1351976.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#38924
No description provided.