Page MenuHome

wm.link_append() never appends despite link=False
Closed, ResolvedPublic

Description

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)

Event Timeline

codemanx created this task.Mar 3 2014, 1:32 AM
codemanx raised the priority of this task from to 90.
codemanx updated the task description. (Show Details)
codemanx edited a custom field.
codemanx added a subscriber: codemanx.

This was actually reported earlier, but closed as invalid:

https://developer.blender.org/T30172

It might be platform-specific.

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

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Low.Mar 3 2014, 6:00 AM
codemanx added a comment.EditedMar 3 2014, 2:27 PM

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

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.Apr 25 2014, 10:44 AM

Closed by commit rB1eb13519768f.