Is there a way to iterate all sub-files inside a .blend file's directories? - blender

So my end goal is to link all brushes from one blend file into another via a script. I know I can link one brush by using the following:
bpy.ops.wm.link(directory="F:/Blender/Scenes/brushes.blend/Brush", filename="CustomBrushForImport")
I also know I can iterate through a folder of files by using the following in python (currently using print so I can visualize what's happening in console)
for filename in os.listdir(testDirectory):
print (filename)
AFAIK (from what I've tried), I cannot use os.listdir to access anything inside the .blend file (i.e. F:/Blender/Scenes/brushes.blend/Brush), but I don't know of any other functions that operate similarly but for this unique sub-directory. Is there some way to do the same method, or should I just look at creating a list of brushes instead and checking for those brushes inside the .blend file?
Thanks!

Related

Always show the file extension inside the folder using vb.net

Currently, I am working on an application that will need to always show the file extensions of the files inside the folder.
Example:
I have a folder named Awards and the Contents are Images.
Contents:
As you can see, the file extension is hidden.
But when you click the options red boxed on the image. the file extension will be shown.
My question is, Is there a way to check the checkbox on the Image using vb.net? If it is possible? How??
Thank you and Regards,

How to use ctags for code documentation

I have some source code that I want to document without touching the code. For every source file (e.g., example.cpp, example.f90, etc.) I would like to have a separate documentation file (e.g., example.cpp.doc, example.f90.doc) that has some metadata (ctag) linking it to the original source file.
Ideally I could open the source file and the documentation file in parallel views in my favorite editor (ViM) and have the two files synced so that they scroll together. In this manner, I can keep my documentation visually inline with the un-touched source code.
I know this is likely to be a unique scenario. But I'm hoping someone else has already figured this out.
Is this even a possibility?
Create the initial .doc structure outside of Vim such that the "metadata" you want to keep is in the same line number as the original file.
Then open the two files in different Vim windows with vim -O example.cpp example.cpp.doc. At this point use :windo set scrollbind to enable scroll binding, which will allow to navigate any of the windows while keeping both in sync.

Edit .blend file's Text only

http://www.blendswap.com/blends/view/73614
I have downloaded this and want to use my own text on it using Blender (or another program). It is not used for commercial purpose. When I open it, I get no option to edit text. I tried edit external and GIMP which failed.
the .blend file is binary and can only be opened inside of Blender, When you create text objects they are displayed as objects inside blender. You should be able to find the object by using the object browser section inside blender and changing it there. You may have to recreate the text object depending on how the author did the original.

Passing files selected in project views to external tools

Is it possible to pass paths to all files currently selected in the project view to an external tool?
I know you can use the $FilePath$ macro but it only seems to pass the path to the first selected file ignoring the rest and no other macro seems suitable. A workaround would also be using all the files from the parent directory, but that's not feasible in my case.
It's not possible right now, please vote for this feature request.

How do I put a listing of files into a menu?

I have a folder with .txt files in it. How can i make my menuitem get those .txt files and put the filenames in the menuitem, so that it creates a list of all .txt files in that folder.
So when i put a .txt in the folder the program automatically creates the menu item.
Does someone knows how to do this, or perhaps an example?
Unless you're using ASP.Net, you're looking for the FileSystemWatcher and Directory classes.
Basically, you need to call Directory.GetFiles and loop through the results creating MenuItems.
Then, handle the FileSystemWatcher events and either rebuild the menu from scratch (simpler) or update the appropriate item (faster)