This script aims to read folders that contain blend files, display the content in a list of elements that may be imported. Useful to save custom node setups, materials or objects that will be reuse in other files.
The folders of the blend files are stored either in the addon preferences or in the settings tab of the tool shelf.
Folder paths are available for:
compositing node groups
shading node groups
texture node groups
materials
objects
groups
Addon preferences
The paths set in addon preferences are accessible in every files and can be set once.
Custom paths
The paths can also be set in the Settings tab of the Tool Shelf. This can be save with the blend file. The paths set in the addon preferences can still be used if the Use custom paths checkbox is off.
3D View
The Tool Shelf of the 3D view gives access to the library for:
Thanks, very very useful
I have 2 things:
1.groups are placed on 3d cursor, objects not , i think the objects should be placed on 3d cursor too, for fast placing on desire spot
2.after appending object in scene my materials are lost, when source materials was linked, i also think it shouldn’t be …
What do you mean? a blend file is already a file that can contain everything.
Indeed, I don’t understand why the groups uses the cursor and the objects not, this is the same python command. I will take a look. But you gave me an idea : have a checkbox “use cursor”. It should be possible.
I tried it with object that has linked material and it is appended correctly with the material, so I don’t understand what is your issue.
I have discovered it: if file with source material is not in your directory, linked material is lost.
When object is in your directory but linked material is not.
Normallly it doesn’t matter where source file with linked material is, in this case it is problem …
Try solve it please, I cannot copy all blend files into your directory.
I can’t reproduce this issue. Do you have errors in the terminal?
What is your OS? I tried the script only on Linux and Windows, so I don’t know what append with MacOS path system. But anyway, I’m using the only python command of the Blender API to append or link datablocks, nothing more. If this is the issue, maybe it should be report in the bug tracker but it’s hard to say if I can’t reproduce it.
Try maybe to reproduce it in simple files with all link in relative and sent it to me. I will take a look.
I have old PC, new PC, and NB, all windows, and this problem is on all of these.
I sent TEST file, Try please set “OBJECTS LIBRARY” as object directory in your plugin.
File: “cylinder with linked red color.blend” has linked material from “source red cube.blend” file.
But if you want use “Cylinder” object into new scene with your plugin, linked red material will be lost,
because “source red cube.blend” file is out “OBJECTS LIBRARY” directory
English is not my native language and i can’t explain it better.
thanks
I explained myself badly,
I have a file which I put in the blender to link other object files from different directories,
I would like to have a comand “to pack in zip file” going to look for all things linked
that the copy in a directory path as putting on, so if I want to
flounder around the zip file to someone or a render farm, nothing is missing
is mossibile change your script to do this?
Thanks;-)
Ok I get it. Actually, it’s working well on Linux but not on Windows where the material is lost. I don’t know why… I will try to solve that. Weird!
Mmh, this is not really the goal of the script when I started it. But I’m sure that a script that does what you’re looking for exists. Something that makes the linked objects local. Maybe even directly in the normal Blender tools? Does anyone know that?
I’d like to add in the future the choice between global paths like it is right now and project paths that would be all in relative. It should be nice but I think it’s one of the the plan for the Gooseberry project to include an asset manager, so that’s not very useful right now to dive into it, they will do much much better!
The goal of my script is more to extend the Blender’s tools quickly with nodes, shaders, meshes, materials, etc. that you have created or downloaded and simple paste in a folder.
hi. great addon. but it does not work for me. After giving him the path for objects and groups, I tried to append an object. so, I hit the button for the updating the object list, and it updated it right. However, then I hit the append button and it gave me this error:
Traceback (most recent call last):
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\addons_extern\blender_library.py”, line 566, in execute
import_from_library(datablock=“Object”, folderpath=folderpath, file=filename, selected=object_selected, link=False)
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\addons_extern\blender_library.py”, line 158, in import_from_library
bpy.ops.wm.link(directory=folderpath+"//"+file+"/"+datablock+"/", filepath="//"+file+"/"+datablock+"/"+selected, filename=selected, link=link)
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\modules\bpy\ops.py”, line 188, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator “bpy.ops.wm.link” error, could not be found
location: <unknown location>:-1
I hope you will solve it, thanks again.
hi. great addon. but it does not work for me. After giving him the path for objects and groups, I tried to append an object. so, I hit the button for the updating the object list, and it updated it right. However, then I hit the append button and it gave me this error:
Traceback (most recent call last):
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\addons_extern\blender_library.py”, line 566, in execute
import_from_library(datablock=“Object”, folderpath=folderpath, file=filename, selected=object_selected, link=False)
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\addons_extern\blender_library.py”, line 158, in import_from_library
bpy.ops.wm.link(directory=folderpath+"//"+file+"/"+datablock+"/", filepath="//"+file+"/"+datablock+"/"+selected, filename=selected, link=link)
File “C:\Program Files\Blender\2.70a\blender-2.70a-windows32\2.70\scripts\modules\bpy\ops.py”, line 188, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator “bpy.ops.wm.link” error, could not be found
location: <unknown location>:-1
I hope you will solve it, thanks again.
Ok I get it. Actually, it’s working well on Linux but not on Windows where the material is lost. I don’t know why… I will try to solve that. Weird![/QUOTE]
I don’t know why but it works on Windows only if the path of the linked material is absolute. I don’t know if this is a bug of Blender’s API or if I did something wrong. On Linux, no problem at all with absolute or relative path. If someone has an idea, please tell me.
If you want to use the script, you can convert your paths to absolute (File > External Data > Make all paths absolute). I know this is not perfect but I it should work correctly on Windows.
Hi VincentG, this is great add-on. Thanks for sharing this. Do you have any repo for this add-on, so I can fork/contribute? I have build similar things, but yours seems more mature